pdd-cli 0.0.118__py3-none-any.whl → 0.0.121__py3-none-any.whl
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.
- pdd/__init__.py +1 -1
- pdd/agentic_bug_orchestrator.py +15 -6
- pdd/agentic_change_orchestrator.py +18 -7
- pdd/agentic_common.py +68 -40
- pdd/agentic_crash.py +2 -1
- pdd/agentic_e2e_fix_orchestrator.py +165 -9
- pdd/agentic_update.py +2 -1
- pdd/agentic_verify.py +3 -2
- pdd/auto_include.py +51 -0
- pdd/commands/analysis.py +32 -25
- pdd/commands/connect.py +69 -1
- pdd/commands/fix.py +31 -13
- pdd/commands/generate.py +5 -0
- pdd/commands/modify.py +47 -11
- pdd/commands/utility.py +12 -7
- pdd/core/cli.py +17 -4
- pdd/core/dump.py +68 -20
- pdd/fix_main.py +4 -2
- pdd/frontend/dist/assets/index-CUWd8al1.js +450 -0
- pdd/frontend/dist/index.html +1 -1
- pdd/llm_invoke.py +82 -12
- pdd/operation_log.py +342 -0
- pdd/postprocess.py +122 -100
- pdd/prompts/agentic_change_step12_create_pr_LLM.prompt +11 -2
- pdd/prompts/generate_test_LLM.prompt +0 -1
- pdd/prompts/generate_test_from_example_LLM.prompt +251 -0
- pdd/prompts/prompt_code_diff_LLM.prompt +29 -25
- pdd/server/routes/prompts.py +26 -1
- pdd/server/terminal_spawner.py +15 -7
- pdd/sync_orchestration.py +164 -147
- pdd/sync_order.py +304 -0
- pdd/update_main.py +48 -24
- {pdd_cli-0.0.118.dist-info → pdd_cli-0.0.121.dist-info}/METADATA +3 -3
- {pdd_cli-0.0.118.dist-info → pdd_cli-0.0.121.dist-info}/RECORD +37 -35
- pdd/frontend/dist/assets/index-DQ3wkeQ2.js +0 -449
- {pdd_cli-0.0.118.dist-info → pdd_cli-0.0.121.dist-info}/WHEEL +0 -0
- {pdd_cli-0.0.118.dist-info → pdd_cli-0.0.121.dist-info}/entry_points.txt +0 -0
- {pdd_cli-0.0.118.dist-info → pdd_cli-0.0.121.dist-info}/licenses/LICENSE +0 -0
- {pdd_cli-0.0.118.dist-info → pdd_cli-0.0.121.dist-info}/top_level.txt +0 -0
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
var w9=Object.defineProperty;var S9=(n,e,t)=>e in n?w9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Pt=(n,e,t)=>S9(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();var Th=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function km(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pg={exports:{}},Nu={};/**
|
|
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 bj;function Q9(){if(bj)return Nu;bj=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:n,type:r,key:a,ref:s!==void 0?s:null,props:i}}return Nu.Fragment=e,Nu.jsx=t,Nu.jsxs=t,Nu}var yj;function k9(){return yj||(yj=1,Pg.exports=Q9()),Pg.exports}var f=k9(),Ng={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 vj;function $9(){if(vj)return We;vj=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function x(X){return X===null||typeof X!="object"?null:(X=g&&X[g]||X["@@iterator"],typeof X=="function"?X:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,S={};function Q(X,D,ee){this.props=X,this.context=D,this.refs=S,this.updater=ee||v}Q.prototype.isReactComponent={},Q.prototype.setState=function(X,D){if(typeof X!="object"&&typeof X!="function"&&X!=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,X,D,"setState")},Q.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function k(){}k.prototype=Q.prototype;function $(X,D,ee){this.props=X,this.context=D,this.refs=S,this.updater=ee||v}var j=$.prototype=new k;j.constructor=$,y(j,Q.prototype),j.isPureReactComponent=!0;var T=Array.isArray;function R(){}var N={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function z(X,D,ee){var Z=ee.ref;return{$$typeof:n,type:X,key:D,ref:Z!==void 0?Z:null,props:ee}}function L(X,D){return z(X.type,D,X.props)}function E(X){return typeof X=="object"&&X!==null&&X.$$typeof===n}function V(X){var D={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(ee){return D[ee]})}var B=/\/+/g;function C(X,D){return typeof X=="object"&&X!==null&&X.key!=null?V(""+X.key):D.toString(36)}function G(X){switch(X.status){case"fulfilled":return X.value;case"rejected":throw X.reason;default:switch(typeof X.status=="string"?X.then(R,R):(X.status="pending",X.then(function(D){X.status==="pending"&&(X.status="fulfilled",X.value=D)},function(D){X.status==="pending"&&(X.status="rejected",X.reason=D)})),X.status){case"fulfilled":return X.value;case"rejected":throw X.reason}}throw X}function A(X,D,ee,Z,I){var K=typeof X;(K==="undefined"||K==="boolean")&&(X=null);var re=!1;if(X===null)re=!0;else switch(K){case"bigint":case"string":case"number":re=!0;break;case"object":switch(X.$$typeof){case n:case e:re=!0;break;case p:return re=X._init,A(re(X._payload),D,ee,Z,I)}}if(re)return I=I(X),re=Z===""?"."+C(X,0):Z,T(I)?(ee="",re!=null&&(ee=re.replace(B,"$&/")+"/"),A(I,D,ee,"",function($e){return $e})):I!=null&&(E(I)&&(I=L(I,ee+(I.key==null||X&&X.key===I.key?"":(""+I.key).replace(B,"$&/")+"/")+re)),D.push(I)),1;re=0;var se=Z===""?".":Z+":";if(T(X))for(var be=0;be<X.length;be++)Z=X[be],K=se+C(Z,be),re+=A(Z,D,ee,K,I);else if(be=x(X),typeof be=="function")for(X=be.call(X),be=0;!(Z=X.next()).done;)Z=Z.value,K=se+C(Z,be++),re+=A(Z,D,ee,K,I);else if(K==="object"){if(typeof X.then=="function")return A(G(X),D,ee,Z,I);throw D=String(X),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(X).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return re}function U(X,D,ee){if(X==null)return X;var Z=[],I=0;return A(X,Z,"","",function(K){return D.call(ee,K,I++)}),Z}function H(X){if(X._status===-1){var D=X._result;D=D(),D.then(function(ee){(X._status===0||X._status===-1)&&(X._status=1,X._result=ee)},function(ee){(X._status===0||X._status===-1)&&(X._status=2,X._result=ee)}),X._status===-1&&(X._status=0,X._result=D)}if(X._status===1)return X._result.default;throw X._result}var W=typeof reportError=="function"?reportError:function(X){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof X=="object"&&X!==null&&typeof X.message=="string"?String(X.message):String(X),error:X});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",X);return}console.error(X)},J={map:U,forEach:function(X,D,ee){U(X,function(){D.apply(this,arguments)},ee)},count:function(X){var D=0;return U(X,function(){D++}),D},toArray:function(X){return U(X,function(D){return D})||[]},only:function(X){if(!E(X))throw Error("React.Children.only expected to receive a single React element child.");return X}};return We.Activity=m,We.Children=J,We.Component=Q,We.Fragment=t,We.Profiler=s,We.PureComponent=$,We.StrictMode=r,We.Suspense=u,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,We.__COMPILER_RUNTIME={__proto__:null,c:function(X){return N.H.useMemoCache(X)}},We.cache=function(X){return function(){return X.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(X,D,ee){if(X==null)throw Error("The argument must be a React element, but you passed "+X+".");var Z=y({},X.props),I=X.key;if(D!=null)for(K in D.key!==void 0&&(I=""+D.key),D)!q.call(D,K)||K==="key"||K==="__self"||K==="__source"||K==="ref"&&D.ref===void 0||(Z[K]=D[K]);var K=arguments.length-2;if(K===1)Z.children=ee;else if(1<K){for(var re=Array(K),se=0;se<K;se++)re[se]=arguments[se+2];Z.children=re}return z(X.type,I,Z)},We.createContext=function(X){return X={$$typeof:a,_currentValue:X,_currentValue2:X,_threadCount:0,Provider:null,Consumer:null},X.Provider=X,X.Consumer={$$typeof:i,_context:X},X},We.createElement=function(X,D,ee){var Z,I={},K=null;if(D!=null)for(Z in D.key!==void 0&&(K=""+D.key),D)q.call(D,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(I[Z]=D[Z]);var re=arguments.length-2;if(re===1)I.children=ee;else if(1<re){for(var se=Array(re),be=0;be<re;be++)se[be]=arguments[be+2];I.children=se}if(X&&X.defaultProps)for(Z in re=X.defaultProps,re)I[Z]===void 0&&(I[Z]=re[Z]);return z(X,K,I)},We.createRef=function(){return{current:null}},We.forwardRef=function(X){return{$$typeof:o,render:X}},We.isValidElement=E,We.lazy=function(X){return{$$typeof:p,_payload:{_status:-1,_result:X},_init:H}},We.memo=function(X,D){return{$$typeof:d,type:X,compare:D===void 0?null:D}},We.startTransition=function(X){var D=N.T,ee={};N.T=ee;try{var Z=X(),I=N.S;I!==null&&I(ee,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,W)}catch(K){W(K)}finally{D!==null&&ee.types!==null&&(D.types=ee.types),N.T=D}},We.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},We.use=function(X){return N.H.use(X)},We.useActionState=function(X,D,ee){return N.H.useActionState(X,D,ee)},We.useCallback=function(X,D){return N.H.useCallback(X,D)},We.useContext=function(X){return N.H.useContext(X)},We.useDebugValue=function(){},We.useDeferredValue=function(X,D){return N.H.useDeferredValue(X,D)},We.useEffect=function(X,D){return N.H.useEffect(X,D)},We.useEffectEvent=function(X){return N.H.useEffectEvent(X)},We.useId=function(){return N.H.useId()},We.useImperativeHandle=function(X,D,ee){return N.H.useImperativeHandle(X,D,ee)},We.useInsertionEffect=function(X,D){return N.H.useInsertionEffect(X,D)},We.useLayoutEffect=function(X,D){return N.H.useLayoutEffect(X,D)},We.useMemo=function(X,D){return N.H.useMemo(X,D)},We.useOptimistic=function(X,D){return N.H.useOptimistic(X,D)},We.useReducer=function(X,D,ee){return N.H.useReducer(X,D,ee)},We.useRef=function(X){return N.H.useRef(X)},We.useState=function(X){return N.H.useState(X)},We.useSyncExternalStore=function(X,D,ee){return N.H.useSyncExternalStore(X,D,ee)},We.useTransition=function(){return N.H.useTransition()},We.version="19.2.3",We}var wj;function Uf(){return wj||(wj=1,Ng.exports=$9()),Ng.exports}var P=Uf();const ue=km(P);var Cg={exports:{}},Cu={},Rg={exports:{}},Eg={};/**
|
|
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 Sj;function T9(){return Sj||(Sj=1,(function(n){function e(A,U){var H=A.length;A.push(U);e:for(;0<H;){var W=H-1>>>1,J=A[W];if(0<s(J,U))A[W]=U,A[H]=J,H=W;else break e}}function t(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var U=A[0],H=A.pop();if(H!==U){A[0]=H;e:for(var W=0,J=A.length,X=J>>>1;W<X;){var D=2*(W+1)-1,ee=A[D],Z=D+1,I=A[Z];if(0>s(ee,H))Z<J&&0>s(I,ee)?(A[W]=I,A[Z]=H,W=Z):(A[W]=ee,A[D]=H,W=D);else if(Z<J&&0>s(I,H))A[W]=I,A[Z]=H,W=Z;else break e}}return U}function s(A,U){var H=A.sortIndex-U.sortIndex;return H!==0?H:A.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;n.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();n.unstable_now=function(){return a.now()-o}}var u=[],d=[],p=1,m=null,g=3,x=!1,v=!1,y=!1,S=!1,Q=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function j(A){for(var U=t(d);U!==null;){if(U.callback===null)r(d);else if(U.startTime<=A)r(d),U.sortIndex=U.expirationTime,e(u,U);else break;U=t(d)}}function T(A){if(y=!1,j(A),!v)if(t(u)!==null)v=!0,R||(R=!0,V());else{var U=t(d);U!==null&&G(T,U.startTime-A)}}var R=!1,N=-1,q=5,z=-1;function L(){return S?!0:!(n.unstable_now()-z<q)}function E(){if(S=!1,R){var A=n.unstable_now();z=A;var U=!0;try{e:{v=!1,y&&(y=!1,k(N),N=-1),x=!0;var H=g;try{t:{for(j(A),m=t(u);m!==null&&!(m.expirationTime>A&&L());){var W=m.callback;if(typeof W=="function"){m.callback=null,g=m.priorityLevel;var J=W(m.expirationTime<=A);if(A=n.unstable_now(),typeof J=="function"){m.callback=J,j(A),U=!0;break t}m===t(u)&&r(u),j(A)}else r(u);m=t(u)}if(m!==null)U=!0;else{var X=t(d);X!==null&&G(T,X.startTime-A),U=!1}}break e}finally{m=null,g=H,x=!1}U=void 0}}finally{U?V():R=!1}}}var V;if(typeof $=="function")V=function(){$(E)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,C=B.port2;B.port1.onmessage=E,V=function(){C.postMessage(null)}}else V=function(){Q(E,0)};function G(A,U){N=Q(function(){A(n.unstable_now())},U)}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(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<A?Math.floor(1e3/A):5},n.unstable_getCurrentPriorityLevel=function(){return g},n.unstable_next=function(A){switch(g){case 1:case 2:case 3:var U=3;break;default:U=g}var H=g;g=U;try{return A()}finally{g=H}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(A,U){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var H=g;g=A;try{return U()}finally{g=H}},n.unstable_scheduleCallback=function(A,U,H){var W=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?W+H:W):H=W,A){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=H+J,A={id:p++,callback:U,priorityLevel:A,startTime:H,expirationTime:J,sortIndex:-1},H>W?(A.sortIndex=H,e(d,A),t(u)===null&&A===t(d)&&(y?(k(N),N=-1):y=!0,G(T,H-W))):(A.sortIndex=J,e(u,A),v||x||(v=!0,R||(R=!0,V()))),A},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(A){var U=g;return function(){var H=g;g=U;try{return A.apply(this,arguments)}finally{g=H}}}})(Eg)),Eg}var Qj;function j9(){return Qj||(Qj=1,Rg.exports=T9()),Rg.exports}var Ag={exports:{}},Bn={};/**
|
|
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 kj;function _9(){if(kj)return Bn;kj=1;var n=Uf();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var r={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(u,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:u,containerInfo:d,implementation:p}}var a=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Bn.createPortal=function(u,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return i(u,d,null,p)},Bn.flushSync=function(u){var d=a.T,p=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=d,r.p=p,r.d.f()}},Bn.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},Bn.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Bn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var p=d.as,m=o(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:x}):p==="script"&&r.d.X(u,{crossOrigin:m,integrity:g,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Bn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=o(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},Bn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=o(p,d.crossOrigin);r.d.L(u,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Bn.preloadModule=function(u,d){if(typeof u=="string")if(d){var p=o(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},Bn.requestFormReset=function(u){r.d.r(u)},Bn.unstable_batchedUpdates=function(u,d){return u(d)},Bn.useFormState=function(u,d,p){return a.H.useFormState(u,d,p)},Bn.useFormStatus=function(){return a.H.useHostTransitionStatus()},Bn.version="19.2.3",Bn}var $j;function FA(){if($j)return Ag.exports;$j=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(e){console.error(e)}}return n(),Ag.exports=_9(),Ag.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 Tj;function P9(){if(Tj)return Cu;Tj=1;var n=j9(),e=Uf(),t=FA();function r(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function i(l){var c=l,h=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(h=c.return),l=c.return;while(l)}return c.tag===3?h:null}function a(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function o(l){if(l.tag===31){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function u(l){if(i(l)!==l)throw Error(r(188))}function d(l){var c=l.alternate;if(!c){if(c=i(l),c===null)throw Error(r(188));return c!==l?null:l}for(var h=l,O=c;;){var b=h.return;if(b===null)break;var w=b.alternate;if(w===null){if(O=b.return,O!==null){h=O;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===h)return u(b),l;if(w===O)return u(b),c;w=w.sibling}throw Error(r(188))}if(h.return!==O.return)h=b,O=w;else{for(var _=!1,M=b.child;M;){if(M===h){_=!0,h=b,O=w;break}if(M===O){_=!0,O=b,h=w;break}M=M.sibling}if(!_){for(M=w.child;M;){if(M===h){_=!0,h=w,O=b;break}if(M===O){_=!0,O=w,h=b;break}M=M.sibling}if(!_)throw Error(r(189))}}if(h.alternate!==O)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?l:c}function p(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=p(l),c!==null)return c;l=l.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),$=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),E=Symbol.iterator;function V(l){return l===null||typeof l!="object"?null:(l=E&&l[E]||l["@@iterator"],typeof l=="function"?l:null)}var B=Symbol.for("react.client.reference");function C(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===B?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case y:return"Fragment";case Q:return"Profiler";case S:return"StrictMode";case T:return"Suspense";case R:return"SuspenseList";case z:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case v:return"Portal";case $:return l.displayName||"Context";case k:return(l._context.displayName||"Context")+".Consumer";case j:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case N:return c=l.displayName||null,c!==null?c:C(l.type)||"Memo";case q:c=l._payload,l=l._init;try{return C(l(c))}catch{}}return null}var G=Array.isArray,A=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},W=[],J=-1;function X(l){return{current:l}}function D(l){0>J||(l.current=W[J],W[J]=null,J--)}function ee(l,c){J++,W[J]=l.current,l.current=c}var Z=X(null),I=X(null),K=X(null),re=X(null);function se(l,c){switch(ee(K,c),ee(I,l),ee(Z,null),c.nodeType){case 9:case 11:l=(l=c.documentElement)&&(l=l.namespaceURI)?VT(l):0;break;default:if(l=c.tagName,c=c.namespaceURI)c=VT(c),l=YT(c,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}D(Z),ee(Z,l)}function be(){D(Z),D(I),D(K)}function $e(l){l.memoizedState!==null&&ee(re,l);var c=Z.current,h=YT(c,l.type);c!==h&&(ee(I,l),ee(Z,h))}function Xe(l){I.current===l&&(D(Z),D(I)),re.current===l&&(D(re),Tu._currentValue=H)}var ae,Qe;function Oe(l){if(ae===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);ae=c&&c[1]||"",Qe=-1<h.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ae+l+Qe}var ye=!1;function Fe(l,c){if(!l||ye)return"";ye=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var O={DetermineComponentFrameRoot:function(){try{if(c){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ce){var oe=ce}Reflect.construct(l,[],me)}else{try{me.call()}catch(ce){oe=ce}l.call(me.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(me=l())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=O.DetermineComponentFrameRoot(),_=w[0],M=w[1];if(_&&M){var F=_.split(`
|
|
44
|
-
`),le=M.split(`
|
|
45
|
-
`);for(b=O=0;O<F.length&&!F[O].includes("DetermineComponentFrameRoot");)O++;for(;b<le.length&&!le[b].includes("DetermineComponentFrameRoot");)b++;if(O===F.length||b===le.length)for(O=F.length-1,b=le.length-1;1<=O&&0<=b&&F[O]!==le[b];)b--;for(;1<=O&&0<=b;O--,b--)if(F[O]!==le[b]){if(O!==1||b!==1)do if(O--,b--,0>b||F[O]!==le[b]){var fe=`
|
|
46
|
-
`+F[O].replace(" at new "," at ");return l.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",l.displayName)),fe}while(1<=O&&0<=b);break}}}finally{ye=!1,Error.prepareStackTrace=h}return(h=l?l.displayName||l.name:"")?Oe(h):""}function Te(l,c){switch(l.tag){case 26:case 27:case 5:return Oe(l.type);case 16:return Oe("Lazy");case 13:return l.child!==c&&c!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Fe(l.type,!1);case 11:return Fe(l.type.render,!1);case 1:return Fe(l.type,!0);case 31:return Oe("Activity");default:return""}}function ge(l){try{var c="",h=null;do c+=Te(l,h),h=l,l=l.return;while(l);return c}catch(O){return`
|
|
47
|
-
Error generating stack: `+O.message+`
|
|
48
|
-
`+O.stack}}var Ke=Object.prototype.hasOwnProperty,ot=n.unstable_scheduleCallback,st=n.unstable_cancelCallback,ht=n.unstable_shouldYield,Je=n.unstable_requestPaint,tt=n.unstable_now,hn=n.unstable_getCurrentPriorityLevel,Qt=n.unstable_ImmediatePriority,zt=n.unstable_UserBlockingPriority,St=n.unstable_NormalPriority,en=n.unstable_LowPriority,ln=n.unstable_IdlePriority,pt=n.log,Lt=n.unstable_setDisableYieldValue,ct=null,de=null;function we(l){if(typeof pt=="function"&&Lt(l),de&&typeof de.setStrictMode=="function")try{de.setStrictMode(ct,l)}catch{}}var ke=Math.clz32?Math.clz32:Dt,Be=Math.log,Qn=Math.LN2;function Dt(l){return l>>>=0,l===0?32:31-(Be(l)/Qn|0)|0}var kn=256,Zt=262144,pn=4194304;function on(l){var c=l&42;if(c!==0)return c;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function cs(l,c,h){var O=l.pendingLanes;if(O===0)return 0;var b=0,w=l.suspendedLanes,_=l.pingedLanes;l=l.warmLanes;var M=O&134217727;return M!==0?(O=M&~w,O!==0?b=on(O):(_&=M,_!==0?b=on(_):h||(h=M&~l,h!==0&&(b=on(h))))):(M=O&~w,M!==0?b=on(M):_!==0?b=on(_):h||(h=O&~l,h!==0&&(b=on(h)))),b===0?0:c!==0&&c!==b&&(c&w)===0&&(w=b&-b,h=c&-c,w>=h||w===32&&(h&4194048)!==0)?c:b}function xr(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function Ia(l,c){switch(l){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 us(){var l=pn;return pn<<=1,(pn&62914560)===0&&(pn=4194304),l}function $n(l){for(var c=[],h=0;31>h;h++)c.push(l);return c}function mn(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function oi(l,c,h,O,b,w){var _=l.pendingLanes;l.pendingLanes=h,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=h,l.entangledLanes&=h,l.errorRecoveryDisabledLanes&=h,l.shellSuspendCounter=0;var M=l.entanglements,F=l.expirationTimes,le=l.hiddenUpdates;for(h=_&~h;0<h;){var fe=31-ke(h),me=1<<fe;M[fe]=0,F[fe]=-1;var oe=le[fe];if(oe!==null)for(le[fe]=null,fe=0;fe<oe.length;fe++){var ce=oe[fe];ce!==null&&(ce.lane&=-536870913)}h&=~me}O!==0&&fs(l,O,0),w!==0&&b===0&&l.tag!==0&&(l.suspendedLanes|=w&~(_&~c))}function fs(l,c,h){l.pendingLanes|=c,l.suspendedLanes&=~c;var O=31-ke(c);l.entangledLanes|=c,l.entanglements[O]=l.entanglements[O]|1073741824|h&261930}function br(l,c){var h=l.entangledLanes|=c;for(l=l.entanglements;h;){var O=31-ke(h),b=1<<O;b&c|l[O]&c&&(l[O]|=c),h&=~b}}function ds(l,c){var h=c&-c;return h=(h&42)!==0?1:Xs(h),(h&(l.suspendedLanes|c))!==0?0:h}function Xs(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function yr(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function hs(){var l=U.p;return l!==0?l:(l=window.event,l===void 0?32:dj(l.type))}function ps(l,c){var h=U.p;try{return U.p=l,c()}finally{U.p=h}}var xe=Math.random().toString(36).slice(2),_e="__reactFiber$"+xe,Ve="__reactProps$"+xe,Rt="__reactContainer$"+xe,On="__reactEvents$"+xe,tr="__reactListeners$"+xe,Fl="__reactHandles$"+xe,ci="__reactResources$"+xe,ui="__reactMarker$"+xe;function Ha(l){delete l[_e],delete l[Ve],delete l[On],delete l[tr],delete l[Fl]}function ms(l){var c=l[_e];if(c)return c;for(var h=l.parentNode;h;){if(c=h[Rt]||h[_e]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(l=HT(l);l!==null;){if(h=l[_e])return h;l=HT(l)}return c}l=h,h=l.parentNode}return null}function Os(l){if(l=l[_e]||l[Rt]){var c=l.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return l}return null}function zs(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l.stateNode;throw Error(r(33))}function Ls(l){var c=l[ci];return c||(c=l[ci]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function tn(l){l[ui]=!0}var Kl=new Set,Jl={};function gs(l,c){xs(l,c),xs(l+"Capture",c)}function xs(l,c){for(Jl[l]=c,l=0;l<c.length;l++)Kl.add(c[l])}var Lc=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]*$"),eo={},to={};function Ji(l){return Ke.call(to,l)?!0:Ke.call(eo,l)?!1:Lc.test(l)?to[l]=!0:(eo[l]=!0,!1)}function no(l,c,h){if(Ji(c))if(h===null)l.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":l.removeAttribute(c);return;case"boolean":var O=c.toLowerCase().slice(0,5);if(O!=="data-"&&O!=="aria-"){l.removeAttribute(c);return}}l.setAttribute(c,""+h)}}function ro(l,c,h){if(h===null)l.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(c);return}l.setAttribute(c,""+h)}}function bs(l,c,h,O){if(O===null)l.removeAttribute(h);else{switch(typeof O){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(h);return}l.setAttributeNS(c,h,""+O)}}function nr(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function so(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Zc(l,c,h){var O=Object.getOwnPropertyDescriptor(l.constructor.prototype,c);if(!l.hasOwnProperty(c)&&typeof O<"u"&&typeof O.get=="function"&&typeof O.set=="function"){var b=O.get,w=O.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return b.call(this)},set:function(_){h=""+_,w.call(this,_)}}),Object.defineProperty(l,c,{enumerable:O.enumerable}),{getValue:function(){return h},setValue:function(_){h=""+_},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function pe(l){if(!l._valueTracker){var c=so(l)?"checked":"value";l._valueTracker=Zc(l,c,""+l[c])}}function Pe(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var h=c.getValue(),O="";return l&&(O=so(l)?l.checked?"true":"false":l.value),l=O,l!==h?(c.setValue(l),!0):!1}function De(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var cn=/[\n"\\]/g;function mt(l){return l.replace(cn,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Dn(l,c,h,O,b,w,_,M){l.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?l.type=_:l.removeAttribute("type"),c!=null?_==="number"?(c===0&&l.value===""||l.value!=c)&&(l.value=""+nr(c)):l.value!==""+nr(c)&&(l.value=""+nr(c)):_!=="submit"&&_!=="reset"||l.removeAttribute("value"),c!=null?wr(l,_,nr(c)):h!=null?wr(l,_,nr(h)):O!=null&&l.removeAttribute("value"),b==null&&w!=null&&(l.defaultChecked=!!w),b!=null&&(l.checked=b&&typeof b!="function"&&typeof b!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?l.name=""+nr(M):l.removeAttribute("name")}function vr(l,c,h,O,b,w,_,M){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(l.type=w),c!=null||h!=null){if(!(w!=="submit"&&w!=="reset"||c!=null)){pe(l);return}h=h!=null?""+nr(h):"",c=c!=null?""+nr(c):h,M||c===l.value||(l.value=c),l.defaultValue=c}O=O??b,O=typeof O!="function"&&typeof O!="symbol"&&!!O,l.checked=M?l.checked:!!O,l.defaultChecked=!!O,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(l.name=_),pe(l)}function wr(l,c,h){c==="number"&&De(l.ownerDocument)===l||l.defaultValue===""+h||(l.defaultValue=""+h)}function rr(l,c,h,O){if(l=l.options,c){c={};for(var b=0;b<h.length;b++)c["$"+h[b]]=!0;for(h=0;h<l.length;h++)b=c.hasOwnProperty("$"+l[h].value),l[h].selected!==b&&(l[h].selected=b),b&&O&&(l[h].defaultSelected=!0)}else{for(h=""+nr(h),c=null,b=0;b<l.length;b++){if(l[b].value===h){l[b].selected=!0,O&&(l[b].defaultSelected=!0);return}c!==null||l[b].disabled||(c=l[b])}c!==null&&(c.selected=!0)}}function pd(l,c,h){if(c!=null&&(c=""+nr(c),c!==l.value&&(l.value=c),h==null)){l.defaultValue!==c&&(l.defaultValue=c);return}l.defaultValue=h!=null?""+nr(h):""}function md(l,c,h,O){if(c==null){if(O!=null){if(h!=null)throw Error(r(92));if(G(O)){if(1<O.length)throw Error(r(93));O=O[0]}h=O}h==null&&(h=""),c=h}h=nr(c),l.defaultValue=h,O=l.textContent,O===h&&O!==""&&O!==null&&(l.value=O),pe(l)}function fi(l,c){if(c){var h=l.firstChild;if(h&&h===l.lastChild&&h.nodeType===3){h.nodeValue=c;return}}l.textContent=c}var Od=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 Vc(l,c,h){var O=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?O?l.setProperty(c,""):c==="float"?l.cssFloat="":l[c]="":O?l.setProperty(c,h):typeof h!="number"||h===0||Od.has(c)?c==="float"?l.cssFloat=h:l[c]=(""+h).trim():l[c]=h+"px"}function gd(l,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(l=l.style,h!=null){for(var O in h)!h.hasOwnProperty(O)||c!=null&&c.hasOwnProperty(O)||(O.indexOf("--")===0?l.setProperty(O,""):O==="float"?l.cssFloat="":l[O]="");for(var b in c)O=c[b],c.hasOwnProperty(b)&&h[b]!==O&&Vc(l,b,O)}else for(var w in c)c.hasOwnProperty(w)&&Vc(l,w,c[w])}function Yc(l){if(l.indexOf("-")===-1)return!1;switch(l){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 $O=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),b6=/^[\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 xd(l){return b6.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function di(){}var TO=null;function jO(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var io=null,ao=null;function Zk(l){var c=Os(l);if(c&&(l=c.stateNode)){var h=l[Ve]||null;e:switch(l=c.stateNode,c.type){case"input":if(Dn(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=l;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+mt(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var O=h[c];if(O!==l&&O.form===l.form){var b=O[Ve]||null;if(!b)throw Error(r(90));Dn(O,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(c=0;c<h.length;c++)O=h[c],O.form===l.form&&Pe(O)}break e;case"textarea":pd(l,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&rr(l,!!h.multiple,c,!1)}}}var _O=!1;function Vk(l,c,h){if(_O)return l(c,h);_O=!0;try{var O=l(c);return O}finally{if(_O=!1,(io!==null||ao!==null)&&(ih(),io&&(c=io,l=ao,ao=io=null,Zk(c),l)))for(c=0;c<l.length;c++)Zk(l[c])}}function Dc(l,c){var h=l.stateNode;if(h===null)return null;var O=h[Ve]||null;if(O===null)return null;h=O[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(O=!O.disabled)||(l=l.type,O=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!O;break e;default:l=!1}if(l)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),PO=!1;if(hi)try{var Bc={};Object.defineProperty(Bc,"passive",{get:function(){PO=!0}}),window.addEventListener("test",Bc,Bc),window.removeEventListener("test",Bc,Bc)}catch{PO=!1}var ea=null,NO=null,bd=null;function Yk(){if(bd)return bd;var l,c=NO,h=c.length,O,b="value"in ea?ea.value:ea.textContent,w=b.length;for(l=0;l<h&&c[l]===b[l];l++);var _=h-l;for(O=1;O<=_&&c[h-O]===b[w-O];O++);return bd=b.slice(l,1<O?1-O:void 0)}function yd(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function vd(){return!0}function Dk(){return!1}function sr(l){function c(h,O,b,w,_){this._reactName=h,this._targetInst=b,this.type=O,this.nativeEvent=w,this.target=_,this.currentTarget=null;for(var M in l)l.hasOwnProperty(M)&&(h=l[M],this[M]=h?h(w):w[M]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?vd:Dk,this.isPropagationStopped=Dk,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=vd)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=vd)},persist:function(){},isPersistent:vd}),c}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wd=sr(Fa),Uc=m({},Fa,{view:0,detail:0}),y6=sr(Uc),CO,RO,Wc,Sd=m({},Uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:AO,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Wc&&(Wc&&l.type==="mousemove"?(CO=l.screenX-Wc.screenX,RO=l.screenY-Wc.screenY):RO=CO=0,Wc=l),CO)},movementY:function(l){return"movementY"in l?l.movementY:RO}}),Bk=sr(Sd),v6=m({},Sd,{dataTransfer:0}),w6=sr(v6),S6=m({},Uc,{relatedTarget:0}),EO=sr(S6),Q6=m({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),k6=sr(Q6),$6=m({},Fa,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),T6=sr($6),j6=m({},Fa,{data:0}),Uk=sr(j6),_6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P6={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"},N6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C6(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=N6[l])?!!c[l]:!1}function AO(){return C6}var R6=m({},Uc,{key:function(l){if(l.key){var c=_6[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=yd(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?P6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:AO,charCode:function(l){return l.type==="keypress"?yd(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?yd(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),E6=sr(R6),A6=m({},Sd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wk=sr(A6),q6=m({},Uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:AO}),M6=sr(q6),X6=m({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),z6=sr(X6),L6=m({},Sd,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Z6=sr(L6),V6=m({},Fa,{newState:0,oldState:0}),Y6=sr(V6),D6=[9,13,27,32],qO=hi&&"CompositionEvent"in window,Gc=null;hi&&"documentMode"in document&&(Gc=document.documentMode);var B6=hi&&"TextEvent"in window&&!Gc,Gk=hi&&(!qO||Gc&&8<Gc&&11>=Gc),Ik=" ",Hk=!1;function Fk(l,c){switch(l){case"keyup":return D6.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kk(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var lo=!1;function U6(l,c){switch(l){case"compositionend":return Kk(c);case"keypress":return c.which!==32?null:(Hk=!0,Ik);case"textInput":return l=c.data,l===Ik&&Hk?null:l;default:return null}}function W6(l,c){if(lo)return l==="compositionend"||!qO&&Fk(l,c)?(l=Yk(),bd=NO=ea=null,lo=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Gk&&c.locale!=="ko"?null:c.data;default:return null}}var G6={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 Jk(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!G6[l.type]:c==="textarea"}function e5(l,c,h,O){io?ao?ao.push(O):ao=[O]:io=O,c=dh(c,"onChange"),0<c.length&&(h=new wd("onChange","change",null,h,O),l.push({event:h,listeners:c}))}var Ic=null,Hc=null;function I6(l){qT(l,0)}function Qd(l){var c=zs(l);if(Pe(c))return l}function t5(l,c){if(l==="change")return c}var n5=!1;if(hi){var MO;if(hi){var XO="oninput"in document;if(!XO){var r5=document.createElement("div");r5.setAttribute("oninput","return;"),XO=typeof r5.oninput=="function"}MO=XO}else MO=!1;n5=MO&&(!document.documentMode||9<document.documentMode)}function s5(){Ic&&(Ic.detachEvent("onpropertychange",i5),Hc=Ic=null)}function i5(l){if(l.propertyName==="value"&&Qd(Hc)){var c=[];e5(c,Hc,l,jO(l)),Vk(I6,c)}}function H6(l,c,h){l==="focusin"?(s5(),Ic=c,Hc=h,Ic.attachEvent("onpropertychange",i5)):l==="focusout"&&s5()}function F6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Qd(Hc)}function K6(l,c){if(l==="click")return Qd(c)}function J6(l,c){if(l==="input"||l==="change")return Qd(c)}function e8(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Sr=typeof Object.is=="function"?Object.is:e8;function Fc(l,c){if(Sr(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var h=Object.keys(l),O=Object.keys(c);if(h.length!==O.length)return!1;for(O=0;O<h.length;O++){var b=h[O];if(!Ke.call(c,b)||!Sr(l[b],c[b]))return!1}return!0}function a5(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function l5(l,c){var h=a5(l);l=0;for(var O;h;){if(h.nodeType===3){if(O=l+h.textContent.length,l<=c&&O>=c)return{node:h,offset:c-l};l=O}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=a5(h)}}function o5(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?o5(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function c5(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var c=De(l.document);c instanceof l.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)l=c.contentWindow;else break;c=De(l.document)}return c}function zO(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}var t8=hi&&"documentMode"in document&&11>=document.documentMode,oo=null,LO=null,Kc=null,ZO=!1;function u5(l,c,h){var O=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;ZO||oo==null||oo!==De(O)||(O=oo,"selectionStart"in O&&zO(O)?O={start:O.selectionStart,end:O.selectionEnd}:(O=(O.ownerDocument&&O.ownerDocument.defaultView||window).getSelection(),O={anchorNode:O.anchorNode,anchorOffset:O.anchorOffset,focusNode:O.focusNode,focusOffset:O.focusOffset}),Kc&&Fc(Kc,O)||(Kc=O,O=dh(LO,"onSelect"),0<O.length&&(c=new wd("onSelect","select",null,c,h),l.push({event:c,listeners:O}),c.target=oo)))}function Ka(l,c){var h={};return h[l.toLowerCase()]=c.toLowerCase(),h["Webkit"+l]="webkit"+c,h["Moz"+l]="moz"+c,h}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")},VO={},f5={};hi&&(f5=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 Ja(l){if(VO[l])return VO[l];if(!co[l])return l;var c=co[l],h;for(h in c)if(c.hasOwnProperty(h)&&h in f5)return VO[l]=c[h];return l}var d5=Ja("animationend"),h5=Ja("animationiteration"),p5=Ja("animationstart"),n8=Ja("transitionrun"),r8=Ja("transitionstart"),s8=Ja("transitioncancel"),m5=Ja("transitionend"),O5=new Map,YO="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");YO.push("scrollEnd");function ys(l,c){O5.set(l,c),gs(c,[l])}var kd=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Xr=[],uo=0,DO=0;function $d(){for(var l=uo,c=DO=uo=0;c<l;){var h=Xr[c];Xr[c++]=null;var O=Xr[c];Xr[c++]=null;var b=Xr[c];Xr[c++]=null;var w=Xr[c];if(Xr[c++]=null,O!==null&&b!==null){var _=O.pending;_===null?b.next=b:(b.next=_.next,_.next=b),O.pending=b}w!==0&&g5(h,b,w)}}function Td(l,c,h,O){Xr[uo++]=l,Xr[uo++]=c,Xr[uo++]=h,Xr[uo++]=O,DO|=O,l.lanes|=O,l=l.alternate,l!==null&&(l.lanes|=O)}function BO(l,c,h,O){return Td(l,c,h,O),jd(l)}function el(l,c){return Td(l,null,null,c),jd(l)}function g5(l,c,h){l.lanes|=h;var O=l.alternate;O!==null&&(O.lanes|=h);for(var b=!1,w=l.return;w!==null;)w.childLanes|=h,O=w.alternate,O!==null&&(O.childLanes|=h),w.tag===22&&(l=w.stateNode,l===null||l._visibility&1||(b=!0)),l=w,w=w.return;return l.tag===3?(w=l.stateNode,b&&c!==null&&(b=31-ke(h),l=w.hiddenUpdates,O=l[b],O===null?l[b]=[c]:O.push(c),c.lane=h|536870912),w):null}function jd(l){if(50<yu)throw yu=0,eg=null,Error(r(185));for(var c=l.return;c!==null;)l=c,c=l.return;return l.tag===3?l.stateNode:null}var fo={};function i8(l,c,h,O){this.tag=l,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=O,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(l,c,h,O){return new i8(l,c,h,O)}function UO(l){return l=l.prototype,!(!l||!l.isReactComponent)}function pi(l,c){var h=l.alternate;return h===null?(h=Qr(l.tag,c,l.key,l.mode),h.elementType=l.elementType,h.type=l.type,h.stateNode=l.stateNode,h.alternate=l,l.alternate=h):(h.pendingProps=c,h.type=l.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=l.flags&65011712,h.childLanes=l.childLanes,h.lanes=l.lanes,h.child=l.child,h.memoizedProps=l.memoizedProps,h.memoizedState=l.memoizedState,h.updateQueue=l.updateQueue,c=l.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=l.sibling,h.index=l.index,h.ref=l.ref,h.refCleanup=l.refCleanup,h}function x5(l,c){l.flags&=65011714;var h=l.alternate;return h===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=h.childLanes,l.lanes=h.lanes,l.child=h.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=h.memoizedProps,l.memoizedState=h.memoizedState,l.updateQueue=h.updateQueue,l.type=h.type,c=h.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function _d(l,c,h,O,b,w){var _=0;if(O=l,typeof l=="function")UO(l)&&(_=1);else if(typeof l=="string")_=u9(l,h,Z.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case z:return l=Qr(31,h,c,b),l.elementType=z,l.lanes=w,l;case y:return tl(h.children,b,w,c);case S:_=8,b|=24;break;case Q:return l=Qr(12,h,c,b|2),l.elementType=Q,l.lanes=w,l;case T:return l=Qr(13,h,c,b),l.elementType=T,l.lanes=w,l;case R:return l=Qr(19,h,c,b),l.elementType=R,l.lanes=w,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case $:_=10;break e;case k:_=9;break e;case j:_=11;break e;case N:_=14;break e;case q:_=16,O=null;break e}_=29,h=Error(r(130,l===null?"null":typeof l,"")),O=null}return c=Qr(_,h,c,b),c.elementType=l,c.type=O,c.lanes=w,c}function tl(l,c,h,O){return l=Qr(7,l,O,c),l.lanes=h,l}function WO(l,c,h){return l=Qr(6,l,null,c),l.lanes=h,l}function b5(l){var c=Qr(18,null,null,0);return c.stateNode=l,c}function GO(l,c,h){return c=Qr(4,l.children!==null?l.children:[],l.key,c),c.lanes=h,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}var y5=new WeakMap;function zr(l,c){if(typeof l=="object"&&l!==null){var h=y5.get(l);return h!==void 0?h:(c={value:l,source:c,stack:ge(c)},y5.set(l,c),c)}return{value:l,source:c,stack:ge(c)}}var ho=[],po=0,Pd=null,Jc=0,Lr=[],Zr=0,ta=null,Zs=1,Vs="";function mi(l,c){ho[po++]=Jc,ho[po++]=Pd,Pd=l,Jc=c}function v5(l,c,h){Lr[Zr++]=Zs,Lr[Zr++]=Vs,Lr[Zr++]=ta,ta=l;var O=Zs;l=Vs;var b=32-ke(O)-1;O&=~(1<<b),h+=1;var w=32-ke(c)+b;if(30<w){var _=b-b%5;w=(O&(1<<_)-1).toString(32),O>>=_,b-=_,Zs=1<<32-ke(c)+b|h<<b|O,Vs=w+l}else Zs=1<<w|h<<b|O,Vs=l}function IO(l){l.return!==null&&(mi(l,1),v5(l,1,0))}function HO(l){for(;l===Pd;)Pd=ho[--po],ho[po]=null,Jc=ho[--po],ho[po]=null;for(;l===ta;)ta=Lr[--Zr],Lr[Zr]=null,Vs=Lr[--Zr],Lr[Zr]=null,Zs=Lr[--Zr],Lr[Zr]=null}function w5(l,c){Lr[Zr++]=Zs,Lr[Zr++]=Vs,Lr[Zr++]=ta,Zs=c.id,Vs=c.overflow,ta=l}var An=null,Vt=null,lt=!1,na=null,Vr=!1,FO=Error(r(519));function ra(l){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eu(zr(c,l)),FO}function S5(l){var c=l.stateNode,h=l.type,O=l.memoizedProps;switch(c[_e]=l,c[Ve]=O,h){case"dialog":rt("cancel",c),rt("close",c);break;case"iframe":case"object":case"embed":rt("load",c);break;case"video":case"audio":for(h=0;h<wu.length;h++)rt(wu[h],c);break;case"source":rt("error",c);break;case"img":case"image":case"link":rt("error",c),rt("load",c);break;case"details":rt("toggle",c);break;case"input":rt("invalid",c),vr(c,O.value,O.defaultValue,O.checked,O.defaultChecked,O.type,O.name,!0);break;case"select":rt("invalid",c);break;case"textarea":rt("invalid",c),md(c,O.value,O.defaultValue,O.children)}h=O.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||O.suppressHydrationWarning===!0||LT(c.textContent,h)?(O.popover!=null&&(rt("beforetoggle",c),rt("toggle",c)),O.onScroll!=null&&rt("scroll",c),O.onScrollEnd!=null&&rt("scrollend",c),O.onClick!=null&&(c.onclick=di),c=!0):c=!1,c||ra(l,!0)}function Q5(l){for(An=l.return;An;)switch(An.tag){case 5:case 31:case 13:Vr=!1;return;case 27:case 3:Vr=!0;return;default:An=An.return}}function mo(l){if(l!==An)return!1;if(!lt)return Q5(l),lt=!0,!1;var c=l.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=l.type,h=!(h!=="form"&&h!=="button")||mg(l.type,l.memoizedProps)),h=!h),h&&Vt&&ra(l),Q5(l),c===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Vt=IT(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Vt=IT(l)}else c===27?(c=Vt,ga(l.type)?(l=yg,yg=null,Vt=l):Vt=c):Vt=An?Dr(l.stateNode.nextSibling):null;return!0}function nl(){Vt=An=null,lt=!1}function KO(){var l=na;return l!==null&&(or===null?or=l:or.push.apply(or,l),na=null),l}function eu(l){na===null?na=[l]:na.push(l)}var JO=X(null),rl=null,Oi=null;function sa(l,c,h){ee(JO,c._currentValue),c._currentValue=h}function gi(l){l._currentValue=JO.current,D(JO)}function e0(l,c,h){for(;l!==null;){var O=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,O!==null&&(O.childLanes|=c)):O!==null&&(O.childLanes&c)!==c&&(O.childLanes|=c),l===h)break;l=l.return}}function t0(l,c,h,O){var b=l.child;for(b!==null&&(b.return=l);b!==null;){var w=b.dependencies;if(w!==null){var _=b.child;w=w.firstContext;e:for(;w!==null;){var M=w;w=b;for(var F=0;F<c.length;F++)if(M.context===c[F]){w.lanes|=h,M=w.alternate,M!==null&&(M.lanes|=h),e0(w.return,h,l),O||(_=null);break e}w=M.next}}else if(b.tag===18){if(_=b.return,_===null)throw Error(r(341));_.lanes|=h,w=_.alternate,w!==null&&(w.lanes|=h),e0(_,h,l),_=null}else _=b.child;if(_!==null)_.return=b;else for(_=b;_!==null;){if(_===l){_=null;break}if(b=_.sibling,b!==null){b.return=_.return,_=b;break}_=_.return}b=_}}function Oo(l,c,h,O){l=null;for(var b=c,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var _=b.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var M=b.type;Sr(b.pendingProps.value,_.value)||(l!==null?l.push(M):l=[M])}}else if(b===re.current){if(_=b.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(l!==null?l.push(Tu):l=[Tu])}b=b.return}l!==null&&t0(c,l,h,O),c.flags|=262144}function Nd(l){for(l=l.firstContext;l!==null;){if(!Sr(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function sl(l){rl=l,Oi=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function qn(l){return k5(rl,l)}function Cd(l,c){return rl===null&&sl(l),k5(l,c)}function k5(l,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},Oi===null){if(l===null)throw Error(r(308));Oi=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else Oi=Oi.next=c;return h}var a8=typeof AbortController<"u"?AbortController:function(){var l=[],c=this.signal={aborted:!1,addEventListener:function(h,O){l.push(O)}};this.abort=function(){c.aborted=!0,l.forEach(function(h){return h()})}},l8=n.unstable_scheduleCallback,o8=n.unstable_NormalPriority,gn={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function n0(){return{controller:new a8,data:new Map,refCount:0}}function tu(l){l.refCount--,l.refCount===0&&l8(o8,function(){l.controller.abort()})}var nu=null,r0=0,go=0,xo=null;function c8(l,c){if(nu===null){var h=nu=[];r0=0,go=ag(),xo={status:"pending",value:void 0,then:function(O){h.push(O)}}}return r0++,c.then($5,$5),c}function $5(){if(--r0===0&&nu!==null){xo!==null&&(xo.status="fulfilled");var l=nu;nu=null,go=0,xo=null;for(var c=0;c<l.length;c++)(0,l[c])()}}function u8(l,c){var h=[],O={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return l.then(function(){O.status="fulfilled",O.value=c;for(var b=0;b<h.length;b++)(0,h[b])(c)},function(b){for(O.status="rejected",O.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),O}var T5=A.S;A.S=function(l,c){uT=tt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&c8(l,c),T5!==null&&T5(l,c)};var il=X(null);function s0(){var l=il.current;return l!==null?l:Et.pooledCache}function Rd(l,c){c===null?ee(il,il.current):ee(il,c.pool)}function j5(){var l=s0();return l===null?null:{parent:gn._currentValue,pool:l}}var bo=Error(r(460)),i0=Error(r(474)),Ed=Error(r(542)),Ad={then:function(){}};function _5(l){return l=l.status,l==="fulfilled"||l==="rejected"}function P5(l,c,h){switch(h=l[h],h===void 0?l.push(c):h!==c&&(c.then(di,di),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,C5(l),l;default:if(typeof c.status=="string")c.then(di,di);else{if(l=Et,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=c,l.status="pending",l.then(function(O){if(c.status==="pending"){var b=c;b.status="fulfilled",b.value=O}},function(O){if(c.status==="pending"){var b=c;b.status="rejected",b.reason=O}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,C5(l),l}throw ll=c,bo}}function al(l){try{var c=l._init;return c(l._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(ll=h,bo):h}}var ll=null;function N5(){if(ll===null)throw Error(r(459));var l=ll;return ll=null,l}function C5(l){if(l===bo||l===Ed)throw Error(r(483))}var yo=null,ru=0;function qd(l){var c=ru;return ru+=1,yo===null&&(yo=[]),P5(yo,l,c)}function su(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function Md(l,c){throw c.$$typeof===g?Error(r(525)):(l=Object.prototype.toString.call(c),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l)))}function R5(l){function c(ne,te){if(l){var ie=ne.deletions;ie===null?(ne.deletions=[te],ne.flags|=16):ie.push(te)}}function h(ne,te){if(!l)return null;for(;te!==null;)c(ne,te),te=te.sibling;return null}function O(ne){for(var te=new Map;ne!==null;)ne.key!==null?te.set(ne.key,ne):te.set(ne.index,ne),ne=ne.sibling;return te}function b(ne,te){return ne=pi(ne,te),ne.index=0,ne.sibling=null,ne}function w(ne,te,ie){return ne.index=ie,l?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<te?(ne.flags|=67108866,te):ie):(ne.flags|=67108866,te)):(ne.flags|=1048576,te)}function _(ne){return l&&ne.alternate===null&&(ne.flags|=67108866),ne}function M(ne,te,ie,he){return te===null||te.tag!==6?(te=WO(ie,ne.mode,he),te.return=ne,te):(te=b(te,ie),te.return=ne,te)}function F(ne,te,ie,he){var Le=ie.type;return Le===y?fe(ne,te,ie.props.children,he,ie.key):te!==null&&(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===q&&al(Le)===te.type)?(te=b(te,ie.props),su(te,ie),te.return=ne,te):(te=_d(ie.type,ie.key,ie.props,null,ne.mode,he),su(te,ie),te.return=ne,te)}function le(ne,te,ie,he){return te===null||te.tag!==4||te.stateNode.containerInfo!==ie.containerInfo||te.stateNode.implementation!==ie.implementation?(te=GO(ie,ne.mode,he),te.return=ne,te):(te=b(te,ie.children||[]),te.return=ne,te)}function fe(ne,te,ie,he,Le){return te===null||te.tag!==7?(te=tl(ie,ne.mode,he,Le),te.return=ne,te):(te=b(te,ie),te.return=ne,te)}function me(ne,te,ie){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=WO(""+te,ne.mode,ie),te.return=ne,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return ie=_d(te.type,te.key,te.props,null,ne.mode,ie),su(ie,te),ie.return=ne,ie;case v:return te=GO(te,ne.mode,ie),te.return=ne,te;case q:return te=al(te),me(ne,te,ie)}if(G(te)||V(te))return te=tl(te,ne.mode,ie,null),te.return=ne,te;if(typeof te.then=="function")return me(ne,qd(te),ie);if(te.$$typeof===$)return me(ne,Cd(ne,te),ie);Md(ne,te)}return null}function oe(ne,te,ie,he){var Le=te!==null?te.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Le!==null?null:M(ne,te,""+ie,he);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ie.key===Le?F(ne,te,ie,he):null;case v:return ie.key===Le?le(ne,te,ie,he):null;case q:return ie=al(ie),oe(ne,te,ie,he)}if(G(ie)||V(ie))return Le!==null?null:fe(ne,te,ie,he,null);if(typeof ie.then=="function")return oe(ne,te,qd(ie),he);if(ie.$$typeof===$)return oe(ne,te,Cd(ne,ie),he);Md(ne,ie)}return null}function ce(ne,te,ie,he,Le){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ne=ne.get(ie)||null,M(te,ne,""+he,Le);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case x:return ne=ne.get(he.key===null?ie:he.key)||null,F(te,ne,he,Le);case v:return ne=ne.get(he.key===null?ie:he.key)||null,le(te,ne,he,Le);case q:return he=al(he),ce(ne,te,ie,he,Le)}if(G(he)||V(he))return ne=ne.get(ie)||null,fe(te,ne,he,Le,null);if(typeof he.then=="function")return ce(ne,te,ie,qd(he),Le);if(he.$$typeof===$)return ce(ne,te,ie,Cd(te,he),Le);Md(te,he)}return null}function Re(ne,te,ie,he){for(var Le=null,Ot=null,Ee=te,He=te=0,at=null;Ee!==null&&He<ie.length;He++){Ee.index>He?(at=Ee,Ee=null):at=Ee.sibling;var gt=oe(ne,Ee,ie[He],he);if(gt===null){Ee===null&&(Ee=at);break}l&&Ee&>.alternate===null&&c(ne,Ee),te=w(gt,te,He),Ot===null?Le=gt:Ot.sibling=gt,Ot=gt,Ee=at}if(He===ie.length)return h(ne,Ee),lt&&mi(ne,He),Le;if(Ee===null){for(;He<ie.length;He++)Ee=me(ne,ie[He],he),Ee!==null&&(te=w(Ee,te,He),Ot===null?Le=Ee:Ot.sibling=Ee,Ot=Ee);return lt&&mi(ne,He),Le}for(Ee=O(Ee);He<ie.length;He++)at=ce(Ee,ne,He,ie[He],he),at!==null&&(l&&at.alternate!==null&&Ee.delete(at.key===null?He:at.key),te=w(at,te,He),Ot===null?Le=at:Ot.sibling=at,Ot=at);return l&&Ee.forEach(function(wa){return c(ne,wa)}),lt&&mi(ne,He),Le}function Ye(ne,te,ie,he){if(ie==null)throw Error(r(151));for(var Le=null,Ot=null,Ee=te,He=te=0,at=null,gt=ie.next();Ee!==null&&!gt.done;He++,gt=ie.next()){Ee.index>He?(at=Ee,Ee=null):at=Ee.sibling;var wa=oe(ne,Ee,gt.value,he);if(wa===null){Ee===null&&(Ee=at);break}l&&Ee&&wa.alternate===null&&c(ne,Ee),te=w(wa,te,He),Ot===null?Le=wa:Ot.sibling=wa,Ot=wa,Ee=at}if(gt.done)return h(ne,Ee),lt&&mi(ne,He),Le;if(Ee===null){for(;!gt.done;He++,gt=ie.next())gt=me(ne,gt.value,he),gt!==null&&(te=w(gt,te,He),Ot===null?Le=gt:Ot.sibling=gt,Ot=gt);return lt&&mi(ne,He),Le}for(Ee=O(Ee);!gt.done;He++,gt=ie.next())gt=ce(Ee,ne,He,gt.value,he),gt!==null&&(l&>.alternate!==null&&Ee.delete(gt.key===null?He:gt.key),te=w(gt,te,He),Ot===null?Le=gt:Ot.sibling=gt,Ot=gt);return l&&Ee.forEach(function(v9){return c(ne,v9)}),lt&&mi(ne,He),Le}function _t(ne,te,ie,he){if(typeof ie=="object"&&ie!==null&&ie.type===y&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Le=ie.key;te!==null;){if(te.key===Le){if(Le=ie.type,Le===y){if(te.tag===7){h(ne,te.sibling),he=b(te,ie.props.children),he.return=ne,ne=he;break e}}else if(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===q&&al(Le)===te.type){h(ne,te.sibling),he=b(te,ie.props),su(he,ie),he.return=ne,ne=he;break e}h(ne,te);break}else c(ne,te);te=te.sibling}ie.type===y?(he=tl(ie.props.children,ne.mode,he,ie.key),he.return=ne,ne=he):(he=_d(ie.type,ie.key,ie.props,null,ne.mode,he),su(he,ie),he.return=ne,ne=he)}return _(ne);case v:e:{for(Le=ie.key;te!==null;){if(te.key===Le)if(te.tag===4&&te.stateNode.containerInfo===ie.containerInfo&&te.stateNode.implementation===ie.implementation){h(ne,te.sibling),he=b(te,ie.children||[]),he.return=ne,ne=he;break e}else{h(ne,te);break}else c(ne,te);te=te.sibling}he=GO(ie,ne.mode,he),he.return=ne,ne=he}return _(ne);case q:return ie=al(ie),_t(ne,te,ie,he)}if(G(ie))return Re(ne,te,ie,he);if(V(ie)){if(Le=V(ie),typeof Le!="function")throw Error(r(150));return ie=Le.call(ie),Ye(ne,te,ie,he)}if(typeof ie.then=="function")return _t(ne,te,qd(ie),he);if(ie.$$typeof===$)return _t(ne,te,Cd(ne,ie),he);Md(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,te!==null&&te.tag===6?(h(ne,te.sibling),he=b(te,ie),he.return=ne,ne=he):(h(ne,te),he=WO(ie,ne.mode,he),he.return=ne,ne=he),_(ne)):h(ne,te)}return function(ne,te,ie,he){try{ru=0;var Le=_t(ne,te,ie,he);return yo=null,Le}catch(Ee){if(Ee===bo||Ee===Ed)throw Ee;var Ot=Qr(29,Ee,null,ne.mode);return Ot.lanes=he,Ot.return=ne,Ot}finally{}}}var ol=R5(!0),E5=R5(!1),ia=!1;function a0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function l0(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function aa(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function la(l,c,h){var O=l.updateQueue;if(O===null)return null;if(O=O.shared,(yt&2)!==0){var b=O.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),O.pending=c,c=jd(l),g5(l,null,h),c}return Td(l,O,c,h),jd(l)}function iu(l,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var O=c.lanes;O&=l.pendingLanes,h|=O,c.lanes=h,br(l,h)}}function o0(l,c){var h=l.updateQueue,O=l.alternate;if(O!==null&&(O=O.updateQueue,h===O)){var b=null,w=null;if(h=h.firstBaseUpdate,h!==null){do{var _={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};w===null?b=w=_:w=w.next=_,h=h.next}while(h!==null);w===null?b=w=c:w=w.next=c}else b=w=c;h={baseState:O.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:O.shared,callbacks:O.callbacks},l.updateQueue=h;return}l=h.lastBaseUpdate,l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=c}var c0=!1;function au(){if(c0){var l=xo;if(l!==null)throw l}}function lu(l,c,h,O){c0=!1;var b=l.updateQueue;ia=!1;var w=b.firstBaseUpdate,_=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var F=M,le=F.next;F.next=null,_===null?w=le:_.next=le,_=F;var fe=l.alternate;fe!==null&&(fe=fe.updateQueue,M=fe.lastBaseUpdate,M!==_&&(M===null?fe.firstBaseUpdate=le:M.next=le,fe.lastBaseUpdate=F))}if(w!==null){var me=b.baseState;_=0,fe=le=F=null,M=w;do{var oe=M.lane&-536870913,ce=oe!==M.lane;if(ce?(it&oe)===oe:(O&oe)===oe){oe!==0&&oe===go&&(c0=!0),fe!==null&&(fe=fe.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Re=l,Ye=M;oe=c;var _t=h;switch(Ye.tag){case 1:if(Re=Ye.payload,typeof Re=="function"){me=Re.call(_t,me,oe);break e}me=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ye.payload,oe=typeof Re=="function"?Re.call(_t,me,oe):Re,oe==null)break e;me=m({},me,oe);break e;case 2:ia=!0}}oe=M.callback,oe!==null&&(l.flags|=64,ce&&(l.flags|=8192),ce=b.callbacks,ce===null?b.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:M.tag,payload:M.payload,callback:M.callback,next:null},fe===null?(le=fe=ce,F=me):fe=fe.next=ce,_|=oe;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;ce=M,M=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);fe===null&&(F=me),b.baseState=F,b.firstBaseUpdate=le,b.lastBaseUpdate=fe,w===null&&(b.shared.lanes=0),da|=_,l.lanes=_,l.memoizedState=me}}function A5(l,c){if(typeof l!="function")throw Error(r(191,l));l.call(c)}function q5(l,c){var h=l.callbacks;if(h!==null)for(l.callbacks=null,l=0;l<h.length;l++)A5(h[l],c)}var vo=X(null),Xd=X(0);function M5(l,c){l=$i,ee(Xd,l),ee(vo,c),$i=l|c.baseLanes}function u0(){ee(Xd,$i),ee(vo,vo.current)}function f0(){$i=Xd.current,D(vo),D(Xd)}var kr=X(null),Yr=null;function oa(l){var c=l.alternate;ee(un,un.current&1),ee(kr,l),Yr===null&&(c===null||vo.current!==null||c.memoizedState!==null)&&(Yr=l)}function d0(l){ee(un,un.current),ee(kr,l),Yr===null&&(Yr=l)}function X5(l){l.tag===22?(ee(un,un.current),ee(kr,l),Yr===null&&(Yr=l)):ca()}function ca(){ee(un,un.current),ee(kr,kr.current)}function $r(l){D(kr),Yr===l&&(Yr=null),D(un)}var un=X(0);function zd(l){for(var c=l;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||xg(h)||bg(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var xi=0,Ie=null,Tt=null,xn=null,Ld=!1,wo=!1,cl=!1,Zd=0,ou=0,So=null,f8=0;function nn(){throw Error(r(321))}function h0(l,c){if(c===null)return!1;for(var h=0;h<c.length&&h<l.length;h++)if(!Sr(l[h],c[h]))return!1;return!0}function p0(l,c,h,O,b,w){return xi=w,Ie=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,A.H=l===null||l.memoizedState===null?v$:_0,cl=!1,w=h(O,b),cl=!1,wo&&(w=L5(c,h,O,b)),z5(l),w}function z5(l){A.H=fu;var c=Tt!==null&&Tt.next!==null;if(xi=0,xn=Tt=Ie=null,Ld=!1,ou=0,So=null,c)throw Error(r(300));l===null||bn||(l=l.dependencies,l!==null&&Nd(l)&&(bn=!0))}function L5(l,c,h,O){Ie=l;var b=0;do{if(wo&&(So=null),ou=0,wo=!1,25<=b)throw Error(r(301));if(b+=1,xn=Tt=null,l.updateQueue!=null){var w=l.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}A.H=w$,w=c(h,O)}while(wo);return w}function d8(){var l=A.H,c=l.useState()[0];return c=typeof c.then=="function"?cu(c):c,l=l.useState()[0],(Tt!==null?Tt.memoizedState:null)!==l&&(Ie.flags|=1024),c}function m0(){var l=Zd!==0;return Zd=0,l}function O0(l,c,h){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~h}function g0(l){if(Ld){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}Ld=!1}xi=0,xn=Tt=Ie=null,wo=!1,ou=Zd=0,So=null}function In(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xn===null?Ie.memoizedState=xn=l:xn=xn.next=l,xn}function fn(){if(Tt===null){var l=Ie.alternate;l=l!==null?l.memoizedState:null}else l=Tt.next;var c=xn===null?Ie.memoizedState:xn.next;if(c!==null)xn=c,Tt=l;else{if(l===null)throw Ie.alternate===null?Error(r(467)):Error(r(310));Tt=l,l={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},xn===null?Ie.memoizedState=xn=l:xn=xn.next=l}return xn}function Vd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cu(l){var c=ou;return ou+=1,So===null&&(So=[]),l=P5(So,l,c),c=Ie,(xn===null?c.memoizedState:xn.next)===null&&(c=c.alternate,A.H=c===null||c.memoizedState===null?v$:_0),l}function Yd(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return cu(l);if(l.$$typeof===$)return qn(l)}throw Error(r(438,String(l)))}function x0(l){var c=null,h=Ie.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var O=Ie.alternate;O!==null&&(O=O.updateQueue,O!==null&&(O=O.memoCache,O!=null&&(c={data:O.data.map(function(b){return b.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Vd(),Ie.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(l),O=0;O<l;O++)h[O]=L;return c.index++,h}function bi(l,c){return typeof c=="function"?c(l):c}function Dd(l){var c=fn();return b0(c,Tt,l)}function b0(l,c,h){var O=l.queue;if(O===null)throw Error(r(311));O.lastRenderedReducer=h;var b=l.baseQueue,w=O.pending;if(w!==null){if(b!==null){var _=b.next;b.next=w.next,w.next=_}c.baseQueue=b=w,O.pending=null}if(w=l.baseState,b===null)l.memoizedState=w;else{c=b.next;var M=_=null,F=null,le=c,fe=!1;do{var me=le.lane&-536870913;if(me!==le.lane?(it&me)===me:(xi&me)===me){var oe=le.revertLane;if(oe===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),me===go&&(fe=!0);else if((xi&oe)===oe){le=le.next,oe===go&&(fe=!0);continue}else me={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},F===null?(M=F=me,_=w):F=F.next=me,Ie.lanes|=oe,da|=oe;me=le.action,cl&&h(w,me),w=le.hasEagerState?le.eagerState:h(w,me)}else oe={lane:me,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},F===null?(M=F=oe,_=w):F=F.next=oe,Ie.lanes|=me,da|=me;le=le.next}while(le!==null&&le!==c);if(F===null?_=w:F.next=M,!Sr(w,l.memoizedState)&&(bn=!0,fe&&(h=xo,h!==null)))throw h;l.memoizedState=w,l.baseState=_,l.baseQueue=F,O.lastRenderedState=w}return b===null&&(O.lanes=0),[l.memoizedState,O.dispatch]}function y0(l){var c=fn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=l;var O=h.dispatch,b=h.pending,w=c.memoizedState;if(b!==null){h.pending=null;var _=b=b.next;do w=l(w,_.action),_=_.next;while(_!==b);Sr(w,c.memoizedState)||(bn=!0),c.memoizedState=w,c.baseQueue===null&&(c.baseState=w),h.lastRenderedState=w}return[w,O]}function Z5(l,c,h){var O=Ie,b=fn(),w=lt;if(w){if(h===void 0)throw Error(r(407));h=h()}else h=c();var _=!Sr((Tt||b).memoizedState,h);if(_&&(b.memoizedState=h,bn=!0),b=b.queue,S0(D5.bind(null,O,b,l),[l]),b.getSnapshot!==c||_||xn!==null&&xn.memoizedState.tag&1){if(O.flags|=2048,Qo(9,{destroy:void 0},Y5.bind(null,O,b,h,c),null),Et===null)throw Error(r(349));w||(xi&127)!==0||V5(O,c,h)}return h}function V5(l,c,h){l.flags|=16384,l={getSnapshot:c,value:h},c=Ie.updateQueue,c===null?(c=Vd(),Ie.updateQueue=c,c.stores=[l]):(h=c.stores,h===null?c.stores=[l]:h.push(l))}function Y5(l,c,h,O){c.value=h,c.getSnapshot=O,B5(c)&&U5(l)}function D5(l,c,h){return h(function(){B5(c)&&U5(l)})}function B5(l){var c=l.getSnapshot;l=l.value;try{var h=c();return!Sr(l,h)}catch{return!0}}function U5(l){var c=el(l,2);c!==null&&cr(c,l,2)}function v0(l){var c=In();if(typeof l=="function"){var h=l;if(l=h(),cl){we(!0);try{h()}finally{we(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:l},c}function W5(l,c,h,O){return l.baseState=h,b0(l,Tt,typeof O=="function"?O:bi)}function h8(l,c,h,O,b){if(Wd(l))throw Error(r(485));if(l=c.action,l!==null){var w={payload:b,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){w.listeners.push(_)}};A.T!==null?h(!0):w.isTransition=!1,O(w),h=c.pending,h===null?(w.next=c.pending=w,G5(c,w)):(w.next=h.next,c.pending=h.next=w)}}function G5(l,c){var h=c.action,O=c.payload,b=l.state;if(c.isTransition){var w=A.T,_={};A.T=_;try{var M=h(b,O),F=A.S;F!==null&&F(_,M),I5(l,c,M)}catch(le){w0(l,c,le)}finally{w!==null&&_.types!==null&&(w.types=_.types),A.T=w}}else try{w=h(b,O),I5(l,c,w)}catch(le){w0(l,c,le)}}function I5(l,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(O){H5(l,c,O)},function(O){return w0(l,c,O)}):H5(l,c,h)}function H5(l,c,h){c.status="fulfilled",c.value=h,F5(c),l.state=h,c=l.pending,c!==null&&(h=c.next,h===c?l.pending=null:(h=h.next,c.next=h,G5(l,h)))}function w0(l,c,h){var O=l.pending;if(l.pending=null,O!==null){O=O.next;do c.status="rejected",c.reason=h,F5(c),c=c.next;while(c!==O)}l.action=null}function F5(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function K5(l,c){return c}function J5(l,c){if(lt){var h=Et.formState;if(h!==null){e:{var O=Ie;if(lt){if(Vt){t:{for(var b=Vt,w=Vr;b.nodeType!==8;){if(!w){b=null;break t}if(b=Dr(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Vt=Dr(b.nextSibling),O=b.data==="F!";break e}}ra(O)}O=!1}O&&(c=h[0])}}return h=In(),h.memoizedState=h.baseState=c,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:K5,lastRenderedState:c},h.queue=O,h=x$.bind(null,Ie,O),O.dispatch=h,O=v0(!1),w=j0.bind(null,Ie,!1,O.queue),O=In(),b={state:c,dispatch:null,action:l,pending:null},O.queue=b,h=h8.bind(null,Ie,b,w,h),b.dispatch=h,O.memoizedState=l,[c,h,!1]}function e$(l){var c=fn();return t$(c,Tt,l)}function t$(l,c,h){if(c=b0(l,c,K5)[0],l=Dd(bi)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var O=cu(c)}catch(_){throw _===bo?Ed:_}else O=c;c=fn();var b=c.queue,w=b.dispatch;return h!==c.memoizedState&&(Ie.flags|=2048,Qo(9,{destroy:void 0},p8.bind(null,b,h),null)),[O,w,l]}function p8(l,c){l.action=c}function n$(l){var c=fn(),h=Tt;if(h!==null)return t$(c,h,l);fn(),c=c.memoizedState,h=fn();var O=h.queue.dispatch;return h.memoizedState=l,[c,O,!1]}function Qo(l,c,h,O){return l={tag:l,create:h,deps:O,inst:c,next:null},c=Ie.updateQueue,c===null&&(c=Vd(),Ie.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=l.next=l:(O=h.next,h.next=l,l.next=O,c.lastEffect=l),l}function r$(){return fn().memoizedState}function Bd(l,c,h,O){var b=In();Ie.flags|=l,b.memoizedState=Qo(1|c,{destroy:void 0},h,O===void 0?null:O)}function Ud(l,c,h,O){var b=fn();O=O===void 0?null:O;var w=b.memoizedState.inst;Tt!==null&&O!==null&&h0(O,Tt.memoizedState.deps)?b.memoizedState=Qo(c,w,h,O):(Ie.flags|=l,b.memoizedState=Qo(1|c,w,h,O))}function s$(l,c){Bd(8390656,8,l,c)}function S0(l,c){Ud(2048,8,l,c)}function m8(l){Ie.flags|=4;var c=Ie.updateQueue;if(c===null)c=Vd(),Ie.updateQueue=c,c.events=[l];else{var h=c.events;h===null?c.events=[l]:h.push(l)}}function i$(l){var c=fn().memoizedState;return m8({ref:c,nextImpl:l}),function(){if((yt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function a$(l,c){return Ud(4,2,l,c)}function l$(l,c){return Ud(4,4,l,c)}function o$(l,c){if(typeof c=="function"){l=l();var h=c(l);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function c$(l,c,h){h=h!=null?h.concat([l]):null,Ud(4,4,o$.bind(null,c,l),h)}function Q0(){}function u$(l,c){var h=fn();c=c===void 0?null:c;var O=h.memoizedState;return c!==null&&h0(c,O[1])?O[0]:(h.memoizedState=[l,c],l)}function f$(l,c){var h=fn();c=c===void 0?null:c;var O=h.memoizedState;if(c!==null&&h0(c,O[1]))return O[0];if(O=l(),cl){we(!0);try{l()}finally{we(!1)}}return h.memoizedState=[O,c],O}function k0(l,c,h){return h===void 0||(xi&1073741824)!==0&&(it&261930)===0?l.memoizedState=c:(l.memoizedState=h,l=dT(),Ie.lanes|=l,da|=l,h)}function d$(l,c,h,O){return Sr(h,c)?h:vo.current!==null?(l=k0(l,h,O),Sr(l,c)||(bn=!0),l):(xi&42)===0||(xi&1073741824)!==0&&(it&261930)===0?(bn=!0,l.memoizedState=h):(l=dT(),Ie.lanes|=l,da|=l,c)}function h$(l,c,h,O,b){var w=U.p;U.p=w!==0&&8>w?w:8;var _=A.T,M={};A.T=M,j0(l,!1,c,h);try{var F=b(),le=A.S;if(le!==null&&le(M,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var fe=u8(F,O);uu(l,c,fe,_r(l))}else uu(l,c,O,_r(l))}catch(me){uu(l,c,{then:function(){},status:"rejected",reason:me},_r())}finally{U.p=w,_!==null&&M.types!==null&&(_.types=M.types),A.T=_}}function O8(){}function $0(l,c,h,O){if(l.tag!==5)throw Error(r(476));var b=p$(l).queue;h$(l,b,c,H,h===null?O8:function(){return m$(l),h(O)})}function p$(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:H},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:h},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function m$(l){var c=p$(l);c.next===null&&(c=l.alternate.memoizedState),uu(l,c.next.queue,{},_r())}function T0(){return qn(Tu)}function O$(){return fn().memoizedState}function g$(){return fn().memoizedState}function g8(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var h=_r();l=aa(h);var O=la(c,l,h);O!==null&&(cr(O,c,h),iu(O,c,h)),c={cache:n0()},l.payload=c;return}c=c.return}}function x8(l,c,h){var O=_r();h={lane:O,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Wd(l)?b$(c,h):(h=BO(l,c,h,O),h!==null&&(cr(h,l,O),y$(h,c,O)))}function x$(l,c,h){var O=_r();uu(l,c,h,O)}function uu(l,c,h,O){var b={lane:O,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Wd(l))b$(c,b);else{var w=l.alternate;if(l.lanes===0&&(w===null||w.lanes===0)&&(w=c.lastRenderedReducer,w!==null))try{var _=c.lastRenderedState,M=w(_,h);if(b.hasEagerState=!0,b.eagerState=M,Sr(M,_))return Td(l,c,b,0),Et===null&&$d(),!1}catch{}finally{}if(h=BO(l,c,b,O),h!==null)return cr(h,l,O),y$(h,c,O),!0}return!1}function j0(l,c,h,O){if(O={lane:2,revertLane:ag(),gesture:null,action:O,hasEagerState:!1,eagerState:null,next:null},Wd(l)){if(c)throw Error(r(479))}else c=BO(l,h,O,2),c!==null&&cr(c,l,2)}function Wd(l){var c=l.alternate;return l===Ie||c!==null&&c===Ie}function b$(l,c){wo=Ld=!0;var h=l.pending;h===null?c.next=c:(c.next=h.next,h.next=c),l.pending=c}function y$(l,c,h){if((h&4194048)!==0){var O=c.lanes;O&=l.pendingLanes,h|=O,c.lanes=h,br(l,h)}}var fu={readContext:qn,use:Yd,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};fu.useEffectEvent=nn;var v$={readContext:qn,use:Yd,useCallback:function(l,c){return In().memoizedState=[l,c===void 0?null:c],l},useContext:qn,useEffect:s$,useImperativeHandle:function(l,c,h){h=h!=null?h.concat([l]):null,Bd(4194308,4,o$.bind(null,c,l),h)},useLayoutEffect:function(l,c){return Bd(4194308,4,l,c)},useInsertionEffect:function(l,c){Bd(4,2,l,c)},useMemo:function(l,c){var h=In();c=c===void 0?null:c;var O=l();if(cl){we(!0);try{l()}finally{we(!1)}}return h.memoizedState=[O,c],O},useReducer:function(l,c,h){var O=In();if(h!==void 0){var b=h(c);if(cl){we(!0);try{h(c)}finally{we(!1)}}}else b=c;return O.memoizedState=O.baseState=b,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:b},O.queue=l,l=l.dispatch=x8.bind(null,Ie,l),[O.memoizedState,l]},useRef:function(l){var c=In();return l={current:l},c.memoizedState=l},useState:function(l){l=v0(l);var c=l.queue,h=x$.bind(null,Ie,c);return c.dispatch=h,[l.memoizedState,h]},useDebugValue:Q0,useDeferredValue:function(l,c){var h=In();return k0(h,l,c)},useTransition:function(){var l=v0(!1);return l=h$.bind(null,Ie,l.queue,!0,!1),In().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,h){var O=Ie,b=In();if(lt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Et===null)throw Error(r(349));(it&127)!==0||V5(O,c,h)}b.memoizedState=h;var w={value:h,getSnapshot:c};return b.queue=w,s$(D5.bind(null,O,w,l),[l]),O.flags|=2048,Qo(9,{destroy:void 0},Y5.bind(null,O,w,h,c),null),h},useId:function(){var l=In(),c=Et.identifierPrefix;if(lt){var h=Vs,O=Zs;h=(O&~(1<<32-ke(O)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Zd++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=f8++,c="_"+c+"r_"+h.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:T0,useFormState:J5,useActionState:J5,useOptimistic:function(l){var c=In();c.memoizedState=c.baseState=l;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=j0.bind(null,Ie,!0,h),h.dispatch=c,[l,c]},useMemoCache:x0,useCacheRefresh:function(){return In().memoizedState=g8.bind(null,Ie)},useEffectEvent:function(l){var c=In(),h={impl:l};return c.memoizedState=h,function(){if((yt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},_0={readContext:qn,use:Yd,useCallback:u$,useContext:qn,useEffect:S0,useImperativeHandle:c$,useInsertionEffect:a$,useLayoutEffect:l$,useMemo:f$,useReducer:Dd,useRef:r$,useState:function(){return Dd(bi)},useDebugValue:Q0,useDeferredValue:function(l,c){var h=fn();return d$(h,Tt.memoizedState,l,c)},useTransition:function(){var l=Dd(bi)[0],c=fn().memoizedState;return[typeof l=="boolean"?l:cu(l),c]},useSyncExternalStore:Z5,useId:O$,useHostTransitionStatus:T0,useFormState:e$,useActionState:e$,useOptimistic:function(l,c){var h=fn();return W5(h,Tt,l,c)},useMemoCache:x0,useCacheRefresh:g$};_0.useEffectEvent=i$;var w$={readContext:qn,use:Yd,useCallback:u$,useContext:qn,useEffect:S0,useImperativeHandle:c$,useInsertionEffect:a$,useLayoutEffect:l$,useMemo:f$,useReducer:y0,useRef:r$,useState:function(){return y0(bi)},useDebugValue:Q0,useDeferredValue:function(l,c){var h=fn();return Tt===null?k0(h,l,c):d$(h,Tt.memoizedState,l,c)},useTransition:function(){var l=y0(bi)[0],c=fn().memoizedState;return[typeof l=="boolean"?l:cu(l),c]},useSyncExternalStore:Z5,useId:O$,useHostTransitionStatus:T0,useFormState:n$,useActionState:n$,useOptimistic:function(l,c){var h=fn();return Tt!==null?W5(h,Tt,l,c):(h.baseState=l,[l,h.queue.dispatch])},useMemoCache:x0,useCacheRefresh:g$};w$.useEffectEvent=i$;function P0(l,c,h,O){c=l.memoizedState,h=h(O,c),h=h==null?c:m({},c,h),l.memoizedState=h,l.lanes===0&&(l.updateQueue.baseState=h)}var N0={enqueueSetState:function(l,c,h){l=l._reactInternals;var O=_r(),b=aa(O);b.payload=c,h!=null&&(b.callback=h),c=la(l,b,O),c!==null&&(cr(c,l,O),iu(c,l,O))},enqueueReplaceState:function(l,c,h){l=l._reactInternals;var O=_r(),b=aa(O);b.tag=1,b.payload=c,h!=null&&(b.callback=h),c=la(l,b,O),c!==null&&(cr(c,l,O),iu(c,l,O))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var h=_r(),O=aa(h);O.tag=2,c!=null&&(O.callback=c),c=la(l,O,h),c!==null&&(cr(c,l,h),iu(c,l,h))}};function S$(l,c,h,O,b,w,_){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(O,w,_):c.prototype&&c.prototype.isPureReactComponent?!Fc(h,O)||!Fc(b,w):!0}function Q$(l,c,h,O){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,O),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,O),c.state!==l&&N0.enqueueReplaceState(c,c.state,null)}function ul(l,c){var h=c;if("ref"in c){h={};for(var O in c)O!=="ref"&&(h[O]=c[O])}if(l=l.defaultProps){h===c&&(h=m({},h));for(var b in l)h[b]===void 0&&(h[b]=l[b])}return h}function k$(l){kd(l)}function $$(l){console.error(l)}function T$(l){kd(l)}function Gd(l,c){try{var h=l.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(O){setTimeout(function(){throw O})}}function j$(l,c,h){try{var O=l.onCaughtError;O(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function C0(l,c,h){return h=aa(h),h.tag=3,h.payload={element:null},h.callback=function(){Gd(l,c)},h}function _$(l){return l=aa(l),l.tag=3,l}function P$(l,c,h,O){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var w=O.value;l.payload=function(){return b(w)},l.callback=function(){j$(c,h,O)}}var _=h.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){j$(c,h,O),typeof b!="function"&&(ha===null?ha=new Set([this]):ha.add(this));var M=O.stack;this.componentDidCatch(O.value,{componentStack:M!==null?M:""})})}function b8(l,c,h,O,b){if(h.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){if(c=h.alternate,c!==null&&Oo(c,h,b,!0),h=kr.current,h!==null){switch(h.tag){case 31:case 13:return Yr===null?ah():h.alternate===null&&rn===0&&(rn=3),h.flags&=-257,h.flags|=65536,h.lanes=b,O===Ad?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([O]):c.add(O),rg(l,O,b)),!1;case 22:return h.flags|=65536,O===Ad?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([O])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([O]):h.add(O)),rg(l,O,b)),!1}throw Error(r(435,h.tag))}return rg(l,O,b),ah(),!1}if(lt)return c=kr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=b,O!==FO&&(l=Error(r(422),{cause:O}),eu(zr(l,h)))):(O!==FO&&(c=Error(r(423),{cause:O}),eu(zr(c,h))),l=l.current.alternate,l.flags|=65536,b&=-b,l.lanes|=b,O=zr(O,h),b=C0(l.stateNode,O,b),o0(l,b),rn!==4&&(rn=2)),!1;var w=Error(r(520),{cause:O});if(w=zr(w,h),bu===null?bu=[w]:bu.push(w),rn!==4&&(rn=2),c===null)return!0;O=zr(O,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,l=b&-b,h.lanes|=l,l=C0(h.stateNode,O,l),o0(h,l),!1;case 1:if(c=h.type,w=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ha===null||!ha.has(w))))return h.flags|=65536,b&=-b,h.lanes|=b,b=_$(b),P$(b,l,h,O),o0(h,b),!1}h=h.return}while(h!==null);return!1}var R0=Error(r(461)),bn=!1;function Mn(l,c,h,O){c.child=l===null?E5(c,null,h,O):ol(c,l.child,h,O)}function N$(l,c,h,O,b){h=h.render;var w=c.ref;if("ref"in O){var _={};for(var M in O)M!=="ref"&&(_[M]=O[M])}else _=O;return sl(c),O=p0(l,c,h,_,w,b),M=m0(),l!==null&&!bn?(O0(l,c,b),yi(l,c,b)):(lt&&M&&IO(c),c.flags|=1,Mn(l,c,O,b),c.child)}function C$(l,c,h,O,b){if(l===null){var w=h.type;return typeof w=="function"&&!UO(w)&&w.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=w,R$(l,c,w,O,b)):(l=_d(h.type,null,O,c,c.mode,b),l.ref=c.ref,l.return=c,c.child=l)}if(w=l.child,!Z0(l,b)){var _=w.memoizedProps;if(h=h.compare,h=h!==null?h:Fc,h(_,O)&&l.ref===c.ref)return yi(l,c,b)}return c.flags|=1,l=pi(w,O),l.ref=c.ref,l.return=c,c.child=l}function R$(l,c,h,O,b){if(l!==null){var w=l.memoizedProps;if(Fc(w,O)&&l.ref===c.ref)if(bn=!1,c.pendingProps=O=w,Z0(l,b))(l.flags&131072)!==0&&(bn=!0);else return c.lanes=l.lanes,yi(l,c,b)}return E0(l,c,h,O,b)}function E$(l,c,h,O){var b=O.children,w=l!==null?l.memoizedState:null;if(l===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),O.mode==="hidden"){if((c.flags&128)!==0){if(w=w!==null?w.baseLanes|h:h,l!==null){for(O=c.child=l.child,b=0;O!==null;)b=b|O.lanes|O.childLanes,O=O.sibling;O=b&~w}else O=0,c.child=null;return A$(l,c,w,h,O)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&Rd(c,w!==null?w.cachePool:null),w!==null?M5(c,w):u0(),X5(c);else return O=c.lanes=536870912,A$(l,c,w!==null?w.baseLanes|h:h,h,O)}else w!==null?(Rd(c,w.cachePool),M5(c,w),ca(),c.memoizedState=null):(l!==null&&Rd(c,null),u0(),ca());return Mn(l,c,b,h),c.child}function du(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function A$(l,c,h,O,b){var w=s0();return w=w===null?null:{parent:gn._currentValue,pool:w},c.memoizedState={baseLanes:h,cachePool:w},l!==null&&Rd(c,null),u0(),X5(c),l!==null&&Oo(l,c,O,!0),c.childLanes=b,null}function Id(l,c){return c=Fd({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function q$(l,c,h){return ol(c,l.child,null,h),l=Id(c,c.pendingProps),l.flags|=2,$r(c),c.memoizedState=null,l}function y8(l,c,h){var O=c.pendingProps,b=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(lt){if(O.mode==="hidden")return l=Id(c,O),c.lanes=536870912,du(null,l);if(d0(c),(l=Vt)?(l=GT(l,Vr),l=l!==null&&l.data==="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:ta!==null?{id:Zs,overflow:Vs}:null,retryLane:536870912,hydrationErrors:null},h=b5(l),h.return=c,c.child=h,An=c,Vt=null)):l=null,l===null)throw ra(c);return c.lanes=536870912,null}return Id(c,O)}var w=l.memoizedState;if(w!==null){var _=w.dehydrated;if(d0(c),b)if(c.flags&256)c.flags&=-257,c=q$(l,c,h);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(r(558));else if(bn||Oo(l,c,h,!1),b=(h&l.childLanes)!==0,bn||b){if(O=Et,O!==null&&(_=ds(O,h),_!==0&&_!==w.retryLane))throw w.retryLane=_,el(l,_),cr(O,l,_),R0;ah(),c=q$(l,c,h)}else l=w.treeContext,Vt=Dr(_.nextSibling),An=c,lt=!0,na=null,Vr=!1,l!==null&&w5(c,l),c=Id(c,O),c.flags|=4096;return c}return l=pi(l.child,{mode:O.mode,children:O.children}),l.ref=c.ref,c.child=l,l.return=c,l}function Hd(l,c){var h=c.ref;if(h===null)l!==null&&l.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(l===null||l.ref!==h)&&(c.flags|=4194816)}}function E0(l,c,h,O,b){return sl(c),h=p0(l,c,h,O,void 0,b),O=m0(),l!==null&&!bn?(O0(l,c,b),yi(l,c,b)):(lt&&O&&IO(c),c.flags|=1,Mn(l,c,h,b),c.child)}function M$(l,c,h,O,b,w){return sl(c),c.updateQueue=null,h=L5(c,O,h,b),z5(l),O=m0(),l!==null&&!bn?(O0(l,c,w),yi(l,c,w)):(lt&&O&&IO(c),c.flags|=1,Mn(l,c,h,w),c.child)}function X$(l,c,h,O,b){if(sl(c),c.stateNode===null){var w=fo,_=h.contextType;typeof _=="object"&&_!==null&&(w=qn(_)),w=new h(O,w),c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=N0,c.stateNode=w,w._reactInternals=c,w=c.stateNode,w.props=O,w.state=c.memoizedState,w.refs={},a0(c),_=h.contextType,w.context=typeof _=="object"&&_!==null?qn(_):fo,w.state=c.memoizedState,_=h.getDerivedStateFromProps,typeof _=="function"&&(P0(c,h,_,O),w.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(_=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),_!==w.state&&N0.enqueueReplaceState(w,w.state,null),lu(c,O,w,b),au(),w.state=c.memoizedState),typeof w.componentDidMount=="function"&&(c.flags|=4194308),O=!0}else if(l===null){w=c.stateNode;var M=c.memoizedProps,F=ul(h,M);w.props=F;var le=w.context,fe=h.contextType;_=fo,typeof fe=="object"&&fe!==null&&(_=qn(fe));var me=h.getDerivedStateFromProps;fe=typeof me=="function"||typeof w.getSnapshotBeforeUpdate=="function",M=c.pendingProps!==M,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(M||le!==_)&&Q$(c,w,O,_),ia=!1;var oe=c.memoizedState;w.state=oe,lu(c,O,w,b),au(),le=c.memoizedState,M||oe!==le||ia?(typeof me=="function"&&(P0(c,h,me,O),le=c.memoizedState),(F=ia||S$(c,h,F,O,oe,le,_))?(fe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(c.flags|=4194308)):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=O,c.memoizedState=le),w.props=O,w.state=le,w.context=_,O=F):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),O=!1)}else{w=c.stateNode,l0(l,c),_=c.memoizedProps,fe=ul(h,_),w.props=fe,me=c.pendingProps,oe=w.context,le=h.contextType,F=fo,typeof le=="object"&&le!==null&&(F=qn(le)),M=h.getDerivedStateFromProps,(le=typeof M=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==me||oe!==F)&&Q$(c,w,O,F),ia=!1,oe=c.memoizedState,w.state=oe,lu(c,O,w,b),au();var ce=c.memoizedState;_!==me||oe!==ce||ia||l!==null&&l.dependencies!==null&&Nd(l.dependencies)?(typeof M=="function"&&(P0(c,h,M,O),ce=c.memoizedState),(fe=ia||S$(c,h,fe,O,oe,ce,F)||l!==null&&l.dependencies!==null&&Nd(l.dependencies))?(le||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(O,ce,F),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(O,ce,F)),typeof w.componentDidUpdate=="function"&&(c.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===l.memoizedProps&&oe===l.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===l.memoizedProps&&oe===l.memoizedState||(c.flags|=1024),c.memoizedProps=O,c.memoizedState=ce),w.props=O,w.state=ce,w.context=F,O=fe):(typeof w.componentDidUpdate!="function"||_===l.memoizedProps&&oe===l.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===l.memoizedProps&&oe===l.memoizedState||(c.flags|=1024),O=!1)}return w=O,Hd(l,c),O=(c.flags&128)!==0,w||O?(w=c.stateNode,h=O&&typeof h.getDerivedStateFromError!="function"?null:w.render(),c.flags|=1,l!==null&&O?(c.child=ol(c,l.child,null,b),c.child=ol(c,null,h,b)):Mn(l,c,h,b),c.memoizedState=w.state,l=c.child):l=yi(l,c,b),l}function z$(l,c,h,O){return nl(),c.flags|=256,Mn(l,c,h,O),c.child}var A0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function q0(l){return{baseLanes:l,cachePool:j5()}}function M0(l,c,h){return l=l!==null?l.childLanes&~h:0,c&&(l|=jr),l}function L$(l,c,h){var O=c.pendingProps,b=!1,w=(c.flags&128)!==0,_;if((_=w)||(_=l!==null&&l.memoizedState===null?!1:(un.current&2)!==0),_&&(b=!0,c.flags&=-129),_=(c.flags&32)!==0,c.flags&=-33,l===null){if(lt){if(b?oa(c):ca(),(l=Vt)?(l=GT(l,Vr),l=l!==null&&l.data!=="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:ta!==null?{id:Zs,overflow:Vs}:null,retryLane:536870912,hydrationErrors:null},h=b5(l),h.return=c,c.child=h,An=c,Vt=null)):l=null,l===null)throw ra(c);return bg(l)?c.lanes=32:c.lanes=536870912,null}var M=O.children;return O=O.fallback,b?(ca(),b=c.mode,M=Fd({mode:"hidden",children:M},b),O=tl(O,b,h,null),M.return=c,O.return=c,M.sibling=O,c.child=M,O=c.child,O.memoizedState=q0(h),O.childLanes=M0(l,_,h),c.memoizedState=A0,du(null,O)):(oa(c),X0(c,M))}var F=l.memoizedState;if(F!==null&&(M=F.dehydrated,M!==null)){if(w)c.flags&256?(oa(c),c.flags&=-257,c=z0(l,c,h)):c.memoizedState!==null?(ca(),c.child=l.child,c.flags|=128,c=null):(ca(),M=O.fallback,b=c.mode,O=Fd({mode:"visible",children:O.children},b),M=tl(M,b,h,null),M.flags|=2,O.return=c,M.return=c,O.sibling=M,c.child=O,ol(c,l.child,null,h),O=c.child,O.memoizedState=q0(h),O.childLanes=M0(l,_,h),c.memoizedState=A0,c=du(null,O));else if(oa(c),bg(M)){if(_=M.nextSibling&&M.nextSibling.dataset,_)var le=_.dgst;_=le,O=Error(r(419)),O.stack="",O.digest=_,eu({value:O,source:null,stack:null}),c=z0(l,c,h)}else if(bn||Oo(l,c,h,!1),_=(h&l.childLanes)!==0,bn||_){if(_=Et,_!==null&&(O=ds(_,h),O!==0&&O!==F.retryLane))throw F.retryLane=O,el(l,O),cr(_,l,O),R0;xg(M)||ah(),c=z0(l,c,h)}else xg(M)?(c.flags|=192,c.child=l.child,c=null):(l=F.treeContext,Vt=Dr(M.nextSibling),An=c,lt=!0,na=null,Vr=!1,l!==null&&w5(c,l),c=X0(c,O.children),c.flags|=4096);return c}return b?(ca(),M=O.fallback,b=c.mode,F=l.child,le=F.sibling,O=pi(F,{mode:"hidden",children:O.children}),O.subtreeFlags=F.subtreeFlags&65011712,le!==null?M=pi(le,M):(M=tl(M,b,h,null),M.flags|=2),M.return=c,O.return=c,O.sibling=M,c.child=O,du(null,O),O=c.child,M=l.child.memoizedState,M===null?M=q0(h):(b=M.cachePool,b!==null?(F=gn._currentValue,b=b.parent!==F?{parent:F,pool:F}:b):b=j5(),M={baseLanes:M.baseLanes|h,cachePool:b}),O.memoizedState=M,O.childLanes=M0(l,_,h),c.memoizedState=A0,du(l.child,O)):(oa(c),h=l.child,l=h.sibling,h=pi(h,{mode:"visible",children:O.children}),h.return=c,h.sibling=null,l!==null&&(_=c.deletions,_===null?(c.deletions=[l],c.flags|=16):_.push(l)),c.child=h,c.memoizedState=null,h)}function X0(l,c){return c=Fd({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function Fd(l,c){return l=Qr(22,l,null,c),l.lanes=0,l}function z0(l,c,h){return ol(c,l.child,null,h),l=X0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Z$(l,c,h){l.lanes|=c;var O=l.alternate;O!==null&&(O.lanes|=c),e0(l.return,c,h)}function L0(l,c,h,O,b,w){var _=l.memoizedState;_===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:O,tail:h,tailMode:b,treeForkCount:w}:(_.isBackwards=c,_.rendering=null,_.renderingStartTime=0,_.last=O,_.tail=h,_.tailMode=b,_.treeForkCount=w)}function V$(l,c,h){var O=c.pendingProps,b=O.revealOrder,w=O.tail;O=O.children;var _=un.current,M=(_&2)!==0;if(M?(_=_&1|2,c.flags|=128):_&=1,ee(un,_),Mn(l,c,O,h),O=lt?Jc:0,!M&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Z$(l,h,c);else if(l.tag===19)Z$(l,h,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(b){case"forwards":for(h=c.child,b=null;h!==null;)l=h.alternate,l!==null&&zd(l)===null&&(b=h),h=h.sibling;h=b,h===null?(b=c.child,c.child=null):(b=h.sibling,h.sibling=null),L0(c,!1,b,h,w,O);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=c.child,c.child=null;b!==null;){if(l=b.alternate,l!==null&&zd(l)===null){c.child=b;break}l=b.sibling,b.sibling=h,h=b,b=l}L0(c,!0,h,null,w,O);break;case"together":L0(c,!1,null,null,void 0,O);break;default:c.memoizedState=null}return c.child}function yi(l,c,h){if(l!==null&&(c.dependencies=l.dependencies),da|=c.lanes,(h&c.childLanes)===0)if(l!==null){if(Oo(l,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(r(153));if(c.child!==null){for(l=c.child,h=pi(l,l.pendingProps),c.child=h,h.return=c;l.sibling!==null;)l=l.sibling,h=h.sibling=pi(l,l.pendingProps),h.return=c;h.sibling=null}return c.child}function Z0(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&Nd(l)))}function v8(l,c,h){switch(c.tag){case 3:se(c,c.stateNode.containerInfo),sa(c,gn,l.memoizedState.cache),nl();break;case 27:case 5:$e(c);break;case 4:se(c,c.stateNode.containerInfo);break;case 10:sa(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,d0(c),null;break;case 13:var O=c.memoizedState;if(O!==null)return O.dehydrated!==null?(oa(c),c.flags|=128,null):(h&c.child.childLanes)!==0?L$(l,c,h):(oa(c),l=yi(l,c,h),l!==null?l.sibling:null);oa(c);break;case 19:var b=(l.flags&128)!==0;if(O=(h&c.childLanes)!==0,O||(Oo(l,c,h,!1),O=(h&c.childLanes)!==0),b){if(O)return V$(l,c,h);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ee(un,un.current),O)break;return null;case 22:return c.lanes=0,E$(l,c,h,c.pendingProps);case 24:sa(c,gn,l.memoizedState.cache)}return yi(l,c,h)}function Y$(l,c,h){if(l!==null)if(l.memoizedProps!==c.pendingProps)bn=!0;else{if(!Z0(l,h)&&(c.flags&128)===0)return bn=!1,v8(l,c,h);bn=(l.flags&131072)!==0}else bn=!1,lt&&(c.flags&1048576)!==0&&v5(c,Jc,c.index);switch(c.lanes=0,c.tag){case 16:e:{var O=c.pendingProps;if(l=al(c.elementType),c.type=l,typeof l=="function")UO(l)?(O=ul(l,O),c.tag=1,c=X$(null,c,l,O,h)):(c.tag=0,c=E0(null,c,l,O,h));else{if(l!=null){var b=l.$$typeof;if(b===j){c.tag=11,c=N$(null,c,l,O,h);break e}else if(b===N){c.tag=14,c=C$(null,c,l,O,h);break e}}throw c=C(l)||l,Error(r(306,c,""))}}return c;case 0:return E0(l,c,c.type,c.pendingProps,h);case 1:return O=c.type,b=ul(O,c.pendingProps),X$(l,c,O,b,h);case 3:e:{if(se(c,c.stateNode.containerInfo),l===null)throw Error(r(387));O=c.pendingProps;var w=c.memoizedState;b=w.element,l0(l,c),lu(c,O,null,h);var _=c.memoizedState;if(O=_.cache,sa(c,gn,O),O!==w.cache&&t0(c,[gn],h,!0),au(),O=_.element,w.isDehydrated)if(w={element:O,isDehydrated:!1,cache:_.cache},c.updateQueue.baseState=w,c.memoizedState=w,c.flags&256){c=z$(l,c,O,h);break e}else if(O!==b){b=zr(Error(r(424)),c),eu(b),c=z$(l,c,O,h);break e}else{switch(l=c.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(Vt=Dr(l.firstChild),An=c,lt=!0,na=null,Vr=!0,h=E5(c,null,O,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(nl(),O===b){c=yi(l,c,h);break e}Mn(l,c,O,h)}c=c.child}return c;case 26:return Hd(l,c),l===null?(h=ej(c.type,null,c.pendingProps,null))?c.memoizedState=h:lt||(h=c.type,l=c.pendingProps,O=hh(K.current).createElement(h),O[_e]=c,O[Ve]=l,Xn(O,h,l),tn(O),c.stateNode=O):c.memoizedState=ej(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:return $e(c),l===null&<&&(O=c.stateNode=FT(c.type,c.pendingProps,K.current),An=c,Vr=!0,b=Vt,ga(c.type)?(yg=b,Vt=Dr(O.firstChild)):Vt=b),Mn(l,c,c.pendingProps.children,h),Hd(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&<&&((b=O=Vt)&&(O=F8(O,c.type,c.pendingProps,Vr),O!==null?(c.stateNode=O,An=c,Vt=Dr(O.firstChild),Vr=!1,b=!0):b=!1),b||ra(c)),$e(c),b=c.type,w=c.pendingProps,_=l!==null?l.memoizedProps:null,O=w.children,mg(b,w)?O=null:_!==null&&mg(b,_)&&(c.flags|=32),c.memoizedState!==null&&(b=p0(l,c,d8,null,null,h),Tu._currentValue=b),Hd(l,c),Mn(l,c,O,h),c.child;case 6:return l===null&<&&((l=h=Vt)&&(h=K8(h,c.pendingProps,Vr),h!==null?(c.stateNode=h,An=c,Vt=null,l=!0):l=!1),l||ra(c)),null;case 13:return L$(l,c,h);case 4:return se(c,c.stateNode.containerInfo),O=c.pendingProps,l===null?c.child=ol(c,null,O,h):Mn(l,c,O,h),c.child;case 11:return N$(l,c,c.type,c.pendingProps,h);case 7:return Mn(l,c,c.pendingProps,h),c.child;case 8:return Mn(l,c,c.pendingProps.children,h),c.child;case 12:return Mn(l,c,c.pendingProps.children,h),c.child;case 10:return O=c.pendingProps,sa(c,c.type,O.value),Mn(l,c,O.children,h),c.child;case 9:return b=c.type._context,O=c.pendingProps.children,sl(c),b=qn(b),O=O(b),c.flags|=1,Mn(l,c,O,h),c.child;case 14:return C$(l,c,c.type,c.pendingProps,h);case 15:return R$(l,c,c.type,c.pendingProps,h);case 19:return V$(l,c,h);case 31:return y8(l,c,h);case 22:return E$(l,c,h,c.pendingProps);case 24:return sl(c),O=qn(gn),l===null?(b=s0(),b===null&&(b=Et,w=n0(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=h),b=w),c.memoizedState={parent:O,cache:b},a0(c),sa(c,gn,b)):((l.lanes&h)!==0&&(l0(l,c),lu(c,null,null,h),au()),b=l.memoizedState,w=c.memoizedState,b.parent!==O?(b={parent:O,cache:O},c.memoizedState=b,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=b),sa(c,gn,O)):(O=w.cache,sa(c,gn,O),O!==b.cache&&t0(c,[gn],h,!0))),Mn(l,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function vi(l){l.flags|=4}function V0(l,c,h,O,b){if((c=(l.mode&32)!==0)&&(c=!1),c){if(l.flags|=16777216,(b&335544128)===b)if(l.stateNode.complete)l.flags|=8192;else if(OT())l.flags|=8192;else throw ll=Ad,i0}else l.flags&=-16777217}function D$(l,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!ij(c))if(OT())l.flags|=8192;else throw ll=Ad,i0}function Kd(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?us():536870912,l.lanes|=c,jo|=c)}function hu(l,c){if(!lt)switch(l.tailMode){case"hidden":c=l.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?l.tail=null:h.sibling=null;break;case"collapsed":h=l.tail;for(var O=null;h!==null;)h.alternate!==null&&(O=h),h=h.sibling;O===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:O.sibling=null}}function Yt(l){var c=l.alternate!==null&&l.alternate.child===l.child,h=0,O=0;if(c)for(var b=l.child;b!==null;)h|=b.lanes|b.childLanes,O|=b.subtreeFlags&65011712,O|=b.flags&65011712,b.return=l,b=b.sibling;else for(b=l.child;b!==null;)h|=b.lanes|b.childLanes,O|=b.subtreeFlags,O|=b.flags,b.return=l,b=b.sibling;return l.subtreeFlags|=O,l.childLanes=h,c}function w8(l,c,h){var O=c.pendingProps;switch(HO(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(c),null;case 1:return Yt(c),null;case 3:return h=c.stateNode,O=null,l!==null&&(O=l.memoizedState.cache),c.memoizedState.cache!==O&&(c.flags|=2048),gi(gn),be(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(l===null||l.child===null)&&(mo(c)?vi(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,KO())),Yt(c),null;case 26:var b=c.type,w=c.memoizedState;return l===null?(vi(c),w!==null?(Yt(c),D$(c,w)):(Yt(c),V0(c,b,null,O,h))):w?w!==l.memoizedState?(vi(c),Yt(c),D$(c,w)):(Yt(c),c.flags&=-16777217):(l=l.memoizedProps,l!==O&&vi(c),Yt(c),V0(c,b,l,O,h)),null;case 27:if(Xe(c),h=K.current,b=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==O&&vi(c);else{if(!O){if(c.stateNode===null)throw Error(r(166));return Yt(c),null}l=Z.current,mo(c)?S5(c):(l=FT(b,O,h),c.stateNode=l,vi(c))}return Yt(c),null;case 5:if(Xe(c),b=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==O&&vi(c);else{if(!O){if(c.stateNode===null)throw Error(r(166));return Yt(c),null}if(w=Z.current,mo(c))S5(c);else{var _=hh(K.current);switch(w){case 1:w=_.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=_.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=_.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof O.is=="string"?_.createElement("select",{is:O.is}):_.createElement("select"),O.multiple?w.multiple=!0:O.size&&(w.size=O.size);break;default:w=typeof O.is=="string"?_.createElement(b,{is:O.is}):_.createElement(b)}}w[_e]=c,w[Ve]=O;e:for(_=c.child;_!==null;){if(_.tag===5||_.tag===6)w.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===c)break e;for(;_.sibling===null;){if(_.return===null||_.return===c)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}c.stateNode=w;e:switch(Xn(w,b,O),b){case"button":case"input":case"select":case"textarea":O=!!O.autoFocus;break e;case"img":O=!0;break e;default:O=!1}O&&vi(c)}}return Yt(c),V0(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,h),null;case 6:if(l&&c.stateNode!=null)l.memoizedProps!==O&&vi(c);else{if(typeof O!="string"&&c.stateNode===null)throw Error(r(166));if(l=K.current,mo(c)){if(l=c.stateNode,h=c.memoizedProps,O=null,b=An,b!==null)switch(b.tag){case 27:case 5:O=b.memoizedProps}l[_e]=c,l=!!(l.nodeValue===h||O!==null&&O.suppressHydrationWarning===!0||LT(l.nodeValue,h)),l||ra(c,!0)}else l=hh(l).createTextNode(O),l[_e]=c,c.stateNode=l}return Yt(c),null;case 31:if(h=c.memoizedState,l===null||l.memoizedState!==null){if(O=mo(c),h!==null){if(l===null){if(!O)throw Error(r(318));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[_e]=c}else nl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Yt(c),l=!1}else h=KO(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=h),l=!0;if(!l)return c.flags&256?($r(c),c):($r(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Yt(c),null;case 13:if(O=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(b=mo(c),O!==null&&O.dehydrated!==null){if(l===null){if(!b)throw Error(r(318));if(b=c.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[_e]=c}else nl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Yt(c),b=!1}else b=KO(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=b),b=!0;if(!b)return c.flags&256?($r(c),c):($r(c),null)}return $r(c),(c.flags&128)!==0?(c.lanes=h,c):(h=O!==null,l=l!==null&&l.memoizedState!==null,h&&(O=c.child,b=null,O.alternate!==null&&O.alternate.memoizedState!==null&&O.alternate.memoizedState.cachePool!==null&&(b=O.alternate.memoizedState.cachePool.pool),w=null,O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(w=O.memoizedState.cachePool.pool),w!==b&&(O.flags|=2048)),h!==l&&h&&(c.child.flags|=8192),Kd(c,c.updateQueue),Yt(c),null);case 4:return be(),l===null&&ug(c.stateNode.containerInfo),Yt(c),null;case 10:return gi(c.type),Yt(c),null;case 19:if(D(un),O=c.memoizedState,O===null)return Yt(c),null;if(b=(c.flags&128)!==0,w=O.rendering,w===null)if(b)hu(O,!1);else{if(rn!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(w=zd(l),w!==null){for(c.flags|=128,hu(O,!1),l=w.updateQueue,c.updateQueue=l,Kd(c,l),c.subtreeFlags=0,l=h,h=c.child;h!==null;)x5(h,l),h=h.sibling;return ee(un,un.current&1|2),lt&&mi(c,O.treeForkCount),c.child}l=l.sibling}O.tail!==null&&tt()>rh&&(c.flags|=128,b=!0,hu(O,!1),c.lanes=4194304)}else{if(!b)if(l=zd(w),l!==null){if(c.flags|=128,b=!0,l=l.updateQueue,c.updateQueue=l,Kd(c,l),hu(O,!0),O.tail===null&&O.tailMode==="hidden"&&!w.alternate&&!lt)return Yt(c),null}else 2*tt()-O.renderingStartTime>rh&&h!==536870912&&(c.flags|=128,b=!0,hu(O,!1),c.lanes=4194304);O.isBackwards?(w.sibling=c.child,c.child=w):(l=O.last,l!==null?l.sibling=w:c.child=w,O.last=w)}return O.tail!==null?(l=O.tail,O.rendering=l,O.tail=l.sibling,O.renderingStartTime=tt(),l.sibling=null,h=un.current,ee(un,b?h&1|2:h&1),lt&&mi(c,O.treeForkCount),l):(Yt(c),null);case 22:case 23:return $r(c),f0(),O=c.memoizedState!==null,l!==null?l.memoizedState!==null!==O&&(c.flags|=8192):O&&(c.flags|=8192),O?(h&536870912)!==0&&(c.flags&128)===0&&(Yt(c),c.subtreeFlags&6&&(c.flags|=8192)):Yt(c),h=c.updateQueue,h!==null&&Kd(c,h.retryQueue),h=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),O=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(O=c.memoizedState.cachePool.pool),O!==h&&(c.flags|=2048),l!==null&&D(il),null;case 24:return h=null,l!==null&&(h=l.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),gi(gn),Yt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function S8(l,c){switch(HO(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return gi(gn),be(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return Xe(c),null;case 31:if(c.memoizedState!==null){if($r(c),c.alternate===null)throw Error(r(340));nl()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 13:if($r(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(r(340));nl()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return D(un),null;case 4:return be(),null;case 10:return gi(c.type),null;case 22:case 23:return $r(c),f0(),l!==null&&D(il),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return gi(gn),null;case 25:return null;default:return null}}function B$(l,c){switch(HO(c),c.tag){case 3:gi(gn),be();break;case 26:case 27:case 5:Xe(c);break;case 4:be();break;case 31:c.memoizedState!==null&&$r(c);break;case 13:$r(c);break;case 19:D(un);break;case 10:gi(c.type);break;case 22:case 23:$r(c),f0(),l!==null&&D(il);break;case 24:gi(gn)}}function pu(l,c){try{var h=c.updateQueue,O=h!==null?h.lastEffect:null;if(O!==null){var b=O.next;h=b;do{if((h.tag&l)===l){O=void 0;var w=h.create,_=h.inst;O=w(),_.destroy=O}h=h.next}while(h!==b)}}catch(M){$t(c,c.return,M)}}function ua(l,c,h){try{var O=c.updateQueue,b=O!==null?O.lastEffect:null;if(b!==null){var w=b.next;O=w;do{if((O.tag&l)===l){var _=O.inst,M=_.destroy;if(M!==void 0){_.destroy=void 0,b=c;var F=h,le=M;try{le()}catch(fe){$t(b,F,fe)}}}O=O.next}while(O!==w)}}catch(fe){$t(c,c.return,fe)}}function U$(l){var c=l.updateQueue;if(c!==null){var h=l.stateNode;try{q5(c,h)}catch(O){$t(l,l.return,O)}}}function W$(l,c,h){h.props=ul(l.type,l.memoizedProps),h.state=l.memoizedState;try{h.componentWillUnmount()}catch(O){$t(l,c,O)}}function mu(l,c){try{var h=l.ref;if(h!==null){switch(l.tag){case 26:case 27:case 5:var O=l.stateNode;break;case 30:O=l.stateNode;break;default:O=l.stateNode}typeof h=="function"?l.refCleanup=h(O):h.current=O}}catch(b){$t(l,c,b)}}function Ys(l,c){var h=l.ref,O=l.refCleanup;if(h!==null)if(typeof O=="function")try{O()}catch(b){$t(l,c,b)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){$t(l,c,b)}else h.current=null}function G$(l){var c=l.type,h=l.memoizedProps,O=l.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&O.focus();break e;case"img":h.src?O.src=h.src:h.srcSet&&(O.srcset=h.srcSet)}}catch(b){$t(l,l.return,b)}}function Y0(l,c,h){try{var O=l.stateNode;B8(O,l.type,h,c),O[Ve]=c}catch(b){$t(l,l.return,b)}}function I$(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ga(l.type)||l.tag===4}function D0(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||I$(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ga(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function B0(l,c,h){var O=l.tag;if(O===5||O===6)l=l.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(l,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(l),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=di));else if(O!==4&&(O===27&&ga(l.type)&&(h=l.stateNode,c=null),l=l.child,l!==null))for(B0(l,c,h),l=l.sibling;l!==null;)B0(l,c,h),l=l.sibling}function Jd(l,c,h){var O=l.tag;if(O===5||O===6)l=l.stateNode,c?h.insertBefore(l,c):h.appendChild(l);else if(O!==4&&(O===27&&ga(l.type)&&(h=l.stateNode),l=l.child,l!==null))for(Jd(l,c,h),l=l.sibling;l!==null;)Jd(l,c,h),l=l.sibling}function H$(l){var c=l.stateNode,h=l.memoizedProps;try{for(var O=l.type,b=c.attributes;b.length;)c.removeAttributeNode(b[0]);Xn(c,O,h),c[_e]=l,c[Ve]=h}catch(w){$t(l,l.return,w)}}var wi=!1,yn=!1,U0=!1,F$=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function Q8(l,c){if(l=l.containerInfo,hg=yh,l=c5(l),zO(l)){if("selectionStart"in l)var h={start:l.selectionStart,end:l.selectionEnd};else e:{h=(h=l.ownerDocument)&&h.defaultView||window;var O=h.getSelection&&h.getSelection();if(O&&O.rangeCount!==0){h=O.anchorNode;var b=O.anchorOffset,w=O.focusNode;O=O.focusOffset;try{h.nodeType,w.nodeType}catch{h=null;break e}var _=0,M=-1,F=-1,le=0,fe=0,me=l,oe=null;t:for(;;){for(var ce;me!==h||b!==0&&me.nodeType!==3||(M=_+b),me!==w||O!==0&&me.nodeType!==3||(F=_+O),me.nodeType===3&&(_+=me.nodeValue.length),(ce=me.firstChild)!==null;)oe=me,me=ce;for(;;){if(me===l)break t;if(oe===h&&++le===b&&(M=_),oe===w&&++fe===O&&(F=_),(ce=me.nextSibling)!==null)break;me=oe,oe=me.parentNode}me=ce}h=M===-1||F===-1?null:{start:M,end:F}}else h=null}h=h||{start:0,end:0}}else h=null;for(pg={focusedElem:l,selectionRange:h},yh=!1,Cn=c;Cn!==null;)if(c=Cn,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Cn=l;else for(;Cn!==null;){switch(c=Cn,w=c.alternate,l=c.flags,c.tag){case 0:if((l&4)!==0&&(l=c.updateQueue,l=l!==null?l.events:null,l!==null))for(h=0;h<l.length;h++)b=l[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&w!==null){l=void 0,h=c,b=w.memoizedProps,w=w.memoizedState,O=h.stateNode;try{var Re=ul(h.type,b);l=O.getSnapshotBeforeUpdate(Re,w),O.__reactInternalSnapshotBeforeUpdate=l}catch(Ye){$t(h,h.return,Ye)}}break;case 3:if((l&1024)!==0){if(l=c.stateNode.containerInfo,h=l.nodeType,h===9)gg(l);else if(h===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":gg(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(r(163))}if(l=c.sibling,l!==null){l.return=c.return,Cn=l;break}Cn=c.return}}function K$(l,c,h){var O=h.flags;switch(h.tag){case 0:case 11:case 15:Qi(l,h),O&4&&pu(5,h);break;case 1:if(Qi(l,h),O&4)if(l=h.stateNode,c===null)try{l.componentDidMount()}catch(_){$t(h,h.return,_)}else{var b=ul(h.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(b,c,l.__reactInternalSnapshotBeforeUpdate)}catch(_){$t(h,h.return,_)}}O&64&&U$(h),O&512&&mu(h,h.return);break;case 3:if(Qi(l,h),O&64&&(l=h.updateQueue,l!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{q5(l,c)}catch(_){$t(h,h.return,_)}}break;case 27:c===null&&O&4&&H$(h);case 26:case 5:Qi(l,h),c===null&&O&4&&G$(h),O&512&&mu(h,h.return);break;case 12:Qi(l,h);break;case 31:Qi(l,h),O&4&&tT(l,h);break;case 13:Qi(l,h),O&4&&nT(l,h),O&64&&(l=h.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(h=R8.bind(null,h),J8(l,h))));break;case 22:if(O=h.memoizedState!==null||wi,!O){c=c!==null&&c.memoizedState!==null||yn,b=wi;var w=yn;wi=O,(yn=c)&&!w?ki(l,h,(h.subtreeFlags&8772)!==0):Qi(l,h),wi=b,yn=w}break;case 30:break;default:Qi(l,h)}}function J$(l){var c=l.alternate;c!==null&&(l.alternate=null,J$(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&Ha(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var Bt=null,ir=!1;function Si(l,c,h){for(h=h.child;h!==null;)eT(l,c,h),h=h.sibling}function eT(l,c,h){if(de&&typeof de.onCommitFiberUnmount=="function")try{de.onCommitFiberUnmount(ct,h)}catch{}switch(h.tag){case 26:yn||Ys(h,c),Si(l,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:yn||Ys(h,c);var O=Bt,b=ir;ga(h.type)&&(Bt=h.stateNode,ir=!1),Si(l,c,h),Qu(h.stateNode),Bt=O,ir=b;break;case 5:yn||Ys(h,c);case 6:if(O=Bt,b=ir,Bt=null,Si(l,c,h),Bt=O,ir=b,Bt!==null)if(ir)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(h.stateNode)}catch(w){$t(h,c,w)}else try{Bt.removeChild(h.stateNode)}catch(w){$t(h,c,w)}break;case 18:Bt!==null&&(ir?(l=Bt,UT(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,h.stateNode),qo(l)):UT(Bt,h.stateNode));break;case 4:O=Bt,b=ir,Bt=h.stateNode.containerInfo,ir=!0,Si(l,c,h),Bt=O,ir=b;break;case 0:case 11:case 14:case 15:ua(2,h,c),yn||ua(4,h,c),Si(l,c,h);break;case 1:yn||(Ys(h,c),O=h.stateNode,typeof O.componentWillUnmount=="function"&&W$(h,c,O)),Si(l,c,h);break;case 21:Si(l,c,h);break;case 22:yn=(O=yn)||h.memoizedState!==null,Si(l,c,h),yn=O;break;default:Si(l,c,h)}}function tT(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{qo(l)}catch(h){$t(c,c.return,h)}}}function nT(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{qo(l)}catch(h){$t(c,c.return,h)}}function k8(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new F$),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new F$),c;default:throw Error(r(435,l.tag))}}function eh(l,c){var h=k8(l);c.forEach(function(O){if(!h.has(O)){h.add(O);var b=E8.bind(null,l,O);O.then(b,b)}})}function ar(l,c){var h=c.deletions;if(h!==null)for(var O=0;O<h.length;O++){var b=h[O],w=l,_=c,M=_;e:for(;M!==null;){switch(M.tag){case 27:if(ga(M.type)){Bt=M.stateNode,ir=!1;break e}break;case 5:Bt=M.stateNode,ir=!1;break e;case 3:case 4:Bt=M.stateNode.containerInfo,ir=!0;break e}M=M.return}if(Bt===null)throw Error(r(160));eT(w,_,b),Bt=null,ir=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)rT(c,l),c=c.sibling}var vs=null;function rT(l,c){var h=l.alternate,O=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:ar(c,l),lr(l),O&4&&(ua(3,l,l.return),pu(3,l),ua(5,l,l.return));break;case 1:ar(c,l),lr(l),O&512&&(yn||h===null||Ys(h,h.return)),O&64&&wi&&(l=l.updateQueue,l!==null&&(O=l.callbacks,O!==null&&(h=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=h===null?O:h.concat(O))));break;case 26:var b=vs;if(ar(c,l),lr(l),O&512&&(yn||h===null||Ys(h,h.return)),O&4){var w=h!==null?h.memoizedState:null;if(O=l.memoizedState,h===null)if(O===null)if(l.stateNode===null){e:{O=l.type,h=l.memoizedProps,b=b.ownerDocument||b;t:switch(O){case"title":w=b.getElementsByTagName("title")[0],(!w||w[ui]||w[_e]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(O),b.head.insertBefore(w,b.querySelector("head > title"))),Xn(w,O,h),w[_e]=l,tn(w),O=w;break e;case"link":var _=rj("link","href",b).get(O+(h.href||""));if(_){for(var M=0;M<_.length;M++)if(w=_[M],w.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&w.getAttribute("rel")===(h.rel==null?null:h.rel)&&w.getAttribute("title")===(h.title==null?null:h.title)&&w.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){_.splice(M,1);break t}}w=b.createElement(O),Xn(w,O,h),b.head.appendChild(w);break;case"meta":if(_=rj("meta","content",b).get(O+(h.content||""))){for(M=0;M<_.length;M++)if(w=_[M],w.getAttribute("content")===(h.content==null?null:""+h.content)&&w.getAttribute("name")===(h.name==null?null:h.name)&&w.getAttribute("property")===(h.property==null?null:h.property)&&w.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&w.getAttribute("charset")===(h.charSet==null?null:h.charSet)){_.splice(M,1);break t}}w=b.createElement(O),Xn(w,O,h),b.head.appendChild(w);break;default:throw Error(r(468,O))}w[_e]=l,tn(w),O=w}l.stateNode=O}else sj(b,l.type,l.stateNode);else l.stateNode=nj(b,O,l.memoizedProps);else w!==O?(w===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):w.count--,O===null?sj(b,l.type,l.stateNode):nj(b,O,l.memoizedProps)):O===null&&l.stateNode!==null&&Y0(l,l.memoizedProps,h.memoizedProps)}break;case 27:ar(c,l),lr(l),O&512&&(yn||h===null||Ys(h,h.return)),h!==null&&O&4&&Y0(l,l.memoizedProps,h.memoizedProps);break;case 5:if(ar(c,l),lr(l),O&512&&(yn||h===null||Ys(h,h.return)),l.flags&32){b=l.stateNode;try{fi(b,"")}catch(Re){$t(l,l.return,Re)}}O&4&&l.stateNode!=null&&(b=l.memoizedProps,Y0(l,b,h!==null?h.memoizedProps:b)),O&1024&&(U0=!0);break;case 6:if(ar(c,l),lr(l),O&4){if(l.stateNode===null)throw Error(r(162));O=l.memoizedProps,h=l.stateNode;try{h.nodeValue=O}catch(Re){$t(l,l.return,Re)}}break;case 3:if(Oh=null,b=vs,vs=ph(c.containerInfo),ar(c,l),vs=b,lr(l),O&4&&h!==null&&h.memoizedState.isDehydrated)try{qo(c.containerInfo)}catch(Re){$t(l,l.return,Re)}U0&&(U0=!1,sT(l));break;case 4:O=vs,vs=ph(l.stateNode.containerInfo),ar(c,l),lr(l),vs=O;break;case 12:ar(c,l),lr(l);break;case 31:ar(c,l),lr(l),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,eh(l,O)));break;case 13:ar(c,l),lr(l),l.child.flags&8192&&l.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(nh=tt()),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,eh(l,O)));break;case 22:b=l.memoizedState!==null;var F=h!==null&&h.memoizedState!==null,le=wi,fe=yn;if(wi=le||b,yn=fe||F,ar(c,l),yn=fe,wi=le,lr(l),O&8192)e:for(c=l.stateNode,c._visibility=b?c._visibility&-2:c._visibility|1,b&&(h===null||F||wi||yn||fl(l)),h=null,c=l;;){if(c.tag===5||c.tag===26){if(h===null){F=h=c;try{if(w=F.stateNode,b)_=w.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{M=F.stateNode;var me=F.memoizedProps.style,oe=me!=null&&me.hasOwnProperty("display")?me.display:null;M.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Re){$t(F,F.return,Re)}}}else if(c.tag===6){if(h===null){F=c;try{F.stateNode.nodeValue=b?"":F.memoizedProps}catch(Re){$t(F,F.return,Re)}}}else if(c.tag===18){if(h===null){F=c;try{var ce=F.stateNode;b?WT(ce,!0):WT(F.stateNode,!1)}catch(Re){$t(F,F.return,Re)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}O&4&&(O=l.updateQueue,O!==null&&(h=O.retryQueue,h!==null&&(O.retryQueue=null,eh(l,h))));break;case 19:ar(c,l),lr(l),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,eh(l,O)));break;case 30:break;case 21:break;default:ar(c,l),lr(l)}}function lr(l){var c=l.flags;if(c&2){try{for(var h,O=l.return;O!==null;){if(I$(O)){h=O;break}O=O.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,w=D0(l);Jd(l,w,b);break;case 5:var _=h.stateNode;h.flags&32&&(fi(_,""),h.flags&=-33);var M=D0(l);Jd(l,M,_);break;case 3:case 4:var F=h.stateNode.containerInfo,le=D0(l);B0(l,le,F);break;default:throw Error(r(161))}}catch(fe){$t(l,l.return,fe)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function sT(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;sT(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),l=l.sibling}}function Qi(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)K$(l,c.alternate,c),c=c.sibling}function fl(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:ua(4,c,c.return),fl(c);break;case 1:Ys(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&W$(c,c.return,h),fl(c);break;case 27:Qu(c.stateNode);case 26:case 5:Ys(c,c.return),fl(c);break;case 22:c.memoizedState===null&&fl(c);break;case 30:fl(c);break;default:fl(c)}l=l.sibling}}function ki(l,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var O=c.alternate,b=l,w=c,_=w.flags;switch(w.tag){case 0:case 11:case 15:ki(b,w,h),pu(4,w);break;case 1:if(ki(b,w,h),O=w,b=O.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(le){$t(O,O.return,le)}if(O=w,b=O.updateQueue,b!==null){var M=O.stateNode;try{var F=b.shared.hiddenCallbacks;if(F!==null)for(b.shared.hiddenCallbacks=null,b=0;b<F.length;b++)A5(F[b],M)}catch(le){$t(O,O.return,le)}}h&&_&64&&U$(w),mu(w,w.return);break;case 27:H$(w);case 26:case 5:ki(b,w,h),h&&O===null&&_&4&&G$(w),mu(w,w.return);break;case 12:ki(b,w,h);break;case 31:ki(b,w,h),h&&_&4&&tT(b,w);break;case 13:ki(b,w,h),h&&_&4&&nT(b,w);break;case 22:w.memoizedState===null&&ki(b,w,h),mu(w,w.return);break;case 30:break;default:ki(b,w,h)}c=c.sibling}}function W0(l,c){var h=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),l=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(l=c.memoizedState.cachePool.pool),l!==h&&(l!=null&&l.refCount++,h!=null&&tu(h))}function G0(l,c){l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&tu(l))}function ws(l,c,h,O){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)iT(l,c,h,O),c=c.sibling}function iT(l,c,h,O){var b=c.flags;switch(c.tag){case 0:case 11:case 15:ws(l,c,h,O),b&2048&&pu(9,c);break;case 1:ws(l,c,h,O);break;case 3:ws(l,c,h,O),b&2048&&(l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&tu(l)));break;case 12:if(b&2048){ws(l,c,h,O),l=c.stateNode;try{var w=c.memoizedProps,_=w.id,M=w.onPostCommit;typeof M=="function"&&M(_,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(F){$t(c,c.return,F)}}else ws(l,c,h,O);break;case 31:ws(l,c,h,O);break;case 13:ws(l,c,h,O);break;case 23:break;case 22:w=c.stateNode,_=c.alternate,c.memoizedState!==null?w._visibility&2?ws(l,c,h,O):Ou(l,c):w._visibility&2?ws(l,c,h,O):(w._visibility|=2,ko(l,c,h,O,(c.subtreeFlags&10256)!==0||!1)),b&2048&&W0(_,c);break;case 24:ws(l,c,h,O),b&2048&&G0(c.alternate,c);break;default:ws(l,c,h,O)}}function ko(l,c,h,O,b){for(b=b&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var w=l,_=c,M=h,F=O,le=_.flags;switch(_.tag){case 0:case 11:case 15:ko(w,_,M,F,b),pu(8,_);break;case 23:break;case 22:var fe=_.stateNode;_.memoizedState!==null?fe._visibility&2?ko(w,_,M,F,b):Ou(w,_):(fe._visibility|=2,ko(w,_,M,F,b)),b&&le&2048&&W0(_.alternate,_);break;case 24:ko(w,_,M,F,b),b&&le&2048&&G0(_.alternate,_);break;default:ko(w,_,M,F,b)}c=c.sibling}}function Ou(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=l,O=c,b=O.flags;switch(O.tag){case 22:Ou(h,O),b&2048&&W0(O.alternate,O);break;case 24:Ou(h,O),b&2048&&G0(O.alternate,O);break;default:Ou(h,O)}c=c.sibling}}var gu=8192;function $o(l,c,h){if(l.subtreeFlags&gu)for(l=l.child;l!==null;)aT(l,c,h),l=l.sibling}function aT(l,c,h){switch(l.tag){case 26:$o(l,c,h),l.flags&gu&&l.memoizedState!==null&&f9(h,vs,l.memoizedState,l.memoizedProps);break;case 5:$o(l,c,h);break;case 3:case 4:var O=vs;vs=ph(l.stateNode.containerInfo),$o(l,c,h),vs=O;break;case 22:l.memoizedState===null&&(O=l.alternate,O!==null&&O.memoizedState!==null?(O=gu,gu=16777216,$o(l,c,h),gu=O):$o(l,c,h));break;default:$o(l,c,h)}}function lT(l){var c=l.alternate;if(c!==null&&(l=c.child,l!==null)){c.child=null;do c=l.sibling,l.sibling=null,l=c;while(l!==null)}}function xu(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var O=c[h];Cn=O,cT(O,l)}lT(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)oT(l),l=l.sibling}function oT(l){switch(l.tag){case 0:case 11:case 15:xu(l),l.flags&2048&&ua(9,l,l.return);break;case 3:xu(l);break;case 12:xu(l);break;case 22:var c=l.stateNode;l.memoizedState!==null&&c._visibility&2&&(l.return===null||l.return.tag!==13)?(c._visibility&=-3,th(l)):xu(l);break;default:xu(l)}}function th(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var O=c[h];Cn=O,cT(O,l)}lT(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:ua(8,c,c.return),th(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,th(c));break;default:th(c)}l=l.sibling}}function cT(l,c){for(;Cn!==null;){var h=Cn;switch(h.tag){case 0:case 11:case 15:ua(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var O=h.memoizedState.cachePool.pool;O!=null&&O.refCount++}break;case 24:tu(h.memoizedState.cache)}if(O=h.child,O!==null)O.return=h,Cn=O;else e:for(h=l;Cn!==null;){O=Cn;var b=O.sibling,w=O.return;if(J$(O),O===h){Cn=null;break e}if(b!==null){b.return=w,Cn=b;break e}Cn=w}}}var $8={getCacheForType:function(l){var c=qn(gn),h=c.data.get(l);return h===void 0&&(h=l(),c.data.set(l,h)),h},cacheSignal:function(){return qn(gn).controller.signal}},T8=typeof WeakMap=="function"?WeakMap:Map,yt=0,Et=null,nt=null,it=0,kt=0,Tr=null,fa=!1,To=!1,I0=!1,$i=0,rn=0,da=0,dl=0,H0=0,jr=0,jo=0,bu=null,or=null,F0=!1,nh=0,uT=0,rh=1/0,sh=null,ha=null,Tn=0,pa=null,_o=null,Ti=0,K0=0,J0=null,fT=null,yu=0,eg=null;function _r(){return(yt&2)!==0&&it!==0?it&-it:A.T!==null?ag():hs()}function dT(){if(jr===0)if((it&536870912)===0||lt){var l=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),jr=l}else jr=536870912;return l=kr.current,l!==null&&(l.flags|=32),jr}function cr(l,c,h){(l===Et&&(kt===2||kt===9)||l.cancelPendingCommit!==null)&&(Po(l,0),ma(l,it,jr,!1)),mn(l,h),((yt&2)===0||l!==Et)&&(l===Et&&((yt&2)===0&&(dl|=h),rn===4&&ma(l,it,jr,!1)),Ds(l))}function hT(l,c,h){if((yt&6)!==0)throw Error(r(327));var O=!h&&(c&127)===0&&(c&l.expiredLanes)===0||xr(l,c),b=O?P8(l,c):ng(l,c,!0),w=O;do{if(b===0){To&&!O&&ma(l,c,0,!1);break}else{if(h=l.current.alternate,w&&!j8(h)){b=ng(l,c,!1),w=!1;continue}if(b===2){if(w=c,l.errorRecoveryDisabledLanes&w)var _=0;else _=l.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){c=_;e:{var M=l;b=bu;var F=M.current.memoizedState.isDehydrated;if(F&&(Po(M,_).flags|=256),_=ng(M,_,!1),_!==2){if(I0&&!F){M.errorRecoveryDisabledLanes|=w,dl|=w,b=4;break e}w=or,or=b,w!==null&&(or===null?or=w:or.push.apply(or,w))}b=_}if(w=!1,b!==2)continue}}if(b===1){Po(l,0),ma(l,c,0,!0);break}e:{switch(O=l,w=b,w){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ma(O,c,jr,!fa);break e;case 2:or=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(b=nh+300-tt(),10<b)){if(ma(O,c,jr,!fa),cs(O,0,!0)!==0)break e;Ti=c,O.timeoutHandle=DT(pT.bind(null,O,h,or,sh,F0,c,jr,dl,jo,fa,w,"Throttled",-0,0),b);break e}pT(O,h,or,sh,F0,c,jr,dl,jo,fa,w,null,-0,0)}}break}while(!0);Ds(l)}function pT(l,c,h,O,b,w,_,M,F,le,fe,me,oe,ce){if(l.timeoutHandle=-1,me=c.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:di},aT(c,w,me);var Re=(w&62914560)===w?nh-tt():(w&4194048)===w?uT-tt():0;if(Re=d9(me,Re),Re!==null){Ti=w,l.cancelPendingCommit=Re(wT.bind(null,l,c,w,h,O,b,_,M,F,fe,me,null,oe,ce)),ma(l,w,_,!le);return}}wT(l,c,w,h,O,b,_,M,F)}function j8(l){for(var c=l;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var O=0;O<h.length;O++){var b=h[O],w=b.getSnapshot;b=b.value;try{if(!Sr(w(),b))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ma(l,c,h,O){c&=~H0,c&=~dl,l.suspendedLanes|=c,l.pingedLanes&=~c,O&&(l.warmLanes|=c),O=l.expirationTimes;for(var b=c;0<b;){var w=31-ke(b),_=1<<w;O[w]=-1,b&=~_}h!==0&&fs(l,h,c)}function ih(){return(yt&6)===0?(vu(0),!1):!0}function tg(){if(nt!==null){if(kt===0)var l=nt.return;else l=nt,Oi=rl=null,g0(l),yo=null,ru=0,l=nt;for(;l!==null;)B$(l.alternate,l),l=l.return;nt=null}}function Po(l,c){var h=l.timeoutHandle;h!==-1&&(l.timeoutHandle=-1,G8(h)),h=l.cancelPendingCommit,h!==null&&(l.cancelPendingCommit=null,h()),Ti=0,tg(),Et=l,nt=h=pi(l.current,null),it=c,kt=0,Tr=null,fa=!1,To=xr(l,c),I0=!1,jo=jr=H0=dl=da=rn=0,or=bu=null,F0=!1,(c&8)!==0&&(c|=c&32);var O=l.entangledLanes;if(O!==0)for(l=l.entanglements,O&=c;0<O;){var b=31-ke(O),w=1<<b;c|=l[b],O&=~w}return $i=c,$d(),h}function mT(l,c){Ie=null,A.H=fu,c===bo||c===Ed?(c=N5(),kt=3):c===i0?(c=N5(),kt=4):kt=c===R0?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Tr=c,nt===null&&(rn=1,Gd(l,zr(c,l.current)))}function OT(){var l=kr.current;return l===null?!0:(it&4194048)===it?Yr===null:(it&62914560)===it||(it&536870912)!==0?l===Yr:!1}function gT(){var l=A.H;return A.H=fu,l===null?fu:l}function xT(){var l=A.A;return A.A=$8,l}function ah(){rn=4,fa||(it&4194048)!==it&&kr.current!==null||(To=!0),(da&134217727)===0&&(dl&134217727)===0||Et===null||ma(Et,it,jr,!1)}function ng(l,c,h){var O=yt;yt|=2;var b=gT(),w=xT();(Et!==l||it!==c)&&(sh=null,Po(l,c)),c=!1;var _=rn;e:do try{if(kt!==0&&nt!==null){var M=nt,F=Tr;switch(kt){case 8:tg(),_=6;break e;case 3:case 2:case 9:case 6:kr.current===null&&(c=!0);var le=kt;if(kt=0,Tr=null,No(l,M,F,le),h&&To){_=0;break e}break;default:le=kt,kt=0,Tr=null,No(l,M,F,le)}}_8(),_=rn;break}catch(fe){mT(l,fe)}while(!0);return c&&l.shellSuspendCounter++,Oi=rl=null,yt=O,A.H=b,A.A=w,nt===null&&(Et=null,it=0,$d()),_}function _8(){for(;nt!==null;)bT(nt)}function P8(l,c){var h=yt;yt|=2;var O=gT(),b=xT();Et!==l||it!==c?(sh=null,rh=tt()+500,Po(l,c)):To=xr(l,c);e:do try{if(kt!==0&&nt!==null){c=nt;var w=Tr;t:switch(kt){case 1:kt=0,Tr=null,No(l,c,w,1);break;case 2:case 9:if(_5(w)){kt=0,Tr=null,yT(c);break}c=function(){kt!==2&&kt!==9||Et!==l||(kt=7),Ds(l)},w.then(c,c);break e;case 3:kt=7;break e;case 4:kt=5;break e;case 7:_5(w)?(kt=0,Tr=null,yT(c)):(kt=0,Tr=null,No(l,c,w,7));break;case 5:var _=null;switch(nt.tag){case 26:_=nt.memoizedState;case 5:case 27:var M=nt;if(_?ij(_):M.stateNode.complete){kt=0,Tr=null;var F=M.sibling;if(F!==null)nt=F;else{var le=M.return;le!==null?(nt=le,lh(le)):nt=null}break t}}kt=0,Tr=null,No(l,c,w,5);break;case 6:kt=0,Tr=null,No(l,c,w,6);break;case 8:tg(),rn=6;break e;default:throw Error(r(462))}}N8();break}catch(fe){mT(l,fe)}while(!0);return Oi=rl=null,A.H=O,A.A=b,yt=h,nt!==null?0:(Et=null,it=0,$d(),rn)}function N8(){for(;nt!==null&&!ht();)bT(nt)}function bT(l){var c=Y$(l.alternate,l,$i);l.memoizedProps=l.pendingProps,c===null?lh(l):nt=c}function yT(l){var c=l,h=c.alternate;switch(c.tag){case 15:case 0:c=M$(h,c,c.pendingProps,c.type,void 0,it);break;case 11:c=M$(h,c,c.pendingProps,c.type.render,c.ref,it);break;case 5:g0(c);default:B$(h,c),c=nt=x5(c,$i),c=Y$(h,c,$i)}l.memoizedProps=l.pendingProps,c===null?lh(l):nt=c}function No(l,c,h,O){Oi=rl=null,g0(c),yo=null,ru=0;var b=c.return;try{if(b8(l,b,c,h,it)){rn=1,Gd(l,zr(h,l.current)),nt=null;return}}catch(w){if(b!==null)throw nt=b,w;rn=1,Gd(l,zr(h,l.current)),nt=null;return}c.flags&32768?(lt||O===1?l=!0:To||(it&536870912)!==0?l=!1:(fa=l=!0,(O===2||O===9||O===3||O===6)&&(O=kr.current,O!==null&&O.tag===13&&(O.flags|=16384))),vT(c,l)):lh(c)}function lh(l){var c=l;do{if((c.flags&32768)!==0){vT(c,fa);return}l=c.return;var h=w8(c.alternate,c,$i);if(h!==null){nt=h;return}if(c=c.sibling,c!==null){nt=c;return}nt=c=l}while(c!==null);rn===0&&(rn=5)}function vT(l,c){do{var h=S8(l.alternate,l);if(h!==null){h.flags&=32767,nt=h;return}if(h=l.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(l=l.sibling,l!==null)){nt=l;return}nt=l=h}while(l!==null);rn=6,nt=null}function wT(l,c,h,O,b,w,_,M,F){l.cancelPendingCommit=null;do oh();while(Tn!==0);if((yt&6)!==0)throw Error(r(327));if(c!==null){if(c===l.current)throw Error(r(177));if(w=c.lanes|c.childLanes,w|=DO,oi(l,h,w,_,M,F),l===Et&&(nt=Et=null,it=0),_o=c,pa=l,Ti=h,K0=w,J0=b,fT=O,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,A8(St,function(){return TT(),null})):(l.callbackNode=null,l.callbackPriority=0),O=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||O){O=A.T,A.T=null,b=U.p,U.p=2,_=yt,yt|=4;try{Q8(l,c,h)}finally{yt=_,U.p=b,A.T=O}}Tn=1,ST(),QT(),kT()}}function ST(){if(Tn===1){Tn=0;var l=pa,c=_o,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=A.T,A.T=null;var O=U.p;U.p=2;var b=yt;yt|=4;try{rT(c,l);var w=pg,_=c5(l.containerInfo),M=w.focusedElem,F=w.selectionRange;if(_!==M&&M&&M.ownerDocument&&o5(M.ownerDocument.documentElement,M)){if(F!==null&&zO(M)){var le=F.start,fe=F.end;if(fe===void 0&&(fe=le),"selectionStart"in M)M.selectionStart=le,M.selectionEnd=Math.min(fe,M.value.length);else{var me=M.ownerDocument||document,oe=me&&me.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Re=M.textContent.length,Ye=Math.min(F.start,Re),_t=F.end===void 0?Ye:Math.min(F.end,Re);!ce.extend&&Ye>_t&&(_=_t,_t=Ye,Ye=_);var ne=l5(M,Ye),te=l5(M,_t);if(ne&&te&&(ce.rangeCount!==1||ce.anchorNode!==ne.node||ce.anchorOffset!==ne.offset||ce.focusNode!==te.node||ce.focusOffset!==te.offset)){var ie=me.createRange();ie.setStart(ne.node,ne.offset),ce.removeAllRanges(),Ye>_t?(ce.addRange(ie),ce.extend(te.node,te.offset)):(ie.setEnd(te.node,te.offset),ce.addRange(ie))}}}}for(me=[],ce=M;ce=ce.parentNode;)ce.nodeType===1&&me.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<me.length;M++){var he=me[M];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}yh=!!hg,pg=hg=null}finally{yt=b,U.p=O,A.T=h}}l.current=c,Tn=2}}function QT(){if(Tn===2){Tn=0;var l=pa,c=_o,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=A.T,A.T=null;var O=U.p;U.p=2;var b=yt;yt|=4;try{K$(l,c.alternate,c)}finally{yt=b,U.p=O,A.T=h}}Tn=3}}function kT(){if(Tn===4||Tn===3){Tn=0,Je();var l=pa,c=_o,h=Ti,O=fT;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Tn=5:(Tn=0,_o=pa=null,$T(l,l.pendingLanes));var b=l.pendingLanes;if(b===0&&(ha=null),yr(h),c=c.stateNode,de&&typeof de.onCommitFiberRoot=="function")try{de.onCommitFiberRoot(ct,c,void 0,(c.current.flags&128)===128)}catch{}if(O!==null){c=A.T,b=U.p,U.p=2,A.T=null;try{for(var w=l.onRecoverableError,_=0;_<O.length;_++){var M=O[_];w(M.value,{componentStack:M.stack})}}finally{A.T=c,U.p=b}}(Ti&3)!==0&&oh(),Ds(l),b=l.pendingLanes,(h&261930)!==0&&(b&42)!==0?l===eg?yu++:(yu=0,eg=l):yu=0,vu(0)}}function $T(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,tu(c)))}function oh(){return ST(),QT(),kT(),TT()}function TT(){if(Tn!==5)return!1;var l=pa,c=K0;K0=0;var h=yr(Ti),O=A.T,b=U.p;try{U.p=32>h?32:h,A.T=null,h=J0,J0=null;var w=pa,_=Ti;if(Tn=0,_o=pa=null,Ti=0,(yt&6)!==0)throw Error(r(331));var M=yt;if(yt|=4,oT(w.current),iT(w,w.current,_,h),yt=M,vu(0,!1),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(ct,w)}catch{}return!0}finally{U.p=b,A.T=O,$T(l,c)}}function jT(l,c,h){c=zr(h,c),c=C0(l.stateNode,c,2),l=la(l,c,2),l!==null&&(mn(l,2),Ds(l))}function $t(l,c,h){if(l.tag===3)jT(l,l,h);else for(;c!==null;){if(c.tag===3){jT(c,l,h);break}else if(c.tag===1){var O=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof O.componentDidCatch=="function"&&(ha===null||!ha.has(O))){l=zr(h,l),h=_$(2),O=la(c,h,2),O!==null&&(P$(h,O,c,l),mn(O,2),Ds(O));break}}c=c.return}}function rg(l,c,h){var O=l.pingCache;if(O===null){O=l.pingCache=new T8;var b=new Set;O.set(c,b)}else b=O.get(c),b===void 0&&(b=new Set,O.set(c,b));b.has(h)||(I0=!0,b.add(h),l=C8.bind(null,l,c,h),c.then(l,l))}function C8(l,c,h){var O=l.pingCache;O!==null&&O.delete(c),l.pingedLanes|=l.suspendedLanes&h,l.warmLanes&=~h,Et===l&&(it&h)===h&&(rn===4||rn===3&&(it&62914560)===it&&300>tt()-nh?(yt&2)===0&&Po(l,0):H0|=h,jo===it&&(jo=0)),Ds(l)}function _T(l,c){c===0&&(c=us()),l=el(l,c),l!==null&&(mn(l,c),Ds(l))}function R8(l){var c=l.memoizedState,h=0;c!==null&&(h=c.retryLane),_T(l,h)}function E8(l,c){var h=0;switch(l.tag){case 31:case 13:var O=l.stateNode,b=l.memoizedState;b!==null&&(h=b.retryLane);break;case 19:O=l.stateNode;break;case 22:O=l.stateNode._retryCache;break;default:throw Error(r(314))}O!==null&&O.delete(c),_T(l,h)}function A8(l,c){return ot(l,c)}var ch=null,Co=null,sg=!1,uh=!1,ig=!1,Oa=0;function Ds(l){l!==Co&&l.next===null&&(Co===null?ch=Co=l:Co=Co.next=l),uh=!0,sg||(sg=!0,M8())}function vu(l,c){if(!ig&&uh){ig=!0;do for(var h=!1,O=ch;O!==null;){if(l!==0){var b=O.pendingLanes;if(b===0)var w=0;else{var _=O.suspendedLanes,M=O.pingedLanes;w=(1<<31-ke(42|l)+1)-1,w&=b&~(_&~M),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(h=!0,RT(O,w))}else w=it,w=cs(O,O===Et?w:0,O.cancelPendingCommit!==null||O.timeoutHandle!==-1),(w&3)===0||xr(O,w)||(h=!0,RT(O,w));O=O.next}while(h);ig=!1}}function q8(){PT()}function PT(){uh=sg=!1;var l=0;Oa!==0&&W8()&&(l=Oa);for(var c=tt(),h=null,O=ch;O!==null;){var b=O.next,w=NT(O,c);w===0?(O.next=null,h===null?ch=b:h.next=b,b===null&&(Co=h)):(h=O,(l!==0||(w&3)!==0)&&(uh=!0)),O=b}Tn!==0&&Tn!==5||vu(l),Oa!==0&&(Oa=0)}function NT(l,c){for(var h=l.suspendedLanes,O=l.pingedLanes,b=l.expirationTimes,w=l.pendingLanes&-62914561;0<w;){var _=31-ke(w),M=1<<_,F=b[_];F===-1?((M&h)===0||(M&O)!==0)&&(b[_]=Ia(M,c)):F<=c&&(l.expiredLanes|=M),w&=~M}if(c=Et,h=it,h=cs(l,l===c?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),O=l.callbackNode,h===0||l===c&&(kt===2||kt===9)||l.cancelPendingCommit!==null)return O!==null&&O!==null&&st(O),l.callbackNode=null,l.callbackPriority=0;if((h&3)===0||xr(l,h)){if(c=h&-h,c===l.callbackPriority)return c;switch(O!==null&&st(O),yr(h)){case 2:case 8:h=zt;break;case 32:h=St;break;case 268435456:h=ln;break;default:h=St}return O=CT.bind(null,l),h=ot(h,O),l.callbackPriority=c,l.callbackNode=h,c}return O!==null&&O!==null&&st(O),l.callbackPriority=2,l.callbackNode=null,2}function CT(l,c){if(Tn!==0&&Tn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var h=l.callbackNode;if(oh()&&l.callbackNode!==h)return null;var O=it;return O=cs(l,l===Et?O:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),O===0?null:(hT(l,O,c),NT(l,tt()),l.callbackNode!=null&&l.callbackNode===h?CT.bind(null,l):null)}function RT(l,c){if(oh())return null;hT(l,c,!0)}function M8(){I8(function(){(yt&6)!==0?ot(Qt,q8):PT()})}function ag(){if(Oa===0){var l=go;l===0&&(l=kn,kn<<=1,(kn&261888)===0&&(kn=256)),Oa=l}return Oa}function ET(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:xd(""+l)}function AT(l,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,l.id&&h.setAttribute("form",l.id),c.parentNode.insertBefore(h,c),l=new FormData(l),h.parentNode.removeChild(h),l}function X8(l,c,h,O,b){if(c==="submit"&&h&&h.stateNode===b){var w=ET((b[Ve]||null).action),_=O.submitter;_&&(c=(c=_[Ve]||null)?ET(c.formAction):_.getAttribute("formAction"),c!==null&&(w=c,_=null));var M=new wd("action","action",null,O,b);l.push({event:M,listeners:[{instance:null,listener:function(){if(O.defaultPrevented){if(Oa!==0){var F=_?AT(b,_):new FormData(b);$0(h,{pending:!0,data:F,method:b.method,action:w},null,F)}}else typeof w=="function"&&(M.preventDefault(),F=_?AT(b,_):new FormData(b),$0(h,{pending:!0,data:F,method:b.method,action:w},w,F))},currentTarget:b}]})}}for(var lg=0;lg<YO.length;lg++){var og=YO[lg],z8=og.toLowerCase(),L8=og[0].toUpperCase()+og.slice(1);ys(z8,"on"+L8)}ys(d5,"onAnimationEnd"),ys(h5,"onAnimationIteration"),ys(p5,"onAnimationStart"),ys("dblclick","onDoubleClick"),ys("focusin","onFocus"),ys("focusout","onBlur"),ys(n8,"onTransitionRun"),ys(r8,"onTransitionStart"),ys(s8,"onTransitionCancel"),ys(m5,"onTransitionEnd"),xs("onMouseEnter",["mouseout","mouseover"]),xs("onMouseLeave",["mouseout","mouseover"]),xs("onPointerEnter",["pointerout","pointerover"]),xs("onPointerLeave",["pointerout","pointerover"]),gs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gs("onBeforeInput",["compositionend","keypress","textInput","paste"]),gs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="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(" "),Z8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wu));function qT(l,c){c=(c&4)!==0;for(var h=0;h<l.length;h++){var O=l[h],b=O.event;O=O.listeners;e:{var w=void 0;if(c)for(var _=O.length-1;0<=_;_--){var M=O[_],F=M.instance,le=M.currentTarget;if(M=M.listener,F!==w&&b.isPropagationStopped())break e;w=M,b.currentTarget=le;try{w(b)}catch(fe){kd(fe)}b.currentTarget=null,w=F}else for(_=0;_<O.length;_++){if(M=O[_],F=M.instance,le=M.currentTarget,M=M.listener,F!==w&&b.isPropagationStopped())break e;w=M,b.currentTarget=le;try{w(b)}catch(fe){kd(fe)}b.currentTarget=null,w=F}}}}function rt(l,c){var h=c[On];h===void 0&&(h=c[On]=new Set);var O=l+"__bubble";h.has(O)||(MT(c,l,2,!1),h.add(O))}function cg(l,c,h){var O=0;c&&(O|=4),MT(h,l,O,c)}var fh="_reactListening"+Math.random().toString(36).slice(2);function ug(l){if(!l[fh]){l[fh]=!0,Kl.forEach(function(h){h!=="selectionchange"&&(Z8.has(h)||cg(h,!1,l),cg(h,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[fh]||(c[fh]=!0,cg("selectionchange",!1,c))}}function MT(l,c,h,O){switch(dj(c)){case 2:var b=m9;break;case 8:b=O9;break;default:b=kg}h=b.bind(null,c,h,l),b=void 0,!PO||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(b=!0),O?b!==void 0?l.addEventListener(c,h,{capture:!0,passive:b}):l.addEventListener(c,h,!0):b!==void 0?l.addEventListener(c,h,{passive:b}):l.addEventListener(c,h,!1)}function fg(l,c,h,O,b){var w=O;if((c&1)===0&&(c&2)===0&&O!==null)e:for(;;){if(O===null)return;var _=O.tag;if(_===3||_===4){var M=O.stateNode.containerInfo;if(M===b)break;if(_===4)for(_=O.return;_!==null;){var F=_.tag;if((F===3||F===4)&&_.stateNode.containerInfo===b)return;_=_.return}for(;M!==null;){if(_=ms(M),_===null)return;if(F=_.tag,F===5||F===6||F===26||F===27){O=w=_;continue e}M=M.parentNode}}O=O.return}Vk(function(){var le=w,fe=jO(h),me=[];e:{var oe=O5.get(l);if(oe!==void 0){var ce=wd,Re=l;switch(l){case"keypress":if(yd(h)===0)break e;case"keydown":case"keyup":ce=E6;break;case"focusin":Re="focus",ce=EO;break;case"focusout":Re="blur",ce=EO;break;case"beforeblur":case"afterblur":ce=EO;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Bk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=w6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=M6;break;case d5:case h5:case p5:ce=k6;break;case m5:ce=z6;break;case"scroll":case"scrollend":ce=y6;break;case"wheel":ce=Z6;break;case"copy":case"cut":case"paste":ce=T6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=Wk;break;case"toggle":case"beforetoggle":ce=Y6}var Ye=(c&4)!==0,_t=!Ye&&(l==="scroll"||l==="scrollend"),ne=Ye?oe!==null?oe+"Capture":null:oe;Ye=[];for(var te=le,ie;te!==null;){var he=te;if(ie=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ie===null||ne===null||(he=Dc(te,ne),he!=null&&Ye.push(Su(te,he,ie))),_t)break;te=te.return}0<Ye.length&&(oe=new ce(oe,Re,null,h,fe),me.push({event:oe,listeners:Ye}))}}if((c&7)===0){e:{if(oe=l==="mouseover"||l==="pointerover",ce=l==="mouseout"||l==="pointerout",oe&&h!==TO&&(Re=h.relatedTarget||h.fromElement)&&(ms(Re)||Re[Rt]))break e;if((ce||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Re=h.relatedTarget||h.toElement,ce=le,Re=Re?ms(Re):null,Re!==null&&(_t=i(Re),Ye=Re.tag,Re!==_t||Ye!==5&&Ye!==27&&Ye!==6)&&(Re=null)):(ce=null,Re=le),ce!==Re)){if(Ye=Bk,he="onMouseLeave",ne="onMouseEnter",te="mouse",(l==="pointerout"||l==="pointerover")&&(Ye=Wk,he="onPointerLeave",ne="onPointerEnter",te="pointer"),_t=ce==null?oe:zs(ce),ie=Re==null?oe:zs(Re),oe=new Ye(he,te+"leave",ce,h,fe),oe.target=_t,oe.relatedTarget=ie,he=null,ms(fe)===le&&(Ye=new Ye(ne,te+"enter",Re,h,fe),Ye.target=ie,Ye.relatedTarget=_t,he=Ye),_t=he,ce&&Re)t:{for(Ye=V8,ne=ce,te=Re,ie=0,he=ne;he;he=Ye(he))ie++;he=0;for(var Le=te;Le;Le=Ye(Le))he++;for(;0<ie-he;)ne=Ye(ne),ie--;for(;0<he-ie;)te=Ye(te),he--;for(;ie--;){if(ne===te||te!==null&&ne===te.alternate){Ye=ne;break t}ne=Ye(ne),te=Ye(te)}Ye=null}else Ye=null;ce!==null&&XT(me,oe,ce,Ye,!1),Re!==null&&_t!==null&&XT(me,_t,Re,Ye,!0)}}e:{if(oe=le?zs(le):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var Ot=t5;else if(Jk(oe))if(n5)Ot=J6;else{Ot=F6;var Ee=H6}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?le&&Yc(le.elementType)&&(Ot=t5):Ot=K6;if(Ot&&(Ot=Ot(l,le))){e5(me,Ot,h,fe);break e}Ee&&Ee(l,oe,le),l==="focusout"&&le&&oe.type==="number"&&le.memoizedProps.value!=null&&wr(oe,"number",oe.value)}switch(Ee=le?zs(le):window,l){case"focusin":(Jk(Ee)||Ee.contentEditable==="true")&&(oo=Ee,LO=le,Kc=null);break;case"focusout":Kc=LO=oo=null;break;case"mousedown":ZO=!0;break;case"contextmenu":case"mouseup":case"dragend":ZO=!1,u5(me,h,fe);break;case"selectionchange":if(t8)break;case"keydown":case"keyup":u5(me,h,fe)}var He;if(qO)e:{switch(l){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else lo?Fk(l,h)&&(at="onCompositionEnd"):l==="keydown"&&h.keyCode===229&&(at="onCompositionStart");at&&(Gk&&h.locale!=="ko"&&(lo||at!=="onCompositionStart"?at==="onCompositionEnd"&&lo&&(He=Yk()):(ea=fe,NO="value"in ea?ea.value:ea.textContent,lo=!0)),Ee=dh(le,at),0<Ee.length&&(at=new Uk(at,l,null,h,fe),me.push({event:at,listeners:Ee}),He?at.data=He:(He=Kk(h),He!==null&&(at.data=He)))),(He=B6?U6(l,h):W6(l,h))&&(at=dh(le,"onBeforeInput"),0<at.length&&(Ee=new Uk("onBeforeInput","beforeinput",null,h,fe),me.push({event:Ee,listeners:at}),Ee.data=He)),X8(me,l,le,h,fe)}qT(me,c)})}function Su(l,c,h){return{instance:l,listener:c,currentTarget:h}}function dh(l,c){for(var h=c+"Capture",O=[];l!==null;){var b=l,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=Dc(l,h),b!=null&&O.unshift(Su(l,b,w)),b=Dc(l,c),b!=null&&O.push(Su(l,b,w))),l.tag===3)return O;l=l.return}return[]}function V8(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function XT(l,c,h,O,b){for(var w=c._reactName,_=[];h!==null&&h!==O;){var M=h,F=M.alternate,le=M.stateNode;if(M=M.tag,F!==null&&F===O)break;M!==5&&M!==26&&M!==27||le===null||(F=le,b?(le=Dc(h,w),le!=null&&_.unshift(Su(h,le,F))):b||(le=Dc(h,w),le!=null&&_.push(Su(h,le,F)))),h=h.return}_.length!==0&&l.push({event:c,listeners:_})}var Y8=/\r\n?/g,D8=/\u0000|\uFFFD/g;function zT(l){return(typeof l=="string"?l:""+l).replace(Y8,`
|
|
49
|
-
`).replace(D8,"")}function LT(l,c){return c=zT(c),zT(l)===c}function jt(l,c,h,O,b,w){switch(h){case"children":typeof O=="string"?c==="body"||c==="textarea"&&O===""||fi(l,O):(typeof O=="number"||typeof O=="bigint")&&c!=="body"&&fi(l,""+O);break;case"className":ro(l,"class",O);break;case"tabIndex":ro(l,"tabindex",O);break;case"dir":case"role":case"viewBox":case"width":case"height":ro(l,h,O);break;case"style":gd(l,O,w);break;case"data":if(c!=="object"){ro(l,"data",O);break}case"src":case"href":if(O===""&&(c!=="a"||h!=="href")){l.removeAttribute(h);break}if(O==null||typeof O=="function"||typeof O=="symbol"||typeof O=="boolean"){l.removeAttribute(h);break}O=xd(""+O),l.setAttribute(h,O);break;case"action":case"formAction":if(typeof O=="function"){l.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(h==="formAction"?(c!=="input"&&jt(l,c,"name",b.name,b,null),jt(l,c,"formEncType",b.formEncType,b,null),jt(l,c,"formMethod",b.formMethod,b,null),jt(l,c,"formTarget",b.formTarget,b,null)):(jt(l,c,"encType",b.encType,b,null),jt(l,c,"method",b.method,b,null),jt(l,c,"target",b.target,b,null)));if(O==null||typeof O=="symbol"||typeof O=="boolean"){l.removeAttribute(h);break}O=xd(""+O),l.setAttribute(h,O);break;case"onClick":O!=null&&(l.onclick=di);break;case"onScroll":O!=null&&rt("scroll",l);break;case"onScrollEnd":O!=null&&rt("scrollend",l);break;case"dangerouslySetInnerHTML":if(O!=null){if(typeof O!="object"||!("__html"in O))throw Error(r(61));if(h=O.__html,h!=null){if(b.children!=null)throw Error(r(60));l.innerHTML=h}}break;case"multiple":l.multiple=O&&typeof O!="function"&&typeof O!="symbol";break;case"muted":l.muted=O&&typeof O!="function"&&typeof O!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(O==null||typeof O=="function"||typeof O=="boolean"||typeof O=="symbol"){l.removeAttribute("xlink:href");break}h=xd(""+O),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":O!=null&&typeof O!="function"&&typeof O!="symbol"?l.setAttribute(h,""+O):l.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":O&&typeof O!="function"&&typeof O!="symbol"?l.setAttribute(h,""):l.removeAttribute(h);break;case"capture":case"download":O===!0?l.setAttribute(h,""):O!==!1&&O!=null&&typeof O!="function"&&typeof O!="symbol"?l.setAttribute(h,O):l.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":O!=null&&typeof O!="function"&&typeof O!="symbol"&&!isNaN(O)&&1<=O?l.setAttribute(h,O):l.removeAttribute(h);break;case"rowSpan":case"start":O==null||typeof O=="function"||typeof O=="symbol"||isNaN(O)?l.removeAttribute(h):l.setAttribute(h,O);break;case"popover":rt("beforetoggle",l),rt("toggle",l),no(l,"popover",O);break;case"xlinkActuate":bs(l,"http://www.w3.org/1999/xlink","xlink:actuate",O);break;case"xlinkArcrole":bs(l,"http://www.w3.org/1999/xlink","xlink:arcrole",O);break;case"xlinkRole":bs(l,"http://www.w3.org/1999/xlink","xlink:role",O);break;case"xlinkShow":bs(l,"http://www.w3.org/1999/xlink","xlink:show",O);break;case"xlinkTitle":bs(l,"http://www.w3.org/1999/xlink","xlink:title",O);break;case"xlinkType":bs(l,"http://www.w3.org/1999/xlink","xlink:type",O);break;case"xmlBase":bs(l,"http://www.w3.org/XML/1998/namespace","xml:base",O);break;case"xmlLang":bs(l,"http://www.w3.org/XML/1998/namespace","xml:lang",O);break;case"xmlSpace":bs(l,"http://www.w3.org/XML/1998/namespace","xml:space",O);break;case"is":no(l,"is",O);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=$O.get(h)||h,no(l,h,O))}}function dg(l,c,h,O,b,w){switch(h){case"style":gd(l,O,w);break;case"dangerouslySetInnerHTML":if(O!=null){if(typeof O!="object"||!("__html"in O))throw Error(r(61));if(h=O.__html,h!=null){if(b.children!=null)throw Error(r(60));l.innerHTML=h}}break;case"children":typeof O=="string"?fi(l,O):(typeof O=="number"||typeof O=="bigint")&&fi(l,""+O);break;case"onScroll":O!=null&&rt("scroll",l);break;case"onScrollEnd":O!=null&&rt("scrollend",l);break;case"onClick":O!=null&&(l.onclick=di);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jl.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),c=h.slice(2,b?h.length-7:void 0),w=l[Ve]||null,w=w!=null?w[h]:null,typeof w=="function"&&l.removeEventListener(c,w,b),typeof O=="function")){typeof w!="function"&&w!==null&&(h in l?l[h]=null:l.hasAttribute(h)&&l.removeAttribute(h)),l.addEventListener(c,O,b);break e}h in l?l[h]=O:O===!0?l.setAttribute(h,""):no(l,h,O)}}}function Xn(l,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",l),rt("load",l);var O=!1,b=!1,w;for(w in h)if(h.hasOwnProperty(w)){var _=h[w];if(_!=null)switch(w){case"src":O=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:jt(l,c,w,_,h,null)}}b&&jt(l,c,"srcSet",h.srcSet,h,null),O&&jt(l,c,"src",h.src,h,null);return;case"input":rt("invalid",l);var M=w=_=b=null,F=null,le=null;for(O in h)if(h.hasOwnProperty(O)){var fe=h[O];if(fe!=null)switch(O){case"name":b=fe;break;case"type":_=fe;break;case"checked":F=fe;break;case"defaultChecked":le=fe;break;case"value":w=fe;break;case"defaultValue":M=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,c));break;default:jt(l,c,O,fe,h,null)}}vr(l,w,M,F,le,_,b,!1);return;case"select":rt("invalid",l),O=_=w=null;for(b in h)if(h.hasOwnProperty(b)&&(M=h[b],M!=null))switch(b){case"value":w=M;break;case"defaultValue":_=M;break;case"multiple":O=M;default:jt(l,c,b,M,h,null)}c=w,h=_,l.multiple=!!O,c!=null?rr(l,!!O,c,!1):h!=null&&rr(l,!!O,h,!0);return;case"textarea":rt("invalid",l),w=b=O=null;for(_ in h)if(h.hasOwnProperty(_)&&(M=h[_],M!=null))switch(_){case"value":O=M;break;case"defaultValue":b=M;break;case"children":w=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:jt(l,c,_,M,h,null)}md(l,O,b,w);return;case"option":for(F in h)if(h.hasOwnProperty(F)&&(O=h[F],O!=null))switch(F){case"selected":l.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:jt(l,c,F,O,h,null)}return;case"dialog":rt("beforetoggle",l),rt("toggle",l),rt("cancel",l),rt("close",l);break;case"iframe":case"object":rt("load",l);break;case"video":case"audio":for(O=0;O<wu.length;O++)rt(wu[O],l);break;case"image":rt("error",l),rt("load",l);break;case"details":rt("toggle",l);break;case"embed":case"source":case"link":rt("error",l),rt("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in h)if(h.hasOwnProperty(le)&&(O=h[le],O!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:jt(l,c,le,O,h,null)}return;default:if(Yc(c)){for(fe in h)h.hasOwnProperty(fe)&&(O=h[fe],O!==void 0&&dg(l,c,fe,O,h,void 0));return}}for(M in h)h.hasOwnProperty(M)&&(O=h[M],O!=null&&jt(l,c,M,O,h,null))}function B8(l,c,h,O){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,_=null,M=null,F=null,le=null,fe=null;for(ce in h){var me=h[ce];if(h.hasOwnProperty(ce)&&me!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":F=me;default:O.hasOwnProperty(ce)||jt(l,c,ce,null,O,me)}}for(var oe in O){var ce=O[oe];if(me=h[oe],O.hasOwnProperty(oe)&&(ce!=null||me!=null))switch(oe){case"type":w=ce;break;case"name":b=ce;break;case"checked":le=ce;break;case"defaultChecked":fe=ce;break;case"value":_=ce;break;case"defaultValue":M=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,c));break;default:ce!==me&&jt(l,c,oe,ce,O,me)}}Dn(l,_,M,F,le,fe,w,b);return;case"select":ce=_=M=oe=null;for(w in h)if(F=h[w],h.hasOwnProperty(w)&&F!=null)switch(w){case"value":break;case"multiple":ce=F;default:O.hasOwnProperty(w)||jt(l,c,w,null,O,F)}for(b in O)if(w=O[b],F=h[b],O.hasOwnProperty(b)&&(w!=null||F!=null))switch(b){case"value":oe=w;break;case"defaultValue":M=w;break;case"multiple":_=w;default:w!==F&&jt(l,c,b,w,O,F)}c=M,h=_,O=ce,oe!=null?rr(l,!!h,oe,!1):!!O!=!!h&&(c!=null?rr(l,!!h,c,!0):rr(l,!!h,h?[]:"",!1));return;case"textarea":ce=oe=null;for(M in h)if(b=h[M],h.hasOwnProperty(M)&&b!=null&&!O.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:jt(l,c,M,null,O,b)}for(_ in O)if(b=O[_],w=h[_],O.hasOwnProperty(_)&&(b!=null||w!=null))switch(_){case"value":oe=b;break;case"defaultValue":ce=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&jt(l,c,_,b,O,w)}pd(l,oe,ce);return;case"option":for(var Re in h)if(oe=h[Re],h.hasOwnProperty(Re)&&oe!=null&&!O.hasOwnProperty(Re))switch(Re){case"selected":l.selected=!1;break;default:jt(l,c,Re,null,O,oe)}for(F in O)if(oe=O[F],ce=h[F],O.hasOwnProperty(F)&&oe!==ce&&(oe!=null||ce!=null))switch(F){case"selected":l.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:jt(l,c,F,oe,O,ce)}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 Ye in h)oe=h[Ye],h.hasOwnProperty(Ye)&&oe!=null&&!O.hasOwnProperty(Ye)&&jt(l,c,Ye,null,O,oe);for(le in O)if(oe=O[le],ce=h[le],O.hasOwnProperty(le)&&oe!==ce&&(oe!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,c));break;default:jt(l,c,le,oe,O,ce)}return;default:if(Yc(c)){for(var _t in h)oe=h[_t],h.hasOwnProperty(_t)&&oe!==void 0&&!O.hasOwnProperty(_t)&&dg(l,c,_t,void 0,O,oe);for(fe in O)oe=O[fe],ce=h[fe],!O.hasOwnProperty(fe)||oe===ce||oe===void 0&&ce===void 0||dg(l,c,fe,oe,O,ce);return}}for(var ne in h)oe=h[ne],h.hasOwnProperty(ne)&&oe!=null&&!O.hasOwnProperty(ne)&&jt(l,c,ne,null,O,oe);for(me in O)oe=O[me],ce=h[me],!O.hasOwnProperty(me)||oe===ce||oe==null&&ce==null||jt(l,c,me,oe,O,ce)}function ZT(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function U8(){if(typeof performance.getEntriesByType=="function"){for(var l=0,c=0,h=performance.getEntriesByType("resource"),O=0;O<h.length;O++){var b=h[O],w=b.transferSize,_=b.initiatorType,M=b.duration;if(w&&M&&ZT(_)){for(_=0,M=b.responseEnd,O+=1;O<h.length;O++){var F=h[O],le=F.startTime;if(le>M)break;var fe=F.transferSize,me=F.initiatorType;fe&&ZT(me)&&(F=F.responseEnd,_+=fe*(F<M?1:(M-le)/(F-le)))}if(--O,c+=8*(w+_)/(b.duration/1e3),l++,10<l)break}}if(0<l)return c/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var hg=null,pg=null;function hh(l){return l.nodeType===9?l:l.ownerDocument}function VT(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function YT(l,c){if(l===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&c==="foreignObject"?0:l}function mg(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Og=null;function W8(){var l=window.event;return l&&l.type==="popstate"?l===Og?!1:(Og=l,!0):(Og=null,!1)}var DT=typeof setTimeout=="function"?setTimeout:void 0,G8=typeof clearTimeout=="function"?clearTimeout:void 0,BT=typeof Promise=="function"?Promise:void 0,I8=typeof queueMicrotask=="function"?queueMicrotask:typeof BT<"u"?function(l){return BT.resolve(null).then(l).catch(H8)}:DT;function H8(l){setTimeout(function(){throw l})}function ga(l){return l==="head"}function UT(l,c){var h=c,O=0;do{var b=h.nextSibling;if(l.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(O===0){l.removeChild(b),qo(c);return}O--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")O++;else if(h==="html")Qu(l.ownerDocument.documentElement);else if(h==="head"){h=l.ownerDocument.head,Qu(h);for(var w=h.firstChild;w;){var _=w.nextSibling,M=w.nodeName;w[ui]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&w.rel.toLowerCase()==="stylesheet"||h.removeChild(w),w=_}}else h==="body"&&Qu(l.ownerDocument.body);h=b}while(h);qo(c)}function WT(l,c){var h=l;l=0;do{var O=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),O&&O.nodeType===8)if(h=O.data,h==="/$"){if(l===0)break;l--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||l++;h=O}while(h)}function gg(l){var c=l.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":gg(h),Ha(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}l.removeChild(h)}}function F8(l,c,h,O){for(;l.nodeType===1;){var b=h;if(l.nodeName.toLowerCase()!==c.toLowerCase()){if(!O&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(O){if(!l[ui])switch(c){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(w=l.getAttribute("rel"),w==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(w!==b.rel||l.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||l.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||l.getAttribute("title")!==(b.title==null?null:b.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(w=l.getAttribute("src"),(w!==(b.src==null?null:b.src)||l.getAttribute("type")!==(b.type==null?null:b.type)||l.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(c==="input"&&l.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&l.getAttribute("name")===w)return l}else return l;if(l=Dr(l.nextSibling),l===null)break}return null}function K8(l,c,h){if(c==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!h||(l=Dr(l.nextSibling),l===null))return null;return l}function GT(l,c){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!c||(l=Dr(l.nextSibling),l===null))return null;return l}function xg(l){return l.data==="$?"||l.data==="$~"}function bg(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function J8(l,c){var h=l.ownerDocument;if(l.data==="$~")l._reactRetry=c;else if(l.data!=="$?"||h.readyState!=="loading")c();else{var O=function(){c(),h.removeEventListener("DOMContentLoaded",O)};h.addEventListener("DOMContentLoaded",O),l._reactRetry=O}}function Dr(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return l}var yg=null;function IT(l){l=l.nextSibling;for(var c=0;l;){if(l.nodeType===8){var h=l.data;if(h==="/$"||h==="/&"){if(c===0)return Dr(l.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}l=l.nextSibling}return null}function HT(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var h=l.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return l;c--}else h!=="/$"&&h!=="/&"||c++}l=l.previousSibling}return null}function FT(l,c,h){switch(c=hh(h),l){case"html":if(l=c.documentElement,!l)throw Error(r(452));return l;case"head":if(l=c.head,!l)throw Error(r(453));return l;case"body":if(l=c.body,!l)throw Error(r(454));return l;default:throw Error(r(451))}}function Qu(l){for(var c=l.attributes;c.length;)l.removeAttributeNode(c[0]);Ha(l)}var Br=new Map,KT=new Set;function ph(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var ji=U.d;U.d={f:e9,r:t9,D:n9,C:r9,L:s9,m:i9,X:l9,S:a9,M:o9};function e9(){var l=ji.f(),c=ih();return l||c}function t9(l){var c=Os(l);c!==null&&c.tag===5&&c.type==="form"?m$(c):ji.r(l)}var Ro=typeof document>"u"?null:document;function JT(l,c,h){var O=Ro;if(O&&typeof c=="string"&&c){var b=mt(c);b='link[rel="'+l+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),KT.has(b)||(KT.add(b),l={rel:l,crossOrigin:h,href:c},O.querySelector(b)===null&&(c=O.createElement("link"),Xn(c,"link",l),tn(c),O.head.appendChild(c)))}}function n9(l){ji.D(l),JT("dns-prefetch",l,null)}function r9(l,c){ji.C(l,c),JT("preconnect",l,c)}function s9(l,c,h){ji.L(l,c,h);var O=Ro;if(O&&l&&c){var b='link[rel="preload"][as="'+mt(c)+'"]';c==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+mt(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+mt(h.imageSizes)+'"]')):b+='[href="'+mt(l)+'"]';var w=b;switch(c){case"style":w=Eo(l);break;case"script":w=Ao(l)}Br.has(w)||(l=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:l,as:c},h),Br.set(w,l),O.querySelector(b)!==null||c==="style"&&O.querySelector(ku(w))||c==="script"&&O.querySelector($u(w))||(c=O.createElement("link"),Xn(c,"link",l),tn(c),O.head.appendChild(c)))}}function i9(l,c){ji.m(l,c);var h=Ro;if(h&&l){var O=c&&typeof c.as=="string"?c.as:"script",b='link[rel="modulepreload"][as="'+mt(O)+'"][href="'+mt(l)+'"]',w=b;switch(O){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ao(l)}if(!Br.has(w)&&(l=m({rel:"modulepreload",href:l},c),Br.set(w,l),h.querySelector(b)===null)){switch(O){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector($u(w)))return}O=h.createElement("link"),Xn(O,"link",l),tn(O),h.head.appendChild(O)}}}function a9(l,c,h){ji.S(l,c,h);var O=Ro;if(O&&l){var b=Ls(O).hoistableStyles,w=Eo(l);c=c||"default";var _=b.get(w);if(!_){var M={loading:0,preload:null};if(_=O.querySelector(ku(w)))M.loading=5;else{l=m({rel:"stylesheet",href:l,"data-precedence":c},h),(h=Br.get(w))&&vg(l,h);var F=_=O.createElement("link");tn(F),Xn(F,"link",l),F._p=new Promise(function(le,fe){F.onload=le,F.onerror=fe}),F.addEventListener("load",function(){M.loading|=1}),F.addEventListener("error",function(){M.loading|=2}),M.loading|=4,mh(_,c,O)}_={type:"stylesheet",instance:_,count:1,state:M},b.set(w,_)}}}function l9(l,c){ji.X(l,c);var h=Ro;if(h&&l){var O=Ls(h).hoistableScripts,b=Ao(l),w=O.get(b);w||(w=h.querySelector($u(b)),w||(l=m({src:l,async:!0},c),(c=Br.get(b))&&wg(l,c),w=h.createElement("script"),tn(w),Xn(w,"link",l),h.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},O.set(b,w))}}function o9(l,c){ji.M(l,c);var h=Ro;if(h&&l){var O=Ls(h).hoistableScripts,b=Ao(l),w=O.get(b);w||(w=h.querySelector($u(b)),w||(l=m({src:l,async:!0,type:"module"},c),(c=Br.get(b))&&wg(l,c),w=h.createElement("script"),tn(w),Xn(w,"link",l),h.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},O.set(b,w))}}function ej(l,c,h,O){var b=(b=K.current)?ph(b):null;if(!b)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=Eo(h.href),h=Ls(b).hoistableStyles,O=h.get(c),O||(O={type:"style",instance:null,count:0,state:null},h.set(c,O)),O):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){l=Eo(h.href);var w=Ls(b).hoistableStyles,_=w.get(l);if(_||(b=b.ownerDocument||b,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(l,_),(w=b.querySelector(ku(l)))&&!w._p&&(_.instance=w,_.state.loading=5),Br.has(l)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Br.set(l,h),w||c9(b,l,h,_.state))),c&&O===null)throw Error(r(528,""));return _}if(c&&O!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Ao(h),h=Ls(b).hoistableScripts,O=h.get(c),O||(O={type:"script",instance:null,count:0,state:null},h.set(c,O)),O):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function Eo(l){return'href="'+mt(l)+'"'}function ku(l){return'link[rel="stylesheet"]['+l+"]"}function tj(l){return m({},l,{"data-precedence":l.precedence,precedence:null})}function c9(l,c,h,O){l.querySelector('link[rel="preload"][as="style"]['+c+"]")?O.loading=1:(c=l.createElement("link"),O.preload=c,c.addEventListener("load",function(){return O.loading|=1}),c.addEventListener("error",function(){return O.loading|=2}),Xn(c,"link",h),tn(c),l.head.appendChild(c))}function Ao(l){return'[src="'+mt(l)+'"]'}function $u(l){return"script[async]"+l}function nj(l,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var O=l.querySelector('style[data-href~="'+mt(h.href)+'"]');if(O)return c.instance=O,tn(O),O;var b=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return O=(l.ownerDocument||l).createElement("style"),tn(O),Xn(O,"style",b),mh(O,h.precedence,l),c.instance=O;case"stylesheet":b=Eo(h.href);var w=l.querySelector(ku(b));if(w)return c.state.loading|=4,c.instance=w,tn(w),w;O=tj(h),(b=Br.get(b))&&vg(O,b),w=(l.ownerDocument||l).createElement("link"),tn(w);var _=w;return _._p=new Promise(function(M,F){_.onload=M,_.onerror=F}),Xn(w,"link",O),c.state.loading|=4,mh(w,h.precedence,l),c.instance=w;case"script":return w=Ao(h.src),(b=l.querySelector($u(w)))?(c.instance=b,tn(b),b):(O=h,(b=Br.get(w))&&(O=m({},h),wg(O,b)),l=l.ownerDocument||l,b=l.createElement("script"),tn(b),Xn(b,"link",O),l.head.appendChild(b),c.instance=b);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(O=c.instance,c.state.loading|=4,mh(O,h.precedence,l));return c.instance}function mh(l,c,h){for(var O=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=O.length?O[O.length-1]:null,w=b,_=0;_<O.length;_++){var M=O[_];if(M.dataset.precedence===c)w=M;else if(w!==b)break}w?w.parentNode.insertBefore(l,w.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(l,c.firstChild))}function vg(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.title==null&&(l.title=c.title)}function wg(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.integrity==null&&(l.integrity=c.integrity)}var Oh=null;function rj(l,c,h){if(Oh===null){var O=new Map,b=Oh=new Map;b.set(h,O)}else b=Oh,O=b.get(h),O||(O=new Map,b.set(h,O));if(O.has(l))return O;for(O.set(l,null),h=h.getElementsByTagName(l),b=0;b<h.length;b++){var w=h[b];if(!(w[ui]||w[_e]||l==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var _=w.getAttribute(c)||"";_=l+_;var M=O.get(_);M?M.push(w):O.set(_,[w])}}return O}function sj(l,c,h){l=l.ownerDocument||l,l.head.insertBefore(h,c==="title"?l.querySelector("head > title"):null)}function u9(l,c,h){if(h===1||c.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return l=c.disabled,typeof c.precedence=="string"&&l==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function ij(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function f9(l,c,h,O){if(h.type==="stylesheet"&&(typeof O.media!="string"||matchMedia(O.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=Eo(O.href),w=c.querySelector(ku(b));if(w){c=w._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(l.count++,l=gh.bind(l),c.then(l,l)),h.state.loading|=4,h.instance=w,tn(w);return}w=c.ownerDocument||c,O=tj(O),(b=Br.get(b))&&vg(O,b),w=w.createElement("link"),tn(w);var _=w;_._p=new Promise(function(M,F){_.onload=M,_.onerror=F}),Xn(w,"link",O),h.instance=w}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(l.count++,h=gh.bind(l),c.addEventListener("load",h),c.addEventListener("error",h))}}var Sg=0;function d9(l,c){return l.stylesheets&&l.count===0&&bh(l,l.stylesheets),0<l.count||0<l.imgCount?function(h){var O=setTimeout(function(){if(l.stylesheets&&bh(l,l.stylesheets),l.unsuspend){var w=l.unsuspend;l.unsuspend=null,w()}},6e4+c);0<l.imgBytes&&Sg===0&&(Sg=62500*U8());var b=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&bh(l,l.stylesheets),l.unsuspend)){var w=l.unsuspend;l.unsuspend=null,w()}},(l.imgBytes>Sg?50:800)+c);return l.unsuspend=h,function(){l.unsuspend=null,clearTimeout(O),clearTimeout(b)}}:null}function gh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bh(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var xh=null;function bh(l,c){l.stylesheets=null,l.unsuspend!==null&&(l.count++,xh=new Map,c.forEach(h9,l),xh=null,gh.call(l))}function h9(l,c){if(!(c.state.loading&4)){var h=xh.get(l);if(h)var O=h.get(null);else{h=new Map,xh.set(l,h);for(var b=l.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var _=b[w];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(h.set(_.dataset.precedence,_),O=_)}O&&h.set(null,O)}b=c.instance,_=b.getAttribute("data-precedence"),w=h.get(_)||O,w===O&&h.set(null,b),h.set(_,b),this.count++,O=gh.bind(this),b.addEventListener("load",O),b.addEventListener("error",O),w?w.parentNode.insertBefore(b,w.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(b,l.firstChild)),c.state.loading|=4}}var Tu={$$typeof:$,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function p9(l,c,h,O,b,w,_,M,F){this.tag=1,this.containerInfo=l,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=$n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$n(0),this.hiddenUpdates=$n(null),this.identifierPrefix=O,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function aj(l,c,h,O,b,w,_,M,F,le,fe,me){return l=new p9(l,c,h,_,F,le,fe,me,M),c=1,w===!0&&(c|=24),w=Qr(3,null,null,c),l.current=w,w.stateNode=l,c=n0(),c.refCount++,l.pooledCache=c,c.refCount++,w.memoizedState={element:O,isDehydrated:h,cache:c},a0(w),l}function lj(l){return l?(l=fo,l):fo}function oj(l,c,h,O,b,w){b=lj(b),O.context===null?O.context=b:O.pendingContext=b,O=aa(c),O.payload={element:h},w=w===void 0?null:w,w!==null&&(O.callback=w),h=la(l,O,c),h!==null&&(cr(h,l,c),iu(h,l,c))}function cj(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var h=l.retryLane;l.retryLane=h!==0&&h<c?h:c}}function Qg(l,c){cj(l,c),(l=l.alternate)&&cj(l,c)}function uj(l){if(l.tag===13||l.tag===31){var c=el(l,67108864);c!==null&&cr(c,l,67108864),Qg(l,67108864)}}function fj(l){if(l.tag===13||l.tag===31){var c=_r();c=Xs(c);var h=el(l,c);h!==null&&cr(h,l,c),Qg(l,c)}}var yh=!0;function m9(l,c,h,O){var b=A.T;A.T=null;var w=U.p;try{U.p=2,kg(l,c,h,O)}finally{U.p=w,A.T=b}}function O9(l,c,h,O){var b=A.T;A.T=null;var w=U.p;try{U.p=8,kg(l,c,h,O)}finally{U.p=w,A.T=b}}function kg(l,c,h,O){if(yh){var b=$g(O);if(b===null)fg(l,c,O,vh,h),hj(l,O);else if(x9(b,l,c,h,O))O.stopPropagation();else if(hj(l,O),c&4&&-1<g9.indexOf(l)){for(;b!==null;){var w=Os(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var _=on(w.pendingLanes);if(_!==0){var M=w;for(M.pendingLanes|=2,M.entangledLanes|=2;_;){var F=1<<31-ke(_);M.entanglements[1]|=F,_&=~F}Ds(w),(yt&6)===0&&(rh=tt()+500,vu(0))}}break;case 31:case 13:M=el(w,2),M!==null&&cr(M,w,2),ih(),Qg(w,2)}if(w=$g(O),w===null&&fg(l,c,O,vh,h),w===b)break;b=w}b!==null&&O.stopPropagation()}else fg(l,c,O,null,h)}}function $g(l){return l=jO(l),Tg(l)}var vh=null;function Tg(l){if(vh=null,l=ms(l),l!==null){var c=i(l);if(c===null)l=null;else{var h=c.tag;if(h===13){if(l=a(c),l!==null)return l;l=null}else if(h===31){if(l=o(c),l!==null)return l;l=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null)}}return vh=l,null}function dj(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(hn()){case Qt:return 2;case zt:return 8;case St:case en:return 32;case ln:return 268435456;default:return 32}default:return 32}}var jg=!1,xa=null,ba=null,ya=null,ju=new Map,_u=new Map,va=[],g9="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 hj(l,c){switch(l){case"focusin":case"focusout":xa=null;break;case"dragenter":case"dragleave":ba=null;break;case"mouseover":case"mouseout":ya=null;break;case"pointerover":case"pointerout":ju.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":_u.delete(c.pointerId)}}function Pu(l,c,h,O,b,w){return l===null||l.nativeEvent!==w?(l={blockedOn:c,domEventName:h,eventSystemFlags:O,nativeEvent:w,targetContainers:[b]},c!==null&&(c=Os(c),c!==null&&uj(c)),l):(l.eventSystemFlags|=O,c=l.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),l)}function x9(l,c,h,O,b){switch(c){case"focusin":return xa=Pu(xa,l,c,h,O,b),!0;case"dragenter":return ba=Pu(ba,l,c,h,O,b),!0;case"mouseover":return ya=Pu(ya,l,c,h,O,b),!0;case"pointerover":var w=b.pointerId;return ju.set(w,Pu(ju.get(w)||null,l,c,h,O,b)),!0;case"gotpointercapture":return w=b.pointerId,_u.set(w,Pu(_u.get(w)||null,l,c,h,O,b)),!0}return!1}function pj(l){var c=ms(l.target);if(c!==null){var h=i(c);if(h!==null){if(c=h.tag,c===13){if(c=a(h),c!==null){l.blockedOn=c,ps(l.priority,function(){fj(h)});return}}else if(c===31){if(c=o(h),c!==null){l.blockedOn=c,ps(l.priority,function(){fj(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){l.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}l.blockedOn=null}function wh(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var h=$g(l.nativeEvent);if(h===null){h=l.nativeEvent;var O=new h.constructor(h.type,h);TO=O,h.target.dispatchEvent(O),TO=null}else return c=Os(h),c!==null&&uj(c),l.blockedOn=h,!1;c.shift()}return!0}function mj(l,c,h){wh(l)&&h.delete(c)}function b9(){jg=!1,xa!==null&&wh(xa)&&(xa=null),ba!==null&&wh(ba)&&(ba=null),ya!==null&&wh(ya)&&(ya=null),ju.forEach(mj),_u.forEach(mj)}function Sh(l,c){l.blockedOn===c&&(l.blockedOn=null,jg||(jg=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,b9)))}var Qh=null;function Oj(l){Qh!==l&&(Qh=l,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Qh===l&&(Qh=null);for(var c=0;c<l.length;c+=3){var h=l[c],O=l[c+1],b=l[c+2];if(typeof O!="function"){if(Tg(O||h)===null)continue;break}var w=Os(h);w!==null&&(l.splice(c,3),c-=3,$0(w,{pending:!0,data:b,method:h.method,action:O},O,b))}}))}function qo(l){function c(F){return Sh(F,l)}xa!==null&&Sh(xa,l),ba!==null&&Sh(ba,l),ya!==null&&Sh(ya,l),ju.forEach(c),_u.forEach(c);for(var h=0;h<va.length;h++){var O=va[h];O.blockedOn===l&&(O.blockedOn=null)}for(;0<va.length&&(h=va[0],h.blockedOn===null);)pj(h),h.blockedOn===null&&va.shift();if(h=(l.ownerDocument||l).$$reactFormReplay,h!=null)for(O=0;O<h.length;O+=3){var b=h[O],w=h[O+1],_=b[Ve]||null;if(typeof w=="function")_||Oj(h);else if(_){var M=null;if(w&&w.hasAttribute("formAction")){if(b=w,_=w[Ve]||null)M=_.formAction;else if(Tg(b)!==null)continue}else M=_.action;typeof M=="function"?h[O+1]=M:(h.splice(O,3),O-=3),Oj(h)}}}function gj(){function l(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(_){return b=_})},focusReset:"manual",scroll:"manual"})}function c(){b!==null&&(b(),b=null),O||setTimeout(h,20)}function h(){if(!O&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var O=!1,b=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){O=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),b!==null&&(b(),b=null)}}}function _g(l){this._internalRoot=l}kh.prototype.render=_g.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,O=_r();oj(h,O,l,c,null,null)},kh.prototype.unmount=_g.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;oj(l.current,2,null,l,null,null),ih(),c[Rt]=null}};function kh(l){this._internalRoot=l}kh.prototype.unstable_scheduleHydration=function(l){if(l){var c=hs();l={blockedOn:null,target:l,priority:c};for(var h=0;h<va.length&&c!==0&&c<va[h].priority;h++);va.splice(h,0,l),h===0&&pj(l)}};var xj=e.version;if(xj!=="19.2.3")throw Error(r(527,xj,"19.2.3"));U.findDOMNode=function(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=d(c),l=l!==null?p(l):null,l=l===null?null:l.stateNode,l};var y9={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{ct=$h.inject(y9),de=$h}catch{}}return Cu.createRoot=function(l,c){if(!s(l))throw Error(r(299));var h=!1,O="",b=k$,w=$$,_=T$;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(O=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(w=c.onCaughtError),c.onRecoverableError!==void 0&&(_=c.onRecoverableError)),c=aj(l,1,!1,null,null,h,O,null,b,w,_,gj),l[Rt]=c.current,ug(l),new _g(c)},Cu.hydrateRoot=function(l,c,h){if(!s(l))throw Error(r(299));var O=!1,b="",w=k$,_=$$,M=T$,F=null;return h!=null&&(h.unstable_strictMode===!0&&(O=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(w=h.onUncaughtError),h.onCaughtError!==void 0&&(_=h.onCaughtError),h.onRecoverableError!==void 0&&(M=h.onRecoverableError),h.formState!==void 0&&(F=h.formState)),c=aj(l,1,!0,c,h??null,O,b,F,w,_,M,gj),c.context=lj(null),h=c.current,O=_r(),O=Xs(O),b=aa(O),b.callback=null,la(h,b,O),h=O,c.current.lanes=h,mn(c,h),Ds(c),l[Rt]=c.current,ug(l),new kh(c)},Cu.version="19.2.3",Cu}var jj;function N9(){if(jj)return Cg.exports;jj=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(e){console.error(e)}}return n(),Cg.exports=P9(),Cg.exports}var C9=N9();const R9=km(C9);var Ze=(n=>(n.SYNC="sync",n.UPDATE="update",n.GENERATE="generate",n.TEST="test",n.EXAMPLE="example",n.FIX="fix",n.BUG="bug",n.CRASH="crash",n.VERIFY="verify",n.SUBMIT_EXAMPLE="submit-example",n.SPLIT="split",n.CHANGE="change",n.DETECT="detect",n.AUTO_DEPS="auto-deps",n.CONFLICTS="conflicts",n.PREPROCESS="preprocess",n))(Ze||{});const sn={strength:1,temperature:0,time:.25,verbose:!1,quiet:!1,force:!1,local:!1,reviewExamples:!1},ur=[{name:"strength",cliFlag:"--strength",type:"range",placeholder:"1",description:"Model strength: <0.5 = cheaper models, 0.5 = base, >0.5 = stronger models",defaultValue:sn.strength,min:0,max:1,step:.05},{name:"temperature",cliFlag:"--temperature",type:"range",placeholder:"0.0",description:"LLM creativity level (0 = deterministic, higher = more creative)",defaultValue:sn.temperature,min:0,max:2,step:.1},{name:"time",cliFlag:"--time",type:"range",placeholder:"0.25",description:"Reasoning allocation for compatible models (0 = minimal, 1 = maximum)",defaultValue:sn.time,min:0,max:1,step:.05},{name:"verbose",cliFlag:"--verbose",type:"checkbox",placeholder:"",description:"Increase output verbosity for debugging",defaultValue:sn.verbose},{name:"quiet",cliFlag:"--quiet",type:"checkbox",placeholder:"",description:"Decrease output verbosity",defaultValue:sn.quiet},{name:"force",cliFlag:"--force",type:"checkbox",placeholder:"",description:"Skip interactive prompts (useful for automation)",defaultValue:sn.force},{name:"local",cliFlag:"--local",type:"checkbox",placeholder:"",description:"Run commands locally instead of in the cloud",defaultValue:sn.local},{name:"review-examples",cliFlag:"--review-examples",type:"checkbox",placeholder:"",description:"Review and optionally exclude few-shot examples before execution",defaultValue:sn.reviewExamples}],Ra={[Ze.SYNC]:{name:Ze.SYNC,backendName:"sync",description:"Synchronize a prompt with its code, tests, and examples. Generates missing files and fixes failing tests.",shortDescription:"Sync",icon:"🔄",requiresPrompt:!0,group:"sync-update",options:[{name:"max-attempts",type:"number",placeholder:"3",description:"Maximum fix attempts",defaultValue:"3"},{name:"budget",type:"number",placeholder:"20",description:"Maximum cost in dollars",defaultValue:"20"},{name:"skip-tests",type:"checkbox",placeholder:"",description:"Skip test generation"}]},[Ze.UPDATE]:{name:Ze.UPDATE,backendName:"update",description:"Update prompts based on code changes. Syncs prompt content with modified code.",shortDescription:"Update",icon:"📝",requiresPrompt:!0,requiresCode:!0,group:"sync-update",options:[{name:"git",type:"checkbox",placeholder:"",description:"Use git history to find original code"},{name:"simple",type:"checkbox",placeholder:"",description:"Use legacy 2-stage LLM update"}]},[Ze.GENERATE]:{name:Ze.GENERATE,backendName:"generate",description:"Generate code from a prompt file. Creates new implementation based on the prompt specification.",shortDescription:"Generate code",icon:"⚡",requiresPrompt:!0,options:[{name:"output",type:"file",placeholder:"e.g., src/calculator.py",description:"Where to save generated code"},{name:"incremental",type:"checkbox",placeholder:"",description:"Use incremental patching"}]},[Ze.TEST]:{name:Ze.TEST,backendName:"test",description:"Generate unit tests for existing code based on its prompt specification.",shortDescription:"Generate tests",icon:"🧪",requiresPrompt:!0,requiresCode:!0,options:[{name:"output",type:"file",placeholder:"e.g., tests/test_calculator.py",description:"Where to save generated tests"},{name:"target-coverage",type:"number",placeholder:"80",description:"Target code coverage %"}]},[Ze.EXAMPLE]:{name:Ze.EXAMPLE,backendName:"example",description:"Generate example code that demonstrates how to use the implementation.",shortDescription:"Generate example",icon:"📖",requiresPrompt:!0,requiresCode:!0,options:[{name:"output",type:"file",placeholder:"e.g., examples/calculator_example.py",description:"Where to save generated example"}]},[Ze.FIX]:{name:Ze.FIX,backendName:"fix",description:"Fix code based on failing tests. Requires an error file with test output.",shortDescription:"Fix failing tests",icon:"🔧",requiresPrompt:!0,requiresCode:!0,requiresTest:!0,options:[{name:"error-file",type:"file",placeholder:"e.g., error.log or test_output.txt",description:"File containing test errors (required)",required:!0},{name:"max-attempts",type:"number",placeholder:"3",description:"Maximum fix attempts",defaultValue:"3"},{name:"budget",type:"number",placeholder:"5",description:"Maximum cost in dollars",defaultValue:"5"},{name:"loop",type:"checkbox",placeholder:"",description:"Enable iterative fixing (requires verification-program)"},{name:"verification-program",type:"file",placeholder:"verify.py",description:"Python program that verifies the fix (required for --loop)"},{name:"agentic-fallback",type:"checkbox",placeholder:"",description:"Enable agentic fallback if primary fix fails"},{name:"auto-submit",type:"checkbox",placeholder:"",description:"Auto-submit if all tests pass"}]},[Ze.BUG]:{name:Ze.BUG,backendName:"bug",description:"Investigate a bug from a GitHub issue URL (agentic mode) or generate a reproducing test case.",shortDescription:"Investigate bug",icon:"🐛",requiresPrompt:!1,options:[{name:"issue-url",type:"text",placeholder:"https://github.com/org/repo/issues/123",description:"GitHub issue URL to investigate",required:!0},{name:"output",type:"file",placeholder:"e.g., tests/test_bug_123.py",description:"Where to save generated test"}]},[Ze.CRASH]:{name:Ze.CRASH,backendName:"crash",description:"Fix code based on crash errors. Analyzes error file and proposes fixes.",shortDescription:"Crash Fix",icon:"💥",requiresPrompt:!0,requiresCode:!0,options:[{name:"program-file",type:"file",placeholder:"program.py",description:"Program file that crashed",required:!0},{name:"error-file",type:"file",placeholder:"error.log",description:"File containing error messages",required:!0},{name:"output",type:"file",placeholder:"src/fixed_code.py",description:"Where to save fixed code"},{name:"output-program",type:"file",placeholder:"program_fixed.py",description:"Where to save fixed program"},{name:"loop",type:"checkbox",placeholder:"",description:"Enable iterative fixing process"},{name:"max-attempts",type:"number",placeholder:"3",description:"Maximum fix attempts",defaultValue:3},{name:"budget",type:"number",placeholder:"5",description:"Maximum cost in dollars",defaultValue:5}]},[Ze.VERIFY]:{name:Ze.VERIFY,backendName:"verify",description:"Verify code against prompt requirements using a verification program.",shortDescription:"Verify",icon:"✅",requiresPrompt:!0,requiresCode:!0,options:[{name:"verification-program",type:"file",placeholder:"verify.py",description:"Verification program to run",required:!0},{name:"output-code",type:"file",placeholder:"src/verified_code.py",description:"Where to save verified code"},{name:"output-program",type:"file",placeholder:"verify_fixed.py",description:"Where to save fixed verification program"},{name:"output-results",type:"file",placeholder:"results.log",description:"Where to save verification results"},{name:"max-attempts",type:"number",placeholder:"3",description:"Maximum verification attempts",defaultValue:3},{name:"budget",type:"number",placeholder:"5",description:"Maximum cost in dollars",defaultValue:5},{name:"agentic-fallback",type:"checkbox",placeholder:"",description:"Enable agentic fallback if primary fix fails",defaultValue:!0}]},[Ze.SUBMIT_EXAMPLE]:{name:Ze.SUBMIT_EXAMPLE,backendName:"fix",description:"Submit a successful fix as a few-shot example to PDD Cloud. Runs fix --loop --auto-submit with verification to iteratively fix and submit the example.",shortDescription:"Submit Example",icon:"🚀",requiresPrompt:!0,requiresCode:!0,requiresTest:!0,options:[{name:"verification-program",type:"file",placeholder:"examples/calculator_example.py",description:"Verification program to check the fix (required). The example file typically serves as the verification program.",required:!0},{name:"max-attempts",type:"number",placeholder:"5",description:"Maximum fix attempts before giving up",defaultValue:5},{name:"budget",type:"number",placeholder:"10",description:"Maximum cost in dollars",defaultValue:10}]},[Ze.SPLIT]:{name:Ze.SPLIT,backendName:"split",description:"Split a large prompt file into smaller, manageable sub-prompts for better organization and modularity.",shortDescription:"Split Prompt",icon:"›",requiresPrompt:!0,requiresCode:!0,isAdvanced:!0,options:[{name:"example-code",type:"file",placeholder:"examples/interface.py",description:"Example code as interface to sub-module",required:!0},{name:"output-sub",type:"file",placeholder:"prompts/sub_module.prompt",description:"Output path for the sub-prompt file"},{name:"output-modified",type:"file",placeholder:"prompts/modified.prompt",description:"Output path for the modified prompt file"}]},[Ze.CHANGE]:{name:Ze.CHANGE,backendName:"change",description:"Modify a prompt based on change instructions from a change prompt file.",shortDescription:"Change Prompt",icon:"›",requiresPrompt:!0,requiresCode:!0,isAdvanced:!0,options:[{name:"change-prompt",type:"file",placeholder:"changes.prompt",description:"File containing change instructions",required:!0},{name:"budget",type:"number",placeholder:"5",description:"Maximum cost in dollars",defaultValue:"5"},{name:"output",type:"file",placeholder:"prompts/modified.prompt",description:"Output path for modified prompt"}]},[Ze.DETECT]:{name:Ze.DETECT,backendName:"detect",description:"Analyze prompts to determine which ones need changes based on a change description file.",shortDescription:"Detect Changes",icon:"›",requiresPrompt:!1,isAdvanced:!0,options:[{name:"prompt-files",type:"text",placeholder:"file1.prompt, file2.prompt",description:"Comma-separated list of prompt files to analyze",required:!0},{name:"change-file",type:"file",placeholder:"changes.prompt",description:"File describing the changes to detect",required:!0},{name:"output",type:"file",placeholder:"detect_results.csv",description:"Output CSV file for analysis results"}]},[Ze.AUTO_DEPS]:{name:Ze.AUTO_DEPS,backendName:"auto-deps",description:"Analyze project dependencies and update the prompt file with discovered dependencies.",shortDescription:"Auto Dependencies",icon:"›",requiresPrompt:!0,isAdvanced:!0,options:[{name:"directory-path",type:"text",placeholder:"src/",description:"Directory to scan for dependencies",required:!0},{name:"output",type:"file",placeholder:"prompts/updated.prompt",description:"Where to save modified prompt"},{name:"csv",type:"file",placeholder:"deps.csv",description:"CSV file for dependency info"},{name:"force-scan",type:"checkbox",placeholder:"",description:"Force rescan all files"}]},[Ze.CONFLICTS]:{name:Ze.CONFLICTS,backendName:"conflicts",description:"Check for conflicts between two prompt files.",shortDescription:"Check Conflicts",icon:"›",requiresPrompt:!0,isAdvanced:!0,options:[{name:"prompt2",type:"file",placeholder:"prompts/other.prompt",description:"Second prompt file to compare",required:!0},{name:"output",type:"file",placeholder:"conflicts.csv",description:"Where to save conflict analysis"}]},[Ze.PREPROCESS]:{name:Ze.PREPROCESS,backendName:"preprocess",description:"Preprocess a prompt file to prepare it for LLM use.",shortDescription:"Preprocess",icon:"›",requiresPrompt:!0,isAdvanced:!0,options:[{name:"output",type:"file",placeholder:"prompts/preprocessed.prompt",description:"Where to save preprocessed prompt"},{name:"xml",type:"checkbox",placeholder:"",description:"Insert XML delimiters for structure"},{name:"recursive",type:"checkbox",placeholder:"",description:"Recursively preprocess includes"},{name:"double",type:"checkbox",placeholder:"",description:"Double curly brackets"}]}},E9=[{value:"python",label:"Python"},{value:"typescript",label:"TypeScript"},{value:"javascript",label:"JavaScript"},{value:"java",label:"Java"},{value:"go",label:"Go"},{value:"rust",label:"Rust"}];function A9(n,e,t){const r=(t==null?void 0:t.trim())||`[describe what ${n} should do]`;return`Write a ${e} module "${n}" that ${r}.
|
|
50
|
-
|
|
51
|
-
## Requirements
|
|
52
|
-
|
|
53
|
-
- [Add your requirements here]
|
|
54
|
-
|
|
55
|
-
## Inputs
|
|
56
|
-
|
|
57
|
-
- [Define input parameters]
|
|
58
|
-
|
|
59
|
-
## Outputs
|
|
60
|
-
|
|
61
|
-
- [Define expected outputs]
|
|
62
|
-
`}function q9(n,e){const t=n._code||e.code,r=n._test||e.test,s={};for(const[i,a]of Object.entries(n))if(!(i==="_code"||i==="_test"))if(i.startsWith("_global_")){const o=i.replace("_global_","");s[o]=a}else s[i]=a;return{options:s,codeFile:t,testFile:r}}function M9(n,e,t,r,s){const i={};switch(n){case Ze.SYNC:i.basename=e.sync_basename,e.context&&(s.context=e.context);break;case Ze.UPDATE:t?i.args=[t]:i.args=[];break;case Ze.GENERATE:i.prompt_file=e.prompt;break;case Ze.TEST:i.prompt_file=e.prompt,i.code_file=t;break;case Ze.EXAMPLE:i.prompt_file=e.prompt,i.code_file=t;break;case Ze.FIX:i.prompt_file=e.prompt,i.code_file=t,i.unit_test_files=r,s["error-file"]&&(i.error_file=s["error-file"],delete s["error-file"]);break;case Ze.SPLIT:i.input_prompt=e.prompt,i.input_code=t,s["example-code"]&&(i.example_code=s["example-code"],delete s["example-code"]);break;case Ze.CHANGE:s["change-prompt"]&&(i.change_prompt_file=s["change-prompt"],delete s["change-prompt"]),i.input_code=t,i.input_prompt_file=e.prompt;break;case Ze.DETECT:{const a=s["prompt-files"]||"",o=s["change-file"]||"",u=a.split(",").map(d=>d.trim()).filter(Boolean);i.args=[...u,o].filter(Boolean),delete s["prompt-files"],delete s["change-file"]}break;case Ze.AUTO_DEPS:i.prompt_file=e.prompt,s["directory-path"]&&(i.directory_path=s["directory-path"],delete s["directory-path"]);break;case Ze.CONFLICTS:i.prompt_file=e.prompt,s.prompt2&&(i.prompt2=s.prompt2,delete s.prompt2);break;case Ze.PREPROCESS:i.prompt_file=e.prompt;break;case Ze.CRASH:i.prompt_file=e.prompt,i.code_file=t,s["program-file"]&&(i.program_file=s["program-file"],delete s["program-file"]),s["error-file"]&&(i.error_file=s["error-file"],delete s["error-file"]);break;case Ze.VERIFY:i.prompt_file=e.prompt,i.code_file=t,s["verification-program"]&&(i.verification_program=s["verification-program"],delete s["verification-program"]);break;case Ze.SUBMIT_EXAMPLE:i.prompt_file=e.prompt,i.code_file=t,i.unit_test_files=r,i.error_file=".pdd/submit_example_errors.log",s.loop=!0,s["auto-submit"]=!0,s["verification-program"]&&(i.verification_program=s["verification-program"],delete s["verification-program"]);break;case Ze.BUG:s.args&&(i.args=s.args,delete s.args);break}return i}function Z2(n,e,t){const r=Ra[n],s=n===Ze.SYNC?e.sync_basename:e.prompt,i=Object.keys(t).length>0?" "+Object.entries(t).map(([a,o])=>typeof o=="boolean"?o?`--${a.replace(/_/g,"-")}`:"":`--${a.replace(/_/g,"-")} ${o}`).filter(Boolean).join(" "):"";return`pdd ${r.backendName} ${s}${i}`}function _j(n,e,t={}){const{options:r,codeFile:s,testFile:i}=q9(t,e),a=M9(n,e,s,i,r),o=Z2(n,e,r),u=Ra[n];return{args:a,options:r,displayCommand:o,backendName:u.backendName}}const V2=Symbol.for("yaml.alias"),gS=Symbol.for("yaml.document"),Ea=Symbol.for("yaml.map"),KA=Symbol.for("yaml.pair"),si=Symbol.for("yaml.scalar"),$c=Symbol.for("yaml.seq"),ns=Symbol.for("yaml.node.type"),Ba=n=>!!n&&typeof n=="object"&&n[ns]===V2,Zl=n=>!!n&&typeof n=="object"&&n[ns]===gS,Tc=n=>!!n&&typeof n=="object"&&n[ns]===Ea,Wt=n=>!!n&&typeof n=="object"&&n[ns]===KA,qt=n=>!!n&&typeof n=="object"&&n[ns]===si,jc=n=>!!n&&typeof n=="object"&&n[ns]===$c;function Ht(n){if(n&&typeof n=="object")switch(n[ns]){case Ea:case $c:return!0}return!1}function Kt(n){if(n&&typeof n=="object")switch(n[ns]){case V2:case Ea:case si:case $c:return!0}return!1}const JA=n=>(qt(n)||Ht(n))&&!!n.anchor,fr=Symbol("break visit"),eq=Symbol("skip children"),ei=Symbol("remove node");function Vl(n,e){const t=tq(e);Zl(n)?Do(null,n.contents,t,Object.freeze([n]))===ei&&(n.contents=null):Do(null,n,t,Object.freeze([]))}Vl.BREAK=fr;Vl.SKIP=eq;Vl.REMOVE=ei;function Do(n,e,t,r){const s=nq(n,e,t,r);if(Kt(s)||Wt(s))return rq(n,r,s),Do(n,s,t,r);if(typeof s!="symbol"){if(Ht(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){const a=Do(i,e.items[i],t,r);if(typeof a=="number")i=a-1;else{if(a===fr)return fr;a===ei&&(e.items.splice(i,1),i-=1)}}}else if(Wt(e)){r=Object.freeze(r.concat(e));const i=Do("key",e.key,t,r);if(i===fr)return fr;i===ei&&(e.key=null);const a=Do("value",e.value,t,r);if(a===fr)return fr;a===ei&&(e.value=null)}}return s}async function $m(n,e){const t=tq(e);Zl(n)?await Bo(null,n.contents,t,Object.freeze([n]))===ei&&(n.contents=null):await Bo(null,n,t,Object.freeze([]))}$m.BREAK=fr;$m.SKIP=eq;$m.REMOVE=ei;async function Bo(n,e,t,r){const s=await nq(n,e,t,r);if(Kt(s)||Wt(s))return rq(n,r,s),Bo(n,s,t,r);if(typeof s!="symbol"){if(Ht(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){const a=await Bo(i,e.items[i],t,r);if(typeof a=="number")i=a-1;else{if(a===fr)return fr;a===ei&&(e.items.splice(i,1),i-=1)}}}else if(Wt(e)){r=Object.freeze(r.concat(e));const i=await Bo("key",e.key,t,r);if(i===fr)return fr;i===ei&&(e.key=null);const a=await Bo("value",e.value,t,r);if(a===fr)return fr;a===ei&&(e.value=null)}}return s}function tq(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function nq(n,e,t,r){var s,i,a,o,u;if(typeof t=="function")return t(n,e,r);if(Tc(e))return(s=t.Map)==null?void 0:s.call(t,n,e,r);if(jc(e))return(i=t.Seq)==null?void 0:i.call(t,n,e,r);if(Wt(e))return(a=t.Pair)==null?void 0:a.call(t,n,e,r);if(qt(e))return(o=t.Scalar)==null?void 0:o.call(t,n,e,r);if(Ba(e))return(u=t.Alias)==null?void 0:u.call(t,n,e,r)}function rq(n,e,t){const r=e[e.length-1];if(Ht(r))r.items[n]=t;else if(Wt(r))n==="key"?r.key=t:r.value=t;else if(Zl(r))r.contents=t;else{const s=Ba(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const X9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},z9=n=>n.replace(/[!,[\]{}]/g,e=>X9[e]);class Hn{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Hn.defaultYaml,e),this.tags=Object.assign({},Hn.defaultTags,t)}clone(){const e=new Hn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Hn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Hn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Hn.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Hn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Hn.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,a]=r;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,a),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}const[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(a){return t(String(a)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+z9(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(e&&r.length>0&&Kt(e.contents)){const i={};Vl(e.contents,(a,o)=>{Kt(o)&&o.tag&&(i[o.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!e||s.some(o=>o.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
63
|
-
`)}}Hn.defaultYaml={explicit:!1,version:"1.2"};Hn.defaultTags={"!!":"tag:yaml.org,2002:"};function sq(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function iq(n){const e=new Set;return Vl(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function aq(n,e){for(let t=1;;++t){const r=`${n}${t}`;if(!e.has(r))return r}}function L9(n,e){const t=[],r=new Map;let s=null;return{onAnchor:i=>{t.push(i),s??(s=iq(n));const a=aq(e,s);return s.add(a),a},setAnchors:()=>{for(const i of t){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(qt(a.node)||Ht(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:r}}function Uo(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const a=r[s],o=Uo(n,r,String(s),a);o===void 0?delete r[s]:o!==a&&(r[s]=o)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),a=Uo(n,r,s,i);a===void 0?r.delete(s):a!==i&&r.set(s,a)}else if(r instanceof Set)for(const s of Array.from(r)){const i=Uo(n,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const a=Uo(n,r,s,i);a===void 0?delete r[s]:a!==i&&(r[s]=a)}return n.call(e,t,r)}function es(n,e,t){if(Array.isArray(n))return n.map((r,s)=>es(r,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!JA(n))return n.toJSON(e,t);const r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=i=>{r.res=i,delete t.onCreate};const s=n.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof n=="bigint"&&!(t!=null&&t.keep)?Number(n):n}class Y2{constructor(e){Object.defineProperty(this,ns,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Zl(e))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=es(this,"",a);if(typeof s=="function")for(const{count:u,res:d}of a.anchors.values())s(d,u);return typeof i=="function"?Uo(i,{"":o},"",o):o}}class Tm extends Y2{constructor(e){super(V2),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let r;t!=null&&t.aliasResolveCache?r=t.aliasResolveCache:(r=[],Vl(e,{Node:(i,a)=>{(Ba(a)||JA(a))&&r.push(a)}}),t&&(t.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=t,a=this.resolve(s,t);if(!a){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let o=r.get(a);if(o||(es(a,null,t),o=r.get(a)),(o==null?void 0:o.res)===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=hp(s,a,r)),o.count*o.aliasCount>i)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return o.res}toString(e,t,r){const s=`*${this.source}`;if(e){if(sq(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}}function hp(n,e,t){if(Ba(e)){const r=e.resolve(n),s=t&&r&&t.get(r);return s?s.count*s.aliasCount:0}else if(Ht(e)){let r=0;for(const s of e.items){const i=hp(n,s,t);i>r&&(r=i)}return r}else if(Wt(e)){const r=hp(n,e.key,t),s=hp(n,e.value,t);return Math.max(r,s)}return 1}const lq=n=>!n||typeof n!="function"&&typeof n!="object";class Ge extends Y2{constructor(e){super(si),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:es(this.value,e,t)}toString(){return String(this.value)}}Ge.BLOCK_FOLDED="BLOCK_FOLDED";Ge.BLOCK_LITERAL="BLOCK_LITERAL";Ge.PLAIN="PLAIN";Ge.QUOTE_DOUBLE="QUOTE_DOUBLE";Ge.QUOTE_SINGLE="QUOTE_SINGLE";const Z9="tag:yaml.org,2002:";function V9(n,e,t){if(e){const r=t.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,n))&&!r.format})}function xf(n,e,t){var m,g,x;if(Zl(n)&&(n=n.contents),Kt(n))return n;if(Wt(n)){const v=(g=(m=t.schema[Ea]).createNode)==null?void 0:g.call(m,t.schema,null,t);return v.items.push(n),v}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:a,sourceObjects:o}=t;let u;if(r&&n&&typeof n=="object"){if(u=o.get(n),u)return u.anchor??(u.anchor=s(n)),new Tm(u.anchor);u={anchor:null,node:null},o.set(n,u)}e!=null&&e.startsWith("!!")&&(e=Z9+e.slice(2));let d=V9(n,e,a.tags);if(!d){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const v=new Ge(n);return u&&(u.node=v),v}d=n instanceof Map?a[Ea]:Symbol.iterator in Object(n)?a[$c]:a[Ea]}i&&(i(d),delete t.onTagObj);const p=d!=null&&d.createNode?d.createNode(t.schema,n,t):typeof((x=d==null?void 0:d.nodeClass)==null?void 0:x.from)=="function"?d.nodeClass.from(t.schema,n,t):new Ge(n);return e?p.tag=e:d.default||(p.tag=d.tag),u&&(u.node=p),p}function Ap(n,e,t){let r=t;for(let s=e.length-1;s>=0;--s){const i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=r,r=a}else r=new Map([[i,r]])}return xf(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const Iu=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class oq extends Y2{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>Kt(r)||Wt(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Iu(e))this.add(t);else{const[r,...s]=e,i=this.get(r,!0);if(Ht(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(r,Ap(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){const[t,...r]=e;if(r.length===0)return this.delete(t);const s=this.get(t,!0);if(Ht(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){const[r,...s]=e,i=this.get(r,!0);return s.length===0?!t&&qt(i)?i.value:i:Ht(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Wt(t))return!1;const r=t.value;return r==null||e&&qt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[t,...r]=e;if(r.length===0)return this.has(t);const s=this.get(t,!0);return Ht(s)?s.hasIn(r):!1}setIn(e,t){const[r,...s]=e;if(s.length===0)this.set(r,t);else{const i=this.get(r,!0);if(Ht(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(r,Ap(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Y9=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Xi(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const bl=(n,e,t)=>n.endsWith(`
|
|
64
|
-
`)?Xi(t,e):t.includes(`
|
|
65
|
-
`)?`
|
|
66
|
-
`+Xi(t,e):(n.endsWith(" ")?"":" ")+t,cq="flow",xS="block",pp="quoted";function jm(n,e,t="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:o}={}){if(!s||s<0)return n;s<i&&(i=0);const u=Math.max(1+i,1+s-e.length);if(n.length<=u)return n;const d=[],p={};let m=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?d.push(0):m=s-r);let g,x,v=!1,y=-1,S=-1,Q=-1;t===xS&&(y=Pj(n,y,e.length),y!==-1&&(m=y+u));for(let $;$=n[y+=1];){if(t===pp&&$==="\\"){switch(S=y,n[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}Q=y}if($===`
|
|
67
|
-
`)t===xS&&(y=Pj(n,y,e.length)),m=y+e.length+u,g=void 0;else{if($===" "&&x&&x!==" "&&x!==`
|
|
68
|
-
`&&x!==" "){const j=n[y+1];j&&j!==" "&&j!==`
|
|
69
|
-
`&&j!==" "&&(g=y)}if(y>=m)if(g)d.push(g),m=g+u,g=void 0;else if(t===pp){for(;x===" "||x===" ";)x=$,$=n[y+=1],v=!0;const j=y>Q+1?y-2:S-1;if(p[j])return n;d.push(j),p[j]=!0,m=j+u,g=void 0}else v=!0}x=$}if(v&&o&&o(),d.length===0)return n;a&&a();let k=n.slice(0,d[0]);for(let $=0;$<d.length;++$){const j=d[$],T=d[$+1]||n.length;j===0?k=`
|
|
70
|
-
${e}${n.slice(0,T)}`:(t===pp&&p[j]&&(k+=`${n[j]}\\`),k+=`
|
|
71
|
-
${e}${n.slice(j+1,T)}`)}return k}function Pj(n,e,t){let r=e,s=e+1,i=n[s];for(;i===" "||i===" ";)if(e<s+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
|
|
72
|
-
`);r=e,s=e+1,i=n[s]}return r}const _m=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Pm=n=>/^(%|---|\.\.\.)/m.test(n);function D9(n,e,t){if(!e||e<0)return!1;const r=e-t,s=n.length;if(s<=r)return!1;for(let i=0,a=0;i<s;++i)if(n[i]===`
|
|
73
|
-
`){if(i-a>r)return!0;if(a=i+1,s-a<=r)return!1}return!0}function of(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Pm(n)?" ":"");let a="",o=0;for(let u=0,d=t[u];d;d=t[++u])if(d===" "&&t[u+1]==="\\"&&t[u+2]==="n"&&(a+=t.slice(o,u)+"\\ ",u+=1,o=u,d="\\"),d==="\\")switch(t[u+1]){case"u":{a+=t.slice(o,u);const p=t.substr(u+2,4);switch(p){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=t.substr(u,6)}u+=5,o=u+1}break;case"n":if(r||t[u+2]==='"'||t.length<s)u+=1;else{for(a+=t.slice(o,u)+`
|
|
74
|
-
|
|
75
|
-
`;t[u+2]==="\\"&&t[u+3]==="n"&&t[u+4]!=='"';)a+=`
|
|
76
|
-
`,u+=2;a+=i,t[u+2]===" "&&(a+="\\"),u+=1,o=u+1}break;default:u+=1}return a=o?a+t.slice(o):t,r?a:jm(a,i,pp,_m(e,!1))}function bS(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
77
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return of(n,e);const t=e.indent||(Pm(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
78
|
-
${t}`)+"'";return e.implicitKey?r:jm(r,t,cq,_m(e,!1))}function Wo(n,e){const{singleQuote:t}=e.options;let r;if(t===!1)r=of;else{const s=n.includes('"'),i=n.includes("'");s&&!i?r=bS:i&&!s?r=of:r=t?bS:of}return r(n,e)}let yS;try{yS=new RegExp(`(^|(?<!
|
|
79
|
-
))
|
|
80
|
-
+(?!
|
|
81
|
-
|$)`,"g")}catch{yS=/\n+(?!\n|$)/g}function mp({comment:n,type:e,value:t},r,s,i){const{blockQuote:a,commentString:o,lineWidth:u}=r.options;if(!a||/\n[\t ]+$/.test(t))return Wo(t,r);const d=r.indent||(r.forceBlockIndent||Pm(t)?" ":""),p=a==="literal"?!0:a==="folded"||e===Ge.BLOCK_FOLDED?!1:e===Ge.BLOCK_LITERAL?!0:!D9(t,u,d.length);if(!t)return p?`|
|
|
82
|
-
`:`>
|
|
83
|
-
`;let m,g;for(g=t.length;g>0;--g){const T=t[g-1];if(T!==`
|
|
84
|
-
`&&T!==" "&&T!==" ")break}let x=t.substring(g);const v=x.indexOf(`
|
|
85
|
-
`);v===-1?m="-":t===x||v!==x.length-1?(m="+",i&&i()):m="",x&&(t=t.slice(0,-x.length),x[x.length-1]===`
|
|
86
|
-
`&&(x=x.slice(0,-1)),x=x.replace(yS,`$&${d}`));let y=!1,S,Q=-1;for(S=0;S<t.length;++S){const T=t[S];if(T===" ")y=!0;else if(T===`
|
|
87
|
-
`)Q=S;else break}let k=t.substring(0,Q<S?Q+1:S);k&&(t=t.substring(k.length),k=k.replace(/\n+/g,`$&${d}`));let j=(y?d?"2":"1":"")+m;if(n&&(j+=" "+o(n.replace(/ ?[\r\n]+/g," ")),s&&s()),!p){const T=t.replace(/\n+/g,`
|
|
88
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);let R=!1;const N=_m(r,!0);a!=="folded"&&e!==Ge.BLOCK_FOLDED&&(N.onOverflow=()=>{R=!0});const q=jm(`${k}${T}${x}`,d,xS,N);if(!R)return`>${j}
|
|
89
|
-
${d}${q}`}return t=t.replace(/\n+/g,`$&${d}`),`|${j}
|
|
90
|
-
${d}${k}${t}${x}`}function B9(n,e,t,r){const{type:s,value:i}=n,{actualString:a,implicitKey:o,indent:u,indentStep:d,inFlow:p}=e;if(o&&i.includes(`
|
|
91
|
-
`)||p&&/[[\]{},]/.test(i))return Wo(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||p||!i.includes(`
|
|
92
|
-
`)?Wo(i,e):mp(n,e,t,r);if(!o&&!p&&s!==Ge.PLAIN&&i.includes(`
|
|
93
|
-
`))return mp(n,e,t,r);if(Pm(i)){if(u==="")return e.forceBlockIndent=!0,mp(n,e,t,r);if(o&&u===d)return Wo(i,e)}const m=i.replace(/\n+/g,`$&
|
|
94
|
-
${u}`);if(a){const g=y=>{var S;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((S=y.test)==null?void 0:S.test(m))},{compat:x,tags:v}=e.doc.schema;if(v.some(g)||x!=null&&x.some(g))return Wo(i,e)}return o?m:jm(m,u,cq,_m(e,!1))}function Wf(n,e,t,r){const{implicitKey:s,inFlow:i}=e,a=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:o}=n;o!==Ge.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Ge.QUOTE_DOUBLE);const u=p=>{switch(p){case Ge.BLOCK_FOLDED:case Ge.BLOCK_LITERAL:return s||i?Wo(a.value,e):mp(a,e,t,r);case Ge.QUOTE_DOUBLE:return of(a.value,e);case Ge.QUOTE_SINGLE:return bS(a.value,e);case Ge.PLAIN:return B9(a,e,t,r);default:return null}};let d=u(o);if(d===null){const{defaultKeyType:p,defaultStringType:m}=e.options,g=s&&p||m;if(d=u(g),d===null)throw new Error(`Unsupported default string type ${g}`)}return d}function uq(n,e){const t=Object.assign({blockQuote:!0,commentString:Y9,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function U9(n,e){var s;if(e.tag){const i=n.filter(a=>a.tag===e.tag);if(i.length>0)return i.find(a=>a.format===e.format)??i[0]}let t,r;if(qt(e)){r=e.value;let i=n.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}t=i.find(a=>a.format===e.format)??i.find(a=>!a.format)}else r=e,t=n.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!t){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return t}function W9(n,e,{anchors:t,doc:r}){if(!r.directives)return"";const s=[],i=(qt(n)||Ht(n))&&n.anchor;i&&sq(i)&&(t.add(i),s.push(`&${i}`));const a=n.tag??(e.default?null:e.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function fc(n,e,t,r){var u;if(Wt(n))return n.toString(e,t,r);if(Ba(n)){if(e.doc.directives)return n.toString(e);if((u=e.resolvedAliases)!=null&&u.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let s;const i=Kt(n)?n:e.doc.createNode(n,{onTagObj:d=>s=d});s??(s=U9(e.doc.schema.tags,i));const a=W9(i,s,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const o=typeof s.stringify=="function"?s.stringify(i,e,t,r):qt(i)?Wf(i,e,t,r):i.toString(e,t,r);return a?qt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
|
|
95
|
-
${e.indent}${o}`:o}function G9({key:n,value:e},t,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:u,options:{commentString:d,indentSeq:p,simpleKeys:m}}=t;let g=Kt(n)&&n.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Ht(n)||!Kt(n)&&typeof n=="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let x=!m&&(!n||g&&e==null&&!t.inFlow||Ht(n)||(qt(n)?n.type===Ge.BLOCK_FOLDED||n.type===Ge.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!x&&(m||!i),indent:o+u});let v=!1,y=!1,S=fc(n,t,()=>v=!0,()=>y=!0);if(!x&&!t.inFlow&&S.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(t.inFlow){if(i||e==null)return v&&r&&r(),S===""?"?":x?`? ${S}`:S}else if(i&&!m||e==null&&x)return S=`? ${S}`,g&&!v?S+=bl(S,t.indent,d(g)):y&&s&&s(),S;v&&(g=null),x?(g&&(S+=bl(S,t.indent,d(g))),S=`? ${S}
|
|
96
|
-
${o}:`):(S=`${S}:`,g&&(S+=bl(S,t.indent,d(g))));let Q,k,$;Kt(e)?(Q=!!e.spaceBefore,k=e.commentBefore,$=e.comment):(Q=!1,k=null,$=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!x&&!g&&qt(e)&&(t.indentAtStart=S.length+1),y=!1,!p&&u.length>=2&&!t.inFlow&&!x&&jc(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let j=!1;const T=fc(e,t,()=>j=!0,()=>y=!0);let R=" ";if(g||Q||k){if(R=Q?`
|
|
97
|
-
`:"",k){const N=d(k);R+=`
|
|
98
|
-
${Xi(N,t.indent)}`}T===""&&!t.inFlow?R===`
|
|
99
|
-
`&&$&&(R=`
|
|
100
|
-
|
|
101
|
-
`):R+=`
|
|
102
|
-
${t.indent}`}else if(!x&&Ht(e)){const N=T[0],q=T.indexOf(`
|
|
103
|
-
`),z=q!==-1,L=t.inFlow??e.flow??e.items.length===0;if(z||!L){let E=!1;if(z&&(N==="&"||N==="!")){let V=T.indexOf(" ");N==="&"&&V!==-1&&V<q&&T[V+1]==="!"&&(V=T.indexOf(" ",V+1)),(V===-1||q<V)&&(E=!0)}E||(R=`
|
|
104
|
-
${t.indent}`)}}else(T===""||T[0]===`
|
|
105
|
-
`)&&(R="");return S+=R+T,t.inFlow?j&&r&&r():$&&!j?S+=bl(S,t.indent,d($)):y&&s&&s(),S}function fq(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const jh="<<",Vi={identify:n=>n===jh||typeof n=="symbol"&&n.description===jh,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ge(Symbol(jh)),{addToJSMap:dq}),stringify:()=>jh},I9=(n,e)=>(Vi.identify(e)||qt(e)&&(!e.type||e.type===Ge.PLAIN)&&Vi.identify(e.value))&&(n==null?void 0:n.doc.schema.tags.some(t=>t.tag===Vi.tag&&t.default));function dq(n,e,t){if(t=n&&Ba(t)?t.resolve(n.doc):t,jc(t))for(const r of t.items)qg(n,e,r);else if(Array.isArray(t))for(const r of t)qg(n,e,r);else qg(n,e,t)}function qg(n,e,t){const r=n&&Ba(t)?t.resolve(n.doc):t;if(!Tc(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,n,Map);for(const[i,a]of s)e instanceof Map?e.has(i)||e.set(i,a):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function hq(n,e,{key:t,value:r}){if(Kt(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(I9(n,t))dq(n,e,r);else{const s=es(t,"",n);if(e instanceof Map)e.set(s,es(r,s,n));else if(e instanceof Set)e.add(s);else{const i=H9(t,s,n),a=es(r,i,n);i in e?Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[i]=a}}return e}function H9(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Kt(n)&&(t!=null&&t.doc)){const r=uq(t.doc,{});r.anchors=new Set;for(const i of t.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=n.toString(r);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),fq(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}function D2(n,e,t){const r=xf(n,void 0,t),s=xf(e,void 0,t);return new Wn(r,s)}class Wn{constructor(e,t=null){Object.defineProperty(this,ns,{value:KA}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return Kt(t)&&(t=t.clone(e)),Kt(r)&&(r=r.clone(e)),new Wn(t,r)}toJSON(e,t){const r=t!=null&&t.mapAsMap?new Map:{};return hq(t,r,this)}toString(e,t,r){return e!=null&&e.doc?G9(this,e,t,r):JSON.stringify(this)}}function pq(n,e,t){return(e.inFlow??n.flow?K9:F9)(n,e,t)}function F9({comment:n,items:e},t,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:u,options:{commentString:d}}=t,p=Object.assign({},t,{indent:i,type:null});let m=!1;const g=[];for(let v=0;v<e.length;++v){const y=e[v];let S=null;if(Kt(y))!m&&y.spaceBefore&&g.push(""),qp(t,g,y.commentBefore,m),y.comment&&(S=y.comment);else if(Wt(y)){const k=Kt(y.key)?y.key:null;k&&(!m&&k.spaceBefore&&g.push(""),qp(t,g,k.commentBefore,m))}m=!1;let Q=fc(y,p,()=>S=null,()=>m=!0);S&&(Q+=bl(Q,i,d(S))),m&&S&&(m=!1),g.push(r+Q)}let x;if(g.length===0)x=s.start+s.end;else{x=g[0];for(let v=1;v<g.length;++v){const y=g[v];x+=y?`
|
|
106
|
-
${u}${y}`:`
|
|
107
|
-
`}}return n?(x+=`
|
|
108
|
-
`+Xi(d(n),u),o&&o()):m&&a&&a(),x}function K9({items:n},e,{flowChars:t,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:a,options:{commentString:o}}=e;r+=i;const u=Object.assign({},e,{indent:r,inFlow:!0,type:null});let d=!1,p=0;const m=[];for(let v=0;v<n.length;++v){const y=n[v];let S=null;if(Kt(y))y.spaceBefore&&m.push(""),qp(e,m,y.commentBefore,!1),y.comment&&(S=y.comment);else if(Wt(y)){const k=Kt(y.key)?y.key:null;k&&(k.spaceBefore&&m.push(""),qp(e,m,k.commentBefore,!1),k.comment&&(d=!0));const $=Kt(y.value)?y.value:null;$?($.comment&&(S=$.comment),$.commentBefore&&(d=!0)):y.value==null&&(k!=null&&k.comment)&&(S=k.comment)}S&&(d=!0);let Q=fc(y,u,()=>S=null);v<n.length-1&&(Q+=","),S&&(Q+=bl(Q,r,o(S))),!d&&(m.length>p||Q.includes(`
|
|
109
|
-
`))&&(d=!0),m.push(Q),p=m.length}const{start:g,end:x}=t;if(m.length===0)return g+x;if(!d){const v=m.reduce((y,S)=>y+S.length+2,2);d=e.options.lineWidth>0&&v>e.options.lineWidth}if(d){let v=g;for(const y of m)v+=y?`
|
|
110
|
-
${i}${s}${y}`:`
|
|
111
|
-
`;return`${v}
|
|
112
|
-
${s}${x}`}else return`${g}${a}${m.join(" ")}${a}${x}`}function qp({indent:n,options:{commentString:e}},t,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Xi(e(r),n);t.push(i.trimStart())}}function yl(n,e){const t=qt(e)?e.value:e;for(const r of n)if(Wt(r)&&(r.key===e||r.key===t||qt(r.key)&&r.key.value===t))return r}class Ar extends oq{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ea,e),this.items=[]}static from(e,t,r){const{keepUndefined:s,replacer:i}=r,a=new this(e),o=(u,d)=>{if(typeof i=="function")d=i.call(t,u,d);else if(Array.isArray(i)&&!i.includes(u))return;(d!==void 0||s)&&a.items.push(D2(u,d,r))};if(t instanceof Map)for(const[u,d]of t)o(u,d);else if(t&&typeof t=="object")for(const u of Object.keys(t))o(u,t[u]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){var a;let r;Wt(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Wn(e,e==null?void 0:e.value):r=new Wn(e.key,e.value);const s=yl(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);qt(s.value)&&lq(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(u=>i(r,u)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){const t=yl(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const r=yl(this.items,e),s=r==null?void 0:r.value;return(!t&&qt(s)?s.value:s)??void 0}has(e){return!!yl(this.items,e)}set(e,t){this.add(new Wn(e,t),!0)}toJSON(e,t,r){const s=r?new r:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(s);for(const i of this.items)hq(t,s,i);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(const s of this.items)if(!Wt(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),pq(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}const _c={collection:"map",default:!0,nodeClass:Ar,tag:"tag:yaml.org,2002:map",resolve(n,e){return Tc(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>Ar.from(n,e,t)};class Ma extends oq{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super($c,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=_h(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const r=_h(e);if(typeof r!="number")return;const s=this.items[r];return!t&&qt(s)?s.value:s}has(e){const t=_h(e);return typeof t=="number"&&t<this.items.length}set(e,t){const r=_h(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[r];qt(s)&&lq(t)?s.value=t:this.items[r]=t}toJSON(e,t){const r=[];t!=null&&t.onCreate&&t.onCreate(r);let s=0;for(const i of this.items)r.push(es(i,String(s++),t));return r}toString(e,t,r){return e?pq(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){const{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let o of t){if(typeof s=="function"){const u=t instanceof Set?o:String(a++);o=s.call(t,u,o)}i.items.push(xf(o,void 0,r))}}return i}}function _h(n){let e=qt(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Pc={collection:"seq",default:!0,nodeClass:Ma,tag:"tag:yaml.org,2002:seq",resolve(n,e){return jc(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>Ma.from(n,e,t)},Nm={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),Wf(n,e,t,r)}},Cm={identify:n=>n==null,createNode:()=>new Ge(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ge(null),stringify:({source:n},e)=>typeof n=="string"&&Cm.test.test(n)?n:e.options.nullStr},B2={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new Ge(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&B2.test.test(n)){const r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};function Rs({format:n,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let o=e-(i.length-a-1);for(;o-- >0;)i+="0"}return i}const mq={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rs},Oq={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Rs(n)}},gq={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new Ge(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Rs},Rm=n=>typeof n=="bigint"||Number.isInteger(n),U2=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function xq(n,e,t){const{value:r}=n;return Rm(r)&&r>=0?t+r.toString(e):Rs(n)}const bq={identify:n=>Rm(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>U2(n,2,8,t),stringify:n=>xq(n,8,"0o")},yq={identify:Rm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>U2(n,0,10,t),stringify:Rs},vq={identify:n=>Rm(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>U2(n,2,16,t),stringify:n=>xq(n,16,"0x")},J9=[_c,Pc,Nm,Cm,B2,bq,yq,vq,mq,Oq,gq];function Nj(n){return typeof n=="bigint"||Number.isInteger(n)}const Ph=({value:n})=>JSON.stringify(n),eV=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Ph},{identify:n=>n==null,createNode:()=>new Ge(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ph},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Ph},{identify:Nj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Nj(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Ph}],tV={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},nV=[_c,Pc].concat(eV,tV),W2={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let s=0;s<t.length;++s)r[s]=t.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},r,s,i){if(!t)return"";const a=t;let o;if(typeof btoa=="function"){let u="";for(let d=0;d<a.length;++d)u+=String.fromCharCode(a[d]);o=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Ge.BLOCK_LITERAL),e!==Ge.QUOTE_DOUBLE){const u=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),d=Math.ceil(o.length/u),p=new Array(d);for(let m=0,g=0;m<d;++m,g+=u)p[m]=o.substr(g,u);o=p.join(e===Ge.BLOCK_LITERAL?`
|
|
113
|
-
`:" ")}return Wf({comment:n,type:e,value:o},r,s,i)}};function wq(n,e){if(jc(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!Wt(r)){if(Tc(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const s=r.items[0]||new Wn(new Ge(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
114
|
-
${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
|
|
115
|
-
${i.comment}`:r.comment}r=s}n.items[t]=Wt(r)?r:new Wn(r)}}else e("Expected a sequence for this tag");return n}function Sq(n,e,t){const{replacer:r}=t,s=new Ma(n);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof r=="function"&&(a=r.call(e,String(i++),a));let o,u;if(Array.isArray(a))if(a.length===2)o=a[0],u=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const d=Object.keys(a);if(d.length===1)o=d[0],u=a[o];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else o=a;s.items.push(D2(o,u,t))}return s}const G2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wq,createNode:Sq};class Jo extends Ma{constructor(){super(),this.add=Ar.prototype.add.bind(this),this.delete=Ar.prototype.delete.bind(this),this.get=Ar.prototype.get.bind(this),this.has=Ar.prototype.has.bind(this),this.set=Ar.prototype.set.bind(this),this.tag=Jo.tag}toJSON(e,t){if(!t)return super.toJSON(e);const r=new Map;t!=null&&t.onCreate&&t.onCreate(r);for(const s of this.items){let i,a;if(Wt(s)?(i=es(s.key,"",t),a=es(s.value,i,t)):i=es(s,"",t),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,a)}return r}static from(e,t,r){const s=Sq(e,t,r),i=new this;return i.items=s.items,i}}Jo.tag="tag:yaml.org,2002:omap";const I2={collection:"seq",identify:n=>n instanceof Map,nodeClass:Jo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=wq(n,e),r=[];for(const{key:s}of t.items)qt(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Jo,t)},createNode:(n,e,t)=>Jo.from(n,e,t)};function Qq({value:n,source:e},t){return e&&(n?kq:$q).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const kq={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ge(!0),stringify:Qq},$q={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ge(!1),stringify:Qq},rV={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rs},sV={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Rs(n)}},iV={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new Ge(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Rs},Gf=n=>typeof n=="bigint"||Number.isInteger(n);function Em(n,e,t,{intAsBigInt:r}){const s=n[0];if((s==="-"||s==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const a=BigInt(n);return s==="-"?BigInt(-1)*a:a}const i=parseInt(n,t);return s==="-"?-1*i:i}function H2(n,e,t){const{value:r}=n;if(Gf(r)){const s=r.toString(e);return r<0?"-"+t+s.substr(1):t+s}return Rs(n)}const aV={identify:Gf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Em(n,2,2,t),stringify:n=>H2(n,2,"0b")},lV={identify:Gf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Em(n,1,8,t),stringify:n=>H2(n,8,"0")},oV={identify:Gf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Em(n,0,10,t),stringify:Rs},cV={identify:Gf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Em(n,2,16,t),stringify:n=>H2(n,16,"0x")};class ec extends Ar{constructor(e){super(e),this.tag=ec.tag}add(e){let t;Wt(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Wn(e.key,null):t=new Wn(e,null),yl(this.items,t.key)||this.items.push(t)}get(e,t){const r=yl(this.items,e);return!t&&Wt(r)?qt(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const r=yl(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new Wn(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){const{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof s=="function"&&(a=s.call(t,a,a)),i.items.push(D2(a,null,r));return i}}ec.tag="tag:yaml.org,2002:set";const F2={collection:"map",identify:n=>n instanceof Set,nodeClass:ec,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>ec.from(n,e,t),resolve(n,e){if(Tc(n)){if(n.hasAllNullValues(!0))return Object.assign(new ec,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function K2(n,e){const t=n[0],r=t==="-"||t==="+"?n.substring(1):n,s=a=>e?BigInt(a):Number(a),i=r.replace(/_/g,"").split(":").reduce((a,o)=>a*s(60)+s(o),s(0));return t==="-"?s(-1)*i:i}function Tq(n){let{value:e}=n,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Rs(n);let r="";e<0&&(r="-",e*=t(-1));const s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const jq={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>K2(n,t),stringify:Tq},_q={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>K2(n,!1),stringify:Tq},Am={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(Am.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,r,s,i,a,o]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let d=Date.UTC(t,r-1,s,i||0,a||0,o||0,u);const p=e[8];if(p&&p!=="Z"){let m=K2(p,!1);Math.abs(m)<30&&(m*=60),d-=6e4*m}return new Date(d)},stringify:({value:n})=>(n==null?void 0:n.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Cj=[_c,Pc,Nm,Cm,kq,$q,aV,lV,oV,cV,rV,sV,iV,W2,Vi,I2,G2,F2,jq,_q,Am],Rj=new Map([["core",J9],["failsafe",[_c,Pc,Nm]],["json",nV],["yaml11",Cj],["yaml-1.1",Cj]]),Ej={binary:W2,bool:B2,float:gq,floatExp:Oq,floatNaN:mq,floatTime:_q,int:yq,intHex:vq,intOct:bq,intTime:jq,map:_c,merge:Vi,null:Cm,omap:I2,pairs:G2,seq:Pc,set:F2,timestamp:Am},uV={"tag:yaml.org,2002:binary":W2,"tag:yaml.org,2002:merge":Vi,"tag:yaml.org,2002:omap":I2,"tag:yaml.org,2002:pairs":G2,"tag:yaml.org,2002:set":F2,"tag:yaml.org,2002:timestamp":Am};function Mg(n,e,t){const r=Rj.get(e);if(r&&!n)return t&&!r.includes(Vi)?r.concat(Vi):r.slice();let s=r;if(!s)if(Array.isArray(n))s=[];else{const i=Array.from(Rj.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(n))for(const i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));return t&&(s=s.concat(Vi)),s.reduce((i,a)=>{const o=typeof a=="string"?Ej[a]:a;if(!o){const u=JSON.stringify(a),d=Object.keys(Ej).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return i.includes(o)||i.push(o),i},[])}const fV=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;let Pq=class Nq{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Mg(e,"compat"):e?Mg(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?uV:{},this.tags=Mg(t,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Ea,{value:_c}),Object.defineProperty(this,si,{value:Nm}),Object.defineProperty(this,$c,{value:Pc}),this.sortMapEntries=typeof a=="function"?a:a===!0?fV:null}clone(){const e=Object.create(Nq.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function dV(n,e){var u;const t=[];let r=e.directives===!0;if(e.directives!==!1&&n.directives){const d=n.directives.toString(n);d?(t.push(d),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");const s=uq(n,e),{commentString:i}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");const d=i(n.commentBefore);t.unshift(Xi(d,""))}let a=!1,o=null;if(n.contents){if(Kt(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){const m=i(n.contents.commentBefore);t.push(Xi(m,""))}s.forceBlockIndent=!!n.comment,o=n.contents.comment}const d=o?void 0:()=>a=!0;let p=fc(n.contents,s,()=>o=null,d);o&&(p+=bl(p,"",i(o))),(p[0]==="|"||p[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${p}`:t.push(p)}else t.push(fc(n.contents,s));if((u=n.directives)!=null&&u.docEnd)if(n.comment){const d=i(n.comment);d.includes(`
|
|
116
|
-
`)?(t.push("..."),t.push(Xi(d,""))):t.push(`... ${d}`)}else t.push("...");else{let d=n.comment;d&&a&&(d=d.replace(/^\n+/,"")),d&&((!a||o)&&t[t.length-1]!==""&&t.push(""),t.push(Xi(i(d),"")))}return t.join(`
|
|
117
|
-
`)+`
|
|
118
|
-
`}class Nc{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ns,{value:gS});let s=null;typeof t=="function"||Array.isArray(t)?s=t:r===void 0&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Hn({version:a}),this.setSchema(a,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){const e=Object.create(Nc.prototype,{[ns]:{value:gS}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Kt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Mo(this.contents)&&this.contents.add(e)}addIn(e,t){Mo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const r=iq(this);e.anchor=!t||r.has(t)?aq(t||"a",r):t}return new Tm(e.anchor)}createNode(e,t,r){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const S=k=>typeof k=="number"||k instanceof String||k instanceof Number,Q=t.filter(S).map(String);Q.length>0&&(t=t.concat(Q)),s=t}else r===void 0&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:u,onTagObj:d,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:x}=L9(this,a||"a"),v={aliasDuplicateObjects:i??!0,keepUndefined:u??!1,onAnchor:m,onTagObj:d,replacer:s,schema:this.schema,sourceObjects:x},y=xf(e,p,v);return o&&Ht(y)&&(y.flow=!0),g(),y}createPair(e,t,r={}){const s=this.createNode(e,null,r),i=this.createNode(t,null,r);return new Wn(s,i)}delete(e){return Mo(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Iu(e)?this.contents==null?!1:(this.contents=null,!0):Mo(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Ht(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Iu(e)?!t&&qt(this.contents)?this.contents.value:this.contents:Ht(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Ht(this.contents)?this.contents.has(e):!1}hasIn(e){return Iu(e)?this.contents!==void 0:Ht(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ap(this.schema,[e],t):Mo(this.contents)&&this.contents.set(e,t)}setIn(e,t){Iu(e)?this.contents=t:this.contents==null?this.contents=Ap(this.schema,Array.from(e),t):Mo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Hn({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Hn({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new Pq(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},u=es(this.contents,t??"",o);if(typeof i=="function")for(const{count:d,res:p}of o.anchors.values())i(p,d);return typeof a=="function"?Uo(a,{"":u},"",u):u}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return dV(this,e)}}function Mo(n){if(Ht(n))return!0;throw new Error("Expected a YAML collection as document contents")}class J2 extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}}class vl extends J2{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class Cq extends J2{constructor(e,t,r){super("YAMLWarning",e,t,r)}}const Mp=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));const{line:r,col:s}=t.linePos[0];t.message+=` at line ${r}, column ${s}`;let i=s-1,a=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const o=Math.min(i-39,a.length-79);a="…"+a.substring(o),i-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let o=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`…
|
|
119
|
-
`),a=o+a}if(/[^ ]/.test(a)){let o=1;const u=t.linePos[1];(u==null?void 0:u.line)===r&&u.col>s&&(o=Math.max(1,Math.min(u.col-s,80-i)));const d=" ".repeat(i)+"^".repeat(o);t.message+=`:
|
|
120
|
-
|
|
121
|
-
${a}
|
|
122
|
-
${d}
|
|
123
|
-
`}};function dc(n,{flow:e,indicator:t,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let u=!1,d=o,p=o,m="",g="",x=!1,v=!1,y=null,S=null,Q=null,k=null,$=null,j=null,T=null;for(const q of n)switch(v&&(q.type!=="space"&&q.type!=="newline"&&q.type!=="comma"&&i(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),y&&(d&&q.type!=="comment"&&q.type!=="newline"&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),q.type){case"space":!e&&(t!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&q.source.includes(" ")&&(y=q),p=!0;break;case"comment":{p||i(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const z=q.source.substring(1)||" ";m?m+=g+z:m=z,g="",d=!1;break}case"newline":d?m?m+=q.source:(!j||t!=="seq-item-ind")&&(u=!0):g+=q.source,d=!0,x=!0,(S||Q)&&(k=q),p=!0;break;case"anchor":S&&i(q,"MULTIPLE_ANCHORS","A node can have at most one anchor"),q.source.endsWith(":")&&i(q.offset+q.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=q,T??(T=q.offset),d=!1,p=!1,v=!0;break;case"tag":{Q&&i(q,"MULTIPLE_TAGS","A node can have at most one tag"),Q=q,T??(T=q.offset),d=!1,p=!1,v=!0;break}case t:(S||Q)&&i(q,"BAD_PROP_ORDER",`Anchors and tags must be after the ${q.source} indicator`),j&&i(q,"UNEXPECTED_TOKEN",`Unexpected ${q.source} in ${e??"collection"}`),j=q,d=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){$&&i(q,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),$=q,d=!1,p=!1;break}default:i(q,"UNEXPECTED_TOKEN",`Unexpected ${q.type} token`),d=!1,p=!1}const R=n[n.length-1],N=R?R.offset+R.source.length:s;return v&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:$,found:j,spaceBefore:u,comment:m,hasNewline:x,anchor:S,tag:Q,newlineAfterProp:k,end:N,start:T??N}}function bf(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
124
|
-
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(bf(e.key)||bf(e.value))return!0}return!1;default:return!0}}function vS(n,e,t){if((e==null?void 0:e.type)==="flow-collection"){const r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&bf(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Rq(n,e,t){const{uniqueKeys:r}=n.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||qt(i)&&qt(a)&&i.value===a.value;return e.some(i=>s(i.key,t))}const Aj="All mapping items must start at the same column";function hV({composeNode:n,composeEmptyNode:e},t,r,s,i){var p;const a=(i==null?void 0:i.nodeClass)??Ar,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let u=r.offset,d=null;for(const m of r.items){const{start:g,key:x,sep:v,value:y}=m,S=dc(g,{indicator:"explicit-key-ind",next:x??(v==null?void 0:v[0]),offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0}),Q=!S.found;if(Q){if(x&&(x.type==="block-seq"?s(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==r.indent&&s(u,"BAD_INDENT",Aj)),!S.anchor&&!S.tag&&!v){d=S.end,S.comment&&(o.comment?o.comment+=`
|
|
125
|
-
`+S.comment:o.comment=S.comment);continue}(S.newlineAfterProp||bf(x))&&s(x??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=S.found)==null?void 0:p.indent)!==r.indent&&s(u,"BAD_INDENT",Aj);t.atKey=!0;const k=S.end,$=x?n(t,x,S,s):e(t,k,g,null,S,s);t.schema.compat&&vS(r.indent,x,s),t.atKey=!1,Rq(t,o.items,$)&&s(k,"DUPLICATE_KEY","Map keys must be unique");const j=dc(v??[],{indicator:"map-value-ind",next:y,offset:$.range[2],onError:s,parentIndent:r.indent,startOnNewline:!x||x.type==="block-scalar"});if(u=j.end,j.found){Q&&((y==null?void 0:y.type)==="block-map"&&!j.hasNewline&&s(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&S.start<j.found.offset-1024&&s($.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const T=y?n(t,y,j,s):e(t,u,v,null,j,s);t.schema.compat&&vS(r.indent,y,s),u=T.range[2];const R=new Wn($,T);t.options.keepSourceTokens&&(R.srcToken=m),o.items.push(R)}else{Q&&s($.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&($.comment?$.comment+=`
|
|
126
|
-
`+j.comment:$.comment=j.comment);const T=new Wn($);t.options.keepSourceTokens&&(T.srcToken=m),o.items.push(T)}}return d&&d<u&&s(d,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,u,d??u],o}function pV({composeNode:n,composeEmptyNode:e},t,r,s,i){const a=(i==null?void 0:i.nodeClass)??Ma,o=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=r.offset,d=null;for(const{start:p,value:m}of r.items){const g=dc(p,{indicator:"seq-item-ind",next:m,offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)(m==null?void 0:m.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(u,"MISSING_CHAR","Sequence item without - indicator");else{d=g.end,g.comment&&(o.comment=g.comment);continue}const x=m?n(t,m,g,s):e(t,g.end,p,null,g,s);t.schema.compat&&vS(r.indent,m,s),u=x.range[2],o.items.push(x)}return o.range=[r.offset,u,d??u],o}function If(n,e,t,r){let s="";if(n){let i=!1,a="";for(const o of n){const{source:u,type:d}=o;switch(d){case"space":i=!0;break;case"comment":{t&&!i&&r(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=u.substring(1)||" ";s?s+=a+p:s=p,a="";break}case"newline":s&&(a+=u),i=!0;break;default:r(o,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:s,offset:e}}const Xg="Block collections are not allowed within flow collections",zg=n=>n&&(n.type==="block-map"||n.type==="block-seq");function mV({composeNode:n,composeEmptyNode:e},t,r,s,i){var S;const a=r.start.source==="{",o=a?"flow map":"flow sequence",u=(i==null?void 0:i.nodeClass)??(a?Ar:Ma),d=new u(t.schema);d.flow=!0;const p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let m=r.offset+r.start.source.length;for(let Q=0;Q<r.items.length;++Q){const k=r.items[Q],{start:$,key:j,sep:T,value:R}=k,N=dc($,{flow:o,indicator:"explicit-key-ind",next:j??(T==null?void 0:T[0]),offset:m,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!T&&!R){Q===0&&N.comma?s(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):Q<r.items.length-1&&s(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),N.comment&&(d.comment?d.comment+=`
|
|
127
|
-
`+N.comment:d.comment=N.comment),m=N.end;continue}!a&&t.options.strict&&bf(j)&&s(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(Q===0)N.comma&&s(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(N.comma||s(N.start,"MISSING_CHAR",`Missing , between ${o} items`),N.comment){let q="";e:for(const z of $)switch(z.type){case"comma":case"space":break;case"comment":q=z.source.substring(1);break e;default:break e}if(q){let z=d.items[d.items.length-1];Wt(z)&&(z=z.value??z.key),z.comment?z.comment+=`
|
|
128
|
-
`+q:z.comment=q,N.comment=N.comment.substring(q.length+1)}}if(!a&&!T&&!N.found){const q=R?n(t,R,N,s):e(t,N.end,T,null,N,s);d.items.push(q),m=q.range[2],zg(R)&&s(q.range,"BLOCK_IN_FLOW",Xg)}else{t.atKey=!0;const q=N.end,z=j?n(t,j,N,s):e(t,q,$,null,N,s);zg(j)&&s(z.range,"BLOCK_IN_FLOW",Xg),t.atKey=!1;const L=dc(T??[],{flow:o,indicator:"map-value-ind",next:R,offset:z.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(L.found){if(!a&&!N.found&&t.options.strict){if(T)for(const B of T){if(B===L.found)break;if(B.type==="newline"){s(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<L.found.offset-1024&&s(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else R&&("source"in R&&((S=R.source)==null?void 0:S[0])===":"?s(R,"MISSING_CHAR",`Missing space after : in ${o}`):s(L.start,"MISSING_CHAR",`Missing , or : between ${o} items`));const E=R?n(t,R,L,s):L.found?e(t,L.end,T,null,L,s):null;E?zg(R)&&s(E.range,"BLOCK_IN_FLOW",Xg):L.comment&&(z.comment?z.comment+=`
|
|
129
|
-
`+L.comment:z.comment=L.comment);const V=new Wn(z,E);if(t.options.keepSourceTokens&&(V.srcToken=k),a){const B=d;Rq(t,B.items,z)&&s(q,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(V)}else{const B=new Ar(t.schema);B.flow=!0,B.items.push(V);const C=(E??z).range;B.range=[z.range[0],C[1],C[2]],d.items.push(B)}m=E?E.range[2]:L.end}}const g=a?"}":"]",[x,...v]=r.end;let y=m;if((x==null?void 0:x.source)===g)y=x.offset+x.source.length;else{const Q=o[0].toUpperCase()+o.substring(1),k=p?`${Q} must end with a ${g}`:`${Q} in block collection must be sufficiently indented and end with a ${g}`;s(m,p?"MISSING_CHAR":"BAD_INDENT",k),x&&x.source.length!==1&&v.unshift(x)}if(v.length>0){const Q=If(v,y,t.options.strict,s);Q.comment&&(d.comment?d.comment+=`
|
|
130
|
-
`+Q.comment:d.comment=Q.comment),d.range=[r.offset,y,Q.offset]}else d.range=[r.offset,y,y];return d}function Lg(n,e,t,r,s,i){const a=t.type==="block-map"?hV(n,e,t,r,i):t.type==="block-seq"?pV(n,e,t,r,i):mV(n,e,t,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function OV(n,e,t,r,s){var g;const i=r.tag,a=i?e.directives.tagName(i.source,x=>s(i,"TAG_RESOLVE_FAILED",x)):null;if(t.type==="block-seq"){const{anchor:x,newlineAfterProp:v}=r,y=x&&i?x.offset>i.offset?x:i:x??i;y&&(!v||v.offset<y.offset)&&s(y,"MISSING_CHAR","Missing newline after block sequence props")}const o=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!a||a==="!"||a===Ar.tagName&&o==="map"||a===Ma.tagName&&o==="seq")return Lg(n,e,t,s,a);let u=e.schema.tags.find(x=>x.tag===a&&x.collection===o);if(!u){const x=e.schema.knownTags[a];if((x==null?void 0:x.collection)===o)e.schema.tags.push(Object.assign({},x,{default:!1})),u=x;else return x?s(i,"BAD_COLLECTION_TYPE",`${x.tag} used for ${o} collection, but expects ${x.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Lg(n,e,t,s,a)}const d=Lg(n,e,t,s,a,u),p=((g=u.resolve)==null?void 0:g.call(u,d,x=>s(i,"TAG_RESOLVE_FAILED",x),e.options))??d,m=Kt(p)?p:new Ge(p);return m.range=d.range,m.tag=a,u!=null&&u.format&&(m.format=u.format),m}function Eq(n,e,t){const r=e.offset,s=gV(e,n.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?Ge.BLOCK_FOLDED:Ge.BLOCK_LITERAL,a=e.source?xV(e.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const S=a[y][1];if(S===""||S==="\r")o=y;else break}if(o===0){const y=s.chomp==="+"&&a.length>0?`
|
|
131
|
-
`.repeat(Math.max(1,a.length-1)):"";let S=r+s.length;return e.source&&(S+=e.source.length),{value:y,type:i,comment:s.comment,range:[r,S,S]}}let u=e.indent+s.indent,d=e.offset+s.length,p=0;for(let y=0;y<o;++y){const[S,Q]=a[y];if(Q===""||Q==="\r")s.indent===0&&S.length>u&&(u=S.length);else{S.length<u&&t(d+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(u=S.length),p=y,u===0&&!n.atRoot&&t(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=S.length+Q.length+1}for(let y=a.length-1;y>=o;--y)a[y][0].length>u&&(o=y+1);let m="",g="",x=!1;for(let y=0;y<p;++y)m+=a[y][0].slice(u)+`
|
|
132
|
-
`;for(let y=p;y<o;++y){let[S,Q]=a[y];d+=S.length+Q.length+1;const k=Q[Q.length-1]==="\r";if(k&&(Q=Q.slice(0,-1)),Q&&S.length<u){const j=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(d-Q.length-(k?2:1),"BAD_INDENT",j),S=""}i===Ge.BLOCK_LITERAL?(m+=g+S.slice(u)+Q,g=`
|
|
133
|
-
`):S.length>u||Q[0]===" "?(g===" "?g=`
|
|
134
|
-
`:!x&&g===`
|
|
135
|
-
`&&(g=`
|
|
136
|
-
|
|
137
|
-
`),m+=g+S.slice(u)+Q,g=`
|
|
138
|
-
`,x=!0):Q===""?g===`
|
|
139
|
-
`?m+=`
|
|
140
|
-
`:g=`
|
|
141
|
-
`:(m+=g+Q,g=" ",x=!1)}switch(s.chomp){case"-":break;case"+":for(let y=o;y<a.length;++y)m+=`
|
|
142
|
-
`+a[y][0].slice(u);m[m.length-1]!==`
|
|
143
|
-
`&&(m+=`
|
|
144
|
-
`);break;default:m+=`
|
|
145
|
-
`}const v=r+s.length+e.source.length;return{value:m,type:i,comment:s.comment,range:[r,v,v]}}function gV({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=e[0],i=s[0];let a=0,o="",u=-1;for(let g=1;g<s.length;++g){const x=s[g];if(!o&&(x==="-"||x==="+"))o=x;else{const v=Number(x);!a&&v?a=v:u===-1&&(u=n+g)}}u!==-1&&r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let d=!1,p="",m=s.length;for(let g=1;g<e.length;++g){const x=e[g];switch(x.type){case"space":d=!0;case"newline":m+=x.source.length;break;case"comment":t&&!d&&r(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=x.source.length,p=x.source.substring(1);break;case"error":r(x,"UNEXPECTED_TOKEN",x.message),m+=x.source.length;break;default:{const v=`Unexpected token in block scalar header: ${x.type}`;r(x,"UNEXPECTED_TOKEN",v);const y=x.source;y&&typeof y=="string"&&(m+=y.length)}}}return{mode:i,indent:a,chomp:o,comment:p,length:m}}function xV(n){const e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),i=[r!=null&&r[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)i.push([e[a],e[a+1]]);return i}function Aq(n,e,t){const{offset:r,type:s,source:i,end:a}=n;let o,u;const d=(g,x,v)=>t(r+g,x,v);switch(s){case"scalar":o=Ge.PLAIN,u=bV(i,d);break;case"single-quoted-scalar":o=Ge.QUOTE_SINGLE,u=yV(i,d);break;case"double-quoted-scalar":o=Ge.QUOTE_DOUBLE,u=vV(i,d);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const p=r+i.length,m=If(a,p,e,t);return{value:u,type:o,comment:m.comment,range:[r,p,m.offset]}}function bV(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),qq(n)}function yV(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),qq(n.slice(1,-1)).replace(/''/g,"'")}function qq(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
146
|
-
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
147
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let s=r[1],i=" ",a=e.lastIndex;for(t.lastIndex=a;r=t.exec(n);)r[1]===""?i===`
|
|
148
|
-
`?s+=i:i=`
|
|
149
|
-
`:(s+=i+r[1],i=" "),a=t.lastIndex;const o=/[ \t]*(.*)/sy;return o.lastIndex=a,r=o.exec(n),s+i+((r==null?void 0:r[1])??"")}function vV(n,e){let t="";for(let r=1;r<n.length-1;++r){const s=n[r];if(!(s==="\r"&&n[r+1]===`
|
|
150
|
-
`))if(s===`
|
|
151
|
-
`){const{fold:i,offset:a}=wV(n,r);t+=i,r=a}else if(s==="\\"){let i=n[++r];const a=SV[i];if(a)t+=a;else if(i===`
|
|
152
|
-
`)for(i=n[r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="\r"&&n[r+1]===`
|
|
153
|
-
`)for(i=n[++r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="x"||i==="u"||i==="U"){const o={x:2,u:4,U:8}[i];t+=QV(n,r+1,o,e),r+=o}else{const o=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(s===" "||s===" "){const i=r;let a=n[r+1];for(;a===" "||a===" ";)a=n[++r+1];a!==`
|
|
154
|
-
`&&!(a==="\r"&&n[r+2]===`
|
|
155
|
-
`)&&(t+=r>i?n.slice(i,r+1):s)}else t+=s}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function wV(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
|
|
156
|
-
`||r==="\r")&&!(r==="\r"&&n[e+2]!==`
|
|
157
|
-
`);)r===`
|
|
158
|
-
`&&(t+=`
|
|
159
|
-
`),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}const SV={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
160
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function QV(n,e,t,r){const s=n.substr(e,t),a=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(a)){const o=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(a)}function Mq(n,e,t,r){const{value:s,type:i,comment:a,range:o}=e.type==="block-scalar"?Eq(n,e,r):Aq(e,n.options.strict,r),u=t?n.directives.tagName(t.source,m=>r(t,"TAG_RESOLVE_FAILED",m)):null;let d;n.options.stringKeys&&n.atKey?d=n.schema[si]:u?d=kV(n.schema,s,u,t,r):e.type==="scalar"?d=$V(n,s,e,r):d=n.schema[si];let p;try{const m=d.resolve(s,g=>r(t??e,"TAG_RESOLVE_FAILED",g),n.options);p=qt(m)?m:new Ge(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(t??e,"TAG_RESOLVE_FAILED",g),p=new Ge(s)}return p.range=o,p.source=s,i&&(p.type=i),u&&(p.tag=u),d.format&&(p.format=d.format),a&&(p.comment=a),p}function kV(n,e,t,r,s){var o;if(t==="!")return n[si];const i=[];for(const u of n.tags)if(!u.collection&&u.tag===t)if(u.default&&u.test)i.push(u);else return u;for(const u of i)if((o=u.test)!=null&&o.test(e))return u;const a=n.knownTags[t];return a&&!a.collection?(n.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[si])}function $V({atKey:n,directives:e,schema:t},r,s,i){const a=t.tags.find(o=>{var u;return(o.default===!0||n&&o.default==="key")&&((u=o.test)==null?void 0:u.test(r))})||t[si];if(t.compat){const o=t.compat.find(u=>{var d;return u.default&&((d=u.test)==null?void 0:d.test(r))})??t[si];if(a.tag!==o.tag){const u=e.tagString(a.tag),d=e.tagString(o.tag),p=`Value may be parsed as either ${u} or ${d}`;i(s,"TAG_RESOLVE_FAILED",p,!0)}}return a}function TV(n,e,t){if(e){t??(t=e.length);for(let r=t-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":n-=s.source.length;continue}for(s=e[++r];(s==null?void 0:s.type)==="space";)n+=s.source.length,s=e[++r];break}}return n}const jV={composeNode:Xq,composeEmptyNode:eQ};function Xq(n,e,t,r){const s=n.atKey,{spaceBefore:i,comment:a,anchor:o,tag:u}=t;let d,p=!0;switch(e.type){case"alias":d=_V(n,e,r),(o||u)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=Mq(n,e,u,r),o&&(d.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":d=OV(jV,n,e,t,r),o&&(d.anchor=o.source.substring(1));break;default:{const m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",m),d=eQ(n,e.offset,void 0,null,t,r),p=!1}}return o&&d.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!qt(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&r(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(d.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?d.comment=a:d.commentBefore=a),n.options.keepSourceTokens&&p&&(d.srcToken=e),d}function eQ(n,e,t,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:u},d){const p={type:"scalar",offset:TV(e,t,r),indent:-1,source:""},m=Mq(n,p,o,d);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(m.spaceBefore=!0),i&&(m.comment=i,m.range[2]=u),m}function _V({options:n},{offset:e,source:t,end:r},s){const i=new Tm(t.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+t.length,o=If(r,a,n.strict,s);return i.range=[e,a,o.offset],o.comment&&(i.comment=o.comment),i}function PV(n,e,{offset:t,start:r,value:s,end:i},a){const o=Object.assign({_directives:e},n),u=new Nc(void 0,o),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},p=dc(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:t,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(u.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=s?Xq(d,s,p,a):eQ(d,p.end,r,null,p,a);const m=u.contents.range[2],g=If(i,m,!1,a);return g.comment&&(u.comment=g.comment),u.range=[t,m,g.offset],u}function Ru(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function qj(n){var s;let e="",t=!1,r=!1;for(let i=0;i<n.length;++i){const a=n[i];switch(a[0]){case"#":e+=(e===""?"":r?`
|
|
161
|
-
|
|
162
|
-
`:`
|
|
163
|
-
`)+(a.substring(1)||" "),t=!0,r=!1;break;case"%":((s=n[i+1])==null?void 0:s[0])!=="#"&&(i+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}class tQ{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,s,i)=>{const a=Ru(t);i?this.warnings.push(new Cq(a,r,s)):this.errors.push(new vl(a,r,s))},this.directives=new Hn({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:r,afterEmptyLine:s}=qj(this.prelude);if(r){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
164
|
-
${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(Ht(i)&&!i.flow&&i.items.length>0){let a=i.items[0];Wt(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${r}
|
|
165
|
-
${o}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r}
|
|
166
|
-
${a}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:qj(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(const s of e)yield*this.next(s);yield*this.end(t,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,r,s)=>{const i=Ru(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=PV(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new vl(Ru(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new vl(Ru(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const t=If(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
167
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new vl(Ru(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),s=new Nc(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}}function NV(n,e=!0,t){if(n){const r=(s,i,a)=>{const o=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(o,i,a);else throw new vl([o,o+1],i,a)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Aq(n,e,r);case"block-scalar":return Eq({options:{strict:e}},n,r)}}return null}function CV(n,e){const{implicitKey:t=!1,indent:r,inFlow:s=!1,offset:i=-1,type:a="PLAIN"}=e,o=Wf({type:a,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
168
|
-
`}];switch(o[0]){case"|":case">":{const d=o.indexOf(`
|
|
169
|
-
`),p=o.substring(0,d),m=o.substring(d+1)+`
|
|
170
|
-
`,g=[{type:"block-scalar-header",offset:i,indent:r,source:p}];return zq(g,u)||g.push({type:"newline",offset:-1,indent:r,source:`
|
|
171
|
-
`}),{type:"block-scalar",offset:i,indent:r,props:g,source:m}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:o,end:u};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:o,end:u};default:return{type:"scalar",offset:i,indent:r,source:o,end:u}}}function RV(n,e,t={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:a}=t,o="indent"in n?n.indent:null;if(r&&typeof o=="number"&&(o+=2),!a)switch(n.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const d=n.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const u=Wf({type:a,value:e},{implicitKey:s||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":EV(n,u);break;case'"':Zg(n,u,"double-quoted-scalar");break;case"'":Zg(n,u,"single-quoted-scalar");break;default:Zg(n,u,"scalar")}}function EV(n,e){const t=e.indexOf(`
|
|
172
|
-
`),r=e.substring(0,t),s=e.substring(t+1)+`
|
|
173
|
-
`;if(n.type==="block-scalar"){const i=n.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,n.source=s}else{const{offset:i}=n,a="indent"in n?n.indent:-1,o=[{type:"block-scalar-header",offset:i,indent:a,source:r}];zq(o,"end"in n?n.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
|
|
174
|
-
`});for(const u of Object.keys(n))u!=="type"&&u!=="offset"&&delete n[u];Object.assign(n,{type:"block-scalar",indent:a,props:o,source:s})}}function zq(n,e){if(e)for(const t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Zg(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{const r=n.props.slice(1);let s=e.length;n.props[0].type==="block-scalar-header"&&(s-=n.props[0].source.length);for(const i of r)i.offset+=s;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{const s={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
175
|
-
`};delete n.items,Object.assign(n,{type:t,source:e,end:[s]});break}default:{const r="indent"in n?n.indent:-1,s="end"in n&&Array.isArray(n.end)?n.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(const i of Object.keys(n))i!=="type"&&i!=="offset"&&delete n[i];Object.assign(n,{type:t,indent:r,source:e,end:s})}}}const AV=n=>"type"in n?Xp(n):Op(n);function Xp(n){switch(n.type){case"block-scalar":{let e="";for(const t of n.props)e+=Xp(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(const t of n.items)e+=Op(t);return e}case"flow-collection":{let e=n.start.source;for(const t of n.items)e+=Op(t);for(const t of n.end)e+=t.source;return e}case"document":{let e=Op(n);if(n.end)for(const t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const t of n.end)e+=t.source;return e}}}function Op({start:n,key:e,sep:t,value:r}){let s="";for(const i of n)s+=i.source;if(e&&(s+=Xp(e)),t)for(const i of t)s+=i.source;return r&&(s+=Xp(r)),s}const wS=Symbol("break visit"),qV=Symbol("skip children"),Lq=Symbol("remove item");function Cl(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),Zq(Object.freeze([]),n,e)}Cl.BREAK=wS;Cl.SKIP=qV;Cl.REMOVE=Lq;Cl.itemAtPath=(n,e)=>{let t=n;for(const[r,s]of e){const i=t==null?void 0:t[r];if(i&&"items"in i)t=i.items[s];else return}return t};Cl.parentCollection=(n,e)=>{const t=Cl.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],s=t==null?void 0:t[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function Zq(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(const s of["key","value"]){const i=e[s];if(i&&"items"in i){for(let a=0;a<i.items.length;++a){const o=Zq(Object.freeze(n.concat([[s,a]])),i.items[a],t);if(typeof o=="number")a=o-1;else{if(o===wS)return wS;o===Lq&&(i.items.splice(a,1),a-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}const qm="\uFEFF",Mm="",Xm="",yf="",MV=n=>!!n&&"items"in n,XV=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function zV(n){switch(n){case qm:return"<BOM>";case Mm:return"<DOC>";case Xm:return"<FLOW_END>";case yf:return"<SCALAR>";default:return JSON.stringify(n)}}function Vq(n){switch(n){case qm:return"byte-order-mark";case Mm:return"doc-mode";case Xm:return"flow-error-end";case yf:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
176
|
-
`:case`\r
|
|
177
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const LV=Object.freeze(Object.defineProperty({__proto__:null,BOM:qm,DOCUMENT:Mm,FLOW_END:Xm,SCALAR:yf,createScalarToken:CV,isCollection:MV,isScalar:XV,prettyToken:zV,resolveAsScalar:NV,setScalarValue:RV,stringify:AV,tokenType:Vq,visit:Cl},Symbol.toStringTag,{value:"Module"}));function Ss(n){switch(n){case void 0:case" ":case`
|
|
178
|
-
`:case"\r":case" ":return!0;default:return!1}}const Mj=new Set("0123456789ABCDEFabcdef"),ZV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Nh=new Set(",[]{}"),VV=new Set(` ,[]{}
|
|
179
|
-
\r `),Vg=n=>!n||VV.has(n);class Yq{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
180
|
-
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
181
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){const s=this.buffer[r+e+1];if(s===`
|
|
182
|
-
`||!s&&!this.atEnd)return e+r+1}return t===`
|
|
183
|
-
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){const r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Ss(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
184
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===qm&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){const i=e[r-1];if(i===" "||i===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){const i=e[t-1];if(i===" "||i===" ")t-=1;else break}const s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Mm,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&Ss(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ss(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ss(t)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Vg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Ss(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Xm,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Vg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Ss(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}const r=this.buffer.substring(0,t);let s=r.indexOf(`
|
|
185
|
-
`,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
|
|
186
|
-
`,i)}s!==-1&&(t=s-(r[s-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Ss(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
|
|
187
|
-
`:e=i,t=0;break;case"\r":{const a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
188
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
189
|
-
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
190
|
-
`;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);const o=i;for(;a===" ";)a=this.buffer[--i];if(a===`
|
|
191
|
-
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield yf,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(Ss(i)||e&&Nh.has(i))break;t=r}else if(Ss(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
|
|
192
|
-
`?(r+=1,s=`
|
|
193
|
-
`,i=this.buffer[r+1]):t=r),i==="#"||e&&Nh.has(i))break;if(s===`
|
|
194
|
-
`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(e&&Nh.has(s))break;t=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield yf,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Vg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Ss(t)||e&&Nh.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Ss(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ZV.has(t))t=this.buffer[++e];else if(t==="%"&&Mj.has(this.buffer[e+1])&&Mj.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
195
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
196
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");const s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Dq{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){const i=t+r>>1;this.lineStarts[i]<e?t=i+1:r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}}function ka(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Xj(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Bq(n){switch(n==null?void 0:n.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ch(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Xo(n){var t;if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=n[++e])==null?void 0:t.type)==="space";);return n.splice(e,n.length)}function zj(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!ka(e.start,"explicit-key-ind")&&!ka(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Bq(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}let nQ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Yq,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Vq(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&zj(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Xj(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Xj(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Ch(this.peek(2)),r=Xo(t);let s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
197
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
198
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var r;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const s=e.items[e.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&t.sep&&!t.value){const o=[];for(let u=0;u<t.sep.length;++u){const d=t.sep[u];switch(d.type){case"newline":o.push(u);break;case"space":break;case"comment":d.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ka(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(Bq(t.key)&&!ka(t.sep,"newline")){const o=Xo(t.start),u=t.key,d=t.sep;d.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:u,sep:d}]})}else a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if(ka(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=Xo(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:a,key:null,sep:[this.sourceToken]}):ka(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||t.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ka(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const s=e.items[e.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ka(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Ch(r),i=Xo(s);zj(e);const a=e.end.splice(1,e.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
199
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
200
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Ch(e),r=Xo(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Ch(e),r=Xo(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function Uq(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Dq||null,prettyErrors:e}}function YV(n,e={}){const{lineCounter:t,prettyErrors:r}=Uq(e),s=new nQ(t==null?void 0:t.addNewLine),i=new tQ(e),a=Array.from(i.compose(s.parse(n)));if(r&&t)for(const o of a)o.errors.forEach(Mp(n,t)),o.warnings.forEach(Mp(n,t));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())}function Wq(n,e={}){const{lineCounter:t,prettyErrors:r}=Uq(e),s=new nQ(t==null?void 0:t.addNewLine),i=new tQ(e);let a=null;for(const o of i.compose(s.parse(n),!0,n.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new vl(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(a.errors.forEach(Mp(n,t)),a.warnings.forEach(Mp(n,t))),a}function DV(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);const s=Wq(n,t);if(!s)return null;if(s.warnings.forEach(i=>fq(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},t))}function BV(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(n===void 0){const{keepUndefined:s}=t??e??{};if(!s)return}return Zl(n)&&!r?n.toString(t):new Nc(n,r,t).toString(t)}const Lj=Object.freeze(Object.defineProperty({__proto__:null,Alias:Tm,CST:LV,Composer:tQ,Document:Nc,Lexer:Yq,LineCounter:Dq,Pair:Wn,Parser:nQ,Scalar:Ge,Schema:Pq,YAMLError:J2,YAMLMap:Ar,YAMLParseError:vl,YAMLSeq:Ma,YAMLWarning:Cq,isAlias:Ba,isCollection:Ht,isDocument:Zl,isMap:Tc,isNode:Kt,isPair:Wt,isScalar:qt,isSeq:jc,parse:DV,parseAllDocuments:YV,parseDocument:Wq,stringify:BV,visit:Vl,visitAsync:$m},Symbol.toStringTag,{value:"Module"})),UV="";class WV{constructor(e=UV){this.cachedCloudUrl=null,this.baseUrl=e,this.wsBaseUrl=e.replace("http","ws")}async request(e,t){const r=await fetch(`${this.baseUrl}${e}`,{...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!r.ok){const s=await r.json().catch(()=>({detail:r.statusText}));throw new Error(s.detail||`API Error: ${r.status}`)}return r.json()}async getStatus(){return this.request("/api/v1/status")}async getAuthStatus(){return this.request("/api/v1/auth/status")}async logout(){return this.request("/api/v1/auth/logout",{method:"POST"})}async startLogin(e){return this.request("/api/v1/auth/login",{method:"POST",body:JSON.stringify(e||{})})}async pollLoginStatus(e){return this.request(`/api/v1/auth/login/poll/${encodeURIComponent(e)}`)}async getAvailableCommands(){return this.request("/api/v1/commands/available")}async executeCommand(e){return this.request("/api/v1/commands/execute",{method:"POST",body:JSON.stringify(e)})}async runCommand(e){return this.request("/api/v1/commands/run",{method:"POST",body:JSON.stringify(e)})}async cancelCommand(){return this.request("/api/v1/commands/cancel",{method:"POST"})}async getCommandStatus(){return this.request("/api/v1/commands/status")}async getJobStatus(e){return this.request(`/api/v1/commands/jobs/${e}`)}async cancelJob(e){return this.request(`/api/v1/commands/jobs/${e}/cancel`,{method:"POST"})}async getJobHistory(e=50,t=0){return this.request(`/api/v1/commands/history?limit=${e}&offset=${t}`)}async spawnTerminal(e){return this.request("/api/v1/commands/spawn-terminal",{method:"POST",body:JSON.stringify(e)})}async getSpawnedJobStatus(e){return this.request(`/api/v1/commands/spawned-jobs/${e}/status`)}async getFileTree(e="",t=3){const r=new URLSearchParams;return e&&r.set("path",e),r.set("depth",t.toString()),this.request(`/api/v1/files/tree?${r}`)}async getFileContent(e){return this.request(`/api/v1/files/content?path=${encodeURIComponent(e)}`)}async writeFile(e,t,r="utf-8"){return this.request("/api/v1/files/write",{method:"POST",body:JSON.stringify({path:e,content:t,encoding:r})})}async getPddrc(){try{const e=await this.getFileContent(".pddrc");return Lj.parse(e.content)}catch{return null}}async savePddrc(e){const t=Lj.stringify(e);return this.writeFile(".pddrc",t)}async listPrompts(){return this.request("/api/v1/files/prompts")}async analyzePrompt(e){return this.request("/api/v1/prompts/analyze",{method:"POST",body:JSON.stringify(e)})}async analyzeFile(e,t){return(await this.analyzePrompt({path:e,model:t||"claude-sonnet-4-20250514",preprocess:!1})).raw_metrics}async getSyncStatus(e,t){return this.request(`/api/v1/prompts/sync-status?basename=${encodeURIComponent(e)}&language=${encodeURIComponent(t)}`)}async getModels(){return this.request("/api/v1/prompts/models")}async checkMatch(e){return this.request("/api/v1/prompts/check-match",{method:"POST",body:JSON.stringify(e)})}async analyzeDiff(e){return this.request("/api/v1/prompts/diff-analysis",{method:"POST",body:JSON.stringify(e)})}async getPromptHistory(e){return this.request("/api/v1/prompts/git-history",{method:"POST",body:JSON.stringify(e)})}async getPromptDiff(e){return this.request("/api/v1/prompts/prompt-diff",{method:"POST",body:JSON.stringify(e)})}async checkArchitectureExists(){try{return await this.getFileContent("architecture.json"),{exists:!0,path:"architecture.json"}}catch{return{exists:!1}}}async getArchitecture(){const e=await this.getFileContent("architecture.json");return JSON.parse(e.content)}async saveArchitecture(e){const t=JSON.stringify(e,null,2);return this.writeFile("architecture.json",t)}async validateArchitecture(e){return this.request("/api/v1/architecture/validate",{method:"POST",body:JSON.stringify({modules:e})})}async syncArchitectureFromPrompts(e={}){return this.request("/api/v1/architecture/sync-from-prompts",{method:"POST",body:JSON.stringify(e)})}async generateTagsForPrompt(e){return this.request("/api/v1/architecture/generate-tags-for-prompt",{method:"POST",body:JSON.stringify({prompt_filename:e})})}async listMarkdownFiles(){const e=[];try{const t=await this.getFileTree("",4),r=(s,i="")=>{const a=i?`${i}/${s.name}`:s.name;if(s.type==="file"&&s.name.endsWith(".md")&&e.push(a),s.children)for(const o of s.children)r(o,a)};r(t)}catch(t){console.error("Failed to list markdown files:",t)}return e}async generateArchitecture(e){const t={};if(e.prdPath)t.PRD_FILE=e.prdPath;else if(e.prdContent){const a=".pdd/temp_prd.md";await this.writeFile(a,e.prdContent),t.PRD_FILE=a}if(e.techStackPath)t.TECH_STACK_FILE=e.techStackPath;else if(e.techStackContent){const a=".pdd/temp_tech_stack.md";await this.writeFile(a,e.techStackContent),t.TECH_STACK_FILE=a}e.appName&&(t.APP_NAME=e.appName);const r=e.outputPath||"architecture.json",s=[];for(const[a,o]of Object.entries(t))s.push(`${a}=${o}`);const i={output:r,template:"architecture/architecture_json",env:s};if(e.globalOptions){const{strength:a,temperature:o,time:u,verbose:d,quiet:p,force:m}=e.globalOptions;a!==void 0&&(i.strength=a),o!==void 0&&(i.temperature=o),u!==void 0&&(i.time=u),d&&(i.verbose=!0),p&&(i.quiet=!0),m&&(i.force=!0)}return this.runCommand({command:"generate",args:{},options:i})}async generatePromptFromArchitecture(e){const{module:t,langOrFramework:r,architectureFile:s,prdFile:i,techStackFile:a,outputPath:o,globalOptions:u}=e,d=[`MODULE=${t}`,`LANG_OR_FRAMEWORK=${r}`,`ARCHITECTURE_FILE=${s||"architecture.json"}`];i&&d.push(`PRD_FILE=${i}`),a&&d.push(`TECH_STACK_FILE=${a}`);const p={template:"generic/generate_prompt",env:d,output:o||`prompts/${t}_${r}.prompt`};if(u){const{strength:m,temperature:g,time:x,verbose:v,quiet:y,force:S}=u;m!==void 0&&(p.strength=m),g!==void 0&&(p.temperature=g),x!==void 0&&(p.time=x),v&&(p.verbose=!0),y&&(p.quiet=!0),S&&(p.force=!0)}return this.runCommand({command:"generate",args:{},options:p})}async batchGeneratePrompts(e,t,r){const s=[],{modules:i,architectureFile:a,prdFile:o,techStackFile:u,globalOptions:d}=e;for(let p=0;p<i.length&&!(r!=null&&r());p++){const{module:m,langOrFramework:g}=i[p];t==null||t(p+1,i.length,m);try{const x=await this.generatePromptFromArchitecture({module:m,langOrFramework:g,architectureFile:a,prdFile:o,techStackFile:u,globalOptions:d});s.push({module:`${m}_${g}`,success:x.success,error:x.success?void 0:x.message})}catch(x){s.push({module:`${m}_${g}`,success:!1,error:x instanceof Error?x.message:String(x)})}}return s}async getJWTToken(){try{return(await this.request("/api/v1/auth/jwt-token")).jwt}catch{return null}}async fetchCloudUrl(){try{return(await this.request("/api/v1/config/cloud-url")).cloud_url}catch(e){return console.warn("Failed to fetch cloud URL from server, using default:",e),"https://us-central1-prompt-driven-development.cloudfunctions.net"}}async getCloudUrl(){return this.cachedCloudUrl||(this.cachedCloudUrl=await this.fetchCloudUrl()),this.cachedCloudUrl}async listRemoteSessions(){const e=await this.getJWTToken();if(!e)throw new Error("Not authenticated. Please run: pdd auth login");const t=await this.getCloudUrl(),r=await fetch(`${t}/listSessions`,{method:"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){const i=await r.json().catch(()=>({error:r.statusText}));throw new Error(i.error||`Failed to list sessions: ${r.status}`)}return(await r.json()).sessions||[]}async submitRemoteCommand(e){const t=await this.getJWTToken();if(!t)throw new Error("Not authenticated. Please run: pdd auth login");const r=await this.getCloudUrl(),s=await fetch(`${r}/submitCommand`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const i=await s.json().catch(()=>({error:s.statusText}));throw new Error(i.error||`Failed to submit command: ${s.status}`)}return await s.json()}async getRemoteCommandStatus(e,t){const r=await this.getJWTToken();if(!r)throw new Error("Not authenticated. Please run: pdd auth login");const s=await this.getCloudUrl(),i=await fetch(`${s}/getCommandStatus?sessionId=${encodeURIComponent(e)}&commandId=${encodeURIComponent(t)}`,{method:"GET",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!i.ok){if(i.status===404)return null;const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error||`Failed to get command status: ${i.status}`)}const o=(await i.json()).command;return o?{commandId:o.commandId,type:o.type,status:o.status,createdAt:o.createdAt,updatedAt:o.updatedAt,response:o.response}:null}async cancelRemoteCommand(e){const t=await this.getJWTToken();if(!t)throw new Error("Not authenticated. Please run: pdd auth login");const r=await this.getCloudUrl(),s=await fetch(`${r}/cancelCommand`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const i=await s.json().catch(()=>({error:s.statusText}));throw new Error(i.error||`Failed to cancel command: ${s.status}`)}return s.json()}connectToJobStream(e,t){const r=new WebSocket(`${this.wsBaseUrl}/ws/jobs/${e}/stream`);return r.onmessage=s=>{var i,a,o,u,d,p,m,g;try{const x=JSON.parse(s.data);switch((i=t.onMessage)==null||i.call(t,x.type,x.data),x.type){case"stdout":(a=t.onStdout)==null||a.call(t,x.data);break;case"stderr":(o=t.onStderr)==null||o.call(t,x.data);break;case"progress":(u=t.onProgress)==null||u.call(t,x.current,x.total,x.message);break;case"complete":(g=t.onComplete)==null||g.call(t,(d=x.data)==null?void 0:d.success,(p=x.data)==null?void 0:p.result,((m=x.data)==null?void 0:m.cost)||0);break}}catch(x){console.error("Failed to parse WebSocket message:",x)}},r.onerror=s=>{var i;(i=t.onError)==null||i.call(t,new Error("WebSocket error"))},r.onclose=()=>{var s;(s=t.onClose)==null||s.call(t)},r}sendCancelRequest(e){e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"cancel"}))}}const Ce=new WV,GV=n=>n.trim()?n.length<2?"Name must be at least 2 characters":n.length>50?"Name must be 50 characters or less":/^[a-z][a-z0-9_]*$/.test(n)?null:"Name must start with a letter and contain only lowercase letters, numbers, and underscores":"Name is required",Zj=({onClose:n,onCreate:e,isCreating:t,existingPrompts:r})=>{const[s,i]=P.useState(""),[a,o]=P.useState("python"),[u,d]=P.useState(""),[p,m]=P.useState(null),g=P.useMemo(()=>s.trim()?`prompts/${s.trim()}_${a}.prompt`:"",[s,a]),x=P.useMemo(()=>g?r.some(y=>y.prompt===g):!1,[g,r]),v=async y=>{y.preventDefault(),m(null);const S=GV(s.trim());if(S){m(S);return}if(x){m("A prompt with this name and language already exists");return}const Q=A9(s.trim(),a,u),k={prompt:g,sync_basename:s.trim(),language:a};try{await e({path:g,content:Q,info:k})}catch($){m($.message||"Failed to create prompt")}};return f.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4 animate-fade-in",onClick:t?void 0:n,role:"dialog","aria-modal":"true","aria-labelledby":"create-prompt-title",children:f.jsxs("div",{className:"bg-gray-800 rounded-none sm:rounded-lg shadow-xl w-full h-full sm:h-auto sm:max-w-lg sm:max-h-[90vh] flex flex-col ring-1 ring-white/10 overflow-y-auto",onClick:y=>y.stopPropagation(),children:[f.jsxs("header",{className:"flex items-center justify-between p-4 border-b border-gray-700",children:[f.jsx("h2",{id:"create-prompt-title",className:"text-lg font-semibold text-white",children:"Create New Prompt"}),f.jsx("button",{onClick:n,className:"p-2 rounded-full text-gray-400 hover:bg-gray-700 hover:text-white transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50","aria-label":"Close modal",disabled:t,children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("form",{onSubmit:v,children:[f.jsxs("main",{className:"p-6 space-y-4",children:[f.jsxs("div",{children:[f.jsxs("label",{htmlFor:"prompt-name",className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Prompt Name ",f.jsx("span",{className:"text-red-400",children:"*"})]}),f.jsx("input",{id:"prompt-name",type:"text",value:s,onChange:y=>i(y.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")),placeholder:"calculator",className:"block w-full rounded-md border-0 bg-white/5 py-2.5 px-3 text-white shadow-sm ring-1 ring-inset ring-white/10 focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:text-sm transition-shadow duration-200",disabled:t,autoFocus:!0}),f.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Lowercase letters, numbers, and underscores only"})]}),f.jsxs("div",{children:[f.jsxs("label",{htmlFor:"prompt-language",className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Language ",f.jsx("span",{className:"text-red-400",children:"*"})]}),f.jsx("select",{id:"prompt-language",value:a,onChange:y=>o(y.target.value),className:"block w-full rounded-md border-0 bg-white/5 py-2.5 px-3 text-white shadow-sm ring-1 ring-inset ring-white/10 focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:text-sm transition-shadow duration-200",disabled:t,children:E9.map(y=>f.jsx("option",{value:y.value,className:"bg-gray-800",children:y.label},y.value))})]}),f.jsxs("div",{children:[f.jsxs("label",{htmlFor:"prompt-description",className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Description ",f.jsx("span",{className:"text-gray-500",children:"(optional)"})]}),f.jsx("textarea",{id:"prompt-description",value:u,onChange:y=>d(y.target.value),placeholder:"handles basic arithmetic operations",rows:2,className:"block w-full rounded-md border-0 bg-white/5 py-2.5 px-3 text-white shadow-sm ring-1 ring-inset ring-white/10 focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:text-sm transition-shadow duration-200 resize-none",disabled:t}),f.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Brief description - will be included in the prompt template"})]}),g&&f.jsxs("div",{className:`rounded-md p-3 ${x?"bg-red-900/30 ring-1 ring-red-500/30":"bg-gray-900/50"}`,children:[f.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"File will be created at:"}),f.jsx("p",{className:`font-mono text-sm ${x?"text-red-400":"text-blue-400"}`,children:g}),x&&f.jsx("p",{className:"text-xs text-red-400 mt-1",children:"A prompt with this name already exists"})]}),p&&f.jsx("div",{className:"bg-red-900/30 rounded-md p-3 ring-1 ring-red-500/30",children:f.jsx("p",{className:"text-sm text-red-400",children:p})})]}),f.jsxs("footer",{className:"px-6 py-4 bg-gray-800/50 border-t border-gray-700 flex justify-end space-x-3 rounded-b-lg",children:[f.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 rounded-md text-sm font-medium bg-gray-600 text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-gray-500 transition-colors disabled:opacity-50",disabled:t,children:"Cancel"}),f.jsx("button",{type:"submit",className:"px-4 py-2 rounded-md text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-blue-500 transition-colors disabled:opacity-50 flex items-center gap-2",disabled:t||!s.trim()||x,children:t?f.jsxs(f.Fragment,{children:[f.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{children:"Creating..."})]}):f.jsx("span",{children:"Create & Edit"})})]})]})]})})},IV={python:"bg-blue-500/15 text-blue-300 border-blue-500/30",typescript:"bg-cyan-500/15 text-cyan-300 border-cyan-500/30",javascript:"bg-yellow-500/15 text-yellow-300 border-yellow-500/30",java:"bg-orange-500/15 text-orange-300 border-orange-500/30",go:"bg-teal-500/15 text-teal-300 border-teal-500/30",rust:"bg-red-500/15 text-red-300 border-red-500/30"},HV=({prompt:n,isSelected:e,onSelect:t,onEditPrompt:r})=>{const s=n.language&&IV[n.language]||"bg-surface-700/50 text-surface-300 border-surface-600",i=o=>{o.stopPropagation(),t()},a=o=>{o.stopPropagation(),r()};return f.jsx(f.Fragment,{children:f.jsx("div",{className:`
|
|
201
|
-
glass rounded-xl sm:rounded-2xl border transition-all duration-200 card-hover
|
|
202
|
-
${e?"border-accent-500/50 shadow-lg shadow-accent-500/10 ring-1 ring-accent-500/20":"border-surface-700/50 hover:border-surface-600"}
|
|
203
|
-
`,children:f.jsxs("div",{className:"p-3 sm:p-4 cursor-pointer",onClick:i,children:[f.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2 sm:mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[f.jsx("h3",{className:"text-base sm:text-lg font-semibold text-white truncate",children:n.sync_basename}),n.language&&f.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] sm:text-xs border font-medium ${s}`,children:n.language})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsxs("button",{onClick:a,className:"px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg text-xs sm:text-sm font-medium flex items-center gap-1 sm:gap-1.5 transition-all duration-200 bg-surface-700/50 text-surface-300 hover:bg-accent-600 hover:text-white border border-surface-600/50 hover:border-accent-500/50",title:"Open in Prompt Space",children:[f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),f.jsx("span",{className:"hidden sm:inline",children:"Open"})]}),e&&f.jsx("span",{className:"px-2 py-1 rounded-full bg-accent-500/20 text-accent-300 text-[10px] sm:text-xs font-medium border border-accent-500/30",children:"Selected"})]})]}),f.jsx("p",{className:"text-[10px] sm:text-xs text-surface-400 font-mono mb-2 sm:mb-3 truncate",children:n.prompt}),f.jsxs("div",{className:"flex gap-1.5 sm:gap-2 flex-wrap",children:[f.jsx(Rh,{label:"Prompt",path:n.prompt,exists:!0,color:"purple"}),f.jsx(Rh,{label:"Code",path:n.code,exists:!!n.code,color:"green"}),f.jsx(Rh,{label:"Test",path:n.test,exists:!!n.test,color:"yellow"}),f.jsx(Rh,{label:"Example",path:n.example,exists:!!n.example,color:"blue"})]})]})})})},Rh=({label:n,path:e,exists:t,color:r})=>{const s={purple:t?"bg-purple-500/15 text-purple-300 border-purple-500/30":"bg-surface-800/50 text-surface-500 border-surface-700/50",green:t?"bg-green-500/15 text-green-300 border-green-500/30":"bg-surface-800/50 text-surface-500 border-surface-700/50",yellow:t?"bg-yellow-500/15 text-yellow-300 border-yellow-500/30":"bg-surface-800/50 text-surface-500 border-surface-700/50",blue:t?"bg-blue-500/15 text-blue-300 border-blue-500/30":"bg-surface-800/50 text-surface-500 border-surface-700/50"};return f.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 sm:px-2 py-0.5 rounded-md text-[10px] sm:text-xs border font-medium ${s[r]}`,title:e||`No ${n.toLowerCase()} file`,children:[f.jsx("span",{className:t?"text-green-400":"text-surface-500",children:t?"✓":"✗"}),f.jsx("span",{children:n})]})},FV=({onSelectPrompt:n,onEditPrompt:e,onCreatePrompt:t,selectedPrompt:r})=>{const[s,i]=P.useState([]),[a,o]=P.useState(!0),[u,d]=P.useState(null),[p,m]=P.useState(""),[g,x]=P.useState(!1),[v,y]=P.useState(!1),S=P.useMemo(()=>{if(!p.trim())return s;const $=p.toLowerCase();return s.filter(j=>j.sync_basename.toLowerCase().includes($)||j.prompt.toLowerCase().includes($)||j.language&&j.language.toLowerCase().includes($))},[s,p]);P.useEffect(()=>{Q()},[]);const Q=async()=>{o(!0),d(null);try{const $=await Ce.listPrompts();i($)}catch($){d($.message||"Failed to load prompts")}finally{o(!1)}},k=async $=>{y(!0);try{await Ce.writeFile($.path,$.content),await Q(),x(!1),t&&t($.info)}catch(j){throw new Error(j.message||"Failed to create prompt")}finally{y(!1)}};return a?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 sm:py-20",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center mb-4",children:f.jsxs("svg",{className:"animate-spin h-5 w-5 text-accent-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}),f.jsx("div",{className:"text-surface-400 text-sm",children:"Loading prompts..."})]}):u?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 sm:py-20",children:[f.jsx("div",{className:"w-12 h-12 rounded-xl bg-red-500/20 flex items-center justify-center mb-4",children:f.jsx("svg",{className:"w-6 h-6 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),f.jsx("div",{className:"text-red-400 mb-2 text-center",children:u}),f.jsx("button",{onClick:Q,className:"px-4 py-2 bg-surface-700/50 hover:bg-surface-600 rounded-xl text-sm text-white transition-colors border border-surface-600",children:"Try Again"})]}):s.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 sm:py-20",children:[f.jsx("div",{className:"w-14 h-14 rounded-2xl bg-surface-700/50 flex items-center justify-center mb-5",children:f.jsx("svg",{className:"w-7 h-7 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),f.jsx("div",{className:"text-surface-200 mb-2 font-semibold text-lg",children:"No prompts found"}),f.jsxs("p",{className:"text-surface-500 text-sm text-center mb-6 max-w-sm",children:["Get started by creating your first prompt, or add ",f.jsx("code",{className:"bg-surface-800/80 px-1.5 py-0.5 rounded text-accent-300",children:".prompt"})," files to the ",f.jsx("code",{className:"bg-surface-800/80 px-1.5 py-0.5 rounded text-accent-300",children:"prompts/"})," directory."]}),f.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-2 px-5 py-2.5 bg-gradient-to-r from-accent-600 to-accent-500 hover:from-accent-500 hover:to-accent-400 text-white rounded-xl font-medium shadow-lg shadow-accent-500/25 transition-all",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Create Your First Prompt"]}),g&&f.jsx(Zj,{onClose:()=>x(!1),onCreate:k,isCreating:v,existingPrompts:s})]}):f.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("h2",{className:"text-base sm:text-lg font-semibold text-white flex items-center gap-2",children:[f.jsx("span",{className:"hidden sm:inline",children:"Your Prompts"}),f.jsx("span",{className:"sm:hidden",children:"Prompts"}),f.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-accent-500/20 text-accent-300 text-xs font-medium",children:[S.length,p?`/${s.length}`:""]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1.5 px-2.5 sm:px-3 py-1.5 text-xs sm:text-sm bg-accent-600 hover:bg-accent-500 text-white rounded-lg transition-colors",title:"Create new prompt",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),f.jsx("span",{className:"hidden sm:inline",children:"New"})]}),f.jsxs("button",{onClick:Q,className:"flex items-center gap-1.5 px-2.5 sm:px-3 py-1.5 text-xs sm:text-sm text-surface-400 hover:text-white bg-surface-800/50 hover:bg-surface-700 rounded-lg transition-colors border border-surface-700/50",title:"Refresh",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),f.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]})]})]}),f.jsxs("div",{className:"relative",children:[f.jsx("input",{type:"text",placeholder:"Search prompts...",value:p,onChange:$=>m($.target.value),className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 pl-9 sm:pl-11 bg-surface-800/50 border border-surface-600/50 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 text-sm sm:text-base transition-all"}),f.jsx("span",{className:"absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 text-surface-400",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),p&&f.jsx("button",{onClick:()=>m(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-surface-400 hover:text-white p-1 rounded-lg hover:bg-surface-700/50 transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),S.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 sm:py-16",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-700/50 flex items-center justify-center mb-3",children:f.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),f.jsxs("div",{className:"text-surface-400 text-sm text-center",children:['No prompts matching "',f.jsx("span",{className:"text-white",children:p}),'"']})]}):f.jsx("div",{className:"grid gap-3 sm:gap-4",children:S.map($=>f.jsx(HV,{prompt:$,isSelected:(r==null?void 0:r.prompt)===$.prompt,onSelect:()=>n($),onEditPrompt:()=>e($)},$.prompt))}),g&&f.jsx(Zj,{onClose:()=>x(!1),onCreate:k,isCreating:v,existingPrompts:s})]})};let SS=[],Gq=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,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)return!1;for(let e=0,t=SS.length;;){let r=e+t>>1;if(n<SS[r])t=r;else if(n>=Gq[r])e=r+1;else return!0;if(e==t)return!1}}function Vj(n){return n>=127462&&n<=127487}const Yj=8205;function JV(n,e,t=!0,r=!0){return(t?Iq:eY)(n,e,r)}function Iq(n,e,t){if(e==n.length)return e;e&&Hq(n.charCodeAt(e))&&Fq(n.charCodeAt(e-1))&&e--;let r=Yg(n,e);for(e+=Dj(r);e<n.length;){let s=Yg(n,e);if(r==Yj||s==Yj||t&&KV(s))e+=Dj(s),r=s;else if(Vj(s)){let i=0,a=e-2;for(;a>=0&&Vj(Yg(n,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function eY(n,e,t){for(;e>0;){let r=Iq(n,e-2,t);if(r<e)return r;e--}return 0}function Yg(n,e){let t=n.charCodeAt(e);if(!Fq(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return Hq(r)?(t-55296<<10)+(r-56320)+65536:t}function Hq(n){return n>=56320&&n<57344}function Fq(n){return n>=55296&&n<56320}function Dj(n){return n<65536?1:2}class dt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=hc(this,e,t);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(t,this.length,s,1),Is.from(s,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=hc(this,e,t);let r=[];return this.decompose(e,t,r,0),Is.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new cf(this),i=new cf(e);for(let a=t,o=t;;){if(s.next(a),i.next(a),a=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(o+=s.value.length,s.done||o>=r)return!0}}iter(e=1){return new cf(this,e)}iterRange(e,t=this.length){return new Kq(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Jq(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?dt.empty:e.length<=32?new dn(e):Is.from(dn.split(e,[]))}}class dn extends dt{constructor(e,t=tY(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,s){for(let i=0;;i++){let a=this.text[i],o=s+a.length;if((t?r:o)>=e)return new nY(s,o,r,a);s=o+1,r++}}decompose(e,t,r,s){let i=e<=0&&t>=this.length?this:new dn(Bj(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),o=gp(i.text,a.text.slice(),0,i.length);if(o.length<=32)r.push(new dn(o,a.length+i.length));else{let u=o.length>>1;r.push(new dn(o.slice(0,u)),new dn(o.slice(u)))}}else r.push(i)}replace(e,t,r){if(!(r instanceof dn))return super.replace(e,t,r);[e,t]=hc(this,e,t);let s=gp(this.text,gp(r.text,Bj(this.text,0,e)),t),i=this.length+r.length-(t-e);return s.length<=32?new dn(s,i):Is.from(dn.split(s,[]),i)}sliceString(e,t=this.length,r=`
|
|
204
|
-
`){[e,t]=hc(this,e,t);let s="";for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],u=i+o.length;i>e&&a&&(s+=r),e<u&&t>i&&(s+=o.slice(Math.max(0,e-i),t-i)),i=u+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(t.push(new dn(r,s)),r=[],s=-1);return s>-1&&t.push(new dn(r,s)),t}}class Is extends dt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,s){for(let i=0;;i++){let a=this.children[i],o=s+a.length,u=r+a.lines-1;if((t?u:o)>=e)return a.lineInner(e,t,r,s);s=o+1,r=u+1}}decompose(e,t,r,s){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],u=a+o.length;if(e<=u&&t>=a){let d=s&((a<=e?1:0)|(u>=t?2:0));a>=e&&u<=t&&!d?r.push(o):o.decompose(e-a,t-a,r,d)}a=u+1}}replace(e,t,r){if([e,t]=hc(this,e,t),r.lines<this.lines)for(let s=0,i=0;s<this.children.length;s++){let a=this.children[s],o=i+a.length;if(e>=i&&t<=o){let u=a.replace(e-i,t-i,r),d=this.lines-a.lines+u.lines;if(u.lines<d>>4&&u.lines>d>>6){let p=this.children.slice();return p[s]=u,new Is(p,this.length-(t-e)+r.length)}return super.replace(i,o,u)}i=o+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
205
|
-
`){[e,t]=hc(this,e,t);let s="";for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],u=a+o.length;a>e&&i&&(s+=r),e<u&&t>a&&(s+=o.sliceString(e-a,t-a,r)),a=u+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Is))return 0;let r=0,[s,i,a,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,i+=t){if(s==a||i==o)return r;let u=this.children[s],d=e.children[i];if(u!=d)return r+u.scanIdentical(d,t);r+=u.length+1}}static from(e,t=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let v of e)v.flatten(x);return new dn(x,t)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,o=[],u=0,d=-1,p=[];function m(x){let v;if(x.lines>i&&x instanceof Is)for(let y of x.children)m(y);else x.lines>a&&(u>a||!u)?(g(),o.push(x)):x instanceof dn&&u&&(v=p[p.length-1])instanceof dn&&x.lines+v.lines<=32?(u+=x.lines,d+=x.length+1,p[p.length-1]=new dn(v.text.concat(x.text),v.length+1+x.length)):(u+x.lines>s&&g(),u+=x.lines,d+=x.length+1,p.push(x))}function g(){u!=0&&(o.push(p.length==1?p[0]:Is.from(p,d)),d=-1,u=p.length=0)}for(let x of e)m(x);return g(),o.length==1?o[0]:new Is(o,t)}}dt.empty=new dn([""],0);function tY(n){let e=-1;for(let t of n)e+=t.length+1;return e}function gp(n,e,t=0,r=1e9){for(let s=0,i=0,a=!0;i<n.length&&s<=r;i++){let o=n[i],u=s+o.length;u>=t&&(u>r&&(o=o.slice(0,r-s)),s<t&&(o=o.slice(t-s)),a?(e[e.length-1]+=o,a=!1):e.push(o)),s=u+1}return e}function Bj(n,e,t){return gp(n,[""],e,t)}class cf{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof dn?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],a=i>>1,o=s instanceof dn?s.text.length:s.children.length;if(a==(t>0?o:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
206
|
-
`,this;e--}else if(s instanceof dn){let u=s.text[a+(t<0?-1:0)];if(this.offsets[r]+=t,u.length>Math.max(0,e))return this.value=e==0?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=s.children[a+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof dn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Kq{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new cf(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=r?s:t<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jq{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(dt.prototype[Symbol.iterator]=function(){return this.iter()},cf.prototype[Symbol.iterator]=Kq.prototype[Symbol.iterator]=Jq.prototype[Symbol.iterator]=function(){return this});let nY=class{constructor(e,t,r,s){this.from=e,this.to=t,this.number=r,this.text=s}get length(){return this.to-this.from}};function hc(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Zn(n,e,t=!0,r=!0){return JV(n,e,t,r)}function rY(n){return n>=56320&&n<57344}function sY(n){return n>=55296&&n<56320}function pl(n,e){let t=n.charCodeAt(e);if(!sY(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return rY(r)?(t-55296<<10)+(r-56320)+65536:t}function iY(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Yo(n){return n<65536?1:2}const QS=/\r\n?|\n/;var Kn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Kn||(Kn={}));class ti{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,s=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(r,s,i),s+=i):s+=a,r+=i}}iterChangedRanges(e,t=!1){kS(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];s<0?e.push(r,s):e.push(s,r)}return new ti(e)}composeDesc(e){return this.empty?e:e.empty?this:eM(this,e)}mapDesc(e,t=!1){return e.empty?this:$S(this,e,t)}mapPos(e,t=-1,r=Kn.Simple){let s=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],u=this.sections[a++],d=s+o;if(u<0){if(d>e)return i+(e-s);i+=o}else{if(r!=Kn.Simple&&d>=e&&(r==Kn.TrackDel&&s<e&&d>e||r==Kn.TrackBefore&&s<e||r==Kn.TrackAfter&&d>e))return null;if(d>e||d==e&&t<0&&!o)return e==s||t<0?i:i+u;i+=u}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,t=e){for(let r=0,s=0;r<this.sections.length&&s<=t;){let i=this.sections[r++],a=this.sections[r++],o=s+i;if(a>=0&&s<=t&&o>=e)return s<e&&o>t?"cover":!0;s=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ti(e)}static create(e){return new ti(e)}}class _n extends ti{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kS(this,(t,r,s,i,a)=>e=e.replace(s,s+(r-t),a),!1),e}mapDesc(e,t=!1){return $S(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let s=0,i=0;s<t.length;s+=2){let a=t[s],o=t[s+1];if(o>=0){t[s]=o,t[s+1]=a;let u=s>>1;for(;r.length<u;)r.push(dt.empty);r.push(a?e.slice(i,i+a):dt.empty)}i+=a}return new _n(t,r)}compose(e){return this.empty?e:e.empty?this:eM(this,e,!0)}map(e,t=!1){return e.empty?this:$S(this,e,t,!0)}iterChanges(e,t=!1){kS(this,e,t)}get desc(){return ti.create(this.sections)}filter(e){let t=[],r=[],s=[],i=new vf(this);e:for(let a=0,o=0;;){let u=a==e.length?1e9:e[a++];for(;o<u||o==u&&i.len==0;){if(i.done)break e;let p=Math.min(i.len,u-o);Un(s,p,-1);let m=i.ins==-1?-1:i.off==0?i.ins:0;Un(t,p,m),m>0&&Ca(r,t,i.text),i.forward(p),o+=p}let d=e[a++];for(;o<d;){if(i.done)break e;let p=Math.min(i.len,d-o);Un(t,p,-1),Un(s,p,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(p),o+=p}}return{changes:new _n(t,r),filtered:ti.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],s=this.sections[t+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let s=[],i=[],a=0,o=null;function u(p=!1){if(!p&&!s.length)return;a<t&&Un(s,t-a,-1);let m=new _n(s,i);o=o?o.compose(m.map(o)):m,s=[],i=[],a=0}function d(p){if(Array.isArray(p))for(let m of p)d(m);else if(p instanceof _n){if(p.length!=t)throw new RangeError(`Mismatched change set length (got ${p.length}, expected ${t})`);u(),o=o?o.compose(p.map(o)):p}else{let{from:m,to:g=m,insert:x}=p;if(m>g||m<0||g>t)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${t})`);let v=x?typeof x=="string"?dt.of(x.split(r||QS)):x:dt.empty,y=v.length;if(m==g&&y==0)return;m<a&&u(),m>a&&Un(s,m-a,-1),Un(s,g-m,y),Ca(i,s,v),a=g}}return d(e),u(!o),o}static empty(e){return new _n(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let s=0;s<e.length;s++){let i=e[s];if(typeof i=="number")t.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((a,o)=>o&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)t.push(i[0],0);else{for(;r.length<s;)r.push(dt.empty);r[s]=dt.of(i.slice(1)),t.push(i[0],r[s].length)}}}return new _n(t,r)}static createSet(e,t){return new _n(e,t)}}function Un(n,e,t,r=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:r?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Ca(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(dt.empty);n.push(t)}}function kS(n,e,t){let r=n.inserted;for(let s=0,i=0,a=0;a<n.sections.length;){let o=n.sections[a++],u=n.sections[a++];if(u<0)s+=o,i+=o;else{let d=s,p=i,m=dt.empty;for(;d+=o,p+=u,u&&r&&(m=m.append(r[a-2>>1])),!(t||a==n.sections.length||n.sections[a+1]<0);)o=n.sections[a++],u=n.sections[a++];e(s,d,i,p,m),s=d,i=p}}}function $S(n,e,t,r=!1){let s=[],i=r?[]:null,a=new vf(n),o=new vf(e);for(let u=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let d=Math.min(a.len,o.len);Un(s,d,-1),a.forward(d),o.forward(d)}else if(o.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(o.len<a.len||o.len==a.len&&!t))){let d=o.len;for(Un(s,o.ins,-1);d;){let p=Math.min(a.len,d);a.ins>=0&&u<a.i&&a.len<=p&&(Un(s,0,a.ins),i&&Ca(i,s,a.text),u=a.i),a.forward(p),d-=p}o.next()}else if(a.ins>=0){let d=0,p=a.len;for(;p;)if(o.ins==-1){let m=Math.min(p,o.len);d+=m,p-=m,o.forward(m)}else if(o.ins==0&&o.len<p)p-=o.len,o.next();else break;Un(s,d,u<a.i?a.ins:0),i&&u<a.i&&Ca(i,s,a.text),u=a.i,a.forward(a.len-p)}else{if(a.done&&o.done)return i?_n.createSet(s,i):ti.create(s);throw new Error("Mismatched change set lengths")}}}function eM(n,e,t=!1){let r=[],s=t?[]:null,i=new vf(n),a=new vf(e);for(let o=!1;;){if(i.done&&a.done)return s?_n.createSet(r,s):ti.create(r);if(i.ins==0)Un(r,i.len,0,o),i.next();else if(a.len==0&&!a.done)Un(r,0,a.ins,o),s&&Ca(s,r,a.text),a.next();else{if(i.done||a.done)throw new Error("Mismatched change set lengths");{let u=Math.min(i.len2,a.len),d=r.length;if(i.ins==-1){let p=a.ins==-1?-1:a.off?0:a.ins;Un(r,u,p,o),s&&p&&Ca(s,r,a.text)}else a.ins==-1?(Un(r,i.off?0:i.len,u,o),s&&Ca(s,r,i.textBit(u))):(Un(r,i.off?0:i.len,a.off?0:a.ins,o),s&&!a.off&&Ca(s,r,a.text));o=(i.ins>u||a.ins>=0&&a.len>u)&&(o||r.length>d),i.forward2(u),a.forward(u)}}}}class vf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?dt.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?dt.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class wl{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new wl(r,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ve.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ve.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ve.range(e.anchor,e.head)}static create(e,t,r){return new wl(e,t,r)}}class ve{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ve.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ve([this.main],0)}addRange(e,t=!0){return ve.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,ve.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ve(e.ranges.map(t=>wl.fromJSON(t)),e.main)}static single(e,t=e){return new ve([ve.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;s<e.length;s++){let i=e[s];if(i.empty?i.from<=r:i.from<r)return ve.normalized(e.slice(),t);r=i.to}return new ve(e,t)}static cursor(e,t=0,r,s){return wl.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(s??16777215)<<6)}static range(e,t,r,s){let i=(r??16777215)<<6|(s==null?7:Math.min(6,s));return t<e?wl.create(t,e,48|i):wl.create(e,t,(t>e?8:0)|i)}static normalized(e,t=0){let r=e[t];e.sort((s,i)=>s.from-i.from),t=e.indexOf(r);for(let s=1;s<e.length;s++){let i=e[s],a=e[s-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,u=Math.max(i.to,a.to);s<=t&&t--,e.splice(--s,2,i.anchor>i.head?ve.range(u,o):ve.range(o,u))}}return new ve(e,t)}}function tM(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let rQ=0;class qe{constructor(e,t,r,s,i){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=s,this.id=rQ++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new qe(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:sQ),!!e.static,e.enables)}of(e){return new xp([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new xp(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new xp(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function sQ(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class xp{constructor(e,t,r,s){this.dependencies=e,this.facet=t,this.type=r,this.value=s,this.id=rQ++}dynamicSlot(e){var t;let r=this.value,s=this.facet.compareInput,i=this.id,a=e[i]>>1,o=this.type==2,u=!1,d=!1,p=[];for(let m of this.dependencies)m=="doc"?u=!0:m=="selection"?d=!0:(((t=e[m.id])!==null&&t!==void 0?t:1)&1)==0&&p.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(u&&g.docChanged||d&&(g.docChanged||g.selection)||TS(m,p)){let x=r(m);if(o?!Uj(x,m.values[a],s):!s(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,g)=>{let x,v=g.config.address[i];if(v!=null){let y=Lp(g,v);if(this.dependencies.every(S=>S instanceof qe?g.facet(S)===m.facet(S):S instanceof ii?g.field(S,!1)==m.field(S,!1):!0)||(o?Uj(x=r(m),y,s):s(x=r(m),y)))return m.values[a]=y,0}else x=r(m);return m.values[a]=x,1}}}}function Uj(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function TS(n,e){let t=!1;for(let r of e)uf(n,r)&1&&(t=!0);return t}function aY(n,e,t){let r=t.map(u=>n[u.id]),s=t.map(u=>u.type),i=r.filter(u=>!(u&1)),a=n[e.id]>>1;function o(u){let d=[];for(let p=0;p<r.length;p++){let m=Lp(u,r[p]);if(s[p]==2)for(let g of m)d.push(g);else d.push(m)}return e.combine(d)}return{create(u){for(let d of r)uf(u,d);return u.values[a]=o(u),1},update(u,d){if(!TS(u,i))return 0;let p=o(u);return e.compare(p,u.values[a])?0:(u.values[a]=p,1)},reconfigure(u,d){let p=TS(u,r),m=d.config.facets[e.id],g=d.facet(e);if(m&&!p&&sQ(t,m))return u.values[a]=g,0;let x=o(u);return e.compare(x,g)?(u.values[a]=g,0):(u.values[a]=x,1)}}}const Eh=qe.define({static:!0});class ii{constructor(e,t,r,s,i){this.id=e,this.createF=t,this.updateF=r,this.compareF=s,this.spec=i,this.provides=void 0}static define(e){let t=new ii(rQ++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Eh).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,s)=>{let i=r.values[t],a=this.updateF(i,s);return this.compareF(i,a)?0:(r.values[t]=a,1)},reconfigure:(r,s)=>{let i=r.facet(Eh),a=s.facet(Eh),o;return(o=i.find(u=>u.field==this))&&o!=a.find(u=>u.field==this)?(r.values[t]=o.create(r),1):s.config.address[this.id]!=null?(r.values[t]=s.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Eh.of({field:this,create:e})]}get extension(){return this}}const gl={lowest:4,low:3,default:2,high:1,highest:0};function Eu(n){return e=>new nM(e,n)}const Yl={highest:Eu(gl.highest),high:Eu(gl.high),default:Eu(gl.default),low:Eu(gl.low),lowest:Eu(gl.lowest)};class nM{constructor(e,t){this.inner=e,this.prec=t}}class Hf{of(e){return new jS(this,e)}reconfigure(e){return Hf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class jS{constructor(e,t){this.compartment=e,this.inner=t}}class zp{constructor(e,t,r,s,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let s=[],i=Object.create(null),a=new Map;for(let g of lY(e,t,a))g instanceof ii?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let o=Object.create(null),u=[],d=[];for(let g of s)o[g.id]=d.length<<1,d.push(x=>g.slot(x));let p=r==null?void 0:r.config.facets;for(let g in i){let x=i[g],v=x[0].facet,y=p&&p[g]||[];if(x.every(S=>S.type==0))if(o[v.id]=u.length<<1|1,sQ(y,x))u.push(r.facet(v));else{let S=v.combine(x.map(Q=>Q.value));u.push(r&&v.compare(S,r.facet(v))?r.facet(v):S)}else{for(let S of x)S.type==0?(o[S.id]=u.length<<1|1,u.push(S.value)):(o[S.id]=d.length<<1,d.push(Q=>S.dynamicSlot(Q)));o[v.id]=d.length<<1,d.push(S=>aY(S,v,x))}}let m=d.map(g=>g(o));return new zp(e,a,m,o,u,i)}}function lY(n,e,t){let r=[[],[],[],[],[]],s=new Map;function i(a,o){let u=s.get(a);if(u!=null){if(u<=o)return;let d=r[u].indexOf(a);d>-1&&r[u].splice(d,1),a instanceof jS&&t.delete(a.compartment)}if(s.set(a,o),Array.isArray(a))for(let d of a)i(d,o);else if(a instanceof jS){if(t.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;t.set(a.compartment,d),i(d,o)}else if(a instanceof nM)i(a.inner,a.prec);else if(a instanceof ii)r[o].push(a),a.provides&&i(a.provides,o);else if(a instanceof xp)r[o].push(a),a.facet.extensions&&i(a.facet.extensions,gl.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(d,o)}}return i(n,gl.default),r.reduce((a,o)=>a.concat(o))}function uf(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Lp(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const rM=qe.define(),_S=qe.define({combine:n=>n.some(e=>e),static:!0}),sM=qe.define({combine:n=>n.length?n[0]:void 0,static:!0}),iM=qe.define(),aM=qe.define(),lM=qe.define(),oM=qe.define({combine:n=>n.length?n[0]:!1});class Hi{constructor(e,t){this.type=e,this.value=t}static define(){return new oY}}class oY{of(e){return new Hi(this,e)}}class cY{constructor(e){this.map=e}of(e){return new Ct(this,e)}}class Ct{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ct(this.type,t)}is(e){return this.type==e}static define(e={}){return new cY(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(t);i&&r.push(i)}return r}}Ct.reconfigure=Ct.define();Ct.appendConfig=Ct.define();class vn{constructor(e,t,r,s,i,a){this.startState=e,this.changes=t,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=a,this._doc=null,this._state=null,r&&tM(r,t.newLength),i.some(o=>o.type==vn.time)||(this.annotations=i.concat(vn.time.of(Date.now())))}static create(e,t,r,s,i,a){return new vn(e,t,r,s,i,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(vn.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}vn.time=Hi.define();vn.userEvent=Hi.define();vn.addToHistory=Hi.define();vn.remote=Hi.define();function uY(n,e){let t=[];for(let r=0,s=0;;){let i,a;if(r<n.length&&(s==e.length||e[s]>=n[r]))i=n[r++],a=n[r++];else if(s<e.length)i=e[s++],a=e[s++];else return t;!t.length||t[t.length-1]<i?t.push(i,a):t[t.length-1]<a&&(t[t.length-1]=a)}}function cM(n,e,t){var r;let s,i,a;return t?(s=e.changes,i=_n.empty(e.changes.length),a=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),i=n.changes.mapDesc(e.changes,!0),a=n.changes.compose(s)),{changes:a,selection:e.selection?e.selection.map(i):(r=n.selection)===null||r===void 0?void 0:r.map(s),effects:Ct.mapEffects(n.effects,s).concat(Ct.mapEffects(e.effects,i)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function PS(n,e,t){let r=e.selection,s=tc(e.annotations);return e.userEvent&&(s=s.concat(vn.userEvent.of(e.userEvent))),{changes:e.changes instanceof _n?e.changes:_n.of(e.changes||[],t,n.facet(sM)),selection:r&&(r instanceof ve?r:ve.single(r.anchor,r.head)),effects:tc(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function uM(n,e,t){let r=PS(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(t=!1);let a=!!e[i].sequential;r=cM(r,PS(n,e[i],a?r.changes.newLength:n.doc.length),a)}let s=vn.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return dY(t?fY(s):s)}function fY(n){let e=n.startState,t=!0;for(let s of e.facet(iM)){let i=s(n);if(i===!1){t=!1;break}Array.isArray(i)&&(t=t===!0?i:uY(t,i))}if(t!==!0){let s,i;if(t===!1)i=n.changes.invertedDesc,s=_n.empty(e.doc.length);else{let a=n.changes.filter(t);s=a.changes,i=a.filtered.mapDesc(a.changes).invertedDesc}n=vn.create(e,s,n.selection&&n.selection.map(i),Ct.mapEffects(n.effects,i),n.annotations,n.scrollIntoView)}let r=e.facet(aM);for(let s=r.length-1;s>=0;s--){let i=r[s](n);i instanceof vn?n=i:Array.isArray(i)&&i.length==1&&i[0]instanceof vn?n=i[0]:n=uM(e,tc(i),!1)}return n}function dY(n){let e=n.startState,t=e.facet(lM),r=n;for(let s=t.length-1;s>=0;s--){let i=t[s](n);i&&Object.keys(i).length&&(r=cM(r,PS(e,i,n.changes.newLength),!0))}return r==n?n:vn.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const hY=[];function tc(n){return n==null?hY:Array.isArray(n)?n:[n]}var zi=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(zi||(zi={}));const pY=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let NS;try{NS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function mY(n){if(NS)return NS.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||pY.test(t)))return!0}return!1}function OY(n){return e=>{if(!/\S/.test(e))return zi.Space;if(mY(e))return zi.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return zi.Word;return zi.Other}}class xt{constructor(e,t,r,s,i,a){this.config=e,this.doc=t,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)uf(this,o<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return uf(this,r),Lp(this,r)}update(...e){return uM(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:s}=t;for(let o of e.effects)o.is(Hf.reconfigure)?(t&&(s=new Map,t.compartments.forEach((u,d)=>s.set(d,u)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(Ct.reconfigure)?(t=null,r=o.value):o.is(Ct.appendConfig)&&(t=null,r=tc(r).concat(o.value));let i;t?i=e.startState.values.slice():(t=zp.resolve(r,s,this),i=new xt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(u,d)=>d.reconfigure(u,this),null).values);let a=e.startState.facet(_S)?e.newSelection:e.newSelection.asSingle();new xt(t,e.newDoc,a,i,(o,u)=>u.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ve.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),s=this.changes(r.changes),i=[r.range],a=tc(r.effects);for(let o=1;o<t.ranges.length;o++){let u=e(t.ranges[o]),d=this.changes(u.changes),p=d.map(s);for(let g=0;g<o;g++)i[g]=i[g].map(p);let m=s.mapDesc(d,!0);i.push(u.range.map(m)),s=s.compose(p),a=Ct.mapEffects(a,p).concat(Ct.mapEffects(tc(u.effects),m))}return{changes:s,selection:ve.create(i,t.mainIndex),effects:a}}changes(e=[]){return e instanceof _n?e:_n.of(e,this.doc.length,this.facet(xt.lineSeparator))}toText(e){return dt.of(e.split(this.facet(xt.lineSeparator)||QS))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(uf(this,t),Lp(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof ii&&this.config.address[s.id]!=null&&(t[r]=s.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let a=r[i],o=e[i];s.push(a.init(u=>a.spec.fromJSON(o,u)))}}return xt.create({doc:e.doc,selection:ve.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=zp.resolve(e.extensions||[],new Map),r=e.doc instanceof dt?e.doc:dt.of((e.doc||"").split(t.staticFacet(xt.lineSeparator)||QS)),s=e.selection?e.selection instanceof ve?e.selection:ve.single(e.selection.anchor,e.selection.head):ve.single(0);return tM(s,r.length),t.staticFacet(_S)||(s=s.asSingle()),new xt(t,r,s,t.dynamicSlots.map(()=>null),(i,a)=>a.create(i),null)}get tabSize(){return this.facet(xt.tabSize)}get lineBreak(){return this.facet(xt.lineSeparator)||`
|
|
207
|
-
`}get readOnly(){return this.facet(oM)}phrase(e,...t){for(let r of this.facet(xt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>t.length?r:t[i-1]})),e}languageDataAt(e,t,r=-1){let s=[];for(let i of this.facet(rM))for(let a of i(this,t,r))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return OY(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-r,o=e-r;for(;a>0;){let u=Zn(t,a,!1);if(i(t.slice(u,a))!=zi.Word)break;a=u}for(;o<s;){let u=Zn(t,o);if(i(t.slice(o,u))!=zi.Word)break;o=u}return a==o?null:ve.range(a+r,o+r)}}xt.allowMultipleSelections=_S;xt.tabSize=qe.define({combine:n=>n.length?n[0]:4});xt.lineSeparator=sM;xt.readOnly=oM;xt.phrases=qe.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(s=>n[s]==e[s])}});xt.languageData=rM;xt.changeFilter=iM;xt.transactionFilter=aM;xt.transactionExtender=lM;Hf.reconfigure=Ct.define();function iQ(n,e,t={}){let r={};for(let s of n)for(let i of Object.keys(s)){let a=s[i],o=r[i];if(o===void 0)r[i]=a;else if(!(o===a||a===void 0))if(Object.hasOwnProperty.call(t,i))r[i]=t[i](o,a);else throw new Error("Config merge conflict for field "+i)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class Xa{eq(e){return this==e}range(e,t=e){return CS.create(e,t,this)}}Xa.prototype.startSide=Xa.prototype.endSide=0;Xa.prototype.point=!1;Xa.prototype.mapMode=Kn.TrackDel;function aQ(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let CS=class fM{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new fM(e,t,r)}};function RS(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class lQ{constructor(e,t,r,s){this.from=e,this.to=t,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,s=0){let i=r?this.to:this.from;for(let a=s,o=i.length;;){if(a==o)return a;let u=a+o>>1,d=i[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==a)return d>=0?a:o;d>=0?o=u:a=u+1}}between(e,t,r,s){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(r,1e9,!1,i);i<a;i++)if(s(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,t){let r=[],s=[],i=[],a=-1,o=-1;for(let u=0;u<this.value.length;u++){let d=this.value[u],p=this.from[u]+e,m=this.to[u]+e,g,x;if(p==m){let v=t.mapPos(p,d.startSide,d.mapMode);if(v==null||(g=x=v,d.startSide!=d.endSide&&(x=t.mapPos(p,d.endSide),x<g)))continue}else if(g=t.mapPos(p,d.startSide),x=t.mapPos(m,d.endSide),g>x||g==x&&d.startSide>0&&d.endSide<=0)continue;(x-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(o=Math.max(o,x-g)),r.push(d),s.push(g-a),i.push(x-a))}return{mapped:r.length?new lQ(s,i,r,o):null,pos:a}}}class ft{constructor(e,t,r,s){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=s}static create(e,t,r,s){return new ft(e,t,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,a=e.filter;if(t.length==0&&!a)return this;if(r&&(t=t.slice().sort(RS)),this.isEmpty)return t.length?ft.of(t):this;let o=new dM(this,null,-1).goto(0),u=0,d=[],p=new wf;for(;o.value||u<t.length;)if(u<t.length&&(o.from-t[u].from||o.startSide-t[u].value.startSide)>=0){let m=t[u++];p.addInner(m.from,m.to,m.value)||d.push(m)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(u==t.length||this.chunkEnd(o.chunkIndex)<t[u].from)&&(!a||s>this.chunkEnd(o.chunkIndex)||i<this.chunkPos[o.chunkIndex])&&p.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!a||s>o.to||i<o.from||a(o.from,o.to,o.value))&&(p.addInner(o.from,o.to,o.value)||d.push(CS.create(o.from,o.to,o.value))),o.next());return p.finishInner(this.nextLayer.isEmpty&&!d.length?ft.empty:this.nextLayer.update({add:d,filter:a,filterFrom:s,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],s=-1;for(let a=0;a<this.chunk.length;a++){let o=this.chunkPos[a],u=this.chunk[a],d=e.touchesRange(o,o+u.length);if(d===!1)s=Math.max(s,u.maxPoint),t.push(u),r.push(e.mapPos(o));else if(d===!0){let{mapped:p,pos:m}=u.map(o,e);p&&(s=Math.max(s,p.maxPoint),t.push(p),r.push(m))}}let i=this.nextLayer.map(e);return t.length==0?i:new ft(r,t,i||ft.empty,s)}between(e,t,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let i=this.chunkPos[s],a=this.chunk[s];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Sf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Sf.from(e).goto(t)}static compare(e,t,r,s,i=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),o=t.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),u=Wj(a,o,r),d=new Au(a,u,i),p=new Au(o,u,i);r.iterGaps((m,g,x)=>Gj(d,m,p,g,x,s)),r.empty&&r.length==0&&Gj(d,0,p,0,0,s)}static eq(e,t,r=0,s){s==null&&(s=999999999);let i=e.filter(p=>!p.isEmpty&&t.indexOf(p)<0),a=t.filter(p=>!p.isEmpty&&e.indexOf(p)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=Wj(i,a),u=new Au(i,o,0).goto(r),d=new Au(a,o,0).goto(r);for(;;){if(u.to!=d.to||!ES(u.active,d.active)||u.point&&(!d.point||!aQ(u.point,d.point)))return!1;if(u.to>s)return!0;u.next(),d.next()}}static spans(e,t,r,s,i=-1){let a=new Au(e,null,i).goto(t),o=t,u=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let p=a.activeForPoint(a.to),m=a.pointFrom<t?p.length+1:a.point.startSide<0?p.length:Math.min(p.length,u);s.point(o,d,a.point,p,m,a.pointRank),u=Math.min(a.openEnd(d),p.length)}else d>o&&(s.span(o,d,a.active,u),u=a.openEnd(d));if(a.to>r)return u+(a.point&&a.to>r?1:0);o=a.to,a.next()}}static of(e,t=!1){let r=new wf;for(let s of e instanceof CS?[e]:t?gY(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return ft.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=ft.empty;s=s.nextLayer)t=new ft(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}ft.empty=new ft([],[],null,-1);function gY(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(RS(e,r)>0)return n.slice().sort(RS);e=r}return n}ft.empty.nextLayer=ft.empty;class wf{finishChunk(e){this.chunks.push(new lQ(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new wf)).add(e,t,r)}addInner(e,t,r){let s=e-this.lastTo||r.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(ft.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=ft.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Wj(n,e,t){let r=new Map;for(let i of n)for(let a=0;a<i.chunk.length;a++)i.chunk[a].maxPoint<=0&&r.set(i.chunk[a],i.chunkPos[a]);let s=new Set;for(let i of e)for(let a=0;a<i.chunk.length;a++){let o=r.get(i.chunk[a]);o!=null&&(t?t.mapPos(o):o)==i.chunkPos[a]&&!(t!=null&&t.touchesRange(o,o+i.chunk[a].length))&&s.add(i.chunk[a])}return s}class dM{constructor(e,t,r,s=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Sf{constructor(e){this.heap=e}static from(e,t=null,r=-1){let s=[];for(let i=0;i<e.length;i++)for(let a=e[i];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&s.push(new dM(a,t,r,i));return s.length==1?s[0]:new Sf(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)Dg(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)Dg(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Dg(this.heap,0)}}}function Dg(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let s=n[r];if(r+1<n.length&&s.compare(n[r+1])>=0&&(s=n[r+1],r++),t.compare(s)<0)break;n[r]=t,n[e]=s,e=r}}class Au{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Sf.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ah(this.active,e),Ah(this.activeTo,e),Ah(this.activeRank,e),this.minActive=Ij(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:s,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||s-this.activeTo[t])>0;)t++;qh(this.active,t,r),qh(this.activeTo,t,s),qh(this.activeRank,t,i),e&&qh(e,t,this.cursor.from),this.minActive=Ij(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&Ah(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let s=r.length-1;s>=0&&r[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function Gj(n,e,t,r,s,i){n.goto(e),t.goto(r);let a=r+s,o=r,u=r-e,d=!!i.boundChange;for(let p=!1;;){let m=n.to+u-t.to,g=m||n.endSide-t.endSide,x=g<0?n.to+u:t.to,v=Math.min(x,a);if(n.point||t.point?(n.point&&t.point&&aQ(n.point,t.point)&&ES(n.activeForPoint(n.to),t.activeForPoint(t.to))||i.comparePoint(o,v,n.point,t.point),p=!1):(p&&i.boundChange(o),v>o&&!ES(n.active,t.active)&&i.compareRange(o,v,n.active,t.active),d&&v<a&&(m||n.openEnd(x)!=t.openEnd(x))&&(p=!0)),x>a)break;o=x,g<=0&&n.next(),g>=0&&t.next()}}function ES(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!aQ(n[t],e[t]))return!1;return!0}function Ah(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function qh(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function Ij(n,e){let t=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||n[s].endSide-n[t].endSide)<0&&(t=s,r=e[s]);return t}function Bi(n,e,t=n.length){let r=0;for(let s=0;s<t&&s<n.length;)n.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=Zn(n,s));return r}function xY(n,e,t,r){for(let s=0,i=0;;){if(i>=e)return s;if(s==n.length)break;i+=n.charCodeAt(s)==9?t-i%t:1,s=Zn(n,s)}return n.length}const AS="ͼ",Hj=typeof Symbol>"u"?"__"+AS:Symbol.for(AS),qS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Fj=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class za{constructor(e,t){this.rules=[];let{finish:r}=t||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,o,u,d){let p=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&o==null)return u.push(a[0]+";");for(let x in o){let v=o[x];if(/&/.test(x))i(x.split(/,\s*/).map(y=>a.map(S=>y.replace(/&/,S))).reduce((y,S)=>y.concat(S)),v,u);else if(v&&typeof v=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");i(s(x),v,p,g)}else v!=null&&p.push(x.replace(/_.*/,"").replace(/[A-Z]/g,y=>"-"+y.toLowerCase())+": "+v+";")}(p.length||g)&&u.push((r&&!m&&!d?a.map(r):a).join(", ")+" {"+p.join(" ")+"}")}for(let a in e)i(s(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
208
|
-
`)}static newName(){let e=Fj[Hj]||1;return Fj[Hj]=e+1,AS+e.toString(36)}static mount(e,t,r){let s=e[qS],i=r&&r.nonce;s?i&&s.setNonce(i):s=new bY(e,i),s.mount(Array.isArray(t)?t:[t],e)}}let Kj=new Map;class bY{constructor(e,t){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=Kj.get(r);if(i)return e[qS]=i;this.sheet=new s.CSSStyleSheet,Kj.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[qS]=this}mount(e,t){let r=this.sheet,s=0,i=0;for(let a=0;a<e.length;a++){let o=e[a],u=this.modules.indexOf(o);if(u<i&&u>-1&&(this.modules.splice(u,1),i--,u=-1),u==-1){if(this.modules.splice(i++,0,o),r)for(let d=0;d<o.rules.length;d++)r.insertRule(o.rules[d],s++)}else{for(;i<u;)s+=this.modules[i++].rules.length;s+=o.rules.length,i++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let a="";for(let u=0;u<this.modules.length;u++)a+=this.modules[u].getRules()+`
|
|
209
|
-
`;this.styleTag.textContent=a;let o=t.head||t;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var La={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yY=typeof navigator<"u"&&/Mac/.test(navigator.platform),vY=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ln=0;Ln<10;Ln++)La[48+Ln]=La[96+Ln]=String(Ln);for(var Ln=1;Ln<=24;Ln++)La[Ln+111]="F"+Ln;for(var Ln=65;Ln<=90;Ln++)La[Ln]=String.fromCharCode(Ln+32),Qf[Ln]=String.fromCharCode(Ln);for(var Bg in La)Qf.hasOwnProperty(Bg)||(Qf[Bg]=La[Bg]);function wY(n){var e=yY&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||vY&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Qf:La)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}let Fn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},MS=typeof document<"u"?document:{documentElement:{style:{}}};const XS=/Edge\/(\d+)/.exec(Fn.userAgent),hM=/MSIE \d/.test(Fn.userAgent),zS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fn.userAgent),zm=!!(hM||zS||XS),Jj=!zm&&/gecko\/(\d+)/i.test(Fn.userAgent),Ug=!zm&&/Chrome\/(\d+)/.exec(Fn.userAgent),SY="webkitFontSmoothing"in MS.documentElement.style,LS=!zm&&/Apple Computer/.test(Fn.vendor),e_=LS&&(/Mobile\/\w+/.test(Fn.userAgent)||Fn.maxTouchPoints>2);var Ne={mac:e_||/Mac/.test(Fn.platform),windows:/Win/.test(Fn.platform),linux:/Linux|X11/.test(Fn.platform),ie:zm,ie_version:hM?MS.documentMode||6:zS?+zS[1]:XS?+XS[1]:0,gecko:Jj,gecko_version:Jj?+(/Firefox\/(\d+)/.exec(Fn.userAgent)||[0,0])[1]:0,chrome:!!Ug,chrome_version:Ug?+Ug[1]:0,ios:e_,android:/Android\b/.test(Fn.userAgent),webkit_version:SY?+(/\bAppleWebKit\/(\d+)/.exec(Fn.userAgent)||[0,0])[1]:0,safari:LS,safari_version:LS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fn.userAgent)||[0,0])[1]:0,tabSize:MS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function oQ(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Zp=Object.create(null);function cQ(n,e,t){if(n==e)return!0;n||(n=Zp),e||(e=Zp);let r=Object.keys(n),s=Object.keys(e);if(r.length-0!=s.length-0)return!1;for(let i of r)if(i!=t&&(s.indexOf(i)==-1||n[i]!==e[i]))return!1;return!0}function QY(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function t_(n,e,t){let r=!1;if(e)for(let s in e)t&&s in t||(r=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(r=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return r}function kY(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class Ff{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Or=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(Or||(Or={}));class Ut extends Xa{constructor(e,t,r,s){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Kf(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Rl(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:a}=pM(e,t);r=(i?t?-3e8:-1:5e8)-1,s=(a?t?2e8:1:-6e8)+1}return new Rl(e,r,s,t,e.widget||null,!0)}static line(e){return new Jf(e)}static set(e,t=!1){return ft.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ut.none=ft.empty;class Kf extends Ut{constructor(e){let{start:t,end:r}=pM(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?oQ(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Zp}eq(e){return this==e||e instanceof Kf&&this.tagName==e.tagName&&cQ(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Kf.prototype.point=!1;class Jf extends Ut{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Jf&&this.spec.class==e.spec.class&&cQ(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Jf.prototype.mapMode=Kn.TrackBefore;Jf.prototype.point=!0;class Rl extends Ut{constructor(e,t,r,s,i,a){super(t,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?t<=0?Kn.TrackBefore:Kn.TrackAfter:Kn.TrackDel}get type(){return this.startSide!=this.endSide?Or.WidgetRange:this.startSide<=0?Or.WidgetBefore:Or.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Rl&&$Y(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Rl.prototype.point=!0;function pM(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function $Y(n,e){return n==e||!!(n&&e&&n.compare(e))}function nc(n,e,t,r=0){let s=t.length-1;s>=0&&t[s]+r>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class kf extends Xa{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof kf&&this.tagName==e.tagName&&cQ(this.attributes,e.attributes)}static create(e){return new kf(e.tagName,e.attributes||Zp)}static set(e,t=!1){return ft.of(e,t)}}kf.prototype.startSide=kf.prototype.endSide=-1;function $f(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function ZS(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function bp(n,e){if(!e.anchorNode)return!1;try{return ZS(n,e.anchorNode)}catch{return!1}}function yp(n){return n.nodeType==3?Tf(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function ff(n,e,t,r){return t?n_(n,e,t,r,-1)||n_(n,e,t,r,1):!1}function Za(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Vp(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function n_(n,e,t,r,s){for(;;){if(n==t&&e==r)return!0;if(e==(s<0?0:Ui(n))){if(n.nodeName=="DIV")return!1;let i=n.parentNode;if(!i||i.nodeType!=1)return!1;e=Za(n)+(s<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?Ui(n):0}else return!1}}function Ui(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Yp(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function TY(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function mM(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function jY(n,e,t,r,s,i,a,o){let u=n.ownerDocument,d=u.defaultView||window;for(let p=n,m=!1;p&&!m;)if(p.nodeType==1){let g,x=p==u.body,v=1,y=1;if(x)g=TY(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(p).position)&&(m=!0),p.scrollHeight<=p.clientHeight&&p.scrollWidth<=p.clientWidth){p=p.assignedSlot||p.parentNode;continue}let k=p.getBoundingClientRect();({scaleX:v,scaleY:y}=mM(p,k)),g={left:k.left,right:k.left+p.clientWidth*v,top:k.top,bottom:k.top+p.clientHeight*y}}let S=0,Q=0;if(s=="nearest")e.top<g.top?(Q=e.top-(g.top+a),t>0&&e.bottom>g.bottom+Q&&(Q=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(Q=e.bottom-g.bottom+a,t<0&&e.top-Q<g.top&&(Q=e.top-(g.top+a)));else{let k=e.bottom-e.top,$=g.bottom-g.top;Q=(s=="center"&&k<=$?e.top+k/2-$/2:s=="start"||s=="center"&&t<0?e.top-a:e.bottom-$+a)-g.top}if(r=="nearest"?e.left<g.left?(S=e.left-(g.left+i),t>0&&e.right>g.right+S&&(S=e.right-g.right+i)):e.right>g.right&&(S=e.right-g.right+i,t<0&&e.left<g.left+S&&(S=e.left-(g.left+i))):S=(r=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:r=="start"==o?e.left-i:e.right-(g.right-g.left)+i)-g.left,S||Q)if(x)d.scrollBy(S,Q);else{let k=0,$=0;if(Q){let j=p.scrollTop;p.scrollTop+=Q/y,$=(p.scrollTop-j)*y}if(S){let j=p.scrollLeft;p.scrollLeft+=S/v,k=(p.scrollLeft-j)*v}e={left:e.left-k,top:e.top-$,right:e.right-k,bottom:e.bottom-$},k&&Math.abs(k-S)<1&&(r="nearest"),$&&Math.abs($-Q)<1&&(s="nearest")}if(x)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),p=p.assignedSlot||p.parentNode}else if(p.nodeType==11)p=p.host;else break}function _Y(n){let e=n.ownerDocument,t,r;for(let s=n.parentNode;s&&!(s==e.body||t&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:r}}class PY{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Ui(t):0),r,Math.min(e.focusOffset,r?Ui(r):0))}set(e,t,r,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=s}}let ml=null;Ne.safari&&Ne.safari_version>=26&&(ml=!1);function OM(n){if(n.setActive)return n.setActive();if(ml)return n.focus(ml);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ml==null?{get preventScroll(){return ml={preventScroll:!0},!0}}:void 0),!ml){ml=!1;for(let t=0;t<e.length;){let r=e[t++],s=e[t++],i=e[t++];r.scrollTop!=s&&(r.scrollTop=s),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let r_;function Tf(n,e,t=e){let r=r_||(r_=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function rc(n,e,t,r){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let i=new KeyboardEvent("keydown",s);i.synthetic=!0,n.dispatchEvent(i);let a=new KeyboardEvent("keyup",s);return a.synthetic=!0,n.dispatchEvent(a),i.defaultPrevented||a.defaultPrevented}function NY(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function CY(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,Ui(t));;)if(r){if(t.nodeType!=1)return!1;let s=t.childNodes[r-1];s.contentEditable=="false"?r--:(t=s,r=Ui(t))}else{if(t==n)return!0;r=Za(t),t=t.parentNode}}function gM(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function xM(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Ui(t)}else if(t.parentNode&&!Vp(t))r=Za(t),t=t.parentNode;else return null}}function bM(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!Vp(t))r=Za(t)+1,t=t.parentNode;else return null}}class _s{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new _s(e.parentNode,Za(e),t)}static after(e,t){return new _s(e.parentNode,Za(e)+1,t)}}var Ft=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Ft||(Ft={}));const El=Ft.LTR,uQ=Ft.RTL;function yM(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const RY=yM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),EY=yM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),VS=Object.create(null),Bs=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);VS[e]=t,VS[t]=-e}function vM(n){return n<=247?RY[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?EY[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const AY=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Li{get dir(){return this.level%2?uQ:El}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,s){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==r)return a;(i<0||(s!=0?s<0?o.from<t:o.to>t:e[i].level>o.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}function wM(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],s=e[t];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!wM(r.inner,s.inner))return!1}return!0}const At=[];function qY(n,e,t,r,s){for(let i=0;i<=r.length;i++){let a=i?r[i-1].to:e,o=i<r.length?r[i].from:t,u=i?256:s;for(let d=a,p=u,m=u;d<o;d++){let g=vM(n.charCodeAt(d));g==512?g=p:g==8&&m==4&&(g=16),At[d]=g==4?2:g,g&7&&(m=g),p=g}for(let d=a,p=u,m=u;d<o;d++){let g=At[d];if(g==128)d<o-1&&p==At[d+1]&&p&24?g=At[d]=p:At[d]=256;else if(g==64){let x=d+1;for(;x<o&&At[x]==64;)x++;let v=d&&p==8||x<t&&At[x]==8?m==1?1:8:256;for(let y=d;y<x;y++)At[y]=v;d=x-1}else g==8&&m==1&&(At[d]=1);p=g,g&7&&(m=g)}}}function MY(n,e,t,r,s){let i=s==1?2:1;for(let a=0,o=0,u=0;a<=r.length;a++){let d=a?r[a-1].to:e,p=a<r.length?r[a].from:t;for(let m=d,g,x,v;m<p;m++)if(x=VS[g=n.charCodeAt(m)])if(x<0){for(let y=o-3;y>=0;y-=3)if(Bs[y+1]==-x){let S=Bs[y+2],Q=S&2?s:S&4?S&1?i:s:0;Q&&(At[m]=At[Bs[y]]=Q),o=y;break}}else{if(Bs.length==189)break;Bs[o++]=m,Bs[o++]=g,Bs[o++]=u}else if((v=At[m])==2||v==1){let y=v==s;u=y?0:1;for(let S=o-3;S>=0;S-=3){let Q=Bs[S+2];if(Q&2)break;if(y)Bs[S+2]|=2;else{if(Q&4)break;Bs[S+2]|=4}}}}}function XY(n,e,t,r){for(let s=0,i=r;s<=t.length;s++){let a=s?t[s-1].to:n,o=s<t.length?t[s].from:e;for(let u=a;u<o;){let d=At[u];if(d==256){let p=u+1;for(;;)if(p==o){if(s==t.length)break;p=t[s++].to,o=s<t.length?t[s].from:e}else if(At[p]==256)p++;else break;let m=i==1,g=(p<e?At[p]:r)==1,x=m==g?m?1:2:r;for(let v=p,y=s,S=y?t[y-1].to:n;v>u;)v==S&&(v=t[--y].from,S=y?t[y-1].to:n),At[--v]=x;u=p}else i=d,u++}}}function YS(n,e,t,r,s,i,a){let o=r%2?2:1;if(r%2==s%2)for(let u=e,d=0;u<t;){let p=!0,m=!1;if(d==i.length||u<i[d].from){let y=At[u];y!=o&&(p=!1,m=y==16)}let g=!p&&o==1?[]:null,x=p?r:r+1,v=u;e:for(;;)if(d<i.length&&v==i[d].from){if(m)break e;let y=i[d];if(!p)for(let S=y.to,Q=d+1;;){if(S==t)break e;if(Q<i.length&&i[Q].from==S)S=i[Q++].to;else{if(At[S]==o)break e;break}}if(d++,g)g.push(y);else{y.from>u&&a.push(new Li(u,y.from,x));let S=y.direction==El!=!(x%2);DS(n,S?r+1:r,s,y.inner,y.from,y.to,a),u=y.to}v=y.to}else{if(v==t||(p?At[v]!=o:At[v]==o))break;v++}g?YS(n,u,v,r+1,s,g,a):u<v&&a.push(new Li(u,v,x)),u=v}else for(let u=t,d=i.length;u>e;){let p=!0,m=!1;if(!d||u>i[d-1].to){let y=At[u-1];y!=o&&(p=!1,m=y==16)}let g=!p&&o==1?[]:null,x=p?r:r+1,v=u;e:for(;;)if(d&&v==i[d-1].to){if(m)break e;let y=i[--d];if(!p)for(let S=y.from,Q=d;;){if(S==e)break e;if(Q&&i[Q-1].to==S)S=i[--Q].from;else{if(At[S-1]==o)break e;break}}if(g)g.push(y);else{y.to<u&&a.push(new Li(y.to,u,x));let S=y.direction==El!=!(x%2);DS(n,S?r+1:r,s,y.inner,y.from,y.to,a),u=y.from}v=y.from}else{if(v==e||(p?At[v-1]!=o:At[v-1]==o))break;v--}g?YS(n,v,u,r+1,s,g,a):v<u&&a.push(new Li(v,u,x)),u=v}}function DS(n,e,t,r,s,i,a){let o=e%2?2:1;qY(n,s,i,r,o),MY(n,s,i,r,o),XY(s,i,r,o),YS(n,s,i,e,t,r,a)}function zY(n,e,t){if(!n)return[new Li(0,0,e==uQ?1:0)];if(e==El&&!t.length&&!AY.test(n))return SM(n.length);if(t.length)for(;n.length>At.length;)At[At.length]=256;let r=[],s=e==El?0:1;return DS(n,s,s,t,0,n.length,r),r}function SM(n){return[new Li(0,n,0)]}let QM="";function LY(n,e,t,r,s){var i;let a=r.head-n.from,o=Li.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),u=e[o],d=u.side(s,t);if(a==d){let g=o+=s?1:-1;if(g<0||g>=e.length)return null;u=e[o=g],a=u.side(!s,t),d=u.side(s,t)}let p=Zn(n.text,a,u.forward(s,t));(p<u.from||p>u.to)&&(p=d),QM=n.text.slice(Math.min(a,p),Math.max(a,p));let m=o==(s?e.length-1:0)?null:e[o+(s?1:-1)];return m&&p==d&&m.level+(s?0:1)<u.level?ve.cursor(m.side(!s,t)+n.from,m.forward(s,t)?1:-1,m.level):ve.cursor(p+n.from,u.forward(s,t)?-1:1,u.level)}function ZY(n,e,t){for(let r=e;r<t;r++){let s=vM(n.charCodeAt(r));if(s==1)return El;if(s==2||s==4)return uQ}return El}const kM=qe.define(),$M=qe.define(),TM=qe.define(),jM=qe.define(),BS=qe.define(),_M=qe.define(),PM=qe.define(),fQ=qe.define(),dQ=qe.define(),NM=qe.define({combine:n=>n.some(e=>e)}),VY=qe.define({combine:n=>n.some(e=>e)}),CM=qe.define();class sc{constructor(e,t="nearest",r="nearest",s=5,i=5,a=!1){this.range=e,this.y=t,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=a}map(e){return e.empty?this:new sc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new sc(ve.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Mh=Ct.define({map:(n,e)=>n.map(e)}),RM=Ct.define();function qr(n,e,t){let r=n.facet(jM);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Mi=qe.define({combine:n=>n.length?n[0]:!0});let YY=0;const Go=qe.define({combine(n){return n.filter((e,t)=>{for(let r=0;r<t;r++)if(n[r].plugin==e.plugin)return!1;return!0})}});class Ps{constructor(e,t,r,s,i){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Go.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Go.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:r,eventObservers:s,provide:i,decorations:a}=t||{};return new Ps(YY++,e,r,s,o=>{let u=[];return a&&u.push(Lm.of(d=>{let p=d.plugin(o);return p?a(p):Ut.none})),i&&u.push(i(o)),u})}static fromClass(e,t){return Ps.define((r,s)=>new e(r,s),t)}}class Wg{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(qr(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){qr(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){qr(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const EM=qe.define(),hQ=qe.define(),Lm=qe.define(),AM=qe.define(),pQ=qe.define(),ed=qe.define(),qM=qe.define();function s_(n,e){let t=n.state.facet(qM);if(!t.length)return t;let r=t.map(i=>i instanceof Function?i(n):i),s=[];return ft.spans(r,e.from,e.to,{point(){},span(i,a,o,u){let d=i-e.from,p=a-e.from,m=s;for(let g=o.length-1;g>=0;g--,u--){let x=o[g].spec.bidiIsolate,v;if(x==null&&(x=ZY(e.text,d,p)),u>0&&m.length&&(v=m[m.length-1]).to==d&&v.direction==x)v.to=p,m=v.inner;else{let y={from:d,to:p,direction:x,inner:[]};m.push(y),m=y.inner}}}}),s}const MM=qe.define();function mQ(n){let e=0,t=0,r=0,s=0;for(let i of n.state.facet(MM)){let a=i(n);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(t=Math.max(t,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(s=Math.max(s,a.bottom)))}return{left:e,right:t,top:r,bottom:s}}const Hu=qe.define();class Gr{constructor(e,t,r,s){this.fromA=e,this.toA=t,this.fromB=r,this.toB=s}join(e){return new Gr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let s=0,i=0,a=0;;){let o=s<e.length?e[s].fromB:1e9,u=i<t.length?t[i]:1e9,d=Math.min(o,u);if(d==1e9)break;let p=d+a,m=d,g=p;for(;;)if(i<t.length&&t[i]<=m){let x=t[i+1];i+=2,m=Math.max(m,x);for(let v=s;v<e.length&&e[v].fromB<=m;v++)a=e[v].toA-e[v].toB;g=Math.max(g,x+a)}else if(s<e.length&&e[s].fromB<=m){let x=e[s++];m=Math.max(m,x.toB),g=Math.max(g,x.toA),a=x.toA-x.toB}else break;r.push(new Gr(p,g,d,m))}return r}}class Dp{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=_n.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,a,o,u)=>s.push(new Gr(i,a,o,u))),this.changedRanges=s}static create(e,t,r){return new Dp(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const DY=[];class wn{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return DY}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&QY(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let r=t;for(let s of this.children){if(s==e)return r;r+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let r=Za(this.dom),s=this.length?e>0:t>0;return new _s(this.parent.dom,r+(s?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Vm)return e;return null}static get(e){return e.cmTile}}class Zm extends wn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,r=null,s,i=(e==null?void 0:e.node)==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,s=r?r.nextSibling:t.firstChild,i&&s!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;s&&s!=o.dom;)s=i_(s);else t.insertBefore(o.dom,s);r=o.dom}for(s=r?r.nextSibling:t.firstChild,i&&s&&(i.written=!0);s;)s=i_(s);this.length=a}}function i_(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Vm extends Zm{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=wn.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,s=0,i=0;;)if(s==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&i++,s=t.pop()}else{let a=r.children[s++];if(a instanceof Aa)t.push(s),r=a,s=0;else{let o=i+a.length,u=e(a,i);if(u!==void 0)return u;i=o+a.breakAfter}}}resolveBlock(e,t){let r,s=-1,i,a=-1;if(this.blockTiles((o,u)=>{let d=u+o.length;if(e>=u&&e<=d){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(r=void 0)}(u<e||e==d&&(t<-1?o.length:o.covers(1)))&&(!r||!o.isWidget()&&r.isWidget())&&(r=o,s=e-u),(d>e||e==u&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-u)}}),!r&&!i)throw new Error("No tile at position "+e);return r&&t<0||!i?{tile:r,offset:s}:{tile:i,offset:a}}}class Aa extends Zm{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let r=new Aa(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class pc extends Zm{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let s=new pc(t||document.createElement("div"),e);return(!t||!r)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,t,r){let s=null,i=-1,a=null,o=-1;function u(p,m){for(let g=0,x=0;g<p.children.length&&x<=m;g++){let v=p.children[g],y=x+v.length;y>=m&&(v.isComposite()?u(v,m-x):(!a||a.isHidden&&(t>0||r&&UY(a,v)))&&(y>m||v.flags&32)?(a=v,o=m-x):(x<m||v.flags&16&&!v.isHidden)&&(s=v,i=m-x)),x=y}}u(this,e);let d=(t<0?s:a)||s||a;return d?{tile:d,offset:d==s?i:o}:null}coordsIn(e,t){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t):BY(this)}domIn(e,t){let r=this.resolveInline(e,t);if(r){let{tile:s,offset:i}=r;if(this.dom.contains(s.dom))return s.isText()?new _s(s.dom,Math.min(s.dom.nodeValue.length,i)):s.domPosFor(i,s.flags&16?1:s.flags&32?-1:t);let a=r.tile.parent,o=!1;for(let u of a.children){if(o)return new _s(u.dom,0);u==r.tile&&(o=!0)}}return new _s(this.dom,0)}}function BY(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=yp(e);return t[t.length-1]||null}function UY(n,e){let t=n.coordsIn(0,1),r=e.coordsIn(0,1);return t&&r&&r.top<t.bottom}class hr extends Zm{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let r=new hr(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class Sl extends wn{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,i=e,a=0;e==0&&t<0||e==r&&t>=0?Ne.chrome||Ne.gecko||(e?(s--,a=1):i<r&&(i++,a=-1)):t<0?s--:i<r&&i++;let o=Tf(this.dom,s,i).getClientRects();if(!o.length)return null;let u=o[(a?a<0:t>=0)?0:o.length-1];return Ne.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(o,d=>d.width)||u),a?Yp(u,a<0):u||null}static of(e,t){let r=new Sl(t||document.createTextNode(e),e);return t||(r.flags|=2),r}}class Al extends wn{constructor(e,t,r,s){super(e,t,s),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let s=this.widget.coordsAt(this.dom,e,t);if(s)return s;if(r)return Yp(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let i=this.dom.getClientRects(),a=null;if(!i.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=o?i.length-1:0;a=i[u],!(e>0?u==0:u==i.length-1||a.top<a.bottom);u+=o?-1:1);return Yp(a,!o)}}get overrideDOMText(){if(!this.length)return dt.empty;let{root:e}=this;if(!e)return dt.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,r,s,i){return i||(i=e.toDOM(t),e.editable||(i.contentEditable="false")),new Al(i,r,e,s)}}class Bp extends wn{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return dt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class WY{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,r){let{tile:s,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(s.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(i==s.children.length){if(!e&&!o.length)break;r&&r.leave(s),a=!!s.breakAfter,{tile:s,index:i}=o.pop(),i++}else{let u=s.children[i],d=u.breakAfter;(t>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!d,i++,e-=u.length):(o.push({tile:s,index:i}),s=u,i=0,r&&u.isComposite()&&r.enter(u))}else if(i==s.length)a=!!s.breakAfter,{tile:s,index:i}=o.pop(),i++;else if(e){let u=Math.min(e,s.length-i);r&&r.skip(s,i,i+u),e-=u,i+=u}else break;return this.tile=s,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class GY{constructor(e,t,r,s){this.from=e,this.to=t,this.wrapper=r,this.rank=s}}class IY{constructor(e,t,r){this.cache=e,this.root=t,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,r,s){var i;this.flushBuffer();let a=this.ensureMarks(t,r),o=a.lastChild;if(o&&o.isText()&&!(o.flags&8)){this.cache.reused.set(o,2);let u=a.children[a.children.length-1]=new Sl(o.dom,o.text+e);u.parent=a}else a.append(s||Sl.of(e,(i=this.cache.find(Sl))===null||i===void 0?void 0:i.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let r=this.curLine;r.dom!=t.line.dom&&(r.setDOM(this.cache.reused.has(t.line)?Gg(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let s=r;for(let o=t.marks.length-1;o>=0;o--){let u=t.marks[o],d=s.lastChild;if(d instanceof hr&&d.mark.eq(u.mark))d.dom!=u.dom&&d.setDOM(Gg(u.dom)),s=d;else{if(this.cache.reused.get(u)){let m=wn.get(u.dom);m&&m.setDOM(Gg(u.dom))}let p=hr.of(u.mark,u.dom);s.append(p),s=p}this.cache.reused.set(u,2)}let i=wn.get(e.text);i&&this.cache.reused.set(i,2);let a=new Sl(e.text,e.text.nodeValue);a.flags|=8,s.append(a)}addInlineWidget(e,t,r){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let i=this.ensureMarks(t,r);!s&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=XM);let s=pc.start(e,t||((r=this.cache.find(pc))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var r;let s=this.curLine;for(let i=e.length-1;i>=0;i--){let a=e[i],o;if(t>0&&(o=s.lastChild)&&o instanceof hr&&o.mark.eq(a))s=o,t--;else{let u=hr.of(a,(r=this.cache.find(hr,d=>d.mark.eq(a)))===null||r===void 0?void 0:r.dom);s.append(u),s=u,t=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!a_(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ne.ios&&a_(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ig,0,32)||new Al(Ig.toDOM(),0,Ig,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new GY(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-t.rank||this.wrappers[r-1].to-t.to)<0;)r--;this.wrappers.splice(r,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let s=t.lastChild;if(r.from<this.pos&&s instanceof Aa&&s.wrapper.eq(r.wrapper))t=s;else{let i=Aa.of(r.wrapper,(e=this.cache.find(Aa,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(Bp,void 0,1);return r&&(r.flags=t),r||new Bp(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class HY{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:s,lineBreak:i,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=s;let o=this.textOff=Math.min(e,s.length);return i?null:s.slice(0,o)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}}const Up=[Al,pc,Sl,hr,Bp,Aa,Vm];for(let n=0;n<Up.length;n++)Up[n].bucket=n;class FY{constructor(e){this.view=e,this.buckets=Up.map(()=>[]),this.index=Up.map(()=>0),this.reused=new Map}add(e){e.demo&&console.log("Add widget to cache");let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let s=e.bucket,i=this.buckets[s],a=this.index[s];for(let o=i.length-1;o>=0;o--){let u=(o+a)%i.length,d=i[u];if((!t||t(d))&&!this.reused.has(d))return i.splice(u,1),u<a&&this.index[s]--,this.reused.set(d,r),d}return null}findWidget(e,t,r){let s=this.buckets[0];if(e.demo&&console.log("looking for widget",e,"in cache",s.slice()),s.length)for(let i=0,a=0;;i++){if(i==s.length){if(a)return null;a=1,i=0}let o=s[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view)))return s.splice(i,1),i<this.index[0]&&this.index[0]--,o.length==t&&(o.flags&497)==r?(this.reused.set(o,1),o):(this.reused.set(o,2),new Al(o.dom,t,e,o.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class KY{constructor(e,t,r,s,i){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new FY(e),this.text=new HY(e.state.doc),this.builder=new IY(this.cache,new Vm(e,e.contentDOM),ft.iter(r)),this.cache.reused.set(t,2),this.old=new WY(t),this.reuseWalker={skip:(a,o,u)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let s=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,u=o?o.fromA:this.old.root.length;if(u>s){let d=u-s;this.preserve(d,!a,!o),s=u,i+=d}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,r),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,s=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,r){let s=tD(this.old),i=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,o,u)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(u-o);else{let d=u>0||o<a.length?Al.of(a.widget,this.view,u-o,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,s,i),i=s.length)}else if(a.isText())this.builder.ensureLine(null),!o&&u==a.length?this.builder.addText(a.text,s,i,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(o,u),s,i)),i=s.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof Bp)this.cache.add(a);else if(a instanceof hr)this.builder.ensureLine(null),this.builder.addMark(a,s,i),this.cache.reused.set(a,1),i=s.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof hr&&s.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?s.length&&(s.length=i=0):a instanceof hr&&(s.shift(),i=Math.min(i,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,s=this.builder,i=0,a=ft.spans(this.decorations,e,t,{point:(o,u,d,p,m,g)=>{if(d instanceof Rl){if(this.disallowBlockEffectsFor[g]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=p.length,m>p.length)s.continueWidget(u-o);else{let x=d.widget||(d.block?mc.block:mc.inline),v=JY(d),y=this.cache.findWidget(x,u-o,v)||Al.of(x,this.view,u-o,v);d.block?(d.startSide>0&&s.addLineStartIfNotCovered(r),s.addBlockWidget(y)):(s.ensureLine(r),s.addInlineWidget(y,p,m))}r=null}else r=eD(r,d);u>o&&this.text.skip(u-o)},span:(o,u,d,p)=>{for(let m=o;m<u;){let g=this.text.next(Math.min(512,u-m));g==null?(s.addLineStartIfNotCovered(r),s.addBreak(),m++):(s.ensureLine(r),s.addText(g,d,p),m+=g.length),r=null}}});s.addLineStartIfNotCovered(r),this.openWidget=a>i,this.openMarks=a}forward(e,t){t-e<=10?this.old.advance(t-e,1,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,1,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let s=e.parentNode;;s=s.parentNode){let i=wn.get(s);if(s==this.view.contentDOM)break;i instanceof hr?t.push(i):i!=null&&i.isLine()?r=i:s.nodeName=="DIV"&&!r&&s!=this.view.contentDOM?r=new pc(s,XM):t.push(hr.of(new Kf({tagName:s.nodeName.toLowerCase(),attributes:kY(s)}),s))}return{line:r,marks:t}}}function a_(n,e){let t=r=>{for(let s of r.children)if((e?s.isText():s.length)||t(s))return!0;return!1};return t(n)}function JY(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const XM={class:"cm-line"};function eD(n,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(n||(n={class:"cm-line"}),t&&oQ(t,n),r&&(n.class+=" "+r)),n}function tD(n){let e=[];for(let t=n.parents.length;t>1;t--){let r=t==n.parents.length?n.tile:n.parents[t].tile;r instanceof hr&&e.push(r.mark)}return e}function Gg(n){let e=wn.get(n);return e&&e.setDOM(n.cloneNode()),n}class mc extends Ff{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}mc.inline=new mc("span");mc.block=new mc("div");const Ig=new class extends Ff{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class l_{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ut.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Vm(e,e.contentDOM),this.updateInner([new Gr(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:p,toA:m})=>m<this.minWidthFrom||p>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!uD(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?rD(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:p,to:m}=this.hasComposition;r=new Gr(p,m,e.changes.mapPos(p,-1),e.changes.mapPos(m,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(Ne.ie||Ne.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,o=this.blockWrappers;this.updateDeco();let u=aD(a,this.decorations,e.changes);u.length&&(r=Gr.extendWithRanges(r,u));let d=oD(o,this.blockWrappers,e.changes);return d.length&&(r=Gr.extendWithRanges(r,d)),i&&!r.some(p=>p.fromA<=i.range.fromA&&p.toA>=i.range.toA)&&(r=i.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let a=this.tile,o=new KY(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=o.run(e,t),US(a,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=Ne.chrome||Ne.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||r.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let i of this.tile.children)i.isWidget()&&i.widget instanceof Hg&&s.push(i.dom);r.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(RM)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,s=this.view.root.activeElement,i=s==r,a=!i&&!(this.view.state.facet(Mi)||r.tabIndex>-1)&&bp(r,this.view.observer.selectionRange)&&!(s&&r.contains(s));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,d,p;if(u.empty?p=d=this.inlineDOMNearPos(u.anchor,u.assoc||1):(p=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),d=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),Ne.gecko&&u.empty&&!this.hasComposition&&nD(d)){let g=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(g,d.node.childNodes[d.offset]||null)),d=p=new _s(g,0),o=!0}let m=this.view.observer.selectionRange;(o||!m.focusNode||(!ff(d.node,d.offset,m.anchorNode,m.anchorOffset)||!ff(p.node,p.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,u))&&(this.view.observer.ignore(()=>{Ne.android&&Ne.chrome&&r.contains(m.focusNode)&&cD(m.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=$f(this.view.root);if(g)if(u.empty){if(Ne.gecko){let x=sD(d.node,d.offset);if(x&&x!=3){let v=(x==1?xM:bM)(d.node,d.offset);v&&(d=new _s(v.node,v.offset))}}g.collapse(d.node,d.offset),u.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=u.bidiLevel)}else if(g.extend){g.collapse(d.node,d.offset);try{g.extend(p.node,p.offset)}catch{}}else{let x=document.createRange();u.anchor>u.head&&([d,p]=[p,d]),x.setEnd(p.node,p.offset),x.setStart(d.node,d.offset),g.removeAllRanges(),g.addRange(x)}a&&this.view.root.activeElement==r&&(r.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(d,p)),this.impreciseAnchor=d.precise?null:new _s(m.anchorNode,m.anchorOffset),this.impreciseHead=p.precise?null:new _s(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ff(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=$f(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let u=this.coordsAt(t.head,-1),d=this.coordsAt(t.head,1);if(!u||!d||u.bottom>d.top)return;let p=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(p.node,p.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=t.from&&r.collapse(s,i)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=r.posAtStart;if(r.isComposite()){let i;if(e==r.dom)i=r.dom.childNodes[t];else{let a=Ui(e)==0?0:t==0?-1:1;for(;;){let o=e.parentNode;if(o==r.dom)break;a==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?a=-1:a=1),e=o}a<0?i=e:i=e.nextSibling}if(i==r.dom.firstChild)return s;for(;i&&!wn.get(i);)i=i.nextSibling;if(!i)return s+r.length;for(let a=0,o=s;;a++){let u=r.children[a];if(u.dom==i)return o;o+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?s+t:s+(t?r.length:0):s}domAtPos(e,t){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(e,t):r.domIn(s,t)}inlineDOMNearPos(e,t){let r,s=-1,i=!1,a,o=-1,u=!1;return this.tile.blockTiles((d,p)=>{if(d.isWidget()){if(d.flags&32&&p>=e)return!0;d.flags&16&&(i=!0)}else{let m=p+d.length;if(p<=e&&(r=d,s=e-p,i=m<e),m>=e&&!a&&(a=d,o=e-p,u=p>e),p>e&&a)return!0}}),!r&&!a?this.domAtPos(e,t):(i&&a?r=null:u&&r&&(a=null),r&&t<0||!a?r.domIn(s,t):a.domIn(o,t))}coordsAt(e,t){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof Hg?null:r.coordsInWidget(s,t,!0):r.coordsIn(s,t)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function s(i,a){if(i.isComposite())for(let o of i.children){if(o.length>=a){let u=s(o,a);if(u)return u}if(a-=o.length,a<0)break}else if(i.isText()&&a<i.length){let o=Zn(i.text,a);if(o==a)return null;let u=Tf(i.dom,a,o).getClientRects();for(let d=0;d<u.length;d++){let p=u[d];if(d==u.length-1||p.top<p.bottom&&p.left<p.right)return p}}return null}return s(t,r)}measureVisibleLineHeights(e){let t=[],{from:r,to:s}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,u=this.view.textDirection==Ft.LTR,d=0,p=(m,g,x)=>{for(let v=0;v<m.children.length&&!(g>s);v++){let y=m.children[v],S=g+y.length,Q=y.dom.getBoundingClientRect(),{height:k}=Q;if(x&&!v&&(d+=Q.top-x.top),y instanceof Aa)S>r&&p(y,g,Q);else if(g>=r&&(d>0&&t.push(-d),t.push(k+d),d=0,a)){let $=y.dom.lastChild,j=$?yp($):[];if(j.length){let T=j[j.length-1],R=u?T.right-Q.left:Q.right-T.left;R>o&&(o=R,this.minWidth=i,this.minWidthFrom=g,this.minWidthTo=S)}}x&&v==m.children.length-1&&(d+=x.bottom-Q.bottom),g=S+y.breakAfter}};return p(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?Ft.RTL:Ft.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let o=0,u;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let p=yp(d.dom);if(p.length!=1)return;o+=p[0].width,u=p[0].height}if(o)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:o/a.length,textHeight:u}}});if(e)return e;let t=document.createElement("div"),r,s,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let a=yp(t.firstChild)[0];r=t.getBoundingClientRect().height,s=a&&a.width?a.width/27:7,i=a&&a.height?a.height:r,t.remove()}),{lineHeight:r,charWidth:s,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,s=0;;s++){let i=s==t.viewports.length?null:t.viewports[s],a=i?i.from-1:this.view.state.doc.length;if(a>r){let o=(t.lineBlockAt(a).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Ut.replace({widget:new Hg(o),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return Ut.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Lm).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(pQ).map((i,a)=>{let o=typeof i=="function";return o&&(r=!0),o?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,t.push(ft.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(AM).map(i=>typeof i=="function"?i(this.view):i)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(CM))try{if(d(this.view,e.range,e))return!0}catch(p){qr(this.view.state,p,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),s;if(!r)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let i=mQ(this.view),a={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:o,offsetHeight:u}=this.view.scrollDOM;jY(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==Ft.LTR)}lineHasWidget(e){let t=r=>r.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){US(this.tile)}}function US(n,e){let t=e==null?void 0:e.get(n);if(t!=1){t==null&&n.destroy();for(let r of n.children)US(r,e)}}function nD(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function zM(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=xM(t.focusNode,t.focusOffset),s=bM(t.focusNode,t.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let o=wn.get(s.node);if(!o||o.isText()&&o.text!=s.node.nodeValue)i=s;else if(n.docView.lastCompositionAfterCursor){let u=wn.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(i=s)}}if(n.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=e-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}function rD(n,e,t){let r=zM(n,t);if(!r)return null;let{node:s,from:i,to:a}=r,o=s.nodeValue;if(/[\n\r]/.test(o)||n.state.doc.sliceString(r.from,r.to)!=o)return null;let u=e.invertedDesc;return{range:new Gr(u.mapPos(i),u.mapPos(a),i,a),text:s}}function sD(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let iD=class{constructor(){this.changes=[]}compareRange(e,t){nc(e,t,this.changes)}comparePoint(e,t){nc(e,t,this.changes)}boundChange(e){nc(e,e,this.changes)}};function aD(n,e,t){let r=new iD;return ft.compare(n,e,t,r),r.changes}class lD{constructor(){this.changes=[]}compareRange(e,t){nc(e,t,this.changes)}comparePoint(){}boundChange(e){nc(e,e,this.changes)}}function oD(n,e,t){let r=new lD;return ft.compare(n,e,t,r),r.changes}function cD(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function uD(n,e){let t=!1;return e&&n.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(t=!0)}),t}class Hg extends Ff{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function fD(n,e,t=1){let r=n.charCategorizer(e),s=n.doc.lineAt(e),i=e-s.from;if(s.length==0)return ve.cursor(e);i==0?t=1:i==s.length&&(t=-1);let a=i,o=i;t<0?a=Zn(s.text,i,!1):o=Zn(s.text,i);let u=r(s.text.slice(a,o));for(;a>0;){let d=Zn(s.text,a,!1);if(r(s.text.slice(d,a))!=u)break;a=d}for(;o<s.length;){let d=Zn(s.text,o);if(r(s.text.slice(o,d))!=u)break;o=d}return ve.range(a+s.from,o+s.from)}function dD(n,e,t,r,s){let i=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,u=Math.floor((s-t.top-(n.defaultLineHeight-o)*.5)/o);i+=u*n.viewState.heightOracle.lineLength}let a=n.state.sliceDoc(t.from,t.to);return t.from+xY(a,i,n.state.tabSize)}function hD(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!s||i.type==Or.Text&&(s.type!=i.type||(t<0?i.from<e:i.to>e)))&&(s=i)}}return s||r}return r}function pD(n,e,t,r){let s=hD(n,e.head,e.assoc||-1),i=!r||s.type!=Or.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let a=n.dom.getBoundingClientRect(),o=n.textDirectionAt(s.from),u=n.posAtCoords({x:t==(o==Ft.LTR)?a.right-1:a.left+1,y:(i.top+i.bottom)/2});if(u!=null)return ve.cursor(u,t?-1:1)}return ve.cursor(t?s.to:s.from,t?-1:1)}function o_(n,e,t,r){let s=n.state.doc.lineAt(e.head),i=n.bidiSpans(s),a=n.textDirectionAt(s.from);for(let o=e,u=null;;){let d=LY(s,i,a,o,t),p=QM;if(!d){if(s.number==(t?n.state.doc.lines:1))return o;p=`
|
|
210
|
-
`,s=n.state.doc.line(s.number+(t?1:-1)),i=n.bidiSpans(s),d=n.visualLineSide(s,!t)}if(u){if(!u(p))return o}else{if(!r)return d;u=r(p)}o=d}}function mD(n,e,t){let r=n.state.charCategorizer(e),s=r(t);return i=>{let a=r(i);return s==zi.Space&&(s=a),s==a}}function OD(n,e,t,r){let s=e.head,i=t?1:-1;if(s==(t?n.state.doc.length:0))return ve.cursor(s,e.assoc);let a=e.goalColumn,o,u=n.contentDOM.getBoundingClientRect(),d=n.coordsAtPos(s,e.assoc||-1),p=n.documentTop;if(d)a==null&&(a=d.left-u.left),o=i<0?d.top:d.bottom;else{let x=n.viewState.lineBlockAt(s);a==null&&(a=Math.min(u.right-u.left,n.defaultCharacterWidth*(s-x.from))),o=(i<0?x.top:x.bottom)+p}let m=u.left+a,g=r??n.viewState.heightOracle.textHeight>>1;for(let x=0;;x+=10){let v=o+(g+x)*i,y=WS(n,{x:m,y:v},!1,i);return ve.cursor(y.pos,y.assoc,void 0,a)}}function df(n,e,t){for(;;){let r=0;for(let s of n)s.between(e-1,e+1,(i,a,o)=>{if(e>i&&e<a){let u=r||t||(e-i<a-e?-1:1);e=u<0?i:a,r=u}});if(!r)return e}}function LM(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],i=null;if(s.empty){let a=df(n,s.from,0);a!=s.from&&(i=ve.cursor(a,-1))}else{let a=df(n,s.from,-1),o=df(n,s.to,1);(a!=s.from||o!=s.to)&&(i=ve.range(s.from==s.anchor?a:o,s.from==s.head?a:o))}i&&(t||(t=e.ranges.slice()),t[r]=i)}return t?ve.create(t,e.mainIndex):e}function Fg(n,e,t){let r=df(n.state.facet(ed).map(s=>s(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:ve.cursor(r,r<t.from?1:-1)}class Hs{constructor(e,t){this.pos=e,this.assoc=t}}function WS(n,e,t,r){let s=n.contentDOM.getBoundingClientRect(),i=s.top+n.viewState.paddingTop,{x:a,y:o}=e,u=o-i,d;for(;;){if(u<0)return new Hs(0,1);if(u>n.viewState.docHeight)return new Hs(n.state.doc.length,-1);if(d=n.elementAtHeight(u),r==null)break;if(d.type==Or.Text){let g=n.docView.coordsAt(r<0?d.from:d.to,r);if(g&&(r<0?g.top<=u+i:g.bottom>=u+i))break}let m=n.viewState.heightOracle.textHeight/2;u=r>0?d.bottom+m:d.top-m}if(n.viewport.from>=d.to||n.viewport.to<=d.from){if(t)return null;if(d.type==Or.Text){let m=dD(n,s,d,a,o);return new Hs(m,m==d.from?1:-1)}}if(d.type!=Or.Text)return u<(d.top+d.bottom)/2?new Hs(d.from,1):new Hs(d.to,-1);let p=n.docView.lineAt(d.from,2);return(!p||p.length!=d.length)&&(p=n.docView.lineAt(d.from,-2)),ZM(n,p,d.from,a,o)}function ZM(n,e,t,r,s){let i=-1,a=null,o=1e9,u=1e9,d=s,p=s,m=(g,x)=>{for(let v=0;v<g.length;v++){let y=g[v];if(y.top==y.bottom)continue;let S=y.left>r?y.left-r:y.right<r?r-y.right:0,Q=y.top>s?y.top-s:y.bottom<s?s-y.bottom:0;y.top<=p&&y.bottom>=d&&(d=Math.min(y.top,d),p=Math.max(y.bottom,p),Q=0),(i<0||(Q-u||S-o)<0)&&(i>=0&&u&&o<S&&a.top<=p-2&&a.bottom>=d+2?u=0:(i=x,o=S,u=Q,a=y))}};if(e.isText()){for(let x=0;x<e.length;){let v=Zn(e.text,x);if(m(Tf(e.dom,x,v).getClientRects(),x),!o&&!u)break;x=v}return r>(a.left+a.right)/2==(c_(n,i+t)==Ft.LTR)?new Hs(t+Zn(e.text,i),-1):new Hs(t+i,1)}else{if(!e.length)return new Hs(t,1);for(let y=0;y<e.children.length;y++){let S=e.children[y];if(S.flags&48)continue;let Q=(S.dom.nodeType==1?S.dom:Tf(S.dom,0,S.length)).getClientRects();if(m(Q,y),!o&&!u)break}let g=e.children[i],x=e.posBefore(g,t);return g.isComposite()||g.isText()?ZM(n,g,x,Math.max(a.left,Math.min(a.right,r)),s):r>(a.left+a.right)/2==(c_(n,i+t)==Ft.LTR)?new Hs(x+g.length,-1):new Hs(x,1)}}function c_(n,e){let t=n.state.doc.lineAt(e);return n.bidiSpans(t)[Li.find(n.bidiSpans(t),e-t.from,-1,1)].dir}const Fu="";class gD{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(xt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fu}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let i=this.text.length;this.readNode(s);let a=wn.get(s),o=s.nextSibling;if(o==t){a!=null&&a.breakAfter&&!o&&r!=this.view.contentDOM&&this.lineBreak();break}let u=wn.get(o);(a&&u?a.breakAfter:(a?a.breakAfter:Vp(s))||Vp(o)&&(s.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>i)&&!bD(o,t)&&this.lineBreak(),s=o}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=s.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(r,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=a-1);r=i+a}}readNode(e){let t=wn.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(xD(e,r.node,r.offset)?t:0))}}function xD(n,e,t){for(;;){if(!e||t<Ui(e))return!1;if(e==n)return!0;t=Za(e)+1,e=e.parentNode}}function bD(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=wn.get(n);if(!(r!=null&&r.isWidget()))return!1;r&&(t||(t=[])).push(r)}if(t)for(let r of t){let s=r.overrideDOMText;if(s!=null&&s.length)return!1}return!0}class u_{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class yD{constructor(e,t,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=VM(e.docView.tile,t,r,0))){let o=i||a?[]:wD(e),u=new gD(o,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=SD(o,this.bounds.from)}else{let o=e.observer.selectionRange,u=i&&i.node==o.focusNode&&i.offset==o.focusOffset||!ZS(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),d=a&&a.node==o.anchorNode&&a.offset==o.anchorOffset||!ZS(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),p=e.viewport;if((Ne.ios||Ne.chrome)&&e.state.selection.main.empty&&u!=d&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(u,d),g=Math.max(u,d),x=p.from-m,v=p.to-g;(x==0||x==1||m==0)&&(v==0||v==-1||g==e.state.doc.length)&&(u=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(ve.range(d,u)):this.newSel=ve.single(d,u)}}}function VM(n,e,t,r){if(n.isComposite()){let s=-1,i=-1,a=-1,o=-1;for(let u=0,d=r,p=r;u<n.children.length;u++){let m=n.children[u],g=d+m.length;if(d<e&&g>t)return VM(m,e,t,d);if(g>=e&&s==-1&&(s=u,i=d),d>t&&m.dom.parentNode==n.dom){a=u,o=p;break}p=g,d=g+m.breakAfter}return{from:i,to:o<0?r+n.length:o,startDOM:(s?n.children[s-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:a<n.children.length&&a>=0?n.children[a].dom:null}}else return n.isText()?{from:r,to:r+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function YM(n,e){let t,{newSel:r}=e,s=n.state.selection.main,i=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:o}=e.bounds,u=s.from,d=null;(i===8||Ne.android&&e.text.length<o-a)&&(u=s.to,d="end");let p=DM(n.state.doc.sliceString(a,o,Fu),e.text,u-a,d);p&&(Ne.chrome&&i==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==Fu+Fu&&p.toB--,t={from:a+p.from,to:a+p.toA,insert:dt.of(e.text.slice(p.from,p.toB).split(Fu))})}else r&&(!n.hasFocus&&n.state.facet(Mi)||r.main.eq(s))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!s.empty&&r&&r.main.empty?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:(Ne.mac||Ne.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=ve.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:dt.of([t.insert.toString().replace("."," ")])}):t&&t.from>=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:n.state.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:n.state.toText(n.inputState.insertingText)}:Ne.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
|
|
211
|
-
`&&n.lineWrapping&&(r&&(r=ve.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:dt.of([" "])}),t)return OQ(n,t,r,i);if(r&&!r.main.eq(s)){let a=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(a=!0),o=n.inputState.lastSelectionOrigin,o=="select.pointer"&&(r=LM(n.state.facet(ed).map(u=>u(n)),r))),n.dispatch({selection:r,scrollIntoView:a,userEvent:o}),!0}else return!1}function OQ(n,e,t,r=-1){if(Ne.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(Ne.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&rc(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&rc(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&rc(n.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let a,o=()=>a||(a=vD(n,e,t));return n.state.facet(_M).some(u=>u(n,e.from,e.to,i,o))||n.dispatch(o()),!0}function vD(n,e,t){let r,s=n.state,i=s.selection.main,a=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let u=e.from<i.from?-1:1,d=u<0?i.from:i.to,p=df(s.facet(ed).map(m=>m(n)),d,u);e.from==p&&(a=p)}if(a>-1)r={changes:e,selection:ve.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let u=i.from<e.from?s.sliceDoc(i.from,e.from):"",d=i.to>e.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(n.state.toText(u+e.insert.sliceString(0,void 0,n.state.lineBreak)+d))}else{let u=s.changes(e),d=t&&t.main.to<=u.newLength?t.main:void 0;if(s.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let p=n.state.sliceDoc(e.from,e.to),m,g=t&&zM(n,t.main.head);if(g){let v=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-v}}else m=n.state.doc.lineAt(i.head);let x=i.to-e.to;r=s.changeByRange(v=>{if(v.from==i.from&&v.to==i.to)return{changes:u,range:d||v.map(u)};let y=v.to-x,S=y-p.length;if(n.state.sliceDoc(S,y)!=p||y>=m.from&&S<=m.to)return{range:v};let Q=s.changes({from:S,to:y,insert:e.insert}),k=v.to-i.to;return{changes:Q,range:d?ve.range(Math.max(0,d.anchor+k),Math.max(0,d.head+k)):v.map(Q)}})}else r={changes:u,selection:d&&s.selection.replaceRange(d)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:o,scrollIntoView:!0})}function DM(n,e,t,r){let s=Math.min(n.length,e.length),i=0;for(;i<s&&n.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==s&&n.length==e.length)return null;let a=n.length,o=e.length;for(;a>0&&o>0&&n.charCodeAt(a-1)==e.charCodeAt(o-1);)a--,o--;if(r=="end"){let u=Math.max(0,i-Math.min(a,o));t-=a+u-i}if(a<i&&n.length<e.length){let u=t<=i&&t>=a?i-t:0;i-=u,o=i+(o-a),a=i}else if(o<i){let u=t<=i&&t>=o?i-t:0;i-=u,a=i+(a-o),o=i}return{from:i,toA:a,toB:o}}function wD(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}=n.observer.selectionRange;return t&&(e.push(new u_(t,r)),(s!=t||i!=r)&&e.push(new u_(s,i))),e}function SD(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?ve.single(t+e,r+e):null}class QD{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ne.safari&&e.contentDOM.addEventListener("input",()=>null),Ne.gecko&&zD(e.contentDOM.ownerDocument)}handleEvent(e){!CD(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,t);for(let s of r.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=kD(e),r=this.handlers,s=this.view.contentDOM;for(let i in t)if(i!="scroll"){let a=!t[i].handlers.length,o=r[i];o&&a!=!o.handlers.length&&(s.removeEventListener(i,this.handleEvent),o=null),o||s.addEventListener(i,this.handleEvent,{passive:a})}for(let i in r)i!="scroll"&&!t[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&UM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ne.android&&Ne.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Ne.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=BM.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||$D.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,rc(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ne.safari&&!Ne.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function f_(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(s){qr(t.state,s)}}}function kD(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let s=r.spec,i=s&&s.plugin.domEventHandlers,a=s&&s.plugin.domEventObservers;if(i)for(let o in i){let u=i[o];u&&t(o).handlers.push(f_(r.value,u))}if(a)for(let o in a){let u=a[o];u&&t(o).observers.push(f_(r.value,u))}}for(let r in Ns)t(r).handlers.push(Ns[r]);for(let r in rs)t(r).observers.push(rs[r]);return e}const BM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$D="dthko",UM=[16,17,18,20,91,92,224,225],Xh=6;function zh(n){return Math.max(0,n)*.7+8}function TD(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class jD{constructor(e,t,r,s){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=_Y(e.contentDOM),this.atoms=e.state.facet(ed).map(a=>a(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(xt.allowMultipleSelections)&&_D(e,t),this.dragging=ND(e,t)&&IM(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&TD(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,s=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let u=mQ(this.view);e.clientX-u.left<=s+Xh?t=-zh(s-e.clientX):e.clientX+u.right>=a-Xh&&(t=zh(e.clientX-a)),e.clientY-u.top<=i+Xh?r=-zh(i-e.clientY):e.clientY+u.bottom>=o-Xh&&(r=zh(e.clientY-o)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=LM(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function _D(n,e){let t=n.state.facet(kM);return t.length?t[0](e):Ne.mac?e.metaKey:e.ctrlKey}function PD(n,e){let t=n.state.facet($M);return t.length?t[0](e):Ne.mac?!e.altKey:!e.ctrlKey}function ND(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=$f(n.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i<s.length;i++){let a=s[i];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function CD(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=wn.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Ns=Object.create(null),rs=Object.create(null),WM=Ne.ie&&Ne.ie_version<15||Ne.ios&&Ne.webkit_version<604;function RD(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),GM(n,t.value)},50)}function Ym(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function GM(n,e){e=Ym(n.state,fQ,e);let{state:t}=n,r,s=1,i=t.toText(e),a=i.lines==t.selection.ranges.length;if(GS!=null&&t.selection.ranges.every(u=>u.empty)&&GS==i.toString()){let u=-1;r=t.changeByRange(d=>{let p=t.doc.lineAt(d.from);if(p.from==u)return{range:d};u=p.from;let m=t.toText((a?i.line(s++).text:e)+t.lineBreak);return{changes:{from:p.from,insert:m},range:ve.cursor(d.from+m.length)}})}else a?r=t.changeByRange(u=>{let d=i.line(s++);return{changes:{from:u.from,to:u.to,insert:d.text},range:ve.cursor(u.from+d.length)}}):r=t.replaceSelection(i);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}rs.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Ns.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);rs.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};rs.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ns.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(TM))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=AD(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new jD(n,e,t,r)),r&&n.observer.ignore(()=>{OM(n.contentDOM);let i=n.root.activeElement;i&&!i.contains(n.contentDOM)&&i.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function d_(n,e,t,r){if(r==1)return ve.cursor(e,t);if(r==2)return fD(n.state,e,t);{let s=n.docView.lineAt(e,t),i=n.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:i.from,o=s?s.posAtEnd:i.to;return o<n.state.doc.length&&o==i.to&&o++,ve.range(a,o)}}const ED=Ne.ie&&Ne.ie_version<=11;let h_=null,p_=0,m_=0;function IM(n){if(!ED)return n.detail;let e=h_,t=m_;return h_=n,m_=Date.now(),p_=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(p_+1)%3:1}function AD(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=IM(e),s=n.state.selection;return{update(i){i.docChanged&&(t.pos=i.changes.mapPos(t.pos),s=s.map(i.changes))},get(i,a,o){let u=n.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),d,p=d_(n,u.pos,u.assoc,r);if(t.pos!=u.pos&&!a){let m=d_(n,t.pos,t.assoc,r),g=Math.min(m.from,p.from),x=Math.max(m.to,p.to);p=g<p.from?ve.range(g,x):ve.range(x,g)}return a?s.replaceRange(s.main.extend(p.from,p.to)):o&&r==1&&s.ranges.length>1&&(d=qD(s,u.pos))?d:o?s.addRange(p):ve.create([p])}}}function qD(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:s}=n.ranges[t];if(r<=e&&s>=e)return ve.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Ns.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.tile.nearest(e.target);if(s&&s.isWidget()){let i=s.posAtStart,a=i+s.length;(i>=t.to||a<=t.from)&&(t=ve.range(i,a))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Ym(n.state,dQ,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ns.dragend=n=>(n.inputState.draggedContent=null,!1);function O_(n,e,t,r){if(t=Ym(n.state,fQ,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=n.inputState,a=r&&i&&PD(n,e)?{from:i.from,to:i.to}:null,o={from:s,insert:t},u=n.state.changes(a?[a,o]:o);n.focus(),n.dispatch({changes:u,selection:{anchor:u.mapPos(s,-1),head:u.mapPos(s,1)},userEvent:a?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Ns.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),s=0,i=()=>{++s==t.length&&O_(n,e,r.filter(a=>a!=null).join(n.state.lineBreak),!1)};for(let a=0;a<t.length;a++){let o=new FileReader;o.onerror=i,o.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),i()},o.readAsText(t[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return O_(n,e,r,!0),!0}return!1};Ns.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=WM?null:e.clipboardData;return t?(GM(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(RD(n),!1)};function MD(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function XD(n){let e=[],t=[],r=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:i}of n.selection.ranges){let a=n.doc.lineAt(i);a.number>s&&(e.push(a.text),t.push({from:a.from,to:Math.min(n.doc.length,a.to+1)})),s=a.number}r=!0}return{text:Ym(n,dQ,e.join(n.lineBreak)),ranges:t,linewise:r}}let GS=null;Ns.copy=Ns.cut=(n,e)=>{let{text:t,ranges:r,linewise:s}=XD(n.state);if(!t&&!s)return!1;GS=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=WM?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",t),!0):(MD(n,t),!1)};const HM=Hi.define();function FM(n,e){let t=[];for(let r of n.facet(PM)){let s=r(n,e);s&&t.push(s)}return t.length?n.update({effects:t,annotations:HM.of(!0)}):null}function KM(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=FM(n.state,e);t?n.dispatch(t):n.update([])}},10)}rs.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),KM(n)};rs.blur=n=>{n.observer.clearSelectionRange(),KM(n)};rs.compositionstart=rs.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};rs.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Ne.chrome&&Ne.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};rs.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Ns.beforeinput=(n,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let i=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),a=e.getTargetRanges();if(i&&a.length){let o=a[0],u=n.posAtDOM(o.startContainer,o.startOffset),d=n.posAtDOM(o.endContainer,o.endOffset);return OQ(n,{from:u,to:d,insert:n.state.toText(i)},null),!0}}let s;if(Ne.chrome&&Ne.android&&(s=BM.find(i=>i.inputType==e.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>i+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Ne.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Ne.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>rs.compositionend(n,e),20),!1};const g_=new Set;function zD(n){g_.has(n)||(g_.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const x_=["pre-wrap","normal","pre-line","break-spaces"];let Oc=!1;function b_(){Oc=!1}class LD{constructor(e){this.lineWrapping=e,this.doc=dt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return x_.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(t=!0,this.heightSamples[Math.floor(s*10)]=!0)}return t}refresh(e,t,r,s,i,a){let o=x_.indexOf(e)>-1,u=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=r,this.textHeight=s,this.lineLength=i,u){this.heightSamples={};for(let d=0;d<a.length;d++){let p=a[d];p<0?d++:this.heightSamples[Math.floor(p*10)]=!0}}return u}}class ZD{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Ts{constructor(e,t,r,s,i){this.from=e,this.length=t,this.top=r,this.height=s,this._content=i}get type(){return typeof this._content=="number"?Or.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Rl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ts(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Mt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Mt||(Mt={}));const vp=.001;class er{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>vp&&(Oc=!0),this.height=e)}replace(e,t,r){return er.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,s){let i=this,a=r.doc;for(let o=s.length-1;o>=0;o--){let{fromA:u,toA:d,fromB:p,toB:m}=s[o],g=i.lineAt(u,Mt.ByPosNoHeight,r.setDoc(t),0,0),x=g.to>=d?g:i.lineAt(d,Mt.ByPosNoHeight,r,0,0);for(m+=x.to-d,d=x.to;o>0&&g.from<=s[o-1].toA;)u=s[o-1].fromA,p=s[o-1].fromB,o--,u<g.from&&(g=i.lineAt(u,Mt.ByPosNoHeight,r,0,0));p+=g.from-u,u=g.from;let v=gQ.build(r.setDoc(a),e,p,m);i=Wp(i,i.replace(u,d,v))}return i.updateHeight(r,0)}static empty(){return new Cr(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,s=0,i=0;for(;;)if(t==r)if(s>i*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),r+=1+o.break,s-=o.size}else if(i>s*2){let o=e[r];o.break?e.splice(r,1,o.left,null,o.right):e.splice(r,1,o.left,o.right),r+=2+o.break,i-=o.size}else break;else if(s<i){let o=e[t++];o&&(s+=o.size)}else{let o=e[--r];o&&(i+=o.size)}let a=0;return e[t-1]==null?(a=1,t--):e[t]==null&&(a=1,r++),new YD(er.of(e.slice(0,t)),a,er.of(e.slice(r)))}}function Wp(n,e){return n==e?n:(n.constructor!=e.constructor&&(Oc=!0),e)}er.prototype.size=1;const VD=Ut.replace({});class JM extends er{constructor(e,t,r){super(e,t),this.deco=r,this.spaceAbove=0}mainBlock(e,t){return new Ts(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,r,s){return this.spaceAbove&&e<r+this.spaceAbove?new Ts(s,0,r,this.spaceAbove,VD):this.mainBlock(r,s)}lineAt(e,t,r,s,i){let a=this.mainBlock(s,i);return this.spaceAbove?this.blockAt(0,r,s,i).join(a):a}forEachLine(e,t,r,s,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,Mt.ByPos,r,s,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,s){return s&&s.from<=t&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Cr extends JM{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new Ts(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let s=r[0];return r.length==1&&(s instanceof Cr||s instanceof zn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof zn?s=new Cr(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):er.of(r)}updateHeight(e,t=0,r=!1,s){return s&&s.from<=t&&s.more?this.setMeasuredHeight(s):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class zn extends er{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,i=s-r+1,a,o=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*i);a=u/i,this.length>i+1&&(o=(this.height-u)/(this.length-i-1))}else a=this.height/i;return{firstLine:r,lastLine:s,perLine:a,perChar:o}}blockAt(e,t,r,s){let{firstLine:i,lastLine:a,perLine:o,perChar:u}=this.heightMetrics(t,s);if(t.lineWrapping){let d=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),p=t.doc.lineAt(d),m=o+p.length*u,g=Math.max(r,e-m/2);return new Ts(p.from,p.length,g,m,0)}else{let d=Math.max(0,Math.min(a-i,Math.floor((e-r)/o))),{from:p,length:m}=t.doc.line(i+d);return new Ts(p,m,r+o*d,o,0)}}lineAt(e,t,r,s,i){if(t==Mt.ByHeight)return this.blockAt(e,r,s,i);if(t==Mt.ByPosNoHeight){let{from:x,to:v}=r.doc.lineAt(e);return new Ts(x,v-x,0,0,0)}let{firstLine:a,perLine:o,perChar:u}=this.heightMetrics(r,i),d=r.doc.lineAt(e),p=o+d.length*u,m=d.number-a,g=s+o*m+u*(d.from-i-m);return new Ts(d.from,d.length,Math.max(s,Math.min(g,s+this.height-p)),p,0)}forEachLine(e,t,r,s,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:u,perChar:d}=this.heightMetrics(r,i);for(let p=e,m=s;p<=t;){let g=r.doc.lineAt(p);if(p==e){let v=g.number-o;m+=u*v+d*(e-i-v)}let x=u+d*g.length;a(new Ts(g.from,g.length,m,x,0)),m+=x,p=g.to+1}}replace(e,t,r){let s=this.length-t;if(s>0){let i=r[r.length-1];i instanceof zn?r[r.length-1]=new zn(i.length+s):r.push(null,new zn(s-1))}if(e>0){let i=r[0];i instanceof zn?r[0]=new zn(e+i.length):r.unshift(new zn(e-1),null)}return er.of(r)}decomposeLeft(e,t){t.push(new zn(e-1),null)}decomposeRight(e,t){t.push(null,new zn(this.length-e-1))}updateHeight(e,t=0,r=!1,s){let i=t+this.length;if(s&&s.from<=t+this.length&&s.more){let a=[],o=Math.max(t,s.from),u=-1;for(s.from>t&&a.push(new zn(s.from-t-1).updateHeight(e,t));o<=i&&s.more;){let p=e.doc.lineAt(o).length;a.length&&a.push(null);let m=s.heights[s.index++],g=0;m<0&&(g=-m,m=s.heights[s.index++]),u==-1?u=m:Math.abs(m-u)>=vp&&(u=-2);let x=new Cr(p,m,g);x.outdated=!1,a.push(x),o+=p+1}o<=i&&a.push(null,new zn(i-o).updateHeight(e,o));let d=er.of(a);return(u<0||Math.abs(d.height-this.height)>=vp||Math.abs(u-this.heightMetrics(e,t).perLine)>=vp)&&(Oc=!0),Wp(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class YD extends er{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,s){let i=r+this.left.height;return e<i?this.left.blockAt(e,t,r,s):this.right.blockAt(e,t,i,s+this.left.length+this.break)}lineAt(e,t,r,s,i){let a=s+this.left.height,o=i+this.left.length+this.break,u=t==Mt.ByHeight?e<a:e<o,d=u?this.left.lineAt(e,t,r,s,i):this.right.lineAt(e,t,r,a,o);if(this.break||(u?d.to<o:d.from>o))return d;let p=t==Mt.ByPosNoHeight?Mt.ByPosNoHeight:Mt.ByPos;return u?d.join(this.right.lineAt(o,p,r,a,o)):this.left.lineAt(o,p,r,s,i).join(d)}forEachLine(e,t,r,s,i,a){let o=s+this.left.height,u=i+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,t,r,s,i,a),t>=u&&this.right.forEachLine(e,t,r,o,u,a);else{let d=this.lineAt(u,Mt.ByPos,r,s,i);e<d.from&&this.left.forEachLine(e,d.from-1,r,s,i,a),d.to>=e&&d.from<=t&&a(d),t>d.to&&this.right.forEachLine(d.to+1,t,r,o,u,a)}}replace(e,t,r){let s=this.left.length+this.break;if(t<s)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let o of r)i.push(o);if(e>0&&y_(i,a-1),t<this.length){let o=i.length;this.decomposeRight(t,i),y_(i,o)}return er.of(i)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<s&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?er.of(this.break?[e,null,t]:[e,t]):(this.left=Wp(this.left,e),this.right=Wp(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,s){let{left:i,right:a}=this,o=t+i.length+this.break,u=null;return s&&s.from<=t+i.length&&s.more?u=i=i.updateHeight(e,t,r,s):i.updateHeight(e,t,r),s&&s.from<=o+a.length&&s.more?u=a=a.updateHeight(e,o,r,s):a.updateHeight(e,o,r),u?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function y_(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof zn&&(r=n[e+1])instanceof zn&&n.splice(e-1,3,new zn(t.length+1+r.length))}const DD=5;class gQ{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Cr?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Cr(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let s=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let a=t-e;r.block?this.addBlock(new JM(a,s,r)):(a||i||s>=DD)&&this.addLineDeco(s,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Cr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new zn(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Cr)return e;let t=new Cr(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Cr)&&!this.isCovered?this.nodes.push(new Cr(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof Cr&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,t,r,s){let i=new gQ(r,e);return ft.spans(t,r,s,i,0),i.finish(r)}}function BD(n,e,t){let r=new UD;return ft.compare(n,e,t,r,0),r.changes}class UD{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,s){(e<t||r&&r.heightRelevant||s&&s.heightRelevant)&&nc(e,t,this.changes,5)}}function WD(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,s=r.defaultView||window,i=Math.max(0,t.left),a=Math.min(s.innerWidth,t.right),o=Math.max(0,t.top),u=Math.min(s.innerHeight,t.bottom);for(let d=n.parentNode;d&&d!=r.body;)if(d.nodeType==1){let p=d,m=window.getComputedStyle(p);if((p.scrollHeight>p.clientHeight||p.scrollWidth>p.clientWidth)&&m.overflow!="visible"){let g=p.getBoundingClientRect();i=Math.max(i,g.left),a=Math.min(a,g.right),o=Math.max(o,g.top),u=Math.min(d==n.parentNode?s.innerHeight:u,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?p.offsetParent:p.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:i-t.left,right:Math.max(i,a)-t.left,top:o-(t.top+e),bottom:Math.max(o,u)-(t.top+e)}}function GD(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function ID(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Kg{constructor(e,t,r,s){this.from=e,this.to=t,this.size=r,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],i=t[r];if(s.from!=i.from||s.to!=i.to||s.size!=i.size)return!1}return!0}draw(e,t){return Ut.replace({widget:new HD(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class HD extends Ff{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class v_{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=w_,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Ft.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(hQ).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new LD(t),this.stateDeco=S_(e),this.heightMap=er.empty().applyChanges(this.stateDeco,dt.empty,this.heightOracle.setDoc(e.doc),[new Gr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ut.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let s=r?t.head:t.anchor;if(!e.some(({from:i,to:a})=>s>=i&&s<=a)){let{from:i,to:a}=this.lineBlockAt(s);e.push(new Lh(i,a))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?w_:new xQ(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ku(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=S_(this.state);let s=e.changedRanges,i=Gr.extendWithRanges(s,BD(r,this.stateDeco,e?e.changes:_n.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);b_(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||Oc)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let u=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<u.from||t.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,t));let d=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(VY)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Ft.RTL:Ft.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),o=t.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let d=0,p=0;if(o.width&&o.height){let{scaleX:j,scaleY:T}=mM(t,o);(j>.005&&Math.abs(this.scaleX-j)>.005||T>.005&&Math.abs(this.scaleY-T)>.005)&&(this.scaleX=j,this.scaleY=T,d|=16,a=u=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=gM(e.scrollDOM);let v=(this.printing?ID:WD)(t,this.paddingTop),y=v.top-this.pixelViewport.top,S=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let Q=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Q!=this.inView&&(this.inView=Q,Q&&(u=!0)),!this.inView&&!this.scrollTarget&&!GD(e.dom))return 0;let k=o.width;if((this.contentDOMWidth!=k||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),u){let j=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(j)&&(a=!0),a||s.lineWrapping&&Math.abs(k-this.contentDOMWidth)>s.charWidth){let{lineHeight:T,charWidth:R,textHeight:N}=e.docView.measureTextSize();a=T>0&&s.refresh(i,T,R,N,Math.max(5,k/R),j),a&&(e.docView.minWidth=0,d|=16)}y>0&&S>0?p=Math.max(y,S):y<0&&S<0&&(p=Math.min(y,S)),b_();for(let T of this.viewports){let R=T.from==this.viewport.from?j:e.docView.measureVisibleLineHeights(T);this.heightMap=(a?er.empty().applyChanges(this.stateDeco,dt.empty,this.heightOracle,[new Gr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new ZD(T.from,R))}Oc&&(d|=2)}let $=!this.viewportIsAppropriate(this.viewport,p)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return $&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(p,this.scrollTarget),d|=this.updateForViewport()),(d&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,u=new Lh(s.lineAt(a-r*1e3,Mt.ByHeight,i,0,0).from,s.lineAt(o+(1-r)*1e3,Mt.ByHeight,i,0,0).to);if(t){let{head:d}=t.range;if(d<u.from||d>u.to){let p=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,Mt.ByPos,i,0,0),g;t.y=="center"?g=(m.top+m.bottom)/2-p/2:t.y=="start"||t.y=="nearest"&&d<u.from?g=m.top:g=m.bottom-p,u=new Lh(s.lineAt(g-1e3/2,Mt.ByHeight,i,0,0).from,s.lineAt(g+p+1e3/2,Mt.ByHeight,i,0,0).to)}}return u}mapViewport(e,t){let r=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new Lh(this.heightMap.lineAt(r,Mt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Mt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Mt.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,Mt.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||s<=a-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(r,250)))&&s>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let s of e)t.touchesRange(s.from,s.to)||r.push(new Kg(t.mapPos(s.from),t.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,i=s>>1,a=s<<1;if(this.defaultTextDirection!=Ft.LTR&&!r)return[];let o=[],u=(p,m,g,x)=>{if(m-p<i)return;let v=this.state.selection.main,y=[v.from];v.empty||y.push(v.to);for(let Q of y)if(Q>p&&Q<m){u(p,Q-10,g,x),u(Q+10,m,g,x);return}let S=KD(e,Q=>Q.from>=g.from&&Q.to<=g.to&&Math.abs(Q.from-p)<i&&Math.abs(Q.to-m)<i&&!y.some(k=>Q.from<k&&Q.to>k));if(!S){if(m<g.to&&t&&r&&t.visibleRanges.some($=>$.from<=m&&$.to>=m)){let $=t.moveToLineBoundary(ve.cursor(m),!1,!0).head;$>p&&(m=$)}let Q=this.gapSize(g,p,m,x),k=r||Q<2e6?Q:2e6;S=new Kg(p,m,Q,k)}o.push(S)},d=p=>{if(p.length<a||p.type!=Or.Text)return;let m=FD(p.from,p.to,this.stateDeco);if(m.total<a)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,x,v;if(r){let y=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,S,Q;if(g!=null){let k=Vh(m,g),$=((this.visibleBottom-this.visibleTop)/2+y)/p.height;S=k-$,Q=k+$}else S=(this.visibleTop-p.top-y)/p.height,Q=(this.visibleBottom-p.top+y)/p.height;x=Zh(m,S),v=Zh(m,Q)}else{let y=m.total*this.heightOracle.charWidth,S=s*this.heightOracle.charWidth,Q=0;if(y>2e6)for(let R of e)R.from>=p.from&&R.from<p.to&&R.size!=R.displaySize&&R.from*this.heightOracle.charWidth+Q<this.pixelViewport.left&&(Q=R.size-R.displaySize);let k=this.pixelViewport.left+Q,$=this.pixelViewport.right+Q,j,T;if(g!=null){let R=Vh(m,g),N=(($-k)/2+S)/y;j=R-N,T=R+N}else j=(k-S)/y,T=($+S)/y;x=Zh(m,j),v=Zh(m,T)}x>p.from&&u(p.from,x,p,m),v<p.to&&u(v,p.to,p,m)};for(let p of this.viewportLines)Array.isArray(p.type)?p.type.forEach(d):d(p);return o}gapSize(e,t,r,s){let i=Vh(s,r)-Vh(s,t);return this.heightOracle.lineWrapping?e.height*i:s.total*this.heightOracle.charWidth*i}updateLineGaps(e){Kg.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ut.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];ft.spans(t,this.viewport.from,this.viewport.to,{span(i,a){r.push({from:i,to:a})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i<r.length&&!(s&8);i++){let a=this.visibleRanges[i],o=r[i];(a.from!=o.from||a.to!=o.to)&&(s|=4,e&&e.mapPos(a.from,-1)==o.from&&e.mapPos(a.to,1)==o.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ku(this.heightMap.lineAt(e,Mt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Ku(this.heightMap.lineAt(this.scaler.fromDOM(e),Mt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ku(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let Lh=class{constructor(e,t){this.from=e,this.to=t}};function FD(n,e,t){let r=[],s=n,i=0;return ft.spans(t,n,e,{span(){},point(a,o){a>s&&(r.push({from:s,to:a}),i+=a-s),s=o}},20),s<e&&(r.push({from:s,to:e}),i+=e-s),{total:i,ranges:r}}function Zh({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let s=0;;s++){let{from:i,to:a}=e[s],o=a-i;if(r<=o)return i+r;r-=o}}function Vh(n,e){let t=0;for(let{from:r,to:s}of n.ranges){if(e<=s){t+=e-r;break}t+=s-r}return t/n.total}function KD(n,e){for(let t of n)if(e(t))return t}const w_={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function S_(n){let e=n.facet(Lm).filter(r=>typeof r!="function"),t=n.facet(pQ).filter(r=>typeof r!="function");return t.length&&e.push(ft.join(t)),e}class xQ{constructor(e,t,r){let s=0,i=0,a=0;this.viewports=r.map(({from:o,to:u})=>{let d=t.lineAt(o,Mt.ByPos,e,0,0).top,p=t.lineAt(u,Mt.ByPos,e,0,0).bottom;return s+=p-d,{from:o,to:u,top:d,bottom:p,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let o of this.viewports)o.domTop=a+(o.top-i)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),i=o.bottom}toDOM(e){for(let t=0,r=0,s=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return s+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,s=i.domBottom}}fromDOM(e){for(let t=0,r=0,s=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return r+(e-s)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,s=i.domBottom}}eq(e){return e instanceof xQ?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Ku(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new Ts(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(s=>Ku(s,e)):n._content)}const Yh=qe.define({combine:n=>n.join(" ")}),IS=qe.define({combine:n=>n.indexOf(!0)>-1}),HS=za.newName(),eX=za.newName(),tX=za.newName(),nX={"&light":"."+eX,"&dark":"."+tX};function FS(n,e,t){return new za(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+r}})}const JD=FS("."+HS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},nX),eB={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Jg=Ne.ie&&Ne.ie_version<=11;class tB{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new PY,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(Ne.ie&&Ne.ie_version<=11||Ne.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ne.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ne.chrome&&Ne.chrome_version<126)&&(this.editContext=new rB(e),e.state.facet(Mi)&&(e.contentDOM.editContext=this.editContext.editContext)),Jg&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(Mi)?r.root.activeElement!=this.dom:!bp(this.dom,s))return;let i=s.anchorNode&&r.docView.tile.nearest(s.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Ne.ie&&Ne.ie_version<=11||Ne.android&&Ne.chrome)&&!r.state.selection.main.empty&&s.focusNode&&ff(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=$f(e.root);if(!t)return!1;let r=Ne.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&nB(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let s=bp(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&CY(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,eB),Jg&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Jg&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let s=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&rc(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,s=!1;for(let i of e){let a=this.readMutation(i);a&&(a.typeOver&&(s=!0),t==-1?{from:t,to:r}=a:(t=Math.min(a.from,t),r=Math.max(a.to,r)))}return{from:t,to:r,typeOver:s}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),s=this.selectionChanged&&bp(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new yD(this.view,e,t,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,s=YM(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=Q_(t,e.previousSibling||e.target.previousSibling,-1),s=Q_(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Mi)!=e.state.facet(Mi)&&(e.view.contentDOM.editContext=e.state.facet(Mi)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Q_(n,e,t){for(;e;){let r=wn.get(e);if(r&&r.parent==n)return r;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function k_(n,e){let t=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,a=n.docView.domAtPos(n.state.selection.main.anchor,1);return ff(a.node,a.offset,s,i)&&([t,r,s,i]=[s,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}}function nB(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return k_(n,s)}let t=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?k_(n,t):null}class rB{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:i,head:a}=s,o=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let d=u-o>r.text.length;o==this.from&&i<this.from?o=i:u==this.to&&i>this.to&&(u=i);let p=DM(e.state.sliceDoc(o,u),r.text,(d?s.from:s.to)-o,d?"end":null);if(!p){let g=ve.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));g.main.eq(s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:p.from+o,to:p.toA+o,insert:dt.of(r.text.slice(p.from,p.toB).split(`
|
|
212
|
-
`))};if((Ne.mac||Ne.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:o,to:u,insert:dt.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);OQ(e,m,ve.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let a=this.toEditorPos(r.rangeStart),o=this.toEditorPos(r.rangeEnd);a<o;a++){let u=e.coordsForChar(a);i=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||i||new DOMRect,s.push(i)}t.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let i of r.getTextFormats()){let a=i.underlineStyle,o=i.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let u=this.toEditorPos(i.rangeStart),d=this.toEditorPos(i.rangeEnd);if(u<d){let p=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(o)?1:2}px`;s.push(Ut.mark({attributes:{style:p}}).range(u,d))}}}e.dispatch({effects:RM.of(Ut.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=$f(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,a,o,u,d)=>{if(r)return;let p=d.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(d)){s=this.pendingContextChange=null,t+=p,this.to+=p;return}else s=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=p,this.to+=p;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),d.toString()),this.to+=p}t+=p}),s&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ae{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||NY(e.parent)||document,this.viewState=new v_(e.state||xt.create(e)),e.scrollTo&&e.scrollTo.is(Mh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Go).map(s=>new Wg(s));for(let s of this.plugins)s.update(this);this.observer=new tB(this),this.inputState=new QD(this),this.inputState.ensureHandlers(this.plugins),this.docView=new l_(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof vn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,s,i=this.state;for(let g of e){if(g.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=g.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,u=null;e.some(g=>g.annotation(HM))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=FM(i,a),u||(o=1));let d=this.observer.delayedAndroidKey,p=null;if(d?(this.observer.clearDelayedAndroidKey(),p=this.observer.readChange(),(p&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(p=null)):this.observer.clear(),i.facet(xt.phrases)!=this.state.facet(xt.phrases))return this.setState(i);s=Dp.create(this,i,e),s.flags|=o;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:x}=g.state.selection;m=new sc(x.empty?x:ve.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is(Mh)&&(m=x.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=Gp.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Hu)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Yh)!=s.state.facet(Yh)&&(this.viewState.mustMeasureContent=!0),(t||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(BS))try{g(s)}catch(x){qr(this.state,x,"update listener")}(u||p)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),p&&!YM(this,p)&&d.force&&rc(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new v_(e),this.plugins=e.facet(Go).map(r=>new Wg(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new l_(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Go),r=e.state.facet(Go);if(t!=r){let s=[];for(let i of r){let a=t.indexOf(i);if(a<0)s.push(new Wg(i));else{let o=this.plugins[a];o.mustUpdate=e,s.push(o)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){qr(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(a<0)if(gM(r))i=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(s);i=x.from,a=x.top}this.updateState=1;let u=this.viewState.measure(this);if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];u&4||([this.measureRequests,d]=[d,this.measureRequests]);let p=d.map(x=>{try{return x.read(this)}catch(v){return qr(this.state,v),$_}}),m=Dp.create(this,this.state,[]),g=!1;m.flags|=u,t?t.flags|=u:t=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let x=0;x<d.length;x++)if(p[x]!=$_)try{let v=d[x];v.write&&v.write(p[x],this)}catch(v){qr(this.state,v)}if(g&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let v=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a;if(v>1||v<-1){s=s+v,r.scrollTop=s/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(BS))o(t)}get themeClasses(){return HS+" "+(this.state.facet(IS)?tX:eX)+" "+this.state.facet(Yh)}updateAttrs(){let e=T_(this,EM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Mi)?"true":"false",class:"cm-content",style:`${Ne.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),T_(this,hQ,t);let r=this.observer.ignore(()=>{let s=t_(this.contentDOM,this.contentAttrs,t),i=t_(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let s of r.effects)if(s.is(Ae.announce)){t&&(this.announceDOM.textContent=""),t=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Hu);let e=this.state.facet(Ae.cspNonce);za.mount(this.root,this.styleModules.concat(JD).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return Fg(this,e,o_(this,e,t,r))}moveByGroup(e,t){return Fg(this,e,o_(this,e,t,r=>mD(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[t?r.length-1:0];return ve.cursor(i.side(t,s)+e.from,i.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,r=!0){return pD(this,e,t,r)}moveVertically(e,t,r){return Fg(this,e,OD(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=WS(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),WS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),a=i[Li.find(i,e-s.from,-1,t)];return Yp(r,a.dir==Ft.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(NM)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>sB)return SM(e.length);let t=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||wM(i.isolates,r=s_(this,e))))return i.order;r||(r=s_(this,e));let s=zY(e.text,t,r);return this.bidiCache.push(new Gp(e.from,e.to,t,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ne.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{OM(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Mh.of(new sc(typeof e=="number"?ve.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Mh.of(new sc(ve.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ps.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ps.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=za.newName(),s=[Yh.of(r),Hu.of(FS(`.${r}`,e))];return t&&t.dark&&s.push(IS.of(!0)),s}static baseTheme(e){return Yl.lowest(Hu.of(FS("."+HS,e,nX)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),s=r&&wn.get(r)||wn.get(e);return((t=s==null?void 0:s.root)===null||t===void 0?void 0:t.view)||null}}Ae.styleModule=Hu;Ae.inputHandler=_M;Ae.clipboardInputFilter=fQ;Ae.clipboardOutputFilter=dQ;Ae.scrollHandler=CM;Ae.focusChangeEffect=PM;Ae.perLineTextDirection=NM;Ae.exceptionSink=jM;Ae.updateListener=BS;Ae.editable=Mi;Ae.mouseSelectionStyle=TM;Ae.dragMovesSelection=$M;Ae.clickAddsSelectionRange=kM;Ae.decorations=Lm;Ae.blockWrappers=AM;Ae.outerDecorations=pQ;Ae.atomicRanges=ed;Ae.bidiIsolatedRanges=qM;Ae.scrollMargins=MM;Ae.darkTheme=IS;Ae.cspNonce=qe.define({combine:n=>n.length?n[0]:""});Ae.contentAttributes=hQ;Ae.editorAttributes=EM;Ae.lineWrapping=Ae.contentAttributes.of({class:"cm-lineWrapping"});Ae.announce=Ct.define();const sB=4096,$_={};class Gp{constructor(e,t,r,s,i,a){this.from=e,this.to=t,this.dir=r,this.isolates=s,this.fresh=i,this.order=a}static update(e,t){if(t.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:Ft.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let a=e[i];a.dir==s&&!t.touchesRange(a.from,a.to)&&r.push(new Gp(t.mapPos(a.from,1),t.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function T_(n,e,t){for(let r=n.state.facet(e),s=r.length-1;s>=0;s--){let i=r[s],a=typeof i=="function"?i(n):i;a&&oQ(a,t)}return t}const iB=Ne.mac?"mac":Ne.windows?"win":Ne.linux?"linux":"key";function aB(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let s,i,a,o;for(let u=0;u<t.length-1;++u){const d=t[u];if(/^(cmd|meta|m)$/i.test(d))o=!0;else if(/^a(lt)?$/i.test(d))s=!0;else if(/^(c|ctrl|control)$/i.test(d))i=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+d)}return s&&(r="Alt-"+r),i&&(r="Ctrl-"+r),o&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Dh(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const lB=Yl.default(Ae.domEventHandlers({keydown(n,e){return fB(oB(e.state),n,e,"editor")}})),Cc=qe.define({enables:lB}),j_=new WeakMap;function oB(n){let e=n.facet(Cc),t=j_.get(e);return t||j_.set(e,t=uB(e.reduce((r,s)=>r.concat(s),[]))),t}let Pa=null;const cB=4e3;function uB(n,e=iB){let t=Object.create(null),r=Object.create(null),s=(a,o)=>{let u=r[a];if(u==null)r[a]=o;else if(u!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},i=(a,o,u,d,p)=>{var m,g;let x=t[a]||(t[a]=Object.create(null)),v=o.split(/ (?!$)/).map(Q=>aB(Q,e));for(let Q=1;Q<v.length;Q++){let k=v.slice(0,Q).join(" ");s(k,!0),x[k]||(x[k]={preventDefault:!0,stopPropagation:!1,run:[$=>{let j=Pa={view:$,prefix:k,scope:a};return setTimeout(()=>{Pa==j&&(Pa=null)},cB),!0}]})}let y=v.join(" ");s(y,!1);let S=x[y]||(x[y]={preventDefault:!1,stopPropagation:!1,run:((g=(m=x._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});u&&S.run.push(u),d&&(S.preventDefault=!0),p&&(S.stopPropagation=!0)};for(let a of n){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of o){let p=t[d]||(t[d]=Object.create(null));p._any||(p._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in p)p[g].run.push(x=>m(x,KS))}let u=a[e]||a.key;if(u)for(let d of o)i(d,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(d,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return t}let KS=null;function fB(n,e,t,r){KS=e;let s=wY(e),i=pl(s,0),a=Yo(i)==s.length&&s!=" ",o="",u=!1,d=!1,p=!1;Pa&&Pa.view==t&&Pa.scope==r&&(o=Pa.prefix+" ",UM.indexOf(e.keyCode)<0&&(d=!0,Pa=null));let m=new Set,g=S=>{if(S){for(let Q of S.run)if(!m.has(Q)&&(m.add(Q),Q(t)))return S.stopPropagation&&(p=!0),!0;S.preventDefault&&(S.stopPropagation&&(p=!0),d=!0)}return!1},x=n[r],v,y;return x&&(g(x[o+Dh(s,e,!a)])?u=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ne.windows&&e.ctrlKey&&e.altKey)&&!(Ne.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=La[e.keyCode])&&v!=s?(g(x[o+Dh(v,e,!0)])||e.shiftKey&&(y=Qf[e.keyCode])!=s&&y!=v&&g(x[o+Dh(y,e,!1)]))&&(u=!0):a&&e.shiftKey&&g(x[o+Dh(s,e,!0)])&&(u=!0),!u&&g(x._any)&&(u=!0)),d&&(u=!0),u&&p&&e.stopPropagation(),KS=null,u}function __(){return hB}const dB=Ut.line({class:"cm-activeLine"}),hB=Ps.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let s=n.lineBlockAt(r.head);s.from>e&&(t.push(dB.range(s.from)),e=s.from)}return Ut.set(t)}},{decorations:n=>n.decorations}),Bh="-10000px";class pB{constructor(e,t,r,s){this.facet=t,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(a=>a);let i=null;this.tooltipViews=this.tooltips.map(a=>i=r(a,i))}update(e,t){var r;let s=e.state.facet(this.facet),i=s.filter(u=>u);if(s===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let a=[],o=t?[]:null;for(let u=0;u<i.length;u++){let d=i[u],p=-1;if(d){for(let m=0;m<this.tooltips.length;m++){let g=this.tooltips[m];g&&g.create==d.create&&(p=m)}if(p<0)a[u]=this.createTooltipView(d,u?a[u-1]:null),o&&(o[u]=!!d.above);else{let m=a[u]=this.tooltipViews[p];o&&(o[u]=t[p]),m.update&&m.update(e)}}}for(let u of this.tooltipViews)a.indexOf(u)<0&&(this.removeTooltipView(u),(r=u.destroy)===null||r===void 0||r.call(u));return t&&(o.forEach((u,d)=>t[d]=u),t.length=o.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function mB(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const ex=qe.define({combine:n=>{var e,t,r;return{position:Ne.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||mB}}}),P_=new WeakMap,rX=Ps.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(ex);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new pB(n,sX,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(ex);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=Bh,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(Ne.safari){let a=i.getBoundingClientRect();t=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else t=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(n=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=mQ(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,a)=>{let o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(ex).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:t,space:r,scaleX:s,scaleY:i}=n,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let u=this.manager.tooltips[o],d=this.manager.tooltipViews[o],{dom:p}=d,m=n.pos[o],g=n.size[o];if(!m||u.clip!==!1&&(m.bottom<=Math.max(t.top,r.top)||m.top>=Math.min(t.bottom,r.bottom)||m.right<Math.max(t.left,r.left)-.1||m.left>Math.min(t.right,r.right)+.1)){p.style.top=Bh;continue}let x=u.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,v=x?7:0,y=g.right-g.left,S=(e=P_.get(d))!==null&&e!==void 0?e:g.bottom-g.top,Q=d.offset||gB,k=this.view.textDirection==Ft.LTR,$=g.width>r.right-r.left?k?r.left:r.right-g.width:k?Math.max(r.left,Math.min(m.left-(x?14:0)+Q.x,r.right-y)):Math.min(Math.max(r.left,m.left-y+(x?14:0)-Q.x),r.right-y),j=this.above[o];!u.strictSide&&(j?m.top-S-v-Q.y<r.top:m.bottom+S+v+Q.y>r.bottom)&&j==r.bottom-m.bottom>m.top-r.top&&(j=this.above[o]=!j);let T=(j?m.top-r.top:r.bottom-m.bottom)-v;if(T<S&&d.resize!==!1){if(T<this.view.defaultLineHeight){p.style.top=Bh;continue}P_.set(d,S),p.style.height=(S=T)/i+"px"}else p.style.height&&(p.style.height="");let R=j?m.top-S-v-Q.y:m.bottom+v+Q.y,N=$+y;if(d.overlap!==!0)for(let q of a)q.left<N&&q.right>$&&q.top<R+S&&q.bottom>R&&(R=j?q.top-S-2-v:q.bottom+v+2);if(this.position=="absolute"?(p.style.top=(R-n.parent.top)/i+"px",N_(p,($-n.parent.left)/s)):(p.style.top=R/i+"px",N_(p,$/s)),x){let q=m.left+(k?Q.x:-Q.x)-($+14-7);x.style.left=q/s+"px"}d.overlap!==!0&&a.push({left:$,top:R,right:N,bottom:R+S}),p.classList.toggle("cm-tooltip-above",j),p.classList.toggle("cm-tooltip-below",!j),d.positioned&&d.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Bh}},{eventObservers:{scroll(){this.maybeMeasure()}}});function N_(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const OB=Ae.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),gB={x:0,y:0},sX=qe.define({enables:[rX,OB]});function iX(n,e){let t=n.plugin(rX);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}class ql extends Xa{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ql.prototype.elementClass="";ql.prototype.toDOM=void 0;ql.prototype.mapMode=Kn.TrackBefore;ql.prototype.startSide=ql.prototype.endSide=-1;ql.prototype.point=!0;const tx=qe.define(),xB=qe.define(),wp=qe.define(),C_=qe.define({combine:n=>n.some(e=>e)});function bB(n){return[yB]}const yB=Ps.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(wp).map(e=>new E_(n,e)),this.fixed=!n.state.facet(C_);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(C_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=ft.iter(this.view.state.facet(tx),this.view.viewport.from),r=[],s=this.gutters.map(i=>new vB(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let a=!0;for(let o of i.type)if(o.type==Or.Text&&a){JS(t,r,o.from);for(let u of s)u.line(this.view,o,r);a=!1}else if(o.widget)for(let u of s)u.widget(this.view,o)}else if(i.type==Or.Text){JS(t,r,i.from);for(let a of s)a.line(this.view,i,r)}else if(i.widget)for(let a of s)a.widget(this.view,i);for(let i of s)i.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(wp),t=n.state.facet(wp),r=n.docChanged||n.heightChanged||n.viewportChanged||!ft.eq(n.startState.facet(tx),n.state.facet(tx),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(r=!0);else{r=!0;let s=[];for(let i of t){let a=e.indexOf(i);a<0?s.push(new E_(this.view,i)):(this.gutters[a].update(n),s.push(this.gutters[a]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>Ae.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ft.LTR?{left:r,right:s}:{right:r,left:s}})});function R_(n){return Array.isArray(n)?n:[n]}function JS(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class vB{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ft.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:s}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==s.elements.length){let o=new aX(e,a,i,r);s.elements.push(o),s.dom.appendChild(o.dom)}else s.elements[this.i].update(e,a,i,r);this.height=t.bottom,this.i++}line(e,t,r){let s=[];JS(this.cursor,s,t.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,t,s);i&&s.unshift(i);let a=this.gutter;s.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),s=r?[r]:null;for(let i of e.state.facet(xB)){let a=i(e,t.widget,t);a&&(s||(s=[])).push(a)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class E_{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let u=i.getBoundingClientRect();a=(u.top+u.bottom)/2}else a=s.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[r](e,o,s)&&s.preventDefault()});this.markers=R_(t.markers(e)),t.initialSpacer&&(this.spacer=new aX(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=R_(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!ft.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class aX{constructor(e,t,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,s)}update(e,t,r,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),wB(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,a=0;;){let o=a,u=i<t.length?t[i++]:null,d=!1;if(u){let p=u.elementClass;p&&(r+=" "+p);for(let m=a;m<this.markers.length;m++)if(this.markers[m].compare(u)){o=m,d=!0;break}}else o=this.markers.length;for(;a<o;){let p=this.markers[a++];if(p.toDOM){p.destroy(s);let m=s.nextSibling;s.remove(),s=m}}if(!u)break;u.toDOM&&(d?s=s.nextSibling:this.dom.insertBefore(u.toDOM(e),s)),d&&a++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function wB(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const SB=qe.define(),QB=qe.define(),Io=qe.define({combine(n){return iQ(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let s in t){let i=r[s],a=t[s];r[s]=i?(o,u,d)=>i(o,u,d)||a(o,u,d):a}return r}})}});class nx extends ql{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function rx(n,e){return n.state.facet(Io).formatNumber(e,n.state)}const kB=wp.compute([Io],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(SB)},lineMarker(e,t,r){return r.some(s=>s.toDOM)?null:new nx(rx(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let s of e.state.facet(QB)){let i=s(e,t,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Io)!=e.state.facet(Io),initialSpacer(e){return new nx(rx(e,q_(e.state.doc.lines)))},updateSpacer(e,t){let r=rx(t.view,q_(t.view.state.doc.lines));return r==e.number?e:new nx(r)},domEventHandlers:n.facet(Io).domEventHandlers,side:"before"}));function A_(n={}){return[Io.of(n),bB(),kB]}function q_(n){let e=9;for(;e<n;)e=e*10+9;return e}const lX=1024;let $B=0;class Ir{constructor(e,t){this.from=e,this.to=t}}class Ue{constructor(e={}){this.id=$B++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Pn.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}Ue.closedBy=new Ue({deserialize:n=>n.split(" ")});Ue.openedBy=new Ue({deserialize:n=>n.split(" ")});Ue.group=new Ue({deserialize:n=>n.split(" ")});Ue.isolate=new Ue({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Ue.contextHash=new Ue({perNode:!0});Ue.lookAhead=new Ue({perNode:!0});Ue.mounted=new Ue({perNode:!0});class ic{constructor(e,t,r,s=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=s}static get(e){return e&&e.props&&e.props[Ue.mounted.id]}}const TB=Object.create(null);class Pn{constructor(e,t,r,s=0){this.name=e,this.props=t,this.id=r,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):TB,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new Pn(e.name||"",t,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Ue.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let s of r.split(" "))t[s]=e[r];return r=>{for(let s=r.prop(Ue.group),i=-1;i<(s?s.length:0);i++){let a=t[i<0?r.name:s[i]];if(a)return a}}}}Pn.none=new Pn("",Object.create(null),0,8);class td{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let s=null;for(let i of e){let a=i(r);if(a){s||(s=Object.assign({},r.props));let o=a[1],u=a[0];u.combine&&u.id in s&&(o=u.combine(s[u.id],o)),s[u.id]=o}}t.push(s?new Pn(r.name,s,r.id,r.flags):r)}return new td(t)}}const Uh=new WeakMap,M_=new WeakMap;var vt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(vt||(vt={}));class wt{constructor(e,t,r,s,i){if(this.type=e,this.children=t,this.positions=r,this.length=s,this.props=null,i&&i.length){this.props=Object.create(null);for(let[a,o]of i)this.props[typeof a=="number"?a:a.id]=o}}toString(){let e=ic.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let s=r.toString();s&&(t&&(t+=","),t+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Ip(this.topNode,e)}cursorAt(e,t=0,r=0){let s=Uh.get(this)||this.topNode,i=new Ip(s);return i.moveTo(e,t),Uh.set(this,i._tree),i}get topNode(){return new ss(this,0,0,null)}resolve(e,t=0){let r=jf(Uh.get(this)||this.topNode,e,t,!1);return Uh.set(this,r),r}resolveInner(e,t=0){let r=jf(M_.get(this)||this.topNode,e,t,!0);return M_.set(this,r),r}resolveStack(e,t=0){return PB(this,e,t)}iterate(e){let{enter:t,leave:r,from:s=0,to:i=this.length}=e,a=e.mode||0,o=(a&vt.IncludeAnonymous)>0;for(let u=this.cursor(a|vt.IncludeAnonymous);;){let d=!1;if(u.from<=i&&u.to>=s&&(!o&&u.type.isAnonymous||t(u)!==!1)){if(u.firstChild())continue;d=!0}for(;d&&r&&(o||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:vQ(Pn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,s)=>new wt(this.type,t,r,s,this.propValues),e.makeTree||((t,r,s)=>new wt(Pn.none,t,r,s)))}static build(e){return NB(e)}}wt.empty=new wt(Pn.none,[],[],0);class bQ{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new bQ(this.buffer,this.index)}}class Va{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Pn.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],s=this.set.types[t],i=s.name;if(/\W/.test(i)&&!s.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return i+"("+a.join(",")+")"}findChild(e,t,r,s,i){let{buffer:a}=this,o=-1;for(let u=e;u!=t&&!(oX(i,s,a[u+1],a[u+2])&&(o=u,r>0));u=a[u+3]);return o}slice(e,t,r){let s=this.buffer,i=new Uint16Array(t-e),a=0;for(let o=e,u=0;o<t;){i[u++]=s[o++],i[u++]=s[o++]-r;let d=i[u++]=s[o++]-r;i[u++]=s[o++]-e,a=Math.max(a,d)}return new Va(i,a,this.set)}}function oX(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function jf(n,e,t,r){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let a=!r&&n instanceof ss&&n.index<0?null:n.parent;if(!a)return n;n=a}let i=r?0:vt.IgnoreOverlays;if(r)for(let a=n,o=a.parent;o;a=o,o=a.parent)a instanceof ss&&a.index<0&&((s=o.enter(e,t,i))===null||s===void 0?void 0:s.from)!=a.from&&(n=o);for(;;){let a=n.enter(e,t,i);if(!a)return n;n=a}}class cX{cursor(e=0){return new Ip(this,e)}getChild(e,t=null,r=null){let s=X_(this,e,t,r);return s.length?s[0]:null}getChildren(e,t=null,r=null){return X_(this,e,t,r)}resolve(e,t=0){return jf(this,e,t,!1)}resolveInner(e,t=0){return jf(this,e,t,!0)}matchContext(e){return e2(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let s=t.lastChild;if(!s||s.to!=t.to)break;s.type.isError&&s.from==s.to?(r=t,t=s.prevSibling):t=s}return r}get node(){return this}get next(){return this.parent}}let ss=class Sp extends cX{constructor(e,t,r,s){super(),this._tree=e,this.from=t,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,s,i=0){var a;for(let o=this;;){for(let{children:u,positions:d}=o._tree,p=t>0?u.length:-1;e!=p;e+=t){let m=u[e],g=d[e]+o.from;if(!(!(i&vt.EnterBracketed&&m instanceof wt&&((a=ic.get(m))===null||a===void 0?void 0:a.overlay)===null&&(g>=r||g+m.length<=r))&&!oX(s,r,g,g+m.length))){if(m instanceof Va){if(i&vt.ExcludeBuffers)continue;let x=m.findChild(0,m.buffer.length,t,r-g,s);if(x>-1)return new Fs(new jB(o,m,e,g),null,x)}else if(i&vt.IncludeAnonymous||!m.type.isAnonymous||yQ(m)){let x;if(!(i&vt.IgnoreMounts)&&(x=ic.get(m))&&!x.overlay)return new Sp(x.tree,g,e,o);let v=new Sp(m,g,e,o);return i&vt.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(t<0?m.children.length-1:0,t,r,s,i)}}}if(i&vt.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let s;if(!(r&vt.IgnoreOverlays)&&(s=ic.get(this._tree))&&s.overlay){let i=e-this.from,a=r&vt.EnterBracketed&&s.bracketed;for(let{from:o,to:u}of s.overlay)if((t>0||a?o<=i:o<i)&&(t<0||a?u>=i:u>i))return new Sp(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function X_(n,e,t,r){let s=n.cursor(),i=[];if(!s.firstChild())return i;if(t!=null){for(let a=!1;!a;)if(a=s.type.is(t),!s.nextSibling())return i}for(;;){if(r!=null&&s.type.is(r))return i;if(s.type.is(e)&&i.push(s.node),!s.nextSibling())return r==null?i:[]}}function e2(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class jB{constructor(e,t,r,s){this.parent=e,this.buffer=t,this.index=r,this.start=s}}class Fs extends cX{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,r);return i<0?null:new Fs(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&vt.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new Fs(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Fs(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Fs(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let a=r.buffer[this.index+1];e.push(r.slice(s,i,a)),t.push(0)}return new wt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function uX(n){if(!n.length)return null;let e=0,t=n[0];for(let i=1;i<n.length;i++){let a=n[i];(a.from>t.from||a.to<t.to)&&(t=a,e=i)}let r=t instanceof ss&&t.index<0?null:t.parent,s=n.slice();return r?s[e]=r:s.splice(e,1),new _B(s,t)}class _B{constructor(e,t){this.heads=e,this.node=t}get next(){return uX(this.heads)}}function PB(n,e,t){let r=n.resolveInner(e,t),s=null;for(let i=r instanceof ss?r:r.context.parent;i;i=i.parent)if(i.index<0){let a=i.parent;(s||(s=[r])).push(a.resolve(e,t)),i=a}else{let a=ic.get(i.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let o=new ss(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(jf(o,e,t,!1))}}return s?uX(s):r}class Ip{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~vt.EnterBracketed,e instanceof ss)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof ss?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&vt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&vt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&vt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(s.buffer.buffer[i+3]<this.index)return!1;({index:t,parent:r}=s)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let i=t+e,a=e<0?-1:r._tree.children.length;i!=a;i+=e){let o=r._tree.children[i];if(this.mode&vt.IncludeAnonymous||o instanceof Va||!o.type.isAnonymous||yQ(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let s=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==s){if(s==this.index)return a;t=a,r=i+1;break e}s=this.stack[--i]}for(let s=r;s<this.stack.length;s++)t=new Fs(this.buffer,t,this.stack[s]);return this.bufferNode=new Fs(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&t&&t(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return e2(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let s=e.length-1,i=this.stack.length-1;s>=0;i--){if(i<0)return e2(this._tree,e,s);let a=r[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}}function yQ(n){return n.children.some(e=>e instanceof Va||!e.type.isAnonymous||yQ(e))}function NB(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:s=lX,reused:i=[],minRepeatType:a=r.types.length}=n,o=Array.isArray(t)?new bQ(t,t.length):t,u=r.types,d=0,p=0;function m(T,R,N,q,z,L){let{id:E,start:V,end:B,size:C}=o,G=p,A=d;if(C<0)if(o.next(),C==-1){let X=i[E];N.push(X),q.push(V-T);return}else if(C==-3){d=E;return}else if(C==-4){p=E;return}else throw new RangeError(`Unrecognized record size: ${C}`);let U=u[E],H,W,J=V-T;if(B-V<=s&&(W=S(o.pos-R,z))){let X=new Uint16Array(W.size-W.skip),D=o.pos-W.size,ee=X.length;for(;o.pos>D;)ee=Q(W.start,X,ee);H=new Va(X,B-W.start,r),J=W.start-T}else{let X=o.pos-C;o.next();let D=[],ee=[],Z=E>=a?E:-1,I=0,K=B;for(;o.pos>X;)Z>=0&&o.id==Z&&o.size>=0?(o.end<=K-s&&(v(D,ee,V,I,o.end,K,Z,G,A),I=D.length,K=o.end),o.next()):L>2500?g(V,X,D,ee):m(V,X,D,ee,Z,L+1);if(Z>=0&&I>0&&I<D.length&&v(D,ee,V,I,V,K,Z,G,A),D.reverse(),ee.reverse(),Z>-1&&I>0){let re=x(U,A);H=vQ(U,D,ee,0,D.length,0,B-V,re,re)}else H=y(U,D,ee,B-V,G-B,A)}N.push(H),q.push(J)}function g(T,R,N,q){let z=[],L=0,E=-1;for(;o.pos>R;){let{id:V,start:B,end:C,size:G}=o;if(G>4)o.next();else{if(E>-1&&B<E)break;E<0&&(E=C-s),z.push(V,B,C),L++,o.next()}}if(L){let V=new Uint16Array(L*4),B=z[z.length-2];for(let C=z.length-3,G=0;C>=0;C-=3)V[G++]=z[C],V[G++]=z[C+1]-B,V[G++]=z[C+2]-B,V[G++]=G;N.push(new Va(V,z[2]-B,r)),q.push(B-T)}}function x(T,R){return(N,q,z)=>{let L=0,E=N.length-1,V,B;if(E>=0&&(V=N[E])instanceof wt){if(!E&&V.type==T&&V.length==z)return V;(B=V.prop(Ue.lookAhead))&&(L=q[E]+V.length+B)}return y(T,N,q,z,L,R)}}function v(T,R,N,q,z,L,E,V,B){let C=[],G=[];for(;T.length>q;)C.push(T.pop()),G.push(R.pop()+N-z);T.push(y(r.types[E],C,G,L-z,V-L,B)),R.push(z-N)}function y(T,R,N,q,z,L,E){if(L){let V=[Ue.contextHash,L];E=E?[V].concat(E):[V]}if(z>25){let V=[Ue.lookAhead,z];E=E?[V].concat(E):[V]}return new wt(T,R,N,q,E)}function S(T,R){let N=o.fork(),q=0,z=0,L=0,E=N.end-s,V={size:0,start:0,skip:0};e:for(let B=N.pos-T;N.pos>B;){let C=N.size;if(N.id==R&&C>=0){V.size=q,V.start=z,V.skip=L,L+=4,q+=4,N.next();continue}let G=N.pos-C;if(C<0||G<B||N.start<E)break;let A=N.id>=a?4:0,U=N.start;for(N.next();N.pos>G;){if(N.size<0)if(N.size==-3||N.size==-4)A+=4;else break e;else N.id>=a&&(A+=4);N.next()}z=U,q+=C,L+=A}return(R<0||q==T)&&(V.size=q,V.start=z,V.skip=L),V.size>4?V:void 0}function Q(T,R,N){let{id:q,start:z,end:L,size:E}=o;if(o.next(),E>=0&&q<a){let V=N;if(E>4){let B=o.pos-(E-4);for(;o.pos>B;)N=Q(T,R,N)}R[--N]=V,R[--N]=L-T,R[--N]=z-T,R[--N]=q}else E==-3?d=q:E==-4&&(p=q);return N}let k=[],$=[];for(;o.pos>0;)m(n.start||0,n.bufferStart||0,k,$,-1,0);let j=(e=n.length)!==null&&e!==void 0?e:k.length?$[0]+k[0].length:0;return new wt(u[n.topID],k.reverse(),$.reverse(),j)}const z_=new WeakMap;function Qp(n,e){if(!n.isAnonymous||e instanceof Va||e.type!=n)return 1;let t=z_.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof wt)){t=1;break}t+=Qp(n,r)}z_.set(e,t)}return t}function vQ(n,e,t,r,s,i,a,o,u){let d=0;for(let v=r;v<s;v++)d+=Qp(n,e[v]);let p=Math.ceil(d*1.5/8),m=[],g=[];function x(v,y,S,Q,k){for(let $=S;$<Q;){let j=$,T=y[$],R=Qp(n,v[$]);for($++;$<Q;$++){let N=Qp(n,v[$]);if(R+N>=p)break;R+=N}if($==j+1){if(R>p){let N=v[j];x(N.children,N.positions,0,N.children.length,y[j]+k);continue}m.push(v[j])}else{let N=y[$-1]+v[$-1].length-T;m.push(vQ(n,v,y,j,$,T,N,null,u))}g.push(T+k-i)}}return x(e,t,r,s,0),(o||u)(m,g,a)}class wQ{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof Fs?this.setBuffer(e.context.buffer,e.index,t):e instanceof ss&&this.map.set(e.tree,t)}get(e){return e instanceof Fs?this.getBuffer(e.context.buffer,e.index):e instanceof ss?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Yi{constructor(e,t,r,s,i=!1,a=!1){this.from=e,this.to=t,this.tree=r,this.offset=s,this.open=(i?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let s=[new Yi(0,e.length,e,0,!1,r)];for(let i of t)i.to>e.length&&s.push(i);return s}static applyChanges(e,t,r=128){if(!t.length)return e;let s=[],i=1,a=e.length?e[0]:null;for(let o=0,u=0,d=0;;o++){let p=o<t.length?t[o]:null,m=p?p.fromA:1e9;if(m-u>=r)for(;a&&a.from<m;){let g=a;if(u>=g.from||m<=g.to||d){let x=Math.max(g.from,u)-d,v=Math.min(g.to,m)-d;g=x>=v?null:new Yi(x,v,g.tree,g.offset+d,o>0,!!p)}if(g&&s.push(g),a.to>m)break;a=i<e.length?e[i++]:null}if(!p)break;u=p.toA,d=p.toA-p.toB}return s}}class SQ{startParse(e,t,r){return typeof e=="string"&&(e=new CB(e)),r=r?r.length?r.map(s=>new Ir(s.from,s.to)):[new Ir(0,0)]:[new Ir(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let s=this.startParse(e,t,r);for(;;){let i=s.advance();if(i)return i}}}class CB{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function fX(n){return(e,t,r,s)=>new EB(e,n,t,r,s)}class L_{constructor(e,t,r,s,i,a){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=s,this.target=i,this.from=a}}function Z_(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class RB{constructor(e,t,r,s,i,a,o,u){this.parser=e,this.predicate=t,this.mounts=r,this.index=s,this.start=i,this.bracketed=a,this.target=o,this.prev=u,this.depth=0,this.ranges=[]}}const t2=new Ue({perNode:!0});class EB{constructor(e,t,r,s,i){this.nest=t,this.input=r,this.fragments=s,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new wt(r.type,r.children,r.positions,r.length,r.propValues.concat([[t2,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Ue.mounted.id]=new ic(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new MB(this.fragments),t=null,r=null,s=new Ip(new ss(this.baseTree,this.ranges[0].from,0,null),vt.IncludeAnonymous|vt.IgnoreMounts);e:for(let i,a;;){let o=!0,u;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)o=!1;else if(e.hasNode(s)){if(t){let d=t.mounts.find(p=>p.frag.from<=s.from&&p.frag.to>=s.to&&p.mount.overlay);if(d)for(let p of d.mount.overlay){let m=p.from+d.pos,g=p.to+d.pos;m>=s.from&&g<=s.to&&!t.ranges.some(x=>x.from<g&&x.to>m)&&t.ranges.push({from:m,to:g})}}o=!1}else if(r&&(a=AB(r.ranges,s.from,s.to)))o=a!=2;else if(!s.type.isAnonymous&&(i=this.nest(s,this.input))&&(s.from<s.to||!i.overlay)){s.tree||(qB(s),t&&t.depth++,r&&r.depth++);let d=e.findMounts(s.from,i.parser);if(typeof i.overlay=="function")t=new RB(i.parser,i.overlay,d,this.inner.length,s.from,!!i.bracketed,s.tree,t);else{let p=D_(this.ranges,i.overlay||(s.from<s.to?[new Ir(s.from,s.to)]:[]));p.length&&Z_(p),(p.length||!i.overlay)&&this.inner.push(new L_(i.parser,p.length?i.parser.startParse(this.input,B_(d,p),p):i.parser.startParse(""),i.overlay?i.overlay.map(m=>new Ir(m.from-s.from,m.to-s.from)):null,!!i.bracketed,s.tree,p.length?p[0].from:s.from)),i.overlay?p.length&&(r={ranges:p,depth:0,prev:r}):o=!1}}else if(t&&(u=t.predicate(s))&&(u===!0&&(u=new Ir(s.from,s.to)),u.from<u.to)){let d=t.ranges.length-1;d>=0&&t.ranges[d].to==u.from?t.ranges[d]={from:t.ranges[d].from,to:u.to}:t.ranges.push(u)}if(o&&s.firstChild())t&&t.depth++,r&&r.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(t&&!--t.depth){let d=D_(this.ranges,t.ranges);d.length&&(Z_(d),this.inner.splice(t.index,0,new L_(t.parser,t.parser.startParse(this.input,B_(t.mounts,d),d),t.ranges.map(p=>new Ir(p.from-t.start,p.to-t.start)),t.bracketed,t.target,d[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function AB(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function V_(n,e,t,r,s,i){if(e<t){let a=n.buffer[e+1];r.push(n.slice(e,t,a)),s.push(a-i)}}function qB(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let s=n.tree,i=s.children.indexOf(r),a=s.children[i],o=a.buffer,u=[i];function d(p,m,g,x,v,y){let S=t[y],Q=[],k=[];V_(a,p,S,Q,k,x);let $=o[S+1],j=o[S+2];u.push(Q.length);let T=y?d(S+4,o[S+3],a.set.types[o[S]],$,j-$,y-1):e.toTree();return Q.push(T),k.push($-x),V_(a,o[S+3],m,Q,k,x),new wt(g,Q,k,v)}s.children[i]=d(0,o.length,Pn.none,0,a.length,t.length-1);for(let p of u){let m=n.tree.children[p],g=n.tree.positions[p];n.yield(new ss(m,g+n.from,p,n._tree))}}class Y_{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(vt.IncludeAnonymous|vt.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,vt.IgnoreOverlays|vt.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof wt)t=t.children[0];else break}return!1}}let MB=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(t2))!==null&&t!==void 0?t:r.to,this.inner=new Y_(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(t2))!==null&&e!==void 0?e:t.to,this.inner=new Y_(t.tree,-t.offset)}}findMounts(e,t){var r;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let i=this.inner.cursor.node;i;i=i.parent){let a=(r=i.tree)===null||r===void 0?void 0:r.prop(Ue.mounted);if(a&&a.parser==t)for(let o=this.fragI;o<this.fragments.length;o++){let u=this.fragments[o];if(u.from>=i.to)break;u.tree==this.curFrag.tree&&s.push({frag:u,pos:i.from-u.offset,mount:a})}}}return s}};function D_(n,e){let t=null,r=e;for(let s=1,i=0;s<n.length;s++){let a=n[s-1].to,o=n[s].from;for(;i<r.length;i++){let u=r[i];if(u.from>=o)break;u.to<=a||(t||(r=t=e.slice()),u.from<a?(t[i]=new Ir(u.from,a),u.to>o&&t.splice(i+1,0,new Ir(o,u.to))):u.to>o?t[i--]=new Ir(o,u.to):t.splice(i--,1))}}return r}function XB(n,e,t,r){let s=0,i=0,a=!1,o=!1,u=-1e9,d=[];for(;;){let p=s==n.length?1e9:a?n[s].to:n[s].from,m=i==e.length?1e9:o?e[i].to:e[i].from;if(a!=o){let g=Math.max(u,t),x=Math.min(p,m,r);g<x&&d.push(new Ir(g,x))}if(u=Math.min(p,m),u==1e9)break;p==u&&(a?(a=!1,s++):a=!0),m==u&&(o?(o=!1,i++):o=!0)}return d}function B_(n,e){let t=[];for(let{pos:r,mount:s,frag:i}of n){let a=r+(s.overlay?s.overlay[0].from:0),o=a+s.tree.length,u=Math.max(i.from,a),d=Math.min(i.to,o);if(s.overlay){let p=s.overlay.map(g=>new Ir(g.from+r,g.to+r)),m=XB(e,p,u,d);for(let g=0,x=u;;g++){let v=g==m.length,y=v?d:m[g].from;if(y>x&&t.push(new Yi(x,y,s.tree,-a,i.from>=x||i.openStart,i.to<=y||i.openEnd)),v)break;x=m[g].to}}else t.push(new Yi(u,d,s.tree,-a,i.from>=a||i.openStart,i.to<=o||i.openEnd))}return t}let zB=0;class Er{constructor(e,t,r,s){this.name=e,this.set=t,this.base=r,this.modified=s,this.id=zB++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Er&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let s=new Er(r,[],null,[]);if(s.set.push(s),t)for(let i of t.set)s.set.push(i);return s}static defineModifier(e){let t=new Hp(e);return r=>r.modified.indexOf(t)>-1?r:Hp.get(r.base||r,r.modified.concat(t).sort((s,i)=>s.id-i.id))}}let LB=0;class Hp{constructor(e){this.name=e,this.instances=[],this.id=LB++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(o=>o.base==e&&ZB(t,o.modified));if(r)return r;let s=[],i=new Er(e.name,s,e,t);for(let o of t)o.instances.push(i);let a=VB(t);for(let o of e.set)if(!o.modified.length)for(let u of a)s.push(Hp.get(o,u));return i}}function ZB(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function VB(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function Ua(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let s of t.split(" "))if(s){let i=[],a=2,o=s;for(let m=0;;){if(o=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!g)throw new RangeError("Invalid path: "+s);if(i.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let x=s[m++];if(m==s.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+s);o=s.slice(m)}let u=i.length-1,d=i[u];if(!d)throw new RangeError("Invalid path: "+s);let p=new _f(r,a,u>0?i.slice(0,u):null);e[d]=p.sort(e[d])}}return dX.add(e)}const dX=new Ue({combine(n,e){let t,r,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let i=new _f(s.tags,s.mode,s.context);t?t.next=i:r=i,t=i}return r}});class _f{constructor(e,t,r,s){this.tags=e,this.mode=t,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}_f.empty=new _f([],2,null);function hX(n,e){let t=Object.create(null);for(let i of n)if(!Array.isArray(i.tag))t[i.tag.id]=i.class;else for(let a of i.tag)t[a.id]=i.class;let{scope:r,all:s=null}=e||{};return{style:i=>{let a=s;for(let o of i)for(let u of o.set){let d=t[u.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function YB(n,e){let t=null;for(let r of n){let s=r.style(e);s&&(t=t?t+" "+s:s)}return t}function DB(n,e,t,r=0,s=n.length){let i=new BB(r,Array.isArray(e)?e:[e],t);i.highlightRange(n.cursor(),r,s,"",i.highlighters),i.flush(s)}class BB{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,s,i){let{type:a,from:o,to:u}=e;if(o>=r||u<=t)return;a.isTop&&(i=this.highlighters.filter(x=>!x.scope||x.scope(a)));let d=s,p=UB(e)||_f.empty,m=YB(i,p.tags);if(m&&(d&&(d+=" "),d+=m,p.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(t,o),d),p.opaque)return;let g=e.tree&&e.tree.prop(Ue.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+o,1),v=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),y=e.firstChild();for(let S=0,Q=o;;S++){let k=S<g.overlay.length?g.overlay[S]:null,$=k?k.from+o:u,j=Math.max(t,Q),T=Math.min(r,$);if(j<T&&y)for(;e.from<T&&(this.highlightRange(e,j,T,s,i),this.startSpan(Math.min(T,e.to),d),!(e.to>=$||!e.nextSibling())););if(!k||$>r)break;Q=k.to+o,Q>t&&(this.highlightRange(x.cursor(),Math.max(t,k.from+o),Math.min(r,Q),"",v),this.startSpan(Math.min(r,Q),d))}y&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,s,i),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function UB(n){let e=n.type.prop(dX);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const je=Er.define,Wh=je(),$a=je(),U_=je($a),W_=je($a),Ta=je(),Gh=je(Ta),sx=je(Ta),Gs=je(),hl=je(Gs),Us=je(),Ws=je(),n2=je(),qu=je(n2),Ih=je(),Y={comment:Wh,lineComment:je(Wh),blockComment:je(Wh),docComment:je(Wh),name:$a,variableName:je($a),typeName:U_,tagName:je(U_),propertyName:W_,attributeName:je(W_),className:je($a),labelName:je($a),namespace:je($a),macroName:je($a),literal:Ta,string:Gh,docString:je(Gh),character:je(Gh),attributeValue:je(Gh),number:sx,integer:je(sx),float:je(sx),bool:je(Ta),regexp:je(Ta),escape:je(Ta),color:je(Ta),url:je(Ta),keyword:Us,self:je(Us),null:je(Us),atom:je(Us),unit:je(Us),modifier:je(Us),operatorKeyword:je(Us),controlKeyword:je(Us),definitionKeyword:je(Us),moduleKeyword:je(Us),operator:Ws,derefOperator:je(Ws),arithmeticOperator:je(Ws),logicOperator:je(Ws),bitwiseOperator:je(Ws),compareOperator:je(Ws),updateOperator:je(Ws),definitionOperator:je(Ws),typeOperator:je(Ws),controlOperator:je(Ws),punctuation:n2,separator:je(n2),bracket:qu,angleBracket:je(qu),squareBracket:je(qu),paren:je(qu),brace:je(qu),content:Gs,heading:hl,heading1:je(hl),heading2:je(hl),heading3:je(hl),heading4:je(hl),heading5:je(hl),heading6:je(hl),contentSeparator:je(Gs),list:je(Gs),quote:je(Gs),emphasis:je(Gs),strong:je(Gs),link:je(Gs),monospace:je(Gs),strikethrough:je(Gs),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:Ih,documentMeta:je(Ih),annotation:je(Ih),processingInstruction:je(Ih),definition:Er.defineModifier("definition"),constant:Er.defineModifier("constant"),function:Er.defineModifier("function"),standard:Er.defineModifier("standard"),local:Er.defineModifier("local"),special:Er.defineModifier("special")};for(let n in Y){let e=Y[n];e instanceof Er&&(e.name=n)}hX([{tag:Y.link,class:"tok-link"},{tag:Y.heading,class:"tok-heading"},{tag:Y.emphasis,class:"tok-emphasis"},{tag:Y.strong,class:"tok-strong"},{tag:Y.keyword,class:"tok-keyword"},{tag:Y.atom,class:"tok-atom"},{tag:Y.bool,class:"tok-bool"},{tag:Y.url,class:"tok-url"},{tag:Y.labelName,class:"tok-labelName"},{tag:Y.inserted,class:"tok-inserted"},{tag:Y.deleted,class:"tok-deleted"},{tag:Y.literal,class:"tok-literal"},{tag:Y.string,class:"tok-string"},{tag:Y.number,class:"tok-number"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],class:"tok-string2"},{tag:Y.variableName,class:"tok-variableName"},{tag:Y.local(Y.variableName),class:"tok-variableName tok-local"},{tag:Y.definition(Y.variableName),class:"tok-variableName tok-definition"},{tag:Y.special(Y.variableName),class:"tok-variableName2"},{tag:Y.definition(Y.propertyName),class:"tok-propertyName tok-definition"},{tag:Y.typeName,class:"tok-typeName"},{tag:Y.namespace,class:"tok-namespace"},{tag:Y.className,class:"tok-className"},{tag:Y.macroName,class:"tok-macroName"},{tag:Y.propertyName,class:"tok-propertyName"},{tag:Y.operator,class:"tok-operator"},{tag:Y.comment,class:"tok-comment"},{tag:Y.meta,class:"tok-meta"},{tag:Y.invalid,class:"tok-invalid"},{tag:Y.punctuation,class:"tok-punctuation"}]);var ix;const Ql=new Ue;function QQ(n){return qe.define({combine:n?e=>e.concat(n):void 0})}const kQ=new Ue;class Hr{constructor(e,t,r=[],s=""){this.data=e,this.name=s,xt.prototype.hasOwnProperty("tree")||Object.defineProperty(xt.prototype,"tree",{get(){return Jt(this)}}),this.parser=t,this.extension=[xc.of(this),xt.languageData.of((i,a,o)=>{let u=G_(i,a,o),d=u.type.prop(Ql);if(!d)return[];let p=i.facet(d),m=u.type.prop(kQ);if(m){let g=u.resolve(a-u.from,o);for(let x of m)if(x.test(g,i)){let v=i.facet(x.facet);return x.type=="replace"?v:v.concat(p)}}return p})].concat(r)}isActiveAt(e,t,r=-1){return G_(e,t,r).type.prop(Ql)==this.data}findRegions(e){let t=e.facet(xc);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],s=(i,a)=>{if(i.prop(Ql)==this.data){r.push({from:a,to:a+i.length});return}let o=i.prop(Ue.mounted);if(o){if(o.tree.prop(Ql)==this.data){if(o.overlay)for(let u of o.overlay)r.push({from:u.from+a,to:u.to+a});else r.push({from:a,to:a+i.length});return}else if(o.overlay){let u=r.length;if(s(o.tree,o.overlay[0].from+a),r.length>u)return}}for(let u=0;u<i.children.length;u++){let d=i.children[u];d instanceof wt&&s(d,i.positions[u]+a)}};return s(Jt(e),0),r}get allowsNesting(){return!0}}Hr.setState=Ct.define();function G_(n,e,t){let r=n.facet(xc),s=Jt(n).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,t,vt.ExcludeBuffers|vt.EnterBracketed))i.type.isTop&&(s=i);return s}class Ya extends Hr{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=QQ(e.languageData);return new Ya(t,e.parser.configure({props:[Ql.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ya(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Jt(n){let e=n.field(Hr.state,!1);return e?e.tree:wt.empty}class WB{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Mu=null;class Pf{constructor(e,t,r=[],s,i,a,o,u){this.parser=e,this.state=t,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Pf(e,t,[],wt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new WB(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=wt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Yi.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Yi.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Mu;Mu=this;try{return e()}finally{Mu=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=I_(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:s,treeLen:i,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((d,p,m,g)=>u.push({fromA:d,toA:p,fromB:m,toB:g})),r=Yi.applyChanges(r,u),s=wt.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let d of this.skipped){let p=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);p<m&&o.push({from:p,to:m})}}}return new Pf(this.parser,t,r,s,i,a,o,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<e.to&&i>e.from&&(this.fragments=I_(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends SQ{createParse(t,r,s){let i=s[0].from,a=s[s.length-1].to;return{parsedPos:i,advance(){let u=Mu;if(u){for(let d of s)u.tempSkipped.push(d);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new wt(Pn.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Mu}}function I_(n,e,t){return Yi.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class gc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new gc(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Pf.create(e.facet(xc).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new gc(r)}}Hr.state=ii.define({create:gc.init,update(n,e){for(let t of e.effects)if(t.is(Hr.setState))return t.value;return e.startState.facet(xc)!=e.state.facet(xc)?gc.init(e.state):n.apply(e)}});let pX=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(pX=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const ax=typeof navigator<"u"&&(!((ix=navigator.scheduling)===null||ix===void 0)&&ix.isInputPending)?()=>navigator.scheduling.isInputPending():null,GB=Ps.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Hr.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Hr.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=pX(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(Hr.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!ax?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<s&&r.doc.length>s+1e3,u=i.context.work(()=>ax&&ax()||Date.now()>a,s+(o?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Hr.setState.of(new gc(i.context))})),this.chunkBudget>0&&!(u&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>qr(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),xc=qe.define({combine(n){return n.length?n[0]:null},enables:n=>[Hr.state,GB,Ae.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ml{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Fp{constructor(e,t,r,s,i,a=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=s,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new Fp(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let s of e)if(s.filename&&s.filename.test(t))return s;let r=/\.([^.]+)$/.exec(t);if(r){for(let s of e)if(s.extensions.indexOf(r[1])>-1)return s}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let s of e)if(s.alias.some(i=>i==t))return s;if(r)for(let s of e)for(let i of s.alias){let a=t.indexOf(i);if(a>-1&&(i.length>2||!/\w/.test(t[a-1])&&!/\w/.test(t[a+i.length])))return s}return null}}const IB=qe.define(),nd=qe.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Kp(n){let e=n.facet(nd);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Jp(n,e){let t="",r=n.tabSize,s=n.facet(nd)[0];if(s==" "){for(;e>=r;)t+=" ",e-=r;s=" "}for(let i=0;i<e;i++)t+=s;return t}function mX(n,e){n instanceof xt&&(n=new Dm(n));for(let r of n.state.facet(IB)){let s=r(n,e);if(s!==void 0)return s}let t=Jt(n.state);return t.length>=e?HB(n,t,e):null}class Dm{constructor(e,t={}){this.state=e,this.options=t,this.unit=Kp(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(t<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,t);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,t=1){let{text:r,from:s}=this.lineAt(e,t),i=this.countColumn(r,e-s),a=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return a>-1&&(i+=a-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,t=e.length){return Bi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:s}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let a=i(s);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Dl=new Ue;function HB(n,e,t){let r=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=r.node){let i=[];for(let a=s;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)i.push(a);for(let a=i.length-1;a>=0;a--)r={node:i[a],next:r}}return OX(r,n,t)}function OX(n,e,t){for(let r=n;r;r=r.next){let s=KB(r.node);if(s)return s($Q.create(e,t,r))}return 0}function FB(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function KB(n){let e=n.type.prop(Dl);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(Ue.closedBy))){let s=n.lastChild,i=s&&r.indexOf(s.name)>-1;return a=>gX(a,!0,1,void 0,i&&!FB(a)?s.from:void 0)}return n.parent==null?JB:null}function JB(){return 0}class $Q extends Dm{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new $Q(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(eU(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return OX(this.context.next,this.base,this.pos)}}function eU(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function tU(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,i=n.state.doc.lineAt(t.from),a=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let o=t.to;;){let u=e.childAfter(o);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=a)return null;let d=/^ */.exec(i.text.slice(t.to-i.from))[0].length;return{from:t.from,to:t.to+d}}o=u.to}}function hf({closing:n,align:e=!0,units:t=1}){return r=>gX(r,e,t,n)}function gX(n,e,t,r,s){let i=n.textAfter,a=i.match(/^\s*/)[0].length,o=r&&i.slice(a,a+r.length)==r||s==n.pos+a,u=e?tU(n):null;return u?o?n.column(u.from):n.column(u.to):n.baseIndent+(o?0:n.unit*t)}const xX=n=>n.baseIndent;function Tl({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const nU=qe.define(),Bl=new Ue;function Bm(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}class Um{constructor(e,t){this.specs=e;let r;function s(o){let u=za.newName();return(r||(r=Object.create(null)))["."+u]=o,u}const i=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,a=t.scope;this.scope=a instanceof Hr?o=>o.prop(Ql)==a.data:a?o=>o==a:void 0,this.style=hX(e.map(o=>({tag:o.tag,class:o.class||s(Object.assign({},o,{tag:null}))})),{all:i}).style,this.module=r?new za(r):null,this.themeType=t.themeType}static define(e,t){return new Um(e,t||{})}}const r2=qe.define(),rU=qe.define({combine(n){return n.length?[n[0]]:null}});function lx(n){let e=n.facet(r2);return e.length?e:n.facet(rU)}function sU(n,e){let t=[aU],r;return n instanceof Um&&(n.module&&t.push(Ae.styleModule.of(n.module)),r=n.themeType),r?t.push(r2.computeN([Ae.darkTheme],s=>s.facet(Ae.darkTheme)==(r=="dark")?[n]:[])):t.push(r2.of(n)),t}class iU{constructor(e){this.markCache=Object.create(null),this.tree=Jt(e.state),this.decorations=this.buildDeco(e,lx(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Jt(e.state),r=lx(e.state),s=r!=lx(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!s&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ut.none;let r=new wf;for(let{from:s,to:i}of e.visibleRanges)DB(this.tree,t,(a,o,u)=>{r.add(a,o,this.markCache[u]||(this.markCache[u]=Ut.mark({class:u})))},s,i);return r.finish()}}const aU=Yl.high(Ps.fromClass(iU,{decorations:n=>n.decorations})),lU=1e4,oU="()[]{}",bX=new Ue;function s2(n,e,t){let r=n.prop(e<0?Ue.openedBy:Ue.closedBy);if(r)return r;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function i2(n){let e=n.type.prop(bX);return e?e(n.node):n}function Ho(n,e,t,r={}){let s=r.maxScanDistance||lU,i=r.brackets||oU,a=Jt(n),o=a.resolveInner(e,t);for(let u=o;u;u=u.parent){let d=s2(u.type,t,i);if(d&&u.from<u.to){let p=i2(u);if(p&&(t>0?e>=p.from&&e<p.to:e>p.from&&e<=p.to))return cU(n,e,t,u,p,d,i)}}return uU(n,e,t,a,o.type,s,i)}function cU(n,e,t,r,s,i,a){let o=r.parent,u={from:s.from,to:s.to},d=0,p=o==null?void 0:o.cursor();if(p&&(t<0?p.childBefore(r.from):p.childAfter(r.to)))do if(t<0?p.to<=r.from:p.from>=r.to){if(d==0&&i.indexOf(p.type.name)>-1&&p.from<p.to){let m=i2(p);return{start:u,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(s2(p.type,t,a))d++;else if(s2(p.type,-t,a)){if(d==0){let m=i2(p);return{start:u,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}d--}}while(t<0?p.prevSibling():p.nextSibling());return{start:u,matched:!1}}function uU(n,e,t,r,s,i,a){let o=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),u=a.indexOf(o);if(u<0||u%2==0!=t>0)return null;let d={from:t<0?e-1:e,to:t>0?e+1:e},p=n.doc.iterRange(e,t>0?n.doc.length:0),m=0;for(let g=0;!p.next().done&&g<=i;){let x=p.value;t<0&&(g+=x.length);let v=e+g*t;for(let y=t>0?0:x.length-1,S=t>0?x.length:-1;y!=S;y+=t){let Q=a.indexOf(x[y]);if(!(Q<0||r.resolveInner(v+y,1).type!=s))if(Q%2==0==t>0)m++;else{if(m==1)return{start:d,end:{from:v+y,to:v+y+1},matched:Q>>1==u>>1};m--}}t>0&&(g+=x.length)}return p.done?{start:d,matched:!1}:null}const fU=Object.create(null),H_=[Pn.none],F_=[],K_=Object.create(null),dU=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])dU[n]=hU(fU,e);function ox(n,e){F_.indexOf(n)>-1||(F_.push(n),console.warn(e))}function hU(n,e){let t=[];for(let o of e.split(" ")){let u=[];for(let d of o.split(".")){let p=n[d]||Y[d];p?typeof p=="function"?u.length?u=u.map(p):ox(d,`Modifier ${d} used at start of tag`):u.length?ox(d,`Tag ${d} used as modifier`):u=Array.isArray(p)?p:[p]:ox(d,`Unknown highlighting tag ${d}`)}for(let d of u)t.push(d)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+t.map(o=>o.id),i=K_[s];if(i)return i.id;let a=K_[s]=Pn.define({id:H_.length,name:r,props:[Ua({[r]:t})]});return H_.push(a),a.id}Ft.RTL,Ft.LTR;const pU=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=jQ(n.state,t.from);return r.line?mU(n):r.block?gU(n):!1};function TQ(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(r(t.update(s)),!0):!1}}const mU=TQ(yU,0),OU=TQ(yX,0),gU=TQ((n,e)=>yX(n,e,bU(e)),0);function jQ(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Xu=50;function xU(n,{open:e,close:t},r,s){let i=n.sliceDoc(r-Xu,r),a=n.sliceDoc(s,s+Xu),o=/\s*$/.exec(i)[0].length,u=/^\s*/.exec(a)[0].length,d=i.length-o;if(i.slice(d-e.length,d)==e&&a.slice(u,u+t.length)==t)return{open:{pos:r-o,margin:o&&1},close:{pos:s+u,margin:u&&1}};let p,m;s-r<=2*Xu?p=m=n.sliceDoc(r,s):(p=n.sliceDoc(r,r+Xu),m=n.sliceDoc(s-Xu,s));let g=/^\s*/.exec(p)[0].length,x=/\s*$/.exec(m)[0].length,v=m.length-x-t.length;return p.slice(g,g+e.length)==e&&m.slice(v,v+t.length)==t?{open:{pos:r+g+e.length,margin:/\s/.test(p.charAt(g+e.length))?1:0},close:{pos:s-x-t.length,margin:/\s/.test(m.charAt(v-1))?1:0}}:null}function bU(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),s=t.to<=r.to?r:n.doc.lineAt(t.to);s.from>r.from&&s.from==t.to&&(s=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function yX(n,e,t=e.selection.ranges){let r=t.map(i=>jQ(e,i.from).block);if(!r.every(i=>i))return null;let s=t.map((i,a)=>xU(e,r[a],i.from,i.to));if(n!=2&&!s.every(i=>i))return{changes:e.changes(t.map((i,a)=>s[a]?[]:[{from:i.from,insert:r[a].open+" "},{from:i.to,insert:" "+r[a].close}]))};if(n!=1&&s.some(i=>i)){let i=[];for(let a=0,o;a<s.length;a++)if(o=s[a]){let u=r[a],{open:d,close:p}=o;i.push({from:d.pos-u.open.length,to:d.pos+d.margin},{from:p.pos-p.margin,to:p.pos+u.close.length})}return{changes:i}}return null}function yU(n,e,t=e.selection.ranges){let r=[],s=-1;for(let{from:i,to:a}of t){let o=r.length,u=1e9,d=jQ(e,i).line;if(d){for(let p=i;p<=a;){let m=e.doc.lineAt(p);if(m.from>s&&(i==a||a>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,x=g==m.length,v=m.text.slice(g,g+d.length)==d?g:-1;g<m.text.length&&g<u&&(u=g),r.push({line:m,comment:v,token:d,indent:g,empty:x,single:!1})}p=m.to+1}if(u<1e9)for(let p=o;p<r.length;p++)r[p].indent<r[p].line.text.length&&(r[p].indent=u);r.length==o+1&&(r[o].single=!0)}}if(n!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:o,token:u,indent:d,empty:p,single:m}of r)(m||!p)&&i.push({from:o.from+d,insert:u+" "});let a=e.changes(i);return{changes:a,selection:e.selection.map(a,1)}}else if(n!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:a,comment:o,token:u}of r)if(o>=0){let d=a.from+o,p=d+u.length;a.text[p-a.from]==" "&&p++,i.push({from:d,to:p})}return{changes:i}}return null}const a2=Hi.define(),vU=Hi.define(),wU=qe.define(),vX=qe.define({combine(n){return iQ(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,s)=>e(r,s)||t(r,s)})}}),wX=ii.define({create(){return Ks.empty},update(n,e){let t=e.state.facet(vX),r=e.annotation(a2);if(r){let u=pr.fromTransaction(e,r.selection),d=r.side,p=d==0?n.undone:n.done;return u?p=em(p,p.length,t.minDepth,u):p=kX(p,e.startState.selection),new Ks(d==0?r.rest:p,d==0?p:r.rest)}let s=e.annotation(vU);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(vn.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let i=pr.fromTransaction(e),a=e.annotation(vn.time),o=e.annotation(vn.userEvent);return i?n=n.addChanges(i,a,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,a,o,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ks(n.done.map(pr.fromJSON),n.undone.map(pr.fromJSON))}});function SU(n={}){return[wX,vX.of(n),Ae.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?SX:e.inputType=="historyRedo"?l2:null;return r?(e.preventDefault(),r(t)):!1}})]}function Wm(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let s=t.field(wX,!1);if(!s)return!1;let i=s.pop(n,t,e);return i?(r(i),!0):!1}}const SX=Wm(0,!1),l2=Wm(1,!1),QU=Wm(0,!0),kU=Wm(1,!0);class pr{constructor(e,t,r,s,i){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new pr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new pr(e.changes&&_n.fromJSON(e.changes),[],e.mapped&&ti.fromJSON(e.mapped),e.startSelection&&ve.fromJSON(e.startSelection),e.selectionsAfter.map(ve.fromJSON))}static fromTransaction(e,t){let r=Fr;for(let s of e.startState.facet(wU)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new pr(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Fr)}static selection(e){return new pr(void 0,Fr,void 0,void 0,e)}}function em(n,e,t,r){let s=e+1>t+20?e-t-1:0,i=n.slice(s,e);return i.push(r),i}function $U(n,e){let t=[],r=!1;return n.iterChangedRanges((s,i)=>t.push(s,i)),e.iterChangedRanges((s,i,a,o)=>{for(let u=0;u<t.length;){let d=t[u++],p=t[u++];o>=d&&a<=p&&(r=!0)}}),r}function TU(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function QX(n,e){return n.length?e.length?n.concat(e):n:e}const Fr=[],jU=200;function kX(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-jU));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),em(n,n.length-1,1e9,t.setSelAfter(r)))}else return[pr.selection([e])]}function _U(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function cx(n,e){if(!n.length)return n;let t=n.length,r=Fr;for(;t;){let s=PU(n[t-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=n.slice(0,t);return i[t-1]=s,i}else e=s.mapped,t--,r=s.selectionsAfter}return r.length?[pr.selection(r)]:Fr}function PU(n,e,t){let r=QX(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Fr,t);if(!n.changes)return pr.selection(r);let s=n.changes.map(e),i=e.mapDesc(n.changes,!0),a=n.mapped?n.mapped.composeDesc(i):i;return new pr(s,Ct.mapEffects(n.effects,e),a,n.startSelection.map(i),r)}const NU=/^(input\.type|delete)($|\.)/;class Ks{constructor(e,t,r=0,s=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Ks(this.done,this.undone):this}addChanges(e,t,r,s,i){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||NU.test(r))&&(!o.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,$U(o.changes,e.changes))||r=="input.type.compose")?a=em(a,a.length-1,s.minDepth,new pr(e.changes.compose(o.changes),QX(Ct.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,Fr)):a=em(a,a.length,s.minDepth,e),new Ks(a,Fr,t,r)}addSelection(e,t,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Fr;return i.length>0&&t-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&TU(i[i.length-1],e)?this:new Ks(kX(this.done,e),this.undone,t,r)}addMapping(e){return new Ks(cx(this.done,e),cx(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let i=s[s.length-1],a=i.selectionsAfter[0]||t.selection;if(r&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:a2.of({side:e,rest:_U(s),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let o=s.length==1?Fr:s.slice(0,s.length-1);return i.mapped&&(o=cx(o,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:a2.of({side:e,rest:o,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ks.empty=new Ks(Fr,Fr);const CU=[{key:"Mod-z",run:SX,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:l2,preventDefault:!0},{linux:"Ctrl-Shift-z",run:l2,preventDefault:!0},{key:"Mod-u",run:QU,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:kU,preventDefault:!0}];function Rc(n,e){return ve.create(n.ranges.map(e),n.mainIndex)}function Es(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function As({state:n,dispatch:e},t){let r=Rc(n.selection,t);return r.eq(n.selection,!0)?!1:(e(Es(n,r)),!0)}function Gm(n,e){return ve.cursor(e?n.to:n.from)}function $X(n,e){return As(n,t=>t.empty?n.moveByChar(t,e):Gm(t,e))}function Gn(n){return n.textDirectionAt(n.state.selection.main.head)==Ft.LTR}const TX=n=>$X(n,!Gn(n)),jX=n=>$X(n,Gn(n));function _X(n,e){return As(n,t=>t.empty?n.moveByGroup(t,e):Gm(t,e))}const RU=n=>_X(n,!Gn(n)),EU=n=>_X(n,Gn(n));function AU(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Im(n,e,t){let r=Jt(n).resolveInner(e.head),s=t?Ue.closedBy:Ue.openedBy;for(let u=e.head;;){let d=t?r.childAfter(u):r.childBefore(u);if(!d)break;AU(n,d,s)?r=d:u=t?d.to:d.from}let i=r.type.prop(s),a,o;return i&&(a=t?Ho(n,r.from,1):Ho(n,r.to,-1))&&a.matched?o=t?a.end.to:a.end.from:o=t?r.to:r.from,ve.cursor(o,t?-1:1)}const qU=n=>As(n,e=>Im(n.state,e,!Gn(n))),MU=n=>As(n,e=>Im(n.state,e,Gn(n)));function PX(n,e){return As(n,t=>{if(!t.empty)return Gm(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const NX=n=>PX(n,!1),CX=n=>PX(n,!0);function RX(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,s;if(e){for(let i of n.state.facet(Ae.scrollMargins)){let a=i(n);a!=null&&a.top&&(t=Math.max(a==null?void 0:a.top,t)),a!=null&&a.bottom&&(r=Math.max(a==null?void 0:a.bottom,r))}s=n.scrollDOM.clientHeight-t-r}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,s-5)}}function EX(n,e){let t=RX(n),{state:r}=n,s=Rc(r.selection,a=>a.empty?n.moveVertically(a,e,t.height):Gm(a,e));if(s.eq(r.selection))return!1;let i;if(t.selfScroll){let a=n.coordsAtPos(r.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),u=o.top+t.marginTop,d=o.bottom-t.marginBottom;a&&a.top>u&&a.bottom<d&&(i=Ae.scrollIntoView(s.main.head,{y:"start",yMargin:a.top-u}))}return n.dispatch(Es(r,s),{effects:i}),!0}const J_=n=>EX(n,!1),o2=n=>EX(n,!0);function Wa(n,e,t){let r=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?r.to:r.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==r.from&&r.length){let i=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=ve.cursor(r.from+i))}return s}const XU=n=>As(n,e=>Wa(n,e,!0)),zU=n=>As(n,e=>Wa(n,e,!1)),LU=n=>As(n,e=>Wa(n,e,!Gn(n))),ZU=n=>As(n,e=>Wa(n,e,Gn(n))),VU=n=>As(n,e=>ve.cursor(n.lineBlockAt(e.head).from,1)),YU=n=>As(n,e=>ve.cursor(n.lineBlockAt(e.head).to,-1));function DU(n,e,t){let r=!1,s=Rc(n.selection,i=>{let a=Ho(n,i.head,-1)||Ho(n,i.head,1)||i.head>0&&Ho(n,i.head-1,1)||i.head<n.doc.length&&Ho(n,i.head+1,-1);if(!a||!a.end)return i;r=!0;let o=a.start.from==i.head?a.end.to:a.end.from;return ve.cursor(o)});return r?(e(Es(n,s)),!0):!1}const BU=({state:n,dispatch:e})=>DU(n,e);function is(n,e){let t=Rc(n.state.selection,r=>{let s=e(r);return ve.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Es(n.state,t)),!0)}function AX(n,e){return is(n,t=>n.moveByChar(t,e))}const qX=n=>AX(n,!Gn(n)),MX=n=>AX(n,Gn(n));function XX(n,e){return is(n,t=>n.moveByGroup(t,e))}const UU=n=>XX(n,!Gn(n)),WU=n=>XX(n,Gn(n)),GU=n=>is(n,e=>Im(n.state,e,!Gn(n))),IU=n=>is(n,e=>Im(n.state,e,Gn(n)));function zX(n,e){return is(n,t=>n.moveVertically(t,e))}const LX=n=>zX(n,!1),ZX=n=>zX(n,!0);function VX(n,e){return is(n,t=>n.moveVertically(t,e,RX(n).height))}const eP=n=>VX(n,!1),tP=n=>VX(n,!0),HU=n=>is(n,e=>Wa(n,e,!0)),FU=n=>is(n,e=>Wa(n,e,!1)),KU=n=>is(n,e=>Wa(n,e,!Gn(n))),JU=n=>is(n,e=>Wa(n,e,Gn(n))),eW=n=>is(n,e=>ve.cursor(n.lineBlockAt(e.head).from)),tW=n=>is(n,e=>ve.cursor(n.lineBlockAt(e.head).to)),nP=({state:n,dispatch:e})=>(e(Es(n,{anchor:0})),!0),rP=({state:n,dispatch:e})=>(e(Es(n,{anchor:n.doc.length})),!0),sP=({state:n,dispatch:e})=>(e(Es(n,{anchor:n.selection.main.anchor,head:0})),!0),iP=({state:n,dispatch:e})=>(e(Es(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),nW=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),rW=({state:n,dispatch:e})=>{let t=Hm(n).map(({from:r,to:s})=>ve.range(r,Math.min(s+1,n.doc.length)));return e(n.update({selection:ve.create(t),userEvent:"select"})),!0},sW=({state:n,dispatch:e})=>{let t=Rc(n.selection,r=>{let s=Jt(n),i=s.resolveStack(r.from,1);if(r.empty){let a=s.resolveStack(r.from,-1);a.node.from>=i.node.from&&a.node.to<=i.node.to&&(i=a)}for(let a=i;a;a=a.next){let{node:o}=a;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return ve.range(o.to,o.from)}return r});return t.eq(n.selection)?!1:(e(Es(n,t)),!0)};function YX(n,e){let{state:t}=n,r=t.selection,s=t.selection.ranges.slice();for(let i of t.selection.ranges){let a=t.doc.lineAt(i.head);if(e?a.to<n.state.doc.length:a.from>0)for(let o=i;;){let u=n.moveVertically(o,e);if(u.head<a.from||u.head>a.to){s.some(d=>d.head==u.head)||s.push(u);break}else{if(u.head==o.head)break;o=u}}}return s.length==r.ranges.length?!1:(n.dispatch(Es(t,ve.create(s,s.length-1))),!0)}const iW=n=>YX(n,!1),aW=n=>YX(n,!0),lW=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=ve.create([t.main]):t.main.empty||(r=ve.create([ve.cursor(t.main.head)])),r?(e(Es(n,r)),!0):!1};function rd(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,s=r.changeByRange(i=>{let{from:a,to:o}=i;if(a==o){let u=e(i);u<a?(t="delete.backward",u=Hh(n,u,!1)):u>a&&(t="delete.forward",u=Hh(n,u,!0)),a=Math.min(a,u),o=Math.max(o,u)}else a=Hh(n,a,!1),o=Hh(n,o,!0);return a==o?{range:i}:{changes:{from:a,to:o},range:ve.cursor(a,a<i.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(r.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Ae.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Hh(n,e,t){if(n instanceof Ae)for(let r of n.state.facet(Ae.atomicRanges).map(s=>s(n)))r.between(e,e,(s,i)=>{s<e&&i>e&&(e=t?i:s)});return e}const DX=(n,e,t)=>rd(n,r=>{let s=r.from,{state:i}=n,a=i.doc.lineAt(s),o,u;if(t&&!e&&s>a.from&&s<a.from+200&&!/[^ \t]/.test(o=a.text.slice(0,s-a.from))){if(o[o.length-1]==" ")return s-1;let d=Bi(o,i.tabSize),p=d%Kp(i)||Kp(i);for(let m=0;m<p&&o[o.length-1-m]==" ";m++)s--;u=s}else u=Zn(a.text,s-a.from,e,e)+a.from,u==s&&a.number!=(e?i.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(u-a.from,s-a.from))&&(u=Zn(a.text,u-a.from,!1,!1)+a.from);return u}),c2=n=>DX(n,!1,!0),BX=n=>DX(n,!0,!1),UX=(n,e)=>rd(n,t=>{let r=t.head,{state:s}=n,i=s.doc.lineAt(r),a=s.charCategorizer(r);for(let o=null;;){if(r==(e?i.to:i.from)){r==t.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let u=Zn(i.text,r-i.from,e)+i.from,d=i.text.slice(Math.min(r,u)-i.from,Math.max(r,u)-i.from),p=a(d);if(o!=null&&p!=o)break;(d!=" "||r!=t.head)&&(o=p),r=u}return r}),WX=n=>UX(n,!1),oW=n=>UX(n,!0),cW=n=>rd(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),uW=n=>rd(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),fW=n=>rd(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),dW=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:dt.of(["",""])},range:ve.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},hW=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let s=r.from,i=n.doc.lineAt(s),a=s==i.from?s-1:Zn(i.text,s-i.from,!1)+i.from,o=s==i.to?s+1:Zn(i.text,s-i.from,!0)+i.from;return{changes:{from:a,to:o,insert:n.doc.slice(s,o).append(n.doc.slice(a,s))},range:ve.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Hm(n){let e=[],t=-1;for(let r of n.selection.ranges){let s=n.doc.lineAt(r.from),i=n.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=n.doc.lineAt(r.to-1)),t>=s.number){let a=e[e.length-1];a.to=i.to,a.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});t=i.number+1}return e}function GX(n,e,t){if(n.readOnly)return!1;let r=[],s=[];for(let i of Hm(n)){if(t?i.to==n.doc.length:i.from==0)continue;let a=n.doc.lineAt(t?i.to+1:i.from-1),o=a.length+1;if(t){r.push({from:i.to,to:a.to},{from:i.from,insert:a.text+n.lineBreak});for(let u of i.ranges)s.push(ve.range(Math.min(n.doc.length,u.anchor+o),Math.min(n.doc.length,u.head+o)))}else{r.push({from:a.from,to:i.from},{from:i.to,insert:n.lineBreak+a.text});for(let u of i.ranges)s.push(ve.range(u.anchor-o,u.head-o))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:ve.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const pW=({state:n,dispatch:e})=>GX(n,e,!1),mW=({state:n,dispatch:e})=>GX(n,e,!0);function IX(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of Hm(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});let s=n.changes(r);return e(n.update({changes:s,selection:n.selection.map(s,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const OW=({state:n,dispatch:e})=>IX(n,e,!1),gW=({state:n,dispatch:e})=>IX(n,e,!0),xW=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Hm(e).map(({from:s,to:i})=>(s>0?s--:i<e.doc.length&&i++,{from:s,to:i}))),r=Rc(e.selection,s=>{let i;if(n.lineWrapping){let a=n.lineBlockAt(s.head),o=n.coordsAtPos(s.head,s.assoc||1);o&&(i=a.bottom+n.documentTop-o.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,i)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function bW(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Jt(n).resolveInner(e),r=t.childBefore(e),s=t.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(Ue.closedBy))&&i.indexOf(s.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const aP=HX(!1),yW=HX(!0);function HX(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:a}=s,o=e.doc.lineAt(i),u=!n&&i==a&&bW(e,i);n&&(i=a=(a<=o.to?o:e.doc.lineAt(a)).to);let d=new Dm(e,{simulateBreak:i,simulateDoubleBreak:!!u}),p=mX(d,i);for(p==null&&(p=Bi(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));a<o.to&&/\s/.test(o.text[a-o.from]);)a++;u?{from:i,to:a}=u:i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let m=["",Jp(e,p)];return u&&m.push(Jp(e,d.lineIndent(o.from,-1))),{changes:{from:i,to:a,insert:dt.of(m)},range:ve.cursor(i+1+m[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function _Q(n,e){let t=-1;return n.changeByRange(r=>{let s=[];for(let a=r.from;a<=r.to;){let o=n.doc.lineAt(a);o.number>t&&(r.empty||r.to>o.from)&&(e(o,s,r),t=o.number),a=o.to+1}let i=n.changes(s);return{changes:s,range:ve.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const vW=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Dm(n,{overrideIndentation:i=>{let a=t[i];return a??-1}}),s=_Q(n,(i,a,o)=>{let u=mX(r,i.from);if(u==null)return;/\S/.test(i.text)||(u=0);let d=/^\s*/.exec(i.text)[0],p=Jp(n,u);(d!=p||o.from<i.from+d.length)&&(t[i.from]=u,a.push({from:i.from,to:i.from+d.length,insert:p}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},wW=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(_Q(n,(t,r)=>{r.push({from:t.from,insert:n.facet(nd)})}),{userEvent:"input.indent"})),!0),SW=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(_Q(n,(t,r)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let i=Bi(s,n.tabSize),a=0,o=Jp(n,Math.max(0,i-Kp(n)));for(;a<s.length&&a<o.length&&s.charCodeAt(a)==o.charCodeAt(a);)a++;r.push({from:t.from+a,to:t.from+s.length,insert:o.slice(a)})}),{userEvent:"delete.dedent"})),!0),QW=n=>(n.setTabFocusMode(),!0),kW=[{key:"Ctrl-b",run:TX,shift:qX,preventDefault:!0},{key:"Ctrl-f",run:jX,shift:MX},{key:"Ctrl-p",run:NX,shift:LX},{key:"Ctrl-n",run:CX,shift:ZX},{key:"Ctrl-a",run:VU,shift:eW},{key:"Ctrl-e",run:YU,shift:tW},{key:"Ctrl-d",run:BX},{key:"Ctrl-h",run:c2},{key:"Ctrl-k",run:cW},{key:"Ctrl-Alt-h",run:WX},{key:"Ctrl-o",run:dW},{key:"Ctrl-t",run:hW},{key:"Ctrl-v",run:o2}],$W=[{key:"ArrowLeft",run:TX,shift:qX,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:RU,shift:UU,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:LU,shift:KU,preventDefault:!0},{key:"ArrowRight",run:jX,shift:MX,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:EU,shift:WU,preventDefault:!0},{mac:"Cmd-ArrowRight",run:ZU,shift:JU,preventDefault:!0},{key:"ArrowUp",run:NX,shift:LX,preventDefault:!0},{mac:"Cmd-ArrowUp",run:nP,shift:sP},{mac:"Ctrl-ArrowUp",run:J_,shift:eP},{key:"ArrowDown",run:CX,shift:ZX,preventDefault:!0},{mac:"Cmd-ArrowDown",run:rP,shift:iP},{mac:"Ctrl-ArrowDown",run:o2,shift:tP},{key:"PageUp",run:J_,shift:eP},{key:"PageDown",run:o2,shift:tP},{key:"Home",run:zU,shift:FU,preventDefault:!0},{key:"Mod-Home",run:nP,shift:sP},{key:"End",run:XU,shift:HU,preventDefault:!0},{key:"Mod-End",run:rP,shift:iP},{key:"Enter",run:aP,shift:aP},{key:"Mod-a",run:nW},{key:"Backspace",run:c2,shift:c2,preventDefault:!0},{key:"Delete",run:BX,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:WX,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:oW,preventDefault:!0},{mac:"Mod-Backspace",run:uW,preventDefault:!0},{mac:"Mod-Delete",run:fW,preventDefault:!0}].concat(kW.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),TW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:qU,shift:GU},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:MU,shift:IU},{key:"Alt-ArrowUp",run:pW},{key:"Shift-Alt-ArrowUp",run:OW},{key:"Alt-ArrowDown",run:mW},{key:"Shift-Alt-ArrowDown",run:gW},{key:"Mod-Alt-ArrowUp",run:iW},{key:"Mod-Alt-ArrowDown",run:aW},{key:"Escape",run:lW},{key:"Mod-Enter",run:yW},{key:"Alt-l",mac:"Ctrl-l",run:rW},{key:"Mod-i",run:sW,preventDefault:!0},{key:"Mod-[",run:SW},{key:"Mod-]",run:wW},{key:"Mod-Alt-\\",run:vW},{key:"Shift-Mod-k",run:xW},{key:"Shift-Mod-\\",run:BU},{key:"Mod-/",run:pU},{key:"Alt-A",run:OU},{key:"Ctrl-m",mac:"Shift-Alt-m",run:QW}].concat($W);class PQ{constructor(e,t,r,s){this.state=e,this.pos=t,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Jt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),s=t.text.slice(r-t.from,this.pos-t.from),i=s.search(KX(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function lP(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function jW(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let i=1;i<s.length;i++)t[s[i]]=!0}let r=lP(e)+lP(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function NQ(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:jW(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:t}:null}}function FX(n,e){return t=>{for(let r=Jt(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class oP{constructor(e,t,r,s){this.completion=e,this.source=t,this.match=r,this.score=s}}function jl(n){return n.selection.main.from}function KX(n,e){var t;let{source:r}=n,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?n:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const CQ=Hi.define();function _W(n,e,t,r){let{main:s}=n.selection,i=t-s.from,a=r-s.from;return{...n.changeByRange(o=>{if(o!=s&&t!=r&&n.sliceDoc(o.from+i,o.from+a)!=n.sliceDoc(t,r))return{range:o};let u=n.toText(e);return{changes:{from:o.from+i,to:r==s.from?o.to:o.from+a,insert:u},range:ve.cursor(o.from+i+u.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const cP=new WeakMap;function PW(n){if(!Array.isArray(n))return n;let e=cP.get(n);return e||cP.set(n,e=NQ(n)),e}const tm=Ct.define(),Nf=Ct.define();class NW{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=pl(e,t),s=Yo(r);this.chars.push(r);let i=e.slice(t,t+s),a=i.toUpperCase();this.folded.push(pl(a==i?i.toLowerCase():a,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:s,precise:i,byWord:a}=this;if(t.length==1){let k=pl(e,0),$=Yo(k),j=$==e.length?0:-100;if(k!=t[0])if(k==r[0])j+=-200;else return null;return this.ret(j,[0,$])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=t.length,d=0;if(o<0){for(let k=0,$=Math.min(e.length,200);k<$&&d<u;){let j=pl(e,k);(j==t[d]||j==r[d])&&(s[d++]=k),k+=Yo(j)}if(d<u)return null}let p=0,m=0,g=!1,x=0,v=-1,y=-1,S=/[a-z]/.test(e),Q=!0;for(let k=0,$=Math.min(e.length,200),j=0;k<$&&m<u;){let T=pl(e,k);o<0&&(p<u&&T==t[p]&&(i[p++]=k),x<u&&(T==t[x]||T==r[x]?(x==0&&(v=k),y=k+1,x++):x=0));let R,N=T<255?T>=48&&T<=57||T>=97&&T<=122?2:T>=65&&T<=90?1:0:(R=iY(T))!=R.toLowerCase()?1:R!=R.toUpperCase()?2:0;(!k||N==1&&S||j==0&&N!=0)&&(t[m]==T||r[m]==T&&(g=!0)?a[m++]=k:a.length&&(Q=!1)),j=N,k+=Yo(T)}return m==u&&a[0]==0&&Q?this.result(-100+(g?-200:0),a,e):x==u&&v==0?this.ret(-200-e.length+(y==e.length?0:-100),[0,y]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):x==u?this.ret(-900-e.length,[v,y]):m==u?this.result(-100+(g?-200:0)+-700+(Q?0:-1100),a,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,r){let s=[],i=0;for(let a of t){let o=a+(this.astral?Yo(pl(r,a)):1);i&&s[i-1]==a?s[i-1]=o:(s[i++]=a,s[i++]=o)}return this.ret(e-r.length,s)}}class CW{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Rn=qe.define({combine(n){return iQ(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:RW,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>uP(e(r),t(r)),optionClass:(e,t)=>r=>uP(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function uP(n,e){return n?e?n+" "+e:n:e}function RW(n,e,t,r,s,i){let a=n.textDirection==Ft.RTL,o=a,u=!1,d="top",p,m,g=e.left-s.left,x=s.right-e.right,v=r.right-r.left,y=r.bottom-r.top;if(o&&g<Math.min(v,x)?o=!1:!o&&x<Math.min(v,g)&&(o=!0),v<=(o?g:x))p=Math.max(s.top,Math.min(t.top,s.bottom-y))-e.top,m=Math.min(400,o?g:x);else{u=!0,m=Math.min(400,(a?e.right:s.right-e.left)-30);let k=s.bottom-e.bottom;k>=y||k>e.top?p=t.bottom-e.top:(d="bottom",p=e.bottom-t.top)}let S=(e.bottom-e.top)/i.offsetHeight,Q=(e.right-e.left)/i.offsetWidth;return{style:`${d}: ${p/S}px; max-width: ${m/Q}px`,class:"cm-completionInfo-"+(u?a?"left-narrow":"right-narrow":o?"left":"right")}}function EW(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,s,i){let a=document.createElement("span");a.className="cm-completionLabel";let o=t.displayLabel||t.label,u=0;for(let d=0;d<i.length;){let p=i[d++],m=i[d++];p>u&&a.appendChild(document.createTextNode(o.slice(u,p)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(o.slice(p,m))),g.className="cm-completionMatchedText",u=m}return u<o.length&&a.appendChild(document.createTextNode(o.slice(u))),a},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function ux(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class AW{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:i,selected:a}=s.open,o=e.state.facet(Rn);this.optionContent=EW(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=ux(i.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:d}=e.state.field(t).open;for(let p=u.target,m;p&&p!=this.dom;p=p.parentNode)if(p.nodeName=="LI"&&(m=/-(\d+)$/.exec(p.id))&&+m[1]<d.length){this.applyCompletion(e,d[+m[1]]),u.preventDefault();return}}),this.dom.addEventListener("focusout",u=>{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(Rn).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:Nf.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:a,disabled:o}=r.open;(!s.open||s.open.options!=i)&&(this.range=ux(i.length,a,e.state.facet(Rn).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),o!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=ux(t.options.length,t.selected,this.view.state.facet(Rn).maxRenderedOptions),this.showOptions(t.options,e.id));let r=this.updateSelectedOption(t.selected);if(r){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:i}=s;if(!i)return;let a=typeof i=="string"?document.createTextNode(i):i(s);if(!a)return;"then"in a?a.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,s)}).catch(o=>qr(this.view.state,o,"completion info")):(this.addInfoPane(a,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return t&&MW(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let a=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return s.top>Math.min(i.bottom,t.bottom)-10||s.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(Rn).positionInfo(this.view,t,s,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",a=>{a.target==s&&a.preventDefault()});let i=null;for(let a=r.from;a<r.to;a++){let{completion:o,match:u}=e[a],{section:d}=o;if(d){let g=typeof d=="string"?d:d.name;if(g!=i&&(a>r.from||r.from==0))if(i=g,typeof d!="string"&&d.header)s.appendChild(d.header(d));else{let x=s.appendChild(document.createElement("completion-section"));x.textContent=g}}const p=s.appendChild(document.createElement("li"));p.id=t+"-"+a,p.setAttribute("role","option");let m=this.optionClass(o);m&&(p.className=m);for(let g of this.optionContent){let x=g(o,this.view.state,this.view,u);x&&p.appendChild(x)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function qW(n,e){return t=>new AW(t,n,e)}function MW(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),s=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/s:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/s)}function fP(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function XW(n,e){let t=[],r=null,s=null,i=p=>{t.push(p);let{section:m}=p.completion;if(m){r||(r=[]);let g=typeof m=="string"?m:m.name;r.some(x=>x.name==g)||r.push(typeof m=="string"?{name:g}:m)}},a=e.facet(Rn);for(let p of n)if(p.hasResult()){let m=p.result.getMatch;if(p.result.filter===!1)for(let g of p.result.options)i(new oP(g,p.source,m?m(g):[],1e9-t.length));else{let g=e.sliceDoc(p.from,p.to),x,v=a.filterStrict?new CW(g):new NW(g);for(let y of p.result.options)if(x=v.match(y.label)){let S=y.displayLabel?m?m(y,x.matched):[]:x.matched,Q=x.score+(y.boost||0);if(i(new oP(y,p.source,S,Q)),typeof y.section=="object"&&y.section.rank==="dynamic"){let{name:k}=y.section;s||(s=Object.create(null)),s[k]=Math.max(Q,s[k]||-1e9)}}}}if(r){let p=Object.create(null),m=0,g=(x,v)=>(x.rank==="dynamic"&&v.rank==="dynamic"?s[v.name]-s[x.name]:0)||(typeof x.rank=="number"?x.rank:1e9)-(typeof v.rank=="number"?v.rank:1e9)||(x.name<v.name?-1:1);for(let x of r.sort(g))m-=1e5,p[x.name]=m;for(let x of t){let{section:v}=x.completion;v&&(x.score+=p[typeof v=="string"?v:v.name])}}let o=[],u=null,d=a.compareCompletions;for(let p of t.sort((m,g)=>g.score-m.score||d(m.completion,g.completion))){let m=p.completion;!u||u.label!=m.label||u.detail!=m.detail||u.type!=null&&m.type!=null&&u.type!=m.type||u.apply!=m.apply||u.boost!=m.boost?o.push(p):fP(p.completion)>fP(u)&&(o[o.length-1]=p),u=p.completion}return o}class Fo{constructor(e,t,r,s,i,a){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=a}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Fo(this.options,dP(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,s,i,a){if(s&&!a&&e.some(d=>d.isPending))return s.setDisabled();let o=XW(e,t);if(!o.length)return s&&e.some(d=>d.isPending)?s.setDisabled():null;let u=t.facet(Rn).selectOnOpen?0:-1;if(s&&s.selected!=u&&s.selected!=-1){let d=s.options[s.selected].completion;for(let p=0;p<o.length;p++)if(o[p].completion==d){u=p;break}}return new Fo(o,dP(r,u),{pos:e.reduce((d,p)=>p.hasResult()?Math.min(d,p.from):d,1e8),create:DW,above:i.aboveCursor},s?s.timestamp:Date.now(),u,!1)}map(e){return new Fo(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Fo(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class nm{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new nm(VW,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Rn),i=(r.override||t.languageDataAt("autocomplete",jl(t)).map(PW)).map(u=>(this.active.find(p=>p.source==u)||new Kr(u,this.active.some(p=>p.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((u,d)=>u==this.active[d])&&(i=this.active);let a=this.open,o=e.effects.some(u=>u.is(RQ));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!zW(i,this.active)||o?a=Fo.build(i,t,this.id,a,r,o):a&&a.disabled&&!i.some(u=>u.isPending)&&(a=null),!a&&i.every(u=>!u.isPending)&&i.some(u=>u.hasResult())&&(i=i.map(u=>u.hasResult()?new Kr(u.source,0):u));for(let u of e.effects)u.is(e7)&&(a=a&&a.setSelected(u.value,this.id));return i==this.active&&a==this.open?this:new nm(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?LW:ZW}}function zW(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let s=t==n.length,i=r==e.length;if(s||i)return s==i;if(n[t++].result!=e[r++].result)return!1}}const LW={"aria-autocomplete":"list"},ZW={};function dP(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const VW=[];function JX(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(CQ);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Kr{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=JX(e,t),s=this;(r&8||r&16&&this.touches(e))&&(s=new Kr(s.source,0)),r&4&&s.state==0&&(s=new Kr(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(tm))s=new Kr(s.source,1,i.value);else if(i.is(Nf))s=new Kr(s.source,0);else if(i.is(RQ))for(let a of i.value)a.source==s.source&&(s=a);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(jl(e.state))}}class ac extends Kr{constructor(e,t,r,s,i,a){super(e,3,t),this.limit=r,this.result=s,this.from=i,this.to=a}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),o=jl(e.state);if(o>a||!s||t&2&&(jl(e.startState)==this.from||o<this.limit))return new Kr(this.source,t&4?1:0);let u=e.changes.mapPos(this.limit);return YW(s.validFor,e.state,i,a)?new ac(this.source,this.explicit,u,s,i,a):s.update&&(s=s.update(s,i,a,new PQ(e.state,o,!1)))?new ac(this.source,this.explicit,u,s,s.from,(r=s.to)!==null&&r!==void 0?r:jl(e.state)):new Kr(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new ac(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Kr(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function YW(n,e,t,r){if(!n)return!1;let s=e.sliceDoc(t,r);return typeof n=="function"?n(s,t,r,e):KX(n,!0).test(s)}const RQ=Ct.define({map(n,e){return n.map(t=>t.map(e))}}),e7=Ct.define(),dr=ii.define({create(){return nm.start()},update(n,e){return n.update(e)},provide:n=>[sX.from(n,e=>e.tooltip),Ae.contentAttributes.from(n,e=>e.attrs)]});function EQ(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(dr).active.find(s=>s.source==e.source);return r instanceof ac?(typeof t=="string"?n.dispatch({..._W(n.state,t,r.from,r.to),annotations:CQ.of(e.completion)}):t(n,e.completion,r.from,r.to),!0):!1}const DW=qW(dr,EQ);function Fh(n,e="option"){return t=>{let r=t.state.field(dr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(Rn).interactionDelay)return!1;let s=1,i;e=="page"&&(i=iX(t,r.open.tooltip))&&(s=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,o=r.open.selected>-1?r.open.selected+s*(n?1:-1):n?0:a-1;return o<0?o=e=="page"?0:a-1:o>=a&&(o=e=="page"?a-1:0),t.dispatch({effects:e7.of(o)}),!0}}const t7=n=>{let e=n.state.field(dr,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Rn).interactionDelay?!1:EQ(n,e.open.options[e.open.selected])},fx=n=>n.state.field(dr,!1)?(n.dispatch({effects:tm.of(!0)}),!0):!1,BW=n=>{let e=n.state.field(dr,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Nf.of(null)}),!0)};class UW{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const WW=50,GW=1e3,IW=Ps.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(dr).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(dr),t=n.state.facet(Rn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(dr)==e)return;let r=n.transactions.some(i=>{let a=JX(i,t);return a&8||(i.selection||i.docChanged)&&!(a&3)});for(let i=0;i<this.running.length;i++){let a=this.running[i];if(r||a.context.abortOnDocChange&&n.docChanged||a.updates.length+n.transactions.length>WW&&Date.now()-a.time>GW){for(let o of a.context.abortListeners)try{o()}catch(u){qr(this.view.state,u)}a.context.abortListeners=null,this.running.splice(i--,1)}else a.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(i=>i.effects.some(a=>a.is(tm)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(a=>a.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of n.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(dr);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Rn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=jl(e),r=new PQ(e,t,n.explicit,this.view),s=new UW(n,r);this.running.push(s),Promise.resolve(n.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Nf.of(null)}),qr(this.view.state,i)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Rn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Rn),r=this.view.state.field(dr);for(let s=0;s<this.running.length;s++){let i=this.running[s];if(i.done===void 0)continue;if(this.running.splice(s--,1),i.done){let o=jl(i.updates.length?i.updates[0].startState:this.view.state),u=Math.min(o,i.done.from+(i.active.explicit?0:1)),d=new ac(i.active.source,i.active.explicit,u,i.done,i.done.from,(n=i.done.to)!==null&&n!==void 0?n:o);for(let p of i.updates)d=d.update(p,t);if(d.hasResult()){e.push(d);continue}}let a=r.active.find(o=>o.source==i.active.source);if(a&&a.isPending)if(i.done==null){let o=new Kr(i.active.source,0);for(let u of i.updates)o=o.update(u,t);o.isPending||e.push(o)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:RQ.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(dr,!1);if(e&&e.tooltip&&this.view.state.facet(Rn).closeOnBlur){let t=e.open&&iX(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Nf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:tm.of(!1)}),20),this.composing=0}}}),HW=typeof navigator=="object"&&/Win/.test(navigator.platform),FW=Yl.highest(Ae.domEventHandlers({keydown(n,e){let t=e.state.field(dr,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(HW&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],s=t.active.find(a=>a.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(n.key)>-1&&EQ(e,r),!1}})),n7=Ae.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class KW{constructor(e,t,r,s){this.field=e,this.line=t,this.from=r,this.to=s}}class AQ{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,Kn.TrackDel),r=e.mapPos(this.to,1,Kn.TrackDel);return t==null||r==null?null:new AQ(this.field,t,r)}}class qQ{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],s=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let u of this.lines){if(r.length){let d=a,p=/^\t*/.exec(u)[0].length;for(let m=0;m<p;m++)d+=e.facet(nd);s.push(t+d.length-p),u=d+u.slice(p)}r.push(u),t+=u.length+1}let o=this.fieldPositions.map(u=>new AQ(u.field,s[u.line]+u.from,s[u.line]+u.to));return{text:r,ranges:o}}static parse(e){let t=[],r=[],s=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=i[1]?+i[1]:null,u=i[2]||i[3]||"",d=-1,p=u.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m<t.length;m++)(o!=null?t[m].seq==o:p&&t[m].name==p)&&(d=m);if(d<0){let m=0;for(;m<t.length&&(o==null||t[m].seq!=null&&t[m].seq<o);)m++;t.splice(m,0,{seq:o,name:p}),d=m;for(let g of s)g.field>=d&&g.field++}for(let m of s)if(m.line==r.length&&m.from>i.index){let g=i[2]?3+(i[1]||"").length:2;m.from-=g,m.to-=g}s.push(new KW(d,r.length,i.index,i.index+p.length)),a=a.slice(0,i.index)+u+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(o,u,d)=>{for(let p of s)p.line==r.length&&p.from>d&&(p.from--,p.to--);return u}),r.push(a)}return new qQ(r,s)}}let JW=Ut.widget({widget:new class extends Ff{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),eG=Ut.mark({class:"cm-snippetField"});class Ec{constructor(e,t){this.ranges=e,this.active=t,this.deco=Ut.set(e.map(r=>(r.from==r.to?JW:eG).range(r.from,r.to)),!0)}map(e){let t=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;t.push(s)}return new Ec(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const sd=Ct.define({map(n,e){return n&&n.map(e)}}),tG=Ct.define(),Cf=ii.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(sd))return t.value;if(t.is(tG)&&n)return new Ec(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Ae.decorations.from(n,e=>e?e.deco:Ut.none)});function MQ(n,e){return ve.create(n.filter(t=>t.field==e).map(t=>ve.range(t.from,t.to)))}function nG(n){let e=qQ.parse(n);return(t,r,s,i)=>{let{text:a,ranges:o}=e.instantiate(t.state,s),{main:u}=t.state.selection,d={changes:{from:s,to:i==u.from?u.to:i,insert:dt.of(a)},scrollIntoView:!0,annotations:r?[CQ.of(r),vn.userEvent.of("input.complete")]:void 0};if(o.length&&(d.selection=MQ(o,0)),o.some(p=>p.field>0)){let p=new Ec(o,0),m=d.effects=[sd.of(p)];t.state.field(Cf,!1)===void 0&&m.push(Ct.appendConfig.of([Cf,lG,oG,n7]))}t.dispatch(t.state.update(d))}}function r7(n){return({state:e,dispatch:t})=>{let r=e.field(Cf,!1);if(!r||n<0&&r.active==0)return!1;let s=r.active+n,i=n>0&&!r.ranges.some(a=>a.field==s+n);return t(e.update({selection:MQ(r.ranges,s),effects:sd.of(i?null:new Ec(r.ranges,s)),scrollIntoView:!0})),!0}}const rG=({state:n,dispatch:e})=>n.field(Cf,!1)?(e(n.update({effects:sd.of(null)})),!0):!1,sG=r7(1),iG=r7(-1),aG=[{key:"Tab",run:sG,shift:iG},{key:"Escape",run:rG}],hP=qe.define({combine(n){return n.length?n[0]:aG}}),lG=Yl.highest(Cc.compute([hP],n=>n.facet(hP)));function It(n,e){return{...e,apply:nG(n)}}const oG=Ae.domEventHandlers({mousedown(n,e){let t=e.state.field(Cf,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==t.active?!1:(e.dispatch({selection:MQ(t.ranges,s.field),effects:sd.of(t.ranges.some(i=>i.field>s.field)?new Ec(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),s7=new class extends Xa{};s7.startSide=1;s7.endSide=-1;function cG(n={}){return[FW,dr,Rn.of(n),IW,uG,n7]}const i7=[{key:"Ctrl-Space",run:fx},{mac:"Alt-`",run:fx},{mac:"Alt-i",run:fx},{key:"Escape",run:BW},{key:"ArrowDown",run:Fh(!0)},{key:"ArrowUp",run:Fh(!1)},{key:"PageDown",run:Fh(!0,"page")},{key:"PageUp",run:Fh(!1,"page")},{key:"Enter",run:t7}],uG=Yl.highest(Cc.computeN([Rn],n=>n.facet(Rn).defaultKeymap?[i7]:[]));class rm{static create(e,t,r,s,i){let a=s+(s<<8)+e+(t<<4)|0;return new rm(e,t,r,a,i,[],[])}constructor(e,t,r,s,i,a,o){this.type=e,this.value=t,this.from=r,this.hash=s,this.end=i,this.children=a,this.positions=o,this.hashProp=[[Ue.contextHash,s]]}addChild(e,t){e.prop(Ue.contextHash)!=this.hash&&(e=new wt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new wt(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(s,i,a)=>new wt(Pn.none,s,i,a,this.hashProp)})}}var Se;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(Se||(Se={}));class fG{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class dG{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return pf(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let s=t;s<e;s++)r+=this.text.charCodeAt(s)==9?4-r%4:1;return r}findColumn(e){let t=0;for(let r=0;t<this.text.length&&r<e;t++)r+=this.text.charCodeAt(t)==9?4-r%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function pP(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==Se.OrderedList?LQ:zQ)(t,e,!1);return r>0&&(n.type!=Se.BulletList||XQ(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const a7={[Se.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(ut(Se.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(as(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[Se.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[Se.OrderedList]:pP,[Se.BulletList]:pP,[Se.Document](){return!0}};function as(n){return n==32||n==9||n==10||n==13}function pf(n,e=0){for(;e<n.length&&as(n.charCodeAt(e));)e++;return e}function mP(n,e,t){for(;e>t&&as(n.charCodeAt(e-1));)e--;return e}function l7(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function o7(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function XQ(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let r=1;for(let s=n.pos+1;s<n.text.length;s++){let i=n.text.charCodeAt(s);if(i==n.next)r++;else if(!as(i))return-1}return t&&n.next==45&&f7(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(m7.SetextHeading)>-1||r<3?-1:1}function c7(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function zQ(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||as(n.text.charCodeAt(n.pos+1)))&&(!t||c7(e,Se.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function LQ(n,e,t){let r=n.pos,s=n.next;for(;s>=48&&s<=57;){r++;if(r==n.text.length)return-1;s=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||s!=46&&s!=41||r<n.text.length-1&&!as(n.text.charCodeAt(r+1))||t&&!c7(e,Se.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function u7(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function f7(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&as(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const u2=/^[ \t]*$/,d7=/-->/,h7=/\?>/,f2=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,d7],[/^\s*<\?/,h7],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,u2],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,u2]];function p7(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let s=0,i=f2.length-(t?1:0);s<i;s++)if(f2[s][0].test(r))return s;return-1}function OP(n,e){let t=n.countIndent(e,n.pos,n.indent),r=n.countIndent(n.skipSpace(e),e,t);return r>=t+5?t+1:r}function Sa(n,e,t){let r=n.length-1;r>=0&&n[r].to==e&&n[r].type==Se.CodeText?n[r].to=t:n.push(ut(Se.CodeText,e,t))}const Kh={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let r=e.findColumn(t),s=n.lineStart+r,i=n.lineStart+e.text.length,a=[],o=[];for(Sa(a,s,i);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){Sa(o,n.lineStart-1,n.lineStart);for(let u of e.markers)o.push(u)}else{if(e.indent<t)break;{if(o.length){for(let d of o)d.type==Se.CodeText?Sa(a,d.from,d.to):a.push(d);o=[]}Sa(a,n.lineStart-1,n.lineStart);for(let d of e.markers)a.push(d);i=n.lineStart+e.text.length;let u=n.lineStart+e.findColumn(e.baseIndent+4);u<i&&Sa(a,u,i)}}return o.length&&(o=o.filter(u=>u.type!=Se.CodeText),o.length&&(e.markers=o.concat(e.markers))),n.addNode(n.buffer.writeElements(a,-s).finish(Se.CodeBlock,i-s),s),!0},FencedCode(n,e){let t=l7(e);if(t<0)return!1;let r=n.lineStart+e.pos,s=e.next,i=t-e.pos,a=e.skipSpace(t),o=mP(e.text,e.text.length,a),u=[ut(Se.CodeMark,r,r+i)];a<o&&u.push(ut(Se.CodeInfo,n.lineStart+a,n.lineStart+o));for(let d=!0,p=!0,m=!1;n.nextLine()&&e.depth>=n.stack.length;d=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==s;)g++;if(g-e.pos>=i&&e.skipSpace(g)==e.text.length){for(let x of e.markers)u.push(x);p&&m&&Sa(u,n.lineStart-1,n.lineStart),u.push(ut(Se.CodeMark,n.lineStart+e.pos,n.lineStart+g)),n.nextLine();break}else{m=!0,d||(Sa(u,n.lineStart-1,n.lineStart),p=!1);for(let y of e.markers)u.push(y);let x=n.lineStart+e.basePos,v=n.lineStart+e.text.length;x<v&&(Sa(u,x,v),p=!1)}}return n.addNode(n.buffer.writeElements(u,-r).finish(Se.FencedCode,n.prevLineEnd()-r),r),!0},Blockquote(n,e){let t=o7(e);return t<0?!1:(n.startContext(Se.Blockquote,e.pos),n.addNode(Se.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(XQ(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(Se.HorizontalRule,t),!0},BulletList(n,e){let t=zQ(e,n,!1);if(t<0)return!1;n.block.type!=Se.BulletList&&n.startContext(Se.BulletList,e.basePos,e.next);let r=OP(e,e.pos+1);return n.startContext(Se.ListItem,e.basePos,r-e.baseIndent),n.addNode(Se.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},OrderedList(n,e){let t=LQ(e,n,!1);if(t<0)return!1;n.block.type!=Se.OrderedList&&n.startContext(Se.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let r=OP(e,e.pos+t);return n.startContext(Se.ListItem,e.basePos,r-e.baseIndent),n.addNode(Se.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},ATXHeading(n,e){let t=u7(e);if(t<0)return!1;let r=e.pos,s=n.lineStart+r,i=mP(e.text,e.text.length,r),a=i;for(;a>r&&e.text.charCodeAt(a-1)==e.next;)a--;(a==i||a==r||!as(e.text.charCodeAt(a-1)))&&(a=e.text.length);let o=n.buffer.write(Se.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(r+t+1,a),s+t+1),-s);a<e.text.length&&o.write(Se.HeaderMark,a-r,i-r);let u=o.finish(Se.ATXHeading1-1+t,e.text.length-r);return n.nextLine(),n.addNode(u,s),!0},HTMLBlock(n,e){let t=p7(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,s=f2[t][1],i=[],a=s!=u2;for(;!s.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){a=!1;break}for(let d of e.markers)i.push(d)}a&&n.nextLine();let o=s==d7?Se.CommentBlock:s==h7?Se.ProcessingInstructionBlock:Se.HTMLBlock,u=n.prevLineEnd();return n.addNode(n.buffer.writeElements(i,-r).finish(o,u-r),r),!0},SetextHeading:void 0};class hG{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,r){if(this.stage==-1)return!1;let s=r.content+`
|
|
213
|
-
`+t.scrub(),i=this.advance(s);return i>-1&&i<s.length?this.complete(e,r,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&pf(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,ut(Se.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(Q7(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(ut(Se.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(w7(e,pf(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=pf(e,this.pos),r=0;if(t>this.pos){let s=S7(e,t,this.start);if(s){let i=dx(e,s.to-this.start);i>0&&(this.nextStage(s),r=i)}}return r||(r=dx(e,this.pos)),r>0&&r<e.length?r:-1}else return dx(e,this.pos)}}}function dx(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!as(t))return-1}return e}class pG{nextLine(e,t,r){let s=t.depth<e.stack.length?-1:f7(t),i=t.next;if(s<0)return!1;let a=ut(Se.HeaderMark,e.lineStart+t.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(r,ut(i==61?Se.SetextHeading1:Se.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),a])),!0}finish(){return!1}}const m7={LinkReference(n,e){return e.content.charCodeAt(0)==91?new hG(e):null},SetextHeading(){return new pG}},mG=[(n,e)=>u7(e)>=0,(n,e)=>l7(e)>=0,(n,e)=>o7(e)>=0,(n,e)=>zQ(e,n,!0)>=0,(n,e)=>LQ(e,n,!0)>=0,(n,e)=>XQ(e,n,!0)>=0,(n,e)=>p7(e,n,!0)>=0],OG={text:"",end:0};class gG{constructor(e,t,r,s){this.parser=e,this.input=t,this.ranges=s,this.line=new dG,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=rm.create(Se.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new yG(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!s||e.markers[r].from<s.end);){let i=e.markers[r++];this.addNode(i.type,i.from,i.to)}if(!s)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let s=r(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}let t=new fG(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let s=r(this,t);s&&t.parsers.push(s)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
|
|
214
|
-
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=k7(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=OG;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<t.end;){s++;let i=this.ranges[s].from,a=this.lineChunkAt(i);t.end=i+a.length,t.text=t.text.slice(0,this.ranges[s-1].to-r)+a,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],i=this.parser.skipContextMarkup[s.type];if(!i)throw new Error("Unhandled block context "+Se[s.type]);let a=this.line.markers.length;if(!i(s,this,e)){this.line.markers.length>a&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
|
|
215
|
-
`?"":t;else{let s=t.indexOf(`
|
|
216
|
-
`);r=s<0?t:t.slice(0,s)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=rm.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new wt(this.parser.nodeSet.types[e],bc,bc,(r??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(h2(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?O7(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=h2(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Se.Paragraph,e.content.length),e.start)}elt(e,t,r,s){return typeof e=="string"?ut(this.parser.getNodeType(e),t,r,s):new b7(e,t)}get buffer(){return new x7(this.parser.nodeSet)}}function O7(n,e,t,r,s){let i=n[e].to,a=[],o=[],u=t.from+r;function d(p,m){for(;m?p>=i:p>i;){let g=n[e+1].from-i;r+=g,p+=g,e++,i=n[e].to}}for(let p=t.firstChild;p;p=p.nextSibling){d(p.from+r,!0);let m=p.from+r,g,x=s.get(p.tree);x?g=x:p.to+r>i?(g=O7(n,e,p,r,s),d(p.to+r,!1)):g=p.toTree(),a.push(g),o.push(m-u)}return d(t.to+r,!1),new wt(t.type,a,o,t.to+r-u,t.tree?t.tree.propValues:void 0)}class Fm extends SQ{constructor(e,t,r,s,i,a,o,u,d){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=s,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=u,this.wrappers=d,this.nodeTypes=Object.create(null);for(let p of e.types)this.nodeTypes[p.name]=p.id}createParse(e,t,r){let s=new gG(this,e,t,r);for(let i of this.wrappers)s=i(s,e,t,r);return s}configure(e){let t=d2(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:s}=this,i=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),o=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),p=this.endLeafBlock.slice(),m=this.wrappers;if(zu(t.defineNodes)){s=Object.assign({},s);let g=r.types.slice(),x;for(let v of t.defineNodes){let{name:y,block:S,composite:Q,style:k}=typeof v=="string"?{name:v}:v;if(g.some(T=>T.name==y))continue;Q&&(s[g.length]=(T,R,N)=>Q(R,N,T.value));let $=g.length,j=Q?["Block","BlockContext"]:S?$>=Se.ATXHeading1&&$<=Se.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(Pn.define({id:$,name:y,props:j&&[[Ue.group,j]]})),k&&(x||(x={}),Array.isArray(k)||k instanceof Er?x[y]=k:Object.assign(x,k))}r=new td(g),x&&(r=r.extend(Ua(x)))}if(zu(t.props)&&(r=r.extend(...t.props)),zu(t.remove))for(let g of t.remove){let x=this.blockNames.indexOf(g),v=this.inlineNames.indexOf(g);x>-1&&(i[x]=a[x]=void 0),v>-1&&(u[v]=void 0)}if(zu(t.parseBlock))for(let g of t.parseBlock){let x=o.indexOf(g.name);if(x>-1)i[x]=g.parse,a[x]=g.leaf;else{let v=g.before?Jh(o,g.before):g.after?Jh(o,g.after)+1:o.length-1;i.splice(v,0,g.parse),a.splice(v,0,g.leaf),o.splice(v,0,g.name)}g.endLeaf&&p.push(g.endLeaf)}if(zu(t.parseInline))for(let g of t.parseInline){let x=d.indexOf(g.name);if(x>-1)u[x]=g.parse;else{let v=g.before?Jh(d,g.before):g.after?Jh(d,g.after)+1:d.length-1;u.splice(v,0,g.parse),d.splice(v,0,g.name)}}return t.wrap&&(m=m.concat(t.wrap)),new Fm(r,i,a,o,p,s,u,d,m)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new ZQ(this,e,t);e:for(let s=t;s<r.end;){let i=r.char(s);for(let a of this.inlineParsers)if(a){let o=a(r,i,s);if(o>=0){s=o;continue e}}s++}return r.resolveMarkers(0)}}function zu(n){return n!=null&&n.length>0}function d2(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=d2(n[0]);if(n.length==1)return e;let t=d2(n.slice(1));if(!t||!e)return e||t;let r=(a,o)=>(a||bc).concat(o||bc),s=e.wrap,i=t.wrap;return{props:r(e.props,t.props),defineNodes:r(e.defineNodes,t.defineNodes),parseBlock:r(e.parseBlock,t.parseBlock),parseInline:r(e.parseInline,t.parseInline),remove:r(e.remove,t.remove),wrap:s?i?(a,o,u,d)=>s(i(a,o,u,d),o,u,d):s:i}}function Jh(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let g7=[Pn.none];for(let n=1,e;e=Se[n];n++)g7[n]=Pn.define({id:n,name:e,props:n>=Se.Escape?[]:[[Ue.group,n in a7?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const bc=[];class x7{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,r,s=0){return this.content.push(e,t,r,4+s*4),this}writeElements(e,t=0){for(let r of e)r.writeTo(this,t);return this}finish(e,t){return wt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let Rf=class{constructor(e,t,r,s=bc){this.type=e,this.from=t,this.to=r,this.children=s}writeTo(e,t){let r=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-r)}toTree(e){return new x7(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class b7{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return bc}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function ut(n,e,t,r){return new Rf(n,e,t,r)}const y7={resolve:"Emphasis",mark:"EmphasisMark"},v7={resolve:"Emphasis",mark:"EmphasisMark"},xl={},sm={};class Rr{constructor(e,t,r,s){this.type=e,this.from=t,this.to=r,this.side=s}}const gP="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Ef=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Ef=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const hx={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let r=n.char(t+1);for(let s=0;s<gP.length;s++)if(gP.charCodeAt(s)==r)return n.append(ut(Se.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return r?n.append(ut(Se.Entity,t,t+1+r[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let r=t+1;for(;r<n.end&&n.char(r)==96;)r++;let s=r-t,i=0;for(;r<n.end;r++)if(n.char(r)==96){if(i++,i==s&&n.char(r+1)!=96)return n.append(ut(Se.InlineCode,t,r+1,[ut(Se.CodeMark,t,t+s),ut(Se.CodeMark,r+1-s,r+1)]))}else i=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let r=n.slice(t+1,n.end),s=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(s)return n.append(ut(Se.Autolink,t,t+1+s[0].length,[ut(Se.LinkMark,t,t+1),ut(Se.URL,t+1,t+s[0].length),ut(Se.LinkMark,t+s[0].length,t+1+s[0].length)]));let i=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(i)return n.append(ut(Se.Comment,t,t+1+i[0].length));let a=/^\?[^]*?\?>/.exec(r);if(a)return n.append(ut(Se.ProcessingInstruction,t,t+1+a[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return o?n.append(ut(Se.HTMLTag,t,t+1+o[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let r=t+1;for(;n.char(r)==e;)r++;let s=n.slice(t-1,t),i=n.slice(r,r+1),a=Ef.test(s),o=Ef.test(i),u=/\s|^$/.test(s),d=/\s|^$/.test(i),p=!d&&(!o||u||a),m=!u&&(!a||d||o),g=p&&(e==42||!m||a),x=m&&(e==42||!p||o);return n.append(new Rr(e==95?y7:v7,t,r,(g?1:0)|(x?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(ut(Se.HardBreak,t,t+2));if(e==32){let r=t+1;for(;n.char(r)==32;)r++;if(n.char(r)==10&&r>=t+2)return n.append(ut(Se.HardBreak,t,r+1))}return-1},Link(n,e,t){return e==91?n.append(new Rr(xl,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new Rr(sm,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let r=n.parts.length-1;r>=0;r--){let s=n.parts[r];if(s instanceof Rr&&(s.type==xl||s.type==sm)){if(!s.side||n.skipSpace(s.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[r]=null,-1;let i=n.takeContent(r),a=n.parts[r]=xG(n,i,s.type==xl?Se.Link:Se.Image,s.from,t+1);if(s.type==xl)for(let o=0;o<r;o++){let u=n.parts[o];u instanceof Rr&&u.type==xl&&(u.side=0)}return a.to}}return-1}};function xG(n,e,t,r,s){let{text:i}=n,a=n.char(s),o=s;if(e.unshift(ut(Se.LinkMark,r,r+(t==Se.Image?2:1))),e.push(ut(Se.LinkMark,s-1,s)),a==40){let u=n.skipSpace(s+1),d=w7(i,u-n.offset,n.offset),p;d&&(u=n.skipSpace(d.to),u!=d.to&&(p=S7(i,u-n.offset,n.offset),p&&(u=n.skipSpace(p.to)))),n.char(u)==41&&(e.push(ut(Se.LinkMark,s,s+1)),o=u+1,d&&e.push(d),p&&e.push(p),e.push(ut(Se.LinkMark,u,o)))}else if(a==91){let u=Q7(i,s-n.offset,n.offset,!1);u&&(e.push(u),o=u.to)}return ut(t,r,o,e)}function w7(n,e,t){if(n.charCodeAt(e)==60){for(let s=e+1;s<n.length;s++){let i=n.charCodeAt(s);if(i==62)return ut(Se.URL,e+t,s+1+t);if(i==60||i==10)return!1}return null}else{let s=0,i=e;for(let a=!1;i<n.length;i++){let o=n.charCodeAt(i);if(as(o))break;if(a)a=!1;else if(o==40)s++;else if(o==41){if(!s)break;s--}else o==92&&(a=!0)}return i>e?ut(Se.URL,e+t,i+t):i==n.length?null:!1}}function S7(n,e,t){let r=n.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let s=r==40?41:r;for(let i=e+1,a=!1;i<n.length;i++){let o=n.charCodeAt(i);if(a)a=!1;else{if(o==s)return ut(Se.LinkTitle,e+t,i+1+t);o==92&&(a=!0)}}return null}function Q7(n,e,t,r){for(let s=!1,i=e+1,a=Math.min(n.length,i+999);i<a;i++){let o=n.charCodeAt(i);if(s)s=!1;else{if(o==93)return r?!1:ut(Se.LinkLabel,e+t,i+1+t);if(r&&!as(o)&&(r=!1),o==91)return!1;o==92&&(s=!0)}}return null}class ZQ{constructor(e,t,r){this.parser=e,this.text=t,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,r,s,i){return this.append(new Rr(e,t,r,(s?1:0)|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Rr&&(t.type==xl||t.type==sm))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let s=this.parts[r];if(!(s instanceof Rr&&s.type.resolve&&s.side&2))continue;let i=s.type==y7||s.type==v7,a=s.to-s.from,o,u=r-1;for(;u>=e;u--){let y=this.parts[u];if(y instanceof Rr&&y.side&1&&y.type==s.type&&!(i&&(s.side&1||y.side&2)&&(y.to-y.from+a)%3==0&&((y.to-y.from)%3||a%3))){o=y;break}}if(!o)continue;let d=s.type.resolve,p=[],m=o.from,g=s.to;if(i){let y=Math.min(2,o.to-o.from,a);m=o.to-y,g=s.from+y,d=y==1?"Emphasis":"StrongEmphasis"}o.type.mark&&p.push(this.elt(o.type.mark,m,o.to));for(let y=u+1;y<r;y++)this.parts[y]instanceof Rf&&p.push(this.parts[y]),this.parts[y]=null;s.type.mark&&p.push(this.elt(s.type.mark,s.from,g));let x=this.elt(d,m,g,p);this.parts[u]=i&&o.from!=m?new Rr(o.type,o.from,m,o.side):null,(this.parts[r]=i&&s.to!=g?new Rr(s.type,g,s.to,s.side):null)?this.parts.splice(r,0,x):this.parts[r]=x}let t=[];for(let r=e;r<this.parts.length;r++){let s=this.parts[r];s instanceof Rf&&t.push(s)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let r=this.parts[t];if(r instanceof Rr&&r.type==e&&r.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Rr?t:null}skipSpace(e){return pf(this.text,e-this.offset)+this.offset}elt(e,t,r,s){return typeof e=="string"?ut(this.parser.getNodeType(e),t,r,s):new b7(e,t)}}ZQ.linkStart=xl;ZQ.imageStart=sm;function h2(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),r=0;for(let s of e){for(;r<t.length&&t[r].to<s.to;)r++;if(r<t.length&&t[r].from<s.from){let i=t[r];i instanceof Rf&&(t[r]=new Rf(i.type,i.from,i.to,h2(i.children,[s])))}else t.splice(r++,0,s)}return t}const bG=[Se.CodeBlock,Se.ListItem,Se.OrderedList,Se.BulletList];let yG=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let i=this.fragment.to;for(;i>0&&this.input.read(i-1,i)!=`
|
|
217
|
-
`;)i--;this.fragmentEnd=i?i-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let s=e+this.fragment.offset;for(;r.to<=s;)if(!r.parent())return!1;for(;;){if(r.from>=s)return this.fragment.from<=t;if(!r.childAfter(s))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ue.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,a=i,o=e.block.children.length,u=a,d=o;for(;;){if(t.to-r>s){if(t.type.isAnonymous&&t.firstChild())continue;break}let p=k7(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,p);else{let m=new wt(e.parser.nodeSet.types[Se.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(m,t.tree),e.addNode(m,p)}if(t.type.is("Block")&&(bG.indexOf(t.type.id)<0?(a=t.to-r,o=e.block.children.length):(a=u,o=d),u=t.to-r,d=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function k7(n,e){let t=n;for(let r=1;r<e.length;r++){let s=e[r-1].to,i=e[r].from;s<n&&(t-=i-s)}return t}const vG=Ua({"Blockquote/...":Y.quote,HorizontalRule:Y.contentSeparator,"ATXHeading1/... SetextHeading1/...":Y.heading1,"ATXHeading2/... SetextHeading2/...":Y.heading2,"ATXHeading3/...":Y.heading3,"ATXHeading4/...":Y.heading4,"ATXHeading5/...":Y.heading5,"ATXHeading6/...":Y.heading6,"Comment CommentBlock":Y.comment,Escape:Y.escape,Entity:Y.character,"Emphasis/...":Y.emphasis,"StrongEmphasis/...":Y.strong,"Link/... Image/...":Y.link,"OrderedList/... BulletList/...":Y.list,"BlockQuote/...":Y.quote,"InlineCode CodeText":Y.monospace,"URL Autolink":Y.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":Y.processingInstruction,"CodeInfo LinkLabel":Y.labelName,LinkTitle:Y.string,Paragraph:Y.content}),wG=new Fm(new td(g7).extend(vG),Object.keys(Kh).map(n=>Kh[n]),Object.keys(Kh).map(n=>m7[n]),Object.keys(Kh),mG,a7,Object.keys(hx).map(n=>hx[n]),Object.keys(hx),[]);function SG(n,e,t){let r=[];for(let s=n.firstChild,i=e;;s=s.nextSibling){let a=s?s.from:t;if(a>i&&r.push({from:i,to:a}),!s)break;i=s.to}return r}function QG(n){let{codeParser:e,htmlParser:t}=n;return{wrap:fX((s,i)=>{let a=s.type.id;if(e&&(a==Se.CodeBlock||a==Se.FencedCode)){let o="";if(a==Se.FencedCode){let d=s.node.getChild(Se.CodeInfo);d&&(o=i.read(d.from,d.to))}let u=e(o);if(u)return{parser:u,overlay:d=>d.type.id==Se.CodeText,bracketed:a==Se.FencedCode}}else if(t&&(a==Se.HTMLBlock||a==Se.HTMLTag||a==Se.CommentBlock))return{parser:t,overlay:SG(s.node,s.from,s.to)};return null})}}const kG={resolve:"Strikethrough",mark:"StrikethroughMark"},$G={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Y.strikethrough}},{name:"StrikethroughMark",style:Y.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let r=n.slice(t-1,t),s=n.slice(t+2,t+3),i=/\s|^$/.test(r),a=/\s|^$/.test(s),o=Ef.test(r),u=Ef.test(s);return n.addDelimiter(kG,t,t+2,!a&&(!u||i||o),!i&&(!o||a||u))},after:"Emphasis"}]};function mf(n,e,t=0,r,s=0){let i=0,a=!0,o=-1,u=-1,d=!1,p=()=>{r.push(n.elt("TableCell",s+o,s+u,n.parser.parseInline(e.slice(o,u),s+o)))};for(let m=t;m<e.length;m++){let g=e.charCodeAt(m);g==124&&!d?((!a||o>-1)&&i++,a=!1,r&&(o>-1&&p(),r.push(n.elt("TableDelimiter",m+s,m+s+1))),o=u=-1):(d||g!=32&&g!=9)&&(o<0&&(o=m),u=m+1),d=!d&&g==92}return o>-1&&(i++,r&&p()),i}function xP(n,e){for(let t=e;t<n.length;t++){let r=n.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}const $7=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class bP{constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let s;if((t.next==45||t.next==58||t.next==124)&&$7.test(s=t.text.slice(t.pos))){let i=[];mf(e,r.content,0,i,r.start)==mf(e,s,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,i),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let s=[];mf(e,t.text,t.pos,s,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,s))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const TG={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":Y.heading}},"TableRow",{name:"TableCell",style:Y.content},{name:"TableDelimiter",style:Y.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return xP(e.content,0)?new bP:null},endLeaf(n,e,t){if(t.parsers.some(s=>s instanceof bP)||!xP(e.text,e.basePos))return!1;let r=n.peekLine();return $7.test(r)&&mf(n,e.text,e.basePos)==mf(n,r,e.basePos)},before:"SetextHeading"}]};class jG{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const _G={defineNodes:[{name:"Task",block:!0,style:Y.list},{name:"TaskMarker",style:Y.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new jG:null},after:"SetextHeading"}]},yP=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,vP=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,PG=/[\w-]+\.[\w-]+($|\/)/,wP=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,SP=/\/[a-zA-Z\d@.]+/gy;function QP(n,e,t,r){let s=0;for(let i=e;i<t;i++)n[i]==r&&s++;return s}function NG(n,e){vP.lastIndex=e;let t=vP.exec(n);if(!t||PG.exec(t[0])[0].indexOf("_")>-1)return-1;let r=e+t[0].length;for(;;){let s=n[r-1],i;if(/[?!.,:*_~]/.test(s)||s==")"&&QP(n,e,r,")")>QP(n,e,r,"("))r--;else if(s==";"&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,r))))r=e+i.index;else break}return r}function kP(n,e){wP.lastIndex=e;let t=wP.exec(n);if(!t)return-1;let r=t[0][t[0].length-1];return r=="_"||r=="-"?-1:e+t[0].length-(r=="."?1:0)}const CG={parseInline:[{name:"Autolink",parse(n,e,t){let r=t-n.offset;if(r&&/\w/.test(n.text[r-1]))return-1;yP.lastIndex=r;let s=yP.exec(n.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=NG(n.text,r+s[0].length),i>-1&&n.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(r,i));i=r+a[0].length}}else s[3]?i=kP(n.text,r):(i=kP(n.text,r+s[0].length),i>-1&&s[0]=="xmpp:"&&(SP.lastIndex=i,s=SP.exec(n.text),s&&(i=s.index+s[0].length)));return i<0?-1:(n.addElement(n.elt("URL",t,i+n.offset)),i+n.offset)}}]},RG=[TG,_G,$G,CG];function T7(n,e,t){return(r,s,i)=>{if(s!=n||r.char(i+1)==n)return-1;let a=[r.elt(t,i,i+1)];for(let o=i+1;o<r.end;o++){let u=r.char(o);if(u==n)return r.addElement(r.elt(e,i,o+1,a.concat(r.elt(t,o,o+1))));if(u==92&&a.push(r.elt("Escape",o,o+++2)),as(u))break}return-1}}const EG={defineNodes:[{name:"Superscript",style:Y.special(Y.content)},{name:"SuperscriptMark",style:Y.processingInstruction}],parseInline:[{name:"Superscript",parse:T7(94,"Superscript","SuperscriptMark")}]},AG={defineNodes:[{name:"Subscript",style:Y.special(Y.content)},{name:"SubscriptMark",style:Y.processingInstruction}],parseInline:[{name:"Subscript",parse:T7(126,"Subscript","SubscriptMark")}]},qG={defineNodes:[{name:"Emoji",style:Y.character}],parseInline:[{name:"Emoji",parse(n,e,t){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+r[0].length))}}]};var $P={};class im{constructor(e,t,r,s,i,a,o,u,d,p=0,m){this.p=e,this.stack=t,this.state=r,this.reducePos=s,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=u,this.curContext=d,this.lookAhead=p,this.parent=m}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let s=e.parser.context;return new im(e,[],t,r,r,0,[],0,s?new TP(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,s=e&65535,{parser:i}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),o=i.dynamicPrecedence(s);if(o&&(this.score+=o),r==0){this.pushState(i.getGoto(this.state,s,!0),this.reducePos),s<i.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(s,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),d=u?this.stack[u-2]:this.p.ranges[0].from,p=this.reducePos-d;p>=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=p):this.p.lastBigReductionSize<p&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=p));let m=u?this.stack[u-1]:0,g=this.bufferBase+this.buffer.length-m;if(s<i.minRepeatTerm||e&131072){let x=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,d,x,g+4,!0)}if(e&262144)this.state=this.stack[u];else{let x=this.stack[u-3];this.state=i.getGoto(x,s,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(s,d)}storeNode(e,t,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,o=this.buffer.length;if(o==0&&a.parent&&(o=a.bufferBase-a.parent.bufferBase,a=a.parent),o>0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(t==r)return;if(a.buffer[o-2]>=t){a.buffer[o-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,t,r,s);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let o=!1;for(let u=a;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,s>4&&(s-=4)}this.buffer[a]=e,this.buffer[a+1]=t,this.buffer[a+2]=r,this.buffer[a+3]=s}}shift(e,t,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:a}=this.p;this.pos=s,!a.stateFlag(i,1)&&(s>r||t<=a.maxNode)&&(this.reducePos=s),this.pushState(i,Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=a.maxNode&&this.buffer.push(t,r,s,4)}else this.pos=s,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,s,4)}apply(e,t,r,s){e&65536?this.reduce(e):this.shift(e,t,r,s)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(r,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new im(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new MG(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let i=0,a;i<t.length;i+=2)(a=t[i+1])!=this.state&&this.p.parser.hasAction(a,e)&&s.push(t[i],a);if(this.stack.length<120)for(let i=0;s.length<8&&i<t.length;i+=2){let a=t[i+1];s.some((o,u)=>u&1&&o==a)||s.push(t[i],a)}t=s}let r=[];for(let s=0;s<t.length&&r.length<4;s+=2){let i=t[s+1];if(i==this.state)continue;let a=this.split();a.pushState(i,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(t[s],this.pos),a.reducePos=this.pos,a.score-=200,r.push(a)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,s=t&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;t=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(s,i)=>{if(!t.includes(s))return t.push(s),e.allActions(s,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-i;if(o>1){let u=a&65535,d=this.stack.length-o*3;if(d>=0&&e.getGoto(this.stack[d],u,!1)>=0)return o<<19|65536|u}}else{let o=r(a,i+1);if(o!=null)return o}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new TP(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class TP{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class MG{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class am{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new am(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new am(this.stack,this.pos,this.index)}}function Ju(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,s=0;r<n.length;){let i=0;for(;;){let a=n.charCodeAt(r++),o=!1;if(a==126){i=65535;break}a>=92&&a--,a>=34&&a--;let u=a-32;if(u>=46&&(u-=46,o=!0),i+=u,o)break;i*=46}t?t[s++]=i:t=new e(i)}return t}class kp{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jP=new kp;class XG{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jP,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!s)return null;let a=this.ranges[--s];i-=r.from-a.to,r=a}for(;t<0?i>r.to:i>=r.to;){if(s==this.ranges.length-1)return null;let a=this.ranges[++s];i+=a.from-r.to,r=a}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,s;if(t>=0&&t<this.chunk.length)r=this.pos+e,s=this.chunk.charCodeAt(t);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let a=this.rangeIndex,o=this.range;for(;o.to<=r;)o=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=jP,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return r}}class lc{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;j7(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}lc.prototype.contextual=lc.prototype.fallback=lc.prototype.extend=!1;class lm{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?Ju(e):e}token(e,t){let r=e.pos,s=0;for(;;){let i=e.next<0,a=e.resolveOffset(1,1);if(j7(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(i||s++,a==null)break;e.reset(a,e.token)}s&&(e.reset(r,e.token),e.acceptToken(this.elseToken,s))}}lm.prototype.contextual=lc.prototype.fallback=lc.prototype.extend=!1;class Vn{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function j7(n,e,t,r,s,i){let a=0,o=1<<r,{dialect:u}=t.p.parser;e:for(;(o&n[a])!=0;){let d=n[a+1];for(let x=a+3;x<d;x+=2)if((n[x+1]&o)>0){let v=n[x];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||zG(v,e.token.value,s,i))){e.acceptToken(v);break}}let p=e.next,m=0,g=n[a+2];if(e.next<0&&g>m&&n[d+g*3-3]==65535){a=n[d+g*3-1];continue e}for(;m<g;){let x=m+g>>1,v=d+x+(x<<1),y=n[v],S=n[v+1]||65536;if(p<y)g=x;else if(p>=S)m=x+1;else{a=n[v+2],e.advance();continue e}}break}}function _P(n,e,t){for(let r=e,s;(s=n[r])!=65535;r++)if(s==t)return r-e;return-1}function zG(n,e,t,r){let s=_P(t,r,e);return s<0||_P(t,r,n)<s}const Pr=typeof process<"u"&&$P&&/\bparse\b/.test($P.LOG);let px=null;function PP(n,e,t){let r=n.cursor(vt.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class LG{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?PP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?PP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],s=this.index[t];if(s==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[s],a=this.start[t]+r.positions[s];if(a>e)return this.nextStart=a,null;if(i instanceof wt){if(a==e){if(a<this.safeFrom)return null;let o=a+i.length;if(o<=this.safeTo){let u=i.prop(Ue.lookAhead);if(!u||o+u<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}}class ZG{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new kp)}getActions(e){let t=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,a=s.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,u=0;for(let d=0;d<i.length;d++){if((1<<d&a)==0)continue;let p=i[d],m=this.tokens[d];if(!(r&&!p.fallback)&&((p.contextual||m.start!=e.pos||m.mask!=a||m.context!=o)&&(this.updateCachedToken(m,p,e),m.mask=a,m.context=o),m.lookAhead>m.end+25&&(u=Math.max(m.lookAhead,u)),m.value!=0)){let g=t;if(m.extended>-1&&(t=this.addActions(e,m.extended,m.end,t)),t=this.addActions(e,m.value,m.end,t),!p.extend&&(r=m,t>g))break}}for(;this.actions.length>t;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new kp,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new kp,{pos:r,p:s}=e;return t.start=r,t.end=Math.min(r+1,s.stream.end),t.value=r==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,r){let s=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let a=0;a<i.specialized.length;a++)if(i.specialized[a]==e.value){let o=i.specializers[a](this.stream.read(e.start,e.end),r);if(o>=0&&r.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,r,s){for(let i=0;i<s;i+=3)if(this.actions[i]==e)return s;return this.actions[s++]=e,this.actions[s++]=t,this.actions[s++]=r,s}addActions(e,t,r,s){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let u=0;u<2;u++)for(let d=a.stateSlot(i,u?2:1);;d+=3){if(o[d]==65535)if(o[d+1]==1)d=qi(o,d+2);else{s==0&&o[d+1]==2&&(s=this.putAction(qi(o,d+2),t,r,s));break}o[d]==t&&(s=this.putAction(qi(o,d+1),t,r,s))}return s}}class VG{constructor(e,t,r,s){this.parser=e,this.input=t,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new XG(t,s),this.tokens=new ZG(e,this.stream),this.topTerm=e.top[1];let{from:i}=s[0];this.stacks=[im.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new LG(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)r.push(o);else{if(this.advanceStack(o,r,e))continue;{s||(s=[],i=[]),s.push(o);let u=this.tokens.getMainToken(o);i.push(u.value,u.end)}}break}}if(!r.length){let a=s&&DG(s);if(a)return Pr&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Pr&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let a=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(a)return Pr&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,u)=>u.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let a=0;a<r.length-1;a++){let o=r[a];for(let u=a+1;u<r.length;u++){let d=r[u];if(o.sameState(d)||o.buffer.length>500&&d.buffer.length>500)if((o.score-d.score||o.buffer.length-d.buffer.length)>0)r.splice(u--,1);else{r.splice(a--,1);continue e}}}r.length>12&&(r.sort((a,o)=>o.score-a.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let a=1;a<r.length;a++)r[a].pos<this.minStackPos&&(this.minStackPos=r[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let s=e.pos,{parser:i}=this,a=Pr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,p=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(s);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?i.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(Ue.contextHash)||0)==p))return e.useNode(m,g),Pr&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof wt)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof wt&&m.positions[0]==0)m=x;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),Pr&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let d=0;d<u.length;){let p=u[d++],m=u[d++],g=u[d++],x=d==u.length||!r,v=x?e:e.split(),y=this.tokens.mainToken;if(v.apply(p,m,y?y.start:v.pos,g),Pr&&console.log(a+this.stackID(v)+` (via ${(p&65536)==0?"shift":`reduce of ${i.getName(p&65535)}`} for ${i.getName(m)} @ ${s}${v==e?"":", split"})`),x)return!0;v.pos>s?t.push(v):r.push(v)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return NP(e,t),!0}}runRecovery(e,t,r){let s=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],u=t[a<<1],d=t[(a<<1)+1],p=Pr?this.stackID(o)+" -> ":"";if(o.deadEnd&&(i||(i=!0,o.restart(),Pr&&console.log(p+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let m=o.split(),g=p;for(let x=0;x<10&&m.forceReduce()&&(Pr&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Pr&&(g=this.stackID(m)+" -> ");for(let x of o.recoverByInsert(u))Pr&&console.log(p+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>o.pos?(d==o.pos&&(d++,u=0),o.recoverByDelete(u,d),Pr&&console.log(p+this.stackID(o)+` (via recover-delete ${this.parser.getName(u)})`),NP(o,r)):(!s||s.score<m.score)&&(s=m)}return s}stackToTree(e){return e.close(),wt.build({buffer:am.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(px||(px=new WeakMap)).get(e);return t||px.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function NP(n,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==n.pos&&r.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class YG{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const mx=n=>n;class VQ{constructor(e){this.start=e.start,this.shift=e.shift||mx,this.reduce=e.reduce||mx,this.reuse=e.reuse||mx,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Da extends SQ{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;o<e.repeatNodeCount;o++)t.push("");let r=Object.keys(e.topRules).map(o=>e.topRules[o][1]),s=[];for(let o=0;o<t.length;o++)s.push([]);function i(o,u,d){s[o].push([u,u.deserialize(String(d))])}if(e.nodeProps)for(let o of e.nodeProps){let u=o[0];typeof u=="string"&&(u=Ue[u]);for(let d=1;d<o.length;){let p=o[d++];if(p>=0)i(p,u,o[d++]);else{let m=o[d+-p];for(let g=-p;g>0;g--)i(o[d++],u,m);d++}}}this.nodeSet=new td(t.map((o,u)=>Pn.define({name:u>=this.minRepeatTerm?void 0:o,id:u,props:s[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=lX;let a=Ju(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(CP),this.states=Ju(e.states,Uint32Array),this.data=Ju(e.stateData),this.goto=Ju(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new lc(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let s=new VG(this,e,t,r);for(let i of this.wrappers)s=i(s,e,t,r);return s}getGoto(e,t,r=!1){let s=this.goto;if(t>=s[0])return-1;for(let i=s[t+1];;){let a=s[i++],o=a&1,u=s[i++];if(o&&r)return u;for(let d=i+(a>>1);i<d;i++)if(s[i]==e)return u;if(o)return-1}}hasAction(e,t){let r=this.data;for(let s=0;s<2;s++)for(let i=this.stateSlot(e,s?2:1),a;;i+=3){if((a=r[i])==65535)if(r[i+1]==1)a=r[i=qi(r,i+2)];else{if(r[i+1]==2)return qi(r,i+2);break}if(a==t||a==0)return qi(r,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),s=r?t(r):void 0;for(let i=this.stateSlot(e,1);s==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=qi(this.data,i+2);else break;s=t(qi(this.data,i+1))}return s}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=qi(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];t.some((i,a)=>a&1&&i==s)||t.push(this.data[r],s)}}return t}configure(e){let t=Object.assign(Object.create(Da.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(o=>o.from==r.external);if(!i)return r;let a=Object.assign(Object.assign({},r),{external:i.to});return t.specializers[s]=CP(a),a})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let i of e.split(" ")){let a=t.indexOf(i);a>=0&&(r[a]=!0)}let s=null;for(let i=0;i<t.length;i++)if(!r[i])for(let a=this.dialects[t[i]],o;(o=this.data[a++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[o]=1;return new YG(e,r,s)}static deserialize(e){return new Da(e)}}function qi(n,e){return n[e]|n[e+1]<<16}function DG(n){let e=null;for(let t of n){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function CP(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}const BG=55,UG=1,WG=56,GG=2,IG=57,HG=3,RP=4,FG=5,YQ=6,_7=7,P7=8,N7=9,C7=10,KG=11,JG=12,eI=13,Ox=58,tI=14,nI=15,EP=59,R7=21,rI=23,E7=24,sI=25,p2=27,A7=28,iI=29,aI=32,lI=35,oI=37,cI=38,uI=0,fI=1,dI={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},hI={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},AP={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function pI(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let qP=null,MP=null,XP=0;function m2(n,e){let t=n.pos+e;if(XP==t&&MP==n)return qP;let r=n.peek(e),s="";for(;pI(r);)s+=String.fromCharCode(r),r=n.peek(++e);return MP=n,XP=t,qP=s?s.toLowerCase():r==mI||r==OI?void 0:null}const q7=60,om=62,DQ=47,mI=63,OI=33,gI=45;function zP(n,e){this.name=n,this.parent=e}const xI=[YQ,C7,_7,P7,N7],bI=new VQ({start:null,shift(n,e,t,r){return xI.indexOf(e)>-1?new zP(m2(r,1)||"",n):n},reduce(n,e){return e==R7&&n?n.parent:n},reuse(n,e,t,r){let s=e.type.id;return s==YQ||s==oI?new zP(m2(r,1)||"",n):n},strict:!1}),yI=new Vn((n,e)=>{if(n.next!=q7){n.next<0&&e.context&&n.acceptToken(Ox);return}n.advance();let t=n.next==DQ;t&&n.advance();let r=m2(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?nI:tI);let s=e.context?e.context.name:null;if(t){if(r==s)return n.acceptToken(KG);if(s&&hI[s])return n.acceptToken(Ox,-2);if(e.dialectEnabled(uI))return n.acceptToken(JG);for(let i=e.context;i;i=i.parent)if(i.name==r)return;n.acceptToken(eI)}else{if(r=="script")return n.acceptToken(_7);if(r=="style")return n.acceptToken(P7);if(r=="textarea")return n.acceptToken(N7);if(dI.hasOwnProperty(r))return n.acceptToken(C7);s&&AP[s]&&AP[s][r]?n.acceptToken(Ox,-1):n.acceptToken(YQ)}},{contextual:!0}),vI=new Vn(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(EP);break}if(n.next==gI)e++;else if(n.next==om&&e>=2){t>=3&&n.acceptToken(EP,-2);break}else e=0;n.advance()}});function wI(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const SI=new Vn((n,e)=>{if(n.next==DQ&&n.peek(1)==om){let t=e.dialectEnabled(fI)||wI(e.context);n.acceptToken(t?FG:RP,2)}else n.next==om&&n.acceptToken(RP,1)});function BQ(n,e,t){let r=2+n.length;return new Vn(s=>{for(let i=0,a=0,o=0;;o++){if(s.next<0){o&&s.acceptToken(e);break}if(i==0&&s.next==q7||i==1&&s.next==DQ||i>=2&&i<r&&s.next==n.charCodeAt(i-2))i++,a++;else if(i==r&&s.next==om){o>a?s.acceptToken(e,-a):s.acceptToken(t,-(a-2));break}else if((s.next==10||s.next==13)&&o){s.acceptToken(e,1);break}else i=a=0;s.advance()}})}const QI=BQ("script",BG,UG),kI=BQ("style",WG,GG),$I=BQ("textarea",IG,HG),TI=Ua({"Text RawText IncompleteTag IncompleteCloseTag":Y.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Y.angleBracket,TagName:Y.tagName,"MismatchedCloseTag/TagName":[Y.tagName,Y.invalid],AttributeName:Y.attributeName,"AttributeValue UnquotedAttributeValue":Y.attributeValue,Is:Y.definitionOperator,"EntityReference CharacterReference":Y.character,Comment:Y.blockComment,ProcessingInst:Y.processingInstruction,DoctypeDecl:Y.documentMeta}),jI=Da.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%a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#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:bI,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[TI],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<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b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[QI,kI,$I,SI,yI,vI,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function M7(n,e){let t=Object.create(null);for(let r of n.getChildren(E7)){let s=r.getChild(sI),i=r.getChild(p2)||r.getChild(A7);s&&(t[e.read(s.from,s.to)]=i?i.type.id==p2?e.read(i.from+1,i.to-1):e.read(i.from,i.to):"")}return t}function LP(n,e){let t=n.getChild(rI);return t?e.read(t.from,t.to):" "}function gx(n,e,t){let r;for(let s of t)if(!s.attrs||s.attrs(r||(r=M7(n.node.parent.firstChild,e))))return{parser:s.parser,bracketed:!0};return null}function X7(n=[],e=[]){let t=[],r=[],s=[],i=[];for(let o of n)(o.tag=="script"?t:o.tag=="style"?r:o.tag=="textarea"?s:i).push(o);let a=e.length?Object.create(null):null;for(let o of e)(a[o.name]||(a[o.name]=[])).push(o);return fX((o,u)=>{let d=o.type.id;if(d==iI)return gx(o,u,t);if(d==aI)return gx(o,u,r);if(d==lI)return gx(o,u,s);if(d==R7&&i.length){let p=o.node,m=p.firstChild,g=m&&LP(m,u),x;if(g){for(let v of i)if(v.tag==g&&(!v.attrs||v.attrs(x||(x=M7(m,u))))){let y=p.lastChild,S=y.type.id==cI?y.from:p.to;if(S>m.to)return{parser:v.parser,overlay:[{from:m.to,to:S}]}}}}if(a&&d==E7){let p=o.node,m;if(m=p.firstChild){let g=a[u.read(m.from,m.to)];if(g)for(let x of g){if(x.tagName&&x.tagName!=LP(p.parent,u))continue;let v=p.lastChild;if(v.type.id==p2){let y=v.from+1,S=v.lastChild,Q=v.to-(S&&S.isError?0:1);if(Q>y)return{parser:x.parser,overlay:[{from:y,to:Q}],bracketed:!0}}else if(v.type.id==A7)return{parser:x.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const _I=122,ZP=1,PI=123,NI=124,z7=2,CI=125,RI=3,EI=4,L7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],AI=58,qI=40,Z7=95,MI=91,$p=45,XI=46,zI=35,LI=37,ZI=38,VI=92,YI=10,DI=42;function Af(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function UQ(n){return n>=48&&n<=57}function VP(n){return UQ(n)||n>=97&&n<=102||n>=65&&n<=70}const V7=(n,e,t)=>(r,s)=>{for(let i=!1,a=0,o=0;;o++){let{next:u}=r;if(Af(u)||u==$p||u==Z7||i&&UQ(u))!i&&(u!=$p||o>0)&&(i=!0),a===o&&u==$p&&a++,r.advance();else if(u==VI&&r.peek(1)!=YI){if(r.advance(),VP(r.next)){do r.advance();while(VP(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();i=!0}else{i&&r.acceptToken(a==2&&s.canShift(z7)?e:u==qI?t:n);break}}},BI=new Vn(V7(PI,z7,NI)),UI=new Vn(V7(CI,RI,EI)),WI=new Vn(n=>{if(L7.includes(n.peek(-1))){let{next:e}=n;(Af(e)||e==Z7||e==zI||e==XI||e==DI||e==MI||e==AI&&Af(n.peek(1))||e==$p||e==ZI)&&n.acceptToken(_I)}}),GI=new Vn(n=>{if(!L7.includes(n.peek(-1))){let{next:e}=n;if(e==LI&&(n.advance(),n.acceptToken(ZP)),Af(e)){do n.advance();while(Af(n.next)||UQ(n.next));n.acceptToken(ZP)}}}),II=Ua({"AtKeyword import charset namespace keyframes media supports":Y.definitionKeyword,"from to selector":Y.keyword,NamespaceName:Y.namespace,KeyframeName:Y.labelName,KeyframeRangeName:Y.operatorKeyword,TagName:Y.tagName,ClassName:Y.className,PseudoClassName:Y.constant(Y.className),IdName:Y.labelName,"FeatureName PropertyName":Y.propertyName,AttributeName:Y.attributeName,NumberLiteral:Y.number,KeywordQuery:Y.keyword,UnaryQueryOp:Y.operatorKeyword,"CallTag ValueName":Y.atom,VariableName:Y.variableName,Callee:Y.operatorKeyword,Unit:Y.unit,"UniversalSelector NestingSelector":Y.definitionOperator,"MatchOp CompareOp":Y.compareOperator,"ChildOp SiblingOp, LogicOp":Y.logicOperator,BinOp:Y.arithmeticOperator,Important:Y.modifier,Comment:Y.blockComment,ColorLiteral:Y.color,"ParenthesizedContent StringLiteral":Y.string,":":Y.punctuation,"PseudoOp #":Y.derefOperator,"; ,":Y.separator,"( )":Y.paren,"[ ]":Y.squareBracket,"{ }":Y.brace}),HI={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},FI={__proto__:null,or:98,and:98,not:106,only:106,layer:170},KI={__proto__:null,selector:112,layer:166},JI={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},eH={__proto__:null,to:207},tH=Da.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#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et RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[II],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%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}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[WI,GI,BI,UI,1,2,3,4,new lm("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:n=>HI[n]||-1},{term:125,get:n=>FI[n]||-1},{term:4,get:n=>KI[n]||-1},{term:25,get:n=>JI[n]||-1},{term:123,get:n=>eH[n]||-1}],tokenPrec:1963});let xx=null;function bx(){if(!xx&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let r in n)r!="cssText"&&r!="cssFloat"&&typeof n[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(r)||(e.push(r),t.add(r)));xx=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return xx||[]}const YP=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),DP=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),nH=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),rH=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),_i=/^(\w[\w-]*|-\w[\w-]*|)$/,sH=/^-(-[\w-]*)?$/;function iH(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let r=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const BP=new wQ,aH=["Declaration"];function lH(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function Y7(n,e,t){if(e.to-e.from>4096){let r=BP.get(e);if(r)return r;let s=[],i=new Set,a=e.cursor(vt.IncludeAnonymous);if(a.firstChild())do for(let o of Y7(n,a.node,t))i.has(o.label)||(i.add(o.label),s.push(o));while(a.nextSibling());return BP.set(e,s),s}else{let r=[],s=new Set;return e.cursor().iterate(i=>{var a;if(t(i)&&i.matchContext(aH)&&((a=i.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=n.sliceString(i.from,i.to);s.has(o)||(s.add(o),r.push({label:o,type:"variable"}))}}),r}}const oH=n=>e=>{let{state:t,pos:r}=e,s=Jt(t).resolveInner(r,-1),i=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(i||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:bx(),validFor:_i};if(s.name=="ValueName")return{from:s.from,options:DP,validFor:_i};if(s.name=="PseudoClassName")return{from:s.from,options:YP,validFor:_i};if(n(s)||(e.explicit||i)&&iH(s,t.doc))return{from:n(s)||i?s.from:r,options:Y7(t.doc,lH(s),n),validFor:sH};if(s.name=="TagName"){for(let{parent:u}=s;u;u=u.parent)if(u.name=="Block")return{from:s.from,options:bx(),validFor:_i};return{from:s.from,options:nH,validFor:_i}}if(s.name=="AtKeyword")return{from:s.from,options:rH,validFor:_i};if(!e.explicit)return null;let a=s.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:YP,validFor:_i}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:DP,validFor:_i}:a.name=="Block"||a.name=="Styles"?{from:r,options:bx(),validFor:_i}:null},cH=oH(n=>n.name=="VariableName"),cm=Ya.define({name:"css",parser:tH.configure({props:[Dl.add({Declaration:Tl()}),Bl.add({"Block KeyframeList":Bm})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function uH(){return new Ml(cm,cm.data.of({autocomplete:cH}))}const fH=316,dH=317,UP=1,hH=2,pH=3,mH=4,OH=318,gH=320,xH=321,bH=5,yH=6,vH=0,O2=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],D7=125,wH=59,g2=47,SH=42,QH=43,kH=45,$H=60,TH=44,jH=63,_H=46,PH=91,NH=new VQ({start:!1,shift(n,e){return e==bH||e==yH||e==gH?n:e==xH},strict:!1}),CH=new Vn((n,e)=>{let{next:t}=n;(t==D7||t==-1||e.context)&&n.acceptToken(OH)},{contextual:!0,fallback:!0}),RH=new Vn((n,e)=>{let{next:t}=n,r;O2.indexOf(t)>-1||t==g2&&((r=n.peek(1))==g2||r==SH)||t!=D7&&t!=wH&&t!=-1&&!e.context&&n.acceptToken(fH)},{contextual:!0}),EH=new Vn((n,e)=>{n.next==PH&&!e.context&&n.acceptToken(dH)},{contextual:!0}),AH=new Vn((n,e)=>{let{next:t}=n;if(t==QH||t==kH){if(n.advance(),t==n.next){n.advance();let r=!e.context&&e.canShift(UP);n.acceptToken(r?UP:hH)}}else t==jH&&n.peek(1)==_H&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(pH))},{contextual:!0});function yx(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const qH=new Vn((n,e)=>{if(n.next!=$H||!e.dialectEnabled(vH)||(n.advance(),n.next==g2))return;let t=0;for(;O2.indexOf(n.next)>-1;)n.advance(),t++;if(yx(n.next,!0)){for(n.advance(),t++;yx(n.next,!1);)n.advance(),t++;for(;O2.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==TH)return;for(let r=0;;r++){if(r==7){if(!yx(n.next,!0))return;break}if(n.next!="extends".charCodeAt(r))break;n.advance(),t++}}n.acceptToken(mH,-t)}),MH=Ua({"get set async static":Y.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Y.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Y.operatorKeyword,"let var const using function class extends":Y.definitionKeyword,"import export from":Y.moduleKeyword,"with debugger new":Y.keyword,TemplateString:Y.special(Y.string),super:Y.atom,BooleanLiteral:Y.bool,this:Y.self,null:Y.null,Star:Y.modifier,VariableName:Y.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Y.function(Y.variableName),VariableDefinition:Y.definition(Y.variableName),Label:Y.labelName,PropertyName:Y.propertyName,PrivatePropertyName:Y.special(Y.propertyName),"CallExpression/MemberExpression/PropertyName":Y.function(Y.propertyName),"FunctionDeclaration/VariableDefinition":Y.function(Y.definition(Y.variableName)),"ClassDeclaration/VariableDefinition":Y.definition(Y.className),"NewExpression/VariableName":Y.className,PropertyDefinition:Y.definition(Y.propertyName),PrivatePropertyDefinition:Y.definition(Y.special(Y.propertyName)),UpdateOp:Y.updateOperator,"LineComment Hashbang":Y.lineComment,BlockComment:Y.blockComment,Number:Y.number,String:Y.string,Escape:Y.escape,ArithOp:Y.arithmeticOperator,LogicOp:Y.logicOperator,BitOp:Y.bitwiseOperator,CompareOp:Y.compareOperator,RegExp:Y.regexp,Equals:Y.definitionOperator,Arrow:Y.function(Y.punctuation),": Spread":Y.punctuation,"( )":Y.paren,"[ ]":Y.squareBracket,"{ }":Y.brace,"InterpolationStart InterpolationEnd":Y.special(Y.brace),".":Y.derefOperator,", ;":Y.separator,"@":Y.meta,TypeName:Y.typeName,TypeDefinition:Y.definition(Y.typeName),"type enum interface implements namespace module declare":Y.definitionKeyword,"abstract global Privacy readonly override":Y.modifier,"is keyof unique infer asserts":Y.operatorKeyword,JSXAttributeValue:Y.attributeValue,JSXText:Y.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Y.angleBracket,"JSXIdentifier JSXNameSpacedName":Y.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Y.attributeName,"JSXBuiltin/JSXIdentifier":Y.standard(Y.tagName)}),XH={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},zH={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},LH={__proto__:null,"<":193},ZH=Da.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ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QT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:NH,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[MH],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(r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#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new lm("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>XH[n]||-1},{term:343,get:n=>zH[n]||-1},{term:95,get:n=>LH[n]||-1}],tokenPrec:15201}),B7=[It("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),It("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),It("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),It("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),It("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),It(`try {
|
|
218
|
-
\${}
|
|
219
|
-
} catch (\${error}) {
|
|
220
|
-
\${}
|
|
221
|
-
}`,{label:"try",detail:"/ catch block",type:"keyword"}),It("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),It(`if (\${}) {
|
|
222
|
-
\${}
|
|
223
|
-
} else {
|
|
224
|
-
\${}
|
|
225
|
-
}`,{label:"if",detail:"/ else block",type:"keyword"}),It(`class \${name} {
|
|
226
|
-
constructor(\${params}) {
|
|
227
|
-
\${}
|
|
228
|
-
}
|
|
229
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),It('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),It('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],VH=B7.concat([It("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),It("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),It("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),WP=new wQ,U7=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Lu(n){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,n),!0}}const YH=["FunctionDeclaration"],DH={FunctionDeclaration:Lu("function"),ClassDeclaration:Lu("class"),ClassExpression:()=>!0,EnumDeclaration:Lu("constant"),TypeAliasDeclaration:Lu("type"),NamespaceDeclaration:Lu("namespace"),VariableDefinition(n,e){n.matchContext(YH)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function W7(n,e){let t=WP.get(e);if(t)return t;let r=[],s=!0;function i(a,o){let u=n.sliceString(a.from,a.to);r.push({label:u,type:o})}return e.cursor(vt.IncludeAnonymous).iterate(a=>{if(s)s=!1;else if(a.name){let o=DH[a.name];if(o&&o(a,i)||U7.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of W7(n,a.node))r.push(o);return!1}}),WP.set(e,r),r}const GP=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,G7=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function BH(n){let e=Jt(n.state).resolveInner(n.pos,-1);if(G7.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&GP.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let s=e;s;s=s.parent)U7.has(s.name)&&(r=r.concat(W7(n.state.doc,s)));return{options:r,from:t?e.from:n.pos,validFor:GP}}const ni=Ya.define({name:"javascript",parser:ZH.configure({props:[Dl.add({IfStatement:Tl({except:/^\s*({|else\b)/}),TryStatement:Tl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:xX,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:hf({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Tl({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Bl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Bm,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),I7={test:n=>/^JSX/.test(n.name),facet:QQ({commentTokens:{block:{open:"{/*",close:"*/}"}}})},H7=ni.configure({dialect:"ts"},"typescript"),F7=ni.configure({dialect:"jsx",props:[kQ.add(n=>n.isTop?[I7]:void 0)]}),K7=ni.configure({dialect:"jsx ts",props:[kQ.add(n=>n.isTop?[I7]:void 0)]},"typescript");let J7=n=>({label:n,type:"keyword"});const ez="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(J7),UH=ez.concat(["declare","implements","private","protected","public"].map(J7));function tz(n={}){let e=n.jsx?n.typescript?K7:F7:n.typescript?H7:ni,t=n.typescript?VH.concat(UH):B7.concat(ez);return new Ml(e,[ni.data.of({autocomplete:FX(G7,NQ(t))}),ni.data.of({autocomplete:BH}),n.jsx?IH:[]])}function WH(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function IP(n,e,t=n.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return n.sliceString(r.from,Math.min(r.to,t));return""}const GH=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),IH=Ae.inputHandler.of((n,e,t,r,s)=>{if((GH?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!ni.isActiveAt(n.state,e,-1))return!1;let i=s(),{state:a}=i,o=a.changeByRange(u=>{var d;let{head:p}=u,m=Jt(a).resolveInner(p-1,-1),g;if(m.name=="JSXStartTag"&&(m=m.parent),!(a.doc.sliceString(p-1,p)!=r||m.name=="JSXAttributeValue"&&m.to>p)){if(r==">"&&m.name=="JSXFragmentTag")return{range:u,changes:{from:p,insert:"</>"}};if(r=="/"&&m.name=="JSXStartCloseTag"){let x=m.parent,v=x.parent;if(v&&x.from==p-2&&((g=IP(a.doc,v.firstChild,p))||((d=v.firstChild)===null||d===void 0?void 0:d.name)=="JSXFragmentTag")){let y=`${g}>`;return{range:ve.cursor(p+y.length,-1),changes:{from:p,insert:y}}}}else if(r==">"){let x=WH(m);if(x&&x.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(p,p+2))&&(g=IP(a.doc,x,p)))return{range:u,changes:{from:p,insert:`</${g}>`}}}}return{range:u}});return o.changes.empty?!1:(n.dispatch([i,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Zu=["_blank","_self","_top","_parent"],vx=["ascii","utf-8","utf-16","latin1","latin1"],wx=["get","post","put","delete"],Sx=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Nr=["true","false"],Me={},HH={a:{attrs:{href:null,ping:null,type:null,media:null,target:Zu,hreflang:null}},abbr:Me,address:Me,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Me,aside:Me,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Me,base:{attrs:{href:null,target:Zu}},bdi:Me,bdo:Me,blockquote:{attrs:{cite:null}},body:Me,br:Me,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Sx,formmethod:wx,formnovalidate:["novalidate"],formtarget:Zu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Me,center:Me,cite:Me,code:Me,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Me,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Me,div:Me,dl:Me,dt:Me,em:Me,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Me,figure:Me,footer:Me,form:{attrs:{action:null,name:null,"accept-charset":vx,autocomplete:["on","off"],enctype:Sx,method:wx,novalidate:["novalidate"],target:Zu}},h1:Me,h2:Me,h3:Me,h4:Me,h5:Me,h6:Me,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Me,hgroup:Me,hr:Me,html:{attrs:{manifest:null}},i:Me,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Sx,formmethod:wx,formnovalidate:["novalidate"],formtarget:Zu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Me,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Me,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Me,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:vx,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Me,noscript:Me,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Me,param:{attrs:{name:null,value:null}},pre:Me,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Me,rt:Me,ruby:Me,samp:Me,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:vx}},section:Me,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Me,source:{attrs:{src:null,type:null,media:null}},span:Me,strong:Me,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Me,summary:Me,sup:Me,table:Me,tbody:Me,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Me,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Me,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Me,time:{attrs:{datetime:null}},title:Me,tr:Me,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Me,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Me},nz={accesskey:null,class:null,contenteditable:Nr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Nr,autocorrect:Nr,autocapitalize:Nr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Nr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Nr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Nr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Nr,"aria-hidden":Nr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Nr,"aria-multiselectable":Nr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Nr,"aria-relevant":null,"aria-required":Nr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},rz="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of rz)nz[n]=null;class qf{constructor(e,t){this.tags={...HH,...e},this.globalAttrs={...nz,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}qf.default=new qf;function yc(n,e,t=n.length){if(!e)return"";let r=e.firstChild,s=r&&r.getChild("TagName");return s?n.sliceString(s.from,Math.min(s.to,t)):""}function vc(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function sz(n,e,t){let r=t.tags[yc(n,vc(e))];return(r==null?void 0:r.children)||t.allTags}function WQ(n,e){let t=[];for(let r=vc(e);r&&!r.type.isTop;r=vc(r.parent)){let s=yc(n,r);if(s&&r.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(s)}return t}const iz=/^[:\-\.\w\u00b7-\uffff]*$/;function HP(n,e,t,r,s){let i=/\s*>/.test(n.sliceDoc(s,s+5))?"":">",a=vc(t,t.name=="StartTag"||t.name=="TagName");return{from:r,to:s,options:sz(n.doc,a,e).map(o=>({label:o,type:"type"})).concat(WQ(n.doc,t).map((o,u)=>({label:"/"+o,apply:"/"+o+i,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function FP(n,e,t,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:WQ(n.doc,e).map((i,a)=>({label:i,apply:i+s,type:"type",boost:99-a})),validFor:iz}}function FH(n,e,t,r){let s=[],i=0;for(let a of sz(n.doc,t,e))s.push({label:"<"+a,type:"type"});for(let a of WQ(n.doc,t))s.push({label:"</"+a+">",type:"type",boost:99-i++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function KH(n,e,t,r,s){let i=vc(t),a=i?e.tags[yc(n.doc,i)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],u=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:s,options:u.map(d=>({label:d,type:"property"})),validFor:iz}}function JH(n,e,t,r,s){var i;let a=(i=t.parent)===null||i===void 0?void 0:i.getChild("AttributeName"),o=[],u;if(a){let d=n.sliceDoc(a.from,a.to),p=e.globalAttrs[d];if(!p){let m=vc(t),g=m?e.tags[yc(n.doc,m)]:null;p=(g==null?void 0:g.attrs)&&g.attrs[d]}if(p){let m=n.sliceDoc(r,s).toLowerCase(),g='"',x='"';/^['"]/.test(m)?(u=m[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",x=n.sliceDoc(s,s+1)==m[0]?"":m[0],m=m.slice(1),r++):u=/^[^\s<>='"]*$/;for(let v of p)o.push({label:v,apply:g+v+x,type:"constant"})}}return{from:r,to:s,options:o,validFor:u}}function az(n,e){let{state:t,pos:r}=e,s=Jt(t).resolveInner(r,-1),i=s.resolve(r);for(let a=r,o;i==s&&(o=s.childBefore(a));){let u=o.lastChild;if(!u||!u.type.isError||u.from<u.to)break;i=s=o,a=u.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?FP(t,s,s.from,r):HP(t,n,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?HP(t,n,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?FP(t,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?KH(t,n,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?JH(t,n,s,s.name=="Is"?r:s.from,r):e.explicit&&(i.name=="Element"||i.name=="Text"||i.name=="Document")?FH(t,n,s,r):null}function eF(n){return az(qf.default,n)}function tF(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new qf(e,t):qf.default;return s=>az(r,s)}const nF=ni.parser.configure({top:"SingleExpression"}),lz=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:H7.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:F7.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:K7.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:nF},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:ni.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:cm.parser}],oz=[{name:"style",parser:cm.parser.configure({top:"Styles"})}].concat(rz.map(n=>({name:n,parser:ni.parser}))),cz=Ya.define({name:"html",parser:jI.configure({props:[Dl.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;e=r=s}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),Bl.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),bX.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Tp=cz.configure({wrap:X7(lz,oz)});function rF(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=X7((n.nestedLanguages||[]).concat(lz),(n.nestedAttributes||[]).concat(oz)));let r=t?cz.configure({wrap:t,dialect:e}):e?Tp.configure({dialect:e}):Tp;return new Ml(r,[Tp.data.of({autocomplete:tF(n)}),n.autoCloseTags!==!1?sF:[],tz().support,uH().support])}const KP=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),sF=Ae.inputHandler.of((n,e,t,r,s)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Tp.isActiveAt(n.state,e,-1))return!1;let i=s(),{state:a}=i,o=a.changeByRange(u=>{var d,p,m;let g=a.doc.sliceString(u.from-1,u.to)==r,{head:x}=u,v=Jt(a).resolveInner(x,-1),y;if(g&&r==">"&&v.name=="EndTag"){let S=v.parent;if(((p=(d=S.parent)===null||d===void 0?void 0:d.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(y=yc(a.doc,S.parent,x))&&!KP.has(y)){let Q=x+(a.doc.sliceString(x,x+1)===">"?1:0),k=`</${y}>`;return{range:u,changes:{from:x,to:Q,insert:k}}}}else if(g&&r=="/"&&v.name=="IncompleteCloseTag"){let S=v.parent;if(v.from==x-2&&((m=S.lastChild)===null||m===void 0?void 0:m.name)!="CloseTag"&&(y=yc(a.doc,S,x))&&!KP.has(y)){let Q=x+(a.doc.sliceString(x,x+1)===">"?1:0),k=`${y}>`;return{range:ve.cursor(x+k.length,-1),changes:{from:x,to:Q,insert:k}}}}return{range:u}});return o.changes.empty?!1:(n.dispatch([i,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),uz=QQ({commentTokens:{block:{open:"<!--",close:"-->"}}}),fz=new Ue,dz=wG.configure({props:[Bl.add(n=>!n.is("Block")||n.is("Document")||x2(n)!=null||iF(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),fz.add(x2),Dl.add({Document:()=>null}),Ql.add({Document:uz})]});function x2(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function iF(n){return n.name=="OrderedList"||n.name=="BulletList"}function aF(n,e){let t=n;for(;;){let r=t.nextSibling,s;if(!r||(s=x2(r.type))!=null&&s<=e)break;t=r}return t.to}const lF=nU.of((n,e,t)=>{for(let r=Jt(n).resolveInner(t,-1);r&&!(r.from<e);r=r.parent){let s=r.type.prop(fz);if(s==null)continue;let i=aF(r,s);if(i>t)return{from:t,to:i}}return null});function GQ(n){return new Hr(uz,n,[],"markdown")}const oF=GQ(dz),cF=dz.configure([RG,AG,EG,qG,{props:[Bl.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),um=GQ(cF);function uF(n,e){return t=>{if(t&&n){let r=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?r=n(t):r=Fp.matchLanguageName(n,t,!0),r instanceof Fp)return r.support?r.support.language.parser:Pf.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}let Qx=class{constructor(e,t,r,s,i,a,o){this.node=e,this.from=t,this.to=r,this.spaceBefore=s,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(t?this.spaceAfter:"")}}marker(e,t){let r=this.node.name=="OrderedList"?String(+pz(this.item,e)[2]+t):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function hz(n,e){let t=[],r=[];for(let s=n;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&t.push(s)}for(let s=t.length-1;s>=0;s--){let i=t[s],a,o=e.lineAt(i.from),u=i.from-o.from;if(i.name=="Blockquote"&&(a=/^ *>( ?)/.exec(o.text.slice(u))))r.push(new Qx(i,u,u+a[0].length,"",a[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(u)))){let d=a[3],p=a[0].length;d.length>=4&&(d=d.slice(0,d.length-4),p-=4),r.push(new Qx(i.parent,u,u+p,a[1],d,a[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(u)))){let d=a[4],p=a[0].length;d.length>4&&(d=d.slice(0,d.length-4),p-=4);let m=a[2];a[3]&&(m+=a[3].replace(/[xX]/," ")),r.push(new Qx(i.parent,u,u+p,a[1],d,m,i))}}return r}function pz(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function kx(n,e,t,r=0){for(let s=-1,i=n;;){if(i.name=="ListItem"){let o=pz(i,e),u=+o[2];if(s>=0){if(u!=s+1)return;t.push({from:i.from+o[1].length,to:i.from+o[0].length,insert:String(s+2+r)})}s=u}let a=i.nextSibling;if(!a)break;i=a}}function IQ(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(nd)!=" ")return n;let r=Bi(n,4,t),s="";for(let i=r;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+n.slice(t)}const fF=(n={})=>({state:e,dispatch:t})=>{let r=Jt(e),{doc:s}=e,i=null,a=e.changeByRange(o=>{if(!o.empty||!um.isActiveAt(e,o.from,-1)&&!um.isActiveAt(e,o.from,1))return i={range:o};let u=o.from,d=s.lineAt(u),p=hz(r.resolveInner(u,-1),s);for(;p.length&&p[p.length-1].from>u-d.from;)p.pop();if(!p.length)return i={range:o};let m=p[p.length-1];if(m.to-m.spaceAfter.length>u-d.from)return i={range:o};let g=u>=m.to-m.spaceAfter.length&&!/\S/.test(d.text.slice(m.to));if(m.item&&g){let Q=m.node.firstChild,k=m.node.getChild("ListItem","ListItem");if(Q.to>=u||k&&k.to<u||d.from>0&&!/[^\s>]/.test(s.lineAt(d.from-1).text)||n.nonTightLists===!1){let $=p.length>1?p[p.length-2]:null,j,T="";$&&$.item?(j=d.from+$.from,T=$.marker(s,1)):j=d.from+($?$.to:0);let R=[{from:j,to:u,insert:T}];return m.node.name=="OrderedList"&&kx(m.item,s,R,-2),$&&$.node.name=="OrderedList"&&kx($.item,s,R),{range:ve.cursor(j+T.length),changes:R}}else{let $=e4(p,e,d);return{range:ve.cursor(u+$.length+1),changes:{from:d.from,insert:$+e.lineBreak}}}}if(m.node.name=="Blockquote"&&g&&d.from){let Q=s.lineAt(d.from-1),k=/>\s*$/.exec(Q.text);if(k&&k.index==m.from){let $=e.changes([{from:Q.from+k.index,to:Q.to},{from:d.from+m.from,to:d.to}]);return{range:o.map($),changes:$}}}let x=[];m.node.name=="OrderedList"&&kx(m.item,s,x);let v=m.item&&m.item.from<d.from,y="";if(!v||/^[\s\d.)\-+*>]*/.exec(d.text)[0].length>=m.to)for(let Q=0,k=p.length-1;Q<=k;Q++)y+=Q==k&&!v?p[Q].marker(s,1):p[Q].blank(Q<k?Bi(d.text,4,p[Q+1].from)-y.length:null);let S=u;for(;S>d.from&&/\s/.test(d.text.charAt(S-d.from-1));)S--;return y=IQ(y,e),hF(m.node,e.doc)&&(y=e4(p,e,d)+e.lineBreak+y),x.push({from:S,to:u,insert:e.lineBreak+y}),{range:ve.cursor(S+y.length+1),changes:x}});return i?!1:(t(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},dF=fF();function JP(n){return n.name=="QuoteMark"||n.name=="ListMark"}function hF(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,r=n.getChild("ListItem","ListItem");if(!r)return!1;let s=e.lineAt(t.to),i=e.lineAt(r.from),a=/^[\s>]*$/.test(s.text);return s.number+(a?0:1)<i.number}function e4(n,e,t){let r="";for(let s=0,i=n.length-2;s<=i;s++)r+=n[s].blank(s<i?Bi(t.text,4,n[s+1].from)-r.length:null,s<i);return IQ(r,e)}function pF(n,e){let t=n.resolveInner(e,-1),r=e;JP(t)&&(r=t.from,t=t.parent);for(let s;s=t.childBefore(r);)if(JP(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")t=s.lastChild,r=t.to;else break;return t}const mF=({state:n,dispatch:e})=>{let t=Jt(n),r=null,s=n.changeByRange(i=>{let a=i.from,{doc:o}=n;if(i.empty&&um.isActiveAt(n,i.from)){let u=o.lineAt(a),d=hz(pF(t,a),o);if(d.length){let p=d[d.length-1],m=p.to-p.spaceAfter.length+(p.spaceAfter?1:0);if(a-u.from>m&&!/\S/.test(u.text.slice(m,a-u.from)))return{range:ve.cursor(u.from+m),changes:{from:u.from+m,to:a}};if(a-u.from==m&&(!p.item||u.from<=p.item.from||!/\S/.test(u.text.slice(0,p.to)))){let g=u.from+p.from;if(p.item&&p.node.from<p.item.from&&/\S/.test(u.text.slice(p.from,p.to))){let x=p.blank(Bi(u.text,4,p.to)-Bi(u.text,4,p.from));return g==u.from&&(x=IQ(x,n)),{range:ve.cursor(g+x.length),changes:{from:g,to:u.from+p.to,insert:x}}}if(g<a)return{range:ve.cursor(g),changes:{from:g,to:a}}}}}return r={range:i}});return r?!1:(e(n.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},OF=[{key:"Enter",run:dF},{key:"Backspace",run:mF}],mz=rF({matchClosingTags:!1});function gF(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:r=!0,base:{parser:s}=oF,completeHTMLTags:i=!0,pasteURLAsLink:a=!0,htmlTagLanguage:o=mz}=n;if(!(s instanceof Fm))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=n.extensions?[n.extensions]:[],d=[o.support,lF],p;a&&d.push(vF),t instanceof Ml?(d.push(t.support),p=t.language):t&&(p=t);let m=e||p?uF(e,p):void 0;u.push(QG({codeParser:m,htmlParser:o.language.parser})),r&&d.push(Yl.high(Cc.of(OF)));let g=GQ(s.configure(u));return i&&d.push(g.data.of({autocomplete:xF})),new Ml(g,d)}function xF(n){let{state:e,pos:t}=n,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!r)return null;let s=Jt(e).resolveInner(t,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:t-r[0].length,to:t,options:bF(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let $x=null;function bF(){if($x)return $x;let n=eF(new PQ(xt.create({extensions:mz}),0,!0));return $x=n?n.options:[]}const yF=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,vF=Ae.domEventHandlers({paste:(n,e)=>{var t;let{main:r}=e.state.selection;if(r.empty)return!1;let s=(t=n.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!um.isActiveAt(e.state,r.from,1)))return!1;let i=Jt(e.state),a=!1;return i.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||yF.test(o.name))&&(a=!0)},leave:o=>{o.to<r.to&&(a=!0)}}),a?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),wF=1,Oz=194,gz=195,SF=196,t4=197,QF=198,kF=199,$F=200,TF=2,xz=3,n4=201,jF=24,_F=25,PF=49,NF=50,CF=55,RF=56,EF=57,AF=59,qF=60,MF=61,XF=62,zF=63,LF=65,ZF=238,VF=71,YF=241,DF=242,BF=243,UF=244,WF=245,GF=246,IF=247,HF=248,bz=72,FF=249,KF=250,JF=251,eK=252,tK=253,nK=254,rK=255,sK=256,iK=73,aK=77,lK=263,oK=112,cK=130,uK=151,fK=152,dK=155,Xl=10,Mf=13,HQ=32,Km=9,FQ=35,hK=40,pK=46,b2=123,r4=125,yz=39,vz=34,s4=92,mK=111,OK=120,gK=78,xK=117,bK=85,yK=new Set([_F,PF,NF,lK,LF,cK,RF,EF,ZF,XF,zF,bz,iK,aK,qF,MF,uK,fK,dK,oK]);function Tx(n){return n==Xl||n==Mf}function jx(n){return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}const vK=new Vn((n,e)=>{let t;if(n.next<0)n.acceptToken(kF);else if(e.context.flags&jp)Tx(n.next)&&n.acceptToken(QF,1);else if(((t=n.peek(-1))<0||Tx(t))&&e.canShift(t4)){let r=0;for(;n.next==HQ||n.next==Km;)n.advance(),r++;(n.next==Xl||n.next==Mf||n.next==FQ)&&n.acceptToken(t4,-r)}else Tx(n.next)&&n.acceptToken(SF,1)},{contextual:!0}),wK=new Vn((n,e)=>{let t=e.context;if(t.flags)return;let r=n.peek(-1);if(r==Xl||r==Mf){let s=0,i=0;for(;;){if(n.next==HQ)s++;else if(n.next==Km)s+=8-s%8;else break;n.advance(),i++}s!=t.indent&&n.next!=Xl&&n.next!=Mf&&n.next!=FQ&&(s<t.indent?n.acceptToken(gz,-i):n.acceptToken(Oz))}}),jp=1,wz=2,Ni=4,Ci=8,Ri=16,Ei=32;function _p(n,e,t){this.parent=n,this.indent=e,this.flags=t,this.hash=(n?n.hash+n.hash<<8:0)+e+(e<<4)+t+(t<<6)}const SK=new _p(null,0,0);function QK(n){let e=0;for(let t=0;t<n.length;t++)e+=n.charCodeAt(t)==Km?8-e%8:1;return e}const i4=new Map([[YF,0],[DF,Ni],[BF,Ci],[UF,Ci|Ni],[WF,Ri],[GF,Ri|Ni],[IF,Ri|Ci],[HF,Ri|Ci|Ni],[FF,Ei],[KF,Ei|Ni],[JF,Ei|Ci],[eK,Ei|Ci|Ni],[tK,Ei|Ri],[nK,Ei|Ri|Ni],[rK,Ei|Ri|Ci],[sK,Ei|Ri|Ci|Ni]].map(([n,e])=>[n,e|wz])),kK=new VQ({start:SK,reduce(n,e,t,r){return n.flags&jp&&yK.has(e)||(e==VF||e==bz)&&n.flags&wz?n.parent:n},shift(n,e,t,r){return e==Oz?new _p(n,QK(r.read(r.pos,t.pos)),0):e==gz?n.parent:e==jF||e==CF||e==AF||e==xz?new _p(n,0,jp):i4.has(e)?new _p(n,0,i4.get(e)|n.flags&jp):n},hash(n){return n.hash}}),$K=new Vn(n=>{for(let e=0;e<5;e++){if(n.next!="print".charCodeAt(e))return;n.advance()}if(!/\w/.test(String.fromCharCode(n.next)))for(let e=0;;e++){let t=n.peek(e);if(!(t==HQ||t==Km)){t!=hK&&t!=pK&&t!=Xl&&t!=Mf&&t!=FQ&&n.acceptToken(wF);return}}}),TK=new Vn((n,e)=>{let{flags:t}=e.context,r=t&Ni?vz:yz,s=(t&Ci)>0,i=!(t&Ri),a=(t&Ei)>0,o=n.pos;for(;!(n.next<0);)if(a&&n.next==b2)if(n.peek(1)==b2)n.advance(2);else{if(n.pos==o){n.acceptToken(xz,1);return}break}else if(i&&n.next==s4){if(n.pos==o){n.advance();let u=n.next;u>=0&&(n.advance(),jK(n,u)),n.acceptToken(TF);return}break}else if(n.next==s4&&!i&&n.peek(1)>-1)n.advance(2);else if(n.next==r&&(!s||n.peek(1)==r&&n.peek(2)==r)){if(n.pos==o){n.acceptToken(n4,s?3:1);return}break}else if(n.next==Xl){if(s)n.advance();else if(n.pos==o){n.acceptToken(n4);return}break}else n.advance();n.pos>o&&n.acceptToken($F)});function jK(n,e){if(e==mK)for(let t=0;t<2&&n.next>=48&&n.next<=55;t++)n.advance();else if(e==OK)for(let t=0;t<2&&jx(n.next);t++)n.advance();else if(e==xK)for(let t=0;t<4&&jx(n.next);t++)n.advance();else if(e==bK)for(let t=0;t<8&&jx(n.next);t++)n.advance();else if(e==gK&&n.next==b2){for(n.advance();n.next>=0&&n.next!=r4&&n.next!=yz&&n.next!=vz&&n.next!=Xl;)n.advance();n.next==r4&&n.advance()}}const _K=Ua({'async "*" "**" FormatConversion FormatSpec':Y.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Y.controlKeyword,"in not and or is del":Y.operatorKeyword,"from def class global nonlocal lambda":Y.definitionKeyword,import:Y.moduleKeyword,"with as print":Y.keyword,Boolean:Y.bool,None:Y.null,VariableName:Y.variableName,"CallExpression/VariableName":Y.function(Y.variableName),"FunctionDefinition/VariableName":Y.function(Y.definition(Y.variableName)),"ClassDefinition/VariableName":Y.definition(Y.className),PropertyName:Y.propertyName,"CallExpression/MemberExpression/PropertyName":Y.function(Y.propertyName),Comment:Y.lineComment,Number:Y.number,String:Y.string,FormatString:Y.special(Y.string),Escape:Y.escape,UpdateOp:Y.updateOperator,"ArithOp!":Y.arithmeticOperator,BitOp:Y.bitwiseOperator,CompareOp:Y.compareOperator,AssignOp:Y.definitionOperator,Ellipsis:Y.punctuation,At:Y.meta,"( )":Y.paren,"[ ]":Y.squareBracket,"{ }":Y.brace,".":Y.derefOperator,", ;":Y.separator}),PK={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},NK=Da.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'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j%|&_'w(p(r)t,P%U!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:kK,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[_K],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!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U;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[$K,wK,vK,TK,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:n=>PK[n]||-1}],tokenPrec:7668}),a4=new wQ,Sz=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function ep(n){return(e,t,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&t(s,n),!0}}const CK={FunctionDefinition:ep("function"),ClassDefinition:ep("class"),ForStatement(n,e,t){if(t){for(let r=n.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(n,e){var t,r;let{node:s}=n,i=((t=s.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let a=s.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,i?"variable":"namespace")},AssignStatement(n,e){for(let t=n.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(n,e){for(let t=null,r=n.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(r,"variable"),t=r},CapturePattern:ep("variable"),AsPattern:ep("variable"),__proto__:null};function Qz(n,e){let t=a4.get(e);if(t)return t;let r=[],s=!0;function i(a,o){let u=n.sliceString(a.from,a.to);r.push({label:u,type:o})}return e.cursor(vt.IncludeAnonymous).iterate(a=>{if(a.name){let o=CK[a.name];if(o&&o(a,i,s)||!s&&Sz.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let o of Qz(n,a.node))r.push(o);return!1}}),a4.set(e,r),r}const l4=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,kz=["String","FormatString","Comment","PropertyName"];function RK(n){let e=Jt(n.state).resolveInner(n.pos,-1);if(kz.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&l4.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let s=e;s;s=s.parent)Sz.has(s.name)&&(r=r.concat(Qz(n.state.doc,s)));return{options:r,from:t?e.from:n.pos,validFor:l4}}const EK=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(n=>({label:n,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(n=>({label:n,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(n=>({label:n,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(n=>({label:n,type:"function"}))),AK=[It("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),It("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),It("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),It("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),It(`if \${}:
|
|
230
|
-
|
|
231
|
-
`,{label:"if",detail:"block",type:"keyword"}),It("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),It("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),It("import ${module}",{label:"import",detail:"statement",type:"keyword"}),It("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],qK=FX(kz,NQ(EK.concat(AK)));function _x(n){let{node:e,pos:t}=n,r=n.lineIndent(t,-1),s=null;for(;;){let i=e.childBefore(t);if(i)if(i.name=="Comment")t=i.from;else if(i.name=="Body"||i.name=="MatchBody")n.baseIndentFor(i)+n.unit<=r&&(s=i),e=i;else if(i.name=="MatchClause")e=i;else if(i.type.is("Statement"))e=i;else break;else break}return s}function Px(n,e){let t=n.baseIndentFor(e),r=n.lineAt(n.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&n.node.to<s+100&&!/\S/.test(n.state.sliceDoc(s,n.node.to))&&n.lineIndent(n.pos,-1)<=t||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(n.textAfter)&&n.lineIndent(n.pos,-1)>t?null:t+n.unit}const Nx=Ya.define({name:"python",parser:NK.configure({props:[Dl.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&_x(n)||n.node;return(e=Px(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=_x(n);return(e=Px(n,t||n.node))!==null&&e!==void 0?e:n.continue()},IfStatement:n=>/^\s*(else:|elif )/.test(n.textAfter)?n.baseIndent:n.continue(),"ForStatement WhileStatement":n=>/^\s*else:/.test(n.textAfter)?n.baseIndent:n.continue(),TryStatement:n=>/^\s*(except[ :]|finally:|else:)/.test(n.textAfter)?n.baseIndent:n.continue(),MatchStatement:n=>/^\s*case /.test(n.textAfter)?n.baseIndent+n.unit:n.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":hf({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":hf({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":hf({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=_x(n);return(e=t&&Px(n,t))!==null&&e!==void 0?e:n.continue()}}),Bl.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Bm,Body:(n,e)=>({from:n.from+1,to:n.to-(n.to==e.doc.length?0:1)}),"String FormatString":(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function MK(){return new Ml(Nx,[Nx.data.of({autocomplete:RK}),Nx.data.of({autocomplete:qK})])}const XK=Ua({null:Y.null,instanceof:Y.operatorKeyword,this:Y.self,"new super assert open to with void":Y.keyword,"class interface extends implements enum var":Y.definitionKeyword,"module package import":Y.moduleKeyword,"switch while for if else case default do break continue return try catch finally throw":Y.controlKeyword,"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws":Y.modifier,IntegerLiteral:Y.integer,FloatingPointLiteral:Y.float,"StringLiteral TextBlock":Y.string,CharacterLiteral:Y.character,LineComment:Y.lineComment,BlockComment:Y.blockComment,BooleanLiteral:Y.bool,PrimitiveType:Y.standard(Y.typeName),TypeName:Y.typeName,Identifier:Y.variableName,"MethodName/Identifier":Y.function(Y.variableName),Definition:Y.definition(Y.variableName),ArithOp:Y.arithmeticOperator,LogicOp:Y.logicOperator,BitOp:Y.bitwiseOperator,CompareOp:Y.compareOperator,AssignOp:Y.definitionOperator,UpdateOp:Y.updateOperator,Asterisk:Y.punctuation,Label:Y.labelName,"( )":Y.paren,"[ ]":Y.squareBracket,"{ }":Y.brace,".":Y.derefOperator,", ;":Y.separator}),zK={__proto__:null,true:34,false:34,null:42,void:46,byte:48,short:48,int:48,long:48,char:48,float:48,double:48,boolean:48,extends:62,super:64,class:76,this:78,new:84,public:100,protected:102,private:104,abstract:106,static:108,final:110,strictfp:112,default:114,synchronized:116,native:118,transient:120,volatile:122,throws:150,implements:160,interface:166,enum:176,instanceof:238,open:267,module:269,requires:274,transitive:276,exports:278,to:280,opens:282,uses:284,provides:286,with:288,package:292,import:296,if:308,else:310,while:314,for:318,var:325,assert:332,switch:336,case:342,do:346,break:350,continue:354,return:358,throw:364,try:368,catch:372,finally:380},LK=Da.deserialize({version:14,states:"##jQ]QPOOQ$wQPOOO(bQQO'#H^O*iQQO'#CbOOQO'#Cb'#CbO*pQPO'#CaO*xOSO'#CpOOQO'#Hc'#HcOOQO'#Cu'#CuO,eQPO'#D_O-OQQO'#HmOOQO'#Hm'#HmO/gQQO'#HhO/nQQO'#HhOOQO'#Hh'#HhOOQO'#Hg'#HgO1rQPO'#DUO2PQPO'#GnO4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,^Q)n%}R,i)m$SfO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kT&p#t,ZQ&|#xQ(P$oQ-u+hQ/]-tR0P/_]!nP!o'^*q-^/O#PaOPX`bcx![!f!o!y#_#e#l$_$m$n$o$p$q%O%b%d&]&i'^'e'h'{(U)O)Q)R*W*q+O+d+l+s+x,Y-[-^.R/O/dU#WY!W'|Q%T!eU&k#n#s+fQ(o%VS,s*T*zT.s,u-aj#UY!W!e#n#s%V%w&W)y*T*z,u-aU&V#`&`(}Q)x&[Q+e'|Q+q(`Q-s+fQ.O+rQ/g.WR0U/hQ)i%vQ,g)fR/o.mR,h)f`!jP!o'^'h*q+O-^/OT%W!g*|R%]!hW%U!e%V*z-aQ(z%^R,V({S#d`%bR&a#eQ)X%gT*t'`'iR*y'e[!lP!o'^*q-^/OR%X!gR#h`R,b)]R)a%kT-j+]-kQ/V-mR/z/WR/z/X",nodeNames:"⚠ LineComment BlockComment Program ModuleDeclaration MarkerAnnotation Identifier ScopedIdentifier . Annotation ) ( AnnotationArgumentList AssignmentExpression FieldAccess IntegerLiteral FloatingPointLiteral BooleanLiteral CharacterLiteral StringLiteral TextBlock null ClassLiteral void PrimitiveType TypeName ScopedTypeName GenericType TypeArguments AnnotatedType Wildcard extends super , ArrayType ] Dimension [ class this ParenthesizedExpression ObjectCreationExpression new ArgumentList } { ClassBody ; FieldDeclaration Modifiers public protected private abstract static final strictfp default synchronized native transient volatile VariableDeclarator Definition AssignOp ArrayInitializer MethodDeclaration TypeParameters TypeParameter TypeBound FormalParameters ReceiverParameter FormalParameter SpreadParameter Throws throws Block ClassDeclaration Superclass SuperInterfaces implements InterfaceTypeList InterfaceDeclaration interface ExtendsInterfaces InterfaceBody ConstantDeclaration EnumDeclaration enum EnumBody EnumConstant EnumBodyDeclarations AnnotationTypeDeclaration AnnotationTypeBody AnnotationTypeElementDeclaration StaticInitializer ConstructorDeclaration ConstructorBody ExplicitConstructorInvocation ArrayAccess MethodInvocation MethodName MethodReference ArrayCreationExpression Dimension AssignOp BinaryExpression CompareOp CompareOp LogicOp LogicOp BitOp BitOp BitOp ArithOp ArithOp ArithOp BitOp InstanceofExpression instanceof LambdaExpression InferredParameters TernaryExpression LogicOp : UpdateExpression UpdateOp UnaryExpression LogicOp BitOp CastExpression ElementValueArrayInitializer ElementValuePair open module ModuleBody ModuleDirective requires transitive exports to opens uses provides with PackageDeclaration package ImportDeclaration import Asterisk ExpressionStatement LabeledStatement Label IfStatement if else WhileStatement while ForStatement for ForSpec LocalVariableDeclaration var EnhancedForStatement ForSpec AssertStatement assert SwitchStatement switch SwitchBlock SwitchLabel case DoStatement do BreakStatement break ContinueStatement continue ReturnStatement return SynchronizedStatement ThrowStatement throw TryStatement try CatchClause catch CatchFormalParameter CatchType FinallyClause finally TryWithResourcesStatement ResourceSpecification Resource ClassContent",maxTerm:276,nodeProps:[["isolate",-4,1,2,18,19,""],["group",-26,4,47,76,77,82,87,92,145,147,150,151,153,156,158,161,163,165,167,172,174,176,178,180,181,183,191,"Statement",-25,6,13,14,15,16,17,18,19,20,21,22,39,40,41,99,100,102,103,106,118,120,122,125,127,130,"Expression",-7,23,24,25,26,27,29,34,"Type"],["openedBy",10,"(",44,"{"],["closedBy",11,")",45,"}"]],propSources:[XK],skippedNodes:[0,1,2],repeatNodeCount:28,tokenData:"#'f_R!_OX%QXY'fYZ)bZ^'f^p%Qpq'fqr*|rs,^st%Qtu4euv5zvw7[wx8rxyAZyzAwz{Be{|CZ|}Dq}!OE_!O!PFx!P!Q! r!Q!R!,h!R![!0`![!]!>p!]!^!@Q!^!_!@n!_!`!BX!`!a!B{!a!b!Di!b!c!EX!c!}!LT!}#O!Mj#O#P%Q#P#Q!NW#Q#R!Nt#R#S4e#S#T%Q#T#o4e#o#p# h#p#q#!U#q#r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SOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT#$cV#uP&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_#%Ru&YS%yZ&PZOX%QXY'fYZ)bZ^'f^p%Qpq'fqr%Qrs%qst%Qtu4eu!Q%Q!Q![4e![!c%Q!c!}4e!}#R%Q#R#S4e#S#T%Q#T#o4e#o#y%Q#y#z'f#z$f%Q$f$g'f$g#BY4e#BY#BZ#$x#BZ$IS4e$IS$I_#$x$I_$I|4e$I|$JO#$x$JO$JT4e$JT$JU#$x$JU$KV4e$KV$KW#$x$KW&FU4e&FU&FV#$x&FV;'S4e;'S;=`5t<%lO4e",tokenizers:[0,1,2,3],topRules:{Program:[0,3],ClassContent:[1,194]},dynamicPrecedences:{27:1,232:-1,243:-1},specialized:[{term:231,get:n=>zK[n]||-1}],tokenPrec:7144}),ZK=Ya.define({name:"java",parser:LK.configure({props:[Dl.add({IfStatement:Tl({except:/^\s*({|else\b)/}),TryStatement:Tl({except:/^\s*({|catch|finally)\b/}),LabeledStatement:xX,SwitchBlock:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:hf({closing:"}"}),BlockComment:()=>null,Statement:Tl({except:/^{/})}),Bl.add({"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer":Bm,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function VK(){return new Ml(ZK)}const YK="#e5c07b",o4="#e06c75",DK="#56b6c2",BK="#ffffff",Pp="#abb2bf",y2="#7d8799",UK="#61afef",WK="#98c379",c4="#d19a66",GK="#c678dd",IK="#21252b",u4="#2c313a",f4="#282c34",Cx="#353a42",HK="#3E4451",d4="#528bff",FK=Ae.theme({"&":{color:Pp,backgroundColor:f4},".cm-content":{caretColor:d4},".cm-cursor, .cm-dropCursor":{borderLeftColor:d4},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:HK},".cm-panels":{backgroundColor:IK,color:Pp},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:f4,color:y2,border:"none"},".cm-activeLineGutter":{backgroundColor:u4},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Cx},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Cx,borderBottomColor:Cx},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:u4,color:Pp}}},{dark:!0}),KK=Um.define([{tag:Y.keyword,color:GK},{tag:[Y.name,Y.deleted,Y.character,Y.propertyName,Y.macroName],color:o4},{tag:[Y.function(Y.variableName),Y.labelName],color:UK},{tag:[Y.color,Y.constant(Y.name),Y.standard(Y.name)],color:c4},{tag:[Y.definition(Y.name),Y.separator],color:Pp},{tag:[Y.typeName,Y.className,Y.number,Y.changed,Y.annotation,Y.modifier,Y.self,Y.namespace],color:YK},{tag:[Y.operator,Y.operatorKeyword,Y.url,Y.escape,Y.regexp,Y.link,Y.special(Y.string)],color:DK},{tag:[Y.meta,Y.comment],color:y2},{tag:Y.strong,fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.link,color:y2,textDecoration:"underline"},{tag:Y.heading,fontWeight:"bold",color:o4},{tag:[Y.atom,Y.bool,Y.special(Y.variableName)],color:c4},{tag:[Y.processingInstruction,Y.string,Y.inserted],color:WK},{tag:Y.invalid,color:BK}]),h4=[FK,sU(KK)];function KQ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ul=KQ();function $z(n){Ul=n}var Of={exec:()=>null};function bt(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Jn.caret,"$1"),t=t.replace(s,a),r},getRegex:()=>new RegExp(t,e)};return r}var JK=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Jn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},eJ=/^(?:[ \t]*(?:\n|$))+/,tJ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nJ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,id=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rJ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,JQ=/(?:[*+-]|\d{1,9}[.)])/,Tz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jz=bt(Tz).replace(/bull/g,JQ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),sJ=bt(Tz).replace(/bull/g,JQ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ek=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,iJ=/^[^\n]+/,tk=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,aJ=bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",tk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lJ=bt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,JQ).getRegex(),Jm="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",nk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oJ=bt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",nk).replace("tag",Jm).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_z=bt(ek).replace("hr",id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jm).getRegex(),cJ=bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_z).getRegex(),rk={blockquote:cJ,code:tJ,def:aJ,fences:nJ,heading:rJ,hr:id,html:oJ,lheading:jz,list:lJ,newline:eJ,paragraph:_z,table:Of,text:iJ},p4=bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jm).getRegex(),uJ={...rk,lheading:sJ,table:p4,paragraph:bt(ek).replace("hr",id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",p4).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jm).getRegex()},fJ={...rk,html:bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nk).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Of,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:bt(ek).replace("hr",id).replace("heading",` *#{1,6} *[^
|
|
232
|
-
]`).replace("lheading",jz).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dJ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hJ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pz=/^( {2,}|\\)\n(?!\s*$)/,pJ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,eO=/[\p{P}\p{S}]/u,sk=/[\s\p{P}\p{S}]/u,Nz=/[^\s\p{P}\p{S}]/u,mJ=bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sk).getRegex(),Cz=/(?!~)[\p{P}\p{S}]/u,OJ=/(?!~)[\s\p{P}\p{S}]/u,gJ=/(?:[^\s\p{P}\p{S}]|~)/u,xJ=bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",JK?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Rz=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,bJ=bt(Rz,"u").replace(/punct/g,eO).getRegex(),yJ=bt(Rz,"u").replace(/punct/g,Cz).getRegex(),Ez="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vJ=bt(Ez,"gu").replace(/notPunctSpace/g,Nz).replace(/punctSpace/g,sk).replace(/punct/g,eO).getRegex(),wJ=bt(Ez,"gu").replace(/notPunctSpace/g,gJ).replace(/punctSpace/g,OJ).replace(/punct/g,Cz).getRegex(),SJ=bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Nz).replace(/punctSpace/g,sk).replace(/punct/g,eO).getRegex(),QJ=bt(/\\(punct)/,"gu").replace(/punct/g,eO).getRegex(),kJ=bt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$J=bt(nk).replace("(?:-->|$)","-->").getRegex(),TJ=bt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$J).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),fm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,jJ=bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",fm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Az=bt(/^!?\[(label)\]\[(ref)\]/).replace("label",fm).replace("ref",tk).getRegex(),qz=bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",tk).getRegex(),_J=bt("reflink|nolink(?!\\()","g").replace("reflink",Az).replace("nolink",qz).getRegex(),m4=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ik={_backpedal:Of,anyPunctuation:QJ,autolink:kJ,blockSkip:xJ,br:Pz,code:hJ,del:Of,emStrongLDelim:bJ,emStrongRDelimAst:vJ,emStrongRDelimUnd:SJ,escape:dJ,link:jJ,nolink:qz,punctuation:mJ,reflink:Az,reflinkSearch:_J,tag:TJ,text:pJ,url:Of},PJ={...ik,link:bt(/^!?\[(label)\]\((.*?)\)/).replace("label",fm).getRegex(),reflink:bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fm).getRegex()},v2={...ik,emStrongRDelimAst:wJ,emStrongLDelim:yJ,url:bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",m4).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",m4).getRegex()},NJ={...v2,br:bt(Pz).replace("{2,}","*").getRegex(),text:bt(v2.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tp={normal:rk,gfm:uJ,pedantic:fJ},Vu={normal:ik,gfm:v2,breaks:NJ,pedantic:PJ},CJ={"&":"&","<":"<",">":">",'"':""","'":"'"},O4=n=>CJ[n];function Ai(n,e){if(e){if(Jn.escapeTest.test(n))return n.replace(Jn.escapeReplace,O4)}else if(Jn.escapeTestNoEncode.test(n))return n.replace(Jn.escapeReplaceNoEncode,O4);return n}function g4(n){try{n=encodeURI(n).replace(Jn.percentDecode,"%")}catch{return null}return n}function x4(n,e){var i;let t=n.replace(Jn.findPipe,(a,o,u)=>{let d=!1,p=o;for(;--p>=0&&u[p]==="\\";)d=!d;return d?"|":" |"}),r=t.split(Jn.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(Jn.slashPipe,"|");return r}function Yu(n,e,t){let r=n.length;if(r===0)return"";let s=0;for(;s<r&&n.charAt(r-s-1)===e;)s++;return n.slice(0,r-s)}function RJ(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function b4(n,e,t,r,s){let i=e.href,a=e.title||null,o=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let u={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,u}function EJ(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
233
|
-
`).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[o]=a;return o.length>=s.length?i.slice(s.length):i}).join(`
|
|
234
|
-
`)}var dm=class{constructor(n){Pt(this,"options");Pt(this,"rules");Pt(this,"lexer");this.options=n||Ul}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Yu(t,`
|
|
235
|
-
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=EJ(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=Yu(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Yu(e[0],`
|
|
236
|
-
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Yu(e[0],`
|
|
237
|
-
`).split(`
|
|
238
|
-
`),r="",s="",i=[];for(;t.length>0;){let a=!1,o=[],u;for(u=0;u<t.length;u++)if(this.rules.other.blockquoteStart.test(t[u]))o.push(t[u]),a=!0;else if(!a)o.push(t[u]);else break;t=t.slice(u);let d=o.join(`
|
|
239
|
-
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
240
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
241
|
-
${d}`:d,s=s?`${s}
|
|
242
|
-
${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=m,t.length===0)break;let g=i.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let x=g,v=x.raw+`
|
|
243
|
-
`+t.join(`
|
|
244
|
-
`),y=this.blockquote(v);i[i.length-1]=y,r=r.substring(0,r.length-x.raw.length)+y.raw,s=s.substring(0,s.length-x.text.length)+y.text;break}else if((g==null?void 0:g.type)==="list"){let x=g,v=x.raw+`
|
|
245
|
-
`+t.join(`
|
|
246
|
-
`),y=this.list(v);i[i.length-1]=y,r=r.substring(0,r.length-g.raw.length)+y.raw,s=s.substring(0,s.length-x.raw.length)+y.raw,t=v.substring(i.at(-1).raw.length).split(`
|
|
247
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(n){var t,r;let e=this.rules.block.list.exec(n);if(e){let s=e[1].trim(),i=s.length>1,a={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let o=this.rules.other.listItemRegex(s),u=!1;for(;n;){let p=!1,m="",g="";if(!(e=o.exec(n))||this.rules.block.hr.test(n))break;m=e[0],n=n.substring(m.length);let x=e[2].split(`
|
|
248
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,Q=>" ".repeat(3*Q.length)),v=n.split(`
|
|
249
|
-
`,1)[0],y=!x.trim(),S=0;if(this.options.pedantic?(S=2,g=x.trimStart()):y?S=e[1].length+1:(S=e[2].search(this.rules.other.nonSpaceChar),S=S>4?1:S,g=x.slice(S),S+=e[1].length),y&&this.rules.other.blankLine.test(v)&&(m+=v+`
|
|
250
|
-
`,n=n.substring(v.length+1),p=!0),!p){let Q=this.rules.other.nextBulletRegex(S),k=this.rules.other.hrRegex(S),$=this.rules.other.fencesBeginRegex(S),j=this.rules.other.headingBeginRegex(S),T=this.rules.other.htmlBeginRegex(S);for(;n;){let R=n.split(`
|
|
251
|
-
`,1)[0],N;if(v=R,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),N=v):N=v.replace(this.rules.other.tabCharGlobal," "),$.test(v)||j.test(v)||T.test(v)||Q.test(v)||k.test(v))break;if(N.search(this.rules.other.nonSpaceChar)>=S||!v.trim())g+=`
|
|
252
|
-
`+N.slice(S);else{if(y||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(x)||j.test(x)||k.test(x))break;g+=`
|
|
253
|
-
`+v}!y&&!v.trim()&&(y=!0),m+=R+`
|
|
254
|
-
`,n=n.substring(R.length+1),x=N.slice(S)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(u=!0)),a.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),a.raw+=m}let d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p of a.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((t=p.tokens[0])==null?void 0:t.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(p.raw);if(m){let g={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};p.checked=g.checked,a.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=g.raw+p.tokens[0].raw,p.tokens[0].text=g.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(g)):p.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):p.tokens.unshift(g)}}if(!a.loose){let m=p.tokens.filter(x=>x.type==="space"),g=m.length>0&&m.some(x=>this.rules.other.anyLine.test(x.raw));a.loose=g}}if(a.loose)for(let p of a.items){p.loose=!0;for(let m of p.tokens)m.type==="text"&&(m.type="paragraph")}return a}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:s}}}table(n){var a;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=x4(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
255
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<t.length;o++)i.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:i.align[o]});for(let o of s)i.rows.push(x4(o,i.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[d]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
256
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=Yu(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=RJ(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),b4(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return b4(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,a,o=s,u=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+s);(r=d.exec(e))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){u+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+u);let p=[...r[0]][0].length,m=n.slice(0,s+r.index+p+a);if(Math.min(s,a)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let g=m.slice(2,-2);return{type:"strong",raw:m,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},ks=class w2{constructor(e){Pt(this,"tokens");Pt(this,"options");Pt(this,"state");Pt(this,"inlineQueue");Pt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ul,this.options.tokenizer=this.options.tokenizer||new dm,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Jn,block:tp.normal,inline:Vu.normal};this.options.pedantic?(t.block=tp.pedantic,t.inline=Vu.pedantic):this.options.gfm&&(t.block=tp.gfm,this.options.breaks?t.inline=Vu.breaks:t.inline=Vu.gfm),this.tokenizer.rules=t}static get rules(){return{block:tp,inline:Vu}}static lex(e,t){return new w2(t).lex(e)}static lexInline(e,t){return new w2(t).inlineTokens(e)}lex(e){e=e.replace(Jn.carriageReturn,`
|
|
257
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){var s,i,a;for(this.options.pedantic&&(e=e.replace(Jn.tabCharGlobal," ").replace(Jn.spaceLine,""));e;){let o;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(d=>(o=d.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let d=t.at(-1);o.raw.length===1&&d!==void 0?d.raw+=`
|
|
258
|
-
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
259
|
-
`)?"":`
|
|
260
|
-
`)+o.raw,d.text+=`
|
|
261
|
-
`+o.text,this.inlineQueue.at(-1).src=d.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
262
|
-
`)?"":`
|
|
263
|
-
`)+o.raw,d.text+=`
|
|
264
|
-
`+o.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},t.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let u=e;if((a=this.options.extensions)!=null&&a.startBlock){let d=1/0,p=e.slice(1),m;this.options.extensions.startBlock.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(u=e.substring(0,d+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){let d=t.at(-1);r&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
|
|
265
|
-
`)?"":`
|
|
266
|
-
`)+o.raw,d.text+=`
|
|
267
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):t.push(o),r=u.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
268
|
-
`)?"":`
|
|
269
|
-
`)+o.raw,d.text+=`
|
|
270
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):t.push(o);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var u,d,p,m,g;let r=e,s=null;if(this.tokens.links){let x=Object.keys(this.tokens.links);if(x.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)x.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((d=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:d.call({lexer:this},r))??r;let a=!1,o="";for(;e;){a||(o=""),a=!1;let x;if((m=(p=this.options.extensions)==null?void 0:p.inline)!=null&&m.some(y=>(x=y.call({lexer:this},e,t))?(e=e.substring(x.raw.length),t.push(x),!0):!1))continue;if(x=this.tokenizer.escape(e)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.tag(e)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.link(e)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(x.raw.length);let y=t.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):t.push(x);continue}if(x=this.tokenizer.emStrong(e,r,o)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.codespan(e)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.br(e)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.del(e)){e=e.substring(x.raw.length),t.push(x);continue}if(x=this.tokenizer.autolink(e)){e=e.substring(x.raw.length),t.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(e))){e=e.substring(x.raw.length),t.push(x);continue}let v=e;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0,S=e.slice(1),Q;this.options.extensions.startInline.forEach(k=>{Q=k.call({lexer:this},S),typeof Q=="number"&&Q>=0&&(y=Math.min(y,Q))}),y<1/0&&y>=0&&(v=e.substring(0,y+1))}if(x=this.tokenizer.inlineText(v)){e=e.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(o=x.raw.slice(-1)),a=!0;let y=t.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):t.push(x);continue}if(e){let y="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return t}},hm=class{constructor(n){Pt(this,"options");Pt(this,"parser");this.options=n||Ul}space(n){return""}code({text:n,lang:e,escaped:t}){var i;let r=(i=(e||"").match(Jn.notSpaceStart))==null?void 0:i[0],s=n.replace(Jn.endingNewline,"")+`
|
|
271
|
-
`;return r?'<pre><code class="language-'+Ai(r)+'">'+(t?s:Ai(s,!0))+`</code></pre>
|
|
272
|
-
`:"<pre><code>"+(t?s:Ai(s,!0))+`</code></pre>
|
|
273
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
274
|
-
${this.parser.parse(n)}</blockquote>
|
|
275
|
-
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
276
|
-
`}hr(n){return`<hr>
|
|
277
|
-
`}list(n){let e=n.ordered,t=n.start,r="";for(let a=0;a<n.items.length;a++){let o=n.items[a];r+=this.listitem(o)}let s=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+s+i+`>
|
|
278
|
-
`+r+"</"+s+`>
|
|
279
|
-
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
280
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
281
|
-
`}table(n){let e="",t="";for(let s=0;s<n.header.length;s++)t+=this.tablecell(n.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<n.rows.length;s++){let i=n.rows[s];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
282
|
-
<thead>
|
|
283
|
-
`+e+`</thead>
|
|
284
|
-
`+r+`</table>
|
|
285
|
-
`}tablerow({text:n}){return`<tr>
|
|
286
|
-
${n}</tr>
|
|
287
|
-
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
288
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${Ai(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),s=g4(n);if(s===null)return r;n=s;let i='<a href="'+n+'"';return e&&(i+=' title="'+Ai(e)+'"'),i+=">"+r+"</a>",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=g4(n);if(s===null)return Ai(t);n=s;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${Ai(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Ai(n.text)}},ak=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},$s=class S2{constructor(e){Pt(this,"options");Pt(this,"renderer");Pt(this,"textRenderer");this.options=e||Ul,this.options.renderer=this.options.renderer||new hm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ak}static parse(e,t){return new S2(t).parse(e)}static parseInline(e,t){return new S2(t).parseInline(e)}parse(e){var r,s;let t="";for(let i=0;i<e.length;i++){let a=e[i];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[a.type]){let u=a,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){t+=d||"";continue}}let o=a;switch(o.type){case"space":{t+=this.renderer.space(o);break}case"hr":{t+=this.renderer.hr(o);break}case"heading":{t+=this.renderer.heading(o);break}case"code":{t+=this.renderer.code(o);break}case"table":{t+=this.renderer.table(o);break}case"blockquote":{t+=this.renderer.blockquote(o);break}case"list":{t+=this.renderer.list(o);break}case"checkbox":{t+=this.renderer.checkbox(o);break}case"html":{t+=this.renderer.html(o);break}case"def":{t+=this.renderer.def(o);break}case"paragraph":{t+=this.renderer.paragraph(o);break}case"text":{t+=this.renderer.text(o);break}default:{let u='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return t}parseInline(e,t=this.renderer){var s,i;let r="";for(let a=0;a<e.length;a++){let o=e[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[o.type]){let d=this.options.extensions.renderers[o.type].call({parser:this},o);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=d||"";continue}}let u=o;switch(u.type){case"escape":{r+=t.text(u);break}case"html":{r+=t.html(u);break}case"link":{r+=t.link(u);break}case"image":{r+=t.image(u);break}case"checkbox":{r+=t.checkbox(u);break}case"strong":{r+=t.strong(u);break}case"em":{r+=t.em(u);break}case"codespan":{r+=t.codespan(u);break}case"br":{r+=t.br(u);break}case"del":{r+=t.del(u);break}case"text":{r+=t.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},dp,ef=(dp=class{constructor(n){Pt(this,"options");Pt(this,"block");this.options=n||Ul}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?ks.lex:ks.lexInline}provideParser(){return this.block?$s.parse:$s.parseInline}},Pt(dp,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Pt(dp,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),dp),Mz=class{constructor(...n){Pt(this,"defaults",KQ());Pt(this,"options",this.setOptions);Pt(this,"parse",this.parseMarkdown(!0));Pt(this,"parseInline",this.parseMarkdown(!1));Pt(this,"Parser",$s);Pt(this,"Renderer",hm);Pt(this,"TextRenderer",ak);Pt(this,"Lexer",ks);Pt(this,"Tokenizer",dm);Pt(this,"Hooks",ef);this.use(...n)}walkTokens(n,e){var r,s;let t=[];for(let i of n)switch(t=t.concat(e.call(this,i)),i.type){case"table":{let a=i;for(let o of a.header)t=t.concat(this.walkTokens(o.tokens,e));for(let o of a.rows)for(let u of o)t=t.concat(this.walkTokens(u.tokens,e));break}case"list":{let a=i;t=t.concat(this.walkTokens(a.items,e));break}default:{let a=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{let u=a[o].flat(1/0);t=t.concat(this.walkTokens(u,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new hm(this.defaults);for(let i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=t.renderer[a],u=s[a];s[a]=(...d)=>{let p=o.apply(s,d);return p===!1&&(p=u.apply(s,d)),p||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new dm(this.defaults);for(let i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=t.tokenizer[a],u=s[a];s[a]=(...d)=>{let p=o.apply(s,d);return p===!1&&(p=u.apply(s,d)),p}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new ef;for(let i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=t.hooks[a],u=s[a];ef.passThroughHooks.has(i)?s[a]=d=>{if(this.defaults.async&&ef.passThroughHooksRespectAsync.has(i))return(async()=>{let m=await o.call(s,d);return u.call(s,m)})();let p=o.call(s,d);return u.call(s,p)}:s[a]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await o.apply(s,d);return m===!1&&(m=await u.apply(s,d)),m})();let p=o.apply(s,d);return p===!1&&(p=u.apply(s,d)),p}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return ks.lex(n,e??this.defaults)}parser(n,e){return $s.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=n),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,o=await(s.hooks?await s.hooks.provideLexer():n?ks.lex:ks.lexInline)(a,s),u=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser():n?$s.parse:$s.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer():n?ks.lex:ks.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=(s.hooks?s.hooks.provideParser():n?$s.parse:$s.parseInline)(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(n,e){return t=>{if(t.message+=`
|
|
289
|
-
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+Ai(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},zl=new Mz;function Nt(n,e){return zl.parse(n,e)}Nt.options=Nt.setOptions=function(n){return zl.setOptions(n),Nt.defaults=zl.defaults,$z(Nt.defaults),Nt};Nt.getDefaults=KQ;Nt.defaults=Ul;Nt.use=function(...n){return zl.use(...n),Nt.defaults=zl.defaults,$z(Nt.defaults),Nt};Nt.walkTokens=function(n,e){return zl.walkTokens(n,e)};Nt.parseInline=zl.parseInline;Nt.Parser=$s;Nt.parser=$s.parse;Nt.Renderer=hm;Nt.TextRenderer=ak;Nt.Lexer=ks;Nt.lexer=ks.lex;Nt.Tokenizer=dm;Nt.Hooks=ef;Nt.parse=Nt;Nt.options;Nt.setOptions;Nt.use;Nt.walkTokens;Nt.parseInline;$s.parse;ks.lex;const y4=n=>n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(0)}K`:n.toString(),AJ=n=>n<.01?`$${n.toFixed(3)}`:`$${n.toFixed(2)}`,qJ=n=>{const e=new Map;for(const t of n){const r=t.provider||"Other";e.has(r)||e.set(r,[]),e.get(r).push(t)}return e},v4=n=>{const e=n.model.split("/").pop()||n.model;return e.length>25?e.substring(0,22)+"...":e},MJ=({selectedModel:n,onModelChange:e,className:t=""})=>{const[r,s]=P.useState([]),[i,a]=P.useState(""),[o,u]=P.useState(!1),[d,p]=P.useState(!0),[m,g]=P.useState(null),x=P.useRef(null);P.useEffect(()=>{(async()=>{try{p(!0);const S=await Ce.getModels();if(s(S.models),a(S.default_model),!n&&S.models.length>0){const Q=S.models.find(k=>k.model===S.default_model);e(Q||S.models[0])}}catch(S){console.error("Failed to fetch models:",S),g(S.message||"Failed to load models")}finally{p(!1)}})()},[]),P.useEffect(()=>{const y=S=>{x.current&&!x.current.contains(S.target)&&u(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[]);const v=qJ(r);return d?f.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs bg-surface-700/50 text-surface-400 ${t}`,children:[f.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{className:"hidden sm:inline",children:"Loading..."})]}):m?f.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs bg-red-500/10 text-red-400 border border-red-500/30 ${t}`,title:m,children:[f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{className:"hidden sm:inline",children:"Error"})]}):f.jsxs("div",{className:`relative ${t}`,ref:x,children:[f.jsxs("button",{onClick:()=>u(!o),className:"flex items-center gap-1.5 px-2 py-1 rounded border border-surface-600/50 bg-surface-700/50 hover:bg-surface-600/50 transition-colors text-xs",children:[f.jsx("span",{className:"text-surface-400 hidden sm:inline",children:"Model:"}),f.jsx("span",{className:"text-white font-medium truncate max-w-[120px] sm:max-w-[180px]",children:n?v4(n):"Select..."}),n&&n.max_thinking_tokens>0&&f.jsx("span",{className:"px-1 py-0.5 rounded text-[9px] bg-purple-500/20 text-purple-300 hidden sm:inline",children:"Think"}),f.jsx("svg",{className:`w-3 h-3 text-surface-400 transition-transform ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&f.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 w-[320px] sm:w-[400px] max-h-[400px] overflow-auto bg-surface-800 border border-surface-600 rounded-lg shadow-xl",children:Array.from(v.entries()).map(([y,S],Q)=>f.jsxs("div",{children:[Q>0&&f.jsx("div",{className:"border-t border-surface-700"}),f.jsx("div",{className:"px-3 py-1.5 text-[10px] font-medium text-surface-500 uppercase tracking-wider bg-surface-800/50 sticky top-0",children:y}),S.map(k=>{const $=(n==null?void 0:n.model)===k.model,j=k.model===i;return f.jsxs("button",{onClick:()=>{e(k),u(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-700/50 transition-colors ${$?"bg-accent-500/10 border-l-2 border-accent-500":""}`,children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("span",{className:`text-sm truncate ${$?"text-white font-medium":"text-surface-200"}`,children:v4(k)}),j&&f.jsx("span",{className:"px-1 py-0.5 rounded text-[9px] bg-green-500/20 text-green-300 flex-shrink-0",children:"Default"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-surface-400 flex-shrink-0",children:[f.jsx("span",{className:"text-green-400",children:AJ(k.input_cost)}),f.jsxs("span",{children:[y4(k.context_limit)," ctx"]}),f.jsxs("span",{className:"text-yellow-400",children:["ELO ",k.elo]})]})]}),k.max_thinking_tokens>0&&f.jsxs("div",{className:"mt-0.5 text-[10px] text-purple-400 flex items-center gap-1",children:[f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),y4(k.max_thinking_tokens)," thinking tokens"]})]},k.model)})]},y))})]})},XJ=({rawMetrics:n,processedMetrics:e,viewMode:t,onViewModeChange:r,isLoading:s,preprocessingError:i,timeValue:a=.25,promptLineCount:o,codeLineCount:u,contextLimit:d,maxThinkingTokens:p,selectedModel:m,onModelChange:g})=>{const x=t==="processed"?e:n,v=(m==null?void 0:m.context_limit)||(x==null?void 0:x.context_limit)||d||2e5,y=(m==null?void 0:m.max_thinking_tokens)||p||(v>=2e5?128e3:32e3),S=Math.floor(a*y),Q=(x==null?void 0:x.token_count)||0,k=Math.max(0,v-Q-S),$=k<2e4,j=V=>V<50?"text-green-400":V<75?"text-yellow-400":V<90?"text-orange-400":"text-red-400",T=V=>V<50?"bg-green-500":V<75?"bg-yellow-500":V<90?"bg-orange-500":"bg-red-500",R=V=>V<1e-4?`$${V.toFixed(6)}`:V<.01?`$${V.toFixed(4)}`:V<1?`$${V.toFixed(3)}`:`$${V.toFixed(2)}`,N=V=>V>=1e6?`${(V/1e6).toFixed(1)}M`:V>=1e3?`${(V/1e3).toFixed(1)}K`:V.toString(),q=v,z=Q/q*100,L=S/q*100,E=k/q*100;return f.jsxs("div",{className:"bg-surface-800/30 border-b border-surface-700/50",children:[f.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between px-3 sm:px-4 py-2 sm:py-2.5 gap-2 sm:gap-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400",children:"View:"}),f.jsxs("div",{className:"flex rounded-lg overflow-hidden border border-surface-600/50",children:[f.jsx("button",{onClick:()=>r("raw"),className:`px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium transition-all duration-200 ${t==="raw"?"bg-accent-600 text-white":"bg-surface-700/50 text-surface-300 hover:bg-surface-600"}`,children:"Raw"}),f.jsx("button",{onClick:()=>r("processed"),disabled:!e&&!i,className:`px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium transition-all duration-200 ${t==="processed"?"bg-accent-600 text-white":"bg-surface-700/50 text-surface-300 hover:bg-surface-600"} ${!e&&!i?"opacity-50 cursor-not-allowed":""}`,title:i?`Error: ${i}`:"View processed prompt with includes expanded",children:"Processed"})]}),i&&t==="processed"&&f.jsx("span",{className:"text-[10px] sm:text-xs text-red-400 ml-1 sm:ml-2 truncate max-w-[100px] sm:max-w-none",title:i,children:"Error"}),g&&f.jsx("div",{className:"hidden sm:block ml-2",children:f.jsx(MJ,{selectedModel:m||null,onModelChange:g})})]}),f.jsx("div",{className:"flex items-center gap-3 sm:gap-5 flex-wrap",children:s?f.jsxs("div",{className:"flex items-center gap-1.5 text-surface-400 text-[10px] sm:text-xs",children:[f.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Analyzing..."]}):x?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400",children:"Tokens:"}),f.jsx("span",{className:"text-xs sm:text-sm font-mono text-white",children:N(x.token_count)})]}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Context:"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"w-12 sm:w-16 h-1.5 sm:h-2 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:`h-full transition-all ${T(x.context_usage_percent)}`,style:{width:`${Math.min(x.context_usage_percent,100)}%`}})}),f.jsxs("span",{className:`text-xs sm:text-sm font-mono ${j(x.context_usage_percent)}`,children:[x.context_usage_percent.toFixed(0),"%"]})]})]}),x.cost_estimate&&f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Cost:"}),f.jsx("span",{className:"text-xs sm:text-sm font-mono text-green-400",children:R(x.cost_estimate.input_cost)})]}),f.jsxs("div",{className:"flex items-center gap-1.5",title:`${N(S)} thinking tokens (${Math.round(a*100)}% of ${N(y)} max)`,children:[f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Thinking:"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"w-12 sm:w-16 h-1.5 sm:h-2 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full transition-all bg-gradient-to-r from-purple-500 to-blue-500",style:{width:`${Math.min(a*100,100)}%`}})}),f.jsx("span",{className:"text-xs sm:text-sm font-mono text-purple-400",children:N(S)})]})]}),o!==void 0&&o>0&&u!==void 0&&f.jsxs("div",{className:"flex items-center gap-1.5",title:`${u} lines of code / ${o} lines of prompt`,children:[f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Code:Prompt:"}),f.jsxs("span",{className:`text-xs sm:text-sm font-mono ${u/o>=1?"text-blue-400":"text-orange-400"}`,children:[(u/o).toFixed(1),"x"]}),f.jsxs("span",{className:"text-[10px] text-surface-500 hidden md:inline",children:["(",u,"/",o,")"]})]})]}):f.jsx("span",{className:"text-[10px] sm:text-xs text-surface-500",children:"No metrics"})})]}),x&&f.jsxs("div",{className:"px-3 sm:px-4 pb-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-[10px] text-surface-500 w-16 sm:w-20 flex-shrink-0",children:[N(v)," ctx"]}),f.jsxs("div",{className:"flex-1 h-2 sm:h-2.5 bg-surface-700/50 rounded-full overflow-hidden flex",children:[f.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${Math.min(z,100)}%`},title:`Input: ${N(Q)} tokens (${z.toFixed(1)}%)`}),f.jsx("div",{className:"h-full bg-purple-500 transition-all",style:{width:`${Math.min(L,100-z)}%`},title:`Thinking: ${N(S)} tokens (${L.toFixed(1)}%)`}),f.jsx("div",{className:`h-full transition-all ${$?"bg-orange-500/50":"bg-green-500/30"}`,style:{width:`${Math.max(E,0)}%`},title:`Output capacity: ${N(k)} tokens (${E.toFixed(1)}%)`})]})]}),f.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[9px] sm:text-[10px] text-surface-500",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"w-2 h-2 rounded-sm bg-blue-500"}),f.jsxs("span",{children:["Input ",N(Q)]})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"w-2 h-2 rounded-sm bg-purple-500"}),f.jsxs("span",{children:["Thinking ",N(S)]})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:`w-2 h-2 rounded-sm ${$?"bg-orange-500":"bg-green-500/50"}`}),f.jsxs("span",{className:$?"text-orange-400":"",children:["Output ",N(k),$&&" (low)"]})]})]})]})]})},Xz=[{tag:"include",description:"Include file content (text or image) at this position",syntax:"<include>path/to/file</include>",example:"<include>context/preamble.prompt</include>",hasClosingTag:!0,category:"include"},{tag:"include-many",description:"Include multiple files (comma-separated)",syntax:"<include-many>path1, path2, ...</include-many>",example:"<include-many>src/api.ts, src/types.ts</include-many>",hasClosingTag:!0,category:"include"},{tag:"pdd",description:"Human-only comment (removed during preprocessing)",syntax:"<pdd>comment text</pdd>",example:"<pdd>TODO: Add more examples here</pdd>",hasClosingTag:!0,category:"meta"},{tag:"shell",description:"Run shell command and inline stdout (non-deterministic)",syntax:"<shell>command</shell>",example:"<shell>git config --get user.name</shell>",hasClosingTag:!0,category:"dynamic"},{tag:"web",description:"Fetch URL content as markdown (non-deterministic)",syntax:"<web>URL</web>",example:"<web>https://docs.example.com/api</web>",hasClosingTag:!0,category:"dynamic"},{tag:"pin",description:"Force a specific grounding example (PDD Cloud)",syntax:"<pin>module_name</pin>",example:"<pin>user_service</pin>",hasClosingTag:!0,category:"grounding"},{tag:"exclude",description:"Block a grounding example from being retrieved (PDD Cloud)",syntax:"<exclude>module_name</exclude>",example:"<exclude>legacy_handler</exclude>",hasClosingTag:!0,category:"grounding"}],zJ=[{title:"Prompt-to-Code Ratio",content:"Aim for 10-30% of expected code size. Too vague (<10%) or too detailed (>50%) reduces effectiveness."},{title:"Prompt Structure",content:"Include: Role/scope (1-2 sentences), Requirements (5-10 items), Dependencies via <include>."},{title:"What to Avoid",content:"Don't include: Coding style (use preamble), implementation patterns, every edge case (use tests)."},{title:"Shared Preamble",content:"Use <include>context/preamble.prompt</include> for consistent coding style across all prompts."}],zz={include:"Context Includes",grounding:"Grounding (Cloud)",dynamic:"Dynamic Content",meta:"Comments"},LJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),pm=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})}),mm=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),Lz=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456Z"})}),ZJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m.75 12l3 3m0 0l3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),gf=n=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),Rx=n=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zm0 0c0 1.657 1.007 3 2.25 3S21 13.657 21 12a9 9 0 10-2.636 6.364M16.5 12V8.25"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25v3.75m0 0a3 3 0 003 3h3"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12c0-4.97 4.03-9 9-9s9 4.03 9 9-4.03 9-9 9"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-2.636-2.636"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 8.25l2.636-2.636"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 15.75l-2.636 2.636"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l2.636 2.636"})]}),VJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})}),Zz=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),Vz=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})}),YJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})}),Ex=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})}),w4=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),DJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})}),Yz=n=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),BJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})}),UJ=n=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),WJ=Xz.reduce((n,e)=>(n[e.category]||(n[e.category]=[]),n[e.category].push(e),n),{}),GJ=["include","dynamic","grounding","meta"],IJ=({directive:n})=>{const[e,t]=P.useState(!1);return f.jsxs("div",{className:`rounded-md border border-surface-700/50 bg-surface-800/50 overflow-hidden transition-all duration-200 ${e?"ring-1 ring-accent-500/30":""}`,children:[f.jsxs("button",{onClick:()=>t(!e),className:"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-surface-700/30 transition-colors",children:[f.jsxs("code",{className:"text-accent-400 font-mono text-sm",children:["<",n.tag,">"]}),f.jsx("svg",{className:`w-4 h-4 text-text-secondary transition-transform duration-200 ${e?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e&&f.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-surface-700/50 bg-surface-900/30",children:[f.jsx("p",{className:"text-text-secondary text-xs mb-2",children:n.description}),f.jsx("div",{className:"bg-surface-900 rounded px-2 py-1.5",children:f.jsx("code",{className:"text-xs text-text-muted font-mono break-all",children:n.syntax})}),n.example&&f.jsxs("div",{className:"mt-2",children:[f.jsx("span",{className:"text-xs text-text-muted",children:"Example:"}),f.jsx("div",{className:"bg-surface-900 rounded px-2 py-1.5 mt-1",children:f.jsx("code",{className:"text-xs text-accent-300 font-mono break-all",children:n.example})})]})]})]})},HJ=({isOpen:n,onClose:e})=>n?f.jsxs("aside",{className:"w-72 flex-shrink-0 border-l border-surface-700 bg-surface-800 flex flex-col overflow-hidden animate-slide-in-right",children:[f.jsxs("header",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-700 bg-surface-800/80",children:[f.jsxs("h3",{className:"font-semibold text-text-primary flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Prompting Guide"]}),f.jsx("button",{onClick:e,className:"p-1 rounded hover:bg-surface-700 text-text-secondary hover:text-text-primary transition-colors","aria-label":"Close guide",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsxs("section",{className:"p-4",children:[f.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-3",children:"PDD Directives"}),f.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["Type ",f.jsx("code",{className:"text-accent-400 bg-surface-900 px-1 rounded",children:"<"})," in the editor to trigger autocomplete."]}),f.jsx("div",{className:"space-y-4",children:GJ.map(t=>{const r=WJ[t];return!r||r.length===0?null:f.jsxs("div",{children:[f.jsxs("h5",{className:"text-xs font-medium text-text-secondary mb-2 flex items-center gap-1.5",children:[f.jsx("span",{className:`w-2 h-2 rounded-full ${t==="include"?"bg-blue-400":t==="dynamic"?"bg-amber-400":t==="grounding"?"bg-purple-400":"bg-gray-400"}`}),zz[t]]}),f.jsx("div",{className:"space-y-1.5",children:r.map(s=>f.jsx(IJ,{directive:s},s.tag))})]},t)})})]}),f.jsx("div",{className:"border-t border-surface-700 mx-4"}),f.jsxs("section",{className:"p-4",children:[f.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Best Practices"}),f.jsx("div",{className:"space-y-3",children:zJ.map((t,r)=>f.jsxs("div",{className:"rounded-md bg-surface-900/50 p-3",children:[f.jsxs("h5",{className:"text-sm font-medium text-text-primary mb-1 flex items-center gap-2",children:[f.jsx(Lz,{className:"w-3 h-3 text-surface-400 flex-shrink-0"}),t.title]}),f.jsx("p",{className:"text-xs text-text-secondary leading-relaxed",children:t.content})]},r))})]}),f.jsx("section",{className:"p-4 pt-0",children:f.jsxs("div",{className:"rounded-md bg-accent-500/10 border border-accent-500/20 p-3",children:[f.jsxs("h5",{className:"text-xs font-medium text-accent-400 mb-2 flex items-center gap-1.5",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Quick Tip"]}),f.jsxs("p",{className:"text-xs text-text-secondary",children:["Use ",f.jsx("code",{className:"text-accent-300 bg-surface-900/50 px-1 rounded",children:"<include>"})," to reference a shared preamble for consistent coding style across all prompts."]})]})})]})]}):null,FJ={in_sync:{color:"text-green-400",bgColor:"bg-green-500/10",borderColor:"border-green-500/30",icon:f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),label:"Synced",description:"Prompt and code are in sync"},prompt_changed:{color:"text-yellow-400",bgColor:"bg-yellow-500/10",borderColor:"border-yellow-500/30",icon:f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})}),label:"Prompt Changed",description:"Prompt was edited since last sync"},code_changed:{color:"text-orange-400",bgColor:"bg-orange-500/10",borderColor:"border-orange-500/30",icon:f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),label:"Code Changed",description:"Code was edited externally"},conflict:{color:"text-red-400",bgColor:"bg-red-500/10",borderColor:"border-red-500/30",icon:f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),label:"Conflict",description:"Both prompt and code have changes"},never_synced:{color:"text-surface-400",bgColor:"bg-surface-500/10",borderColor:"border-surface-500/30",icon:f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2})}),label:"Not Synced",description:"No sync history exists"}},KJ=({basename:n,language:e,refreshTrigger:t,className:r=""})=>{const[s,i]=P.useState(null),[a,o]=P.useState(!0),[u,d]=P.useState(null);if(P.useEffect(()=>{(async()=>{if(!n||!e){o(!1);return}o(!0),d(null);try{const x=await Ce.getSyncStatus(n,e);i(x)}catch(x){console.error("Failed to fetch sync status:",x),d(x.message||"Failed to load")}finally{o(!1)}})()},[n,e,t]),a)return f.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-[10px] sm:text-xs bg-surface-700/50 text-surface-400 ${r}`,children:[f.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{className:"hidden sm:inline",children:"Loading..."})]});if(u||!s)return f.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-[10px] sm:text-xs bg-surface-700/50 text-surface-500 ${r}`,title:u||"Status unavailable",children:[f.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{className:"hidden sm:inline",children:"Unknown"})]});const p=FJ[s.status];let m=[p.description];if(s.last_sync_timestamp){const g=new Date(s.last_sync_timestamp);m.push(`Last sync: ${g.toLocaleString()}`)}return s.last_sync_command&&m.push(`Command: ${s.last_sync_command}`),f.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded border text-[10px] sm:text-xs transition-colors ${p.color} ${p.bgColor} ${p.borderColor} ${r}`,title:m.join(`
|
|
290
|
-
`),children:[p.icon,f.jsx("span",{className:"hidden sm:inline font-medium",children:p.label})]})};function JJ(n){const e=n.explicit,t=n.matchBefore(/<[\w-]*/),r=n.state.sliceDoc(n.pos-1,n.pos);let s=n.pos,i="";if(t&&t.text.length>0){if(s=t.from,i=t.text.slice(1).toLowerCase(),n.state.sliceDoc(Math.max(0,t.from-1),t.from)==="/")return null}else if(r==="<"||e)if(r==="<")s=n.pos-1;else{const o=n.state.doc.lineAt(n.pos),u=o.text.slice(0,n.pos-o.from),d=u.lastIndexOf("<");if(d>=0)s=o.from+d,i=u.slice(d+1).toLowerCase();else if(!e)return null}else return null;const a=Xz.filter(o=>o.tag.toLowerCase().startsWith(i)).map(o=>({label:o.tag,type:"keyword",detail:zz[o.category],info:`${o.description}
|
|
291
|
-
|
|
292
|
-
Syntax: ${o.syntax}
|
|
293
|
-
Example: ${o.example}`,apply:(u,d,p,m)=>{const g=o.hasClosingTag?`<${o.tag}></${o.tag}>`:`<${o.tag}/>`,x=p+o.tag.length+2;u.dispatch({changes:{from:p,to:m,insert:g},selection:{anchor:x}})},boost:o.category==="include"?2:o.category==="dynamic"?1:0}));return a.length===0?null:{from:s,options:a,filter:!1}}const eee=Ae.theme({".cm-tooltip.cm-tooltip-autocomplete":{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.4)",overflow:"hidden"},".cm-tooltip.cm-tooltip-autocomplete > ul":{fontFamily:"inherit",maxHeight:"280px"},".cm-tooltip.cm-tooltip-autocomplete > ul > li":{padding:"6px 12px",display:"flex",alignItems:"center",gap:"8px"},".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]":{backgroundColor:"#3b82f6",color:"white"},".cm-completionLabel":{color:"#60a5fa",fontWeight:"500"},".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] .cm-completionLabel":{color:"white"},".cm-completionDetail":{color:"#94a3b8",fontSize:"11px",marginLeft:"auto",fontStyle:"normal"},".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] .cm-completionDetail":{color:"rgba(255, 255, 255, 0.8)"},".cm-completionInfo":{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",padding:"12px",marginLeft:"4px",maxWidth:"350px"}});function tee(){return[cG({override:[JJ],icons:!1,optionClass:()=>"cm-pdd-completion",activateOnTyping:!0,activateOnTypingDelay:0}),Cc.of([{key:"Tab",run:t7}]),eee]}function nee(n){const e=n.selection.main.head,t=n.doc.toString(),r=[{regex:/<include>(.*?)<\/include>/g,type:"include"},{regex:/<include-many>(.*?)<\/include-many>/g,type:"include-many"},{regex:/<shell>(.*?)<\/shell>/g,type:"shell"},{regex:/<web>(.*?)<\/web>/g,type:"web"}];for(const{regex:s,type:i}of r){let a;for(s.lastIndex=0;(a=s.exec(t))!==null;){const o=a.index,u=a.index+a[0].length;if(e>=o&&e<=u)return{from:o,to:u,path:a[1].trim(),tagType:i}}}return null}function ree(n){return n.split(",").map(e=>e.trim()).filter(Boolean)}const see={matched:{bg:"bg-emerald-500/10",border:"border-emerald-500/30",text:"text-emerald-400",headerBg:"bg-emerald-500/20"},partial:{bg:"bg-yellow-500/10",border:"border-yellow-500/30",text:"text-yellow-400",headerBg:"bg-yellow-500/20"},missing:{bg:"bg-red-500/15",border:"border-red-500/50",text:"text-red-400",headerBg:"bg-red-500/30"},extra:{bg:"bg-red-500/15",border:"border-red-500/50",text:"text-red-400",headerBg:"bg-red-500/30"}},iee=({isOpen:n,onClose:e,promptContent:t,codeContent:r,promptPath:s,codePath:i,prompt:a,onRunCommand:o})=>{const[u,d]=P.useState(null),[p,m]=P.useState(!1),[g,x]=P.useState(null),[v,y]=P.useState("detailed"),[S,Q]=P.useState(.5),[k,$]=P.useState(new Set),[j,T]=P.useState(!0),[R,N]=P.useState("alignment"),[q,z]=P.useState(null),[L,E]=P.useState(!1),[V,B]=P.useState(null),[C,G]=P.useState("working"),[A,U]=P.useState(""),[H,W]=P.useState(null),[J,X]=P.useState(!1),[D,ee]=P.useState(new Set),[Z,I]=P.useState(.5),K=ae=>{$(Qe=>{const Oe=new Set(Qe);return Oe.has(ae)?Oe.delete(ae):Oe.add(ae),Oe})};P.useEffect(()=>{n&&t&&r&&re()},[n]);const re=async()=>{m(!0),x(null),$(new Set);try{const ae={prompt_content:t,code_content:r,strength:S,mode:v,include_tests:j,prompt_path:s,code_path:i},Qe=await Ce.analyzeDiff(ae);d(Qe);const Oe=new Set;Qe.result.sections.filter(ye=>ye.status==="missing"||ye.status==="partial").forEach(ye=>Oe.add(`prompt-${ye.id}`)),Qe.result.codeSections.filter(ye=>ye.status==="extra").forEach(ye=>Oe.add(`code-${ye.id}`)),$(Oe)}catch(ae){x(ae instanceof Error?ae.message:"Failed to analyze diff")}finally{m(!1)}},se=async()=>{if(!s){B("No prompt path available");return}E(!0),B(null);try{const ae=await Ce.getPromptHistory({prompt_path:s,limit:10});z(ae),ae.versions.length>0&&!A&&U(ae.versions[0].commit_hash)}catch(ae){B(ae instanceof Error?ae.message:"Failed to load history")}finally{E(!1)}},be=async()=>{if(!(!s||!C||!A)){X(!0),B(null);try{const ae=await Ce.getPromptDiff({prompt_path:s,version_a:C,version_b:A,code_path:i,strength:Z});W(ae)}catch(ae){B(ae instanceof Error?ae.message:"Failed to compare versions")}finally{X(!1)}}};P.useEffect(()=>{R==="history"&&!q&&s&&se()},[R,s]),P.useEffect(()=>{if(H){const ae=new Set;H.linguistic_changes.forEach((Qe,Oe)=>{(Qe.impact==="breaking"||Qe.impact==="enhancement")&&ae.add(Oe)}),ee(ae)}},[H]);const $e=P.useCallback(()=>{if(!u)return[];const ae=[];return u.result.sections.forEach(Qe=>{ae.push({id:`prompt-${Qe.id}`,type:"prompt",section:Qe,sortKey:Qe.promptRange.startLine})}),u.result.codeSections.filter(Qe=>Qe.status==="extra").forEach(Qe=>{var Oe;ae.push({id:`code-${Qe.id}`,type:"code",section:Qe,sortKey:((Oe=Qe.codeRanges[0])==null?void 0:Oe.startLine)||0})}),ae.sort((Qe,Oe)=>Qe.sortKey-Oe.sortKey)},[u]);if(!n)return null;const Xe=$e();return f.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 animate-fade-in",children:f.jsxs("div",{className:"w-full h-full max-w-[1600px] max-h-[95vh] m-4 glass rounded-2xl border border-surface-600/50 shadow-2xl flex flex-col overflow-hidden animate-scale-in",children:[f.jsxs("div",{className:"px-6 py-4 border-b border-surface-700/50 flex items-center justify-between flex-shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-purple-500/30 to-blue-500/30 flex items-center justify-center",children:f.jsx("svg",{className:"w-5 h-5 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("h2",{className:"text-lg font-semibold text-white",children:"Prompt Analysis"}),f.jsxs("div",{className:"flex items-center bg-surface-800 rounded-lg p-0.5",children:[f.jsx("button",{onClick:()=>N("alignment"),className:`px-3 py-1.5 text-xs rounded-md transition-all ${R==="alignment"?"bg-purple-600 text-white":"text-surface-400 hover:text-white"}`,children:"Alignment"}),f.jsx("button",{onClick:()=>N("history"),className:`px-3 py-1.5 text-xs rounded-md transition-all ${R==="history"?"bg-purple-600 text-white":"text-surface-400 hover:text-white"}`,children:"Version History"})]})]}),f.jsxs("p",{className:"text-sm text-surface-400",children:[R==="alignment"&&(u==null?void 0:u.cached)&&f.jsx("span",{className:"text-emerald-400",children:"(cached) "}),R==="alignment"&&(u==null?void 0:u.tests_included)&&f.jsxs("span",{className:"text-purple-400",title:u.test_files.join(", "),children:["(",u.test_files.length," test",u.test_files.length>1?"s":""," included)"," "]}),R==="alignment"&&(s&&i?`${s} ↔ ${i}`:"Click sections to expand details"),R==="history"&&(s?`Git history for ${s}`:"No prompt path available")]})]})]}),f.jsxs("div",{className:"flex items-center gap-4",children:[R==="alignment"&&f.jsxs(f.Fragment,{children:[u&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg ${u.result.regenerationRisk==="critical"?"bg-red-500/20 border border-red-500/50":u.result.regenerationRisk==="high"?"bg-orange-500/20 border border-orange-500/50":u.result.regenerationRisk==="medium"?"bg-yellow-500/20 border border-yellow-500/50":"bg-emerald-500/20 border border-emerald-500/50"}`,children:[f.jsx("span",{className:`text-xs font-medium ${u.result.regenerationRisk==="critical"?"text-red-400":u.result.regenerationRisk==="high"?"text-orange-400":u.result.regenerationRisk==="medium"?"text-yellow-400":"text-emerald-400"}`,children:u.result.regenerationRisk==="critical"?"CRITICAL RISK":u.result.regenerationRisk==="high"?"HIGH RISK":u.result.regenerationRisk==="medium"?"MEDIUM RISK":"LOW RISK"}),u.result.canRegenerate?f.jsx("svg",{className:"w-4 h-4 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):f.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})]}),f.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-surface-800 rounded-lg",children:[f.jsx("span",{className:"text-xs text-purple-400",children:"Score"}),f.jsxs("span",{className:"text-lg font-bold",style:{color:u.result.overallScore>=80?"#10b981":u.result.overallScore>=50?"#f59e0b":"#ef4444"},children:[u.result.overallScore,"%"]})]})]}),f.jsxs("div",{className:"flex items-center bg-surface-800 rounded-lg p-0.5",children:[f.jsx("button",{onClick:()=>y("quick"),className:`px-3 py-1.5 text-xs rounded-md transition-all ${v==="quick"?"bg-purple-600 text-white":"text-surface-400 hover:text-white"}`,children:"Quick"}),f.jsx("button",{onClick:()=>y("detailed"),className:`px-3 py-1.5 text-xs rounded-md transition-all ${v==="detailed"?"bg-purple-600 text-white":"text-surface-400 hover:text-white"}`,children:"Detailed"})]}),f.jsxs("button",{onClick:()=>T(!j),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all ${j?"bg-emerald-500/20 border border-emerald-500/50 text-emerald-400":"bg-surface-800 text-surface-400 hover:text-white"}`,title:j?"Tests will be included in analysis":"Click to include tests in analysis",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Include Tests",(u==null?void 0:u.tests_included)&&u.test_files.length>0&&f.jsxs("span",{className:"text-[10px] opacity-70",children:["(",u.test_files.length,")"]})]}),f.jsx("button",{onClick:re,disabled:p,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm hover:bg-purple-500 disabled:opacity-50 flex items-center gap-2",children:p?f.jsxs(f.Fragment,{children:[f.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Analyzing..."]}):f.jsxs(f.Fragment,{children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Re-analyze"]})})]}),R==="history"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-3 bg-surface-800 rounded-lg px-3 py-1.5",children:[f.jsx("span",{className:"text-xs text-surface-400",children:"Strength"}),f.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:Z,onChange:ae=>I(parseFloat(ae.target.value)),className:"w-20 h-1.5 bg-surface-700 rounded-lg appearance-none cursor-pointer accent-purple-500"}),f.jsxs("span",{className:"text-xs text-purple-400 w-8",children:[(Z*100).toFixed(0),"%"]})]}),f.jsx("button",{onClick:se,disabled:L,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm hover:bg-purple-500 disabled:opacity-50 flex items-center gap-2",children:L?f.jsxs(f.Fragment,{children:[f.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading..."]}):f.jsxs(f.Fragment,{children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]})})]}),f.jsx("button",{onClick:e,className:"p-2 text-surface-400 hover:text-white hover:bg-surface-700 rounded-lg transition-colors",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),R==="alignment"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex border-b border-surface-700/50 bg-surface-800/30 flex-shrink-0",children:[f.jsx("div",{className:"flex-1 px-6 py-2 border-r border-surface-700/50",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium text-purple-400",children:"Prompt Requirements"}),u&&f.jsxs("span",{className:"text-xs text-surface-500",children:[u.result.stats.matchedRequirements,"/",u.result.stats.totalRequirements," matched"]})]})}),f.jsx("div",{className:"flex-1 px-6 py-2",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium text-emerald-400",children:"Code Implementation"}),u&&f.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[f.jsxs("span",{className:"text-surface-500",children:[u.result.stats.documentedFeatures,"/",u.result.stats.totalCodeFeatures," documented"]}),u.result.hiddenKnowledge&&u.result.hiddenKnowledge.length>0&&f.jsxs("span",{className:"text-orange-400",children:[u.result.hiddenKnowledge.length," hidden"]})]})]})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p&&f.jsx("div",{className:"flex items-center justify-center py-16",children:f.jsxs("div",{className:"text-center",children:[f.jsxs("svg",{className:"w-8 h-8 animate-spin text-purple-500 mx-auto mb-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("p",{className:"text-surface-400",children:"Analyzing prompt and code alignment..."})]})}),g&&f.jsx("div",{className:"p-6",children:f.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-4 flex items-center gap-3",children:[f.jsx("svg",{className:"w-5 h-5 text-red-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{className:"text-red-400",children:g})]})}),!p&&!g&&u&&f.jsxs("div",{className:"divide-y divide-surface-700/30",children:[Xe.map(({id:ae,type:Qe,section:Oe})=>{var ge,Ke,ot,st,ht;const ye=k.has(ae),Fe=see[Oe.status],Te=Oe.status==="missing"||Oe.status==="extra";return f.jsxs("div",{className:`flex transition-colors ${Te?"bg-red-500/5":""}`,children:[f.jsx("div",{className:`flex-1 border-r border-surface-700/30 ${Qe==="code"?"bg-red-500/10":""}`,children:Qe==="prompt"?f.jsxs("div",{className:`p-4 cursor-pointer hover:bg-surface-700/20 transition-colors ${Fe.bg}`,onClick:()=>K(ae),children:[f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${Oe.status==="matched"?"bg-emerald-500":Oe.status==="partial"?"bg-yellow-500":"bg-red-500"}`}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{className:"font-medium text-white text-sm",children:Oe.semanticLabel}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsxs("span",{className:`text-xs ${Fe.text}`,children:[Oe.matchConfidence,"%"]}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${ye?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),f.jsxs("p",{className:"text-xs text-surface-400 mt-1",children:["Lines ",Oe.promptRange.startLine,"-",Oe.promptRange.endLine]}),Oe.notes&&f.jsx("p",{className:`text-xs mt-2 ${Fe.text}`,children:Oe.notes})]})]}),ye&&Oe.promptRange.text&&f.jsx("div",{className:"mt-3 ml-5",children:f.jsx("pre",{className:"text-xs text-purple-300 p-3 bg-surface-900/80 rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto border border-surface-700/30",children:Oe.promptRange.text})})]}):f.jsxs("div",{className:"p-4 flex flex-col items-center justify-center min-h-[80px] gap-2",children:[f.jsx("span",{className:"text-xs text-red-400/60 italic",children:"Not documented in prompt"}),a&&o&&f.jsxs("button",{onClick:Je=>{Je.stopPropagation(),o(Ze.UPDATE,{_code:a.code}),e()},className:"px-3 py-1.5 text-xs bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors flex items-center gap-1.5",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),"Run pdd update"]})]})}),f.jsx("div",{className:`flex-1 ${Qe==="prompt"&&Oe.status==="missing"?"bg-red-500/10":""}`,children:Qe==="prompt"&&Oe.status!=="missing"&&Oe.codeRanges.length>0?f.jsxs("div",{className:`p-4 cursor-pointer hover:bg-surface-700/20 transition-colors ${Fe.bg}`,onClick:()=>K(ae),children:[f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${Oe.status==="matched"?"bg-emerald-500":Oe.status==="partial"?"bg-yellow-500":"bg-red-500"}`}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{className:"font-medium text-white text-sm",children:"Implementation"}),f.jsxs("span",{className:"text-xs text-surface-500",children:[Oe.codeRanges.length," location",Oe.codeRanges.length>1?"s":""]})]}),f.jsxs("p",{className:"text-xs text-surface-400 mt-1",children:["Lines ",(ge=Oe.codeRanges[0])==null?void 0:ge.startLine,"-",(Ke=Oe.codeRanges[0])==null?void 0:Ke.endLine,Oe.codeRanges.length>1&&` (+${Oe.codeRanges.length-1} more)`]})]})]}),ye&&f.jsx("div",{className:"mt-3 ml-5 space-y-2",children:Oe.codeRanges.map((Je,tt)=>f.jsxs("div",{children:[Oe.codeRanges.length>1&&f.jsxs("span",{className:"text-[10px] text-surface-500 uppercase",children:["Location ",tt+1," (L",Je.startLine,"-",Je.endLine,")"]}),f.jsx("pre",{className:"text-xs text-emerald-300 p-3 bg-surface-900/80 rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto border border-surface-700/30",children:Je.text||`Lines ${Je.startLine}-${Je.endLine}`})]},tt))})]}):Qe==="prompt"&&Oe.status==="missing"?f.jsxs("div",{className:"p-4 flex flex-col items-center justify-center min-h-[80px] bg-red-500/10 gap-2",children:[f.jsxs("div",{className:"text-center",children:[f.jsx("svg",{className:"w-5 h-5 text-red-400 mx-auto mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),f.jsx("span",{className:"text-xs text-red-400 font-medium",children:"Not implemented"})]}),a&&o&&f.jsxs("button",{onClick:Je=>{Je.stopPropagation(),o(Ze.SYNC),e()},className:"px-3 py-1.5 text-xs bg-emerald-600 hover:bg-emerald-500 text-white rounded-lg transition-colors flex items-center gap-1.5",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Run pdd sync"]})]}):Qe==="code"?f.jsxs("div",{className:"p-4 cursor-pointer hover:bg-surface-700/20 transition-colors bg-red-500/5",onClick:()=>K(ae),children:[f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("div",{className:"w-2 h-2 rounded-full mt-1.5 flex-shrink-0 bg-red-500"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{className:"font-medium text-white text-sm",children:Oe.semanticLabel}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("span",{className:"text-xs text-red-400",children:"Undocumented"}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${ye?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),f.jsxs("p",{className:"text-xs text-surface-400 mt-1",children:["Lines ",(ot=Oe.codeRanges[0])==null?void 0:ot.startLine,"-",(st=Oe.codeRanges[0])==null?void 0:st.endLine]}),Oe.notes&&f.jsx("p",{className:"text-xs mt-2 text-red-400",children:Oe.notes})]})]}),ye&&((ht=Oe.codeRanges[0])==null?void 0:ht.text)&&f.jsx("div",{className:"mt-3 ml-5",children:f.jsx("pre",{className:"text-xs text-emerald-300 p-3 bg-surface-900/80 rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto border border-red-500/30",children:Oe.codeRanges[0].text})})]}):null})]},ae)}),Xe.length===0&&f.jsx("div",{className:"p-12 text-center text-surface-500",children:"No sections found. Try re-analyzing with different settings."})]})]})]}),R==="history"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"px-6 py-3 border-b border-surface-700/50 bg-surface-800/30 flex-shrink-0",children:!L&&q&&f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[f.jsx("label",{className:"text-xs text-surface-400",children:"Version A:"}),f.jsxs("select",{value:C,onChange:ae=>G(ae.target.value),className:"flex-1 max-w-xs px-3 py-1.5 bg-surface-900 border border-surface-700 rounded-lg text-xs text-white",children:[f.jsx("option",{value:"working",children:"Current (Working)"}),q.versions.map(ae=>f.jsxs("option",{value:ae.commit_hash,children:[ae.commit_hash.slice(0,7)," - ",ae.commit_message.slice(0,30)]},ae.commit_hash))]})]}),f.jsx("span",{className:"text-surface-500 text-sm",children:"vs"}),f.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[f.jsx("label",{className:"text-xs text-surface-400",children:"Version B:"}),f.jsx("select",{value:A,onChange:ae=>U(ae.target.value),className:"flex-1 max-w-xs px-3 py-1.5 bg-surface-900 border border-surface-700 rounded-lg text-xs text-white",children:q.versions.map(ae=>f.jsxs("option",{value:ae.commit_hash,children:[ae.commit_hash.slice(0,7)," - ",ae.commit_message.slice(0,30)]},ae.commit_hash))})]}),f.jsx("button",{onClick:be,disabled:J||!C||!A,className:"px-4 py-1.5 bg-purple-600 text-white rounded-lg text-xs hover:bg-purple-500 disabled:opacity-50",children:J?"Comparing...":"Compare"})]})}),H&&f.jsxs("div",{className:"flex border-b border-surface-700/50 bg-surface-800/30 flex-shrink-0",children:[f.jsx("div",{className:"flex-1 px-6 py-2 border-r border-surface-700/50",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-sm font-medium text-purple-400",children:["Older: ",H.version_a_label]}),H.versions_swapped&&f.jsx("span",{className:"text-[10px] text-surface-500 bg-surface-700 px-1.5 py-0.5 rounded",children:"auto-ordered"})]}),H.linguistic_changes.filter(ae=>ae.change_type==="removed").length>0&&f.jsxs("span",{className:"text-xs text-red-400",children:[H.linguistic_changes.filter(ae=>ae.change_type==="removed").length," removed"]})]})}),f.jsx("div",{className:"flex-1 px-6 py-2",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("span",{className:"text-sm font-medium text-emerald-400",children:["Newer: ",H.version_b_label]}),H.linguistic_changes.filter(ae=>ae.change_type==="added").length>0&&f.jsxs("span",{className:"text-xs text-emerald-400",children:[H.linguistic_changes.filter(ae=>ae.change_type==="added").length," added"]})]})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[L&&f.jsx("div",{className:"flex items-center justify-center py-16",children:f.jsxs("div",{className:"text-center",children:[f.jsxs("svg",{className:"w-8 h-8 animate-spin text-purple-500 mx-auto mb-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("p",{className:"text-surface-400",children:"Loading version history..."})]})}),V&&f.jsx("div",{className:"p-6",children:f.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-4 flex items-center gap-3",children:[f.jsx("svg",{className:"w-5 h-5 text-red-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{className:"text-red-400",children:V})]})}),!L&&q&&!H&&f.jsxs("div",{className:"p-6",children:[f.jsx("div",{className:"mb-6 p-4 bg-surface-800/50 rounded-xl border border-surface-700/50",children:f.jsx("p",{className:"text-sm text-surface-400",children:'Select two versions above and click "Compare" to see side-by-side differences.'})}),f.jsxs("div",{className:"bg-surface-800/50 rounded-xl p-4 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-medium text-white mb-3",children:["Version History (",q.versions.length," commits)",q.has_uncommitted_changes&&f.jsx("span",{className:"ml-2 text-xs text-yellow-400",children:"(uncommitted changes)"})]}),f.jsx("div",{className:"space-y-2",children:q.versions.map(ae=>f.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-surface-700/30 cursor-pointer ${A===ae.commit_hash?"bg-purple-500/20 border border-purple-500/30":""}`,onClick:()=>U(ae.commit_hash),children:[f.jsx("div",{className:`w-2 h-2 rounded-full ${A===ae.commit_hash?"bg-purple-400":"bg-surface-500"}`}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-mono text-purple-400",children:ae.commit_hash.slice(0,7)}),f.jsx("span",{className:"text-sm text-white truncate",children:ae.commit_message})]}),f.jsxs("div",{className:"text-xs text-surface-500",children:[ae.author," • ",new Date(ae.commit_date).toLocaleString()]})]})]},ae.commit_hash))})]})]}),H&&f.jsxs("div",{className:"divide-y divide-surface-700/30",children:[f.jsxs("div",{className:"flex bg-surface-800/20",children:[f.jsxs("div",{className:"flex-1 p-4 border-r border-surface-700/30",children:[f.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Summary"}),f.jsx("p",{className:"text-sm text-surface-300",children:H.summary||"No changes detected"})]}),f.jsxs("div",{className:"flex-1 p-4",children:[f.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Changes"}),f.jsxs("div",{className:"flex gap-3 text-xs",children:[H.linguistic_changes.filter(ae=>ae.impact==="breaking").length>0&&f.jsxs("span",{className:"text-red-400",children:[H.linguistic_changes.filter(ae=>ae.impact==="breaking").length," breaking"]}),H.linguistic_changes.filter(ae=>ae.impact==="enhancement").length>0&&f.jsxs("span",{className:"text-emerald-400",children:[H.linguistic_changes.filter(ae=>ae.impact==="enhancement").length," enhancements"]}),H.linguistic_changes.filter(ae=>ae.impact==="clarification").length>0&&f.jsxs("span",{className:"text-blue-400",children:[H.linguistic_changes.filter(ae=>ae.impact==="clarification").length," clarifications"]})]})]})]}),H.linguistic_changes.map((ae,Qe)=>{const Oe=D.has(Qe),ye=()=>{ee(ot=>{const st=new Set(ot);return st.has(Qe)?st.delete(Qe):st.add(Qe),st})},Fe=ae.impact==="breaking"?"bg-red-500/5":ae.impact==="enhancement"?"bg-emerald-500/5":"bg-blue-500/5";ae.impact==="breaking"||ae.impact;const ge=(ot=>{const st=ot.split(/[.!?]\s/)[0];return st.length<=100?st+(ot.length>st.length?".":""):ot.slice(0,80)+"..."})(ae.description),Ke=ae.description.length>ge.length;return f.jsxs("div",{className:`${Fe} cursor-pointer hover:bg-surface-700/10 transition-colors`,onClick:ye,children:[f.jsx("div",{className:"px-4 pt-4 pb-2 border-b border-surface-700/20",children:f.jsxs("div",{className:"flex items-start justify-between gap-4",children:[f.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[f.jsx("div",{className:`w-2.5 h-2.5 rounded-full mt-1 flex-shrink-0 ${ae.change_type==="added"?"bg-emerald-500":ae.change_type==="removed"?"bg-red-500":"bg-yellow-500"}`}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm text-white font-medium leading-relaxed",children:Oe?ae.description:ge}),!Oe&&Ke&&f.jsx("span",{className:"text-xs text-surface-500 ml-1",children:"(click to see more)"})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${ae.change_type==="added"?"bg-emerald-500/20 text-emerald-400":ae.change_type==="removed"?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"}`,children:ae.change_type}),f.jsx("span",{className:"text-xs text-surface-500",children:ae.category}),f.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${ae.impact==="breaking"?"bg-red-500/20 text-red-400":ae.impact==="enhancement"?"bg-emerald-500/20 text-emerald-400":"bg-blue-500/20 text-blue-400"}`,children:ae.impact}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${Oe?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),f.jsxs("div",{className:"flex",children:[f.jsx("div",{className:`flex-1 border-r border-surface-700/30 p-4 pt-2 ${ae.change_type==="added"?"bg-surface-800/20":""}`,children:ae.old_text?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:`text-xs text-red-400/90 ${Oe?"":"line-clamp-3"}`,children:[Oe?"":ae.old_text.slice(0,200),!Oe&&ae.old_text.length>200?"...":""]}),Oe&&f.jsx("pre",{className:"mt-2 text-xs text-red-300 p-3 bg-surface-900/80 rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto border border-red-500/20",children:ae.old_text})]}):f.jsx("p",{className:"text-xs text-surface-500 italic",children:ae.change_type==="added"?"Not present in older version":"—"})}),f.jsx("div",{className:`flex-1 p-4 pt-2 ${ae.change_type==="removed"?"bg-surface-800/20":""}`,children:ae.new_text?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:`text-xs text-emerald-400/90 ${Oe?"":"line-clamp-3"}`,children:[Oe?"":ae.new_text.slice(0,200),!Oe&&ae.new_text.length>200?"...":""]}),Oe&&f.jsx("pre",{className:"mt-2 text-xs text-emerald-300 p-3 bg-surface-900/80 rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto border border-emerald-500/20",children:ae.new_text})]}):f.jsx("p",{className:"text-xs text-surface-500 italic",children:ae.change_type==="removed"?"Removed in newer version":"—"})})]})]},Qe)}),H.text_diff&&f.jsx("div",{className:"flex",children:f.jsxs("div",{className:"flex-1 p-4 cursor-pointer hover:bg-surface-700/10 transition-colors",onClick:()=>{ee(ae=>{const Qe=new Set(ae);return Qe.has(-1)?Qe.delete(-1):Qe.add(-1),Qe})},children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-sm font-medium text-surface-300",children:"Raw Text Diff"}),f.jsxs("span",{className:"text-xs text-surface-500",children:["(",H.text_diff.split(`
|
|
294
|
-
`).filter(ae=>ae.startsWith("+")).length," additions,",H.text_diff.split(`
|
|
295
|
-
`).filter(ae=>ae.startsWith("-")).length," deletions)"]})]}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${D.has(-1)?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),D.has(-1)&&f.jsx("pre",{className:"mt-3 text-xs font-mono p-3 bg-surface-900 rounded-lg overflow-x-auto whitespace-pre max-h-96 overflow-y-auto border border-surface-700/30",children:H.text_diff.split(`
|
|
296
|
-
`).map((ae,Qe)=>f.jsx("div",{className:ae.startsWith("+")&&!ae.startsWith("+++")?"text-emerald-400 bg-emerald-500/10":ae.startsWith("-")&&!ae.startsWith("---")?"text-red-400 bg-red-500/10":ae.startsWith("@")?"text-blue-400 bg-blue-500/10":"text-surface-400",children:ae},Qe))})]})}),H.linguistic_changes.length===0&&f.jsx("div",{className:"p-12 text-center text-surface-500",children:"No semantic differences detected between versions."})]}),!L&&!q&&!V&&f.jsx("div",{className:"text-center py-16 text-surface-500",children:f.jsx("p",{children:"No history available. Click Refresh to load."})})]})]}),f.jsxs("div",{className:"px-6 py-3 border-t border-surface-700/50 flex items-center justify-between bg-surface-900/50 flex-shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-6",children:[R==="alignment"&&u&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-sm text-surface-300",children:u.result.summary}),f.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[u.result.stats.criticalGaps>0&&f.jsxs("span",{className:"text-red-400 flex items-center gap-1 font-medium",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),u.result.stats.criticalGaps," critical gaps"]}),u.result.stats.hiddenKnowledgeCount>0&&f.jsxs("span",{className:"text-orange-400 flex items-center gap-1",children:[f.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500"}),u.result.stats.hiddenKnowledgeCount," hidden knowledge"]}),u.result.stats.missingRequirements>0&&f.jsxs("span",{className:"text-red-400 flex items-center gap-1",children:[f.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),u.result.stats.missingRequirements," missing"]}),u.result.stats.undocumentedFeatures>0&&f.jsxs("span",{className:"text-red-400 flex items-center gap-1",children:[f.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),u.result.stats.undocumentedFeatures," undocumented"]}),!u.result.canRegenerate&&f.jsx("span",{className:"text-red-400 flex items-center gap-1 font-medium",children:"Cannot safely regenerate"}),u.result.canRegenerate&&u.result.stats.criticalGaps===0&&f.jsxs("span",{className:"text-emerald-400 flex items-center gap-1",children:[f.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),"Safe to regenerate"]})]})]}),R==="history"&&q&&f.jsxs("div",{className:"text-sm text-surface-300",children:[q.versions.length," version",q.versions.length!==1?"s":""," found",q.has_uncommitted_changes&&f.jsx("span",{className:"text-yellow-400 ml-2",children:"• Uncommitted changes present"})]})]}),R==="alignment"&&u&&f.jsxs("div",{className:"text-xs text-surface-500",children:[u.model," ($",u.cost.toFixed(4),")"]}),R==="history"&&H&&H.cost>0&&f.jsxs("div",{className:"text-xs text-surface-500",children:[H.model," ($",H.cost.toFixed(4),")"]})]})]})})},aee=({type:n,name:e})=>n==="directory"?f.jsx(Vz,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".prompt")?f.jsx(Zz,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".py")?f.jsx(Ex,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".ts")||e.endsWith(".tsx")?f.jsx(Ex,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".js")||e.endsWith(".jsx")?f.jsx(Ex,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".json")?f.jsx(DJ,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".md")?f.jsx(w4,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):f.jsx(w4,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}),Dz=({node:n,onSelect:e,filter:t,depth:r,directoryMode:s})=>{var g;const[i,a]=P.useState(r<2),o=n.type==="directory";if(!(o?!0:s?!1:!t||t.length===0?!0:t.some(x=>n.name.endsWith(x))))return null;const d=((g=n.children)==null?void 0:g.filter(x=>x.type==="directory"?!0:s?!1:!t||t.length===0?!0:t.some(v=>x.name.endsWith(v))))||[];if(o&&!s&&t&&t.length>0&&d.length===0)return null;const p=()=>{o?a(!i):e(n.path)},m=x=>{x.stopPropagation(),e(n.path)};return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center py-1 px-2 cursor-pointer rounded transition-colors ${o?"hover:bg-surface-700":"hover:bg-accent-600/20"}`,style:{paddingLeft:`${r*16+8}px`},onClick:p,children:[o&&f.jsx("span",{className:"mr-1 text-surface-400",children:i?f.jsx(mm,{className:"w-4 h-4"}):f.jsx(pm,{className:"w-4 h-4 rotate-90"})}),f.jsx(aee,{type:n.type,name:n.name}),f.jsx("span",{className:`text-sm flex-1 ${o?"text-surface-200":"text-surface-300"}`,children:n.name}),s&&o&&f.jsx("button",{onClick:m,className:"ml-2 px-2 py-0.5 text-xs bg-accent-600/20 hover:bg-accent-600/40 text-accent-400 rounded transition-colors",children:"Select"})]}),o&&i&&d.map((x,v)=>f.jsx(Dz,{node:x,onSelect:e,filter:t,depth:r+1,directoryMode:s},x.path||v))]})},Q2=({onSelect:n,onClose:e,filter:t,title:r="Select File",directoryMode:s=!1})=>{const[i,a]=P.useState(null),[o,u]=P.useState(!0),[d,p]=P.useState(null),[m,g]=P.useState(""),x=t?Array.isArray(t)?t:[t]:void 0;P.useEffect(()=>{v()},[]);const v=async()=>{u(!0),p(null);try{const Q=await Ce.getFileTree("",5);a(Q)}catch(Q){p(Q.message||"Failed to load file tree")}finally{u(!1)}},y=Q=>{n(Q)},S=o?f.jsx("div",{className:"bg-surface-800 rounded-lg p-4 border border-surface-700",children:f.jsx("div",{className:"text-surface-400 text-center",children:"Loading files..."})}):d?f.jsxs("div",{className:"bg-surface-800 rounded-lg p-4 border border-surface-700",children:[f.jsx("div",{className:"text-red-400 text-center",children:d}),f.jsx("button",{onClick:v,className:"mt-2 w-full py-1 bg-surface-700 hover:bg-surface-600 rounded text-sm",children:"Retry"})]}):f.jsxs("div",{className:"bg-surface-800 rounded-lg border border-surface-700 overflow-hidden",children:[f.jsxs("div",{className:"p-3 border-b border-surface-700 flex items-center justify-between",children:[f.jsx("h3",{className:"text-sm font-medium text-surface-200",children:r}),e&&f.jsx("button",{onClick:e,className:"p-1 hover:bg-surface-700 rounded text-surface-400 hover:text-white transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"p-3 border-b border-surface-700/50",children:[f.jsx("input",{type:"text",placeholder:"Search files...",value:m,onChange:Q=>g(Q.target.value),className:"w-full px-3 py-1.5 bg-surface-900 border border-surface-600 rounded text-sm text-surface-200 placeholder-surface-500 focus:outline-none focus:border-accent-500"}),s?f.jsx("div",{className:"mt-2 text-xs text-surface-500",children:"Showing directories only"}):x&&x.length>0?f.jsxs("div",{className:"mt-2 text-xs text-surface-500",children:["Showing: ",x.join(", ")]}):null]}),f.jsx("div",{className:"max-h-80 overflow-y-auto p-2",children:i?f.jsx(Dz,{node:i,onSelect:y,filter:x,depth:0,directoryMode:s}):f.jsx("div",{className:"text-surface-500 text-center py-4",children:"No files found"})})]});return e?f.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:Q=>{Q.target===Q.currentTarget&&e()},children:f.jsx("div",{className:"w-full max-w-md mx-4",children:S})}):S},Js=({label:n,value:e,onChange:t,placeholder:r="",description:s,required:i=!1,filter:a,directoryMode:o=!1,title:u,isDetected:d,detectedLabel:p="detected",className:m=""})=>{const[g,x]=P.useState(!1),v=Q=>{t(Q),x(!1)},y=Q=>{t(Q.target.value)},S=d!==void 0?d?"border-green-500/50":"border-yellow-500/50":"border-surface-600";return f.jsxs("div",{className:m,children:[f.jsxs("label",{className:"block text-sm font-medium text-white mb-1.5",children:[n,i&&f.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),s&&f.jsx("p",{className:"text-xs text-surface-400 mb-2",children:s}),f.jsxs("div",{className:"relative flex gap-2",children:[f.jsxs("div",{className:"relative flex-1",children:[f.jsx("input",{type:"text",value:e,onChange:y,placeholder:r,className:`w-full px-3 py-2.5 bg-surface-900/50 border ${S} rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 text-sm transition-all pr-20`}),d&&f.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-green-400 text-xs px-1.5 py-0.5 rounded bg-green-500/20",children:p})]}),f.jsx("button",{type:"button",onClick:()=>x(!0),className:"px-3 py-2.5 bg-surface-700 hover:bg-surface-600 rounded-xl text-surface-300 hover:text-white transition-colors flex items-center gap-2",title:"Browse files",children:f.jsx(YJ,{className:"w-4 h-4"})})]}),g&&f.jsx(Q2,{onSelect:v,onClose:()=>x(!1),filter:a,directoryMode:o,title:u||(o?"Select Directory":"Select File")})]})};function lee(n){var t;const e=(t=n.split(".").pop())==null?void 0:t.toLowerCase();switch(e){case"py":return MK();case"js":case"jsx":case"ts":case"tsx":return tz({jsx:!0,typescript:e==="ts"||e==="tsx"});case"java":return VK();default:return[]}}const oee=new Mz({breaks:!0,gfm:!0});function Ax(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const qx=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`option-${n.name}`;if(n.type==="checkbox")return f.jsxs("label",{htmlFor:s,className:`flex items-start gap-3 ${r?"p-2":"p-3"} rounded-xl bg-surface-800/30 hover:bg-surface-800/50 transition-colors cursor-pointer group`,children:[f.jsx("input",{type:"checkbox",id:s,checked:!!e,onChange:i=>t(i.target.checked),className:"w-4 h-4 mt-0.5 rounded bg-surface-700 border-surface-600 text-accent-500 focus:ring-accent-500 focus:ring-offset-surface-800"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:Ax(n.name)}),f.jsx("div",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mt-0.5`,children:n.description})]})]});if(n.type==="range"){const i=n.min??0,a=n.max??1,o=n.step??.1,u=e??n.defaultValue??i;return f.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:Ax(n.name)}),f.jsx("span",{className:`${r?"text-xs":"text-sm"} font-mono text-accent-400 bg-accent-500/10 px-2 py-0.5 rounded-lg`,children:typeof u=="number"?u.toFixed(2):u})]}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),f.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:d=>t(parseFloat(d.target.value)),className:`flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500
|
|
297
|
-
[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4
|
|
298
|
-
[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent-500
|
|
299
|
-
[&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-accent-500/30
|
|
300
|
-
[&::-webkit-slider-thumb]:hover:bg-accent-400 [&::-webkit-slider-thumb]:transition-colors`}),f.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return f.jsxs("div",{children:[f.jsxs("label",{htmlFor:s,className:`block ${r?"text-xs":"text-sm"} font-medium text-white mb-1.5`,children:[Ax(n.name),n.required&&f.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mb-2`,children:n.description}),n.type==="textarea"?f.jsx("textarea",{id:s,value:e||"",onChange:i=>t(i.target.value),placeholder:n.placeholder,required:n.required,rows:3,className:"w-full px-3 py-2.5 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 text-sm transition-all resize-none"}):f.jsx("input",{type:n.type==="number"?"number":"text",id:s,value:e||"",onChange:i=>t(n.type==="number"?i.target.value?Number(i.target.value):"":i.target.value),placeholder:n.placeholder,required:n.required,className:"w-full px-3 py-2.5 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 text-sm transition-all"})]})},cee=({command:n,prompt:e,onRun:t,onAddToQueue:r,onCancel:s})=>{const[i,a]=P.useState(!1),[o,u]=P.useState(()=>{const x={};return n.options.forEach(v=>{v.defaultValue!==void 0&&(v.type==="checkbox"?x[v.name]=v.defaultValue==="true"||v.defaultValue===!0:(v.type==="number"||v.type,x[v.name]=v.defaultValue))}),n.requiresCode&&(x._code=e.code||""),n.requiresTest&&(x._test=e.test||""),n.name===Ze.SUBMIT_EXAMPLE&&e.example&&(x["verification-program"]=e.example),ur.forEach(v=>{x[`_global_${v.name}`]=v.defaultValue}),x}),d=(x,v)=>{u(y=>({...y,[x]:v}))},p=x=>{x.preventDefault();const v={};Object.entries(o).forEach(([y,S])=>{y.startsWith("_global_")||S!==""&&S!==void 0&&S!==null&&(v[y]=S)}),ur.forEach(y=>{const S=o[`_global_${y.name}`],Q=y.defaultValue;S!==Q&&S!==void 0&&S!==null&&(v[`_global_${y.name}`]=S)}),t(v)},m=()=>{const x={};Object.entries(o).forEach(([v,y])=>{v.startsWith("_global_")||y!==""&&y!==void 0&&y!==null&&(x[v]=y)}),ur.forEach(v=>{const y=o[`_global_${v.name}`],S=v.defaultValue;y!==S&&y!==void 0&&y!==null&&(x[`_global_${v.name}`]=y)}),r==null||r(x)},g=ur.some(x=>o[`_global_${x.name}`]!==x.defaultValue);return f.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-fade-in",onClick:s,children:f.jsxs("div",{className:"glass rounded-2xl border border-surface-600/50 shadow-2xl w-full max-w-md animate-scale-in",onClick:x=>x.stopPropagation(),children:[f.jsx("div",{className:"px-4 sm:px-6 py-4 border-b border-surface-700/50",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center",children:f.jsx("span",{className:"text-xl",children:n.icon})}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold text-white",children:n.shortDescription}),f.jsx("p",{className:"text-xs sm:text-sm text-surface-400 line-clamp-1",children:n.description})]})]})}),f.jsxs("form",{onSubmit:p,children:[f.jsxs("div",{className:"px-4 sm:px-6 py-4 space-y-4 max-h-[50vh] sm:max-h-[60vh] overflow-y-auto",children:[f.jsxs("div",{className:"bg-surface-800/50 rounded-xl px-3 py-2.5 border border-surface-700/50",children:[f.jsx("div",{className:"text-xs text-surface-400 mb-0.5",children:"Target Prompt"}),f.jsx("div",{className:"text-sm text-white font-mono truncate",children:e.sync_basename})]}),n.requiresCode&&f.jsx(Js,{label:"Code File",value:o._code||"",onChange:x=>d("_code",x),placeholder:"e.g., src/calculator.py",description:e.code?"Auto-detected code file. Change if needed.":"No code file detected. Enter the path to use.",required:!0,filter:[".py",".ts",".tsx",".js",".jsx",".java",".go",".rs",".rb",".php",".cs",".cpp",".c",".h"],title:"Select Code File",isDetected:!!e.code}),n.requiresTest&&f.jsx(Js,{label:"Test File",value:o._test||"",onChange:x=>d("_test",x),placeholder:"e.g., tests/test_calculator.py",description:e.test?"Auto-detected test file. Change if needed.":"No test file detected. Enter the path to use.",required:!0,filter:[".py",".ts",".tsx",".js",".jsx",".java",".go",".rs",".rb",".php",".cs",".cpp",".c"],title:"Select Test File",isDetected:!!e.test}),n.options.length>0?n.options.map(x=>f.jsx(qx,{option:x,value:o[x.name],onChange:v=>d(x.name,v)},x.name)):!n.requiresCode&&!n.requiresTest?f.jsx("p",{className:"text-surface-400 text-sm",children:"No additional options for this command."}):null,f.jsxs("div",{className:"border-t border-surface-700/30 pt-3 mt-2",children:[f.jsxs("button",{type:"button",onClick:()=>a(!i),className:"w-full flex items-center justify-between text-left group",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),g&&f.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${i?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&f.jsxs("div",{className:"mt-3 space-y-3 animate-slide-down",children:[f.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),ur.filter(x=>["strength","temperature","time"].includes(x.name)).map(x=>f.jsx(qx,{option:x,value:o[`_global_${x.name}`],onChange:v=>d(`_global_${x.name}`,v),compact:!0},x.name))]}),f.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),ur.filter(x=>["local","verbose","quiet","force","review-examples"].includes(x.name)).map(x=>f.jsx(qx,{option:x,value:o[`_global_${x.name}`],onChange:v=>d(`_global_${x.name}`,v),compact:!0},x.name))]})]})]})]}),f.jsxs("div",{className:"px-4 sm:px-6 py-4 border-t border-surface-700/50 flex flex-col-reverse sm:flex-row justify-end gap-2 sm:gap-3",children:[f.jsx("button",{type:"button",onClick:s,className:"w-full sm:w-auto px-4 py-2.5 rounded-xl text-sm font-medium bg-surface-700/50 text-surface-300 hover:bg-surface-600 transition-colors",children:"Cancel"}),r&&f.jsxs("button",{type:"button",onClick:m,className:"w-full sm:w-auto px-4 py-2.5 rounded-xl text-sm font-medium bg-emerald-600/20 text-emerald-300 hover:bg-emerald-600 hover:text-white border border-emerald-600/30 hover:border-emerald-500/50 transition-all flex items-center justify-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),f.jsx("span",{children:"Add to Queue"})]}),f.jsxs("button",{type:"submit",className:"w-full sm:w-auto px-4 py-2.5 rounded-xl text-sm font-medium bg-gradient-to-r from-accent-600 to-accent-500 hover:from-accent-500 hover:to-accent-400 text-white shadow-lg shadow-accent-500/25 transition-all flex items-center justify-center gap-2",children:[f.jsx("span",{children:n.icon}),f.jsxs("span",{children:["Run ",n.shortDescription]})]})]})]})]})})},uee=({prompt:n,onBack:e,onRunCommand:t,onAddToQueue:r,isExecuting:s,executionStatus:i="idle",lastCommand:a=null,lastRunResult:o=null,onCancelCommand:u})=>{var ps;const d=P.useRef(null),p=P.useRef(null),m=P.useRef(""),g=P.useRef(""),x=P.useRef(new Hf),[v,y]=P.useState(!0),[S,Q]=P.useState(null),[k,$]=P.useState(null),[j,T]=P.useState(!1),[R,N]=P.useState(!1),[q,z]=P.useState(!1),[L,E]=P.useState(null),[V,B]=P.useState("raw"),[C,G]=P.useState(null),[A,U]=P.useState(!1),[H,W]=P.useState(!1),[J,X]=P.useState(null),[D,ee]=P.useState({visible:!1,loading:!1,tagInfo:null,metrics:null,error:null}),[Z,I]=P.useState(""),[K,re]=P.useState(!1),[se,be]=P.useState(null),[$e,Xe]=P.useState(!1),[ae,Qe]=P.useState(null),Oe=P.useRef(null),ye=P.useRef(null),[Fe,Te]=P.useState(!1),[ge,Ke]=P.useState(null),[ot,st]=P.useState(.5),[ht,Je]=P.useState(!1),[tt,hn]=P.useState(!1),[Qt,zt]=P.useState(null),[St,en]=P.useState(!1),[ln,pt]=P.useState(null),[Lt,ct]=P.useState(!1);P.useEffect(()=>{if(H){let xe;V==="processed"&&(C!=null&&C.processed_content)?xe=C.processed_content:p.current?xe=p.current.state.doc.toString():xe=g.current||k||"",I(xe)}},[H,V,C==null?void 0:C.processed_content,k]);const de=P.useMemo(()=>{if(!Z)return"";try{const xe=oee.parse(Z);return typeof xe=="string"?xe:""}catch(xe){return console.error("Markdown rendering error:",xe),'<p class="text-red-400">Error rendering markdown</p>'}},[Z]);P.useEffect(()=>{let xe=!1;return(async()=>{y(!0),Q(null);try{const Ve=await Ce.getFileContent(n.prompt);xe||(m.current=Ve.content,g.current=Ve.content,$(Ve.content))}catch(Ve){xe||Q(Ve.message||"Failed to load file")}finally{xe||y(!1)}})(),()=>{xe=!0}},[n.prompt]),P.useEffect(()=>{if(H||k===null||!d.current)return;p.current&&(p.current.destroy(),p.current=null);const xe=g.current||k,_e=xt.create({doc:xe,extensions:[A_(),__(),SU(),Cc.of([...i7,...TW,...CU]),gF(),h4,...tee(),x.current.of(Ae.editable.of(V==="raw")),Ae.updateListener.of(Ve=>{if(Ve.docChanged){const Rt=Ve.state.doc.toString();Ve.view.state.facet(Ae.editable)&&(g.current=Rt),T(Rt!==m.current)}}),Ae.theme({"&":{height:"100%",fontSize:"14px",backgroundColor:"rgb(17 24 39)"},".cm-scroller":{overflow:"auto",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-gutters":{backgroundColor:"rgb(31 41 55)",borderRight:"1px solid rgb(55 65 81)"},".cm-activeLineGutter":{backgroundColor:"rgb(55 65 81)"},".cm-activeLine":{backgroundColor:"rgba(55, 65, 81, 0.5)"}})]});return p.current=new Ae({state:_e,parent:d.current}),()=>{p.current&&(p.current.destroy(),p.current=null)}},[k,H,V]),P.useEffect(()=>{if(k===null)return;const _e=setTimeout(async()=>{U(!0);try{const Ve=p.current?p.current.state.doc.toString():g.current||k,Rt=(J==null?void 0:J.model)||"claude-sonnet-4-20250514",On=await Ce.analyzePrompt({path:n.prompt,model:Rt,preprocess:!0,content:Ve});G(On)}catch(Ve){console.error("Failed to analyze prompt:",Ve)}finally{U(!1)}},500);return()=>clearTimeout(_e)},[k,n.prompt,j,J]);const we=P.useCallback(async()=>{if(!n.code){Qe("No code file associated with this prompt");return}Xe(!0),Qe(null);try{const xe=await Ce.getFileContent(n.code);be(xe.content)}catch(xe){Qe(xe.message||"Failed to load code file")}finally{Xe(!1)}},[n.code]),ke=P.useCallback(()=>{!K&&!se&&n.code&&we(),re(!K)},[K,se,n.code,we]),Be=P.useCallback(()=>{we()},[we]),Qn=async()=>{if(!se)if(n.code)await we();else{zt("No code file associated with this prompt");return}Je(!0),zt(null);try{const xe=p.current?p.current.state.doc.toString():g.current||k||"",_e=await Ce.checkMatch({prompt_content:xe,code_content:se||"",strength:ot});Ke(_e)}catch(xe){zt(xe.message||"Failed to check match")}finally{Je(!1)}};P.useEffect(()=>{if(!K||se===null||!Oe.current)return;ye.current&&(ye.current.destroy(),ye.current=null);const xe=xt.create({doc:se,extensions:[A_(),__(),Ae.editable.of(!1),lee(n.code||""),h4,Ae.theme({"&":{height:"100%",fontSize:"13px",backgroundColor:"rgb(17 24 39)"},".cm-scroller":{overflow:"auto",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-gutters":{backgroundColor:"rgb(31 41 55)",borderRight:"1px solid rgb(55 65 81)"},".cm-activeLineGutter":{backgroundColor:"rgb(55 65 81)"},".cm-activeLine":{backgroundColor:"rgba(55, 65, 81, 0.5)"}})]});return ye.current=new Ae({state:xe,parent:Oe.current}),()=>{ye.current&&(ye.current.destroy(),ye.current=null)}},[K,se,n.code]),P.useEffect(()=>{const xe=_e=>{(_e.metaKey||_e.ctrlKey)&&_e.key==="."&&(_e.preventDefault(),on()),_e.key==="Escape"&&D.visible&&cs()};return window.addEventListener("keydown",xe),()=>window.removeEventListener("keydown",xe)},[D.visible]);const Dt=xe=>{if(V==="raw"&&p.current&&(g.current=p.current.state.doc.toString()),B(xe),p.current){let _e;const Ve=xe==="raw";xe==="processed"&&(C!=null&&C.processed_content)?_e=C.processed_content:_e=g.current||k||"";const Rt=p.current.state.doc.toString(),On=[x.current.reconfigure(Ae.editable.of(Ve))];Rt!==_e?p.current.dispatch({changes:{from:0,to:Rt.length,insert:_e},effects:On}):p.current.dispatch({effects:On})}},kn=async()=>{if(p.current){N(!0),z(!1),Q(null);try{const xe=p.current.state.doc.toString();await Ce.writeFile(n.prompt,xe),m.current=xe,g.current=xe,T(!1),z(!0),setTimeout(()=>z(!1),2e3)}catch(xe){Q(xe.message||"Failed to save")}finally{N(!1)}}},Zt=()=>{j&&!window.confirm("Discard unsaved changes?")||e()},pn=async()=>{if(p.current){en(!0),pt(null),ct(!1);try{const xe=n.prompt.split("/").pop()||n.prompt,_e=await Ce.generateTagsForPrompt(xe);if(!_e.success){pt(_e.error||"Failed to generate tags");return}if(!_e.tags){pt("No architecture entry found for this prompt");return}if(_e.has_existing_tags){if(!window.confirm("This prompt already has PDD tags. Replace them with tags from architecture.json?"))return;const Rt=p.current.state.doc.toString().replace(/<pdd-reason>[\s\S]*?<\/pdd-reason>\s*/g,"").replace(/<pdd-interface>[\s\S]*?<\/pdd-interface>\s*/g,"").replace(/<pdd-dependency>[\s\S]*?<\/pdd-dependency>\s*/g,"").trimStart(),On=_e.tags+`
|
|
301
|
-
|
|
302
|
-
`+Rt;p.current.dispatch({changes:{from:0,to:p.current.state.doc.length,insert:On}})}else{const Ve=p.current.state.doc.toString(),Rt=_e.tags+`
|
|
303
|
-
|
|
304
|
-
`+Ve;p.current.dispatch({changes:{from:0,to:p.current.state.doc.length,insert:Rt}})}g.current=p.current.state.doc.toString(),T(g.current!==m.current),ct(!0),setTimeout(()=>ct(!1),3e3)}catch(xe){pt(xe.message||"Failed to sync from architecture")}finally{en(!1)}}},on=async()=>{if(!p.current)return;const xe=p.current.state,_e=nee(xe);if(!_e){ee({visible:!0,loading:!1,tagInfo:null,metrics:null,error:"Place cursor inside an <include>, <shell>, or <web> tag to analyze"}),setTimeout(()=>ee(Ve=>({...Ve,visible:!1})),3e3);return}ee({visible:!0,loading:!0,tagInfo:_e,metrics:null,error:null});try{let Ve=_e.path;if(_e.tagType==="include-many"){const On=ree(_e.path);On.length>0&&(Ve=On[0])}const Rt=await Ce.analyzeFile(Ve);ee({visible:!0,loading:!1,tagInfo:_e,metrics:Rt,error:null})}catch(Ve){ee({visible:!0,loading:!1,tagInfo:_e,metrics:null,error:Ve.message||"Failed to analyze file"})}},cs=()=>{ee(xe=>({...xe,visible:!1}))},xr=xe=>{const _e=Ra[xe];_e.options&&_e.options.length>0||_e.requiresCode||_e.requiresTest?E(_e):t(xe)},Ia=xe=>{L&&(t(L.name,xe),E(null))},us=xe=>{L&&r&&(r(L.name,xe),E(null))},$n=xe=>{const _e=[];return xe.requiresCode&&!n.code&&_e.push("code"),xe.requiresTest&&!n.test&&_e.push("test"),_e},mn=Object.values(Ra).filter(xe=>xe.requiresPrompt&&!xe.isAdvanced),oi=Object.values(Ra).filter(xe=>xe.isAdvanced),[fs,br]=P.useState(!1),[ds,Xs]=P.useState(!1),[yr,hs]=P.useState(!1);return f.jsxs("div",{className:"h-screen flex flex-col bg-surface-950",children:[f.jsxs("header",{className:"glass flex items-center justify-between px-3 sm:px-4 py-2.5 sm:py-3 border-b border-surface-700/50 sticky top-0 z-30",children:[f.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0",children:[f.jsxs("button",{onClick:Zt,className:"flex items-center gap-1.5 sm:gap-2 text-surface-400 hover:text-white transition-colors px-2 py-1.5 rounded-lg hover:bg-surface-700/50",children:[f.jsx("svg",{className:"w-4 h-4 sm:w-5 sm:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),f.jsx("span",{className:"hidden sm:inline text-sm",children:"Back"})]}),f.jsx("div",{className:"h-5 w-px bg-surface-700 hidden sm:block"}),f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("h1",{className:"text-sm sm:text-lg font-semibold text-white truncate",children:n.sync_basename}),n.language&&f.jsx("span",{className:"px-1.5 sm:px-2 py-0.5 rounded-full text-[10px] sm:text-xs bg-accent-500/15 text-accent-300 border border-accent-500/30 font-medium flex-shrink-0",children:n.language}),n.sync_basename&&n.language&&f.jsx(KJ,{basename:n.sync_basename,language:n.language,refreshTrigger:q?1:0})]})]}),f.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[f.jsx("button",{onClick:()=>br(!fs),className:"lg:hidden flex items-center gap-1.5 px-2.5 py-1.5 text-surface-400 hover:text-white bg-surface-700/50 hover:bg-surface-600 rounded-lg transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16m-7 6h7"})})}),j&&f.jsxs("span",{className:"text-yellow-400 text-xs sm:text-sm flex items-center gap-1.5 px-2 py-1 rounded-full bg-yellow-500/10 border border-yellow-500/20",children:[f.jsx("span",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-yellow-400 rounded-full animate-pulse"}),f.jsx("span",{className:"hidden xs:inline",children:"Unsaved"})]}),q&&f.jsx("span",{className:"text-green-400 text-xs sm:text-sm flex items-center gap-1.5 px-2 py-1 rounded-full bg-green-500/10 border border-green-500/20",children:f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),Lt&&f.jsxs("span",{className:"text-emerald-400 text-xs sm:text-sm flex items-center gap-1.5 px-2 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/20",children:[f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),f.jsx("span",{className:"hidden sm:inline",children:"Tags injected"})]}),ln&&f.jsx("span",{className:"text-red-400 text-xs flex items-center gap-1 px-2 py-1 rounded-full bg-red-500/10 border border-red-500/20",title:ln,children:f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),f.jsxs("button",{onClick:pn,disabled:St||V==="processed",className:`px-2.5 sm:px-3 py-1.5 text-xs sm:text-sm rounded-lg flex items-center gap-1.5 transition-all duration-200 ${!St&&V==="raw"?"bg-surface-700/50 text-surface-300 hover:text-white hover:bg-surface-600 border border-surface-600":"bg-surface-700/30 text-surface-500 cursor-not-allowed"}`,title:"Inject PDD tags from architecture.json",children:[St?f.jsxs("svg",{className:"animate-spin h-3.5 w-3.5 sm:h-4 sm:w-4",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),f.jsx("span",{className:"hidden sm:inline",children:St?"Syncing...":"Sync from JSON"})]}),f.jsxs("button",{onClick:kn,disabled:!j||R||V==="processed",className:`px-2.5 sm:px-4 py-1.5 text-xs sm:text-sm rounded-lg flex items-center gap-1.5 sm:gap-2 transition-all duration-200 ${j&&!R&&V==="raw"?"bg-gradient-to-r from-accent-600 to-accent-500 hover:from-accent-500 hover:to-accent-400 text-white shadow-lg shadow-accent-500/25":"bg-surface-700/50 text-surface-500 cursor-not-allowed"}`,title:V==="processed"?"Switch to Raw view to save changes":void 0,children:[R?f.jsxs("svg",{className:"animate-spin h-3.5 w-3.5 sm:h-4 sm:w-4",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),f.jsx("span",{className:"hidden xs:inline",children:R?"Saving...":"Save"})]})]})]}),i!=="idle"&&f.jsxs("div",{className:`
|
|
305
|
-
px-3 sm:px-4 py-2 text-center text-xs sm:text-sm font-medium border-b animate-slide-down
|
|
306
|
-
${i==="running"?"bg-accent-500/10 text-accent-300 border-accent-500/20":""}
|
|
307
|
-
${i==="success"?"bg-green-500/10 text-green-300 border-green-500/20":""}
|
|
308
|
-
${i==="failed"?"bg-red-500/10 text-red-300 border-red-500/20":""}
|
|
309
|
-
`,children:[i==="running"&&f.jsxs("span",{className:"flex items-center justify-center gap-2 flex-wrap",children:[f.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("code",{className:"bg-surface-800/80 px-2 py-0.5 rounded text-xs font-mono max-w-[150px] sm:max-w-none truncate",children:a}),u&&f.jsx("button",{onClick:u,className:"ml-2 px-2.5 py-1 bg-red-500/20 hover:bg-red-500/30 text-red-300 border border-red-500/30 rounded-lg text-xs font-medium transition-colors",children:"Stop"})]}),i==="success"&&f.jsxs("span",{className:"flex items-center justify-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Done"]}),i==="failed"&&f.jsxs("div",{className:"flex flex-col items-center gap-2",children:[f.jsxs("span",{className:"flex items-center justify-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Failed",o!=null&&o.exit_code?` (exit code: ${o.exit_code})`:""]}),(o==null?void 0:o.error_details)&&f.jsx("div",{className:"text-xs text-red-200/80 max-w-xl text-center px-4",children:o.error_details})]})]}),f.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[fs&&f.jsx("div",{className:"lg:hidden fixed inset-0 bg-black/50 z-40 animate-fade-in",onClick:()=>br(!1)}),f.jsxs("aside",{className:`
|
|
310
|
-
${fs?"translate-x-0":"-translate-x-full lg:translate-x-0"}
|
|
311
|
-
fixed lg:relative z-50 lg:z-auto
|
|
312
|
-
w-56 sm:w-52 lg:w-48 h-full
|
|
313
|
-
glass lg:bg-surface-800/30 border-r border-surface-700/50
|
|
314
|
-
flex flex-col transition-transform duration-300 ease-out
|
|
315
|
-
`,children:[f.jsxs("div",{className:"lg:hidden flex items-center justify-between p-3 border-b border-surface-700/50",children:[f.jsx("span",{className:"text-sm font-semibold text-white",children:"Menu"}),f.jsx("button",{onClick:()=>br(!1),className:"p-1.5 text-surface-400 hover:text-white rounded-lg hover:bg-surface-700/50",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsx("div",{className:"p-3 border-b border-surface-700/50 hidden lg:block",children:f.jsx("h2",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Commands"})}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsx("div",{className:"p-2 space-y-1",children:mn.map(xe=>{const _e=$n(xe),Ve=_e.length>0;return f.jsxs("button",{onClick:()=>{s||(xr(xe.name),br(!1))},disabled:s,className:`w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg text-sm text-left transition-all duration-200 ${s?"text-surface-500 cursor-not-allowed":"text-surface-300 hover:bg-surface-700/50 hover:text-white"}`,title:Ve?`${xe.description} (${_e.join(", ")} file${_e.length>1?"s":""} not auto-detected)`:xe.description,children:[f.jsx("span",{className:"text-base",children:xe.icon}),f.jsx("span",{className:"flex-1",children:xe.shortDescription}),Ve&&f.jsx("span",{className:"w-5 h-5 rounded-full bg-yellow-500/20 text-yellow-400 text-xs flex items-center justify-center",children:"!"})]},xe.name)})}),oi.length>0&&f.jsxs("div",{className:"border-t border-surface-700/30",children:[f.jsxs("button",{onClick:()=>Xs(!ds),className:"w-full p-3 flex items-center justify-between text-left hover:bg-surface-700/30 transition-colors",children:[f.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Operations"}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${ds?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),ds&&f.jsx("div",{className:"p-2 pt-0 space-y-1",children:oi.map(xe=>{const Ve=$n(xe).length>0;return f.jsxs("button",{onClick:()=>{s||(xr(xe.name),br(!1))},disabled:s,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm text-left transition-all duration-200 ${s?"text-surface-500 cursor-not-allowed":"text-surface-300 hover:bg-surface-700/50 hover:text-white"}`,title:xe.description,children:[f.jsx("span",{className:"text-surface-500 text-xs",children:xe.icon}),f.jsx("span",{className:"flex-1 text-xs",children:xe.shortDescription}),Ve&&f.jsx("span",{className:"w-4 h-4 rounded-full bg-yellow-500/20 text-yellow-400 text-[10px] flex items-center justify-center",children:"!"})]},xe.name)})})]})]}),f.jsxs("div",{className:"p-3 border-t border-surface-700/50 space-y-2",children:[f.jsx("h3",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Files"}),f.jsxs("div",{className:"space-y-1.5 text-xs",children:[f.jsx(np,{label:"Prompt",path:n.prompt,exists:!0}),f.jsx(np,{label:"Code",path:n.code,exists:!!n.code}),f.jsx(np,{label:"Test",path:n.test,exists:!!n.test}),f.jsx(np,{label:"Example",path:n.example,exists:!!n.example})]})]})]}),f.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:v?f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center mb-4",children:f.jsxs("svg",{className:"animate-spin h-5 w-5 text-accent-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}),f.jsx("div",{className:"text-surface-400 text-sm",children:"Loading prompt..."})]}):S&&k===null?f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[f.jsx("div",{className:"w-12 h-12 rounded-xl bg-red-500/20 flex items-center justify-center mb-4",children:f.jsx("svg",{className:"w-6 h-6 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),f.jsx("div",{className:"text-red-400 mb-2",children:S}),f.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-surface-700/50 hover:bg-surface-600 rounded-xl text-sm text-white transition-colors border border-surface-600",children:"Retry"})]}):f.jsxs(f.Fragment,{children:[f.jsx(XJ,{rawMetrics:(C==null?void 0:C.raw_metrics)||null,processedMetrics:(C==null?void 0:C.processed_metrics)||null,viewMode:V,onViewModeChange:Dt,isLoading:A,preprocessingError:C==null?void 0:C.preprocessing_error,timeValue:sn.time,promptLineCount:k?k.split(`
|
|
316
|
-
`).length:void 0,codeLineCount:se?se.split(`
|
|
317
|
-
`).length:void 0,selectedModel:J,onModelChange:X}),f.jsxs("div",{className:"px-3 sm:px-4 py-2 bg-surface-800/30 border-b border-surface-700/50 text-xs sm:text-sm text-surface-400 font-mono flex items-center gap-2 overflow-hidden",children:[f.jsx("span",{className:"truncate flex-1",children:n.prompt}),V==="processed"&&f.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] sm:text-xs bg-yellow-500/15 text-yellow-300 border border-yellow-500/30 flex-shrink-0",children:"Read Only"}),f.jsxs("button",{onClick:on,disabled:H,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium transition-all duration-200 flex-shrink-0 ${H?"bg-surface-700/30 text-surface-500 cursor-not-allowed":"bg-surface-700/50 text-surface-300 hover:bg-surface-600 hover:text-white"}`,title:"Analyze include tag at cursor (Cmd+.)",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),f.jsx("span",{className:"hidden sm:inline",children:"Tokens"})]}),f.jsxs("button",{onClick:ke,disabled:!n.code,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium transition-all duration-200 flex-shrink-0 ${n.code?K?"bg-blue-600 text-white":"bg-surface-700/50 text-surface-300 hover:bg-surface-600 hover:text-white":"bg-surface-700/30 text-surface-500 cursor-not-allowed"}`,title:n.code?K?"Hide code panel":"Show code side-by-side":"No code file available",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),f.jsx("span",{className:"hidden sm:inline",children:"Code"})]}),f.jsxs("button",{onClick:()=>hs(!yr),className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium transition-all duration-200 flex-shrink-0 ${yr?"bg-accent-600 text-white":"bg-surface-700/50 text-surface-300 hover:bg-surface-600 hover:text-white"}`,title:yr?"Hide prompting guide":"Show prompting guide",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{className:"hidden sm:inline",children:"Guide"})]}),f.jsxs("button",{onClick:()=>Te(!0),disabled:!n.code||ht,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium transition-all duration-200 flex-shrink-0 ${n.code?"bg-purple-600/50 text-purple-200 hover:bg-purple-500 hover:text-white":"bg-surface-700/30 text-surface-500 cursor-not-allowed"}`,title:n.code?"Check prompt-code match with LLM":"No code file available",children:[ht?f.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{className:"hidden sm:inline",children:"Match"})]}),f.jsxs("button",{onClick:()=>hn(!0),disabled:!n.code,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium transition-all duration-200 flex-shrink-0 ${n.code?"bg-gradient-to-r from-purple-600/50 to-blue-600/50 text-purple-200 hover:from-purple-500 hover:to-blue-500 hover:text-white":"bg-surface-700/30 text-surface-500 cursor-not-allowed"}`,title:n.code?"View detailed diff analysis":"No code file available",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})}),f.jsx("span",{className:"hidden sm:inline",children:"Diff"})]}),f.jsx("button",{onClick:()=>W(!H),className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium transition-all duration-200 flex-shrink-0 ${H?"bg-accent-600 text-white":"bg-surface-700/50 text-surface-300 hover:bg-surface-600 hover:text-white"}`,title:H?"Show source code":"Show rendered preview",children:H?f.jsxs(f.Fragment,{children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),f.jsx("span",{className:"hidden sm:inline",children:"Source"})]}):f.jsxs(f.Fragment,{children:[f.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),f.jsx("span",{className:"hidden sm:inline",children:"Preview"})]})})]}),f.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[f.jsx("div",{className:`flex-1 flex flex-col overflow-hidden ${K?"w-1/2":"w-full"}`,children:H?f.jsx("div",{className:"flex-1 overflow-auto bg-surface-900/50 p-4 sm:p-6 lg:p-8",children:f.jsx("div",{className:"markdown-body max-w-4xl mx-auto",dangerouslySetInnerHTML:{__html:de}})}):f.jsx("div",{ref:d,className:"flex-1 overflow-hidden"})}),K&&f.jsxs("div",{className:"w-1/2 flex flex-col border-l border-surface-700/50 bg-surface-900/50",children:[f.jsxs("div",{className:"px-3 py-2 bg-surface-800/50 border-b border-surface-700/50 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("svg",{className:"w-4 h-4 text-blue-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),f.jsx("span",{className:"text-xs text-surface-400 font-mono truncate",title:n.code||"",children:((ps=n.code)==null?void 0:ps.split("/").pop())||"Code"}),f.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-blue-500/20 text-blue-300 flex-shrink-0",children:"Read Only"})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:Be,disabled:$e,className:"p-1.5 text-surface-400 hover:text-white hover:bg-surface-700 rounded transition-colors",title:"Reload code file",children:f.jsx("svg",{className:`w-3.5 h-3.5 ${$e?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),f.jsx("button",{onClick:()=>re(!1),className:"p-1.5 text-surface-400 hover:text-white hover:bg-surface-700 rounded transition-colors",title:"Close code panel",children:f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),$e?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center gap-3",children:[f.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{className:"text-sm text-surface-400",children:"Loading code..."})]})}):ae?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center gap-3 p-4 text-center",children:[f.jsx("svg",{className:"w-8 h-8 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),f.jsx("span",{className:"text-sm text-red-300",children:ae}),f.jsx("button",{onClick:Be,className:"px-3 py-1.5 text-xs bg-surface-700 hover:bg-surface-600 rounded-lg transition-colors",children:"Retry"})]})}):f.jsx("div",{ref:Oe,className:"flex-1 overflow-hidden"})]})]}),S&&f.jsx("div",{className:"px-3 sm:px-4 py-2 bg-red-500/10 border-t border-red-500/20 text-red-300 text-xs sm:text-sm",children:S})]})}),f.jsx(HJ,{isOpen:yr,onClose:()=>hs(!1)})]}),L&&f.jsx(cee,{command:L,prompt:n,onRun:Ia,onAddToQueue:r?us:void 0,onCancel:()=>E(null)}),D.visible&&f.jsx("div",{className:"fixed bottom-4 right-4 z-50 animate-slide-up",children:f.jsxs("div",{className:"bg-surface-800 border border-surface-600 rounded-xl shadow-2xl p-4 w-80",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsxs("h4",{className:"text-sm font-semibold text-white flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Include Analysis"]}),f.jsx("button",{onClick:cs,className:"p-1 rounded hover:bg-surface-700 text-surface-400 hover:text-white transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),D.loading?f.jsxs("div",{className:"flex items-center justify-center py-4",children:[f.jsxs("svg",{className:"animate-spin h-5 w-5 text-accent-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{className:"ml-2 text-sm text-surface-400",children:"Analyzing..."})]}):D.error?f.jsx("div",{className:"text-sm text-surface-400 bg-surface-900/50 rounded-lg p-3",children:D.error}):D.metrics&&D.tagInfo?f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[f.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"File"}),f.jsx("div",{className:"text-sm text-white font-mono truncate",children:D.tagInfo.path})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[f.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[f.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Tokens"}),f.jsx("div",{className:"text-lg font-semibold text-accent-400",children:D.metrics.token_count.toLocaleString()})]}),f.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[f.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Context Usage"}),f.jsxs("div",{className:"text-lg font-semibold text-white",children:[D.metrics.context_usage_percent.toFixed(1),"%"]})]})]}),D.metrics.cost_estimate&&f.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[f.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Estimated Cost"}),f.jsxs("div",{className:"text-sm text-green-400",children:["$",D.metrics.cost_estimate.input_cost.toFixed(4)," USD"]})]})]}):null,f.jsx("div",{className:"mt-3 pt-3 border-t border-surface-700",children:f.jsxs("p",{className:"text-[10px] text-surface-500",children:["Press ",f.jsx("kbd",{className:"px-1 py-0.5 bg-surface-700 rounded text-surface-400",children:"Cmd+."})," to analyze include at cursor"]})})]})}),Fe&&f.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-fade-in",onClick:()=>Te(!1),children:f.jsxs("div",{className:"glass rounded-2xl border border-surface-600/50 shadow-2xl w-full max-w-lg animate-scale-in",onClick:xe=>xe.stopPropagation(),children:[f.jsx("div",{className:"px-6 py-4 border-b border-surface-700/50",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-500/20 flex items-center justify-center",children:f.jsx("svg",{className:"w-5 h-5 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold text-white",children:"Check Prompt-Code Match"}),f.jsx("p",{className:"text-sm text-surface-400",children:"Evaluate how well your code implements the prompt"})]})]})}),f.jsxs("div",{className:"px-6 py-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm text-surface-300 mb-2 block",children:"Model Strength"}),f.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{value:.25,label:"Fast",desc:"Quick check"},{value:.5,label:"Balanced",desc:"Default"},{value:.75,label:"Strong",desc:"More accurate"},{value:1,label:"Best",desc:"Highest accuracy"}].map(xe=>f.jsxs("button",{onClick:()=>st(xe.value),className:`py-2 px-3 rounded-lg text-xs transition-all ${ot===xe.value?"bg-purple-600 text-white":"bg-surface-700 text-surface-300 hover:bg-surface-600"}`,children:[f.jsx("div",{className:"font-medium",children:xe.label}),f.jsx("div",{className:"text-[10px] opacity-70",children:xe.desc})]},xe.value))})]}),Qt&&f.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:f.jsx("p",{className:"text-sm text-red-300",children:Qt})}),ge&&f.jsxs("div",{className:"p-4 bg-surface-900/50 rounded-xl space-y-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("span",{className:"text-3xl font-bold",style:{color:ge.result.match_score>=80?"#10b981":ge.result.match_score>=50?"#f59e0b":"#ef4444"},children:[ge.result.match_score,"%"]}),f.jsxs("span",{className:"text-xs text-surface-500",children:[ge.model," ($",ge.cost.toFixed(4),")"]})]}),f.jsx("p",{className:"text-sm text-surface-300",children:ge.result.summary}),ge.result.missing&&ge.result.missing.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"text-xs text-red-400 font-medium mb-1",children:"Missing Requirements:"}),f.jsx("ul",{className:"text-xs text-surface-400 list-disc ml-4 space-y-0.5",children:ge.result.missing.map((xe,_e)=>f.jsx("li",{children:xe},_e))})]}),ge.result.extra&&ge.result.extra.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"text-xs text-yellow-400 font-medium mb-1",children:"Extra Code (not in prompt):"}),f.jsx("ul",{className:"text-xs text-surface-400 list-disc ml-4 space-y-0.5",children:ge.result.extra.map((xe,_e)=>f.jsx("li",{children:xe},_e))})]}),ge.result.suggestions&&ge.result.suggestions.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"text-xs text-blue-400 font-medium mb-1",children:"Suggestions:"}),f.jsx("ul",{className:"text-xs text-surface-400 list-disc ml-4 space-y-0.5",children:ge.result.suggestions.map((xe,_e)=>f.jsx("li",{children:xe},_e))})]})]})]}),f.jsxs("div",{className:"px-6 py-4 border-t border-surface-700/50 flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>{Te(!1),Ke(null),zt(null)},className:"px-4 py-2 text-sm text-surface-300 hover:text-white transition-colors",children:"Close"}),f.jsx("button",{onClick:Qn,disabled:ht,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm hover:bg-purple-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 transition-colors",children:ht?f.jsxs(f.Fragment,{children:[f.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Checking..."]}):"Run Check"})]})]})}),f.jsx(iee,{isOpen:tt,onClose:()=>hn(!1),promptContent:p.current?p.current.state.doc.toString():g.current||k||"",codeContent:se||"",promptPath:n==null?void 0:n.prompt,codePath:n==null?void 0:n.code,prompt:n,onRunCommand:t})]})},np=({label:n,path:e,exists:t})=>f.jsxs("div",{className:`flex items-center gap-2 ${t?"text-surface-300":"text-surface-500"}`,children:[f.jsx("span",{className:`w-4 h-4 rounded flex items-center justify-center text-[10px] ${t?"bg-green-500/20 text-green-400":"bg-surface-700/50 text-surface-500"}`,children:t?"✓":"✗"}),f.jsx("span",{children:n})]});function Yn(n){if(typeof n=="string"||typeof n=="number")return""+n;let e="";if(Array.isArray(n))for(let t=0,r;t<n.length;t++)(r=Yn(n[t]))!==""&&(e+=(e&&" ")+r);else for(let t in n)n[t]&&(e+=(e&&" ")+t);return e}var Mx={exports:{}},Xx={},zx={exports:{}},Lx={};/**
|
|
318
|
-
* @license React
|
|
319
|
-
* use-sync-external-store-shim.production.js
|
|
320
|
-
*
|
|
321
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the MIT license found in the
|
|
324
|
-
* LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/var S4;function fee(){if(S4)return Lx;S4=1;var n=Uf();function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,s=n.useEffect,i=n.useLayoutEffect,a=n.useDebugValue;function o(m,g){var x=g(),v=r({inst:{value:x,getSnapshot:g}}),y=v[0].inst,S=v[1];return i(function(){y.value=x,y.getSnapshot=g,u(y)&&S({inst:y})},[m,x,g]),s(function(){return u(y)&&S({inst:y}),m(function(){u(y)&&S({inst:y})})},[m]),a(x),x}function u(m){var g=m.getSnapshot;m=m.value;try{var x=g();return!t(m,x)}catch{return!0}}function d(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return Lx.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,Lx}var Q4;function dee(){return Q4||(Q4=1,zx.exports=fee()),zx.exports}/**
|
|
326
|
-
* @license React
|
|
327
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
328
|
-
*
|
|
329
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
330
|
-
*
|
|
331
|
-
* This source code is licensed under the MIT license found in the
|
|
332
|
-
* LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/var k4;function hee(){if(k4)return Xx;k4=1;var n=Uf(),e=dee();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,i=n.useRef,a=n.useEffect,o=n.useMemo,u=n.useDebugValue;return Xx.useSyncExternalStoreWithSelector=function(d,p,m,g,x){var v=i(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=o(function(){function Q(R){if(!k){if(k=!0,$=R,R=g(R),x!==void 0&&y.hasValue){var N=y.value;if(x(N,R))return j=N}return j=R}if(N=j,r($,R))return N;var q=g(R);return x!==void 0&&x(N,q)?($=R,N):($=R,j=q)}var k=!1,$,j,T=m===void 0?null:m;return[function(){return Q(p())},T===null?void 0:function(){return Q(T())}]},[p,m,g,x]);var S=s(d,v[0],v[1]);return a(function(){y.hasValue=!0,y.value=S},[S]),u(S),S},Xx}var $4;function pee(){return $4||($4=1,Mx.exports=hee()),Mx.exports}var mee=pee();const Oee=km(mee),gee={},T4=n=>{let e;const t=new Set,r=(p,m)=>{const g=typeof p=="function"?p(e):p;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),t.forEach(v=>v(e,x))}},s=()=>e,u={setState:r,getState:s,getInitialState:()=>d,subscribe:p=>(t.add(p),()=>t.delete(p)),destroy:()=>{(gee?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},d=e=n(r,s,u);return u},xee=n=>n?T4(n):T4,{useDebugValue:bee}=ue,{useSyncExternalStoreWithSelector:yee}=Oee,vee=n=>n;function Bz(n,e=vee,t){const r=yee(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return bee(r),r}const j4=(n,e)=>{const t=xee(n),r=(s,i=e)=>Bz(t,s,i);return Object.assign(r,t),r},wee=(n,e)=>n?j4(n,e):j4;function En(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[r,s]of n)if(!Object.is(s,e.get(r)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const r of n)if(!e.has(r))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}var See={value:()=>{}};function tO(){for(var n=0,e=arguments.length,t={},r;n<e;++n){if(!(r=arguments[n]+"")||r in t||/[\s.]/.test(r))throw new Error("illegal type: "+r);t[r]=[]}return new Np(t)}function Np(n){this._=n}function Qee(n,e){return n.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");if(s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}Np.prototype=tO.prototype={constructor:Np,on:function(n,e){var t=this._,r=Qee(n+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i<a;)if((s=(n=r[i]).type)&&(s=kee(t[s],n.name)))return s;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<a;)if(s=(n=r[i]).type)t[s]=_4(t[s],n.name,e);else if(e==null)for(s in t)t[s]=_4(t[s],n.name,null);return this},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new Np(n)},call:function(n,e){if((s=arguments.length-2)>0)for(var t=new Array(s),r=0,s,i;r<s;++r)t[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=this._[n],r=0,s=i.length;r<s;++r)i[r].value.apply(e,t)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],s=0,i=r.length;s<i;++s)r[s].value.apply(e,t)}};function kee(n,e){for(var t=0,r=n.length,s;t<r;++t)if((s=n[t]).name===e)return s.value}function _4(n,e,t){for(var r=0,s=n.length;r<s;++r)if(n[r].name===e){n[r]=See,n=n.slice(0,r).concat(n.slice(r+1));break}return t!=null&&n.push({name:e,value:t}),n}var k2="http://www.w3.org/1999/xhtml";const P4={svg:"http://www.w3.org/2000/svg",xhtml:k2,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function nO(n){var e=n+="",t=e.indexOf(":");return t>=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),P4.hasOwnProperty(e)?{space:P4[e],local:n}:n}function $ee(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===k2&&e.documentElement.namespaceURI===k2?e.createElement(n):e.createElementNS(t,n)}}function Tee(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Uz(n){var e=nO(n);return(e.local?Tee:$ee)(e)}function jee(){}function lk(n){return n==null?jee:function(){return this.querySelector(n)}}function _ee(n){typeof n!="function"&&(n=lk(n));for(var e=this._groups,t=e.length,r=new Array(t),s=0;s<t;++s)for(var i=e[s],a=i.length,o=r[s]=new Array(a),u,d,p=0;p<a;++p)(u=i[p])&&(d=n.call(u,u.__data__,p,i))&&("__data__"in u&&(d.__data__=u.__data__),o[p]=d);return new Mr(r,this._parents)}function Pee(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function Nee(){return[]}function Wz(n){return n==null?Nee:function(){return this.querySelectorAll(n)}}function Cee(n){return function(){return Pee(n.apply(this,arguments))}}function Ree(n){typeof n=="function"?n=Cee(n):n=Wz(n);for(var e=this._groups,t=e.length,r=[],s=[],i=0;i<t;++i)for(var a=e[i],o=a.length,u,d=0;d<o;++d)(u=a[d])&&(r.push(n.call(u,u.__data__,d,a)),s.push(u));return new Mr(r,s)}function Gz(n){return function(){return this.matches(n)}}function Iz(n){return function(e){return e.matches(n)}}var Eee=Array.prototype.find;function Aee(n){return function(){return Eee.call(this.children,n)}}function qee(){return this.firstElementChild}function Mee(n){return this.select(n==null?qee:Aee(typeof n=="function"?n:Iz(n)))}var Xee=Array.prototype.filter;function zee(){return Array.from(this.children)}function Lee(n){return function(){return Xee.call(this.children,n)}}function Zee(n){return this.selectAll(n==null?zee:Lee(typeof n=="function"?n:Iz(n)))}function Vee(n){typeof n!="function"&&(n=Gz(n));for(var e=this._groups,t=e.length,r=new Array(t),s=0;s<t;++s)for(var i=e[s],a=i.length,o=r[s]=[],u,d=0;d<a;++d)(u=i[d])&&n.call(u,u.__data__,d,i)&&o.push(u);return new Mr(r,this._parents)}function Hz(n){return new Array(n.length)}function Yee(){return new Mr(this._enter||this._groups.map(Hz),this._parents)}function Om(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}Om.prototype={constructor:Om,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function Dee(n){return function(){return n}}function Bee(n,e,t,r,s,i){for(var a=0,o,u=e.length,d=i.length;a<d;++a)(o=e[a])?(o.__data__=i[a],r[a]=o):t[a]=new Om(n,i[a]);for(;a<u;++a)(o=e[a])&&(s[a]=o)}function Uee(n,e,t,r,s,i,a){var o,u,d=new Map,p=e.length,m=i.length,g=new Array(p),x;for(o=0;o<p;++o)(u=e[o])&&(g[o]=x=a.call(u,u.__data__,o,e)+"",d.has(x)?s[o]=u:d.set(x,u));for(o=0;o<m;++o)x=a.call(n,i[o],o,i)+"",(u=d.get(x))?(r[o]=u,u.__data__=i[o],d.delete(x)):t[o]=new Om(n,i[o]);for(o=0;o<p;++o)(u=e[o])&&d.get(g[o])===u&&(s[o]=u)}function Wee(n){return n.__data__}function Gee(n,e){if(!arguments.length)return Array.from(this,Wee);var t=e?Uee:Bee,r=this._parents,s=this._groups;typeof n!="function"&&(n=Dee(n));for(var i=s.length,a=new Array(i),o=new Array(i),u=new Array(i),d=0;d<i;++d){var p=r[d],m=s[d],g=m.length,x=Iee(n.call(p,p&&p.__data__,d,r)),v=x.length,y=o[d]=new Array(v),S=a[d]=new Array(v),Q=u[d]=new Array(g);t(p,m,y,S,Q,x,e);for(var k=0,$=0,j,T;k<v;++k)if(j=y[k]){for(k>=$&&($=k+1);!(T=S[$])&&++$<v;);j._next=T||null}}return a=new Mr(a,r),a._enter=o,a._exit=u,a}function Iee(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function Hee(){return new Mr(this._exit||this._groups.map(Hz),this._parents)}function Fee(n,e,t){var r=this.enter(),s=this,i=this.exit();return typeof n=="function"?(r=n(r),r&&(r=r.selection())):r=r.append(n+""),e!=null&&(s=e(s),s&&(s=s.selection())),t==null?i.remove():t(i),r&&s?r.merge(s).order():s}function Kee(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,s=t.length,i=r.length,a=Math.min(s,i),o=new Array(s),u=0;u<a;++u)for(var d=t[u],p=r[u],m=d.length,g=o[u]=new Array(m),x,v=0;v<m;++v)(x=d[v]||p[v])&&(g[v]=x);for(;u<s;++u)o[u]=t[u];return new Mr(o,this._parents)}function Jee(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r=n[e],s=r.length-1,i=r[s],a;--s>=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function ete(n){n||(n=tte);function e(m,g){return m&&g?n(m.__data__,g.__data__):!m-!g}for(var t=this._groups,r=t.length,s=new Array(r),i=0;i<r;++i){for(var a=t[i],o=a.length,u=s[i]=new Array(o),d,p=0;p<o;++p)(d=a[p])&&(u[p]=d);u.sort(e)}return new Mr(s,this._parents).order()}function tte(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function nte(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function rte(){return Array.from(this)}function ste(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],s=0,i=r.length;s<i;++s){var a=r[s];if(a)return a}return null}function ite(){let n=0;for(const e of this)++n;return n}function ate(){return!this.node()}function lte(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],i=0,a=s.length,o;i<a;++i)(o=s[i])&&n.call(o,o.__data__,i,s);return this}function ote(n){return function(){this.removeAttribute(n)}}function cte(n){return function(){this.removeAttributeNS(n.space,n.local)}}function ute(n,e){return function(){this.setAttribute(n,e)}}function fte(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function dte(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttribute(n):this.setAttribute(n,t)}}function hte(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function pte(n,e){var t=nO(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((e==null?t.local?cte:ote:typeof e=="function"?t.local?hte:dte:t.local?fte:ute)(t,e))}function Fz(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function mte(n){return function(){this.style.removeProperty(n)}}function Ote(n,e,t){return function(){this.style.setProperty(n,e,t)}}function gte(n,e,t){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function xte(n,e,t){return arguments.length>1?this.each((e==null?mte:typeof e=="function"?gte:Ote)(n,e,t??"")):wc(this.node(),n)}function wc(n,e){return n.style.getPropertyValue(e)||Fz(n).getComputedStyle(n,null).getPropertyValue(e)}function bte(n){return function(){delete this[n]}}function yte(n,e){return function(){this[n]=e}}function vte(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function wte(n,e){return arguments.length>1?this.each((e==null?bte:typeof e=="function"?vte:yte)(n,e)):this.node()[n]}function Kz(n){return n.trim().split(/^|\s+/)}function ok(n){return n.classList||new Jz(n)}function Jz(n){this._node=n,this._names=Kz(n.getAttribute("class")||"")}Jz.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function eL(n,e){for(var t=ok(n),r=-1,s=e.length;++r<s;)t.add(e[r])}function tL(n,e){for(var t=ok(n),r=-1,s=e.length;++r<s;)t.remove(e[r])}function Ste(n){return function(){eL(this,n)}}function Qte(n){return function(){tL(this,n)}}function kte(n,e){return function(){(e.apply(this,arguments)?eL:tL)(this,n)}}function $te(n,e){var t=Kz(n+"");if(arguments.length<2){for(var r=ok(this.node()),s=-1,i=t.length;++s<i;)if(!r.contains(t[s]))return!1;return!0}return this.each((typeof e=="function"?kte:e?Ste:Qte)(t,e))}function Tte(){this.textContent=""}function jte(n){return function(){this.textContent=n}}function _te(n){return function(){var e=n.apply(this,arguments);this.textContent=e??""}}function Pte(n){return arguments.length?this.each(n==null?Tte:(typeof n=="function"?_te:jte)(n)):this.node().textContent}function Nte(){this.innerHTML=""}function Cte(n){return function(){this.innerHTML=n}}function Rte(n){return function(){var e=n.apply(this,arguments);this.innerHTML=e??""}}function Ete(n){return arguments.length?this.each(n==null?Nte:(typeof n=="function"?Rte:Cte)(n)):this.node().innerHTML}function Ate(){this.nextSibling&&this.parentNode.appendChild(this)}function qte(){return this.each(Ate)}function Mte(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Xte(){return this.each(Mte)}function zte(n){var e=typeof n=="function"?n:Uz(n);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Lte(){return null}function Zte(n,e){var t=typeof n=="function"?n:Uz(n),r=e==null?Lte:typeof e=="function"?e:lk(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)})}function Vte(){var n=this.parentNode;n&&n.removeChild(this)}function Yte(){return this.each(Vte)}function Dte(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Bte(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Ute(n){return this.select(n?Bte:Dte)}function Wte(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Gte(n){return function(e){n.call(this,e,this.__data__)}}function Ite(n){return n.trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}})}function Hte(n){return function(){var e=this.__on;if(e){for(var t=0,r=-1,s=e.length,i;t<s;++t)i=e[t],(!n.type||i.type===n.type)&&i.name===n.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function Fte(n,e,t){return function(){var r=this.__on,s,i=Gte(e);if(r){for(var a=0,o=r.length;a<o;++a)if((s=r[a]).type===n.type&&s.name===n.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=i,s.options=t),s.value=e;return}}this.addEventListener(n.type,i,t),s={type:n.type,name:n.name,value:e,listener:i,options:t},r?r.push(s):this.__on=[s]}}function Kte(n,e,t){var r=Ite(n+""),s,i=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,d=o.length,p;u<d;++u)for(s=0,p=o[u];s<i;++s)if((a=r[s]).type===p.type&&a.name===p.name)return p.value}return}for(o=e?Fte:Hte,s=0;s<i;++s)this.each(o(r[s],e,t));return this}function nL(n,e,t){var r=Fz(n),s=r.CustomEvent;typeof s=="function"?s=new s(e,t):(s=r.document.createEvent("Event"),t?(s.initEvent(e,t.bubbles,t.cancelable),s.detail=t.detail):s.initEvent(e,!1,!1)),n.dispatchEvent(s)}function Jte(n,e){return function(){return nL(this,n,e)}}function ene(n,e){return function(){return nL(this,n,e.apply(this,arguments))}}function tne(n,e){return this.each((typeof e=="function"?ene:Jte)(n,e))}function*nne(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],s=0,i=r.length,a;s<i;++s)(a=r[s])&&(yield a)}var rL=[null];function Mr(n,e){this._groups=n,this._parents=e}function ad(){return new Mr([[document.documentElement]],rL)}function rne(){return this}Mr.prototype=ad.prototype={constructor:Mr,select:_ee,selectAll:Ree,selectChild:Mee,selectChildren:Zee,filter:Vee,data:Gee,enter:Yee,exit:Hee,join:Fee,merge:Kee,selection:rne,order:Jee,sort:ete,call:nte,nodes:rte,node:ste,size:ite,empty:ate,each:lte,attr:pte,style:xte,property:wte,classed:$te,text:Pte,html:Ete,raise:qte,lower:Xte,append:zte,insert:Zte,remove:Yte,clone:Ute,datum:Wte,on:Kte,dispatch:tne,[Symbol.iterator]:nne};function Wr(n){return typeof n=="string"?new Mr([[document.querySelector(n)]],[document.documentElement]):new Mr([[n]],rL)}function sne(n){let e;for(;e=n.sourceEvent;)n=e;return n}function Qs(n,e){if(n=sne(n),e===void 0&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[n.clientX-s.left-e.clientLeft,n.clientY-s.top-e.clientTop]}}return[n.pageX,n.pageY]}const ine={passive:!1},Xf={capture:!0,passive:!1};function Zx(n){n.stopImmediatePropagation()}function oc(n){n.preventDefault(),n.stopImmediatePropagation()}function sL(n){var e=n.document.documentElement,t=Wr(n).on("dragstart.drag",oc,Xf);"onselectstart"in e?t.on("selectstart.drag",oc,Xf):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function iL(n,e){var t=n.document.documentElement,r=Wr(n).on("dragstart.drag",null);e&&(r.on("click.drag",oc,Xf),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in t?r.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const rp=n=>()=>n;function $2(n,{sourceEvent:e,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:u,dy:d,dispatch:p}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}$2.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function ane(n){return!n.ctrlKey&&!n.button}function lne(){return this.parentNode}function one(n,e){return e??{x:n.x,y:n.y}}function cne(){return navigator.maxTouchPoints||"ontouchstart"in this}function une(){var n=ane,e=lne,t=one,r=cne,s={},i=tO("start","drag","end"),a=0,o,u,d,p,m=0;function g(j){j.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",Q,ine).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(j,T){if(!(p||!n.call(this,j,T))){var R=$(this,e.call(this,j,T),j,T,"mouse");R&&(Wr(j.view).on("mousemove.drag",v,Xf).on("mouseup.drag",y,Xf),sL(j.view),Zx(j),d=!1,o=j.clientX,u=j.clientY,R("start",j))}}function v(j){if(oc(j),!d){var T=j.clientX-o,R=j.clientY-u;d=T*T+R*R>m}s.mouse("drag",j)}function y(j){Wr(j.view).on("mousemove.drag mouseup.drag",null),iL(j.view,d),oc(j),s.mouse("end",j)}function S(j,T){if(n.call(this,j,T)){var R=j.changedTouches,N=e.call(this,j,T),q=R.length,z,L;for(z=0;z<q;++z)(L=$(this,N,j,T,R[z].identifier,R[z]))&&(Zx(j),L("start",j,R[z]))}}function Q(j){var T=j.changedTouches,R=T.length,N,q;for(N=0;N<R;++N)(q=s[T[N].identifier])&&(oc(j),q("drag",j,T[N]))}function k(j){var T=j.changedTouches,R=T.length,N,q;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),N=0;N<R;++N)(q=s[T[N].identifier])&&(Zx(j),q("end",j,T[N]))}function $(j,T,R,N,q,z){var L=i.copy(),E=Qs(z||R,T),V,B,C;if((C=t.call(j,new $2("beforestart",{sourceEvent:R,target:g,identifier:q,active:a,x:E[0],y:E[1],dx:0,dy:0,dispatch:L}),N))!=null)return V=C.x-E[0]||0,B=C.y-E[1]||0,function G(A,U,H){var W=E,J;switch(A){case"start":s[q]=G,J=a++;break;case"end":delete s[q],--a;case"drag":E=Qs(H||U,T),J=a;break}L.call(A,j,new $2(A,{sourceEvent:U,subject:C,target:g,identifier:q,active:J,x:E[0]+V,y:E[1]+B,dx:E[0]-W[0],dy:E[1]-W[1],dispatch:L}),N)}}return g.filter=function(j){return arguments.length?(n=typeof j=="function"?j:rp(!!j),g):n},g.container=function(j){return arguments.length?(e=typeof j=="function"?j:rp(j),g):e},g.subject=function(j){return arguments.length?(t=typeof j=="function"?j:rp(j),g):t},g.touchable=function(j){return arguments.length?(r=typeof j=="function"?j:rp(!!j),g):r},g.on=function(){var j=i.on.apply(i,arguments);return j===i?g:j},g.clickDistance=function(j){return arguments.length?(m=(j=+j)*j,g):Math.sqrt(m)},g}function ck(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function aL(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function ld(){}var zf=.7,gm=1/zf,cc="\\s*([+-]?\\d+)\\s*",Lf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fne=/^#([0-9a-f]{3,8})$/,dne=new RegExp(`^rgb\\(${cc},${cc},${cc}\\)$`),hne=new RegExp(`^rgb\\(${ri},${ri},${ri}\\)$`),pne=new RegExp(`^rgba\\(${cc},${cc},${cc},${Lf}\\)$`),mne=new RegExp(`^rgba\\(${ri},${ri},${ri},${Lf}\\)$`),One=new RegExp(`^hsl\\(${Lf},${ri},${ri}\\)$`),gne=new RegExp(`^hsla\\(${Lf},${ri},${ri},${Lf}\\)$`),N4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ck(ld,Zf,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:C4,formatHex:C4,formatHex8:xne,formatHsl:bne,formatRgb:R4,toString:R4});function C4(){return this.rgb().formatHex()}function xne(){return this.rgb().formatHex8()}function bne(){return lL(this).formatHsl()}function R4(){return this.rgb().formatRgb()}function Zf(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=fne.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?E4(e):t===3?new mr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?sp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?sp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=dne.exec(n))?new mr(e[1],e[2],e[3],1):(e=hne.exec(n))?new mr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=pne.exec(n))?sp(e[1],e[2],e[3],e[4]):(e=mne.exec(n))?sp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=One.exec(n))?M4(e[1],e[2]/100,e[3]/100,1):(e=gne.exec(n))?M4(e[1],e[2]/100,e[3]/100,e[4]):N4.hasOwnProperty(n)?E4(N4[n]):n==="transparent"?new mr(NaN,NaN,NaN,0):null}function E4(n){return new mr(n>>16&255,n>>8&255,n&255,1)}function sp(n,e,t,r){return r<=0&&(n=e=t=NaN),new mr(n,e,t,r)}function yne(n){return n instanceof ld||(n=Zf(n)),n?(n=n.rgb(),new mr(n.r,n.g,n.b,n.opacity)):new mr}function T2(n,e,t,r){return arguments.length===1?yne(n):new mr(n,e,t,r??1)}function mr(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}ck(mr,T2,aL(ld,{brighter(n){return n=n==null?gm:Math.pow(gm,n),new mr(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?zf:Math.pow(zf,n),new mr(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new mr(_l(this.r),_l(this.g),_l(this.b),xm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:A4,formatHex:A4,formatHex8:vne,formatRgb:q4,toString:q4}));function A4(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}`}function vne(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}${kl((isNaN(this.opacity)?1:this.opacity)*255)}`}function q4(){const n=xm(this.opacity);return`${n===1?"rgb(":"rgba("}${_l(this.r)}, ${_l(this.g)}, ${_l(this.b)}${n===1?")":`, ${n})`}`}function xm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function _l(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function kl(n){return n=_l(n),(n<16?"0":"")+n.toString(16)}function M4(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new js(n,e,t,r)}function lL(n){if(n instanceof js)return new js(n.h,n.s,n.l,n.opacity);if(n instanceof ld||(n=Zf(n)),!n)return new js;if(n instanceof js)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,s=Math.min(e,t,r),i=Math.max(e,t,r),a=NaN,o=i-s,u=(i+s)/2;return o?(e===i?a=(t-r)/o+(t<r)*6:t===i?a=(r-e)/o+2:a=(e-t)/o+4,o/=u<.5?i+s:2-i-s,a*=60):o=u>0&&u<1?0:a,new js(a,o,u,n.opacity)}function wne(n,e,t,r){return arguments.length===1?lL(n):new js(n,e,t,r??1)}function js(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}ck(js,wne,aL(ld,{brighter(n){return n=n==null?gm:Math.pow(gm,n),new js(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?zf:Math.pow(zf,n),new js(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,s=2*t-r;return new mr(Vx(n>=240?n-240:n+120,s,r),Vx(n,s,r),Vx(n<120?n+240:n-120,s,r),this.opacity)},clamp(){return new js(X4(this.h),ip(this.s),ip(this.l),xm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=xm(this.opacity);return`${n===1?"hsl(":"hsla("}${X4(this.h)}, ${ip(this.s)*100}%, ${ip(this.l)*100}%${n===1?")":`, ${n})`}`}}));function X4(n){return n=(n||0)%360,n<0?n+360:n}function ip(n){return Math.max(0,Math.min(1,n||0))}function Vx(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const oL=n=>()=>n;function Sne(n,e){return function(t){return n+t*e}}function Qne(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function kne(n){return(n=+n)==1?cL:function(e,t){return t-e?Qne(e,t,n):oL(isNaN(e)?t:e)}}function cL(n,e){var t=e-n;return t?Sne(n,t):oL(isNaN(n)?e:n)}const z4=(function n(e){var t=kne(e);function r(s,i){var a=t((s=T2(s)).r,(i=T2(i)).r),o=t(s.g,i.g),u=t(s.b,i.b),d=cL(s.opacity,i.opacity);return function(p){return s.r=a(p),s.g=o(p),s.b=u(p),s.opacity=d(p),s+""}}return r.gamma=n,r})(1);function ja(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var j2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yx=new RegExp(j2.source,"g");function $ne(n){return function(){return n}}function Tne(n){return function(e){return n(e)+""}}function jne(n,e){var t=j2.lastIndex=Yx.lastIndex=0,r,s,i,a=-1,o=[],u=[];for(n=n+"",e=e+"";(r=j2.exec(n))&&(s=Yx.exec(e));)(i=s.index)>t&&(i=e.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,u.push({i:a,x:ja(r,s)})),t=Yx.lastIndex;return t<e.length&&(i=e.slice(t),o[a]?o[a]+=i:o[++a]=i),o.length<2?u[0]?Tne(u[0].x):$ne(e):(e=u.length,function(d){for(var p=0,m;p<e;++p)o[(m=u[p]).i]=m.x(d);return o.join("")})}var L4=180/Math.PI,_2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function uL(n,e,t,r,s,i){var a,o,u;return(a=Math.sqrt(n*n+e*e))&&(n/=a,e/=a),(u=n*t+e*r)&&(t-=n*u,r-=e*u),(o=Math.sqrt(t*t+r*r))&&(t/=o,r/=o,u/=o),n*r<e*t&&(n=-n,e=-e,u=-u,a=-a),{translateX:s,translateY:i,rotate:Math.atan2(e,n)*L4,skewX:Math.atan(u)*L4,scaleX:a,scaleY:o}}var ap;function _ne(n){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?_2:uL(e.a,e.b,e.c,e.d,e.e,e.f)}function Pne(n){return n==null||(ap||(ap=document.createElementNS("http://www.w3.org/2000/svg","g")),ap.setAttribute("transform",n),!(n=ap.transform.baseVal.consolidate()))?_2:(n=n.matrix,uL(n.a,n.b,n.c,n.d,n.e,n.f))}function fL(n,e,t,r){function s(d){return d.length?d.pop()+" ":""}function i(d,p,m,g,x,v){if(d!==m||p!==g){var y=x.push("translate(",null,e,null,t);v.push({i:y-4,x:ja(d,m)},{i:y-2,x:ja(p,g)})}else(m||g)&&x.push("translate("+m+e+g+t)}function a(d,p,m,g){d!==p?(d-p>180?p+=360:p-d>180&&(d+=360),g.push({i:m.push(s(m)+"rotate(",null,r)-2,x:ja(d,p)})):p&&m.push(s(m)+"rotate("+p+r)}function o(d,p,m,g){d!==p?g.push({i:m.push(s(m)+"skewX(",null,r)-2,x:ja(d,p)}):p&&m.push(s(m)+"skewX("+p+r)}function u(d,p,m,g,x,v){if(d!==m||p!==g){var y=x.push(s(x)+"scale(",null,",",null,")");v.push({i:y-4,x:ja(d,m)},{i:y-2,x:ja(p,g)})}else(m!==1||g!==1)&&x.push(s(x)+"scale("+m+","+g+")")}return function(d,p){var m=[],g=[];return d=n(d),p=n(p),i(d.translateX,d.translateY,p.translateX,p.translateY,m,g),a(d.rotate,p.rotate,m,g),o(d.skewX,p.skewX,m,g),u(d.scaleX,d.scaleY,p.scaleX,p.scaleY,m,g),d=p=null,function(x){for(var v=-1,y=g.length,S;++v<y;)m[(S=g[v]).i]=S.x(x);return m.join("")}}}var Nne=fL(_ne,"px, ","px)","deg)"),Cne=fL(Pne,", ",")",")"),Rne=1e-12;function Z4(n){return((n=Math.exp(n))+1/n)/2}function Ene(n){return((n=Math.exp(n))-1/n)/2}function Ane(n){return((n=Math.exp(2*n))-1)/(n+1)}const qne=(function n(e,t,r){function s(i,a){var o=i[0],u=i[1],d=i[2],p=a[0],m=a[1],g=a[2],x=p-o,v=m-u,y=x*x+v*v,S,Q;if(y<Rne)Q=Math.log(g/d)/e,S=function(N){return[o+N*x,u+N*v,d*Math.exp(e*N*Q)]};else{var k=Math.sqrt(y),$=(g*g-d*d+r*y)/(2*d*t*k),j=(g*g-d*d-r*y)/(2*g*t*k),T=Math.log(Math.sqrt($*$+1)-$),R=Math.log(Math.sqrt(j*j+1)-j);Q=(R-T)/e,S=function(N){var q=N*Q,z=Z4(T),L=d/(t*k)*(z*Ane(e*q+T)-Ene(T));return[o+L*x,u+L*v,d*z/Z4(e*q+T)]}}return S.duration=Q*1e3*e/Math.SQRT2,S}return s.rho=function(i){var a=Math.max(.001,+i),o=a*a,u=o*o;return n(a,o,u)},s})(Math.SQRT2,2,4);var Sc=0,tf=0,Du=0,dL=1e3,bm,nf,ym=0,Ll=0,rO=0,Vf=typeof performance=="object"&&performance.now?performance:Date,hL=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function uk(){return Ll||(hL(Mne),Ll=Vf.now()+rO)}function Mne(){Ll=0}function vm(){this._call=this._time=this._next=null}vm.prototype=pL.prototype={constructor:vm,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?uk():+t)+(e==null?0:+e),!this._next&&nf!==this&&(nf?nf._next=this:bm=this,nf=this),this._call=n,this._time=t,P2()},stop:function(){this._call&&(this._call=null,this._time=1/0,P2())}};function pL(n,e,t){var r=new vm;return r.restart(n,e,t),r}function Xne(){uk(),++Sc;for(var n=bm,e;n;)(e=Ll-n._time)>=0&&n._call.call(void 0,e),n=n._next;--Sc}function V4(){Ll=(ym=Vf.now())+rO,Sc=tf=0;try{Xne()}finally{Sc=0,Lne(),Ll=0}}function zne(){var n=Vf.now(),e=n-ym;e>dL&&(rO-=e,ym=n)}function Lne(){for(var n,e=bm,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:bm=t);nf=n,P2(r)}function P2(n){if(!Sc){tf&&(tf=clearTimeout(tf));var e=n-Ll;e>24?(n<1/0&&(tf=setTimeout(V4,n-Vf.now()-rO)),Du&&(Du=clearInterval(Du))):(Du||(ym=Vf.now(),Du=setInterval(zne,dL)),Sc=1,hL(V4))}}function Y4(n,e,t){var r=new vm;return e=e==null?0:+e,r.restart(s=>{r.stop(),n(s+e)},e,t),r}var Zne=tO("start","end","cancel","interrupt"),Vne=[],mL=0,D4=1,N2=2,Cp=3,B4=4,C2=5,Rp=6;function sO(n,e,t,r,s,i){var a=n.__transition;if(!a)n.__transition={};else if(t in a)return;Yne(n,t,{name:e,index:r,group:s,on:Zne,tween:Vne,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:mL})}function fk(n,e){var t=qs(n,e);if(t.state>mL)throw new Error("too late; already scheduled");return t}function ai(n,e){var t=qs(n,e);if(t.state>Cp)throw new Error("too late; already running");return t}function qs(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Yne(n,e,t){var r=n.__transition,s;r[e]=t,t.timer=pL(i,0,t.time);function i(d){t.state=D4,t.timer.restart(a,t.delay,t.time),t.delay<=d&&a(d-t.delay)}function a(d){var p,m,g,x;if(t.state!==D4)return u();for(p in r)if(x=r[p],x.name===t.name){if(x.state===Cp)return Y4(a);x.state===B4?(x.state=Rp,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete r[p]):+p<e&&(x.state=Rp,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete r[p])}if(Y4(function(){t.state===Cp&&(t.state=B4,t.timer.restart(o,t.delay,t.time),o(d))}),t.state=N2,t.on.call("start",n,n.__data__,t.index,t.group),t.state===N2){for(t.state=Cp,s=new Array(g=t.tween.length),p=0,m=-1;p<g;++p)(x=t.tween[p].value.call(n,n.__data__,t.index,t.group))&&(s[++m]=x);s.length=m+1}}function o(d){for(var p=d<t.duration?t.ease.call(null,d/t.duration):(t.timer.restart(u),t.state=C2,1),m=-1,g=s.length;++m<g;)s[m].call(n,p);t.state===C2&&(t.on.call("end",n,n.__data__,t.index,t.group),u())}function u(){t.state=Rp,t.timer.stop(),delete r[e];for(var d in r)return;delete n.__transition}}function Ep(n,e){var t=n.__transition,r,s,i=!0,a;if(t){e=e==null?null:e+"";for(a in t){if((r=t[a]).name!==e){i=!1;continue}s=r.state>N2&&r.state<C2,r.state=Rp,r.timer.stop(),r.on.call(s?"interrupt":"cancel",n,n.__data__,r.index,r.group),delete t[a]}i&&delete n.__transition}}function Dne(n){return this.each(function(){Ep(this,n)})}function Bne(n,e){var t,r;return function(){var s=ai(this,n),i=s.tween;if(i!==t){r=t=i;for(var a=0,o=r.length;a<o;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function Une(n,e,t){var r,s;if(typeof t!="function")throw new Error;return function(){var i=ai(this,n),a=i.tween;if(a!==r){s=(r=a).slice();for(var o={name:e,value:t},u=0,d=s.length;u<d;++u)if(s[u].name===e){s[u]=o;break}u===d&&s.push(o)}i.tween=s}}function Wne(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r=qs(this.node(),t).tween,s=0,i=r.length,a;s<i;++s)if((a=r[s]).name===n)return a.value;return null}return this.each((e==null?Bne:Une)(t,n,e))}function dk(n,e,t){var r=n._id;return n.each(function(){var s=ai(this,r);(s.value||(s.value={}))[e]=t.apply(this,arguments)}),function(s){return qs(s,r).value[e]}}function OL(n,e){var t;return(typeof e=="number"?ja:e instanceof Zf?z4:(t=Zf(e))?(e=t,z4):jne)(n,e)}function Gne(n){return function(){this.removeAttribute(n)}}function Ine(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Hne(n,e,t){var r,s=t+"",i;return function(){var a=this.getAttribute(n);return a===s?null:a===r?i:i=e(r=a,t)}}function Fne(n,e,t){var r,s=t+"",i;return function(){var a=this.getAttributeNS(n.space,n.local);return a===s?null:a===r?i:i=e(r=a,t)}}function Kne(n,e,t){var r,s,i;return function(){var a,o=t(this),u;return o==null?void this.removeAttribute(n):(a=this.getAttribute(n),u=o+"",a===u?null:a===r&&u===s?i:(s=u,i=e(r=a,o)))}}function Jne(n,e,t){var r,s,i;return function(){var a,o=t(this),u;return o==null?void this.removeAttributeNS(n.space,n.local):(a=this.getAttributeNS(n.space,n.local),u=o+"",a===u?null:a===r&&u===s?i:(s=u,i=e(r=a,o)))}}function ere(n,e){var t=nO(n),r=t==="transform"?Cne:OL;return this.attrTween(n,typeof e=="function"?(t.local?Jne:Kne)(t,r,dk(this,"attr."+n,e)):e==null?(t.local?Ine:Gne)(t):(t.local?Fne:Hne)(t,r,e))}function tre(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}function nre(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}function rre(n,e){var t,r;function s(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&nre(n,i)),t}return s._value=e,s}function sre(n,e){var t,r;function s(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&tre(n,i)),t}return s._value=e,s}function ire(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;var r=nO(n);return this.tween(t,(r.local?rre:sre)(r,e))}function are(n,e){return function(){fk(this,n).delay=+e.apply(this,arguments)}}function lre(n,e){return e=+e,function(){fk(this,n).delay=e}}function ore(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?are:lre)(e,n)):qs(this.node(),e).delay}function cre(n,e){return function(){ai(this,n).duration=+e.apply(this,arguments)}}function ure(n,e){return e=+e,function(){ai(this,n).duration=e}}function fre(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?cre:ure)(e,n)):qs(this.node(),e).duration}function dre(n,e){if(typeof e!="function")throw new Error;return function(){ai(this,n).ease=e}}function hre(n){var e=this._id;return arguments.length?this.each(dre(e,n)):qs(this.node(),e).ease}function pre(n,e){return function(){var t=e.apply(this,arguments);if(typeof t!="function")throw new Error;ai(this,n).ease=t}}function mre(n){if(typeof n!="function")throw new Error;return this.each(pre(this._id,n))}function Ore(n){typeof n!="function"&&(n=Gz(n));for(var e=this._groups,t=e.length,r=new Array(t),s=0;s<t;++s)for(var i=e[s],a=i.length,o=r[s]=[],u,d=0;d<a;++d)(u=i[d])&&n.call(u,u.__data__,d,i)&&o.push(u);return new Wi(r,this._parents,this._name,this._id)}function gre(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,s=t.length,i=Math.min(r,s),a=new Array(r),o=0;o<i;++o)for(var u=e[o],d=t[o],p=u.length,m=a[o]=new Array(p),g,x=0;x<p;++x)(g=u[x]||d[x])&&(m[x]=g);for(;o<r;++o)a[o]=e[o];return new Wi(a,this._parents,this._name,this._id)}function xre(n){return(n+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||e==="start"})}function bre(n,e,t){var r,s,i=xre(e)?fk:ai;return function(){var a=i(this,n),o=a.on;o!==r&&(s=(r=o).copy()).on(e,t),a.on=s}}function yre(n,e){var t=this._id;return arguments.length<2?qs(this.node(),t).on.on(n):this.each(bre(t,n,e))}function vre(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function wre(){return this.on("end.remove",vre(this._id))}function Sre(n){var e=this._name,t=this._id;typeof n!="function"&&(n=lk(n));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a<s;++a)for(var o=r[a],u=o.length,d=i[a]=new Array(u),p,m,g=0;g<u;++g)(p=o[g])&&(m=n.call(p,p.__data__,g,o))&&("__data__"in p&&(m.__data__=p.__data__),d[g]=m,sO(d[g],e,t,g,d,qs(p,t)));return new Wi(i,this._parents,e,t)}function Qre(n){var e=this._name,t=this._id;typeof n!="function"&&(n=Wz(n));for(var r=this._groups,s=r.length,i=[],a=[],o=0;o<s;++o)for(var u=r[o],d=u.length,p,m=0;m<d;++m)if(p=u[m]){for(var g=n.call(p,p.__data__,m,u),x,v=qs(p,t),y=0,S=g.length;y<S;++y)(x=g[y])&&sO(x,e,t,y,g,v);i.push(g),a.push(p)}return new Wi(i,a,e,t)}var kre=ad.prototype.constructor;function $re(){return new kre(this._groups,this._parents)}function Tre(n,e){var t,r,s;return function(){var i=wc(this,n),a=(this.style.removeProperty(n),wc(this,n));return i===a?null:i===t&&a===r?s:s=e(t=i,r=a)}}function gL(n){return function(){this.style.removeProperty(n)}}function jre(n,e,t){var r,s=t+"",i;return function(){var a=wc(this,n);return a===s?null:a===r?i:i=e(r=a,t)}}function _re(n,e,t){var r,s,i;return function(){var a=wc(this,n),o=t(this),u=o+"";return o==null&&(u=o=(this.style.removeProperty(n),wc(this,n))),a===u?null:a===r&&u===s?i:(s=u,i=e(r=a,o))}}function Pre(n,e){var t,r,s,i="style."+e,a="end."+i,o;return function(){var u=ai(this,n),d=u.on,p=u.value[i]==null?o||(o=gL(e)):void 0;(d!==t||s!==p)&&(r=(t=d).copy()).on(a,s=p),u.on=r}}function Nre(n,e,t){var r=(n+="")=="transform"?Nne:OL;return e==null?this.styleTween(n,Tre(n,r)).on("end.style."+n,gL(n)):typeof e=="function"?this.styleTween(n,_re(n,r,dk(this,"style."+n,e))).each(Pre(this._id,n)):this.styleTween(n,jre(n,r,e),t).on("end.style."+n,null)}function Cre(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}function Rre(n,e,t){var r,s;function i(){var a=e.apply(this,arguments);return a!==s&&(r=(s=a)&&Cre(n,a,t)),r}return i._value=e,i}function Ere(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Rre(n,e,t??""))}function Are(n){return function(){this.textContent=n}}function qre(n){return function(){var e=n(this);this.textContent=e??""}}function Mre(n){return this.tween("text",typeof n=="function"?qre(dk(this,"text",n)):Are(n==null?"":n+""))}function Xre(n){return function(e){this.textContent=n.call(this,e)}}function zre(n){var e,t;function r(){var s=n.apply(this,arguments);return s!==t&&(e=(t=s)&&Xre(s)),e}return r._value=n,r}function Lre(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,zre(n))}function Zre(){for(var n=this._name,e=this._id,t=xL(),r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],o=a.length,u,d=0;d<o;++d)if(u=a[d]){var p=qs(u,e);sO(u,n,t,d,a,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Wi(r,this._parents,n,t)}function Vre(){var n,e,t=this,r=t._id,s=t.size();return new Promise(function(i,a){var o={value:a},u={value:function(){--s===0&&i()}};t.each(function(){var d=ai(this,r),p=d.on;p!==n&&(e=(n=p).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(u)),d.on=e}),s===0&&i()})}var Yre=0;function Wi(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function xL(){return++Yre}var Pi=ad.prototype;Wi.prototype={constructor:Wi,select:Sre,selectAll:Qre,selectChild:Pi.selectChild,selectChildren:Pi.selectChildren,filter:Ore,merge:gre,selection:$re,transition:Zre,call:Pi.call,nodes:Pi.nodes,node:Pi.node,size:Pi.size,empty:Pi.empty,each:Pi.each,on:yre,attr:ere,attrTween:ire,style:Nre,styleTween:Ere,text:Mre,textTween:Lre,remove:wre,tween:Wne,delay:ore,duration:fre,ease:hre,easeVarying:mre,end:Vre,[Symbol.iterator]:Pi[Symbol.iterator]};function Dre(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var Bre={time:null,delay:0,duration:250,ease:Dre};function Ure(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}function Wre(n){var e,t;n instanceof Wi?(e=n._id,n=n._name):(e=xL(),(t=Bre).time=uk(),n=n==null?null:n+"");for(var r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],o=a.length,u,d=0;d<o;++d)(u=a[d])&&sO(u,n,e,d,a,t||Ure(u,e));return new Wi(r,this._parents,n,e)}ad.prototype.interrupt=Dne;ad.prototype.transition=Wre;const lp=n=>()=>n;function Gre(n,{sourceEvent:e,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Zi(n,e,t){this.k=n,this.x=e,this.y=t}Zi.prototype={constructor:Zi,scale:function(n){return n===1?this:new Zi(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new Zi(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Di=new Zi(1,0,0);Zi.prototype;function Dx(n){n.stopImmediatePropagation()}function Bu(n){n.preventDefault(),n.stopImmediatePropagation()}function Ire(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Hre(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function U4(){return this.__zoom||Di}function Fre(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Kre(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jre(n,e,t){var r=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],i=n.invertY(e[0][1])-t[0][1],a=n.invertY(e[1][1])-t[1][1];return n.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function bL(){var n=Ire,e=Hre,t=Jre,r=Fre,s=Kre,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,u=qne,d=tO("start","zoom","end"),p,m,g,x=500,v=150,y=0,S=10;function Q(C){C.property("__zoom",U4).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",L).filter(s).on("touchstart.zoom",E).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}Q.transform=function(C,G,A,U){var H=C.selection?C.selection():C;H.property("__zoom",U4),C!==H?T(C,G,A,U):H.interrupt().each(function(){R(this,arguments).event(U).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},Q.scaleBy=function(C,G,A,U){Q.scaleTo(C,function(){var H=this.__zoom.k,W=typeof G=="function"?G.apply(this,arguments):G;return H*W},A,U)},Q.scaleTo=function(C,G,A,U){Q.transform(C,function(){var H=e.apply(this,arguments),W=this.__zoom,J=A==null?j(H):typeof A=="function"?A.apply(this,arguments):A,X=W.invert(J),D=typeof G=="function"?G.apply(this,arguments):G;return t($(k(W,D),J,X),H,a)},A,U)},Q.translateBy=function(C,G,A,U){Q.transform(C,function(){return t(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof A=="function"?A.apply(this,arguments):A),e.apply(this,arguments),a)},null,U)},Q.translateTo=function(C,G,A,U,H){Q.transform(C,function(){var W=e.apply(this,arguments),J=this.__zoom,X=U==null?j(W):typeof U=="function"?U.apply(this,arguments):U;return t(Di.translate(X[0],X[1]).scale(J.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof A=="function"?-A.apply(this,arguments):-A),W,a)},U,H)};function k(C,G){return G=Math.max(i[0],Math.min(i[1],G)),G===C.k?C:new Zi(G,C.x,C.y)}function $(C,G,A){var U=G[0]-A[0]*C.k,H=G[1]-A[1]*C.k;return U===C.x&&H===C.y?C:new Zi(C.k,U,H)}function j(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function T(C,G,A,U){C.on("start.zoom",function(){R(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(U).end()}).tween("zoom",function(){var H=this,W=arguments,J=R(H,W).event(U),X=e.apply(H,W),D=A==null?j(X):typeof A=="function"?A.apply(H,W):A,ee=Math.max(X[1][0]-X[0][0],X[1][1]-X[0][1]),Z=H.__zoom,I=typeof G=="function"?G.apply(H,W):G,K=u(Z.invert(D).concat(ee/Z.k),I.invert(D).concat(ee/I.k));return function(re){if(re===1)re=I;else{var se=K(re),be=ee/se[2];re=new Zi(be,D[0]-se[0]*be,D[1]-se[1]*be)}J.zoom(null,re)}})}function R(C,G,A){return!A&&C.__zooming||new N(C,G)}function N(C,G){this.that=C,this.args=G,this.active=0,this.sourceEvent=null,this.extent=e.apply(C,G),this.taps=0}N.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,G){return this.mouse&&C!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var G=Wr(this.that).datum();d.call(C,this.that,new Gre(C,{sourceEvent:this.sourceEvent,target:Q,transform:this.that.__zoom,dispatch:d}),G)}};function q(C,...G){if(!n.apply(this,arguments))return;var A=R(this,G).event(C),U=this.__zoom,H=Math.max(i[0],Math.min(i[1],U.k*Math.pow(2,r.apply(this,arguments)))),W=Qs(C);if(A.wheel)(A.mouse[0][0]!==W[0]||A.mouse[0][1]!==W[1])&&(A.mouse[1]=U.invert(A.mouse[0]=W)),clearTimeout(A.wheel);else{if(U.k===H)return;A.mouse=[W,U.invert(W)],Ep(this),A.start()}Bu(C),A.wheel=setTimeout(J,v),A.zoom("mouse",t($(k(U,H),A.mouse[0],A.mouse[1]),A.extent,a));function J(){A.wheel=null,A.end()}}function z(C,...G){if(g||!n.apply(this,arguments))return;var A=C.currentTarget,U=R(this,G,!0).event(C),H=Wr(C.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",ee,!0),W=Qs(C,A),J=C.clientX,X=C.clientY;sL(C.view),Dx(C),U.mouse=[W,this.__zoom.invert(W)],Ep(this),U.start();function D(Z){if(Bu(Z),!U.moved){var I=Z.clientX-J,K=Z.clientY-X;U.moved=I*I+K*K>y}U.event(Z).zoom("mouse",t($(U.that.__zoom,U.mouse[0]=Qs(Z,A),U.mouse[1]),U.extent,a))}function ee(Z){H.on("mousemove.zoom mouseup.zoom",null),iL(Z.view,U.moved),Bu(Z),U.event(Z).end()}}function L(C,...G){if(n.apply(this,arguments)){var A=this.__zoom,U=Qs(C.changedTouches?C.changedTouches[0]:C,this),H=A.invert(U),W=A.k*(C.shiftKey?.5:2),J=t($(k(A,W),U,H),e.apply(this,G),a);Bu(C),o>0?Wr(this).transition().duration(o).call(T,J,U,C):Wr(this).call(Q.transform,J,U,C)}}function E(C,...G){if(n.apply(this,arguments)){var A=C.touches,U=A.length,H=R(this,G,C.changedTouches.length===U).event(C),W,J,X,D;for(Dx(C),J=0;J<U;++J)X=A[J],D=Qs(X,this),D=[D,this.__zoom.invert(D),X.identifier],H.touch0?!H.touch1&&H.touch0[2]!==D[2]&&(H.touch1=D,H.taps=0):(H.touch0=D,W=!0,H.taps=1+!!p);p&&(p=clearTimeout(p)),W&&(H.taps<2&&(m=D[0],p=setTimeout(function(){p=null},x)),Ep(this),H.start())}}function V(C,...G){if(this.__zooming){var A=R(this,G).event(C),U=C.changedTouches,H=U.length,W,J,X,D;for(Bu(C),W=0;W<H;++W)J=U[W],X=Qs(J,this),A.touch0&&A.touch0[2]===J.identifier?A.touch0[0]=X:A.touch1&&A.touch1[2]===J.identifier&&(A.touch1[0]=X);if(J=A.that.__zoom,A.touch1){var ee=A.touch0[0],Z=A.touch0[1],I=A.touch1[0],K=A.touch1[1],re=(re=I[0]-ee[0])*re+(re=I[1]-ee[1])*re,se=(se=K[0]-Z[0])*se+(se=K[1]-Z[1])*se;J=k(J,Math.sqrt(re/se)),X=[(ee[0]+I[0])/2,(ee[1]+I[1])/2],D=[(Z[0]+K[0])/2,(Z[1]+K[1])/2]}else if(A.touch0)X=A.touch0[0],D=A.touch0[1];else return;A.zoom("touch",t($(J,X,D),A.extent,a))}}function B(C,...G){if(this.__zooming){var A=R(this,G).event(C),U=C.changedTouches,H=U.length,W,J;for(Dx(C),g&&clearTimeout(g),g=setTimeout(function(){g=null},x),W=0;W<H;++W)J=U[W],A.touch0&&A.touch0[2]===J.identifier?delete A.touch0:A.touch1&&A.touch1[2]===J.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(J=Qs(J,this),Math.hypot(m[0]-J[0],m[1]-J[1])<S)){var X=Wr(this).on("dblclick.zoom");X&&X.apply(this,arguments)}}}return Q.wheelDelta=function(C){return arguments.length?(r=typeof C=="function"?C:lp(+C),Q):r},Q.filter=function(C){return arguments.length?(n=typeof C=="function"?C:lp(!!C),Q):n},Q.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:lp(!!C),Q):s},Q.extent=function(C){return arguments.length?(e=typeof C=="function"?C:lp([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),Q):e},Q.scaleExtent=function(C){return arguments.length?(i[0]=+C[0],i[1]=+C[1],Q):[i[0],i[1]]},Q.translateExtent=function(C){return arguments.length?(a[0][0]=+C[0][0],a[1][0]=+C[1][0],a[0][1]=+C[0][1],a[1][1]=+C[1][1],Q):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},Q.constrain=function(C){return arguments.length?(t=C,Q):t},Q.duration=function(C){return arguments.length?(o=+C,Q):o},Q.interpolate=function(C){return arguments.length?(u=C,Q):u},Q.on=function(){var C=d.on.apply(d,arguments);return C===d?Q:C},Q.clickDistance=function(C){return arguments.length?(y=(C=+C)*C,Q):Math.sqrt(y)},Q.tapDistance=function(C){return arguments.length?(S=+C,Q):S},Q}FA();const iO=P.createContext(null),ese=iO.Provider,Gi={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,e)=>`Couldn't create edge for ${n?"target":"source"} handle id: "${n?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},yL=Gi.error001();function Xt(n,e){const t=P.useContext(iO);if(t===null)throw new Error(yL);return Bz(t,n,e)}const Nn=()=>{const n=P.useContext(iO);if(n===null)throw new Error(yL);return P.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe,destroy:n.destroy}),[n])},tse=n=>n.userSelectionActive?"none":"all";function aO({position:n,children:e,className:t,style:r,...s}){const i=Xt(tse),a=`${n}`.split("-");return ue.createElement("div",{className:Yn(["react-flow__panel",t,...a]),style:{...r,pointerEvents:i},...s},e)}function nse({proOptions:n,position:e="bottom-right"}){return n!=null&&n.hideAttribution?null:ue.createElement(aO,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ue.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const rse=({x:n,y:e,label:t,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:u,className:d,...p})=>{const m=P.useRef(null),[g,x]=P.useState({x:0,y:0,width:0,height:0}),v=Yn(["react-flow__edge-textwrapper",d]);return P.useEffect(()=>{if(m.current){const y=m.current.getBBox();x({x:y.x,y:y.y,width:y.width,height:y.height})}},[t]),typeof t>"u"||!t?null:ue.createElement("g",{transform:`translate(${n-g.width/2} ${e-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...p},s&&ue.createElement("rect",{width:g.width+2*a[0],x:-a[0],y:-a[1],height:g.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),ue.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},t),u)};var sse=P.memo(rse);const hk=n=>({width:n.offsetWidth,height:n.offsetHeight}),Qc=(n,e=0,t=1)=>Math.min(Math.max(n,e),t),pk=(n={x:0,y:0},e)=>({x:Qc(n.x,e[0][0],e[1][0]),y:Qc(n.y,e[0][1],e[1][1])}),W4=(n,e,t)=>n<e?Qc(Math.abs(n-e),1,50)/50:n>t?-Qc(Math.abs(n-t),1,50)/50:0,vL=(n,e)=>{const t=W4(n.x,35,e.width-35)*20,r=W4(n.y,35,e.height-35)*20;return[t,r]},wL=n=>{var e;return((e=n.getRootNode)==null?void 0:e.call(n))||(window==null?void 0:window.document)},SL=(n,e)=>({x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}),Yf=({x:n,y:e,width:t,height:r})=>({x:n,y:e,x2:n+t,y2:e+r}),QL=({x:n,y:e,x2:t,y2:r})=>({x:n,y:e,width:t-n,height:r-e}),G4=n=>({...n.positionAbsolute||{x:0,y:0},width:n.width||0,height:n.height||0}),ise=(n,e)=>QL(SL(Yf(n),Yf(e))),R2=(n,e)=>{const t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),r=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*r)},ase=n=>Jr(n.width)&&Jr(n.height)&&Jr(n.x)&&Jr(n.y),Jr=n=>!isNaN(n)&&isFinite(n),an=Symbol.for("internals"),kL=["Enter"," ","Escape"],lse=(n,e)=>{},ose=n=>"nativeEvent"in n;function E2(n){var s,i;const e=ose(n)?n.nativeEvent:n,t=((i=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:i[0])||n.target;return["INPUT","SELECT","TEXTAREA"].includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const $L=n=>"clientX"in n,qa=(n,e)=>{var i,a;const t=$L(n),r=t?n.clientX:(i=n.touches)==null?void 0:i[0].clientX,s=t?n.clientY:(a=n.touches)==null?void 0:a[0].clientY;return{x:r-((e==null?void 0:e.left)??0),y:s-((e==null?void 0:e.top)??0)}},wm=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0},od=({id:n,path:e,labelX:t,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:g,interactionWidth:x=20})=>ue.createElement(ue.Fragment,null,ue.createElement("path",{id:n,style:p,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:g}),x&&ue.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&Jr(t)&&Jr(r)?ue.createElement(sse,{x:t,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d}):null);od.displayName="BaseEdge";function Uu(n,e,t){return t===void 0?t:r=>{const s=e().edges.find(i=>i.id===n);s&&t(r,{...s})}}function TL({sourceX:n,sourceY:e,targetX:t,targetY:r}){const s=Math.abs(t-n)/2,i=t<n?t+s:t-s,a=Math.abs(r-e)/2,o=r<e?r+a:r-a;return[i,o,s,a]}function jL({sourceX:n,sourceY:e,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const u=n*.125+s*.375+a*.375+t*.125,d=e*.125+i*.375+o*.375+r*.125,p=Math.abs(u-n),m=Math.abs(d-e);return[u,d,p,m]}var Ii;(function(n){n.Strict="strict",n.Loose="loose"})(Ii||(Ii={}));var $l;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})($l||($l={}));var Df;(function(n){n.Partial="partial",n.Full="full"})(Df||(Df={}));var Na;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Na||(Na={}));var Pl;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Pl||(Pl={}));var ze;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(ze||(ze={}));function I4({pos:n,x1:e,y1:t,x2:r,y2:s}){return n===ze.Left||n===ze.Right?[.5*(e+r),t]:[e,.5*(t+s)]}function _L({sourceX:n,sourceY:e,sourcePosition:t=ze.Bottom,targetX:r,targetY:s,targetPosition:i=ze.Top}){const[a,o]=I4({pos:t,x1:n,y1:e,x2:r,y2:s}),[u,d]=I4({pos:i,x1:r,y1:s,x2:n,y2:e}),[p,m,g,x]=jL({sourceX:n,sourceY:e,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:u,targetControlY:d});return[`M${n},${e} C${a},${o} ${u},${d} ${r},${s}`,p,m,g,x]}const mk=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,sourcePosition:s=ze.Bottom,targetPosition:i=ze.Top,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:y})=>{const[S,Q,k]=_L({sourceX:n,sourceY:e,sourcePosition:s,targetX:t,targetY:r,targetPosition:i});return ue.createElement(od,{path:S,labelX:Q,labelY:k,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:y})});mk.displayName="SimpleBezierEdge";const H4={[ze.Left]:{x:-1,y:0},[ze.Right]:{x:1,y:0},[ze.Top]:{x:0,y:-1},[ze.Bottom]:{x:0,y:1}},cse=({source:n,sourcePosition:e=ze.Bottom,target:t})=>e===ze.Left||e===ze.Right?n.x<t.x?{x:1,y:0}:{x:-1,y:0}:n.y<t.y?{x:0,y:1}:{x:0,y:-1},F4=(n,e)=>Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));function use({source:n,sourcePosition:e=ze.Bottom,target:t,targetPosition:r=ze.Top,center:s,offset:i}){const a=H4[e],o=H4[r],u={x:n.x+a.x*i,y:n.y+a.y*i},d={x:t.x+o.x*i,y:t.y+o.y*i},p=cse({source:u,sourcePosition:e,target:d}),m=p.x!==0?"x":"y",g=p[m];let x=[],v,y;const S={x:0,y:0},Q={x:0,y:0},[k,$,j,T]=TL({sourceX:n.x,sourceY:n.y,targetX:t.x,targetY:t.y});if(a[m]*o[m]===-1){v=s.x??k,y=s.y??$;const N=[{x:v,y:u.y},{x:v,y:d.y}],q=[{x:u.x,y},{x:d.x,y}];a[m]===g?x=m==="x"?N:q:x=m==="x"?q:N}else{const N=[{x:u.x,y:d.y}],q=[{x:d.x,y:u.y}];if(m==="x"?x=a.x===g?q:N:x=a.y===g?N:q,e===r){const B=Math.abs(n[m]-t[m]);if(B<=i){const C=Math.min(i-1,i-B);a[m]===g?S[m]=(u[m]>n[m]?-1:1)*C:Q[m]=(d[m]>t[m]?-1:1)*C}}if(e!==r){const B=m==="x"?"y":"x",C=a[m]===o[B],G=u[B]>d[B],A=u[B]<d[B];(a[m]===1&&(!C&&G||C&&A)||a[m]!==1&&(!C&&A||C&&G))&&(x=m==="x"?N:q)}const z={x:u.x+S.x,y:u.y+S.y},L={x:d.x+Q.x,y:d.y+Q.y},E=Math.max(Math.abs(z.x-x[0].x),Math.abs(L.x-x[0].x)),V=Math.max(Math.abs(z.y-x[0].y),Math.abs(L.y-x[0].y));E>=V?(v=(z.x+L.x)/2,y=x[0].y):(v=x[0].x,y=(z.y+L.y)/2)}return[[n,{x:u.x+S.x,y:u.y+S.y},...x,{x:d.x+Q.x,y:d.y+Q.y},t],v,y,j,T]}function fse(n,e,t,r){const s=Math.min(F4(n,e)/2,F4(e,t)/2,r),{x:i,y:a}=e;if(n.x===i&&i===t.x||n.y===a&&a===t.y)return`L${i} ${a}`;if(n.y===a){const d=n.x<t.x?-1:1,p=n.y<t.y?1:-1;return`L ${i+s*d},${a}Q ${i},${a} ${i},${a+s*p}`}const o=n.x<t.x?1:-1,u=n.y<t.y?-1:1;return`L ${i},${a+s*u}Q ${i},${a} ${i+s*o},${a}`}function A2({sourceX:n,sourceY:e,sourcePosition:t=ze.Bottom,targetX:r,targetY:s,targetPosition:i=ze.Top,borderRadius:a=5,centerX:o,centerY:u,offset:d=20}){const[p,m,g,x,v]=use({source:{x:n,y:e},sourcePosition:t,target:{x:r,y:s},targetPosition:i,center:{x:o,y:u},offset:d});return[p.reduce((S,Q,k)=>{let $="";return k>0&&k<p.length-1?$=fse(p[k-1],Q,p[k+1],a):$=`${k===0?"M":"L"}${Q.x} ${Q.y}`,S+=$,S},""),m,g,x,v]}const lO=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d,style:p,sourcePosition:m=ze.Bottom,targetPosition:g=ze.Top,markerEnd:x,markerStart:v,pathOptions:y,interactionWidth:S})=>{const[Q,k,$]=A2({sourceX:n,sourceY:e,sourcePosition:m,targetX:t,targetY:r,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset});return ue.createElement(od,{path:Q,labelX:k,labelY:$,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d,style:p,markerEnd:x,markerStart:v,interactionWidth:S})});lO.displayName="SmoothStepEdge";const Ok=P.memo(n=>{var e;return ue.createElement(lO,{...n,pathOptions:P.useMemo(()=>{var t;return{borderRadius:0,offset:(t=n.pathOptions)==null?void 0:t.offset}},[(e=n.pathOptions)==null?void 0:e.offset])})});Ok.displayName="StepEdge";function dse({sourceX:n,sourceY:e,targetX:t,targetY:r}){const[s,i,a,o]=TL({sourceX:n,sourceY:e,targetX:t,targetY:r});return[`M ${n},${e}L ${t},${r}`,s,i,a,o]}const gk=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[v,y,S]=dse({sourceX:n,sourceY:e,targetX:t,targetY:r});return ue.createElement(od,{path:v,labelX:y,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:g,interactionWidth:x})});gk.displayName="StraightEdge";function op(n,e){return n>=0?.5*n:e*25*Math.sqrt(-n)}function K4({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}){switch(n){case ze.Left:return[e-op(e-r,i),t];case ze.Right:return[e+op(r-e,i),t];case ze.Top:return[e,t-op(t-s,i)];case ze.Bottom:return[e,t+op(s-t,i)]}}function PL({sourceX:n,sourceY:e,sourcePosition:t=ze.Bottom,targetX:r,targetY:s,targetPosition:i=ze.Top,curvature:a=.25}){const[o,u]=K4({pos:t,x1:n,y1:e,x2:r,y2:s,c:a}),[d,p]=K4({pos:i,x1:r,y1:s,x2:n,y2:e,c:a}),[m,g,x,v]=jL({sourceX:n,sourceY:e,targetX:r,targetY:s,sourceControlX:o,sourceControlY:u,targetControlX:d,targetControlY:p});return[`M${n},${e} C${o},${u} ${d},${p} ${r},${s}`,m,g,x,v]}const Sm=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,sourcePosition:s=ze.Bottom,targetPosition:i=ze.Top,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,pathOptions:y,interactionWidth:S})=>{const[Q,k,$]=PL({sourceX:n,sourceY:e,sourcePosition:s,targetX:t,targetY:r,targetPosition:i,curvature:y==null?void 0:y.curvature});return ue.createElement(od,{path:Q,labelX:k,labelY:$,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:S})});Sm.displayName="BezierEdge";const xk=P.createContext(null),hse=xk.Provider;xk.Consumer;const pse=()=>P.useContext(xk),mse=n=>"id"in n&&"source"in n&&"target"in n,Ose=({source:n,sourceHandle:e,target:t,targetHandle:r})=>`reactflow__edge-${n}${e||""}-${t}${r||""}`,q2=(n,e)=>typeof n>"u"?"":typeof n=="string"?n:`${e?`${e}__`:""}${Object.keys(n).sort().map(r=>`${r}=${n[r]}`).join("&")}`,gse=(n,e)=>e.some(t=>t.source===n.source&&t.target===n.target&&(t.sourceHandle===n.sourceHandle||!t.sourceHandle&&!n.sourceHandle)&&(t.targetHandle===n.targetHandle||!t.targetHandle&&!n.targetHandle)),NL=(n,e)=>{if(!n.source||!n.target)return e;let t;return mse(n)?t={...n}:t={...n,id:Ose(n)},gse(t,e)?e:e.concat(t)},M2=({x:n,y:e},[t,r,s],i,[a,o])=>{const u={x:(n-t)/s,y:(e-r)/s};return i?{x:a*Math.round(u.x/a),y:o*Math.round(u.y/o)}:u},CL=({x:n,y:e},[t,r,s])=>({x:n*s+t,y:e*s+r}),Nl=(n,e=[0,0])=>{if(!n)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const t=(n.width??0)*e[0],r=(n.height??0)*e[1],s={x:n.position.x-t,y:n.position.y-r};return{...s,positionAbsolute:n.positionAbsolute?{x:n.positionAbsolute.x-t,y:n.positionAbsolute.y-r}:s}},oO=(n,e=[0,0])=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const t=n.reduce((r,s)=>{const{x:i,y:a}=Nl(s,e).positionAbsolute;return SL(r,Yf({x:i,y:a,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return QL(t)},RL=(n,e,[t,r,s]=[0,0,1],i=!1,a=!1,o=[0,0])=>{const u={x:(e.x-t)/s,y:(e.y-r)/s,width:e.width/s,height:e.height/s},d=[];return n.forEach(p=>{const{width:m,height:g,selectable:x=!0,hidden:v=!1}=p;if(a&&!x||v)return!1;const{positionAbsolute:y}=Nl(p,o),S={x:y.x,y:y.y,width:m||0,height:g||0},Q=R2(u,S),k=typeof m>"u"||typeof g>"u"||m===null||g===null,$=i&&Q>0,j=(m||0)*(g||0);(k||$||Q>=j||p.dragging)&&d.push(p)}),d},EL=(n,e)=>{const t=n.map(r=>r.id);return e.filter(r=>t.includes(r.source)||t.includes(r.target))},AL=(n,e,t,r,s,i=.1)=>{const a=e/(n.width*(1+i)),o=t/(n.height*(1+i)),u=Math.min(a,o),d=Qc(u,r,s),p=n.x+n.width/2,m=n.y+n.height/2,g=e/2-p*d,x=t/2-m*d;return{x:g,y:x,zoom:d}},Ol=(n,e=0)=>n.transition().duration(e);function J4(n,e,t,r){return(e[t]||[]).reduce((s,i)=>{var a,o;return`${n.id}-${i.id}-${t}`!==r&&s.push({id:i.id||null,type:t,nodeId:n.id,x:(((a=n.positionAbsolute)==null?void 0:a.x)??0)+i.x+i.width/2,y:(((o=n.positionAbsolute)==null?void 0:o.y)??0)+i.y+i.height/2}),s},[])}function xse(n,e,t,r,s,i){const{x:a,y:o}=qa(n),d=e.elementsFromPoint(a,o).find(v=>v.classList.contains("react-flow__handle"));if(d){const v=d.getAttribute("data-nodeid");if(v){const y=bk(void 0,d),S=d.getAttribute("data-handleid"),Q=i({nodeId:v,id:S,type:y});if(Q){const k=s.find($=>$.nodeId===v&&$.type===y&&$.id===S);return{handle:{id:S,type:y,nodeId:v,x:(k==null?void 0:k.x)||t.x,y:(k==null?void 0:k.y)||t.y},validHandleResult:Q}}}}let p=[],m=1/0;if(s.forEach(v=>{const y=Math.sqrt((v.x-t.x)**2+(v.y-t.y)**2);if(y<=r){const S=i(v);y<=m&&(y<m?p=[{handle:v,validHandleResult:S}]:y===m&&p.push({handle:v,validHandleResult:S}),m=y)}}),!p.length)return{handle:null,validHandleResult:qL()};if(p.length===1)return p[0];const g=p.some(({validHandleResult:v})=>v.isValid),x=p.some(({handle:v})=>v.type==="target");return p.find(({handle:v,validHandleResult:y})=>x?v.type==="target":g?y.isValid:!0)||p[0]}const bse={source:null,target:null,sourceHandle:null,targetHandle:null},qL=()=>({handleDomNode:null,isValid:!1,connection:bse,endHandle:null});function ML(n,e,t,r,s,i,a){const o=s==="target",u=a.querySelector(`.react-flow__handle[data-id="${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`),d={...qL(),handleDomNode:u};if(u){const p=bk(void 0,u),m=u.getAttribute("data-nodeid"),g=u.getAttribute("data-handleid"),x=u.classList.contains("connectable"),v=u.classList.contains("connectableend"),y={source:o?m:t,sourceHandle:o?g:r,target:o?t:m,targetHandle:o?r:g};d.connection=y,x&&v&&(e===Ii.Strict?o&&p==="source"||!o&&p==="target":m!==t||g!==r)&&(d.endHandle={nodeId:m,handleId:g,type:p},d.isValid=i(y))}return d}function yse({nodes:n,nodeId:e,handleId:t,handleType:r}){return n.reduce((s,i)=>{if(i[an]){const{handleBounds:a}=i[an];let o=[],u=[];a&&(o=J4(i,a,"source",`${e}-${t}-${r}`),u=J4(i,a,"target",`${e}-${t}-${r}`)),s.push(...o,...u)}return s},[])}function bk(n,e){return n||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function Bx(n){n==null||n.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function vse(n,e){let t=null;return e?t="valid":n&&!e&&(t="invalid"),t}function XL({event:n,handleId:e,nodeId:t,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:o,edgeUpdaterType:u,onReconnectEnd:d}){const p=wL(n.target),{connectionMode:m,domNode:g,autoPanOnConnect:x,connectionRadius:v,onConnectStart:y,panBy:S,getNodes:Q,cancelConnection:k}=i();let $=0,j;const{x:T,y:R}=qa(n),N=p==null?void 0:p.elementFromPoint(T,R),q=bk(u,N),z=g==null?void 0:g.getBoundingClientRect();if(!z||!q)return;let L,E=qa(n,z),V=!1,B=null,C=!1,G=null;const A=yse({nodes:Q(),nodeId:t,handleId:e,handleType:q}),U=()=>{if(!x)return;const[J,X]=vL(E,z);S({x:J,y:X}),$=requestAnimationFrame(U)};a({connectionPosition:E,connectionStatus:null,connectionNodeId:t,connectionHandleId:e,connectionHandleType:q,connectionStartHandle:{nodeId:t,handleId:e,type:q},connectionEndHandle:null}),y==null||y(n,{nodeId:t,handleId:e,handleType:q});function H(J){const{transform:X}=i();E=qa(J,z);const{handle:D,validHandleResult:ee}=xse(J,p,M2(E,X,!1,[1,1]),v,A,Z=>ML(Z,m,t,e,s?"target":"source",o,p));if(j=D,V||(U(),V=!0),G=ee.handleDomNode,B=ee.connection,C=ee.isValid,a({connectionPosition:j&&C?CL({x:j.x,y:j.y},X):E,connectionStatus:vse(!!j,C),connectionEndHandle:ee.endHandle}),!j&&!C&&!G)return Bx(L);B.source!==B.target&&G&&(Bx(L),L=G,G.classList.add("connecting","react-flow__handle-connecting"),G.classList.toggle("valid",C),G.classList.toggle("react-flow__handle-valid",C))}function W(J){var X,D;(j||G)&&B&&C&&(r==null||r(B)),(D=(X=i()).onConnectEnd)==null||D.call(X,J),u&&(d==null||d(J)),Bx(L),k(),cancelAnimationFrame($),V=!1,C=!1,B=null,G=null,p.removeEventListener("mousemove",H),p.removeEventListener("mouseup",W),p.removeEventListener("touchmove",H),p.removeEventListener("touchend",W)}p.addEventListener("mousemove",H),p.addEventListener("mouseup",W),p.addEventListener("touchmove",H),p.addEventListener("touchend",W)}const eN=()=>!0,wse=n=>({connectionStartHandle:n.connectionStartHandle,connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName}),Sse=(n,e,t)=>r=>{const{connectionStartHandle:s,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:(s==null?void 0:s.nodeId)===n&&(s==null?void 0:s.handleId)===e&&(s==null?void 0:s.type)===t||(i==null?void 0:i.nodeId)===n&&(i==null?void 0:i.handleId)===e&&(i==null?void 0:i.type)===t,clickConnecting:(a==null?void 0:a.nodeId)===n&&(a==null?void 0:a.handleId)===e&&(a==null?void 0:a.type)===t}},zL=P.forwardRef(({type:n="source",position:e=ze.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:u,className:d,onMouseDown:p,onTouchStart:m,...g},x)=>{var z,L;const v=a||null,y=n==="target",S=Nn(),Q=pse(),{connectOnClick:k,noPanClassName:$}=Xt(wse,En),{connecting:j,clickConnecting:T}=Xt(Sse(Q,v,n),En);Q||(L=(z=S.getState()).onError)==null||L.call(z,"010",Gi.error010());const R=E=>{const{defaultEdgeOptions:V,onConnect:B,hasDefaultEdges:C}=S.getState(),G={...V,...E};if(C){const{edges:A,setEdges:U}=S.getState();U(NL(G,A))}B==null||B(G),o==null||o(G)},N=E=>{if(!Q)return;const V=$L(E);s&&(V&&E.button===0||!V)&&XL({event:E,handleId:v,nodeId:Q,onConnect:R,isTarget:y,getState:S.getState,setState:S.setState,isValidConnection:t||S.getState().isValidConnection||eN}),V?p==null||p(E):m==null||m(E)},q=E=>{const{onClickConnectStart:V,onClickConnectEnd:B,connectionClickStartHandle:C,connectionMode:G,isValidConnection:A}=S.getState();if(!Q||!C&&!s)return;if(!C){V==null||V(E,{nodeId:Q,handleId:v,handleType:n}),S.setState({connectionClickStartHandle:{nodeId:Q,type:n,handleId:v}});return}const U=wL(E.target),H=t||A||eN,{connection:W,isValid:J}=ML({nodeId:Q,id:v,type:n},G,C.nodeId,C.handleId||null,C.type,H,U);J&&R(W),B==null||B(E),S.setState({connectionClickStartHandle:null})};return ue.createElement("div",{"data-handleid":v,"data-nodeid":Q,"data-handlepos":e,"data-id":`${Q}-${v}-${n}`,className:Yn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",$,d,{source:!y,target:y,connectable:r,connectablestart:s,connectableend:i,connecting:T,connectionindicator:r&&(s&&!j||i&&j)}]),onMouseDown:N,onTouchStart:N,onClick:k?q:void 0,ref:x,...g},u)});zL.displayName="Handle";var kc=P.memo(zL);const LL=({data:n,isConnectable:e,targetPosition:t=ze.Top,sourcePosition:r=ze.Bottom})=>ue.createElement(ue.Fragment,null,ue.createElement(kc,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label,ue.createElement(kc,{type:"source",position:r,isConnectable:e}));LL.displayName="DefaultNode";var X2=P.memo(LL);const ZL=({data:n,isConnectable:e,sourcePosition:t=ze.Bottom})=>ue.createElement(ue.Fragment,null,n==null?void 0:n.label,ue.createElement(kc,{type:"source",position:t,isConnectable:e}));ZL.displayName="InputNode";var VL=P.memo(ZL);const YL=({data:n,isConnectable:e,targetPosition:t=ze.Top})=>ue.createElement(ue.Fragment,null,ue.createElement(kc,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label);YL.displayName="OutputNode";var DL=P.memo(YL);const yk=()=>null;yk.displayName="GroupNode";const Qse=n=>({selectedNodes:n.getNodes().filter(e=>e.selected),selectedEdges:n.edges.filter(e=>e.selected).map(e=>({...e}))}),cp=n=>n.id;function kse(n,e){return En(n.selectedNodes.map(cp),e.selectedNodes.map(cp))&&En(n.selectedEdges.map(cp),e.selectedEdges.map(cp))}const BL=P.memo(({onSelectionChange:n})=>{const e=Nn(),{selectedNodes:t,selectedEdges:r}=Xt(Qse,kse);return P.useEffect(()=>{const s={nodes:t,edges:r};n==null||n(s),e.getState().onSelectionChange.forEach(i=>i(s))},[t,r,n]),null});BL.displayName="SelectionListener";const $se=n=>!!n.onSelectionChange;function Tse({onSelectionChange:n}){const e=Xt($se);return n||e?ue.createElement(BL,{onSelectionChange:n}):null}const jse=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset});function zo(n,e){P.useEffect(()=>{typeof n<"u"&&e(n)},[n])}function et(n,e,t){P.useEffect(()=>{typeof e<"u"&&t({[n]:e})},[e])}const _se=({nodes:n,edges:e,defaultNodes:t,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:o,onClickConnectEnd:u,nodesDraggable:d,nodesConnectable:p,nodesFocusable:m,edgesFocusable:g,edgesUpdatable:x,elevateNodesOnSelect:v,minZoom:y,maxZoom:S,nodeExtent:Q,onNodesChange:k,onEdgesChange:$,elementsSelectable:j,connectionMode:T,snapGrid:R,snapToGrid:N,translateExtent:q,connectOnClick:z,defaultEdgeOptions:L,fitView:E,fitViewOptions:V,onNodesDelete:B,onEdgesDelete:C,onNodeDrag:G,onNodeDragStart:A,onNodeDragStop:U,onSelectionDrag:H,onSelectionDragStart:W,onSelectionDragStop:J,noPanClassName:X,nodeOrigin:D,rfId:ee,autoPanOnConnect:Z,autoPanOnNodeDrag:I,onError:K,connectionRadius:re,isValidConnection:se,nodeDragThreshold:be})=>{const{setNodes:$e,setEdges:Xe,setDefaultNodesAndEdges:ae,setMinZoom:Qe,setMaxZoom:Oe,setTranslateExtent:ye,setNodeExtent:Fe,reset:Te}=Xt(jse,En),ge=Nn();return P.useEffect(()=>{const Ke=r==null?void 0:r.map(ot=>({...ot,...L}));return ae(t,Ke),()=>{Te()}},[]),et("defaultEdgeOptions",L,ge.setState),et("connectionMode",T,ge.setState),et("onConnect",s,ge.setState),et("onConnectStart",i,ge.setState),et("onConnectEnd",a,ge.setState),et("onClickConnectStart",o,ge.setState),et("onClickConnectEnd",u,ge.setState),et("nodesDraggable",d,ge.setState),et("nodesConnectable",p,ge.setState),et("nodesFocusable",m,ge.setState),et("edgesFocusable",g,ge.setState),et("edgesUpdatable",x,ge.setState),et("elementsSelectable",j,ge.setState),et("elevateNodesOnSelect",v,ge.setState),et("snapToGrid",N,ge.setState),et("snapGrid",R,ge.setState),et("onNodesChange",k,ge.setState),et("onEdgesChange",$,ge.setState),et("connectOnClick",z,ge.setState),et("fitViewOnInit",E,ge.setState),et("fitViewOnInitOptions",V,ge.setState),et("onNodesDelete",B,ge.setState),et("onEdgesDelete",C,ge.setState),et("onNodeDrag",G,ge.setState),et("onNodeDragStart",A,ge.setState),et("onNodeDragStop",U,ge.setState),et("onSelectionDrag",H,ge.setState),et("onSelectionDragStart",W,ge.setState),et("onSelectionDragStop",J,ge.setState),et("noPanClassName",X,ge.setState),et("nodeOrigin",D,ge.setState),et("rfId",ee,ge.setState),et("autoPanOnConnect",Z,ge.setState),et("autoPanOnNodeDrag",I,ge.setState),et("onError",K,ge.setState),et("connectionRadius",re,ge.setState),et("isValidConnection",se,ge.setState),et("nodeDragThreshold",be,ge.setState),zo(n,$e),zo(e,Xe),zo(y,Qe),zo(S,Oe),zo(q,ye),zo(Q,Fe),null},tN={display:"none"},Pse={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},UL="react-flow__node-desc",WL="react-flow__edge-desc",Nse="react-flow__aria-live",Cse=n=>n.ariaLiveMessage;function Rse({rfId:n}){const e=Xt(Cse);return ue.createElement("div",{id:`${Nse}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:Pse},e)}function Ese({rfId:n,disableKeyboardA11y:e}){return ue.createElement(ue.Fragment,null,ue.createElement("div",{id:`${UL}-${n}`,style:tN},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ue.createElement("div",{id:`${WL}-${n}`,style:tN},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&ue.createElement(Rse,{rfId:n}))}var Bf=(n=null,e={actInsideInputWithModifier:!0})=>{const[t,r]=P.useState(!1),s=P.useRef(!1),i=P.useRef(new Set([])),[a,o]=P.useMemo(()=>{if(n!==null){const d=(Array.isArray(n)?n:[n]).filter(m=>typeof m=="string").map(m=>m.split("+")),p=d.reduce((m,g)=>m.concat(...g),[]);return[d,p]}return[[],[]]},[n]);return P.useEffect(()=>{const u=typeof document<"u"?document:null,d=(e==null?void 0:e.target)||u;if(n!==null){const p=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!e.actInsideInputWithModifier)&&E2(x))return!1;const y=rN(x.code,o);i.current.add(x[y]),nN(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&E2(x))return!1;const y=rN(x.code,o);nN(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(x[y]),x.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return d==null||d.addEventListener("keydown",p),d==null||d.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{d==null||d.removeEventListener("keydown",p),d==null||d.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[n,r]),t};function nN(n,e,t){return n.filter(r=>t||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function rN(n,e){return e.includes(n)?"code":"key"}function GL(n,e,t,r){var o,u;const s=n.parentNode||n.parentId;if(!s)return t;const i=e.get(s),a=Nl(i,r);return GL(i,e,{x:(t.x??0)+a.x,y:(t.y??0)+a.y,z:(((o=i[an])==null?void 0:o.z)??0)>(t.z??0)?((u=i[an])==null?void 0:u.z)??0:t.z??0},r)}function IL(n,e,t){n.forEach(r=>{var i;const s=r.parentNode||r.parentId;if(s&&!n.has(s))throw new Error(`Parent node ${s} not found`);if(s||t!=null&&t[r.id]){const{x:a,y:o,z:u}=GL(r,n,{...r.position,z:((i=r[an])==null?void 0:i.z)??0},e);r.positionAbsolute={x:a,y:o},r[an].z=u,t!=null&&t[r.id]&&(r[an].isParent=!0)}})}function Ux(n,e,t,r){const s=new Map,i={},a=r?1e3:0;return n.forEach(o=>{var x;const u=(Jr(o.zIndex)?o.zIndex:0)+(o.selected?a:0),d=e.get(o.id),p={...o,positionAbsolute:{x:o.position.x,y:o.position.y}},m=o.parentNode||o.parentId;m&&(i[m]=!0);const g=(d==null?void 0:d.type)&&(d==null?void 0:d.type)!==o.type;Object.defineProperty(p,an,{enumerable:!1,value:{handleBounds:g||(x=d==null?void 0:d[an])==null?void 0:x.handleBounds,z:u}}),s.set(o.id,p)}),IL(s,t,i),s}function HL(n,e={}){const{getNodes:t,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:o,d3Selection:u,fitViewOnInitDone:d,fitViewOnInit:p,nodeOrigin:m}=n(),g=e.initial&&!d&&p;if(o&&u&&(g||!e.initial)){const v=t().filter(S=>{var k;const Q=e.includeHiddenNodes?S.width&&S.height:!S.hidden;return(k=e.nodes)!=null&&k.length?Q&&e.nodes.some($=>$.id===S.id):Q}),y=v.every(S=>S.width&&S.height);if(v.length>0&&y){const S=oO(v,m),{x:Q,y:k,zoom:$}=AL(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),j=Di.translate(Q,k).scale($);return typeof e.duration=="number"&&e.duration>0?o.transform(Ol(u,e.duration),j):o.transform(u,j),!0}}return!1}function Ase(n,e){return n.forEach(t=>{const r=e.get(t.id);r&&e.set(r.id,{...r,[an]:r[an],selected:t.selected})}),new Map(e)}function qse(n,e){return e.map(t=>{const r=n.find(s=>s.id===t.id);return r&&(t.selected=r.selected),t})}function up({changedNodes:n,changedEdges:e,get:t,set:r}){const{nodeInternals:s,edges:i,onNodesChange:a,onEdgesChange:o,hasDefaultNodes:u,hasDefaultEdges:d}=t();n!=null&&n.length&&(u&&r({nodeInternals:Ase(n,s)}),a==null||a(n)),e!=null&&e.length&&(d&&r({edges:qse(e,i)}),o==null||o(e))}const Lo=()=>{},Mse={zoomIn:Lo,zoomOut:Lo,zoomTo:Lo,getZoom:()=>1,setViewport:Lo,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Lo,fitBounds:Lo,project:n=>n,screenToFlowPosition:n=>n,flowToScreenPosition:n=>n,viewportInitialized:!1},Xse=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection}),zse=()=>{const n=Nn(),{d3Zoom:e,d3Selection:t}=Xt(Xse,En);return P.useMemo(()=>t&&e?{zoomIn:s=>e.scaleBy(Ol(t,s==null?void 0:s.duration),1.2),zoomOut:s=>e.scaleBy(Ol(t,s==null?void 0:s.duration),1/1.2),zoomTo:(s,i)=>e.scaleTo(Ol(t,i==null?void 0:i.duration),s),getZoom:()=>n.getState().transform[2],setViewport:(s,i)=>{const[a,o,u]=n.getState().transform,d=Di.translate(s.x??a,s.y??o).scale(s.zoom??u);e.transform(Ol(t,i==null?void 0:i.duration),d)},getViewport:()=>{const[s,i,a]=n.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>HL(n.getState,s),setCenter:(s,i,a)=>{const{width:o,height:u,maxZoom:d}=n.getState(),p=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:d,m=o/2-s*p,g=u/2-i*p,x=Di.translate(m,g).scale(p);e.transform(Ol(t,a==null?void 0:a.duration),x)},fitBounds:(s,i)=>{const{width:a,height:o,minZoom:u,maxZoom:d}=n.getState(),{x:p,y:m,zoom:g}=AL(s,a,o,u,d,(i==null?void 0:i.padding)??.1),x=Di.translate(p,m).scale(g);e.transform(Ol(t,i==null?void 0:i.duration),x)},project:s=>{const{transform:i,snapToGrid:a,snapGrid:o}=n.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),M2(s,i,a,o)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:o,domNode:u}=n.getState();if(!u)return s;const{x:d,y:p}=u.getBoundingClientRect(),m={x:s.x-d,y:s.y-p};return M2(m,i,a,o)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=n.getState();if(!a)return s;const{x:o,y:u}=a.getBoundingClientRect(),d=CL(s,i);return{x:d.x+o,y:d.y+u}},viewportInitialized:!0}:Mse,[e,t])};function vk(){const n=zse(),e=Nn(),t=P.useCallback(()=>e.getState().getNodes().map(y=>({...y})),[]),r=P.useCallback(y=>e.getState().nodeInternals.get(y),[]),s=P.useCallback(()=>{const{edges:y=[]}=e.getState();return y.map(S=>({...S}))},[]),i=P.useCallback(y=>{const{edges:S=[]}=e.getState();return S.find(Q=>Q.id===y)},[]),a=P.useCallback(y=>{const{getNodes:S,setNodes:Q,hasDefaultNodes:k,onNodesChange:$}=e.getState(),j=S(),T=typeof y=="function"?y(j):y;if(k)Q(T);else if($){const R=T.length===0?j.map(N=>({type:"remove",id:N.id})):T.map(N=>({item:N,type:"reset"}));$(R)}},[]),o=P.useCallback(y=>{const{edges:S=[],setEdges:Q,hasDefaultEdges:k,onEdgesChange:$}=e.getState(),j=typeof y=="function"?y(S):y;if(k)Q(j);else if($){const T=j.length===0?S.map(R=>({type:"remove",id:R.id})):j.map(R=>({item:R,type:"reset"}));$(T)}},[]),u=P.useCallback(y=>{const S=Array.isArray(y)?y:[y],{getNodes:Q,setNodes:k,hasDefaultNodes:$,onNodesChange:j}=e.getState();if($){const R=[...Q(),...S];k(R)}else if(j){const T=S.map(R=>({item:R,type:"add"}));j(T)}},[]),d=P.useCallback(y=>{const S=Array.isArray(y)?y:[y],{edges:Q=[],setEdges:k,hasDefaultEdges:$,onEdgesChange:j}=e.getState();if($)k([...Q,...S]);else if(j){const T=S.map(R=>({item:R,type:"add"}));j(T)}},[]),p=P.useCallback(()=>{const{getNodes:y,edges:S=[],transform:Q}=e.getState(),[k,$,j]=Q;return{nodes:y().map(T=>({...T})),edges:S.map(T=>({...T})),viewport:{x:k,y:$,zoom:j}}},[]),m=P.useCallback(({nodes:y,edges:S})=>{const{nodeInternals:Q,getNodes:k,edges:$,hasDefaultNodes:j,hasDefaultEdges:T,onNodesDelete:R,onEdgesDelete:N,onNodesChange:q,onEdgesChange:z}=e.getState(),L=(y||[]).map(G=>G.id),E=(S||[]).map(G=>G.id),V=k().reduce((G,A)=>{const U=A.parentNode||A.parentId,H=!L.includes(A.id)&&U&&G.find(J=>J.id===U);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(L.includes(A.id)||H)&&G.push(A),G},[]),B=$.filter(G=>typeof G.deletable=="boolean"?G.deletable:!0),C=B.filter(G=>E.includes(G.id));if(V||C){const G=EL(V,B),A=[...C,...G],U=A.reduce((H,W)=>(H.includes(W.id)||H.push(W.id),H),[]);if((T||j)&&(T&&e.setState({edges:$.filter(H=>!U.includes(H.id))}),j&&(V.forEach(H=>{Q.delete(H.id)}),e.setState({nodeInternals:new Map(Q)}))),U.length>0&&(N==null||N(A),z&&z(U.map(H=>({id:H,type:"remove"})))),V.length>0&&(R==null||R(V),q)){const H=V.map(W=>({id:W.id,type:"remove"}));q(H)}}},[]),g=P.useCallback(y=>{const S=ase(y),Q=S?null:e.getState().nodeInternals.get(y.id);return!S&&!Q?[null,null,S]:[S?y:G4(Q),Q,S]},[]),x=P.useCallback((y,S=!0,Q)=>{const[k,$,j]=g(y);return k?(Q||e.getState().getNodes()).filter(T=>{if(!j&&(T.id===$.id||!T.positionAbsolute))return!1;const R=G4(T),N=R2(R,k);return S&&N>0||N>=k.width*k.height}):[]},[]),v=P.useCallback((y,S,Q=!0)=>{const[k]=g(y);if(!k)return!1;const $=R2(k,S);return Q&&$>0||$>=k.width*k.height},[]);return P.useMemo(()=>({...n,getNodes:t,getNode:r,getEdges:s,getEdge:i,setNodes:a,setEdges:o,addNodes:u,addEdges:d,toObject:p,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:v}),[n,t,r,s,i,a,o,u,d,p,m,x,v])}const Lse={actInsideInputWithModifier:!1};var Zse=({deleteKeyCode:n,multiSelectionKeyCode:e})=>{const t=Nn(),{deleteElements:r}=vk(),s=Bf(n,Lse),i=Bf(e);P.useEffect(()=>{if(s){const{edges:a,getNodes:o}=t.getState(),u=o().filter(p=>p.selected),d=a.filter(p=>p.selected);r({nodes:u,edges:d}),t.setState({nodesSelectionActive:!1})}},[s]),P.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])};function Vse(n){const e=Nn();P.useEffect(()=>{let t;const r=()=>{var i,a;if(!n.current)return;const s=hk(n.current);(s.height===0||s.width===0)&&((a=(i=e.getState()).onError)==null||a.call(i,"004",Gi.error004())),e.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),n.current&&(t=new ResizeObserver(()=>r()),t.observe(n.current)),()=>{window.removeEventListener("resize",r),t&&n.current&&t.unobserve(n.current)}},[])}const wk={position:"absolute",width:"100%",height:"100%",top:0,left:0},Yse=(n,e)=>n.x!==e.x||n.y!==e.y||n.zoom!==e.k,fp=n=>({x:n.x,y:n.y,zoom:n.k}),Zo=(n,e)=>n.target.closest(`.${e}`),sN=(n,e)=>e===2&&Array.isArray(n)&&n.includes(2),iN=n=>{const e=n.ctrlKey&&wm()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*e},Dse=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection,d3ZoomHandler:n.d3ZoomHandler,userSelectionActive:n.userSelectionActive}),Bse=({onMove:n,onMoveStart:e,onMoveEnd:t,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:u=$l.Free,zoomOnDoubleClick:d=!0,elementsSelectable:p,panOnDrag:m=!0,defaultViewport:g,translateExtent:x,minZoom:v,maxZoom:y,zoomActivationKeyCode:S,preventScrolling:Q=!0,children:k,noWheelClassName:$,noPanClassName:j})=>{const T=P.useRef(),R=Nn(),N=P.useRef(!1),q=P.useRef(!1),z=P.useRef(null),L=P.useRef({x:0,y:0,zoom:0}),{d3Zoom:E,d3Selection:V,d3ZoomHandler:B,userSelectionActive:C}=Xt(Dse,En),G=Bf(S),A=P.useRef(0),U=P.useRef(!1),H=P.useRef();return Vse(z),P.useEffect(()=>{if(z.current){const W=z.current.getBoundingClientRect(),J=bL().scaleExtent([v,y]).translateExtent(x),X=Wr(z.current).call(J),D=Di.translate(g.x,g.y).scale(Qc(g.zoom,v,y)),ee=[[0,0],[W.width,W.height]],Z=J.constrain()(D,ee,x);J.transform(X,Z),J.wheelDelta(iN),R.setState({d3Zoom:J,d3Selection:X,d3ZoomHandler:X.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:z.current.closest(".react-flow")})}},[]),P.useEffect(()=>{V&&E&&(a&&!G&&!C?V.on("wheel.zoom",W=>{if(Zo(W,$))return!1;W.preventDefault(),W.stopImmediatePropagation();const J=V.property("__zoom").k||1;if(W.ctrlKey&&i){const se=Qs(W),be=iN(W),$e=J*Math.pow(2,be);E.scaleTo(V,$e,se,W);return}const X=W.deltaMode===1?20:1;let D=u===$l.Vertical?0:W.deltaX*X,ee=u===$l.Horizontal?0:W.deltaY*X;!wm()&&W.shiftKey&&u!==$l.Vertical&&(D=W.deltaY*X,ee=0),E.translateBy(V,-(D/J)*o,-(ee/J)*o,{internal:!0});const Z=fp(V.property("__zoom")),{onViewportChangeStart:I,onViewportChange:K,onViewportChangeEnd:re}=R.getState();clearTimeout(H.current),U.current||(U.current=!0,e==null||e(W,Z),I==null||I(Z)),U.current&&(n==null||n(W,Z),K==null||K(Z),H.current=setTimeout(()=>{t==null||t(W,Z),re==null||re(Z),U.current=!1},150))},{passive:!1}):typeof B<"u"&&V.on("wheel.zoom",function(W,J){if(!Q&&W.type==="wheel"&&!W.ctrlKey||Zo(W,$))return null;W.preventDefault(),B.call(this,W,J)},{passive:!1}))},[C,a,u,V,E,B,G,i,Q,$,e,n,t]),P.useEffect(()=>{E&&E.on("start",W=>{var D,ee;if(!W.sourceEvent||W.sourceEvent.internal)return null;A.current=(D=W.sourceEvent)==null?void 0:D.button;const{onViewportChangeStart:J}=R.getState(),X=fp(W.transform);N.current=!0,L.current=X,((ee=W.sourceEvent)==null?void 0:ee.type)==="mousedown"&&R.setState({paneDragging:!0}),J==null||J(X),e==null||e(W.sourceEvent,X)})},[E,e]),P.useEffect(()=>{E&&(C&&!N.current?E.on("zoom",null):C||E.on("zoom",W=>{var X;const{onViewportChange:J}=R.getState();if(R.setState({transform:[W.transform.x,W.transform.y,W.transform.k]}),q.current=!!(r&&sN(m,A.current??0)),(n||J)&&!((X=W.sourceEvent)!=null&&X.internal)){const D=fp(W.transform);J==null||J(D),n==null||n(W.sourceEvent,D)}}))},[C,E,n,m,r]),P.useEffect(()=>{E&&E.on("end",W=>{if(!W.sourceEvent||W.sourceEvent.internal)return null;const{onViewportChangeEnd:J}=R.getState();if(N.current=!1,R.setState({paneDragging:!1}),r&&sN(m,A.current??0)&&!q.current&&r(W.sourceEvent),q.current=!1,(t||J)&&Yse(L.current,W.transform)){const X=fp(W.transform);L.current=X,clearTimeout(T.current),T.current=setTimeout(()=>{J==null||J(X),t==null||t(W.sourceEvent,X)},a?150:0)}})},[E,a,m,t,r]),P.useEffect(()=>{E&&E.filter(W=>{const J=G||s,X=i&&W.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&W.button===1&&W.type==="mousedown"&&(Zo(W,"react-flow__node")||Zo(W,"react-flow__edge")))return!0;if(!m&&!J&&!a&&!d&&!i||C||!d&&W.type==="dblclick"||Zo(W,$)&&W.type==="wheel"||Zo(W,j)&&(W.type!=="wheel"||a&&W.type==="wheel"&&!G)||!i&&W.ctrlKey&&W.type==="wheel"||!J&&!a&&!X&&W.type==="wheel"||!m&&(W.type==="mousedown"||W.type==="touchstart")||Array.isArray(m)&&!m.includes(W.button)&&W.type==="mousedown")return!1;const D=Array.isArray(m)&&m.includes(W.button)||!W.button||W.button<=1;return(!W.ctrlKey||W.type==="wheel")&&D})},[C,E,s,i,a,d,m,p,G]),ue.createElement("div",{className:"react-flow__renderer",ref:z,style:wk},k)},Use=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function Wse(){const{userSelectionActive:n,userSelectionRect:e}=Xt(Use,En);return n&&e?ue.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function aN(n,e){const t=e.parentNode||e.parentId,r=n.find(s=>s.id===t);if(r){const s=e.position.x+e.width-r.width,i=e.position.y+e.height-r.height;if(s>0||i>0||e.position.x<0||e.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),i>0&&(r.style.height+=i),e.position.x<0){const a=Math.abs(e.position.x);r.position.x=r.position.x-a,r.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);r.position.y=r.position.y-a,r.style.height+=a,e.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function FL(n,e){if(n.some(r=>r.type==="reset"))return n.filter(r=>r.type==="reset").map(r=>r.item);const t=n.filter(r=>r.type==="add").map(r=>r.item);return e.reduce((r,s)=>{const i=n.filter(o=>o.id===s.id);if(i.length===0)return r.push(s),r;const a={...s};for(const o of i)if(o)switch(o.type){case"select":{a.selected=o.selected;break}case"position":{typeof o.position<"u"&&(a.position=o.position),typeof o.positionAbsolute<"u"&&(a.positionAbsolute=o.positionAbsolute),typeof o.dragging<"u"&&(a.dragging=o.dragging),a.expandParent&&aN(r,a);break}case"dimensions":{typeof o.dimensions<"u"&&(a.width=o.dimensions.width,a.height=o.dimensions.height),typeof o.updateStyle<"u"&&(a.style={...a.style||{},...o.dimensions}),typeof o.resizing=="boolean"&&(a.resizing=o.resizing),a.expandParent&&aN(r,a);break}case"remove":return r}return r.push(a),r},t)}function KL(n,e){return FL(n,e)}function Gse(n,e){return FL(n,e)}const _a=(n,e)=>({id:n,type:"select",selected:e});function Ko(n,e){return n.reduce((t,r)=>{const s=e.includes(r.id);return!r.selected&&s?(r.selected=!0,t.push(_a(r.id,!0))):r.selected&&!s&&(r.selected=!1,t.push(_a(r.id,!1))),t},[])}const Wx=(n,e)=>t=>{t.target===e.current&&(n==null||n(t))},Ise=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}),JL=P.memo(({isSelecting:n,selectionMode:e=Df.Full,panOnDrag:t,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:o,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:p,children:m})=>{const g=P.useRef(null),x=Nn(),v=P.useRef(0),y=P.useRef(0),S=P.useRef(),{userSelectionActive:Q,elementsSelectable:k,dragging:$}=Xt(Ise,En),j=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,y.current=0},T=B=>{i==null||i(B),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},R=B=>{if(Array.isArray(t)&&(t!=null&&t.includes(2))){B.preventDefault();return}a==null||a(B)},N=o?B=>o(B):void 0,q=B=>{const{resetSelectedElements:C,domNode:G}=x.getState();if(S.current=G==null?void 0:G.getBoundingClientRect(),!k||!n||B.button!==0||B.target!==g.current||!S.current)return;const{x:A,y:U}=qa(B,S.current);C(),x.setState({userSelectionRect:{width:0,height:0,startX:A,startY:U,x:A,y:U}}),r==null||r(B)},z=B=>{const{userSelectionRect:C,nodeInternals:G,edges:A,transform:U,onNodesChange:H,onEdgesChange:W,nodeOrigin:J,getNodes:X}=x.getState();if(!n||!S.current||!C)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const D=qa(B,S.current),ee=C.startX??0,Z=C.startY??0,I={...C,x:D.x<ee?D.x:ee,y:D.y<Z?D.y:Z,width:Math.abs(D.x-ee),height:Math.abs(D.y-Z)},K=X(),re=RL(G,I,U,e===Df.Partial,!0,J),se=EL(re,A).map($e=>$e.id),be=re.map($e=>$e.id);if(v.current!==be.length){v.current=be.length;const $e=Ko(K,be);$e.length&&(H==null||H($e))}if(y.current!==se.length){y.current=se.length;const $e=Ko(A,se);$e.length&&(W==null||W($e))}x.setState({userSelectionRect:I})},L=B=>{if(B.button!==0)return;const{userSelectionRect:C}=x.getState();!Q&&C&&B.target===g.current&&(T==null||T(B)),x.setState({nodesSelectionActive:v.current>0}),j(),s==null||s(B)},E=B=>{Q&&(x.setState({nodesSelectionActive:v.current>0}),s==null||s(B)),j()},V=k&&(n||Q);return ue.createElement("div",{className:Yn(["react-flow__pane",{dragging:$,selection:n}]),onClick:V?void 0:Wx(T,g),onContextMenu:Wx(R,g),onWheel:Wx(N,g),onMouseEnter:V?void 0:u,onMouseDown:V?q:void 0,onMouseMove:V?z:d,onMouseUp:V?L:void 0,onMouseLeave:V?E:p,ref:g,style:wk},m,ue.createElement(Wse,null))});JL.displayName="Pane";function eZ(n,e){const t=n.parentNode||n.parentId;if(!t)return!1;const r=e.get(t);return r?r.selected?!0:eZ(r,e):!1}function lN(n,e,t){let r=n;do{if(r!=null&&r.matches(e))return!0;if(r===t.current)return!1;r=r.parentElement}while(r);return!1}function Hse(n,e,t,r){return Array.from(n.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!eZ(s,n))&&(s.draggable||e&&typeof s.draggable>"u")).map(s=>{var i,a;return{id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:t.x-(((i=s.positionAbsolute)==null?void 0:i.x)??0),y:t.y-(((a=s.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}})}function Fse(n,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(n.width||0),e[1][1]-(n.height||0)]]}function tZ(n,e,t,r,s=[0,0],i){const a=Fse(n,n.extent||r);let o=a;const u=n.parentNode||n.parentId;if(n.extent==="parent"&&!n.expandParent)if(u&&n.width&&n.height){const m=t.get(u),{x:g,y:x}=Nl(m,s).positionAbsolute;o=m&&Jr(g)&&Jr(x)&&Jr(m.width)&&Jr(m.height)?[[g+n.width*s[0],x+n.height*s[1]],[g+m.width-n.width+n.width*s[0],x+m.height-n.height+n.height*s[1]]]:o}else i==null||i("005",Gi.error005()),o=a;else if(n.extent&&u&&n.extent!=="parent"){const m=t.get(u),{x:g,y:x}=Nl(m,s).positionAbsolute;o=[[n.extent[0][0]+g,n.extent[0][1]+x],[n.extent[1][0]+g,n.extent[1][1]+x]]}let d={x:0,y:0};if(u){const m=t.get(u);d=Nl(m,s).positionAbsolute}const p=o&&o!=="parent"?pk(e,o):e;return{position:{x:p.x-d.x,y:p.y-d.y},positionAbsolute:p}}function Gx({nodeId:n,dragItems:e,nodeInternals:t}){const r=e.map(s=>({...t.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[n?r.find(s=>s.id===n):r[0],r]}const oN=(n,e,t,r)=>{const s=e.querySelectorAll(n);if(!s||!s.length)return null;const i=Array.from(s),a=e.getBoundingClientRect(),o={x:a.width*r[0],y:a.height*r[1]};return i.map(u=>{const d=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),position:u.getAttribute("data-handlepos"),x:(d.left-a.left-o.x)/t,y:(d.top-a.top-o.y)/t,...hk(u)}})};function Wu(n,e,t){return t===void 0?t:r=>{const s=e().nodeInternals.get(n);s&&t(r,{...s})}}function z2({id:n,store:e,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:o,onError:u}=e.getState(),d=o.get(n);if(!d){u==null||u("012",Gi.error012(n));return}e.setState({nodesSelectionActive:!1}),d.selected?(t||d.selected&&a)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([n])}function Kse(){const n=Nn();return P.useCallback(({sourceEvent:t})=>{const{transform:r,snapGrid:s,snapToGrid:i}=n.getState(),a=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,u={x:(a-r[0])/r[2],y:(o-r[1])/r[2]};return{xSnapped:i?s[0]*Math.round(u.x/s[0]):u.x,ySnapped:i?s[1]*Math.round(u.y/s[1]):u.y,...u}},[])}function Ix(n){return(e,t,r)=>n==null?void 0:n(e,r)}function nZ({nodeRef:n,disabled:e=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const o=Nn(),[u,d]=P.useState(!1),p=P.useRef([]),m=P.useRef({x:null,y:null}),g=P.useRef(0),x=P.useRef(null),v=P.useRef({x:0,y:0}),y=P.useRef(null),S=P.useRef(!1),Q=P.useRef(!1),k=P.useRef(!1),$=Kse();return P.useEffect(()=>{if(n!=null&&n.current){const j=Wr(n.current),T=({x:q,y:z})=>{const{nodeInternals:L,onNodeDrag:E,onSelectionDrag:V,updateNodePositions:B,nodeExtent:C,snapGrid:G,snapToGrid:A,nodeOrigin:U,onError:H}=o.getState();m.current={x:q,y:z};let W=!1,J={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&C){const D=oO(p.current,U);J=Yf(D)}if(p.current=p.current.map(D=>{const ee={x:q-D.distance.x,y:z-D.distance.y};A&&(ee.x=G[0]*Math.round(ee.x/G[0]),ee.y=G[1]*Math.round(ee.y/G[1]));const Z=[[C[0][0],C[0][1]],[C[1][0],C[1][1]]];p.current.length>1&&C&&!D.extent&&(Z[0][0]=D.positionAbsolute.x-J.x+C[0][0],Z[1][0]=D.positionAbsolute.x+(D.width??0)-J.x2+C[1][0],Z[0][1]=D.positionAbsolute.y-J.y+C[0][1],Z[1][1]=D.positionAbsolute.y+(D.height??0)-J.y2+C[1][1]);const I=tZ(D,ee,L,Z,U,H);return W=W||D.position.x!==I.position.x||D.position.y!==I.position.y,D.position=I.position,D.positionAbsolute=I.positionAbsolute,D}),!W)return;B(p.current,!0,!0),d(!0);const X=s?E:Ix(V);if(X&&y.current){const[D,ee]=Gx({nodeId:s,dragItems:p.current,nodeInternals:L});X(y.current,D,ee)}},R=()=>{if(!x.current)return;const[q,z]=vL(v.current,x.current);if(q!==0||z!==0){const{transform:L,panBy:E}=o.getState();m.current.x=(m.current.x??0)-q/L[2],m.current.y=(m.current.y??0)-z/L[2],E({x:q,y:z})&&T(m.current)}g.current=requestAnimationFrame(R)},N=q=>{var U;const{nodeInternals:z,multiSelectionActive:L,nodesDraggable:E,unselectNodesAndEdges:V,onNodeDragStart:B,onSelectionDragStart:C}=o.getState();Q.current=!0;const G=s?B:Ix(C);(!a||!i)&&!L&&s&&((U=z.get(s))!=null&&U.selected||V()),s&&i&&a&&z2({id:s,store:o,nodeRef:n});const A=$(q);if(m.current=A,p.current=Hse(z,E,A,s),G&&p.current){const[H,W]=Gx({nodeId:s,dragItems:p.current,nodeInternals:z});G(q.sourceEvent,H,W)}};if(e)j.on(".drag",null);else{const q=une().on("start",z=>{const{domNode:L,nodeDragThreshold:E}=o.getState();E===0&&N(z),k.current=!1;const V=$(z);m.current=V,x.current=(L==null?void 0:L.getBoundingClientRect())||null,v.current=qa(z.sourceEvent,x.current)}).on("drag",z=>{var B,C;const L=$(z),{autoPanOnNodeDrag:E,nodeDragThreshold:V}=o.getState();if(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1&&(k.current=!0),!k.current){if(!S.current&&Q.current&&E&&(S.current=!0,R()),!Q.current){const G=L.xSnapped-(((B=m==null?void 0:m.current)==null?void 0:B.x)??0),A=L.ySnapped-(((C=m==null?void 0:m.current)==null?void 0:C.y)??0);Math.sqrt(G*G+A*A)>V&&N(z)}(m.current.x!==L.xSnapped||m.current.y!==L.ySnapped)&&p.current&&Q.current&&(y.current=z.sourceEvent,v.current=qa(z.sourceEvent,x.current),T(L))}}).on("end",z=>{if(!(!Q.current||k.current)&&(d(!1),S.current=!1,Q.current=!1,cancelAnimationFrame(g.current),p.current)){const{updateNodePositions:L,nodeInternals:E,onNodeDragStop:V,onSelectionDragStop:B}=o.getState(),C=s?V:Ix(B);if(L(p.current,!1,!1),C){const[G,A]=Gx({nodeId:s,dragItems:p.current,nodeInternals:E});C(z.sourceEvent,G,A)}}}).filter(z=>{const L=z.target;return!z.button&&(!t||!lN(L,`.${t}`,n))&&(!r||lN(L,r,n))});return j.call(q),()=>{j.on(".drag",null)}}}},[n,e,t,r,i,o,s,a,$]),u}function rZ(){const n=Nn();return P.useCallback(t=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:o,snapGrid:u,onError:d,nodesDraggable:p}=n.getState(),m=a().filter(k=>k.selected&&(k.draggable||p&&typeof k.draggable>"u")),g=o?u[0]:5,x=o?u[1]:5,v=t.isShiftPressed?4:1,y=t.x*g*v,S=t.y*x*v,Q=m.map(k=>{if(k.positionAbsolute){const $={x:k.positionAbsolute.x+y,y:k.positionAbsolute.y+S};o&&($.x=u[0]*Math.round($.x/u[0]),$.y=u[1]*Math.round($.y/u[1]));const{positionAbsolute:j,position:T}=tZ(k,$,r,s,void 0,d);k.position=T,k.positionAbsolute=j}return k});i(Q,!0,!1)},[])}const uc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Gu=n=>{const e=({id:t,type:r,data:s,xPos:i,yPos:a,xPosOrigin:o,yPosOrigin:u,selected:d,onClick:p,onMouseEnter:m,onMouseMove:g,onMouseLeave:x,onContextMenu:v,onDoubleClick:y,style:S,className:Q,isDraggable:k,isSelectable:$,isConnectable:j,isFocusable:T,selectNodesOnDrag:R,sourcePosition:N,targetPosition:q,hidden:z,resizeObserver:L,dragHandle:E,zIndex:V,isParent:B,noDragClassName:C,noPanClassName:G,initialized:A,disableKeyboardA11y:U,ariaLabel:H,rfId:W,hasHandleBounds:J})=>{const X=Nn(),D=P.useRef(null),ee=P.useRef(null),Z=P.useRef(N),I=P.useRef(q),K=P.useRef(r),re=$||k||p||m||g||x,se=rZ(),be=Wu(t,X.getState,m),$e=Wu(t,X.getState,g),Xe=Wu(t,X.getState,x),ae=Wu(t,X.getState,v),Qe=Wu(t,X.getState,y),Oe=Te=>{const{nodeDragThreshold:ge}=X.getState();if($&&(!R||!k||ge>0)&&z2({id:t,store:X,nodeRef:D}),p){const Ke=X.getState().nodeInternals.get(t);Ke&&p(Te,{...Ke})}},ye=Te=>{if(!E2(Te)&&!U)if(kL.includes(Te.key)&&$){const ge=Te.key==="Escape";z2({id:t,store:X,unselect:ge,nodeRef:D})}else k&&d&&Object.prototype.hasOwnProperty.call(uc,Te.key)&&(X.setState({ariaLiveMessage:`Moved selected node ${Te.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),se({x:uc[Te.key].x,y:uc[Te.key].y,isShiftPressed:Te.shiftKey}))};P.useEffect(()=>()=>{ee.current&&(L==null||L.unobserve(ee.current),ee.current=null)},[]),P.useEffect(()=>{if(D.current&&!z){const Te=D.current;(!A||!J||ee.current!==Te)&&(ee.current&&(L==null||L.unobserve(ee.current)),L==null||L.observe(Te),ee.current=Te)}},[z,A,J]),P.useEffect(()=>{const Te=K.current!==r,ge=Z.current!==N,Ke=I.current!==q;D.current&&(Te||ge||Ke)&&(Te&&(K.current=r),ge&&(Z.current=N),Ke&&(I.current=q),X.getState().updateNodeDimensions([{id:t,nodeElement:D.current,forceUpdate:!0}]))},[t,r,N,q]);const Fe=nZ({nodeRef:D,disabled:z||!k,noDragClassName:C,handleSelector:E,nodeId:t,isSelectable:$,selectNodesOnDrag:R});return z?null:ue.createElement("div",{className:Yn(["react-flow__node",`react-flow__node-${r}`,{[G]:k},Q,{selected:d,selectable:$,parent:B,dragging:Fe}]),ref:D,style:{zIndex:V,transform:`translate(${o}px,${u}px)`,pointerEvents:re?"all":"none",visibility:A?"visible":"hidden",...S},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:be,onMouseMove:$e,onMouseLeave:Xe,onContextMenu:ae,onClick:Oe,onDoubleClick:Qe,onKeyDown:T?ye:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":U?void 0:`${UL}-${W}`,"aria-label":H},ue.createElement(hse,{value:t},ue.createElement(n,{id:t,data:s,type:r,xPos:i,yPos:a,selected:d,isConnectable:j,sourcePosition:N,targetPosition:q,dragging:Fe,dragHandle:E,zIndex:V})))};return e.displayName="NodeWrapper",P.memo(e)};const Jse=n=>{const e=n.getNodes().filter(t=>t.selected);return{...oO(e,n.nodeOrigin),transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`,userSelectionActive:n.userSelectionActive}};function eie({onSelectionContextMenu:n,noPanClassName:e,disableKeyboardA11y:t}){const r=Nn(),{width:s,height:i,x:a,y:o,transformString:u,userSelectionActive:d}=Xt(Jse,En),p=rZ(),m=P.useRef(null);if(P.useEffect(()=>{var v;t||(v=m.current)==null||v.focus({preventScroll:!0})},[t]),nZ({nodeRef:m}),d||!s||!i)return null;const g=n?v=>{const y=r.getState().getNodes().filter(S=>S.selected);n(v,y)}:void 0,x=v=>{Object.prototype.hasOwnProperty.call(uc,v.key)&&p({x:uc[v.key].x,y:uc[v.key].y,isShiftPressed:v.shiftKey})};return ue.createElement("div",{className:Yn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:u}},ue.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:t?void 0:-1,onKeyDown:t?void 0:x,style:{width:s,height:i,top:o,left:a}}))}var tie=P.memo(eie);const nie=n=>n.nodesSelectionActive,sZ=({children:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:o,onMove:u,onMoveStart:d,onMoveEnd:p,selectionKeyCode:m,selectionOnDrag:g,selectionMode:x,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:S,panActivationKeyCode:Q,zoomActivationKeyCode:k,elementsSelectable:$,zoomOnScroll:j,zoomOnPinch:T,panOnScroll:R,panOnScrollSpeed:N,panOnScrollMode:q,zoomOnDoubleClick:z,panOnDrag:L,defaultViewport:E,translateExtent:V,minZoom:B,maxZoom:C,preventScrolling:G,onSelectionContextMenu:A,noWheelClassName:U,noPanClassName:H,disableKeyboardA11y:W})=>{const J=Xt(nie),X=Bf(m),D=Bf(Q),ee=D||L,Z=D||R,I=X||g&&ee!==!0;return Zse({deleteKeyCode:o,multiSelectionKeyCode:S}),ue.createElement(Bse,{onMove:u,onMoveStart:d,onMoveEnd:p,onPaneContextMenu:i,elementsSelectable:$,zoomOnScroll:j,zoomOnPinch:T,panOnScroll:Z,panOnScrollSpeed:N,panOnScrollMode:q,zoomOnDoubleClick:z,panOnDrag:!X&&ee,defaultViewport:E,translateExtent:V,minZoom:B,maxZoom:C,zoomActivationKeyCode:k,preventScrolling:G,noWheelClassName:U,noPanClassName:H},ue.createElement(JL,{onSelectionStart:v,onSelectionEnd:y,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ee,isSelecting:!!I,selectionMode:x},n,J&&ue.createElement(tie,{onSelectionContextMenu:A,noPanClassName:H,disableKeyboardA11y:W})))};sZ.displayName="FlowRenderer";var rie=P.memo(sZ);function sie(n){return Xt(P.useCallback(t=>n?RL(t.nodeInternals,{x:0,y:0,width:t.width,height:t.height},t.transform,!0):t.getNodes(),[n]))}function iie(n){const e={input:Gu(n.input||VL),default:Gu(n.default||X2),output:Gu(n.output||DL),group:Gu(n.group||yk)},t={},r=Object.keys(n).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=Gu(n[i]||X2),s),t);return{...e,...r}}const aie=({x:n,y:e,width:t,height:r,origin:s})=>!t||!r?{x:n,y:e}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:n,y:e}:{x:n-t*s[0],y:e-r*s[1]},lie=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,updateNodeDimensions:n.updateNodeDimensions,onError:n.onError}),iZ=n=>{const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=Xt(lie,En),o=sie(n.onlyRenderVisibleElements),u=P.useRef(),d=P.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const p=new ResizeObserver(m=>{const g=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(g)});return u.current=p,p},[]);return P.useEffect(()=>()=>{var p;(p=u==null?void 0:u.current)==null||p.disconnect()},[]),ue.createElement("div",{className:"react-flow__nodes",style:wk},o.map(p=>{var T,R,N;let m=p.type||"default";n.nodeTypes[m]||(a==null||a("003",Gi.error003(m)),m="default");const g=n.nodeTypes[m]||n.nodeTypes.default,x=!!(p.draggable||e&&typeof p.draggable>"u"),v=!!(p.selectable||s&&typeof p.selectable>"u"),y=!!(p.connectable||t&&typeof p.connectable>"u"),S=!!(p.focusable||r&&typeof p.focusable>"u"),Q=n.nodeExtent?pk(p.positionAbsolute,n.nodeExtent):p.positionAbsolute,k=(Q==null?void 0:Q.x)??0,$=(Q==null?void 0:Q.y)??0,j=aie({x:k,y:$,width:p.width??0,height:p.height??0,origin:n.nodeOrigin});return ue.createElement(g,{key:p.id,id:p.id,className:p.className,style:p.style,type:m,data:p.data,sourcePosition:p.sourcePosition||ze.Bottom,targetPosition:p.targetPosition||ze.Top,hidden:p.hidden,xPos:k,yPos:$,xPosOrigin:j.x,yPosOrigin:j.y,selectNodesOnDrag:n.selectNodesOnDrag,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,selected:!!p.selected,isDraggable:x,isSelectable:v,isConnectable:y,isFocusable:S,resizeObserver:d,dragHandle:p.dragHandle,zIndex:((T=p[an])==null?void 0:T.z)??0,isParent:!!((R=p[an])!=null&&R.isParent),noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,initialized:!!p.width&&!!p.height,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,ariaLabel:p.ariaLabel,hasHandleBounds:!!((N=p[an])!=null&&N.handleBounds)})}))};iZ.displayName="NodeRenderer";var oie=P.memo(iZ);const cie=(n,e,t)=>t===ze.Left?n-e:t===ze.Right?n+e:n,uie=(n,e,t)=>t===ze.Top?n-e:t===ze.Bottom?n+e:n,cN="react-flow__edgeupdater",uN=({position:n,centerX:e,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o})=>ue.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Yn([cN,`${cN}-${o}`]),cx:cie(e,r,n),cy:uie(t,r,n),r,stroke:"transparent",fill:"transparent"}),fie=()=>!0;var Vo=n=>{const e=({id:t,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:o,selected:u,animated:d,label:p,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:v,labelBgBorderRadius:y,style:S,source:Q,target:k,sourceX:$,sourceY:j,targetX:T,targetY:R,sourcePosition:N,targetPosition:q,elementsSelectable:z,hidden:L,sourceHandleId:E,targetHandleId:V,onContextMenu:B,onMouseEnter:C,onMouseMove:G,onMouseLeave:A,reconnectRadius:U,onReconnect:H,onReconnectStart:W,onReconnectEnd:J,markerEnd:X,markerStart:D,rfId:ee,ariaLabel:Z,isFocusable:I,isReconnectable:K,pathOptions:re,interactionWidth:se,disableKeyboardA11y:be})=>{const $e=P.useRef(null),[Xe,ae]=P.useState(!1),[Qe,Oe]=P.useState(!1),ye=Nn(),Fe=P.useMemo(()=>`url('#${q2(D,ee)}')`,[D,ee]),Te=P.useMemo(()=>`url('#${q2(X,ee)}')`,[X,ee]);if(L)return null;const ge=pt=>{var Be;const{edges:Lt,addSelectedEdges:ct,unselectNodesAndEdges:de,multiSelectionActive:we}=ye.getState(),ke=Lt.find(Qn=>Qn.id===t);ke&&(z&&(ye.setState({nodesSelectionActive:!1}),ke.selected&&we?(de({nodes:[],edges:[ke]}),(Be=$e.current)==null||Be.blur()):ct([t])),a&&a(pt,ke))},Ke=Uu(t,ye.getState,o),ot=Uu(t,ye.getState,B),st=Uu(t,ye.getState,C),ht=Uu(t,ye.getState,G),Je=Uu(t,ye.getState,A),tt=(pt,Lt)=>{if(pt.button!==0)return;const{edges:ct,isValidConnection:de}=ye.getState(),we=Lt?k:Q,ke=(Lt?V:E)||null,Be=Lt?"target":"source",Qn=de||fie,Dt=Lt,kn=ct.find(on=>on.id===t);Oe(!0),W==null||W(pt,kn,Be);const Zt=on=>{Oe(!1),J==null||J(on,kn,Be)};XL({event:pt,handleId:ke,nodeId:we,onConnect:on=>H==null?void 0:H(kn,on),isTarget:Dt,getState:ye.getState,setState:ye.setState,isValidConnection:Qn,edgeUpdaterType:Be,onReconnectEnd:Zt})},hn=pt=>tt(pt,!0),Qt=pt=>tt(pt,!1),zt=()=>ae(!0),St=()=>ae(!1),en=!z&&!a,ln=pt=>{var Lt;if(!be&&kL.includes(pt.key)&&z){const{unselectNodesAndEdges:ct,addSelectedEdges:de,edges:we}=ye.getState();pt.key==="Escape"?((Lt=$e.current)==null||Lt.blur(),ct({edges:[we.find(Be=>Be.id===t)]})):de([t])}};return ue.createElement("g",{className:Yn(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:u,animated:d,inactive:en,updating:Xe}]),onClick:ge,onDoubleClick:Ke,onContextMenu:ot,onMouseEnter:st,onMouseMove:ht,onMouseLeave:Je,onKeyDown:I?ln:void 0,tabIndex:I?0:void 0,role:I?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":Z===null?void 0:Z||`Edge from ${Q} to ${k}`,"aria-describedby":I?`${WL}-${ee}`:void 0,ref:$e},!Qe&&ue.createElement(n,{id:t,source:Q,target:k,selected:u,animated:d,label:p,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:v,labelBgBorderRadius:y,data:i,style:S,sourceX:$,sourceY:j,targetX:T,targetY:R,sourcePosition:N,targetPosition:q,sourceHandleId:E,targetHandleId:V,markerStart:Fe,markerEnd:Te,pathOptions:re,interactionWidth:se}),K&&ue.createElement(ue.Fragment,null,(K==="source"||K===!0)&&ue.createElement(uN,{position:N,centerX:$,centerY:j,radius:U,onMouseDown:hn,onMouseEnter:zt,onMouseOut:St,type:"source"}),(K==="target"||K===!0)&&ue.createElement(uN,{position:q,centerX:T,centerY:R,radius:U,onMouseDown:Qt,onMouseEnter:zt,onMouseOut:St,type:"target"})))};return e.displayName="EdgeWrapper",P.memo(e)};function die(n){const e={default:Vo(n.default||Sm),straight:Vo(n.bezier||gk),step:Vo(n.step||Ok),smoothstep:Vo(n.step||lO),simplebezier:Vo(n.simplebezier||mk)},t={},r=Object.keys(n).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=Vo(n[i]||Sm),s),t);return{...e,...r}}function fN(n,e,t=null){const r=((t==null?void 0:t.x)||0)+e.x,s=((t==null?void 0:t.y)||0)+e.y,i=(t==null?void 0:t.width)||e.width,a=(t==null?void 0:t.height)||e.height;switch(n){case ze.Top:return{x:r+i/2,y:s};case ze.Right:return{x:r+i,y:s+a/2};case ze.Bottom:return{x:r+i/2,y:s+a};case ze.Left:return{x:r,y:s+a/2}}}function dN(n,e){return n?n.length===1||!e?n[0]:e&&n.find(t=>t.id===e)||null:null}const hie=(n,e,t,r,s,i)=>{const a=fN(t,n,e),o=fN(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:o.x,targetY:o.y}};function pie({sourcePos:n,targetPos:e,sourceWidth:t,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:o,transform:u}){const d={x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x+t,e.x+s),y2:Math.max(n.y+r,e.y+i)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const p=Yf({x:(0-u[0])/u[2],y:(0-u[1])/u[2],width:a/u[2],height:o/u[2]}),m=Math.max(0,Math.min(p.x2,d.x2)-Math.max(p.x,d.x)),g=Math.max(0,Math.min(p.y2,d.y2)-Math.max(p.y,d.y));return Math.ceil(m*g)>0}function hN(n){var r,s,i,a,o;const e=((r=n==null?void 0:n[an])==null?void 0:r.handleBounds)||null,t=e&&(n==null?void 0:n.width)&&(n==null?void 0:n.height)&&typeof((s=n==null?void 0:n.positionAbsolute)==null?void 0:s.x)<"u"&&typeof((i=n==null?void 0:n.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((a=n==null?void 0:n.positionAbsolute)==null?void 0:a.x)||0,y:((o=n==null?void 0:n.positionAbsolute)==null?void 0:o.y)||0,width:(n==null?void 0:n.width)||0,height:(n==null?void 0:n.height)||0},e,!!t]}const mie=[{level:0,isMaxLevel:!0,edges:[]}];function Oie(n,e,t=!1){let r=-1;const s=n.reduce((a,o)=>{var p,m;const u=Jr(o.zIndex);let d=u?o.zIndex:0;if(t){const g=e.get(o.target),x=e.get(o.source),v=o.selected||(g==null?void 0:g.selected)||(x==null?void 0:x.selected),y=Math.max(((p=x==null?void 0:x[an])==null?void 0:p.z)||0,((m=g==null?void 0:g[an])==null?void 0:m.z)||0,1e3);d=(u?o.zIndex:0)+(v?y:0)}return a[d]?a[d].push(o):a[d]=[o],r=d>r?d:r,a},{}),i=Object.entries(s).map(([a,o])=>{const u=+a;return{edges:o,level:u,isMaxLevel:u===r}});return i.length===0?mie:i}function gie(n,e,t){const r=Xt(P.useCallback(s=>n?s.edges.filter(i=>{const a=e.get(i.source),o=e.get(i.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&pie({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:o.width,targetHeight:o.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[n,e]));return Oie(r,e,t)}const xie=({color:n="none",strokeWidth:e=1})=>ue.createElement("polyline",{style:{stroke:n,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),bie=({color:n="none",strokeWidth:e=1})=>ue.createElement("polyline",{style:{stroke:n,fill:n,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),pN={[Pl.Arrow]:xie,[Pl.ArrowClosed]:bie};function yie(n){const e=Nn();return P.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(pN,n)?pN[n]:((i=(s=e.getState()).onError)==null||i.call(s,"009",Gi.error009(n)),null)},[n])}const vie=({id:n,type:e,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const u=yie(e);return u?ue.createElement("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0"},ue.createElement(u,{color:t,strokeWidth:a})):null},wie=({defaultColor:n,rfId:e})=>t=>{const r=[];return t.edges.reduce((s,i)=>([i.markerStart,i.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const o=q2(a,e);r.includes(o)||(s.push({id:o,color:a.color||n,...a}),r.push(o))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},aZ=({defaultColor:n,rfId:e})=>{const t=Xt(P.useCallback(wie({defaultColor:n,rfId:e}),[n,e]),(r,s)=>!(r.length!==s.length||r.some((i,a)=>i.id!==s[a].id)));return ue.createElement("defs",null,t.map(r=>ue.createElement(vie,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};aZ.displayName="MarkerDefinitions";var Sie=P.memo(aZ);const Qie=n=>({nodesConnectable:n.nodesConnectable,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,width:n.width,height:n.height,connectionMode:n.connectionMode,nodeInternals:n.nodeInternals,onError:n.onError}),lZ=({defaultMarkerColor:n,onlyRenderVisibleElements:e,elevateEdgesOnSelect:t,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:p,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,reconnectRadius:y,children:S,disableKeyboardA11y:Q})=>{const{edgesFocusable:k,edgesUpdatable:$,elementsSelectable:j,width:T,height:R,connectionMode:N,nodeInternals:q,onError:z}=Xt(Qie,En),L=gie(e,q,t);return T?ue.createElement(ue.Fragment,null,L.map(({level:E,edges:V,isMaxLevel:B})=>ue.createElement("svg",{key:E,style:{zIndex:E},width:T,height:R,className:"react-flow__edges react-flow__container"},B&&ue.createElement(Sie,{defaultColor:n,rfId:r}),ue.createElement("g",null,V.map(C=>{const[G,A,U]=hN(q.get(C.source)),[H,W,J]=hN(q.get(C.target));if(!U||!J)return null;let X=C.type||"default";s[X]||(z==null||z("011",Gi.error011(X)),X="default");const D=s[X]||s.default,ee=N===Ii.Strict?W.target:(W.target??[]).concat(W.source??[]),Z=dN(A.source,C.sourceHandle),I=dN(ee,C.targetHandle),K=(Z==null?void 0:Z.position)||ze.Bottom,re=(I==null?void 0:I.position)||ze.Top,se=!!(C.focusable||k&&typeof C.focusable>"u"),be=C.reconnectable||C.updatable,$e=typeof g<"u"&&(be||$&&typeof be>"u");if(!Z||!I)return z==null||z("008",Gi.error008(Z,C)),null;const{sourceX:Xe,sourceY:ae,targetX:Qe,targetY:Oe}=hie(G,Z,K,H,I,re);return ue.createElement(D,{key:C.id,id:C.id,className:Yn([C.className,i]),type:X,data:C.data,selected:!!C.selected,animated:!!C.animated,hidden:!!C.hidden,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,style:C.style,source:C.source,target:C.target,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerEnd:C.markerEnd,markerStart:C.markerStart,sourceX:Xe,sourceY:ae,targetX:Qe,targetY:Oe,sourcePosition:K,targetPosition:re,elementsSelectable:j,onContextMenu:a,onMouseEnter:o,onMouseMove:u,onMouseLeave:d,onClick:p,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,reconnectRadius:y,rfId:r,ariaLabel:C.ariaLabel,isFocusable:se,isReconnectable:$e,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth,disableKeyboardA11y:Q})})))),S):null};lZ.displayName="EdgeRenderer";var kie=P.memo(lZ);const $ie=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function Tie({children:n}){const e=Xt($ie);return ue.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},n)}function jie(n){const e=vk(),t=P.useRef(!1);P.useEffect(()=>{!t.current&&e.viewportInitialized&&n&&(setTimeout(()=>n(e),1),t.current=!0)},[n,e.viewportInitialized])}const _ie={[ze.Left]:ze.Right,[ze.Right]:ze.Left,[ze.Top]:ze.Bottom,[ze.Bottom]:ze.Top},oZ=({nodeId:n,handleType:e,style:t,type:r=Na.Bezier,CustomComponent:s,connectionStatus:i})=>{var R,N,q;const{fromNode:a,handleId:o,toX:u,toY:d,connectionMode:p}=Xt(P.useCallback(z=>({fromNode:z.nodeInternals.get(n),handleId:z.connectionHandleId,toX:(z.connectionPosition.x-z.transform[0])/z.transform[2],toY:(z.connectionPosition.y-z.transform[1])/z.transform[2],connectionMode:z.connectionMode}),[n]),En),m=(R=a==null?void 0:a[an])==null?void 0:R.handleBounds;let g=m==null?void 0:m[e];if(p===Ii.Loose&&(g=g||(m==null?void 0:m[e==="source"?"target":"source"])),!a||!g)return null;const x=o?g.find(z=>z.id===o):g[0],v=x?x.x+x.width/2:(a.width??0)/2,y=x?x.y+x.height/2:a.height??0,S=(((N=a.positionAbsolute)==null?void 0:N.x)??0)+v,Q=(((q=a.positionAbsolute)==null?void 0:q.y)??0)+y,k=x==null?void 0:x.position,$=k?_ie[k]:null;if(!k||!$)return null;if(s)return ue.createElement(s,{connectionLineType:r,connectionLineStyle:t,fromNode:a,fromHandle:x,fromX:S,fromY:Q,toX:u,toY:d,fromPosition:k,toPosition:$,connectionStatus:i});let j="";const T={sourceX:S,sourceY:Q,sourcePosition:k,targetX:u,targetY:d,targetPosition:$};return r===Na.Bezier?[j]=PL(T):r===Na.Step?[j]=A2({...T,borderRadius:0}):r===Na.SmoothStep?[j]=A2(T):r===Na.SimpleBezier?[j]=_L(T):j=`M${S},${Q} ${u},${d}`,ue.createElement("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};oZ.displayName="ConnectionLine";const Pie=n=>({nodeId:n.connectionNodeId,handleType:n.connectionHandleType,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height});function Nie({containerStyle:n,style:e,type:t,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:o,height:u,connectionStatus:d}=Xt(Pie,En);return!(s&&i&&o&&a)?null:ue.createElement("svg",{style:n,width:o,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},ue.createElement("g",{className:Yn(["react-flow__connection",d])},ue.createElement(oZ,{nodeId:s,handleType:i,style:e,type:t,CustomComponent:r,connectionStatus:d})))}function mN(n,e){return P.useRef(null),Nn(),P.useMemo(()=>e(n),[n])}const cZ=({nodeTypes:n,edgeTypes:e,onMove:t,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:u,onEdgeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:v,onSelectionStart:y,onSelectionEnd:S,connectionLineType:Q,connectionLineStyle:k,connectionLineComponent:$,connectionLineContainerStyle:j,selectionKeyCode:T,selectionOnDrag:R,selectionMode:N,multiSelectionKeyCode:q,panActivationKeyCode:z,zoomActivationKeyCode:L,deleteKeyCode:E,onlyRenderVisibleElements:V,elementsSelectable:B,selectNodesOnDrag:C,defaultViewport:G,translateExtent:A,minZoom:U,maxZoom:H,preventScrolling:W,defaultMarkerColor:J,zoomOnScroll:X,zoomOnPinch:D,panOnScroll:ee,panOnScrollSpeed:Z,panOnScrollMode:I,zoomOnDoubleClick:K,panOnDrag:re,onPaneClick:se,onPaneMouseEnter:be,onPaneMouseMove:$e,onPaneMouseLeave:Xe,onPaneScroll:ae,onPaneContextMenu:Qe,onEdgeContextMenu:Oe,onEdgeMouseEnter:ye,onEdgeMouseMove:Fe,onEdgeMouseLeave:Te,onReconnect:ge,onReconnectStart:Ke,onReconnectEnd:ot,reconnectRadius:st,noDragClassName:ht,noWheelClassName:Je,noPanClassName:tt,elevateEdgesOnSelect:hn,disableKeyboardA11y:Qt,nodeOrigin:zt,nodeExtent:St,rfId:en})=>{const ln=mN(n,iie),pt=mN(e,die);return jie(i),ue.createElement(rie,{onPaneClick:se,onPaneMouseEnter:be,onPaneMouseMove:$e,onPaneMouseLeave:Xe,onPaneContextMenu:Qe,onPaneScroll:ae,deleteKeyCode:E,selectionKeyCode:T,selectionOnDrag:R,selectionMode:N,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:q,panActivationKeyCode:z,zoomActivationKeyCode:L,elementsSelectable:B,onMove:t,onMoveStart:r,onMoveEnd:s,zoomOnScroll:X,zoomOnPinch:D,zoomOnDoubleClick:K,panOnScroll:ee,panOnScrollSpeed:Z,panOnScrollMode:I,panOnDrag:re,defaultViewport:G,translateExtent:A,minZoom:U,maxZoom:H,onSelectionContextMenu:v,preventScrolling:W,noDragClassName:ht,noWheelClassName:Je,noPanClassName:tt,disableKeyboardA11y:Qt},ue.createElement(Tie,null,ue.createElement(kie,{edgeTypes:pt,onEdgeClick:o,onEdgeDoubleClick:d,onlyRenderVisibleElements:V,onEdgeContextMenu:Oe,onEdgeMouseEnter:ye,onEdgeMouseMove:Fe,onEdgeMouseLeave:Te,onReconnect:ge,onReconnectStart:Ke,onReconnectEnd:ot,reconnectRadius:st,defaultMarkerColor:J,noPanClassName:tt,elevateEdgesOnSelect:!!hn,disableKeyboardA11y:Qt,rfId:en},ue.createElement(Nie,{style:k,type:Q,component:$,containerStyle:j})),ue.createElement("div",{className:"react-flow__edgelabel-renderer"}),ue.createElement(oie,{nodeTypes:ln,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:C,onlyRenderVisibleElements:V,noPanClassName:tt,noDragClassName:ht,disableKeyboardA11y:Qt,nodeOrigin:zt,nodeExtent:St,rfId:en})))};cZ.displayName="GraphView";var Cie=P.memo(cZ);const L2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Qa={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:L2,nodeExtent:L2,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Ii.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:lse,isValidConnection:void 0},Rie=()=>wee((n,e)=>({...Qa,setNodes:t=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();n({nodeInternals:Ux(t,r,s,i)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:t=>{const{defaultEdgeOptions:r={}}=e();n({edges:t.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(t,r)=>{const s=typeof t<"u",i=typeof r<"u",a=s?Ux(t,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;n({nodeInternals:a,edges:i?r:[],hasDefaultNodes:s,hasDefaultEdges:i})},updateNodeDimensions:t=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:o,domNode:u,nodeOrigin:d}=e(),p=u==null?void 0:u.querySelector(".react-flow__viewport");if(!p)return;const m=window.getComputedStyle(p),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=t.reduce((y,S)=>{const Q=s.get(S.id);if(Q!=null&&Q.hidden)s.set(Q.id,{...Q,[an]:{...Q[an],handleBounds:void 0}});else if(Q){const k=hk(S.nodeElement);!!(k.width&&k.height&&(Q.width!==k.width||Q.height!==k.height||S.forceUpdate))&&(s.set(Q.id,{...Q,[an]:{...Q[an],handleBounds:{source:oN(".source",S.nodeElement,g,d),target:oN(".target",S.nodeElement,g,d)}},...k}),y.push({id:Q.id,type:"dimensions",dimensions:k}))}return y},[]);IL(s,d);const v=a||i&&!a&&HL(e,{initial:!0,...o});n({nodeInternals:new Map(s),fitViewOnInitDone:v}),(x==null?void 0:x.length)>0&&(r==null||r(x))},updateNodePositions:(t,r=!0,s=!1)=>{const{triggerNodeChanges:i}=e(),a=t.map(o=>{const u={id:o.id,type:"position",dragging:s};return r&&(u.positionAbsolute=o.positionAbsolute,u.position=o.position),u});i(a)},triggerNodeChanges:t=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:a,getNodes:o,elevateNodesOnSelect:u}=e();if(t!=null&&t.length){if(i){const d=KL(t,o()),p=Ux(d,s,a,u);n({nodeInternals:p})}r==null||r(t)}},addSelectedNodes:t=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,o=null;r?a=t.map(u=>_a(u,!0)):(a=Ko(i(),t),o=Ko(s,[])),up({changedNodes:a,changedEdges:o,get:e,set:n})},addSelectedEdges:t=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,o=null;r?a=t.map(u=>_a(u,!0)):(a=Ko(s,t),o=Ko(i(),[])),up({changedNodes:o,changedEdges:a,get:e,set:n})},unselectNodesAndEdges:({nodes:t,edges:r}={})=>{const{edges:s,getNodes:i}=e(),a=t||i(),o=r||s,u=a.map(p=>(p.selected=!1,_a(p.id,!1))),d=o.map(p=>_a(p.id,!1));up({changedNodes:u,changedEdges:d,get:e,set:n})},setMinZoom:t=>{const{d3Zoom:r,maxZoom:s}=e();r==null||r.scaleExtent([t,s]),n({minZoom:t})},setMaxZoom:t=>{const{d3Zoom:r,minZoom:s}=e();r==null||r.scaleExtent([s,t]),n({maxZoom:t})},setTranslateExtent:t=>{var r;(r=e().d3Zoom)==null||r.translateExtent(t),n({translateExtent:t})},resetSelectedElements:()=>{const{edges:t,getNodes:r}=e(),i=r().filter(o=>o.selected).map(o=>_a(o.id,!1)),a=t.filter(o=>o.selected).map(o=>_a(o.id,!1));up({changedNodes:i,changedEdges:a,get:e,set:n})},setNodeExtent:t=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=pk(s.position,t)}),n({nodeExtent:t,nodeInternals:new Map(r)})},panBy:t=>{const{transform:r,width:s,height:i,d3Zoom:a,d3Selection:o,translateExtent:u}=e();if(!a||!o||!t.x&&!t.y)return!1;const d=Di.translate(r[0]+t.x,r[1]+t.y).scale(r[2]),p=[[0,0],[s,i]],m=a==null?void 0:a.constrain()(d,p,u);return a.transform(o,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>n({connectionNodeId:Qa.connectionNodeId,connectionHandleId:Qa.connectionHandleId,connectionHandleType:Qa.connectionHandleType,connectionStatus:Qa.connectionStatus,connectionStartHandle:Qa.connectionStartHandle,connectionEndHandle:Qa.connectionEndHandle}),reset:()=>n({...Qa})}),Object.is),uZ=({children:n})=>{const e=P.useRef(null);return e.current||(e.current=Rie()),ue.createElement(ese,{value:e.current},n)};uZ.displayName="ReactFlowProvider";const fZ=({children:n})=>P.useContext(iO)?ue.createElement(ue.Fragment,null,n):ue.createElement(uZ,null,n);fZ.displayName="ReactFlowWrapper";const Eie={input:VL,default:X2,output:DL,group:yk},Aie={default:Sm,straight:gk,step:Ok,smoothstep:lO,simplebezier:mk},qie=[0,0],Mie=[15,15],Xie={x:0,y:0,zoom:1},zie={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},dZ=P.forwardRef(({nodes:n,edges:e,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i=Eie,edgeTypes:a=Aie,onNodeClick:o,onEdgeClick:u,onInit:d,onMove:p,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:v,onConnectEnd:y,onClickConnectStart:S,onClickConnectEnd:Q,onNodeMouseEnter:k,onNodeMouseMove:$,onNodeMouseLeave:j,onNodeContextMenu:T,onNodeDoubleClick:R,onNodeDragStart:N,onNodeDrag:q,onNodeDragStop:z,onNodesDelete:L,onEdgesDelete:E,onSelectionChange:V,onSelectionDragStart:B,onSelectionDrag:C,onSelectionDragStop:G,onSelectionContextMenu:A,onSelectionStart:U,onSelectionEnd:H,connectionMode:W=Ii.Strict,connectionLineType:J=Na.Bezier,connectionLineStyle:X,connectionLineComponent:D,connectionLineContainerStyle:ee,deleteKeyCode:Z="Backspace",selectionKeyCode:I="Shift",selectionOnDrag:K=!1,selectionMode:re=Df.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:be=wm()?"Meta":"Control",zoomActivationKeyCode:$e=wm()?"Meta":"Control",snapToGrid:Xe=!1,snapGrid:ae=Mie,onlyRenderVisibleElements:Qe=!1,selectNodesOnDrag:Oe=!0,nodesDraggable:ye,nodesConnectable:Fe,nodesFocusable:Te,nodeOrigin:ge=qie,edgesFocusable:Ke,edgesUpdatable:ot,elementsSelectable:st,defaultViewport:ht=Xie,minZoom:Je=.5,maxZoom:tt=2,translateExtent:hn=L2,preventScrolling:Qt=!0,nodeExtent:zt,defaultMarkerColor:St="#b1b1b7",zoomOnScroll:en=!0,zoomOnPinch:ln=!0,panOnScroll:pt=!1,panOnScrollSpeed:Lt=.5,panOnScrollMode:ct=$l.Free,zoomOnDoubleClick:de=!0,panOnDrag:we=!0,onPaneClick:ke,onPaneMouseEnter:Be,onPaneMouseMove:Qn,onPaneMouseLeave:Dt,onPaneScroll:kn,onPaneContextMenu:Zt,children:pn,onEdgeContextMenu:on,onEdgeDoubleClick:cs,onEdgeMouseEnter:xr,onEdgeMouseMove:Ia,onEdgeMouseLeave:us,onEdgeUpdate:$n,onEdgeUpdateStart:mn,onEdgeUpdateEnd:oi,onReconnect:fs,onReconnectStart:br,onReconnectEnd:ds,reconnectRadius:Xs=10,edgeUpdaterRadius:yr=10,onNodesChange:hs,onEdgesChange:ps,noDragClassName:xe="nodrag",noWheelClassName:_e="nowheel",noPanClassName:Ve="nopan",fitView:Rt=!1,fitViewOptions:On,connectOnClick:tr=!0,attributionPosition:Fl,proOptions:ci,defaultEdgeOptions:ui,elevateNodesOnSelect:Ha=!0,elevateEdgesOnSelect:ms=!1,disableKeyboardA11y:Os=!1,autoPanOnConnect:zs=!0,autoPanOnNodeDrag:Ls=!0,connectionRadius:tn=20,isValidConnection:Kl,onError:Jl,style:gs,id:xs,nodeDragThreshold:Lc,...eo},to)=>{const Ji=xs||"1";return ue.createElement("div",{...eo,style:{...gs,...zie},ref:to,className:Yn(["react-flow",s]),"data-testid":"rf__wrapper",id:xs},ue.createElement(fZ,null,ue.createElement(Cie,{onInit:d,onMove:p,onMoveStart:m,onMoveEnd:g,onNodeClick:o,onEdgeClick:u,onNodeMouseEnter:k,onNodeMouseMove:$,onNodeMouseLeave:j,onNodeContextMenu:T,onNodeDoubleClick:R,nodeTypes:i,edgeTypes:a,connectionLineType:J,connectionLineStyle:X,connectionLineComponent:D,connectionLineContainerStyle:ee,selectionKeyCode:I,selectionOnDrag:K,selectionMode:re,deleteKeyCode:Z,multiSelectionKeyCode:be,panActivationKeyCode:se,zoomActivationKeyCode:$e,onlyRenderVisibleElements:Qe,selectNodesOnDrag:Oe,defaultViewport:ht,translateExtent:hn,minZoom:Je,maxZoom:tt,preventScrolling:Qt,zoomOnScroll:en,zoomOnPinch:ln,zoomOnDoubleClick:de,panOnScroll:pt,panOnScrollSpeed:Lt,panOnScrollMode:ct,panOnDrag:we,onPaneClick:ke,onPaneMouseEnter:Be,onPaneMouseMove:Qn,onPaneMouseLeave:Dt,onPaneScroll:kn,onPaneContextMenu:Zt,onSelectionContextMenu:A,onSelectionStart:U,onSelectionEnd:H,onEdgeContextMenu:on,onEdgeDoubleClick:cs,onEdgeMouseEnter:xr,onEdgeMouseMove:Ia,onEdgeMouseLeave:us,onReconnect:fs??$n,onReconnectStart:br??mn,onReconnectEnd:ds??oi,reconnectRadius:Xs??yr,defaultMarkerColor:St,noDragClassName:xe,noWheelClassName:_e,noPanClassName:Ve,elevateEdgesOnSelect:ms,rfId:Ji,disableKeyboardA11y:Os,nodeOrigin:ge,nodeExtent:zt}),ue.createElement(_se,{nodes:n,edges:e,defaultNodes:t,defaultEdges:r,onConnect:x,onConnectStart:v,onConnectEnd:y,onClickConnectStart:S,onClickConnectEnd:Q,nodesDraggable:ye,nodesConnectable:Fe,nodesFocusable:Te,edgesFocusable:Ke,edgesUpdatable:ot,elementsSelectable:st,elevateNodesOnSelect:Ha,minZoom:Je,maxZoom:tt,nodeExtent:zt,onNodesChange:hs,onEdgesChange:ps,snapToGrid:Xe,snapGrid:ae,connectionMode:W,translateExtent:hn,connectOnClick:tr,defaultEdgeOptions:ui,fitView:Rt,fitViewOptions:On,onNodesDelete:L,onEdgesDelete:E,onNodeDragStart:N,onNodeDrag:q,onNodeDragStop:z,onSelectionDrag:C,onSelectionDragStart:B,onSelectionDragStop:G,noPanClassName:Ve,nodeOrigin:ge,rfId:Ji,autoPanOnConnect:zs,autoPanOnNodeDrag:Ls,onError:Jl,connectionRadius:tn,isValidConnection:Kl,nodeDragThreshold:Lc}),ue.createElement(Tse,{onSelectionChange:V}),pn,ue.createElement(nse,{proOptions:ci,position:Fl}),ue.createElement(Ese,{rfId:Ji,disableKeyboardA11y:Os})))});dZ.displayName="ReactFlow";function hZ(n){return e=>{const[t,r]=P.useState(e),s=P.useCallback(i=>r(a=>n(i,a)),[]);return[t,r,s]}}const Lie=hZ(KL),Zie=hZ(Gse),pZ=({id:n,x:e,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:u,className:d,borderRadius:p,shapeRendering:m,onClick:g,selected:x})=>{const{background:v,backgroundColor:y}=i||{},S=a||v||y;return ue.createElement("rect",{className:Yn(["react-flow__minimap-node",{selected:x},d]),x:e,y:t,rx:p,ry:p,width:r,height:s,fill:S,stroke:o,strokeWidth:u,shapeRendering:m,onClick:g?Q=>g(Q,n):void 0})};pZ.displayName="MiniMapNode";var Vie=P.memo(pZ);const Yie=n=>n.nodeOrigin,Die=n=>n.getNodes().filter(e=>!e.hidden&&e.width&&e.height),Hx=n=>n instanceof Function?n:()=>n;function Bie({nodeStrokeColor:n="transparent",nodeColor:e="#e2e2e2",nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=Vie,onClick:a}){const o=Xt(Die,En),u=Xt(Yie),d=Hx(e),p=Hx(n),m=Hx(t),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ue.createElement(ue.Fragment,null,o.map(x=>{const{x:v,y}=Nl(x,u).positionAbsolute;return ue.createElement(i,{key:x.id,x:v,y,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:d(x),borderRadius:r,strokeColor:p(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var Uie=P.memo(Bie);const Wie=200,Gie=150,Iie=n=>{const e=n.getNodes(),t={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:t,boundingRect:e.length>0?ise(oO(e,n.nodeOrigin),t):t,rfId:n.rfId}},Hie="react-flow__minimap-desc";function mZ({style:n,className:e,nodeStrokeColor:t="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:o,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:p=1,position:m="bottom-right",onClick:g,onNodeClick:x,pannable:v=!1,zoomable:y=!1,ariaLabel:S="React Flow mini map",inversePan:Q=!1,zoomStep:k=10,offsetScale:$=5}){const j=Nn(),T=P.useRef(null),{boundingRect:R,viewBB:N,rfId:q}=Xt(Iie,En),z=(n==null?void 0:n.width)??Wie,L=(n==null?void 0:n.height)??Gie,E=R.width/z,V=R.height/L,B=Math.max(E,V),C=B*z,G=B*L,A=$*B,U=R.x-(C-R.width)/2-A,H=R.y-(G-R.height)/2-A,W=C+A*2,J=G+A*2,X=`${Hie}-${q}`,D=P.useRef(0);D.current=B,P.useEffect(()=>{if(T.current){const I=Wr(T.current),K=be=>{const{transform:$e,d3Selection:Xe,d3Zoom:ae}=j.getState();if(be.sourceEvent.type!=="wheel"||!Xe||!ae)return;const Qe=-be.sourceEvent.deltaY*(be.sourceEvent.deltaMode===1?.05:be.sourceEvent.deltaMode?1:.002)*k,Oe=$e[2]*Math.pow(2,Qe);ae.scaleTo(Xe,Oe)},re=be=>{const{transform:$e,d3Selection:Xe,d3Zoom:ae,translateExtent:Qe,width:Oe,height:ye}=j.getState();if(be.sourceEvent.type!=="mousemove"||!Xe||!ae)return;const Fe=D.current*Math.max(1,$e[2])*(Q?-1:1),Te={x:$e[0]-be.sourceEvent.movementX*Fe,y:$e[1]-be.sourceEvent.movementY*Fe},ge=[[0,0],[Oe,ye]],Ke=Di.translate(Te.x,Te.y).scale($e[2]),ot=ae.constrain()(Ke,ge,Qe);ae.transform(Xe,ot)},se=bL().on("zoom",v?re:null).on("zoom.wheel",y?K:null);return I.call(se),()=>{I.on("zoom",null)}}},[v,y,Q,k]);const ee=g?I=>{const K=Qs(I);g(I,{x:K[0],y:K[1]})}:void 0,Z=x?(I,K)=>{const re=j.getState().nodeInternals.get(K);x(I,re)}:void 0;return ue.createElement(aO,{position:m,style:n,className:Yn(["react-flow__minimap",e]),"data-testid":"rf__minimap"},ue.createElement("svg",{width:z,height:L,viewBox:`${U} ${H} ${W} ${J}`,role:"img","aria-labelledby":X,ref:T,onClick:ee},S&&ue.createElement("title",{id:X},S),ue.createElement(Uie,{onClick:Z,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),ue.createElement("path",{className:"react-flow__minimap-mask",d:`M${U-A},${H-A}h${W+A*2}v${J+A*2}h${-W-A*2}z
|
|
334
|
-
M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fill:u,fillRule:"evenodd",stroke:d,strokeWidth:p,pointerEvents:"none"})))}mZ.displayName="MiniMap";var Fie=P.memo(mZ);function Kie(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ue.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Jie(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ue.createElement("path",{d:"M0 0h32v4.2H0z"}))}function eae(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ue.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function tae(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function nae(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const rf=({children:n,className:e,...t})=>ue.createElement("button",{type:"button",className:Yn(["react-flow__controls-button",e]),...t},n);rf.displayName="ControlButton";const rae=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}),OZ=({style:n,showZoom:e=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:u,className:d,children:p,position:m="bottom-left"})=>{const g=Nn(),[x,v]=P.useState(!1),{isInteractive:y,minZoomReached:S,maxZoomReached:Q}=Xt(rae,En),{zoomIn:k,zoomOut:$,fitView:j}=vk();if(P.useEffect(()=>{v(!0)},[]),!x)return null;const T=()=>{k(),i==null||i()},R=()=>{$(),a==null||a()},N=()=>{j(s),o==null||o()},q=()=>{g.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),u==null||u(!y)};return ue.createElement(aO,{className:Yn(["react-flow__controls",d]),position:m,style:n,"data-testid":"rf__controls"},e&&ue.createElement(ue.Fragment,null,ue.createElement(rf,{onClick:T,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:Q},ue.createElement(Kie,null)),ue.createElement(rf,{onClick:R,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ue.createElement(Jie,null))),t&&ue.createElement(rf,{className:"react-flow__controls-fitview",onClick:N,title:"fit view","aria-label":"fit view"},ue.createElement(eae,null)),r&&ue.createElement(rf,{className:"react-flow__controls-interactive",onClick:q,title:"toggle interactivity","aria-label":"toggle interactivity"},y?ue.createElement(nae,null):ue.createElement(tae,null)),p)};OZ.displayName="Controls";var sae=P.memo(OZ),ts;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ts||(ts={}));function iae({color:n,dimensions:e,lineWidth:t}){return ue.createElement("path",{stroke:n,strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function aae({color:n,radius:e}){return ue.createElement("circle",{cx:e,cy:e,r:e,fill:n})}const lae={[ts.Dots]:"#91919a",[ts.Lines]:"#eee",[ts.Cross]:"#e2e2e2"},oae={[ts.Dots]:1,[ts.Lines]:1,[ts.Cross]:6},cae=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function gZ({id:n,variant:e=ts.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:o,className:u}){const d=P.useRef(null),{transform:p,patternId:m}=Xt(cae,En),g=a||lae[e],x=r||oae[e],v=e===ts.Dots,y=e===ts.Cross,S=Array.isArray(t)?t:[t,t],Q=[S[0]*p[2]||1,S[1]*p[2]||1],k=x*p[2],$=y?[k,k]:Q,j=v?[k/i,k/i]:[$[0]/i,$[1]/i];return ue.createElement("svg",{className:Yn(["react-flow__background",u]),style:{...o,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},ue.createElement("pattern",{id:m+n,x:p[0]%Q[0],y:p[1]%Q[1],width:Q[0],height:Q[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`},v?ue.createElement(aae,{color:g,radius:k/i}):ue.createElement(iae,{dimensions:$,color:g,lineWidth:s})),ue.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+n})`}))}gZ.displayName="Background";var uae=P.memo(gZ);function Sk(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Fx,ON;function fae(){if(ON)return Fx;ON=1;function n(){this.__data__=[],this.size=0}return Fx=n,Fx}var Kx,gN;function Ac(){if(gN)return Kx;gN=1;function n(e,t){return e===t||e!==e&&t!==t}return Kx=n,Kx}var Jx,xN;function cO(){if(xN)return Jx;xN=1;var n=Ac();function e(t,r){for(var s=t.length;s--;)if(n(t[s][0],r))return s;return-1}return Jx=e,Jx}var e1,bN;function dae(){if(bN)return e1;bN=1;var n=cO(),e=Array.prototype,t=e.splice;function r(s){var i=this.__data__,a=n(i,s);if(a<0)return!1;var o=i.length-1;return a==o?i.pop():t.call(i,a,1),--this.size,!0}return e1=r,e1}var t1,yN;function hae(){if(yN)return t1;yN=1;var n=cO();function e(t){var r=this.__data__,s=n(r,t);return s<0?void 0:r[s][1]}return t1=e,t1}var n1,vN;function pae(){if(vN)return n1;vN=1;var n=cO();function e(t){return n(this.__data__,t)>-1}return n1=e,n1}var r1,wN;function mae(){if(wN)return r1;wN=1;var n=cO();function e(t,r){var s=this.__data__,i=n(s,t);return i<0?(++this.size,s.push([t,r])):s[i][1]=r,this}return r1=e,r1}var s1,SN;function uO(){if(SN)return s1;SN=1;var n=fae(),e=dae(),t=hae(),r=pae(),s=mae();function i(a){var o=-1,u=a==null?0:a.length;for(this.clear();++o<u;){var d=a[o];this.set(d[0],d[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=s,s1=i,s1}var i1,QN;function Oae(){if(QN)return i1;QN=1;var n=uO();function e(){this.__data__=new n,this.size=0}return i1=e,i1}var a1,kN;function gae(){if(kN)return a1;kN=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return a1=n,a1}var l1,$N;function xae(){if($N)return l1;$N=1;function n(e){return this.__data__.get(e)}return l1=n,l1}var o1,TN;function bae(){if(TN)return o1;TN=1;function n(e){return this.__data__.has(e)}return o1=n,o1}var c1,jN;function xZ(){if(jN)return c1;jN=1;var n=typeof Th=="object"&&Th&&Th.Object===Object&&Th;return c1=n,c1}var u1,_N;function Ms(){if(_N)return u1;_N=1;var n=xZ(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return u1=t,u1}var f1,PN;function qc(){if(PN)return f1;PN=1;var n=Ms(),e=n.Symbol;return f1=e,f1}var d1,NN;function yae(){if(NN)return d1;NN=1;var n=qc(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,s=n?n.toStringTag:void 0;function i(a){var o=t.call(a,s),u=a[s];try{a[s]=void 0;var d=!0}catch{}var p=r.call(a);return d&&(o?a[s]=u:delete a[s]),p}return d1=i,d1}var h1,CN;function vae(){if(CN)return h1;CN=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return h1=t,h1}var p1,RN;function Wl(){if(RN)return p1;RN=1;var n=qc(),e=yae(),t=vae(),r="[object Null]",s="[object Undefined]",i=n?n.toStringTag:void 0;function a(o){return o==null?o===void 0?s:r:i&&i in Object(o)?e(o):t(o)}return p1=a,p1}var m1,EN;function ls(){if(EN)return m1;EN=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return m1=n,m1}var O1,AN;function cd(){if(AN)return O1;AN=1;var n=Wl(),e=ls(),t="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";function a(o){if(!e(o))return!1;var u=n(o);return u==r||u==s||u==t||u==i}return O1=a,O1}var g1,qN;function wae(){if(qN)return g1;qN=1;var n=Ms(),e=n["__core-js_shared__"];return g1=e,g1}var x1,MN;function Sae(){if(MN)return x1;MN=1;var n=wae(),e=(function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function t(r){return!!e&&e in r}return x1=t,x1}var b1,XN;function bZ(){if(XN)return b1;XN=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return b1=t,b1}var y1,zN;function Qae(){if(zN)return y1;zN=1;var n=cd(),e=Sae(),t=ls(),r=bZ(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,o=Object.prototype,u=a.toString,d=o.hasOwnProperty,p=RegExp("^"+u.call(d).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!t(g)||e(g))return!1;var x=n(g)?p:i;return x.test(r(g))}return y1=m,y1}var v1,LN;function kae(){if(LN)return v1;LN=1;function n(e,t){return e==null?void 0:e[t]}return v1=n,v1}var w1,ZN;function Gl(){if(ZN)return w1;ZN=1;var n=Qae(),e=kae();function t(r,s){var i=e(r,s);return n(i)?i:void 0}return w1=t,w1}var S1,VN;function Qk(){if(VN)return S1;VN=1;var n=Gl(),e=Ms(),t=n(e,"Map");return S1=t,S1}var Q1,YN;function fO(){if(YN)return Q1;YN=1;var n=Gl(),e=n(Object,"create");return Q1=e,Q1}var k1,DN;function $ae(){if(DN)return k1;DN=1;var n=fO();function e(){this.__data__=n?n(null):{},this.size=0}return k1=e,k1}var $1,BN;function Tae(){if(BN)return $1;BN=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return $1=n,$1}var T1,UN;function jae(){if(UN)return T1;UN=1;var n=fO(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function s(i){var a=this.__data__;if(n){var o=a[i];return o===e?void 0:o}return r.call(a,i)?a[i]:void 0}return T1=s,T1}var j1,WN;function _ae(){if(WN)return j1;WN=1;var n=fO(),e=Object.prototype,t=e.hasOwnProperty;function r(s){var i=this.__data__;return n?i[s]!==void 0:t.call(i,s)}return j1=r,j1}var _1,GN;function Pae(){if(GN)return _1;GN=1;var n=fO(),e="__lodash_hash_undefined__";function t(r,s){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=n&&s===void 0?e:s,this}return _1=t,_1}var P1,IN;function Nae(){if(IN)return P1;IN=1;var n=$ae(),e=Tae(),t=jae(),r=_ae(),s=Pae();function i(a){var o=-1,u=a==null?0:a.length;for(this.clear();++o<u;){var d=a[o];this.set(d[0],d[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=s,P1=i,P1}var N1,HN;function Cae(){if(HN)return N1;HN=1;var n=Nae(),e=uO(),t=Qk();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return N1=r,N1}var C1,FN;function Rae(){if(FN)return C1;FN=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return C1=n,C1}var R1,KN;function dO(){if(KN)return R1;KN=1;var n=Rae();function e(t,r){var s=t.__data__;return n(r)?s[typeof r=="string"?"string":"hash"]:s.map}return R1=e,R1}var E1,JN;function Eae(){if(JN)return E1;JN=1;var n=dO();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return E1=e,E1}var A1,e3;function Aae(){if(e3)return A1;e3=1;var n=dO();function e(t){return n(this,t).get(t)}return A1=e,A1}var q1,t3;function qae(){if(t3)return q1;t3=1;var n=dO();function e(t){return n(this,t).has(t)}return q1=e,q1}var M1,n3;function Mae(){if(n3)return M1;n3=1;var n=dO();function e(t,r){var s=n(this,t),i=s.size;return s.set(t,r),this.size+=s.size==i?0:1,this}return M1=e,M1}var X1,r3;function kk(){if(r3)return X1;r3=1;var n=Cae(),e=Eae(),t=Aae(),r=qae(),s=Mae();function i(a){var o=-1,u=a==null?0:a.length;for(this.clear();++o<u;){var d=a[o];this.set(d[0],d[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=s,X1=i,X1}var z1,s3;function Xae(){if(s3)return z1;s3=1;var n=uO(),e=Qk(),t=kk(),r=200;function s(i,a){var o=this.__data__;if(o instanceof n){var u=o.__data__;if(!e||u.length<r-1)return u.push([i,a]),this.size=++o.size,this;o=this.__data__=new t(u)}return o.set(i,a),this.size=o.size,this}return z1=s,z1}var L1,i3;function hO(){if(i3)return L1;i3=1;var n=uO(),e=Oae(),t=gae(),r=xae(),s=bae(),i=Xae();function a(o){var u=this.__data__=new n(o);this.size=u.size}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=i,L1=a,L1}var Z1,a3;function $k(){if(a3)return Z1;a3=1;function n(e,t){for(var r=-1,s=e==null?0:e.length;++r<s&&t(e[r],r,e)!==!1;);return e}return Z1=n,Z1}var V1,l3;function yZ(){if(l3)return V1;l3=1;var n=Gl(),e=(function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch{}})();return V1=e,V1}var Y1,o3;function pO(){if(o3)return Y1;o3=1;var n=yZ();function e(t,r,s){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):t[r]=s}return Y1=e,Y1}var D1,c3;function mO(){if(c3)return D1;c3=1;var n=pO(),e=Ac(),t=Object.prototype,r=t.hasOwnProperty;function s(i,a,o){var u=i[a];(!(r.call(i,a)&&e(u,o))||o===void 0&&!(a in i))&&n(i,a,o)}return D1=s,D1}var B1,u3;function ud(){if(u3)return B1;u3=1;var n=mO(),e=pO();function t(r,s,i,a){var o=!i;i||(i={});for(var u=-1,d=s.length;++u<d;){var p=s[u],m=a?a(i[p],r[p],p,i,r):void 0;m===void 0&&(m=r[p]),o?e(i,p,m):n(i,p,m)}return i}return B1=t,B1}var U1,f3;function zae(){if(f3)return U1;f3=1;function n(e,t){for(var r=-1,s=Array(e);++r<e;)s[r]=t(r);return s}return U1=n,U1}var W1,d3;function li(){if(d3)return W1;d3=1;function n(e){return e!=null&&typeof e=="object"}return W1=n,W1}var G1,h3;function Lae(){if(h3)return G1;h3=1;var n=Wl(),e=li(),t="[object Arguments]";function r(s){return e(s)&&n(s)==t}return G1=r,G1}var I1,p3;function fd(){if(p3)return I1;p3=1;var n=Lae(),e=li(),t=Object.prototype,r=t.hasOwnProperty,s=t.propertyIsEnumerable,i=n((function(){return arguments})())?n:function(a){return e(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return I1=i,I1}var H1,m3;function Sn(){if(m3)return H1;m3=1;var n=Array.isArray;return H1=n,H1}var sf={exports:{}},F1,O3;function Zae(){if(O3)return F1;O3=1;function n(){return!1}return F1=n,F1}sf.exports;var g3;function Mc(){return g3||(g3=1,(function(n,e){var t=Ms(),r=Zae(),s=e&&!e.nodeType&&e,i=s&&!0&&n&&!n.nodeType&&n,a=i&&i.exports===s,o=a?t.Buffer:void 0,u=o?o.isBuffer:void 0,d=u||r;n.exports=d})(sf,sf.exports)),sf.exports}var K1,x3;function OO(){if(x3)return K1;x3=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,s){var i=typeof r;return s=s??n,!!s&&(i=="number"||i!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<s}return K1=t,K1}var J1,b3;function Tk(){if(b3)return J1;b3=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return J1=e,J1}var eb,y3;function Vae(){if(y3)return eb;y3=1;var n=Wl(),e=Tk(),t=li(),r="[object Arguments]",s="[object Array]",i="[object Boolean]",a="[object Date]",o="[object Error]",u="[object Function]",d="[object Map]",p="[object Number]",m="[object Object]",g="[object RegExp]",x="[object Set]",v="[object String]",y="[object WeakMap]",S="[object ArrayBuffer]",Q="[object DataView]",k="[object Float32Array]",$="[object Float64Array]",j="[object Int8Array]",T="[object Int16Array]",R="[object Int32Array]",N="[object Uint8Array]",q="[object Uint8ClampedArray]",z="[object Uint16Array]",L="[object Uint32Array]",E={};E[k]=E[$]=E[j]=E[T]=E[R]=E[N]=E[q]=E[z]=E[L]=!0,E[r]=E[s]=E[S]=E[i]=E[Q]=E[a]=E[o]=E[u]=E[d]=E[p]=E[m]=E[g]=E[x]=E[v]=E[y]=!1;function V(B){return t(B)&&e(B.length)&&!!E[n(B)]}return eb=V,eb}var tb,v3;function gO(){if(v3)return tb;v3=1;function n(e){return function(t){return e(t)}}return tb=n,tb}var af={exports:{}};af.exports;var w3;function jk(){return w3||(w3=1,(function(n,e){var t=xZ(),r=e&&!e.nodeType&&e,s=r&&!0&&n&&!n.nodeType&&n,i=s&&s.exports===r,a=i&&t.process,o=(function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();n.exports=o})(af,af.exports)),af.exports}var nb,S3;function dd(){if(S3)return nb;S3=1;var n=Vae(),e=gO(),t=jk(),r=t&&t.isTypedArray,s=r?e(r):n;return nb=s,nb}var rb,Q3;function vZ(){if(Q3)return rb;Q3=1;var n=zae(),e=fd(),t=Sn(),r=Mc(),s=OO(),i=dd(),a=Object.prototype,o=a.hasOwnProperty;function u(d,p){var m=t(d),g=!m&&e(d),x=!m&&!g&&r(d),v=!m&&!g&&!x&&i(d),y=m||g||x||v,S=y?n(d.length,String):[],Q=S.length;for(var k in d)(p||o.call(d,k))&&!(y&&(k=="length"||x&&(k=="offset"||k=="parent")||v&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||s(k,Q)))&&S.push(k);return S}return rb=u,rb}var sb,k3;function xO(){if(k3)return sb;k3=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,s=typeof r=="function"&&r.prototype||n;return t===s}return sb=e,sb}var ib,$3;function wZ(){if($3)return ib;$3=1;function n(e,t){return function(r){return e(t(r))}}return ib=n,ib}var ab,T3;function Yae(){if(T3)return ab;T3=1;var n=wZ(),e=n(Object.keys,Object);return ab=e,ab}var lb,j3;function _k(){if(j3)return lb;j3=1;var n=xO(),e=Yae(),t=Object.prototype,r=t.hasOwnProperty;function s(i){if(!n(i))return e(i);var a=[];for(var o in Object(i))r.call(i,o)&&o!="constructor"&&a.push(o);return a}return lb=s,lb}var ob,_3;function Fi(){if(_3)return ob;_3=1;var n=cd(),e=Tk();function t(r){return r!=null&&e(r.length)&&!n(r)}return ob=t,ob}var cb,P3;function Ga(){if(P3)return cb;P3=1;var n=vZ(),e=_k(),t=Fi();function r(s){return t(s)?n(s):e(s)}return cb=r,cb}var ub,N3;function Dae(){if(N3)return ub;N3=1;var n=ud(),e=Ga();function t(r,s){return r&&n(s,e(s),r)}return ub=t,ub}var fb,C3;function Bae(){if(C3)return fb;C3=1;function n(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}return fb=n,fb}var db,R3;function Uae(){if(R3)return db;R3=1;var n=ls(),e=xO(),t=Bae(),r=Object.prototype,s=r.hasOwnProperty;function i(a){if(!n(a))return t(a);var o=e(a),u=[];for(var d in a)d=="constructor"&&(o||!s.call(a,d))||u.push(d);return u}return db=i,db}var hb,E3;function Il(){if(E3)return hb;E3=1;var n=vZ(),e=Uae(),t=Fi();function r(s){return t(s)?n(s,!0):e(s)}return hb=r,hb}var pb,A3;function Wae(){if(A3)return pb;A3=1;var n=ud(),e=Il();function t(r,s){return r&&n(s,e(s),r)}return pb=t,pb}var lf={exports:{}};lf.exports;var q3;function SZ(){return q3||(q3=1,(function(n,e){var t=Ms(),r=e&&!e.nodeType&&e,s=r&&!0&&n&&!n.nodeType&&n,i=s&&s.exports===r,a=i?t.Buffer:void 0,o=a?a.allocUnsafe:void 0;function u(d,p){if(p)return d.slice();var m=d.length,g=o?o(m):new d.constructor(m);return d.copy(g),g}n.exports=u})(lf,lf.exports)),lf.exports}var mb,M3;function QZ(){if(M3)return mb;M3=1;function n(e,t){var r=-1,s=e.length;for(t||(t=Array(s));++r<s;)t[r]=e[r];return t}return mb=n,mb}var Ob,X3;function kZ(){if(X3)return Ob;X3=1;function n(e,t){for(var r=-1,s=e==null?0:e.length,i=0,a=[];++r<s;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}return Ob=n,Ob}var gb,z3;function $Z(){if(z3)return gb;z3=1;function n(){return[]}return gb=n,gb}var xb,L3;function Pk(){if(L3)return xb;L3=1;var n=kZ(),e=$Z(),t=Object.prototype,r=t.propertyIsEnumerable,s=Object.getOwnPropertySymbols,i=s?function(a){return a==null?[]:(a=Object(a),n(s(a),function(o){return r.call(a,o)}))}:e;return xb=i,xb}var bb,Z3;function Gae(){if(Z3)return bb;Z3=1;var n=ud(),e=Pk();function t(r,s){return n(r,e(r),s)}return bb=t,bb}var yb,V3;function Nk(){if(V3)return yb;V3=1;function n(e,t){for(var r=-1,s=t.length,i=e.length;++r<s;)e[i+r]=t[r];return e}return yb=n,yb}var vb,Y3;function bO(){if(Y3)return vb;Y3=1;var n=wZ(),e=n(Object.getPrototypeOf,Object);return vb=e,vb}var wb,D3;function TZ(){if(D3)return wb;D3=1;var n=Nk(),e=bO(),t=Pk(),r=$Z(),s=Object.getOwnPropertySymbols,i=s?function(a){for(var o=[];a;)n(o,t(a)),a=e(a);return o}:r;return wb=i,wb}var Sb,B3;function Iae(){if(B3)return Sb;B3=1;var n=ud(),e=TZ();function t(r,s){return n(r,e(r),s)}return Sb=t,Sb}var Qb,U3;function jZ(){if(U3)return Qb;U3=1;var n=Nk(),e=Sn();function t(r,s,i){var a=s(r);return e(r)?a:n(a,i(r))}return Qb=t,Qb}var kb,W3;function _Z(){if(W3)return kb;W3=1;var n=jZ(),e=Pk(),t=Ga();function r(s){return n(s,t,e)}return kb=r,kb}var $b,G3;function Hae(){if(G3)return $b;G3=1;var n=jZ(),e=TZ(),t=Il();function r(s){return n(s,t,e)}return $b=r,$b}var Tb,I3;function Fae(){if(I3)return Tb;I3=1;var n=Gl(),e=Ms(),t=n(e,"DataView");return Tb=t,Tb}var jb,H3;function Kae(){if(H3)return jb;H3=1;var n=Gl(),e=Ms(),t=n(e,"Promise");return jb=t,jb}var _b,F3;function PZ(){if(F3)return _b;F3=1;var n=Gl(),e=Ms(),t=n(e,"Set");return _b=t,_b}var Pb,K3;function Jae(){if(K3)return Pb;K3=1;var n=Gl(),e=Ms(),t=n(e,"WeakMap");return Pb=t,Pb}var Nb,J3;function Xc(){if(J3)return Nb;J3=1;var n=Fae(),e=Qk(),t=Kae(),r=PZ(),s=Jae(),i=Wl(),a=bZ(),o="[object Map]",u="[object Object]",d="[object Promise]",p="[object Set]",m="[object WeakMap]",g="[object DataView]",x=a(n),v=a(e),y=a(t),S=a(r),Q=a(s),k=i;return(n&&k(new n(new ArrayBuffer(1)))!=g||e&&k(new e)!=o||t&&k(t.resolve())!=d||r&&k(new r)!=p||s&&k(new s)!=m)&&(k=function($){var j=i($),T=j==u?$.constructor:void 0,R=T?a(T):"";if(R)switch(R){case x:return g;case v:return o;case y:return d;case S:return p;case Q:return m}return j}),Nb=k,Nb}var Cb,eC;function ele(){if(eC)return Cb;eC=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r){var s=r.length,i=new r.constructor(s);return s&&typeof r[0]=="string"&&e.call(r,"index")&&(i.index=r.index,i.input=r.input),i}return Cb=t,Cb}var Rb,tC;function NZ(){if(tC)return Rb;tC=1;var n=Ms(),e=n.Uint8Array;return Rb=e,Rb}var Eb,nC;function Ck(){if(nC)return Eb;nC=1;var n=NZ();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return Eb=e,Eb}var Ab,rC;function tle(){if(rC)return Ab;rC=1;var n=Ck();function e(t,r){var s=r?n(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}return Ab=e,Ab}var qb,sC;function nle(){if(sC)return qb;sC=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return qb=e,qb}var Mb,iC;function rle(){if(iC)return Mb;iC=1;var n=qc(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;function r(s){return t?Object(t.call(s)):{}}return Mb=r,Mb}var Xb,aC;function CZ(){if(aC)return Xb;aC=1;var n=Ck();function e(t,r){var s=r?n(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}return Xb=e,Xb}var zb,lC;function sle(){if(lC)return zb;lC=1;var n=Ck(),e=tle(),t=nle(),r=rle(),s=CZ(),i="[object Boolean]",a="[object Date]",o="[object Map]",u="[object Number]",d="[object RegExp]",p="[object Set]",m="[object String]",g="[object Symbol]",x="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",S="[object Float64Array]",Q="[object Int8Array]",k="[object Int16Array]",$="[object Int32Array]",j="[object Uint8Array]",T="[object Uint8ClampedArray]",R="[object Uint16Array]",N="[object Uint32Array]";function q(z,L,E){var V=z.constructor;switch(L){case x:return n(z);case i:case a:return new V(+z);case v:return e(z,E);case y:case S:case Q:case k:case $:case j:case T:case R:case N:return s(z,E);case o:return new V;case u:case m:return new V(z);case d:return t(z);case p:return new V;case g:return r(z)}}return zb=q,zb}var Lb,oC;function RZ(){if(oC)return Lb;oC=1;var n=ls(),e=Object.create,t=(function(){function r(){}return function(s){if(!n(s))return{};if(e)return e(s);r.prototype=s;var i=new r;return r.prototype=void 0,i}})();return Lb=t,Lb}var Zb,cC;function EZ(){if(cC)return Zb;cC=1;var n=RZ(),e=bO(),t=xO();function r(s){return typeof s.constructor=="function"&&!t(s)?n(e(s)):{}}return Zb=r,Zb}var Vb,uC;function ile(){if(uC)return Vb;uC=1;var n=Xc(),e=li(),t="[object Map]";function r(s){return e(s)&&n(s)==t}return Vb=r,Vb}var Yb,fC;function ale(){if(fC)return Yb;fC=1;var n=ile(),e=gO(),t=jk(),r=t&&t.isMap,s=r?e(r):n;return Yb=s,Yb}var Db,dC;function lle(){if(dC)return Db;dC=1;var n=Xc(),e=li(),t="[object Set]";function r(s){return e(s)&&n(s)==t}return Db=r,Db}var Bb,hC;function ole(){if(hC)return Bb;hC=1;var n=lle(),e=gO(),t=jk(),r=t&&t.isSet,s=r?e(r):n;return Bb=s,Bb}var Ub,pC;function AZ(){if(pC)return Ub;pC=1;var n=hO(),e=$k(),t=mO(),r=Dae(),s=Wae(),i=SZ(),a=QZ(),o=Gae(),u=Iae(),d=_Z(),p=Hae(),m=Xc(),g=ele(),x=sle(),v=EZ(),y=Sn(),S=Mc(),Q=ale(),k=ls(),$=ole(),j=Ga(),T=Il(),R=1,N=2,q=4,z="[object Arguments]",L="[object Array]",E="[object Boolean]",V="[object Date]",B="[object Error]",C="[object Function]",G="[object GeneratorFunction]",A="[object Map]",U="[object Number]",H="[object Object]",W="[object RegExp]",J="[object Set]",X="[object String]",D="[object Symbol]",ee="[object WeakMap]",Z="[object ArrayBuffer]",I="[object DataView]",K="[object Float32Array]",re="[object Float64Array]",se="[object Int8Array]",be="[object Int16Array]",$e="[object Int32Array]",Xe="[object Uint8Array]",ae="[object Uint8ClampedArray]",Qe="[object Uint16Array]",Oe="[object Uint32Array]",ye={};ye[z]=ye[L]=ye[Z]=ye[I]=ye[E]=ye[V]=ye[K]=ye[re]=ye[se]=ye[be]=ye[$e]=ye[A]=ye[U]=ye[H]=ye[W]=ye[J]=ye[X]=ye[D]=ye[Xe]=ye[ae]=ye[Qe]=ye[Oe]=!0,ye[B]=ye[C]=ye[ee]=!1;function Fe(Te,ge,Ke,ot,st,ht){var Je,tt=ge&R,hn=ge&N,Qt=ge&q;if(Ke&&(Je=st?Ke(Te,ot,st,ht):Ke(Te)),Je!==void 0)return Je;if(!k(Te))return Te;var zt=y(Te);if(zt){if(Je=g(Te),!tt)return a(Te,Je)}else{var St=m(Te),en=St==C||St==G;if(S(Te))return i(Te,tt);if(St==H||St==z||en&&!st){if(Je=hn||en?{}:v(Te),!tt)return hn?u(Te,s(Je,Te)):o(Te,r(Je,Te))}else{if(!ye[St])return st?Te:{};Je=x(Te,St,tt)}}ht||(ht=new n);var ln=ht.get(Te);if(ln)return ln;ht.set(Te,Je),$(Te)?Te.forEach(function(ct){Je.add(Fe(ct,ge,Ke,ct,Te,ht))}):Q(Te)&&Te.forEach(function(ct,de){Je.set(de,Fe(ct,ge,Ke,de,Te,ht))});var pt=Qt?hn?p:d:hn?T:j,Lt=zt?void 0:pt(Te);return e(Lt||Te,function(ct,de){Lt&&(de=ct,ct=Te[de]),t(Je,de,Fe(ct,ge,Ke,de,Te,ht))}),Je}return Ub=Fe,Ub}var Wb,mC;function cle(){if(mC)return Wb;mC=1;var n=AZ(),e=4;function t(r){return n(r,e)}return Wb=t,Wb}var Gb,OC;function Rk(){if(OC)return Gb;OC=1;function n(e){return function(){return e}}return Gb=n,Gb}var Ib,gC;function ule(){if(gC)return Ib;gC=1;function n(e){return function(t,r,s){for(var i=-1,a=Object(t),o=s(t),u=o.length;u--;){var d=o[e?u:++i];if(r(a[d],d,a)===!1)break}return t}}return Ib=n,Ib}var Hb,xC;function Ek(){if(xC)return Hb;xC=1;var n=ule(),e=n();return Hb=e,Hb}var Fb,bC;function Ak(){if(bC)return Fb;bC=1;var n=Ek(),e=Ga();function t(r,s){return r&&n(r,s,e)}return Fb=t,Fb}var Kb,yC;function fle(){if(yC)return Kb;yC=1;var n=Fi();function e(t,r){return function(s,i){if(s==null)return s;if(!n(s))return t(s,i);for(var a=s.length,o=r?a:-1,u=Object(s);(r?o--:++o<a)&&i(u[o],o,u)!==!1;);return s}}return Kb=e,Kb}var Jb,vC;function yO(){if(vC)return Jb;vC=1;var n=Ak(),e=fle(),t=e(n);return Jb=t,Jb}var ey,wC;function Hl(){if(wC)return ey;wC=1;function n(e){return e}return ey=n,ey}var ty,SC;function qZ(){if(SC)return ty;SC=1;var n=Hl();function e(t){return typeof t=="function"?t:n}return ty=e,ty}var ny,QC;function MZ(){if(QC)return ny;QC=1;var n=$k(),e=yO(),t=qZ(),r=Sn();function s(i,a){var o=r(i)?n:e;return o(i,t(a))}return ny=s,ny}var ry,kC;function XZ(){return kC||(kC=1,ry=MZ()),ry}var sy,$C;function dle(){if($C)return sy;$C=1;var n=yO();function e(t,r){var s=[];return n(t,function(i,a,o){r(i,a,o)&&s.push(i)}),s}return sy=e,sy}var iy,TC;function hle(){if(TC)return iy;TC=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return iy=e,iy}var ay,jC;function ple(){if(jC)return ay;jC=1;function n(e){return this.__data__.has(e)}return ay=n,ay}var ly,_C;function zZ(){if(_C)return ly;_C=1;var n=kk(),e=hle(),t=ple();function r(s){var i=-1,a=s==null?0:s.length;for(this.__data__=new n;++i<a;)this.add(s[i])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,ly=r,ly}var oy,PC;function mle(){if(PC)return oy;PC=1;function n(e,t){for(var r=-1,s=e==null?0:e.length;++r<s;)if(t(e[r],r,e))return!0;return!1}return oy=n,oy}var cy,NC;function LZ(){if(NC)return cy;NC=1;function n(e,t){return e.has(t)}return cy=n,cy}var uy,CC;function ZZ(){if(CC)return uy;CC=1;var n=zZ(),e=mle(),t=LZ(),r=1,s=2;function i(a,o,u,d,p,m){var g=u&r,x=a.length,v=o.length;if(x!=v&&!(g&&v>x))return!1;var y=m.get(a),S=m.get(o);if(y&&S)return y==o&&S==a;var Q=-1,k=!0,$=u&s?new n:void 0;for(m.set(a,o),m.set(o,a);++Q<x;){var j=a[Q],T=o[Q];if(d)var R=g?d(T,j,Q,o,a,m):d(j,T,Q,a,o,m);if(R!==void 0){if(R)continue;k=!1;break}if($){if(!e(o,function(N,q){if(!t($,q)&&(j===N||p(j,N,u,d,m)))return $.push(q)})){k=!1;break}}else if(!(j===T||p(j,T,u,d,m))){k=!1;break}}return m.delete(a),m.delete(o),k}return uy=i,uy}var fy,RC;function Ole(){if(RC)return fy;RC=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(s,i){r[++t]=[i,s]}),r}return fy=n,fy}var dy,EC;function qk(){if(EC)return dy;EC=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(s){r[++t]=s}),r}return dy=n,dy}var hy,AC;function gle(){if(AC)return hy;AC=1;var n=qc(),e=NZ(),t=Ac(),r=ZZ(),s=Ole(),i=qk(),a=1,o=2,u="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Map]",g="[object Number]",x="[object RegExp]",v="[object Set]",y="[object String]",S="[object Symbol]",Q="[object ArrayBuffer]",k="[object DataView]",$=n?n.prototype:void 0,j=$?$.valueOf:void 0;function T(R,N,q,z,L,E,V){switch(q){case k:if(R.byteLength!=N.byteLength||R.byteOffset!=N.byteOffset)return!1;R=R.buffer,N=N.buffer;case Q:return!(R.byteLength!=N.byteLength||!E(new e(R),new e(N)));case u:case d:case g:return t(+R,+N);case p:return R.name==N.name&&R.message==N.message;case x:case y:return R==N+"";case m:var B=s;case v:var C=z&a;if(B||(B=i),R.size!=N.size&&!C)return!1;var G=V.get(R);if(G)return G==N;z|=o,V.set(R,N);var A=r(B(R),B(N),z,L,E,V);return V.delete(R),A;case S:if(j)return j.call(R)==j.call(N)}return!1}return hy=T,hy}var py,qC;function xle(){if(qC)return py;qC=1;var n=_Z(),e=1,t=Object.prototype,r=t.hasOwnProperty;function s(i,a,o,u,d,p){var m=o&e,g=n(i),x=g.length,v=n(a),y=v.length;if(x!=y&&!m)return!1;for(var S=x;S--;){var Q=g[S];if(!(m?Q in a:r.call(a,Q)))return!1}var k=p.get(i),$=p.get(a);if(k&&$)return k==a&&$==i;var j=!0;p.set(i,a),p.set(a,i);for(var T=m;++S<x;){Q=g[S];var R=i[Q],N=a[Q];if(u)var q=m?u(N,R,Q,a,i,p):u(R,N,Q,i,a,p);if(!(q===void 0?R===N||d(R,N,o,u,p):q)){j=!1;break}T||(T=Q=="constructor")}if(j&&!T){var z=i.constructor,L=a.constructor;z!=L&&"constructor"in i&&"constructor"in a&&!(typeof z=="function"&&z instanceof z&&typeof L=="function"&&L instanceof L)&&(j=!1)}return p.delete(i),p.delete(a),j}return py=s,py}var my,MC;function ble(){if(MC)return my;MC=1;var n=hO(),e=ZZ(),t=gle(),r=xle(),s=Xc(),i=Sn(),a=Mc(),o=dd(),u=1,d="[object Arguments]",p="[object Array]",m="[object Object]",g=Object.prototype,x=g.hasOwnProperty;function v(y,S,Q,k,$,j){var T=i(y),R=i(S),N=T?p:s(y),q=R?p:s(S);N=N==d?m:N,q=q==d?m:q;var z=N==m,L=q==m,E=N==q;if(E&&a(y)){if(!a(S))return!1;T=!0,z=!1}if(E&&!z)return j||(j=new n),T||o(y)?e(y,S,Q,k,$,j):t(y,S,N,Q,k,$,j);if(!(Q&u)){var V=z&&x.call(y,"__wrapped__"),B=L&&x.call(S,"__wrapped__");if(V||B){var C=V?y.value():y,G=B?S.value():S;return j||(j=new n),$(C,G,Q,k,j)}}return E?(j||(j=new n),r(y,S,Q,k,$,j)):!1}return my=v,my}var Oy,XC;function VZ(){if(XC)return Oy;XC=1;var n=ble(),e=li();function t(r,s,i,a,o){return r===s?!0:r==null||s==null||!e(r)&&!e(s)?r!==r&&s!==s:n(r,s,i,a,t,o)}return Oy=t,Oy}var gy,zC;function yle(){if(zC)return gy;zC=1;var n=hO(),e=VZ(),t=1,r=2;function s(i,a,o,u){var d=o.length,p=d,m=!u;if(i==null)return!p;for(i=Object(i);d--;){var g=o[d];if(m&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++d<p;){g=o[d];var x=g[0],v=i[x],y=g[1];if(m&&g[2]){if(v===void 0&&!(x in i))return!1}else{var S=new n;if(u)var Q=u(v,y,x,i,a,S);if(!(Q===void 0?e(y,v,t|r,u,S):Q))return!1}}return!0}return gy=s,gy}var xy,LC;function YZ(){if(LC)return xy;LC=1;var n=ls();function e(t){return t===t&&!n(t)}return xy=e,xy}var by,ZC;function vle(){if(ZC)return by;ZC=1;var n=YZ(),e=Ga();function t(r){for(var s=e(r),i=s.length;i--;){var a=s[i],o=r[a];s[i]=[a,o,n(o)]}return s}return by=t,by}var yy,VC;function DZ(){if(VC)return yy;VC=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return yy=n,yy}var vy,YC;function wle(){if(YC)return vy;YC=1;var n=yle(),e=vle(),t=DZ();function r(s){var i=e(s);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(a){return a===s||n(a,s,i)}}return vy=r,vy}var wy,DC;function zc(){if(DC)return wy;DC=1;var n=Wl(),e=li(),t="[object Symbol]";function r(s){return typeof s=="symbol"||e(s)&&n(s)==t}return wy=r,wy}var Sy,BC;function Mk(){if(BC)return Sy;BC=1;var n=Sn(),e=zc(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(i,a){if(n(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||e(i)?!0:r.test(i)||!t.test(i)||a!=null&&i in Object(a)}return Sy=s,Sy}var Qy,UC;function Sle(){if(UC)return Qy;UC=1;var n=kk(),e="Expected a function";function t(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(e);var i=function(){var a=arguments,o=s?s.apply(this,a):a[0],u=i.cache;if(u.has(o))return u.get(o);var d=r.apply(this,a);return i.cache=u.set(o,d)||u,d};return i.cache=new(t.Cache||n),i}return t.Cache=n,Qy=t,Qy}var ky,WC;function Qle(){if(WC)return ky;WC=1;var n=Sle(),e=500;function t(r){var s=n(r,function(a){return i.size===e&&i.clear(),a}),i=s.cache;return s}return ky=t,ky}var $y,GC;function kle(){if(GC)return $y;GC=1;var n=Qle(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(s){var i=[];return s.charCodeAt(0)===46&&i.push(""),s.replace(e,function(a,o,u,d){i.push(u?d.replace(t,"$1"):o||a)}),i});return $y=r,$y}var Ty,IC;function vO(){if(IC)return Ty;IC=1;function n(e,t){for(var r=-1,s=e==null?0:e.length,i=Array(s);++r<s;)i[r]=t(e[r],r,e);return i}return Ty=n,Ty}var jy,HC;function $le(){if(HC)return jy;HC=1;var n=qc(),e=vO(),t=Sn(),r=zc(),s=n?n.prototype:void 0,i=s?s.toString:void 0;function a(o){if(typeof o=="string")return o;if(t(o))return e(o,a)+"";if(r(o))return i?i.call(o):"";var u=o+"";return u=="0"&&1/o==-1/0?"-0":u}return jy=a,jy}var _y,FC;function BZ(){if(FC)return _y;FC=1;var n=$le();function e(t){return t==null?"":n(t)}return _y=e,_y}var Py,KC;function wO(){if(KC)return Py;KC=1;var n=Sn(),e=Mk(),t=kle(),r=BZ();function s(i,a){return n(i)?i:e(i,a)?[i]:t(r(i))}return Py=s,Py}var Ny,JC;function hd(){if(JC)return Ny;JC=1;var n=zc();function e(t){if(typeof t=="string"||n(t))return t;var r=t+"";return r=="0"&&1/t==-1/0?"-0":r}return Ny=e,Ny}var Cy,eR;function SO(){if(eR)return Cy;eR=1;var n=wO(),e=hd();function t(r,s){s=n(s,r);for(var i=0,a=s.length;r!=null&&i<a;)r=r[e(s[i++])];return i&&i==a?r:void 0}return Cy=t,Cy}var Ry,tR;function Tle(){if(tR)return Ry;tR=1;var n=SO();function e(t,r,s){var i=t==null?void 0:n(t,r);return i===void 0?s:i}return Ry=e,Ry}var Ey,nR;function jle(){if(nR)return Ey;nR=1;function n(e,t){return e!=null&&t in Object(e)}return Ey=n,Ey}var Ay,rR;function UZ(){if(rR)return Ay;rR=1;var n=wO(),e=fd(),t=Sn(),r=OO(),s=Tk(),i=hd();function a(o,u,d){u=n(u,o);for(var p=-1,m=u.length,g=!1;++p<m;){var x=i(u[p]);if(!(g=o!=null&&d(o,x)))break;o=o[x]}return g||++p!=m?g:(m=o==null?0:o.length,!!m&&s(m)&&r(x,m)&&(t(o)||e(o)))}return Ay=a,Ay}var qy,sR;function WZ(){if(sR)return qy;sR=1;var n=jle(),e=UZ();function t(r,s){return r!=null&&e(r,s,n)}return qy=t,qy}var My,iR;function _le(){if(iR)return My;iR=1;var n=VZ(),e=Tle(),t=WZ(),r=Mk(),s=YZ(),i=DZ(),a=hd(),o=1,u=2;function d(p,m){return r(p)&&s(m)?i(a(p),m):function(g){var x=e(g,p);return x===void 0&&x===m?t(g,p):n(m,x,o|u)}}return My=d,My}var Xy,aR;function GZ(){if(aR)return Xy;aR=1;function n(e){return function(t){return t==null?void 0:t[e]}}return Xy=n,Xy}var zy,lR;function Ple(){if(lR)return zy;lR=1;var n=SO();function e(t){return function(r){return n(r,t)}}return zy=e,zy}var Ly,oR;function Nle(){if(oR)return Ly;oR=1;var n=GZ(),e=Ple(),t=Mk(),r=hd();function s(i){return t(i)?n(r(i)):e(i)}return Ly=s,Ly}var Zy,cR;function Ki(){if(cR)return Zy;cR=1;var n=wle(),e=_le(),t=Hl(),r=Sn(),s=Nle();function i(a){return typeof a=="function"?a:a==null?t:typeof a=="object"?r(a)?e(a[0],a[1]):n(a):s(a)}return Zy=i,Zy}var Vy,uR;function IZ(){if(uR)return Vy;uR=1;var n=kZ(),e=dle(),t=Ki(),r=Sn();function s(i,a){var o=r(i)?n:e;return o(i,t(a,3))}return Vy=s,Vy}var Yy,fR;function Cle(){if(fR)return Yy;fR=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,s){return r!=null&&e.call(r,s)}return Yy=t,Yy}var Dy,dR;function HZ(){if(dR)return Dy;dR=1;var n=Cle(),e=UZ();function t(r,s){return r!=null&&e(r,s,n)}return Dy=t,Dy}var By,hR;function Rle(){if(hR)return By;hR=1;var n=_k(),e=Xc(),t=fd(),r=Sn(),s=Fi(),i=Mc(),a=xO(),o=dd(),u="[object Map]",d="[object Set]",p=Object.prototype,m=p.hasOwnProperty;function g(x){if(x==null)return!0;if(s(x)&&(r(x)||typeof x=="string"||typeof x.splice=="function"||i(x)||o(x)||t(x)))return!x.length;var v=e(x);if(v==u||v==d)return!x.size;if(a(x))return!n(x).length;for(var y in x)if(m.call(x,y))return!1;return!0}return By=g,By}var Uy,pR;function FZ(){if(pR)return Uy;pR=1;function n(e){return e===void 0}return Uy=n,Uy}var Wy,mR;function KZ(){if(mR)return Wy;mR=1;var n=yO(),e=Fi();function t(r,s){var i=-1,a=e(r)?Array(r.length):[];return n(r,function(o,u,d){a[++i]=s(o,u,d)}),a}return Wy=t,Wy}var Gy,OR;function JZ(){if(OR)return Gy;OR=1;var n=vO(),e=Ki(),t=KZ(),r=Sn();function s(i,a){var o=r(i)?n:t;return o(i,e(a,3))}return Gy=s,Gy}var Iy,gR;function Ele(){if(gR)return Iy;gR=1;function n(e,t,r,s){var i=-1,a=e==null?0:e.length;for(s&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}return Iy=n,Iy}var Hy,xR;function Ale(){if(xR)return Hy;xR=1;function n(e,t,r,s,i){return i(e,function(a,o,u){r=s?(s=!1,a):t(r,a,o,u)}),r}return Hy=n,Hy}var Fy,bR;function e6(){if(bR)return Fy;bR=1;var n=Ele(),e=yO(),t=Ki(),r=Ale(),s=Sn();function i(a,o,u){var d=s(a)?n:r,p=arguments.length<3;return d(a,t(o,4),u,p,e)}return Fy=i,Fy}var Ky,yR;function qle(){if(yR)return Ky;yR=1;var n=Wl(),e=Sn(),t=li(),r="[object String]";function s(i){return typeof i=="string"||!e(i)&&t(i)&&n(i)==r}return Ky=s,Ky}var Jy,vR;function Mle(){if(vR)return Jy;vR=1;var n=GZ(),e=n("length");return Jy=e,Jy}var ev,wR;function Xle(){if(wR)return ev;wR=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=e+t+r,i="\\ufe0e\\ufe0f",a="\\u200d",o=RegExp("["+a+n+s+i+"]");function u(d){return o.test(d)}return ev=u,ev}var tv,SR;function zle(){if(SR)return tv;SR=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=e+t+r,i="\\ufe0e\\ufe0f",a="["+n+"]",o="["+s+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+o+"|"+u+")",p="[^"+n+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",v=d+"?",y="["+i+"]?",S="(?:"+x+"(?:"+[p,m,g].join("|")+")"+y+v+")*",Q=y+v+S,k="(?:"+[p+o+"?",o,m,g,a].join("|")+")",$=RegExp(u+"(?="+u+")|"+k+Q,"g");function j(T){for(var R=$.lastIndex=0;$.test(T);)++R;return R}return tv=j,tv}var nv,QR;function Lle(){if(QR)return nv;QR=1;var n=Mle(),e=Xle(),t=zle();function r(s){return e(s)?t(s):n(s)}return nv=r,nv}var rv,kR;function Zle(){if(kR)return rv;kR=1;var n=_k(),e=Xc(),t=Fi(),r=qle(),s=Lle(),i="[object Map]",a="[object Set]";function o(u){if(u==null)return 0;if(t(u))return r(u)?s(u):u.length;var d=e(u);return d==i||d==a?u.size:n(u).length}return rv=o,rv}var sv,$R;function Vle(){if($R)return sv;$R=1;var n=$k(),e=RZ(),t=Ak(),r=Ki(),s=bO(),i=Sn(),a=Mc(),o=cd(),u=ls(),d=dd();function p(m,g,x){var v=i(m),y=v||a(m)||d(m);if(g=r(g,4),x==null){var S=m&&m.constructor;y?x=v?new S:[]:u(m)?x=o(S)?e(s(m)):{}:x={}}return(y?n:t)(m,function(Q,k,$){return g(x,Q,k,$)}),x}return sv=p,sv}var iv,TR;function Yle(){if(TR)return iv;TR=1;var n=qc(),e=fd(),t=Sn(),r=n?n.isConcatSpreadable:void 0;function s(i){return t(i)||e(i)||!!(r&&i&&i[r])}return iv=s,iv}var av,jR;function Xk(){if(jR)return av;jR=1;var n=Nk(),e=Yle();function t(r,s,i,a,o){var u=-1,d=r.length;for(i||(i=e),o||(o=[]);++u<d;){var p=r[u];s>0&&i(p)?s>1?t(p,s-1,i,a,o):n(o,p):a||(o[o.length]=p)}return o}return av=t,av}var lv,_R;function Dle(){if(_R)return lv;_R=1;function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return lv=n,lv}var ov,PR;function t6(){if(PR)return ov;PR=1;var n=Dle(),e=Math.max;function t(r,s,i){return s=e(s===void 0?r.length-1:s,0),function(){for(var a=arguments,o=-1,u=e(a.length-s,0),d=Array(u);++o<u;)d[o]=a[s+o];o=-1;for(var p=Array(s+1);++o<s;)p[o]=a[o];return p[s]=i(d),n(r,this,p)}}return ov=t,ov}var cv,NR;function Ble(){if(NR)return cv;NR=1;var n=Rk(),e=yZ(),t=Hl(),r=e?function(s,i){return e(s,"toString",{configurable:!0,enumerable:!1,value:n(i),writable:!0})}:t;return cv=r,cv}var uv,CR;function Ule(){if(CR)return uv;CR=1;var n=800,e=16,t=Date.now;function r(s){var i=0,a=0;return function(){var o=t(),u=e-(o-a);if(a=o,u>0){if(++i>=n)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}return uv=r,uv}var fv,RR;function n6(){if(RR)return fv;RR=1;var n=Ble(),e=Ule(),t=e(n);return fv=t,fv}var dv,ER;function QO(){if(ER)return dv;ER=1;var n=Hl(),e=t6(),t=n6();function r(s,i){return t(e(s,i,n),s+"")}return dv=r,dv}var hv,AR;function r6(){if(AR)return hv;AR=1;function n(e,t,r,s){for(var i=e.length,a=r+(s?1:-1);s?a--:++a<i;)if(t(e[a],a,e))return a;return-1}return hv=n,hv}var pv,qR;function Wle(){if(qR)return pv;qR=1;function n(e){return e!==e}return pv=n,pv}var mv,MR;function Gle(){if(MR)return mv;MR=1;function n(e,t,r){for(var s=r-1,i=e.length;++s<i;)if(e[s]===t)return s;return-1}return mv=n,mv}var Ov,XR;function Ile(){if(XR)return Ov;XR=1;var n=r6(),e=Wle(),t=Gle();function r(s,i,a){return i===i?t(s,i,a):n(s,e,a)}return Ov=r,Ov}var gv,zR;function Hle(){if(zR)return gv;zR=1;var n=Ile();function e(t,r){var s=t==null?0:t.length;return!!s&&n(t,r,0)>-1}return gv=e,gv}var xv,LR;function Fle(){if(LR)return xv;LR=1;function n(e,t,r){for(var s=-1,i=e==null?0:e.length;++s<i;)if(r(t,e[s]))return!0;return!1}return xv=n,xv}var bv,ZR;function Kle(){if(ZR)return bv;ZR=1;function n(){}return bv=n,bv}var yv,VR;function Jle(){if(VR)return yv;VR=1;var n=PZ(),e=Kle(),t=qk(),r=1/0,s=n&&1/t(new n([,-0]))[1]==r?function(i){return new n(i)}:e;return yv=s,yv}var vv,YR;function eoe(){if(YR)return vv;YR=1;var n=zZ(),e=Hle(),t=Fle(),r=LZ(),s=Jle(),i=qk(),a=200;function o(u,d,p){var m=-1,g=e,x=u.length,v=!0,y=[],S=y;if(p)v=!1,g=t;else if(x>=a){var Q=d?null:s(u);if(Q)return i(Q);v=!1,g=r,S=new n}else S=d?[]:y;e:for(;++m<x;){var k=u[m],$=d?d(k):k;if(k=p||k!==0?k:0,v&&$===$){for(var j=S.length;j--;)if(S[j]===$)continue e;d&&S.push($),y.push(k)}else g(S,$,p)||(S!==y&&S.push($),y.push(k))}return y}return vv=o,vv}var wv,DR;function s6(){if(DR)return wv;DR=1;var n=Fi(),e=li();function t(r){return e(r)&&n(r)}return wv=t,wv}var Sv,BR;function toe(){if(BR)return Sv;BR=1;var n=Xk(),e=QO(),t=eoe(),r=s6(),s=e(function(i){return t(n(i,1,r,!0))});return Sv=s,Sv}var Qv,UR;function noe(){if(UR)return Qv;UR=1;var n=vO();function e(t,r){return n(r,function(s){return t[s]})}return Qv=e,Qv}var kv,WR;function i6(){if(WR)return kv;WR=1;var n=noe(),e=Ga();function t(r){return r==null?[]:n(r,e(r))}return kv=t,kv}var $v,GR;function os(){if(GR)return $v;GR=1;var n;if(typeof Sk=="function")try{n={clone:cle(),constant:Rk(),each:XZ(),filter:IZ(),has:HZ(),isArray:Sn(),isEmpty:Rle(),isFunction:cd(),isUndefined:FZ(),keys:Ga(),map:JZ(),reduce:e6(),size:Zle(),transform:Vle(),union:toe(),values:i6()}}catch{}return n||(n=window._),$v=n,$v}var Tv,IR;function zk(){if(IR)return Tv;IR=1;var n=os();Tv=s;var e="\0",t="\0",r="";function s(p){this._isDirected=n.has(p,"directed")?p.directed:!0,this._isMultigraph=n.has(p,"multigraph")?p.multigraph:!1,this._isCompound=n.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(p){return this._label=p,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(p){return n.isFunction(p)||(p=n.constant(p)),this._defaultNodeLabelFn=p,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return n.keys(this._nodes)},s.prototype.sources=function(){var p=this;return n.filter(this.nodes(),function(m){return n.isEmpty(p._in[m])})},s.prototype.sinks=function(){var p=this;return n.filter(this.nodes(),function(m){return n.isEmpty(p._out[m])})},s.prototype.setNodes=function(p,m){var g=arguments,x=this;return n.each(p,function(v){g.length>1?x.setNode(v,m):x.setNode(v)}),this},s.prototype.setNode=function(p,m){return n.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=m),this):(this._nodes[p]=arguments.length>1?m:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=t,this._children[p]={},this._children[t][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},s.prototype.node=function(p){return this._nodes[p]},s.prototype.hasNode=function(p){return n.has(this._nodes,p)},s.prototype.removeNode=function(p){var m=this;if(n.has(this._nodes,p)){var g=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],n.each(this.children(p),function(x){m.setParent(x)}),delete this._children[p]),n.each(n.keys(this._in[p]),g),delete this._in[p],delete this._preds[p],n.each(n.keys(this._out[p]),g),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},s.prototype.setParent=function(p,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(m))m=t;else{m+="";for(var g=m;!n.isUndefined(g);g=this.parent(g))if(g===p)throw new Error("Setting "+m+" as parent of "+p+" would create a cycle");this.setNode(m)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=m,this._children[m][p]=!0,this},s.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},s.prototype.parent=function(p){if(this._isCompound){var m=this._parent[p];if(m!==t)return m}},s.prototype.children=function(p){if(n.isUndefined(p)&&(p=t),this._isCompound){var m=this._children[p];if(m)return n.keys(m)}else{if(p===t)return this.nodes();if(this.hasNode(p))return[]}},s.prototype.predecessors=function(p){var m=this._preds[p];if(m)return n.keys(m)},s.prototype.successors=function(p){var m=this._sucs[p];if(m)return n.keys(m)},s.prototype.neighbors=function(p){var m=this.predecessors(p);if(m)return n.union(m,this.successors(p))},s.prototype.isLeaf=function(p){var m;return this.isDirected()?m=this.successors(p):m=this.neighbors(p),m.length===0},s.prototype.filterNodes=function(p){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var g=this;n.each(this._nodes,function(y,S){p(S)&&m.setNode(S,y)}),n.each(this._edgeObjs,function(y){m.hasNode(y.v)&&m.hasNode(y.w)&&m.setEdge(y,g.edge(y))});var x={};function v(y){var S=g.parent(y);return S===void 0||m.hasNode(S)?(x[y]=S,S):S in x?x[S]:v(S)}return this._isCompound&&n.each(m.nodes(),function(y){m.setParent(y,v(y))}),m},s.prototype.setDefaultEdgeLabel=function(p){return n.isFunction(p)||(p=n.constant(p)),this._defaultEdgeLabelFn=p,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return n.values(this._edgeObjs)},s.prototype.setPath=function(p,m){var g=this,x=arguments;return n.reduce(p,function(v,y){return x.length>1?g.setEdge(v,y,m):g.setEdge(v,y),y}),this},s.prototype.setEdge=function(){var p,m,g,x,v=!1,y=arguments[0];typeof y=="object"&&y!==null&&"v"in y?(p=y.v,m=y.w,g=y.name,arguments.length===2&&(x=arguments[1],v=!0)):(p=y,m=arguments[1],g=arguments[3],arguments.length>2&&(x=arguments[2],v=!0)),p=""+p,m=""+m,n.isUndefined(g)||(g=""+g);var S=o(this._isDirected,p,m,g);if(n.has(this._edgeLabels,S))return v&&(this._edgeLabels[S]=x),this;if(!n.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(m),this._edgeLabels[S]=v?x:this._defaultEdgeLabelFn(p,m,g);var Q=u(this._isDirected,p,m,g);return p=Q.v,m=Q.w,Object.freeze(Q),this._edgeObjs[S]=Q,i(this._preds[m],p),i(this._sucs[p],m),this._in[m][S]=Q,this._out[p][S]=Q,this._edgeCount++,this},s.prototype.edge=function(p,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):o(this._isDirected,p,m,g);return this._edgeLabels[x]},s.prototype.hasEdge=function(p,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):o(this._isDirected,p,m,g);return n.has(this._edgeLabels,x)},s.prototype.removeEdge=function(p,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):o(this._isDirected,p,m,g),v=this._edgeObjs[x];return v&&(p=v.v,m=v.w,delete this._edgeLabels[x],delete this._edgeObjs[x],a(this._preds[m],p),a(this._sucs[p],m),delete this._in[m][x],delete this._out[p][x],this._edgeCount--),this},s.prototype.inEdges=function(p,m){var g=this._in[p];if(g){var x=n.values(g);return m?n.filter(x,function(v){return v.v===m}):x}},s.prototype.outEdges=function(p,m){var g=this._out[p];if(g){var x=n.values(g);return m?n.filter(x,function(v){return v.w===m}):x}},s.prototype.nodeEdges=function(p,m){var g=this.inEdges(p,m);if(g)return g.concat(this.outEdges(p,m))};function i(p,m){p[m]?p[m]++:p[m]=1}function a(p,m){--p[m]||delete p[m]}function o(p,m,g,x){var v=""+m,y=""+g;if(!p&&v>y){var S=v;v=y,y=S}return v+r+y+r+(n.isUndefined(x)?e:x)}function u(p,m,g,x){var v=""+m,y=""+g;if(!p&&v>y){var S=v;v=y,y=S}var Q={v,w:y};return x&&(Q.name=x),Q}function d(p,m){return o(p,m.v,m.w,m.name)}return Tv}var jv,HR;function roe(){return HR||(HR=1,jv="2.1.8"),jv}var _v,FR;function soe(){return FR||(FR=1,_v={Graph:zk(),version:roe()}),_v}var Pv,KR;function ioe(){if(KR)return Pv;KR=1;var n=os(),e=zk();Pv={write:t,read:i};function t(a){var o={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return n.isUndefined(a.graph())||(o.value=n.clone(a.graph())),o}function r(a){return n.map(a.nodes(),function(o){var u=a.node(o),d=a.parent(o),p={v:o};return n.isUndefined(u)||(p.value=u),n.isUndefined(d)||(p.parent=d),p})}function s(a){return n.map(a.edges(),function(o){var u=a.edge(o),d={v:o.v,w:o.w};return n.isUndefined(o.name)||(d.name=o.name),n.isUndefined(u)||(d.value=u),d})}function i(a){var o=new e(a.options).setGraph(a.value);return n.each(a.nodes,function(u){o.setNode(u.v,u.value),u.parent&&o.setParent(u.v,u.parent)}),n.each(a.edges,function(u){o.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),o}return Pv}var Nv,JR;function aoe(){if(JR)return Nv;JR=1;var n=os();Nv=e;function e(t){var r={},s=[],i;function a(o){n.has(r,o)||(r[o]=!0,i.push(o),n.each(t.successors(o),a),n.each(t.predecessors(o),a))}return n.each(t.nodes(),function(o){i=[],a(o),i.length&&s.push(i)}),s}return Nv}var Cv,eE;function a6(){if(eE)return Cv;eE=1;var n=os();Cv=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return n.has(this._keyIndices,t)},e.prototype.priority=function(t){var r=this._keyIndices[t];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,r){var s=this._keyIndices;if(t=String(t),!n.has(s,t)){var i=this._arr,a=i.length;return s[t]=a,i.push({key:t,priority:r}),this._decrease(a),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,r){var s=this._keyIndices[t];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},e.prototype._heapify=function(t){var r=this._arr,s=2*t,i=s+1,a=t;s<r.length&&(a=r[s].priority<r[a].priority?s:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==t&&(this._swap(t,a),this._heapify(a)))},e.prototype._decrease=function(t){for(var r=this._arr,s=r[t].priority,i;t!==0&&(i=t>>1,!(r[i].priority<s));)this._swap(t,i),t=i},e.prototype._swap=function(t,r){var s=this._arr,i=this._keyIndices,a=s[t],o=s[r];s[t]=o,s[r]=a,i[o.key]=t,i[a.key]=r},Cv}var Rv,tE;function l6(){if(tE)return Rv;tE=1;var n=os(),e=a6();Rv=r;var t=n.constant(1);function r(i,a,o,u){return s(i,String(a),o||t,u||function(d){return i.outEdges(d)})}function s(i,a,o,u){var d={},p=new e,m,g,x=function(v){var y=v.v!==m?v.v:v.w,S=d[y],Q=o(v),k=g.distance+Q;if(Q<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+Q);k<S.distance&&(S.distance=k,S.predecessor=m,p.decrease(y,k))};for(i.nodes().forEach(function(v){var y=v===a?0:Number.POSITIVE_INFINITY;d[v]={distance:y},p.add(v,y)});p.size()>0&&(m=p.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)u(m).forEach(x);return d}return Rv}var Ev,nE;function loe(){if(nE)return Ev;nE=1;var n=l6(),e=os();Ev=t;function t(r,s,i){return e.transform(r.nodes(),function(a,o){a[o]=n(r,o,s,i)},{})}return Ev}var Av,rE;function o6(){if(rE)return Av;rE=1;var n=os();Av=e;function e(t){var r=0,s=[],i={},a=[];function o(u){var d=i[u]={onStack:!0,lowlink:r,index:r++};if(s.push(u),t.successors(u).forEach(function(g){n.has(i,g)?i[g].onStack&&(d.lowlink=Math.min(d.lowlink,i[g].index)):(o(g),d.lowlink=Math.min(d.lowlink,i[g].lowlink))}),d.lowlink===d.index){var p=[],m;do m=s.pop(),i[m].onStack=!1,p.push(m);while(u!==m);a.push(p)}}return t.nodes().forEach(function(u){n.has(i,u)||o(u)}),a}return Av}var qv,sE;function ooe(){if(sE)return qv;sE=1;var n=os(),e=o6();qv=t;function t(r){return n.filter(e(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return qv}var Mv,iE;function coe(){if(iE)return Mv;iE=1;var n=os();Mv=t;var e=n.constant(1);function t(s,i,a){return r(s,i||e,a||function(o){return s.outEdges(o)})}function r(s,i,a){var o={},u=s.nodes();return u.forEach(function(d){o[d]={},o[d][d]={distance:0},u.forEach(function(p){d!==p&&(o[d][p]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(p){var m=p.v===d?p.w:p.v,g=i(p);o[d][m]={distance:g,predecessor:d}})}),u.forEach(function(d){var p=o[d];u.forEach(function(m){var g=o[m];u.forEach(function(x){var v=g[d],y=p[x],S=g[x],Q=v.distance+y.distance;Q<S.distance&&(S.distance=Q,S.predecessor=y.predecessor)})})}),o}return Mv}var Xv,aE;function c6(){if(aE)return Xv;aE=1;var n=os();Xv=e,e.CycleException=t;function e(r){var s={},i={},a=[];function o(u){if(n.has(i,u))throw new t;n.has(s,u)||(i[u]=!0,s[u]=!0,n.each(r.predecessors(u),o),delete i[u],a.push(u))}if(n.each(r.sinks(),o),n.size(s)!==r.nodeCount())throw new t;return a}function t(){}return t.prototype=new Error,Xv}var zv,lE;function uoe(){if(lE)return zv;lE=1;var n=c6();zv=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return zv}var Lv,oE;function u6(){if(oE)return Lv;oE=1;var n=os();Lv=e;function e(r,s,i){n.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),o=[],u={};return n.each(s,function(d){if(!r.hasNode(d))throw new Error("Graph does not have node: "+d);t(r,d,i==="post",u,a,o)}),o}function t(r,s,i,a,o,u){n.has(a,s)||(a[s]=!0,i||u.push(s),n.each(o(s),function(d){t(r,d,i,a,o,u)}),i&&u.push(s))}return Lv}var Zv,cE;function foe(){if(cE)return Zv;cE=1;var n=u6();Zv=e;function e(t,r){return n(t,r,"post")}return Zv}var Vv,uE;function doe(){if(uE)return Vv;uE=1;var n=u6();Vv=e;function e(t,r){return n(t,r,"pre")}return Vv}var Yv,fE;function hoe(){if(fE)return Yv;fE=1;var n=os(),e=zk(),t=a6();Yv=r;function r(s,i){var a=new e,o={},u=new t,d;function p(g){var x=g.v===d?g.w:g.v,v=u.priority(x);if(v!==void 0){var y=i(g);y<v&&(o[x]=d,u.decrease(x,y))}}if(s.nodeCount()===0)return a;n.each(s.nodes(),function(g){u.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),u.decrease(s.nodes()[0],0);for(var m=!1;u.size()>0;){if(d=u.removeMin(),n.has(o,d))a.setEdge(d,o[d]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(d).forEach(p)}return a}return Yv}var Dv,dE;function poe(){return dE||(dE=1,Dv={components:aoe(),dijkstra:l6(),dijkstraAll:loe(),findCycles:ooe(),floydWarshall:coe(),isAcyclic:uoe(),postorder:foe(),preorder:doe(),prim:hoe(),tarjan:o6(),topsort:c6()}),Dv}var Bv,hE;function moe(){if(hE)return Bv;hE=1;var n=soe();return Bv={Graph:n.Graph,json:ioe(),alg:poe(),version:n.version},Bv}var Uv,pE;function Cs(){if(pE)return Uv;pE=1;var n;if(typeof Sk=="function")try{n=moe()}catch{}return n||(n=window.graphlib),Uv=n,Uv}var Wv,mE;function Ooe(){if(mE)return Wv;mE=1;var n=AZ(),e=1,t=4;function r(s){return n(s,e|t)}return Wv=r,Wv}var Gv,OE;function kO(){if(OE)return Gv;OE=1;var n=Ac(),e=Fi(),t=OO(),r=ls();function s(i,a,o){if(!r(o))return!1;var u=typeof a;return(u=="number"?e(o)&&t(a,o.length):u=="string"&&a in o)?n(o[a],i):!1}return Gv=s,Gv}var Iv,gE;function goe(){if(gE)return Iv;gE=1;var n=QO(),e=Ac(),t=kO(),r=Il(),s=Object.prototype,i=s.hasOwnProperty,a=n(function(o,u){o=Object(o);var d=-1,p=u.length,m=p>2?u[2]:void 0;for(m&&t(u[0],u[1],m)&&(p=1);++d<p;)for(var g=u[d],x=r(g),v=-1,y=x.length;++v<y;){var S=x[v],Q=o[S];(Q===void 0||e(Q,s[S])&&!i.call(o,S))&&(o[S]=g[S])}return o});return Iv=a,Iv}var Hv,xE;function xoe(){if(xE)return Hv;xE=1;var n=Ki(),e=Fi(),t=Ga();function r(s){return function(i,a,o){var u=Object(i);if(!e(i)){var d=n(a,3);i=t(i),a=function(m){return d(u[m],m,u)}}var p=s(i,a,o);return p>-1?u[d?i[p]:p]:void 0}}return Hv=r,Hv}var Fv,bE;function boe(){if(bE)return Fv;bE=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return Fv=e,Fv}var Kv,yE;function yoe(){if(yE)return Kv;yE=1;var n=boe(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return Kv=t,Kv}var Jv,vE;function voe(){if(vE)return Jv;vE=1;var n=yoe(),e=ls(),t=zc(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function u(d){if(typeof d=="number")return d;if(t(d))return r;if(e(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=e(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=n(d);var m=i.test(d);return m||a.test(d)?o(d.slice(2),m?2:8):s.test(d)?r:+d}return Jv=u,Jv}var ew,wE;function f6(){if(wE)return ew;wE=1;var n=voe(),e=1/0,t=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=n(s),s===e||s===-e){var i=s<0?-1:1;return i*t}return s===s?s:0}return ew=r,ew}var tw,SE;function woe(){if(SE)return tw;SE=1;var n=f6();function e(t){var r=n(t),s=r%1;return r===r?s?r-s:r:0}return tw=e,tw}var nw,QE;function Soe(){if(QE)return nw;QE=1;var n=r6(),e=Ki(),t=woe(),r=Math.max;function s(i,a,o){var u=i==null?0:i.length;if(!u)return-1;var d=o==null?0:t(o);return d<0&&(d=r(u+d,0)),n(i,e(a,3),d)}return nw=s,nw}var rw,kE;function Qoe(){if(kE)return rw;kE=1;var n=xoe(),e=Soe(),t=n(e);return rw=t,rw}var sw,$E;function d6(){if($E)return sw;$E=1;var n=Xk();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return sw=e,sw}var iw,TE;function koe(){if(TE)return iw;TE=1;var n=Ek(),e=qZ(),t=Il();function r(s,i){return s==null?s:n(s,e(i),t)}return iw=r,iw}var aw,jE;function $oe(){if(jE)return aw;jE=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return aw=n,aw}var lw,_E;function Toe(){if(_E)return lw;_E=1;var n=pO(),e=Ak(),t=Ki();function r(s,i){var a={};return i=t(i,3),e(s,function(o,u,d){n(a,u,i(o,u,d))}),a}return lw=r,lw}var ow,PE;function Lk(){if(PE)return ow;PE=1;var n=zc();function e(t,r,s){for(var i=-1,a=t.length;++i<a;){var o=t[i],u=r(o);if(u!=null&&(d===void 0?u===u&&!n(u):s(u,d)))var d=u,p=o}return p}return ow=e,ow}var cw,NE;function joe(){if(NE)return cw;NE=1;function n(e,t){return e>t}return cw=n,cw}var uw,CE;function _oe(){if(CE)return uw;CE=1;var n=Lk(),e=joe(),t=Hl();function r(s){return s&&s.length?n(s,t,e):void 0}return uw=r,uw}var fw,RE;function h6(){if(RE)return fw;RE=1;var n=pO(),e=Ac();function t(r,s,i){(i!==void 0&&!e(r[s],i)||i===void 0&&!(s in r))&&n(r,s,i)}return fw=t,fw}var dw,EE;function Poe(){if(EE)return dw;EE=1;var n=Wl(),e=bO(),t=li(),r="[object Object]",s=Function.prototype,i=Object.prototype,a=s.toString,o=i.hasOwnProperty,u=a.call(Object);function d(p){if(!t(p)||n(p)!=r)return!1;var m=e(p);if(m===null)return!0;var g=o.call(m,"constructor")&&m.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}return dw=d,dw}var hw,AE;function p6(){if(AE)return hw;AE=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return hw=n,hw}var pw,qE;function Noe(){if(qE)return pw;qE=1;var n=ud(),e=Il();function t(r){return n(r,e(r))}return pw=t,pw}var mw,ME;function Coe(){if(ME)return mw;ME=1;var n=h6(),e=SZ(),t=CZ(),r=QZ(),s=EZ(),i=fd(),a=Sn(),o=s6(),u=Mc(),d=cd(),p=ls(),m=Poe(),g=dd(),x=p6(),v=Noe();function y(S,Q,k,$,j,T,R){var N=x(S,k),q=x(Q,k),z=R.get(q);if(z){n(S,k,z);return}var L=T?T(N,q,k+"",S,Q,R):void 0,E=L===void 0;if(E){var V=a(q),B=!V&&u(q),C=!V&&!B&&g(q);L=q,V||B||C?a(N)?L=N:o(N)?L=r(N):B?(E=!1,L=e(q,!0)):C?(E=!1,L=t(q,!0)):L=[]:m(q)||i(q)?(L=N,i(N)?L=v(N):(!p(N)||d(N))&&(L=s(q))):E=!1}E&&(R.set(q,L),j(L,q,$,T,R),R.delete(q)),n(S,k,L)}return mw=y,mw}var Ow,XE;function Roe(){if(XE)return Ow;XE=1;var n=hO(),e=h6(),t=Ek(),r=Coe(),s=ls(),i=Il(),a=p6();function o(u,d,p,m,g){u!==d&&t(d,function(x,v){if(g||(g=new n),s(x))r(u,d,v,p,o,m,g);else{var y=m?m(a(u,v),x,v+"",u,d,g):void 0;y===void 0&&(y=x),e(u,v,y)}},i)}return Ow=o,Ow}var gw,zE;function Eoe(){if(zE)return gw;zE=1;var n=QO(),e=kO();function t(r){return n(function(s,i){var a=-1,o=i.length,u=o>1?i[o-1]:void 0,d=o>2?i[2]:void 0;for(u=r.length>3&&typeof u=="function"?(o--,u):void 0,d&&e(i[0],i[1],d)&&(u=o<3?void 0:u,o=1),s=Object(s);++a<o;){var p=i[a];p&&r(s,p,a,u)}return s})}return gw=t,gw}var xw,LE;function Aoe(){if(LE)return xw;LE=1;var n=Roe(),e=Eoe(),t=e(function(r,s,i){n(r,s,i)});return xw=t,xw}var bw,ZE;function m6(){if(ZE)return bw;ZE=1;function n(e,t){return e<t}return bw=n,bw}var yw,VE;function qoe(){if(VE)return yw;VE=1;var n=Lk(),e=m6(),t=Hl();function r(s){return s&&s.length?n(s,t,e):void 0}return yw=r,yw}var vw,YE;function Moe(){if(YE)return vw;YE=1;var n=Lk(),e=Ki(),t=m6();function r(s,i){return s&&s.length?n(s,e(i,2),t):void 0}return vw=r,vw}var ww,DE;function Xoe(){if(DE)return ww;DE=1;var n=Ms(),e=function(){return n.Date.now()};return ww=e,ww}var Sw,BE;function zoe(){if(BE)return Sw;BE=1;var n=mO(),e=wO(),t=OO(),r=ls(),s=hd();function i(a,o,u,d){if(!r(a))return a;o=e(o,a);for(var p=-1,m=o.length,g=m-1,x=a;x!=null&&++p<m;){var v=s(o[p]),y=u;if(v==="__proto__"||v==="constructor"||v==="prototype")return a;if(p!=g){var S=x[v];y=d?d(S,v,x):void 0,y===void 0&&(y=r(S)?S:t(o[p+1])?[]:{})}n(x,v,y),x=x[v]}return a}return Sw=i,Sw}var Qw,UE;function Loe(){if(UE)return Qw;UE=1;var n=SO(),e=zoe(),t=wO();function r(s,i,a){for(var o=-1,u=i.length,d={};++o<u;){var p=i[o],m=n(s,p);a(m,p)&&e(d,t(p,s),m)}return d}return Qw=r,Qw}var kw,WE;function Zoe(){if(WE)return kw;WE=1;var n=Loe(),e=WZ();function t(r,s){return n(r,s,function(i,a){return e(r,a)})}return kw=t,kw}var $w,GE;function Voe(){if(GE)return $w;GE=1;var n=d6(),e=t6(),t=n6();function r(s){return t(e(s,void 0,n),s+"")}return $w=r,$w}var Tw,IE;function Yoe(){if(IE)return Tw;IE=1;var n=Zoe(),e=Voe(),t=e(function(r,s){return r==null?{}:n(r,s)});return Tw=t,Tw}var jw,HE;function Doe(){if(HE)return jw;HE=1;var n=Math.ceil,e=Math.max;function t(r,s,i,a){for(var o=-1,u=e(n((s-r)/(i||1)),0),d=Array(u);u--;)d[a?u:++o]=r,r+=i;return d}return jw=t,jw}var _w,FE;function Boe(){if(FE)return _w;FE=1;var n=Doe(),e=kO(),t=f6();function r(s){return function(i,a,o){return o&&typeof o!="number"&&e(i,a,o)&&(a=o=void 0),i=t(i),a===void 0?(a=i,i=0):a=t(a),o=o===void 0?i<a?1:-1:t(o),n(i,a,o,s)}}return _w=r,_w}var Pw,KE;function Uoe(){if(KE)return Pw;KE=1;var n=Boe(),e=n();return Pw=e,Pw}var Nw,JE;function Woe(){if(JE)return Nw;JE=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return Nw=n,Nw}var Cw,eA;function Goe(){if(eA)return Cw;eA=1;var n=zc();function e(t,r){if(t!==r){var s=t!==void 0,i=t===null,a=t===t,o=n(t),u=r!==void 0,d=r===null,p=r===r,m=n(r);if(!d&&!m&&!o&&t>r||o&&u&&p&&!d&&!m||i&&u&&p||!s&&p||!a)return 1;if(!i&&!o&&!m&&t<r||m&&s&&a&&!i&&!o||d&&s&&a||!u&&a||!p)return-1}return 0}return Cw=e,Cw}var Rw,tA;function Ioe(){if(tA)return Rw;tA=1;var n=Goe();function e(t,r,s){for(var i=-1,a=t.criteria,o=r.criteria,u=a.length,d=s.length;++i<u;){var p=n(a[i],o[i]);if(p){if(i>=d)return p;var m=s[i];return p*(m=="desc"?-1:1)}}return t.index-r.index}return Rw=e,Rw}var Ew,nA;function Hoe(){if(nA)return Ew;nA=1;var n=vO(),e=SO(),t=Ki(),r=KZ(),s=Woe(),i=gO(),a=Ioe(),o=Hl(),u=Sn();function d(p,m,g){m.length?m=n(m,function(y){return u(y)?function(S){return e(S,y.length===1?y[0]:y)}:y}):m=[o];var x=-1;m=n(m,i(t));var v=r(p,function(y,S,Q){var k=n(m,function($){return $(y)});return{criteria:k,index:++x,value:y}});return s(v,function(y,S){return a(y,S,g)})}return Ew=d,Ew}var Aw,rA;function Foe(){if(rA)return Aw;rA=1;var n=Xk(),e=Hoe(),t=QO(),r=kO(),s=t(function(i,a){if(i==null)return[];var o=a.length;return o>1&&r(i,a[0],a[1])?a=[]:o>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),e(i,n(a,1),[])});return Aw=s,Aw}var qw,sA;function Koe(){if(sA)return qw;sA=1;var n=BZ(),e=0;function t(r){var s=++e;return n(r)+s}return qw=t,qw}var Mw,iA;function Joe(){if(iA)return Mw;iA=1;function n(e,t,r){for(var s=-1,i=e.length,a=t.length,o={};++s<i;){var u=s<a?t[s]:void 0;r(o,e[s],u)}return o}return Mw=n,Mw}var Xw,aA;function ece(){if(aA)return Xw;aA=1;var n=mO(),e=Joe();function t(r,s){return e(r||[],s||[],n)}return Xw=t,Xw}var zw,lA;function Gt(){if(lA)return zw;lA=1;var n;if(typeof Sk=="function")try{n={cloneDeep:Ooe(),constant:Rk(),defaults:goe(),each:XZ(),filter:IZ(),find:Qoe(),flatten:d6(),forEach:MZ(),forIn:koe(),has:HZ(),isUndefined:FZ(),last:$oe(),map:JZ(),mapValues:Toe(),max:_oe(),merge:Aoe(),min:qoe(),minBy:Moe(),now:Xoe(),pick:Yoe(),range:Uoe(),reduce:e6(),sortBy:Foe(),uniqueId:Koe(),values:i6(),zipObject:ece()}}catch{}return n||(n=window._),zw=n,zw}var Lw,oA;function tce(){if(oA)return Lw;oA=1,Lw=n;function n(){var r={};r._next=r._prev=r,this._sentinel=r}n.prototype.dequeue=function(){var r=this._sentinel,s=r._prev;if(s!==r)return e(s),s},n.prototype.enqueue=function(r){var s=this._sentinel;r._prev&&r._next&&e(r),r._next=s._next,s._next._prev=r,s._next=r,r._prev=s},n.prototype.toString=function(){for(var r=[],s=this._sentinel,i=s._prev;i!==s;)r.push(JSON.stringify(i,t)),i=i._prev;return"["+r.join(", ")+"]"};function e(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function t(r,s){if(r!=="_next"&&r!=="_prev")return s}return Lw}var Zw,cA;function nce(){if(cA)return Zw;cA=1;var n=Gt(),e=Cs().Graph,t=tce();Zw=s;var r=n.constant(1);function s(d,p){if(d.nodeCount()<=1)return[];var m=o(d,p||r),g=i(m.graph,m.buckets,m.zeroIdx);return n.flatten(n.map(g,function(x){return d.outEdges(x.v,x.w)}),!0)}function i(d,p,m){for(var g=[],x=p[p.length-1],v=p[0],y;d.nodeCount();){for(;y=v.dequeue();)a(d,p,m,y);for(;y=x.dequeue();)a(d,p,m,y);if(d.nodeCount()){for(var S=p.length-2;S>0;--S)if(y=p[S].dequeue(),y){g=g.concat(a(d,p,m,y,!0));break}}}return g}function a(d,p,m,g,x){var v=x?[]:void 0;return n.forEach(d.inEdges(g.v),function(y){var S=d.edge(y),Q=d.node(y.v);x&&v.push({v:y.v,w:y.w}),Q.out-=S,u(p,m,Q)}),n.forEach(d.outEdges(g.v),function(y){var S=d.edge(y),Q=y.w,k=d.node(Q);k.in-=S,u(p,m,k)}),d.removeNode(g.v),v}function o(d,p){var m=new e,g=0,x=0;n.forEach(d.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),n.forEach(d.edges(),function(S){var Q=m.edge(S.v,S.w)||0,k=p(S),$=Q+k;m.setEdge(S.v,S.w,$),x=Math.max(x,m.node(S.v).out+=k),g=Math.max(g,m.node(S.w).in+=k)});var v=n.range(x+g+3).map(function(){return new t}),y=g+1;return n.forEach(m.nodes(),function(S){u(v,y,m.node(S))}),{graph:m,buckets:v,zeroIdx:y}}function u(d,p,m){m.out?m.in?d[m.out-m.in+p].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return Zw}var Vw,uA;function rce(){if(uA)return Vw;uA=1;var n=Gt(),e=nce();Vw={run:t,undo:s};function t(i){var a=i.graph().acyclicer==="greedy"?e(i,o(i)):r(i);n.forEach(a,function(u){var d=i.edge(u);i.removeEdge(u),d.forwardName=u.name,d.reversed=!0,i.setEdge(u.w,u.v,d,n.uniqueId("rev"))});function o(u){return function(d){return u.edge(d).weight}}}function r(i){var a=[],o={},u={};function d(p){n.has(u,p)||(u[p]=!0,o[p]=!0,n.forEach(i.outEdges(p),function(m){n.has(o,m.w)?a.push(m):d(m.w)}),delete o[p])}return n.forEach(i.nodes(),d),a}function s(i){n.forEach(i.edges(),function(a){var o=i.edge(a);if(o.reversed){i.removeEdge(a);var u=o.forwardName;delete o.reversed,delete o.forwardName,i.setEdge(a.w,a.v,o,u)}})}return Vw}var Yw,fA;function gr(){if(fA)return Yw;fA=1;var n=Gt(),e=Cs().Graph;Yw={addDummyNode:t,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:o,buildLayerMatrix:u,normalizeRanks:d,removeEmptyRanks:p,addBorderNode:m,maxRank:g,partition:x,time:v,notime:y};function t(S,Q,k,$){var j;do j=n.uniqueId($);while(S.hasNode(j));return k.dummy=Q,S.setNode(j,k),j}function r(S){var Q=new e().setGraph(S.graph());return n.forEach(S.nodes(),function(k){Q.setNode(k,S.node(k))}),n.forEach(S.edges(),function(k){var $=Q.edge(k.v,k.w)||{weight:0,minlen:1},j=S.edge(k);Q.setEdge(k.v,k.w,{weight:$.weight+j.weight,minlen:Math.max($.minlen,j.minlen)})}),Q}function s(S){var Q=new e({multigraph:S.isMultigraph()}).setGraph(S.graph());return n.forEach(S.nodes(),function(k){S.children(k).length||Q.setNode(k,S.node(k))}),n.forEach(S.edges(),function(k){Q.setEdge(k,S.edge(k))}),Q}function i(S){var Q=n.map(S.nodes(),function(k){var $={};return n.forEach(S.outEdges(k),function(j){$[j.w]=($[j.w]||0)+S.edge(j).weight}),$});return n.zipObject(S.nodes(),Q)}function a(S){var Q=n.map(S.nodes(),function(k){var $={};return n.forEach(S.inEdges(k),function(j){$[j.v]=($[j.v]||0)+S.edge(j).weight}),$});return n.zipObject(S.nodes(),Q)}function o(S,Q){var k=S.x,$=S.y,j=Q.x-k,T=Q.y-$,R=S.width/2,N=S.height/2;if(!j&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var q,z;return Math.abs(T)*R>Math.abs(j)*N?(T<0&&(N=-N),q=N*j/T,z=N):(j<0&&(R=-R),q=R,z=R*T/j),{x:k+q,y:$+z}}function u(S){var Q=n.map(n.range(g(S)+1),function(){return[]});return n.forEach(S.nodes(),function(k){var $=S.node(k),j=$.rank;n.isUndefined(j)||(Q[j][$.order]=k)}),Q}function d(S){var Q=n.min(n.map(S.nodes(),function(k){return S.node(k).rank}));n.forEach(S.nodes(),function(k){var $=S.node(k);n.has($,"rank")&&($.rank-=Q)})}function p(S){var Q=n.min(n.map(S.nodes(),function(T){return S.node(T).rank})),k=[];n.forEach(S.nodes(),function(T){var R=S.node(T).rank-Q;k[R]||(k[R]=[]),k[R].push(T)});var $=0,j=S.graph().nodeRankFactor;n.forEach(k,function(T,R){n.isUndefined(T)&&R%j!==0?--$:$&&n.forEach(T,function(N){S.node(N).rank+=$})})}function m(S,Q,k,$){var j={width:0,height:0};return arguments.length>=4&&(j.rank=k,j.order=$),t(S,"border",j,Q)}function g(S){return n.max(n.map(S.nodes(),function(Q){var k=S.node(Q).rank;if(!n.isUndefined(k))return k}))}function x(S,Q){var k={lhs:[],rhs:[]};return n.forEach(S,function($){Q($)?k.lhs.push($):k.rhs.push($)}),k}function v(S,Q){var k=n.now();try{return Q()}finally{console.log(S+" time: "+(n.now()-k)+"ms")}}function y(S,Q){return Q()}return Yw}var Dw,dA;function sce(){if(dA)return Dw;dA=1;var n=Gt(),e=gr();Dw={run:t,undo:s};function t(i){i.graph().dummyChains=[],n.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var o=a.v,u=i.node(o).rank,d=a.w,p=i.node(d).rank,m=a.name,g=i.edge(a),x=g.labelRank;if(p!==u+1){i.removeEdge(a);var v,y,S;for(S=0,++u;u<p;++S,++u)g.points=[],y={width:0,height:0,edgeLabel:g,edgeObj:a,rank:u},v=e.addDummyNode(i,"edge",y,"_d"),u===x&&(y.width=g.width,y.height=g.height,y.dummy="edge-label",y.labelpos=g.labelpos),i.setEdge(o,v,{weight:g.weight},m),S===0&&i.graph().dummyChains.push(v),o=v;i.setEdge(o,d,{weight:g.weight},m)}}function s(i){n.forEach(i.graph().dummyChains,function(a){var o=i.node(a),u=o.edgeLabel,d;for(i.setEdge(o.edgeObj,u);o.dummy;)d=i.successors(a)[0],i.removeNode(a),u.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(u.x=o.x,u.y=o.y,u.width=o.width,u.height=o.height),a=d,o=i.node(a)})}return Dw}var Bw,hA;function Qm(){if(hA)return Bw;hA=1;var n=Gt();Bw={longestPath:e,slack:t};function e(r){var s={};function i(a){var o=r.node(a);if(n.has(s,a))return o.rank;s[a]=!0;var u=n.min(n.map(r.outEdges(a),function(d){return i(d.w)-r.edge(d).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),o.rank=u}n.forEach(r.sources(),i)}function t(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return Bw}var Uw,pA;function O6(){if(pA)return Uw;pA=1;var n=Gt(),e=Cs().Graph,t=Qm().slack;Uw=r;function r(o){var u=new e({directed:!1}),d=o.nodes()[0],p=o.nodeCount();u.setNode(d,{});for(var m,g;s(u,o)<p;)m=i(u,o),g=u.hasNode(m.v)?t(o,m):-t(o,m),a(u,o,g);return u}function s(o,u){function d(p){n.forEach(u.nodeEdges(p),function(m){var g=m.v,x=p===g?m.w:g;!o.hasNode(x)&&!t(u,m)&&(o.setNode(x,{}),o.setEdge(p,x,{}),d(x))})}return n.forEach(o.nodes(),d),o.nodeCount()}function i(o,u){return n.minBy(u.edges(),function(d){if(o.hasNode(d.v)!==o.hasNode(d.w))return t(u,d)})}function a(o,u,d){n.forEach(o.nodes(),function(p){u.node(p).rank+=d})}return Uw}var Ww,mA;function ice(){if(mA)return Ww;mA=1;var n=Gt(),e=O6(),t=Qm().slack,r=Qm().longestPath,s=Cs().alg.preorder,i=Cs().alg.postorder,a=gr().simplify;Ww=o,o.initLowLimValues=m,o.initCutValues=u,o.calcCutValue=p,o.leaveEdge=x,o.enterEdge=v,o.exchangeEdges=y;function o($){$=a($),r($);var j=e($);m(j),u(j,$);for(var T,R;T=x(j);)R=v(j,$,T),y(j,$,T,R)}function u($,j){var T=i($,$.nodes());T=T.slice(0,T.length-1),n.forEach(T,function(R){d($,j,R)})}function d($,j,T){var R=$.node(T),N=R.parent;$.edge(T,N).cutvalue=p($,j,T)}function p($,j,T){var R=$.node(T),N=R.parent,q=!0,z=j.edge(T,N),L=0;return z||(q=!1,z=j.edge(N,T)),L=z.weight,n.forEach(j.nodeEdges(T),function(E){var V=E.v===T,B=V?E.w:E.v;if(B!==N){var C=V===q,G=j.edge(E).weight;if(L+=C?G:-G,Q($,T,B)){var A=$.edge(T,B).cutvalue;L+=C?-A:A}}}),L}function m($,j){arguments.length<2&&(j=$.nodes()[0]),g($,{},1,j)}function g($,j,T,R,N){var q=T,z=$.node(R);return j[R]=!0,n.forEach($.neighbors(R),function(L){n.has(j,L)||(T=g($,j,T,L,R))}),z.low=q,z.lim=T++,N?z.parent=N:delete z.parent,T}function x($){return n.find($.edges(),function(j){return $.edge(j).cutvalue<0})}function v($,j,T){var R=T.v,N=T.w;j.hasEdge(R,N)||(R=T.w,N=T.v);var q=$.node(R),z=$.node(N),L=q,E=!1;q.lim>z.lim&&(L=z,E=!0);var V=n.filter(j.edges(),function(B){return E===k($,$.node(B.v),L)&&E!==k($,$.node(B.w),L)});return n.minBy(V,function(B){return t(j,B)})}function y($,j,T,R){var N=T.v,q=T.w;$.removeEdge(N,q),$.setEdge(R.v,R.w,{}),m($),u($,j),S($,j)}function S($,j){var T=n.find($.nodes(),function(N){return!j.node(N).parent}),R=s($,T);R=R.slice(1),n.forEach(R,function(N){var q=$.node(N).parent,z=j.edge(N,q),L=!1;z||(z=j.edge(q,N),L=!0),j.node(N).rank=j.node(q).rank+(L?z.minlen:-z.minlen)})}function Q($,j,T){return $.hasEdge(j,T)}function k($,j,T){return T.low<=j.lim&&j.lim<=T.lim}return Ww}var Gw,OA;function ace(){if(OA)return Gw;OA=1;var n=Qm(),e=n.longestPath,t=O6(),r=ice();Gw=s;function s(u){switch(u.graph().ranker){case"network-simplex":o(u);break;case"tight-tree":a(u);break;case"longest-path":i(u);break;default:o(u)}}var i=e;function a(u){e(u),t(u)}function o(u){r(u)}return Gw}var Iw,gA;function lce(){if(gA)return Iw;gA=1;var n=Gt();Iw=e;function e(s){var i=r(s);n.forEach(s.graph().dummyChains,function(a){for(var o=s.node(a),u=o.edgeObj,d=t(s,i,u.v,u.w),p=d.path,m=d.lca,g=0,x=p[g],v=!0;a!==u.w;){if(o=s.node(a),v){for(;(x=p[g])!==m&&s.node(x).maxRank<o.rank;)g++;x===m&&(v=!1)}if(!v){for(;g<p.length-1&&s.node(x=p[g+1]).minRank<=o.rank;)g++;x=p[g]}s.setParent(a,x),a=s.successors(a)[0]}})}function t(s,i,a,o){var u=[],d=[],p=Math.min(i[a].low,i[o].low),m=Math.max(i[a].lim,i[o].lim),g,x;g=a;do g=s.parent(g),u.push(g);while(g&&(i[g].low>p||m>i[g].lim));for(x=g,g=o;(g=s.parent(g))!==x;)d.push(g);return{path:u.concat(d.reverse()),lca:x}}function r(s){var i={},a=0;function o(u){var d=a;n.forEach(s.children(u),o),i[u]={low:d,lim:a++}}return n.forEach(s.children(),o),i}return Iw}var Hw,xA;function oce(){if(xA)return Hw;xA=1;var n=Gt(),e=gr();Hw={run:t,cleanup:a};function t(o){var u=e.addDummyNode(o,"root",{},"_root"),d=s(o),p=n.max(n.values(d))-1,m=2*p+1;o.graph().nestingRoot=u,n.forEach(o.edges(),function(x){o.edge(x).minlen*=m});var g=i(o)+1;n.forEach(o.children(),function(x){r(o,u,m,g,p,d,x)}),o.graph().nodeRankFactor=m}function r(o,u,d,p,m,g,x){var v=o.children(x);if(!v.length){x!==u&&o.setEdge(u,x,{weight:0,minlen:d});return}var y=e.addBorderNode(o,"_bt"),S=e.addBorderNode(o,"_bb"),Q=o.node(x);o.setParent(y,x),Q.borderTop=y,o.setParent(S,x),Q.borderBottom=S,n.forEach(v,function(k){r(o,u,d,p,m,g,k);var $=o.node(k),j=$.borderTop?$.borderTop:k,T=$.borderBottom?$.borderBottom:k,R=$.borderTop?p:2*p,N=j!==T?1:m-g[x]+1;o.setEdge(y,j,{weight:R,minlen:N,nestingEdge:!0}),o.setEdge(T,S,{weight:R,minlen:N,nestingEdge:!0})}),o.parent(x)||o.setEdge(u,y,{weight:0,minlen:m+g[x]})}function s(o){var u={};function d(p,m){var g=o.children(p);g&&g.length&&n.forEach(g,function(x){d(x,m+1)}),u[p]=m}return n.forEach(o.children(),function(p){d(p,1)}),u}function i(o){return n.reduce(o.edges(),function(u,d){return u+o.edge(d).weight},0)}function a(o){var u=o.graph();o.removeNode(u.nestingRoot),delete u.nestingRoot,n.forEach(o.edges(),function(d){var p=o.edge(d);p.nestingEdge&&o.removeEdge(d)})}return Hw}var Fw,bA;function cce(){if(bA)return Fw;bA=1;var n=Gt(),e=gr();Fw=t;function t(s){function i(a){var o=s.children(a),u=s.node(a);if(o.length&&n.forEach(o,i),n.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var d=u.minRank,p=u.maxRank+1;d<p;++d)r(s,"borderLeft","_bl",a,u,d),r(s,"borderRight","_br",a,u,d)}}n.forEach(s.children(),i)}function r(s,i,a,o,u,d){var p={width:0,height:0,rank:d,borderType:i},m=u[i][d-1],g=e.addDummyNode(s,"border",p,a);u[i][d]=g,s.setParent(g,o),m&&s.setEdge(m,g,{weight:1})}return Fw}var Kw,yA;function uce(){if(yA)return Kw;yA=1;var n=Gt();Kw={adjust:e,undo:t};function e(d){var p=d.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&r(d)}function t(d){var p=d.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&i(d),(p==="lr"||p==="rl")&&(o(d),r(d))}function r(d){n.forEach(d.nodes(),function(p){s(d.node(p))}),n.forEach(d.edges(),function(p){s(d.edge(p))})}function s(d){var p=d.width;d.width=d.height,d.height=p}function i(d){n.forEach(d.nodes(),function(p){a(d.node(p))}),n.forEach(d.edges(),function(p){var m=d.edge(p);n.forEach(m.points,a),n.has(m,"y")&&a(m)})}function a(d){d.y=-d.y}function o(d){n.forEach(d.nodes(),function(p){u(d.node(p))}),n.forEach(d.edges(),function(p){var m=d.edge(p);n.forEach(m.points,u),n.has(m,"x")&&u(m)})}function u(d){var p=d.x;d.x=d.y,d.y=p}return Kw}var Jw,vA;function fce(){if(vA)return Jw;vA=1;var n=Gt();Jw=e;function e(t){var r={},s=n.filter(t.nodes(),function(d){return!t.children(d).length}),i=n.max(n.map(s,function(d){return t.node(d).rank})),a=n.map(n.range(i+1),function(){return[]});function o(d){if(!n.has(r,d)){r[d]=!0;var p=t.node(d);a[p.rank].push(d),n.forEach(t.successors(d),o)}}var u=n.sortBy(s,function(d){return t.node(d).rank});return n.forEach(u,o),a}return Jw}var eS,wA;function dce(){if(wA)return eS;wA=1;var n=Gt();eS=e;function e(r,s){for(var i=0,a=1;a<s.length;++a)i+=t(r,s[a-1],s[a]);return i}function t(r,s,i){for(var a=n.zipObject(i,n.map(i,function(g,x){return x})),o=n.flatten(n.map(s,function(g){return n.sortBy(n.map(r.outEdges(g),function(x){return{pos:a[x.w],weight:r.edge(x).weight}}),"pos")}),!0),u=1;u<i.length;)u<<=1;var d=2*u-1;u-=1;var p=n.map(new Array(d),function(){return 0}),m=0;return n.forEach(o.forEach(function(g){var x=g.pos+u;p[x]+=g.weight;for(var v=0;x>0;)x%2&&(v+=p[x+1]),x=x-1>>1,p[x]+=g.weight;m+=g.weight*v})),m}return eS}var tS,SA;function hce(){if(SA)return tS;SA=1;var n=Gt();tS=e;function e(t,r){return n.map(r,function(s){var i=t.inEdges(s);if(i.length){var a=n.reduce(i,function(o,u){var d=t.edge(u),p=t.node(u.v);return{sum:o.sum+d.weight*p.order,weight:o.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return tS}var nS,QA;function pce(){if(QA)return nS;QA=1;var n=Gt();nS=e;function e(s,i){var a={};n.forEach(s,function(u,d){var p=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:d};n.isUndefined(u.barycenter)||(p.barycenter=u.barycenter,p.weight=u.weight)}),n.forEach(i.edges(),function(u){var d=a[u.v],p=a[u.w];!n.isUndefined(d)&&!n.isUndefined(p)&&(p.indegree++,d.out.push(a[u.w]))});var o=n.filter(a,function(u){return!u.indegree});return t(o)}function t(s){var i=[];function a(d){return function(p){p.merged||(n.isUndefined(p.barycenter)||n.isUndefined(d.barycenter)||p.barycenter>=d.barycenter)&&r(d,p)}}function o(d){return function(p){p.in.push(d),--p.indegree===0&&s.push(p)}}for(;s.length;){var u=s.pop();i.push(u),n.forEach(u.in.reverse(),a(u)),n.forEach(u.out,o(u))}return n.map(n.filter(i,function(d){return!d.merged}),function(d){return n.pick(d,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,o=0;s.weight&&(a+=s.barycenter*s.weight,o+=s.weight),i.weight&&(a+=i.barycenter*i.weight,o+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/o,s.weight=o,s.i=Math.min(i.i,s.i),i.merged=!0}return nS}var rS,kA;function mce(){if(kA)return rS;kA=1;var n=Gt(),e=gr();rS=t;function t(i,a){var o=e.partition(i,function(y){return n.has(y,"barycenter")}),u=o.lhs,d=n.sortBy(o.rhs,function(y){return-y.i}),p=[],m=0,g=0,x=0;u.sort(s(!!a)),x=r(p,d,x),n.forEach(u,function(y){x+=y.vs.length,p.push(y.vs),m+=y.barycenter*y.weight,g+=y.weight,x=r(p,d,x)});var v={vs:n.flatten(p,!0)};return g&&(v.barycenter=m/g,v.weight=g),v}function r(i,a,o){for(var u;a.length&&(u=n.last(a)).i<=o;)a.pop(),i.push(u.vs),o++;return o}function s(i){return function(a,o){return a.barycenter<o.barycenter?-1:a.barycenter>o.barycenter?1:i?o.i-a.i:a.i-o.i}}return rS}var sS,$A;function Oce(){if($A)return sS;$A=1;var n=Gt(),e=hce(),t=pce(),r=mce();sS=s;function s(o,u,d,p){var m=o.children(u),g=o.node(u),x=g?g.borderLeft:void 0,v=g?g.borderRight:void 0,y={};x&&(m=n.filter(m,function(T){return T!==x&&T!==v}));var S=e(o,m);n.forEach(S,function(T){if(o.children(T.v).length){var R=s(o,T.v,d,p);y[T.v]=R,n.has(R,"barycenter")&&a(T,R)}});var Q=t(S,d);i(Q,y);var k=r(Q,p);if(x&&(k.vs=n.flatten([x,k.vs,v],!0),o.predecessors(x).length)){var $=o.node(o.predecessors(x)[0]),j=o.node(o.predecessors(v)[0]);n.has(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+$.order+j.order)/(k.weight+2),k.weight+=2}return k}function i(o,u){n.forEach(o,function(d){d.vs=n.flatten(d.vs.map(function(p){return u[p]?u[p].vs:p}),!0)})}function a(o,u){n.isUndefined(o.barycenter)?(o.barycenter=u.barycenter,o.weight=u.weight):(o.barycenter=(o.barycenter*o.weight+u.barycenter*u.weight)/(o.weight+u.weight),o.weight+=u.weight)}return sS}var iS,TA;function gce(){if(TA)return iS;TA=1;var n=Gt(),e=Cs().Graph;iS=t;function t(s,i,a){var o=r(s),u=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(d){return s.node(d)});return n.forEach(s.nodes(),function(d){var p=s.node(d),m=s.parent(d);(p.rank===i||p.minRank<=i&&i<=p.maxRank)&&(u.setNode(d),u.setParent(d,m||o),n.forEach(s[a](d),function(g){var x=g.v===d?g.w:g.v,v=u.edge(x,d),y=n.isUndefined(v)?0:v.weight;u.setEdge(x,d,{weight:s.edge(g).weight+y})}),n.has(p,"minRank")&&u.setNode(d,{borderLeft:p.borderLeft[i],borderRight:p.borderRight[i]}))}),u}function r(s){for(var i;s.hasNode(i=n.uniqueId("_root")););return i}return iS}var aS,jA;function xce(){if(jA)return aS;jA=1;var n=Gt();aS=e;function e(t,r,s){var i={},a;n.forEach(s,function(o){for(var u=t.parent(o),d,p;u;){if(d=t.parent(u),d?(p=i[d],i[d]=u):(p=a,a=u),p&&p!==u){r.setEdge(p,u);return}u=d}})}return aS}var lS,_A;function bce(){if(_A)return lS;_A=1;var n=Gt(),e=fce(),t=dce(),r=Oce(),s=gce(),i=xce(),a=Cs().Graph,o=gr();lS=u;function u(g){var x=o.maxRank(g),v=d(g,n.range(1,x+1),"inEdges"),y=d(g,n.range(x-1,-1,-1),"outEdges"),S=e(g);m(g,S);for(var Q=Number.POSITIVE_INFINITY,k,$=0,j=0;j<4;++$,++j){p($%2?v:y,$%4>=2),S=o.buildLayerMatrix(g);var T=t(g,S);T<Q&&(j=0,k=n.cloneDeep(S),Q=T)}m(g,k)}function d(g,x,v){return n.map(x,function(y){return s(g,y,v)})}function p(g,x){var v=new a;n.forEach(g,function(y){var S=y.graph().root,Q=r(y,S,v,x);n.forEach(Q.vs,function(k,$){y.node(k).order=$}),i(y,v,Q.vs)})}function m(g,x){n.forEach(x,function(v){n.forEach(v,function(y,S){g.node(y).order=S})})}return lS}var oS,PA;function yce(){if(PA)return oS;PA=1;var n=Gt(),e=Cs().Graph,t=gr();oS={positionX:v,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:o,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:g,findSmallestWidthAlignment:m,balance:x};function r(Q,k){var $={};function j(T,R){var N=0,q=0,z=T.length,L=n.last(R);return n.forEach(R,function(E,V){var B=i(Q,E),C=B?Q.node(B).order:z;(B||E===L)&&(n.forEach(R.slice(q,V+1),function(G){n.forEach(Q.predecessors(G),function(A){var U=Q.node(A),H=U.order;(H<N||C<H)&&!(U.dummy&&Q.node(G).dummy)&&a($,A,G)})}),q=V+1,N=C)}),R}return n.reduce(k,j),$}function s(Q,k){var $={};function j(R,N,q,z,L){var E;n.forEach(n.range(N,q),function(V){E=R[V],Q.node(E).dummy&&n.forEach(Q.predecessors(E),function(B){var C=Q.node(B);C.dummy&&(C.order<z||C.order>L)&&a($,B,E)})})}function T(R,N){var q=-1,z,L=0;return n.forEach(N,function(E,V){if(Q.node(E).dummy==="border"){var B=Q.predecessors(E);B.length&&(z=Q.node(B[0]).order,j(N,L,V,q,z),L=V,q=z)}j(N,L,N.length,z,R.length)}),N}return n.reduce(k,T),$}function i(Q,k){if(Q.node(k).dummy)return n.find(Q.predecessors(k),function($){return Q.node($).dummy})}function a(Q,k,$){if(k>$){var j=k;k=$,$=j}var T=Q[k];T||(Q[k]=T={}),T[$]=!0}function o(Q,k,$){if(k>$){var j=k;k=$,$=j}return n.has(Q[k],$)}function u(Q,k,$,j){var T={},R={},N={};return n.forEach(k,function(q){n.forEach(q,function(z,L){T[z]=z,R[z]=z,N[z]=L})}),n.forEach(k,function(q){var z=-1;n.forEach(q,function(L){var E=j(L);if(E.length){E=n.sortBy(E,function(A){return N[A]});for(var V=(E.length-1)/2,B=Math.floor(V),C=Math.ceil(V);B<=C;++B){var G=E[B];R[L]===L&&z<N[G]&&!o($,L,G)&&(R[G]=L,R[L]=T[L]=T[G],z=N[G])}}})}),{root:T,align:R}}function d(Q,k,$,j,T){var R={},N=p(Q,k,$,T),q=T?"borderLeft":"borderRight";function z(V,B){for(var C=N.nodes(),G=C.pop(),A={};G;)A[G]?V(G):(A[G]=!0,C.push(G),C=C.concat(B(G))),G=C.pop()}function L(V){R[V]=N.inEdges(V).reduce(function(B,C){return Math.max(B,R[C.v]+N.edge(C))},0)}function E(V){var B=N.outEdges(V).reduce(function(G,A){return Math.min(G,R[A.w]-N.edge(A))},Number.POSITIVE_INFINITY),C=Q.node(V);B!==Number.POSITIVE_INFINITY&&C.borderType!==q&&(R[V]=Math.max(R[V],B))}return z(L,N.predecessors.bind(N)),z(E,N.successors.bind(N)),n.forEach(j,function(V){R[V]=R[$[V]]}),R}function p(Q,k,$,j){var T=new e,R=Q.graph(),N=y(R.nodesep,R.edgesep,j);return n.forEach(k,function(q){var z;n.forEach(q,function(L){var E=$[L];if(T.setNode(E),z){var V=$[z],B=T.edge(V,E);T.setEdge(V,E,Math.max(N(Q,L,z),B||0))}z=L})}),T}function m(Q,k){return n.minBy(n.values(k),function($){var j=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return n.forIn($,function(R,N){var q=S(Q,N)/2;j=Math.max(R+q,j),T=Math.min(R-q,T)}),j-T})}function g(Q,k){var $=n.values(k),j=n.min($),T=n.max($);n.forEach(["u","d"],function(R){n.forEach(["l","r"],function(N){var q=R+N,z=Q[q],L;if(z!==k){var E=n.values(z);L=N==="l"?j-n.min(E):T-n.max(E),L&&(Q[q]=n.mapValues(z,function(V){return V+L}))}})})}function x(Q,k){return n.mapValues(Q.ul,function($,j){if(k)return Q[k.toLowerCase()][j];var T=n.sortBy(n.map(Q,j));return(T[1]+T[2])/2})}function v(Q){var k=t.buildLayerMatrix(Q),$=n.merge(r(Q,k),s(Q,k)),j={},T;n.forEach(["u","d"],function(N){T=N==="u"?k:n.values(k).reverse(),n.forEach(["l","r"],function(q){q==="r"&&(T=n.map(T,function(V){return n.values(V).reverse()}));var z=(N==="u"?Q.predecessors:Q.successors).bind(Q),L=u(Q,T,$,z),E=d(Q,T,L.root,L.align,q==="r");q==="r"&&(E=n.mapValues(E,function(V){return-V})),j[N+q]=E})});var R=m(Q,j);return g(j,R),x(j,Q.graph().align)}function y(Q,k,$){return function(j,T,R){var N=j.node(T),q=j.node(R),z=0,L;if(z+=N.width/2,n.has(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":L=-N.width/2;break;case"r":L=N.width/2;break}if(L&&(z+=$?L:-L),L=0,z+=(N.dummy?k:Q)/2,z+=(q.dummy?k:Q)/2,z+=q.width/2,n.has(q,"labelpos"))switch(q.labelpos.toLowerCase()){case"l":L=q.width/2;break;case"r":L=-q.width/2;break}return L&&(z+=$?L:-L),L=0,z}}function S(Q,k){return Q.node(k).width}return oS}var cS,NA;function vce(){if(NA)return cS;NA=1;var n=Gt(),e=gr(),t=yce().positionX;cS=r;function r(i){i=e.asNonCompoundGraph(i),s(i),n.forEach(t(i),function(a,o){i.node(o).x=a})}function s(i){var a=e.buildLayerMatrix(i),o=i.graph().ranksep,u=0;n.forEach(a,function(d){var p=n.max(n.map(d,function(m){return i.node(m).height}));n.forEach(d,function(m){i.node(m).y=u+p/2}),u+=p+o})}return cS}var uS,CA;function wce(){if(CA)return uS;CA=1;var n=Gt(),e=rce(),t=sce(),r=ace(),s=gr().normalizeRanks,i=lce(),a=gr().removeEmptyRanks,o=oce(),u=cce(),d=uce(),p=bce(),m=vce(),g=gr(),x=Cs().Graph;uS=v;function v(Z,I){var K=I&&I.debugTiming?g.time:g.notime;K("layout",function(){var re=K(" buildLayoutGraph",function(){return z(Z)});K(" runLayout",function(){y(re,K)}),K(" updateInputGraph",function(){S(Z,re)})})}function y(Z,I){I(" makeSpaceForEdgeLabels",function(){L(Z)}),I(" removeSelfEdges",function(){W(Z)}),I(" acyclic",function(){e.run(Z)}),I(" nestingGraph.run",function(){o.run(Z)}),I(" rank",function(){r(g.asNonCompoundGraph(Z))}),I(" injectEdgeLabelProxies",function(){E(Z)}),I(" removeEmptyRanks",function(){a(Z)}),I(" nestingGraph.cleanup",function(){o.cleanup(Z)}),I(" normalizeRanks",function(){s(Z)}),I(" assignRankMinMax",function(){V(Z)}),I(" removeEdgeLabelProxies",function(){B(Z)}),I(" normalize.run",function(){t.run(Z)}),I(" parentDummyChains",function(){i(Z)}),I(" addBorderSegments",function(){u(Z)}),I(" order",function(){p(Z)}),I(" insertSelfEdges",function(){J(Z)}),I(" adjustCoordinateSystem",function(){d.adjust(Z)}),I(" position",function(){m(Z)}),I(" positionSelfEdges",function(){X(Z)}),I(" removeBorderNodes",function(){H(Z)}),I(" normalize.undo",function(){t.undo(Z)}),I(" fixupEdgeLabelCoords",function(){A(Z)}),I(" undoCoordinateSystem",function(){d.undo(Z)}),I(" translateGraph",function(){C(Z)}),I(" assignNodeIntersects",function(){G(Z)}),I(" reversePoints",function(){U(Z)}),I(" acyclic.undo",function(){e.undo(Z)})}function S(Z,I){n.forEach(Z.nodes(),function(K){var re=Z.node(K),se=I.node(K);re&&(re.x=se.x,re.y=se.y,I.children(K).length&&(re.width=se.width,re.height=se.height))}),n.forEach(Z.edges(),function(K){var re=Z.edge(K),se=I.edge(K);re.points=se.points,n.has(se,"x")&&(re.x=se.x,re.y=se.y)}),Z.graph().width=I.graph().width,Z.graph().height=I.graph().height}var Q=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$=["acyclicer","ranker","rankdir","align"],j=["width","height"],T={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],N={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},q=["labelpos"];function z(Z){var I=new x({multigraph:!0,compound:!0}),K=ee(Z.graph());return I.setGraph(n.merge({},k,D(K,Q),n.pick(K,$))),n.forEach(Z.nodes(),function(re){var se=ee(Z.node(re));I.setNode(re,n.defaults(D(se,j),T)),I.setParent(re,Z.parent(re))}),n.forEach(Z.edges(),function(re){var se=ee(Z.edge(re));I.setEdge(re,n.merge({},N,D(se,R),n.pick(se,q)))}),I}function L(Z){var I=Z.graph();I.ranksep/=2,n.forEach(Z.edges(),function(K){var re=Z.edge(K);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(I.rankdir==="TB"||I.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function E(Z){n.forEach(Z.edges(),function(I){var K=Z.edge(I);if(K.width&&K.height){var re=Z.node(I.v),se=Z.node(I.w),be={rank:(se.rank-re.rank)/2+re.rank,e:I};g.addDummyNode(Z,"edge-proxy",be,"_ep")}})}function V(Z){var I=0;n.forEach(Z.nodes(),function(K){var re=Z.node(K);re.borderTop&&(re.minRank=Z.node(re.borderTop).rank,re.maxRank=Z.node(re.borderBottom).rank,I=n.max(I,re.maxRank))}),Z.graph().maxRank=I}function B(Z){n.forEach(Z.nodes(),function(I){var K=Z.node(I);K.dummy==="edge-proxy"&&(Z.edge(K.e).labelRank=K.rank,Z.removeNode(I))})}function C(Z){var I=Number.POSITIVE_INFINITY,K=0,re=Number.POSITIVE_INFINITY,se=0,be=Z.graph(),$e=be.marginx||0,Xe=be.marginy||0;function ae(Qe){var Oe=Qe.x,ye=Qe.y,Fe=Qe.width,Te=Qe.height;I=Math.min(I,Oe-Fe/2),K=Math.max(K,Oe+Fe/2),re=Math.min(re,ye-Te/2),se=Math.max(se,ye+Te/2)}n.forEach(Z.nodes(),function(Qe){ae(Z.node(Qe))}),n.forEach(Z.edges(),function(Qe){var Oe=Z.edge(Qe);n.has(Oe,"x")&&ae(Oe)}),I-=$e,re-=Xe,n.forEach(Z.nodes(),function(Qe){var Oe=Z.node(Qe);Oe.x-=I,Oe.y-=re}),n.forEach(Z.edges(),function(Qe){var Oe=Z.edge(Qe);n.forEach(Oe.points,function(ye){ye.x-=I,ye.y-=re}),n.has(Oe,"x")&&(Oe.x-=I),n.has(Oe,"y")&&(Oe.y-=re)}),be.width=K-I+$e,be.height=se-re+Xe}function G(Z){n.forEach(Z.edges(),function(I){var K=Z.edge(I),re=Z.node(I.v),se=Z.node(I.w),be,$e;K.points?(be=K.points[0],$e=K.points[K.points.length-1]):(K.points=[],be=se,$e=re),K.points.unshift(g.intersectRect(re,be)),K.points.push(g.intersectRect(se,$e))})}function A(Z){n.forEach(Z.edges(),function(I){var K=Z.edge(I);if(n.has(K,"x"))switch((K.labelpos==="l"||K.labelpos==="r")&&(K.width-=K.labeloffset),K.labelpos){case"l":K.x-=K.width/2+K.labeloffset;break;case"r":K.x+=K.width/2+K.labeloffset;break}})}function U(Z){n.forEach(Z.edges(),function(I){var K=Z.edge(I);K.reversed&&K.points.reverse()})}function H(Z){n.forEach(Z.nodes(),function(I){if(Z.children(I).length){var K=Z.node(I),re=Z.node(K.borderTop),se=Z.node(K.borderBottom),be=Z.node(n.last(K.borderLeft)),$e=Z.node(n.last(K.borderRight));K.width=Math.abs($e.x-be.x),K.height=Math.abs(se.y-re.y),K.x=be.x+K.width/2,K.y=re.y+K.height/2}}),n.forEach(Z.nodes(),function(I){Z.node(I).dummy==="border"&&Z.removeNode(I)})}function W(Z){n.forEach(Z.edges(),function(I){if(I.v===I.w){var K=Z.node(I.v);K.selfEdges||(K.selfEdges=[]),K.selfEdges.push({e:I,label:Z.edge(I)}),Z.removeEdge(I)}})}function J(Z){var I=g.buildLayerMatrix(Z);n.forEach(I,function(K){var re=0;n.forEach(K,function(se,be){var $e=Z.node(se);$e.order=be+re,n.forEach($e.selfEdges,function(Xe){g.addDummyNode(Z,"selfedge",{width:Xe.label.width,height:Xe.label.height,rank:$e.rank,order:be+ ++re,e:Xe.e,label:Xe.label},"_se")}),delete $e.selfEdges})})}function X(Z){n.forEach(Z.nodes(),function(I){var K=Z.node(I);if(K.dummy==="selfedge"){var re=Z.node(K.e.v),se=re.x+re.width/2,be=re.y,$e=K.x-se,Xe=re.height/2;Z.setEdge(K.e,K.label),Z.removeNode(I),K.label.points=[{x:se+2*$e/3,y:be-Xe},{x:se+5*$e/6,y:be-Xe},{x:se+$e,y:be},{x:se+5*$e/6,y:be+Xe},{x:se+2*$e/3,y:be+Xe}],K.label.x=K.x,K.label.y=K.y}})}function D(Z,I){return n.mapValues(n.pick(Z,I),Number)}function ee(Z){var I={};return n.forEach(Z,function(K,re){I[re.toLowerCase()]=K}),I}return uS}var fS,RA;function Sce(){if(RA)return fS;RA=1;var n=Gt(),e=gr(),t=Cs().Graph;fS={debugOrdering:r};function r(s){var i=e.buildLayerMatrix(s),a=new t({compound:!0,multigraph:!0}).setGraph({});return n.forEach(s.nodes(),function(o){a.setNode(o,{label:o}),a.setParent(o,"layer"+s.node(o).rank)}),n.forEach(s.edges(),function(o){a.setEdge(o.v,o.w,{},o.name)}),n.forEach(i,function(o,u){var d="layer"+u;a.setNode(d,{rank:"same"}),n.reduce(o,function(p,m){return a.setEdge(p,m,{style:"invis"}),m})}),a}return fS}var dS,EA;function Qce(){return EA||(EA=1,dS="0.8.5"),dS}var hS,AA;function kce(){return AA||(AA=1,hS={graphlib:Cs(),layout:wce(),debug:Sce(),util:{time:gr().time,notime:gr().notime},version:Qce()}),hS}var $ce=kce();const qA=km($ce),Ur=({content:n,children:e})=>f.jsxs("div",{className:"relative group flex items-center",children:[e,f.jsx("div",{className:"absolute top-full mt-2 w-max max-w-xs bg-gray-900 text-white text-xs rounded-md py-1.5 px-3 opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 ring-1 ring-white/10 shadow-lg",children:n})]}),Tce=({data:n,selected:e,xPos:t,yPos:r})=>{var k,$;const{label:s,module:i,promptInfo:a,hasPrompt:o,colors:u,onClick:d,editMode:p,onEdit:m,isHighlighted:g}=n,x=!!(a!=null&&a.code),v=!!(a!=null&&a.test),y=!!(a!=null&&a.example),S=()=>{d&&d(i)},Q=j=>{j.stopPropagation(),m&&m(i)};return f.jsxs(f.Fragment,{children:[f.jsx(kc,{type:"target",position:ze.Top,className:"!bg-blue-400 !w-2 !h-2"}),f.jsx(Ur,{content:f.jsxs("div",{className:"max-w-xs",children:[f.jsx("div",{className:"font-medium",children:i.filename}),f.jsx("div",{className:"text-xs text-surface-400 mt-1",children:i.filepath}),f.jsxs("div",{className:"text-xs mt-2",children:[(k=i.description)==null?void 0:k.substring(0,100),"..."]}),o&&f.jsxs("div",{className:"mt-2 pt-2 border-t border-surface-700/50",children:[f.jsxs("div",{className:"text-xs text-emerald-400 flex items-center gap-1 mb-1",children:[f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Prompt exists"]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs mt-1",children:[f.jsxs("span",{className:x?"text-green-400":"text-surface-500",children:[x?"✓":"✗"," Code"]}),f.jsxs("span",{className:v?"text-yellow-400":"text-surface-500",children:[v?"✓":"✗"," Test"]}),f.jsxs("span",{className:y?"text-blue-400":"text-surface-500",children:[y?"✓":"✗"," Example"]})]})]})]}),children:f.jsxs("div",{onClick:S,className:`
|
|
335
|
-
relative px-4 py-3 rounded-xl border cursor-pointer
|
|
336
|
-
transition-all duration-200 hover:scale-105 group
|
|
337
|
-
${u.bg} ${u.border} ${u.hover}
|
|
338
|
-
${o?"ring-2 ring-emerald-500/50":""}
|
|
339
|
-
${e?"ring-2 ring-accent-500":""}
|
|
340
|
-
${g?"ring-2 ring-red-500 animate-pulse":""}
|
|
341
|
-
`,style:{width:200,minHeight:85},children:[p&&f.jsx("button",{onClick:Q,className:"absolute -top-2 -left-2 w-6 h-6 bg-accent-600 hover:bg-accent-500 rounded-full flex items-center justify-center shadow-lg z-20 opacity-0 group-hover:opacity-100 transition-opacity",title:"Edit module",children:f.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),o&&f.jsx("div",{className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-emerald-500 rounded-full flex items-center justify-center shadow-lg z-10",children:f.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),o&&f.jsxs("div",{className:"absolute -bottom-1.5 right-1 flex gap-0.5 z-10",children:[f.jsx("div",{className:`w-3.5 h-3.5 rounded-full flex items-center justify-center text-[8px] font-bold ${x?"bg-green-500 text-white":"bg-surface-700 text-surface-500"}`,title:x?"Code exists":"No code file",children:"C"}),f.jsx("div",{className:`w-3.5 h-3.5 rounded-full flex items-center justify-center text-[8px] font-bold ${v?"bg-yellow-500 text-white":"bg-surface-700 text-surface-500"}`,title:v?"Test exists":"No test file",children:"T"}),f.jsx("div",{className:`w-3.5 h-3.5 rounded-full flex items-center justify-center text-[8px] font-bold ${y?"bg-blue-500 text-white":"bg-surface-700 text-surface-500"}`,title:y?"Example exists":"No example file",children:"E"})]}),f.jsx("p",{className:"font-medium text-sm text-white truncate w-full",children:s}),!1,f.jsx("p",{className:`text-xs ${u.text} truncate w-full`,children:(($=i.interface)==null?void 0:$.type)||"module"}),f.jsxs("p",{className:"text-xs text-surface-500 truncate w-full",children:["Priority: ",i.priority]})]})}),f.jsx(kc,{type:"source",position:ze.Bottom,className:"!bg-blue-400 !w-2 !h-2"})]})},jce=P.memo(Tce),MA=200,XA=85,_ce=n=>{const e=n.tags||[],t=["frontend","react","nextjs","ui","page","component","css","html"],r=["backend","api","database","sqlalchemy","fastapi","python","server"];return e.some(s=>t.includes(s.toLowerCase()))?"frontend":e.some(s=>r.includes(s.toLowerCase()))?"backend":"shared"},Pce=n=>{switch(n){case"frontend":return{bg:"bg-orange-500/20",border:"border-orange-500/50",hover:"hover:border-orange-400",text:"text-orange-300"};case"backend":return{bg:"bg-blue-500/20",border:"border-blue-500/50",hover:"hover:border-blue-400",text:"text-blue-300"};default:return{bg:"bg-green-500/20",border:"border-green-500/50",hover:"hover:border-green-400",text:"text-green-300"}}},zA=(n,e,t="TB")=>{const r=new qA.graphlib.Graph;return r.setGraph({rankdir:t,nodesep:50,ranksep:100,edgesep:20}),r.setDefaultEdgeLabel(()=>({})),n.forEach(i=>{r.setNode(i.id,{width:MA,height:XA})}),e.forEach(i=>{r.setEdge(i.source,i.target)}),qA.layout(r),{nodes:n.map(i=>{const a=r.node(i.id);return{...i,position:{x:a.x-MA/2,y:a.y-XA/2}}}),edges:e}},Nce={moduleNode:jce},Cce=({architecture:n,prdContent:e,appName:t,onRegenerate:r,onModuleClick:s,onGeneratePrompts:i,isGeneratingPrompts:a=!1,existingPrompts:o=new Set,promptsInfo:u=[],editMode:d=!1,onModuleEdit:p,onModuleDelete:m,onDependencyAdd:g,onDependencyRemove:x,onPositionsChange:v,highlightedModules:y=new Set})=>{const[S,Q]=P.useState(!1),[k,$]=P.useState(null),j=P.useMemo(()=>{const Z=new Map;for(const I of u){const K=I.prompt.split("/").pop()||"";Z.set(K,I)}return Z},[u]),{initialNodes:T,initialEdges:R}=P.useMemo(()=>{const Z=n.some(se=>se.position),I=n.map(se=>{const be=_ce(se),$e=o.has(se.filename),Xe=y.has(se.filename);return{id:se.filename,type:"moduleNode",position:se.position||{x:0,y:0},data:{label:se.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,""),module:se,promptInfo:j.get(se.filename),hasPrompt:$e,colors:Pce(be),onClick:s,editMode:d,onEdit:p,onDelete:m,isHighlighted:Xe}}}),K=new Set(n.map(se=>se.filename)),re=n.flatMap(se=>se.dependencies.filter(be=>K.has(be)).map(be=>({id:`${be}->${se.filename}`,source:be,target:se.filename,type:"smoothstep",style:{stroke:"#60a5fa",strokeWidth:2},markerEnd:{type:Pl.ArrowClosed,color:"#60a5fa",width:20,height:20},animated:!1,selectable:d,focusable:d,deletable:d,interactionWidth:20})));if(!Z){const se=zA(I,re,"TB");return{initialNodes:se.nodes,initialEdges:se.edges}}return{initialNodes:I,initialEdges:re}},[n,o,j,s,d,p,m,y]),[N,q,z]=Lie(T),[L,E,V]=Zie(R),B=P.useCallback(()=>{const Z=zA(N,L,"TB");q(Z.nodes),E(Z.edges)},[N,L,q,E]),C=P.useCallback(Z=>{!d||!Z.source||!Z.target||(g==null||g(Z.target,Z.source),E(I=>NL({...Z,id:`${Z.source}->${Z.target}`,type:"smoothstep",style:{stroke:"#60a5fa",strokeWidth:2},markerEnd:{type:Pl.ArrowClosed,color:"#60a5fa",width:20,height:20},animated:!1},I)))},[d,g,E]),G=P.useCallback(Z=>{if(d)for(const I of Z)x==null||x(I.target,I.source)},[d,x]),A=P.useCallback((Z,I)=>{d&&($(null),E(K=>K.map(re=>({...re,selected:re.id===I.id,style:{...re.style,stroke:re.id===I.id?"#ef4444":"#60a5fa",strokeWidth:re.id===I.id?3:2},markerEnd:re.markerEnd?{...re.markerEnd,color:re.id===I.id?"#ef4444":"#60a5fa"}:void 0}))))},[d,E]),U=P.useCallback((Z,I)=>{d&&(Z.preventDefault(),$({x:Z.clientX,y:Z.clientY,edge:I}))},[d]),H=P.useCallback(()=>{if(!k)return;const Z=k.edge;x==null||x(Z.target,Z.source),E(I=>I.filter(K=>K.id!==Z.id)),$(null)},[k,x,E]),W=P.useCallback(()=>{$(null)},[]),J=P.useCallback(Z=>{if(d)for(const I of Z)m==null||m(I.id)},[d,m]),X=P.useCallback((Z,I,K)=>{if(!d)return;const re=new Map;K.forEach(se=>{re.set(se.id,{x:se.position.x,y:se.position.y})}),v==null||v(re)},[d,v]),D=ue.useRef(n),ee=P.useCallback(Z=>Z.map(I=>({filename:I.filename,dependencies:[...I.dependencies].sort().join(",")})).sort((I,K)=>I.filename.localeCompare(K.filename)).map(I=>`${I.filename}:${I.dependencies}`).join("|"),[]);return ue.useEffect(()=>{const Z=ee(D.current),I=ee(n),K=Z!==I;D.current=n,(K||!d)&&(q(T),E(R))},[T,R,q,E,d,n,ee]),f.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 overflow-hidden h-full flex flex-col",children:[f.jsxs("div",{className:"bg-surface-800/80 border-b border-surface-700/50 flex-shrink-0",children:[f.jsxs("div",{className:"flex justify-between items-center p-3",children:[f.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>Q(!S),children:[f.jsx("h3",{className:"font-semibold text-sm text-white",children:t||"Product Requirements Document"}),f.jsxs("p",{className:"text-xs text-surface-400",children:[n.length," modules"]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-4",children:[i&&f.jsx(Ur,{content:"Generate prompt files for all modules",children:f.jsxs("button",{onClick:i,disabled:a,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-emerald-600 text-white hover:bg-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[a?f.jsx(gf,{className:"w-3.5 h-3.5 animate-spin"}):f.jsx(ZJ,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:a?"Generating...":"Generate Prompts"})]})}),f.jsx(Ur,{content:"Regenerate architecture from PRD",children:f.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-accent-600 text-white hover:bg-accent-500 transition-colors",children:[f.jsx(Lz,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:"Regenerate"})]})}),f.jsx(Ur,{content:S?"Collapse":"Expand",children:f.jsx("button",{onClick:()=>Q(!S),className:"p-1.5 rounded-lg hover:bg-surface-700 transition-colors",children:S?f.jsx(pm,{className:"w-4 h-4 text-surface-400"}):f.jsx(mm,{className:"w-4 h-4 text-surface-400"})})})]})]}),S&&f.jsx("div",{className:"border-t border-surface-700/50",children:f.jsx("pre",{className:"p-3 text-xs text-surface-300 whitespace-pre-wrap overflow-auto max-h-[200px] font-mono",children:e||"No PRD content available"})})]}),f.jsx("div",{className:"flex-1 min-h-0",children:f.jsxs(dZ,{nodes:N,edges:L,onNodesChange:z,onEdgesChange:V,onConnect:d?C:void 0,onEdgeClick:d?A:void 0,onEdgeContextMenu:d?U:void 0,onPaneClick:W,onNodeDragStop:d?X:void 0,onEdgesDelete:d?G:void 0,onNodesDelete:d?J:void 0,nodeTypes:Nce,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,defaultEdgeOptions:{style:{stroke:"#60a5fa",strokeWidth:2},type:"smoothstep",markerEnd:{type:Pl.ArrowClosed,color:"#60a5fa",width:20,height:20},interactionWidth:20},connectionMode:d?Ii.Loose:Ii.Strict,deleteKeyCode:d?["Backspace","Delete"]:null,edgesUpdatable:d,edgesFocusable:d,elementsSelectable:d,selectNodesOnDrag:!1,proOptions:{hideAttribution:!0},children:[f.jsx(uae,{variant:ts.Dots,gap:20,size:1,color:"#374151"}),f.jsx(sae,{className:"!bg-surface-800 !border-surface-700 !rounded-lg [&>button]:!bg-surface-700 [&>button]:!border-surface-600 [&>button]:!text-surface-300 [&>button:hover]:!bg-surface-600"}),f.jsx(Fie,{className:"!bg-surface-800 !border-surface-700 !rounded-lg",nodeColor:Z=>{const I=Z.data;return I.hasPrompt?"#10b981":I.colors.bg.includes("orange")?"#f97316":I.colors.bg.includes("blue")?"#3b82f6":"#22c55e"},maskColor:"rgba(0, 0, 0, 0.6)"}),f.jsx(aO,{position:"bottom-right",className:"!m-4",children:f.jsxs("div",{className:"bg-surface-800/90 rounded-lg p-3 border border-surface-700/50 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx("p",{className:"text-xs text-surface-400 font-medium",children:"Legend"}),f.jsx("button",{onClick:B,className:"text-[10px] px-2 py-0.5 bg-surface-700 hover:bg-surface-600 text-surface-300 rounded transition-colors",title:"Reset layout",children:"Re-layout"})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-3 h-3 rounded bg-orange-500/40 border border-orange-500/50"}),f.jsx("span",{className:"text-xs text-surface-300",children:"Frontend"})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-3 h-3 rounded bg-blue-500/40 border border-blue-500/50"}),f.jsx("span",{className:"text-xs text-surface-300",children:"Backend"})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-3 h-3 rounded bg-green-500/40 border border-green-500/50"}),f.jsx("span",{className:"text-xs text-surface-300",children:"Shared"})]}),f.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-surface-700/50 mt-1",children:[f.jsx("div",{className:"w-3 h-3 rounded-full bg-emerald-500 flex items-center justify-center",children:f.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),f.jsx("span",{className:"text-xs text-surface-300",children:"Prompt exists"})]}),f.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-surface-700/50 mt-1",children:[f.jsxs("div",{className:"flex gap-0.5",children:[f.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500 flex items-center justify-center text-[7px] font-bold text-white",children:"C"}),f.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500 flex items-center justify-center text-[7px] font-bold text-white",children:"T"}),f.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500 flex items-center justify-center text-[7px] font-bold text-white",children:"E"})]}),f.jsx("span",{className:"text-xs text-surface-300",children:"Code/Test/Example"})]}),f.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-surface-700/50 mt-1",children:[f.jsx("div",{className:"flex items-center",children:f.jsxs("svg",{className:"w-6 h-3",viewBox:"0 0 24 12",children:[f.jsx("defs",{children:f.jsx("marker",{id:"arrow-legend",markerWidth:"10",markerHeight:"10",refX:"8",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:f.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#60a5fa"})})}),f.jsx("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:"#60a5fa",strokeWidth:"2",markerEnd:"url(#arrow-legend)"})]})}),f.jsx("span",{className:"text-xs text-surface-300",children:"Arrow shows dependency direction"})]}),d&&f.jsx("div",{className:"pt-1 border-t border-surface-700/50 mt-1",children:f.jsxs("p",{className:"text-[10px] text-surface-400 leading-relaxed",children:[f.jsx("span",{className:"text-orange-400",children:"Edit mode:"})," Right-click edge to delete, or click + Delete/Backspace"]})})]})]})})]})}),k&&f.jsxs("div",{className:"fixed z-50 bg-surface-800 border border-surface-700 rounded-lg shadow-xl py-1 min-w-[150px]",style:{top:k.y,left:k.x},onClick:Z=>Z.stopPropagation(),children:[f.jsxs("button",{onClick:H,className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-surface-700 transition-colors flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete Edge"]}),f.jsx("div",{className:"px-4 py-2 text-xs text-surface-500 border-t border-surface-700",children:f.jsxs("div",{className:"font-mono",children:[k.edge.source," → ",k.edge.target]})})]})]})},Rce=({isOpen:n,progress:e,results:t,onClose:r,onCancel:s})=>{if(!n)return null;const i=t!==null&&e===null,a=(t==null?void 0:t.filter(u=>u.success).length)||0,o=(t==null?void 0:t.filter(u=>!u.success).length)||0;return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:i?r:void 0}),f.jsxs("div",{className:"relative glass rounded-2xl border border-surface-700/50 p-6 max-w-md w-full mx-4 shadow-2xl",children:[f.jsxs("div",{className:"flex items-center justify-between mb-4",children:[f.jsx("h3",{className:"text-lg font-semibold text-white",children:i?"Generation Complete":"Generating Prompts"}),i&&f.jsx("button",{onClick:r,className:"p-1.5 hover:bg-surface-700 rounded-lg transition-colors",children:f.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e&&!i&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"relative h-2 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"absolute left-0 top-0 h-full bg-gradient-to-r from-emerald-500 to-emerald-400 transition-all duration-300",style:{width:`${e.current/e.total*100}%`}})}),f.jsxs("div",{className:"flex items-center justify-between text-sm",children:[f.jsxs("span",{className:"text-surface-400",children:["Generating prompt ",e.current," of ",e.total]}),f.jsxs("span",{className:"text-white font-medium",children:[Math.round(e.current/e.total*100),"%"]})]}),f.jsxs("div",{className:"flex items-center gap-2 p-3 bg-surface-800/50 rounded-lg",children:[f.jsx(gf,{className:"w-4 h-4 text-emerald-400 animate-spin"}),f.jsx("span",{className:"text-sm text-surface-300 truncate",children:e.currentModule})]}),s&&f.jsx("button",{onClick:s,className:"w-full px-4 py-2.5 bg-red-500/20 hover:bg-red-500/30 text-red-300 border border-red-500/30 rounded-xl font-medium transition-colors",children:"Stop Generation"})]}),i&&t&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-4 p-3 bg-surface-800/50 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-3 h-3 rounded-full bg-emerald-500"}),f.jsxs("span",{className:"text-sm text-surface-300",children:[a," succeeded"]})]}),o>0&&f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),f.jsxs("span",{className:"text-sm text-surface-300",children:[o," failed"]})]})]}),f.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2",children:t.map((u,d)=>f.jsxs("div",{className:`flex items-start gap-2 p-2 rounded-lg ${u.success?"bg-emerald-500/10":"bg-red-500/10"}`,children:[f.jsx("div",{className:"flex-shrink-0 mt-0.5",children:u.success?f.jsx(LJ,{className:"w-4 h-4 text-emerald-400"}):f.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("span",{className:`text-sm ${u.success?"text-emerald-300":"text-red-300"}`,children:[u.module,".prompt"]}),u.error&&f.jsx("p",{className:"text-xs text-red-400 mt-1 truncate",children:u.error})]})]},d))}),f.jsx("button",{onClick:r,className:"w-full px-4 py-2.5 bg-accent-600 hover:bg-accent-500 text-white rounded-xl font-medium transition-colors",children:"Close"})]})]})]})};function LA(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const ZA=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`modal-option-${n.name}`;if(n.type==="checkbox")return f.jsxs("label",{htmlFor:s,className:`flex items-start gap-3 ${r?"p-2":"p-3"} rounded-xl bg-surface-800/30 hover:bg-surface-800/50 transition-colors cursor-pointer group`,children:[f.jsx("input",{type:"checkbox",id:s,checked:!!e,onChange:i=>t(i.target.checked),className:"w-4 h-4 mt-0.5 rounded bg-surface-700 border-surface-600 text-accent-500 focus:ring-accent-500 focus:ring-offset-surface-800"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:LA(n.name)}),f.jsx("div",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mt-0.5`,children:n.description})]})]});if(n.type==="range"){const i=n.min??0,a=n.max??1,o=n.step??.1,u=e??n.defaultValue??i;return f.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:LA(n.name)}),f.jsx("span",{className:`${r?"text-xs":"text-sm"} font-mono text-accent-400 bg-accent-500/10 px-2 py-0.5 rounded-lg`,children:typeof u=="number"?u.toFixed(2):u})]}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),f.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:d=>t(parseFloat(d.target.value)),className:`flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500
|
|
342
|
-
[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4
|
|
343
|
-
[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent-500
|
|
344
|
-
[&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-accent-500/30
|
|
345
|
-
[&::-webkit-slider-thumb]:hover:bg-accent-400 [&::-webkit-slider-thumb]:transition-colors`}),f.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return null},Ece=({isOpen:n,modules:e,existingPrompts:t=new Set,globalOptions:r,onGlobalOptionsChange:s,onClose:i,onConfirm:a})=>{const[o,u]=P.useState(!1),[d,p]=P.useState(()=>e.map((T,R)=>{const N=t.has(T.filename);return{module:T,selected:!N,order:R,hasExistingPrompt:N}}));ue.useEffect(()=>{p(e.map((T,R)=>{const N=t.has(T.filename);return{module:T,selected:!N,order:R,hasExistingPrompt:N}}))},[e,t]);const m=P.useCallback(T=>{p(R=>R.map((N,q)=>q===T?{...N,selected:!N.selected}:N))},[]),g=P.useCallback(T=>{T!==0&&p(R=>{const N=[...R];return[N[T-1],N[T]]=[N[T],N[T-1]],N})},[]),x=P.useCallback(T=>{p(R=>{if(T===R.length-1)return R;const N=[...R];return[N[T],N[T+1]]=[N[T+1],N[T]],N})},[]),v=P.useCallback(()=>{p(T=>T.map(R=>({...R,selected:!0})))},[]),y=P.useCallback(()=>{p(T=>T.map(R=>({...R,selected:!1})))},[]),S=P.useCallback(()=>{p(T=>T.map(R=>({...R,selected:!R.hasExistingPrompt})))},[]),Q=P.useCallback(()=>{const T=d.filter(R=>R.selected).map(R=>R.module);a(T)},[d,a]),k=T=>T.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,""),$=T=>{const R=T.filename.match(/_([A-Za-z]+)\.prompt$/);return(R==null?void 0:R[1])||"Unknown"},j=d.filter(T=>T.selected).length;return n?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:i}),f.jsxs("div",{className:"relative bg-surface-900 rounded-2xl border border-surface-700 shadow-2xl w-full max-w-lg max-h-[80vh] flex flex-col",children:[f.jsxs("div",{className:"p-4 border-b border-surface-700",children:[f.jsx("h2",{className:"text-lg font-semibold text-white",children:"Configure Prompt Generation"}),f.jsx("p",{className:"text-sm text-surface-400 mt-1",children:"Select modules and set the generation order. Prompts will be generated from top to bottom."})]}),f.jsxs("div",{className:"px-4 py-2 border-b border-surface-700/50 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:S,className:"px-2 py-1 text-xs text-emerald-400 hover:text-emerald-300 hover:bg-emerald-500/10 rounded transition-colors font-medium",children:"Select Missing"}),f.jsx("button",{onClick:v,className:"px-2 py-1 text-xs text-surface-300 hover:text-white hover:bg-surface-700 rounded transition-colors",children:"Select All"}),f.jsx("button",{onClick:y,className:"px-2 py-1 text-xs text-surface-300 hover:text-white hover:bg-surface-700 rounded transition-colors",children:"Deselect All"})]}),f.jsxs("span",{className:"text-xs text-surface-400",children:[j," of ",d.length," selected"]})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:f.jsx("div",{className:"space-y-1",children:d.map((T,R)=>{var N,q;return f.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg border transition-colors ${T.selected?"bg-surface-800 border-surface-600":"bg-surface-800/30 border-surface-700/30 opacity-60"} ${T.hasExistingPrompt?"ring-1 ring-emerald-500/30":""}`,children:[f.jsx("input",{type:"checkbox",checked:T.selected,onChange:()=>m(R),className:"w-4 h-4 rounded border-surface-600 bg-surface-700 text-accent-500 focus:ring-accent-500 cursor-pointer"}),f.jsx("span",{className:"w-6 text-center text-xs font-mono text-surface-500",children:T.selected?d.filter((z,L)=>L<=R&&z.selected).length:"-"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"font-medium text-sm text-white truncate",children:k(T.module)}),f.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-surface-700 text-surface-300 rounded",children:$(T.module)}),T.hasExistingPrompt&&f.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium bg-emerald-500/20 text-emerald-400 rounded",children:[f.jsx("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"exists"]})]}),f.jsxs("p",{className:"text-xs text-surface-500 truncate",children:[((N=T.module.description)==null?void 0:N.substring(0,60))||T.module.filepath,(((q=T.module.description)==null?void 0:q.length)||0)>60?"...":""]})]}),f.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded ${T.module.priority==="high"?"bg-red-500/20 text-red-300":T.module.priority==="medium"?"bg-yellow-500/20 text-yellow-300":"bg-green-500/20 text-green-300"}`,children:T.module.priority||"normal"}),f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx("button",{onClick:()=>g(R),disabled:R===0,className:"p-1 hover:bg-surface-600 rounded disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Move up",children:f.jsx("svg",{className:"w-3 h-3 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),f.jsx("button",{onClick:()=>x(R),disabled:R===d.length-1,className:"p-1 hover:bg-surface-600 rounded disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Move down",children:f.jsx("svg",{className:"w-3 h-3 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]},T.module.filename)})})}),f.jsxs("div",{className:"border-t border-surface-700/50",children:[f.jsxs("button",{type:"button",onClick:()=>u(!o),className:"w-full px-4 py-3 flex items-center justify-between text-left hover:bg-surface-800/30 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),(r.strength!==sn.strength||r.temperature!==sn.temperature||r.time!==sn.time||r.local||r.verbose||r.quiet||r.force)&&f.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${o?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&f.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[f.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),ur.filter(T=>["strength","temperature","time"].includes(T.name)).map(T=>f.jsx(ZA,{option:T,value:r[T.name],onChange:R=>s({...r,[T.name]:R}),compact:!0},T.name))]}),f.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),ur.filter(T=>["local","verbose","quiet","force"].includes(T.name)).map(T=>f.jsx(ZA,{option:T,value:r[T.name],onChange:R=>s({...r,[T.name]:R}),compact:!0},T.name))]})]})]}),f.jsxs("div",{className:"p-4 border-t border-surface-700 flex items-center justify-between",children:[f.jsx("p",{className:"text-xs text-surface-500",children:"Dependencies are not automatically resolved. Ensure correct order."}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-surface-300 hover:text-white hover:bg-surface-700 rounded-lg transition-colors",children:"Cancel"}),f.jsxs("button",{onClick:Q,disabled:j===0,className:`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${j===0?"bg-surface-700 text-surface-500 cursor-not-allowed":"bg-emerald-600 text-white hover:bg-emerald-500"}`,children:["Generate ",j," Prompt",j!==1?"s":""]})]})]})]})]}):null},Ace=({editMode:n,hasUnsavedChanges:e,onToggleEditMode:t,onAddModule:r,onSave:s,onDiscard:i,onUndo:a,onRedo:o,canUndo:u,canRedo:d,isSaving:p=!1,onSyncFromPrompts:m})=>f.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-surface-800/80 border-b border-surface-700/50",children:[!n&&m&&f.jsxs(f.Fragment,{children:[f.jsx(Ur,{content:"Sync architecture.json from prompt metadata tags",children:f.jsxs("button",{onClick:m,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-purple-600 text-white hover:bg-purple-500 transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),f.jsx("span",{children:"Sync from Prompts"})]})}),f.jsx("div",{className:"w-px h-6 bg-surface-700"})]}),f.jsx(Ur,{content:n?"Exit edit mode":"Enter edit mode",children:f.jsxs("button",{onClick:t,className:`
|
|
346
|
-
flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors
|
|
347
|
-
${n?"bg-accent-600 text-white hover:bg-accent-500":"bg-surface-700 text-surface-300 hover:bg-surface-600"}
|
|
348
|
-
`,children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),f.jsx("span",{children:n?"Editing":"Edit"})]})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"w-px h-6 bg-surface-700"}),f.jsx(Ur,{content:"Add new module (N)",children:f.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-emerald-600 text-white hover:bg-emerald-500 transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),f.jsx("span",{children:"Add Module"})]})}),f.jsx("div",{className:"w-px h-6 bg-surface-700"}),f.jsx(Ur,{content:"Undo (Ctrl+Z)",children:f.jsx("button",{onClick:a,disabled:!u,className:"p-1.5 rounded-lg text-surface-300 hover:bg-surface-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})})}),f.jsx(Ur,{content:"Redo (Ctrl+Shift+Z)",children:f.jsx("button",{onClick:o,disabled:!d,className:"p-1.5 rounded-lg text-surface-300 hover:bg-surface-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a8 8 0 00-8 8v2m18-10l-6 6m6-6l-6-6"})})})}),e&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"w-px h-6 bg-surface-700"}),f.jsxs("span",{className:"text-xs text-yellow-400 flex items-center gap-1",children:[f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"Unsaved changes"]}),f.jsx(Ur,{content:"Save changes (Ctrl+S)",children:f.jsxs("button",{onClick:s,disabled:p,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-blue-600 text-white hover:bg-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[p?f.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),f.jsx("span",{children:p?"Saving...":"Save"})]})}),f.jsx(Ur,{content:"Discard changes (Escape)",children:f.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-surface-700 text-surface-300 hover:bg-surface-600 transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),f.jsx("span",{children:"Discard"})]})})]})]})]}),qce=["module","component","page","api","graphql","cli","job","message","config"],Mce=({isOpen:n,module:e,allModules:t,onSave:r,onDelete:s,onClose:i})=>{const[a,o]=P.useState(""),[u,d]=P.useState(""),[p,m]=P.useState(""),[g,x]=P.useState(""),[v,y]=P.useState(5),[S,Q]=P.useState(""),[k,$]=P.useState("module"),[j,T]=P.useState([]),[R,N]=P.useState(!1),q=P.useMemo(()=>t.filter(B=>B.filename!==(e==null?void 0:e.filename)),[t,e]);P.useEffect(()=>{var B,C;e&&(o(e.filename),d(e.filepath),m(e.description),x(e.reason),y(e.priority),Q(((B=e.tags)==null?void 0:B.join(", "))||""),$(((C=e.interface)==null?void 0:C.type)||"module"),T(e.dependencies||[]),N(!1))},[e]);const z=P.useMemo(()=>{const B=[];return a.trim()||B.push("Filename is required"),u.trim()||B.push("Filepath is required"),p.trim()||B.push("Description is required"),e&&a!==e.filename&&t.some(C=>C.filename===a)&&B.push("Filename already exists"),B},[a,u,p,e,t]),L=()=>{if(z.length>0)return;const B={filename:a,filepath:u,description:p,reason:g,priority:v,tags:S.split(",").map(C=>C.trim()).filter(C=>C),dependencies:j,interface:{type:k}};r(B),i()},E=()=>{e&&(s(e.filename),i())},V=B=>{T(C=>C.includes(B)?C.filter(G=>G!==B):[...C,B])};return!n||!e?null:f.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:f.jsxs("div",{className:"bg-surface-800 rounded-none sm:rounded-xl border-0 sm:border border-surface-700 w-full h-full sm:h-auto sm:max-w-2xl sm:max-h-[90vh] overflow-hidden flex flex-col",children:[f.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-surface-700",children:[f.jsx("h2",{className:"text-lg font-semibold text-white",children:"Edit Module"}),f.jsx("button",{onClick:i,className:"p-1.5 rounded-lg hover:bg-surface-700 transition-colors",children:f.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Filename ",f.jsx("span",{className:"text-red-400",children:"*"})]}),f.jsx("input",{type:"text",value:a,onChange:B=>o(B.target.value),placeholder:"e.g., user_api_Python.prompt",className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm"})]}),f.jsx(Js,{label:"Filepath",value:u,onChange:d,placeholder:"e.g., src/api/user.py",description:"Target path for the generated code",required:!0,title:"Select Output Path"}),f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Description ",f.jsx("span",{className:"text-red-400",children:"*"})]}),f.jsx("textarea",{value:p,onChange:B=>m(B.target.value),placeholder:"What does this module do?",rows:3,className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm resize-none"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Reason"}),f.jsx("input",{type:"text",value:g,onChange:B=>x(B.target.value),placeholder:"Why is this module needed?",className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Priority"}),f.jsx("input",{type:"number",value:v,onChange:B=>y(parseInt(B.target.value)||1),min:1,max:10,className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Interface Type"}),f.jsx("select",{value:k,onChange:B=>$(B.target.value),className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm",children:qce.map(B=>f.jsx("option",{value:B,children:B},B))})]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Tags ",f.jsx("span",{className:"text-surface-500",children:"(comma-separated)"})]}),f.jsx("input",{type:"text",value:S,onChange:B=>Q(B.target.value),placeholder:"e.g., backend, api, python",className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm"})]}),f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:["Dependencies ",f.jsxs("span",{className:"text-surface-500",children:["(",j.length," selected)"]})]}),f.jsx("div",{className:"bg-surface-900 border border-surface-700 rounded-lg p-2 max-h-40 overflow-y-auto",children:q.length===0?f.jsx("p",{className:"text-sm text-surface-500 text-center py-2",children:"No other modules available"}):f.jsx("div",{className:"space-y-1",children:q.map(B=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-800 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:j.includes(B.filename),onChange:()=>V(B.filename),className:"rounded border-surface-600 bg-surface-800 text-accent-500 focus:ring-accent-500"}),f.jsx("span",{className:"text-sm text-surface-300 truncate",children:B.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,"")})]},B.filename))})})]}),z.length>0&&f.jsx("div",{className:"bg-red-500/10 border border-red-500/50 rounded-lg p-3",children:f.jsx("ul",{className:"text-sm text-red-400 space-y-1",children:z.map((B,C)=>f.jsxs("li",{className:"flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),B]},C))})})]}),f.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-surface-700 bg-surface-800/50",children:[f.jsx("div",{children:R?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs text-red-400",children:"Are you sure?"}),f.jsx("button",{onClick:E,className:"px-2 py-1 rounded text-xs font-medium bg-red-600 text-white hover:bg-red-500 transition-colors",children:"Yes, delete"}),f.jsx("button",{onClick:()=>N(!1),className:"px-2 py-1 rounded text-xs font-medium bg-surface-700 text-surface-300 hover:bg-surface-600 transition-colors",children:"Cancel"})]}):f.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-red-400 hover:bg-red-500/10 transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete Module"]})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:i,className:"px-4 py-2 rounded-lg text-sm font-medium bg-surface-700 text-surface-300 hover:bg-surface-600 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:L,disabled:z.length>0,className:"px-4 py-2 rounded-lg text-sm font-medium bg-accent-600 text-white hover:bg-accent-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save Changes"})]})]})]})})},Xce=["Python","TypeScript","JavaScript","Java","Go","Rust","Ruby","C++"],zce=["module","component","page","api","graphql","cli","job","message","config"],Lce=({isOpen:n,existingModules:e,onAdd:t,onClose:r})=>{const[s,i]=P.useState(""),[a,o]=P.useState("Python"),[u,d]=P.useState(""),[p,m]=P.useState(""),[g,x]=P.useState(""),[v,y]=P.useState(5),[S,Q]=P.useState(""),[k,$]=P.useState("module"),[j,T]=P.useState([]),R=P.useMemo(()=>s.trim()?`${s.trim().toLowerCase().replace(/\s+/g,"_")}_${a}.prompt`:"",[s,a]),N=P.useMemo(()=>{if(!s.trim())return"";const C=s.trim().toLowerCase().replace(/\s+/g,"_"),G=a==="Python"?"py":a==="TypeScript"||a==="JavaScript"?"ts":a.toLowerCase();return`${k==="api"?"src/api/":k==="component"?"src/components/":k==="page"?"src/pages/":"src/"}${C}.${G}`},[s,a,k]),q=u||N,z=P.useMemo(()=>{const C=[];return s.trim()||C.push("Module name is required"),p.trim()||C.push("Description is required"),e.some(G=>G.filename===R)&&C.push("A module with this name and language already exists"),C},[s,p,R,e]),L=()=>{if(z.length>0)return;const C={filename:R,filepath:q,description:p,reason:g||`Module for ${s}`,priority:v,tags:S.split(",").map(G=>G.trim()).filter(G=>G),dependencies:j,interface:{type:k}};t(C),E(),r()},E=()=>{i(""),o("Python"),d(""),m(""),x(""),y(5),Q(""),$("module"),T([])},V=()=>{E(),r()},B=C=>{T(G=>G.includes(C)?G.filter(A=>A!==C):[...G,C])};return n?f.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:f.jsxs("div",{className:"bg-surface-800 rounded-none sm:rounded-xl border-0 sm:border border-surface-700 w-full h-full sm:h-auto sm:max-w-2xl sm:max-h-[90vh] overflow-hidden flex flex-col",children:[f.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-surface-700",children:[f.jsx("h2",{className:"text-lg font-semibold text-white",children:"Add New Module"}),f.jsx("button",{onClick:V,className:"p-1.5 rounded-lg hover:bg-surface-700 transition-colors",children:f.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Module Name ",f.jsx("span",{className:"text-red-400",children:"*"})]}),f.jsx("input",{type:"text",value:s,onChange:C=>i(C.target.value),placeholder:"e.g., user_api",className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm",autoFocus:!0})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Language"}),f.jsx("select",{value:a,onChange:C=>o(C.target.value),className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm",children:Xce.map(C=>f.jsx("option",{value:C,children:C},C))})]})]}),R&&f.jsxs("div",{className:"bg-surface-900/50 rounded-lg px-3 py-2",children:[f.jsx("span",{className:"text-xs text-surface-500",children:"Generated filename: "}),f.jsx("span",{className:"text-xs text-accent-400 font-mono",children:R})]}),f.jsxs("div",{children:[f.jsx(Js,{label:"Filepath",value:u,onChange:d,placeholder:N||"e.g., src/api/user.py",description:"Target path for the generated code (auto-suggested based on name and type)",title:"Select Output Path"}),!u&&N&&f.jsxs("p",{className:"text-xs text-surface-500 mt-1",children:["Will use: ",N]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Description ",f.jsx("span",{className:"text-red-400",children:"*"})]}),f.jsx("textarea",{value:p,onChange:C=>m(C.target.value),placeholder:"What does this module do?",rows:3,className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm resize-none"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Priority"}),f.jsx("input",{type:"number",value:v,onChange:C=>y(parseInt(C.target.value)||1),min:1,max:10,className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Interface Type"}),f.jsx("select",{value:k,onChange:C=>$(C.target.value),className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm",children:zce.map(C=>f.jsx("option",{value:C,children:C},C))})]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Tags ",f.jsx("span",{className:"text-surface-500",children:"(comma-separated)"})]}),f.jsx("input",{type:"text",value:S,onChange:C=>Q(C.target.value),placeholder:"e.g., backend, api, python",className:"w-full px-3 py-2 bg-surface-900 border border-surface-700 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-accent-500 text-sm"})]}),e.length>0&&f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:["Dependencies ",f.jsxs("span",{className:"text-surface-500",children:["(",j.length," selected)"]})]}),f.jsx("div",{className:"bg-surface-900 border border-surface-700 rounded-lg p-2 max-h-40 overflow-y-auto",children:f.jsx("div",{className:"space-y-1",children:e.map(C=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-800 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:j.includes(C.filename),onChange:()=>B(C.filename),className:"rounded border-surface-600 bg-surface-800 text-accent-500 focus:ring-accent-500"}),f.jsx("span",{className:"text-sm text-surface-300 truncate",children:C.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,"")})]},C.filename))})})]}),z.length>0&&f.jsx("div",{className:"bg-red-500/10 border border-red-500/50 rounded-lg p-3",children:f.jsx("ul",{className:"text-sm text-red-400 space-y-1",children:z.map((C,G)=>f.jsxs("li",{className:"flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),C]},G))})})]}),f.jsxs("div",{className:"flex items-center justify-end gap-2 px-6 py-4 border-t border-surface-700 bg-surface-800/50",children:[f.jsx("button",{onClick:V,className:"px-4 py-2 rounded-lg text-sm font-medium bg-surface-700 text-surface-300 hover:bg-surface-600 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:L,disabled:z.length>0,className:"px-4 py-2 rounded-lg text-sm font-medium bg-emerald-600 text-white hover:bg-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Add Module"})]})]})}):null},Zce=({isOpen:n,isSyncing:e,result:t,onSync:r,onClose:s})=>{const[i,a]=P.useState(!1);if(!n)return null;const o=t&&t.validation&&!t.validation.valid,u=t!==null;return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:e?void 0:s}),f.jsxs("div",{className:"relative glass rounded-2xl border border-surface-700/50 w-full max-w-2xl max-h-[80vh] overflow-hidden flex flex-col shadow-2xl m-4",children:[f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-surface-700/50",children:[f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold text-white flex items-center gap-2",children:[f.jsx("svg",{className:"w-6 h-6 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Sync from Prompts"]}),f.jsx("p",{className:"text-sm text-surface-400 mt-1",children:"Update architecture.json from prompt metadata tags"})]}),!e&&f.jsx("button",{onClick:s,className:"p-2 hover:bg-surface-700 rounded-lg transition-colors",children:f.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u?f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:`rounded-lg p-4 border ${t.success&&t.validation.valid?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:f.jsxs("div",{className:"flex items-start gap-3",children:[t.success&&t.validation.valid?f.jsx("svg",{className:"w-6 h-6 text-green-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):f.jsx("svg",{className:"w-6 h-6 text-red-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),f.jsxs("div",{className:"flex-1",children:[f.jsx("h3",{className:`text-sm font-semibold mb-1 ${t.success&&t.validation.valid?"text-green-300":"text-red-300"}`,children:t.success&&t.validation.valid?"Sync Completed Successfully":o?"Validation Errors Detected":"Sync Failed"}),f.jsxs("p",{className:`text-sm ${t.success&&t.validation.valid?"text-green-200/80":"text-red-200/80"}`,children:["Updated ",t.updated_count," module",t.updated_count!==1?"s":"",t.skipped_count>0&&`, skipped ${t.skipped_count}`]})]})]})}),o&&f.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4",children:[f.jsx("h4",{className:"text-sm font-medium text-red-300 mb-2",children:"Validation Errors:"}),f.jsx("ul",{className:"text-sm text-red-200/80 space-y-1",children:t.validation.errors.map((d,p)=>f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-red-400 flex-shrink-0",children:"•"}),f.jsx("span",{children:d.message})]},p))})]}),t.errors&&t.errors.length>0&&f.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4",children:[f.jsx("h4",{className:"text-sm font-medium text-yellow-300 mb-2",children:"Sync Warnings:"}),f.jsx("ul",{className:"text-sm text-yellow-200/80 space-y-1",children:t.errors.map((d,p)=>f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-yellow-400 flex-shrink-0",children:"•"}),f.jsx("span",{children:d})]},p))})]}),t.results&&t.results.length>0&&f.jsxs("button",{onClick:()=>a(!i),className:"w-full px-4 py-2 bg-surface-700 hover:bg-surface-600 rounded-lg text-sm text-white flex items-center justify-between transition-colors",children:[f.jsxs("span",{children:[i?"Hide":"Show"," Detailed Changes"]}),f.jsx("svg",{className:`w-4 h-4 transition-transform ${i?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&t.results&&f.jsx("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:t.results.map((d,p)=>f.jsx(Vce,{result:d},p))})]}):f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"bg-surface-800/50 border border-surface-700/50 rounded-lg p-4",children:[f.jsx("h3",{className:"text-sm font-medium text-white mb-2",children:"What this does:"}),f.jsxs("ul",{className:"text-sm text-surface-300 space-y-1.5 list-disc list-inside",children:[f.jsxs("li",{children:["Scans all prompt files for metadata tags (",f.jsx("code",{className:"text-accent-400",children:"<pdd-reason>"}),", ",f.jsx("code",{className:"text-accent-400",children:"<pdd-interface>"}),", ",f.jsx("code",{className:"text-accent-400",children:"<pdd-dependency>"}),")"]}),f.jsx("li",{children:"Updates corresponding entries in architecture.json"}),f.jsx("li",{children:"Validates the updated architecture for circular dependencies"}),f.jsx("li",{children:"Preserves fields not specified in tags (description, priority, tags)"})]})]}),f.jsxs("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4 flex items-start gap-3",children:[f.jsx("svg",{className:"w-5 h-5 text-blue-400 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),f.jsxs("div",{children:[f.jsx("h4",{className:"text-sm font-medium text-blue-300 mb-1",children:"Source of Truth"}),f.jsx("p",{className:"text-sm text-blue-200/80",children:"Prompts are authoritative. Tags in prompt files will override what's in architecture.json."})]})]}),e&&f.jsxs("div",{className:"flex items-center justify-center gap-3 py-8",children:[f.jsxs("svg",{className:"animate-spin h-8 w-8 text-accent-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{className:"text-surface-300",children:"Syncing..."})]})]})}),f.jsx("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-surface-700/50",children:u?f.jsx("button",{onClick:s,className:"px-4 py-2 bg-surface-700 hover:bg-surface-600 text-white rounded-lg text-sm font-medium transition-colors",children:"Close"}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:s,disabled:e,className:"px-4 py-2 text-sm text-surface-300 hover:text-white transition-colors disabled:opacity-50",children:"Cancel"}),f.jsxs("button",{onClick:r,disabled:e,className:"px-4 py-2 bg-accent-600 hover:bg-accent-500 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[e&&f.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e?"Syncing...":"Sync Now"]})]})})]})]})},Vce=({result:n})=>{const[e,t]=P.useState(!1),r=n.changes&&Object.keys(n.changes).length>0;return f.jsxs("div",{className:"bg-surface-800/50 border border-surface-700/50 rounded-lg p-3",children:[f.jsxs("div",{className:"flex items-start justify-between mb-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n.success?n.updated?f.jsx("svg",{className:"w-4 h-4 text-green-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):f.jsx("svg",{className:"w-4 h-4 text-surface-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm0-2a6 6 0 100-12 6 6 0 000 12z",clipRule:"evenodd"})}):f.jsx("svg",{className:"w-4 h-4 text-red-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),f.jsx("span",{className:"text-sm font-mono text-white",children:n.filename})]}),r&&f.jsxs("button",{onClick:()=>t(!e),className:"text-xs text-accent-400 hover:text-accent-300 flex items-center gap-1",children:[e?"Hide":"Show"," changes",f.jsx("svg",{className:`w-3 h-3 transition-transform ${e?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),f.jsx("p",{className:"text-xs text-surface-400",children:n.updated?`Updated: ${Object.keys(n.changes).join(", ")}`:n.error||"No changes needed"}),e&&r&&f.jsx("div",{className:"mt-3 pt-3 border-t border-surface-700/30 space-y-2",children:Object.entries(n.changes).map(([s,i])=>{const a=i;return f.jsxs("div",{className:"text-xs",children:[f.jsxs("div",{className:"text-surface-400 font-medium mb-1",children:[s,":"]}),f.jsxs("div",{className:"bg-surface-900/50 rounded p-2 space-y-1",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-red-400 flex-shrink-0",children:"-"}),f.jsxs("span",{className:"text-red-300/80 break-all",children:[JSON.stringify(a.old).slice(0,100),JSON.stringify(a.old).length>100?"...":""]})]}),f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400 flex-shrink-0",children:"+"}),f.jsxs("span",{className:"text-green-300/80 break-all",children:[JSON.stringify(a.new).slice(0,100),JSON.stringify(a.new).length>100?"...":""]})]})]})]},s)})})]})};function Yce(n=[]){const[e,t]=P.useState({past:[],present:n,future:[]}),[r,s]=P.useState(n),i=P.useMemo(()=>JSON.stringify(e.present)!==JSON.stringify(r),[e.present,r]),a=P.useCallback(k=>{t($=>({past:[...$.past.slice(-49),$.present],present:k,future:[]}))},[]),o=P.useCallback(k=>{a([...e.present,k])},[e.present,a]),u=P.useCallback((k,$)=>{const j=e.present.map(T=>T.filename===k?$:k!==$.filename?{...T,dependencies:T.dependencies.map(R=>R===k?$.filename:R)}:T);a(j)},[e.present,a]),d=P.useCallback(k=>{const $=e.present.filter(j=>j.filename!==k).map(j=>({...j,dependencies:j.dependencies.filter(T=>T!==k)}));a($)},[e.present,a]),p=P.useCallback((k,$)=>{const j=e.present.map(T=>T.filename===k?T.dependencies.includes($)?T:{...T,dependencies:[...T.dependencies,$]}:T);a(j)},[e.present,a]),m=P.useCallback((k,$)=>{const j=e.present.map(T=>T.filename===k?{...T,dependencies:T.dependencies.filter(R=>R!==$)}:T);a(j)},[e.present,a]),g=P.useCallback(k=>{t($=>({...$,present:$.present.map(j=>{const T=k.get(j.filename);return T?{...j,position:T}:j})}))},[]),x=P.useCallback(()=>{t(k=>{if(k.past.length===0)return k;const $=k.past[k.past.length-1];return{past:k.past.slice(0,-1),present:$,future:[k.present,...k.future]}})},[]),v=P.useCallback(()=>{t(k=>{if(k.future.length===0)return k;const $=k.future[0];return{past:[...k.past,k.present],present:$,future:k.future.slice(1)}})},[]),y=P.useCallback(k=>{s(k),t({past:[],present:k,future:[]})},[]),S=P.useCallback(()=>{t({past:[],present:r,future:[]})},[r]),Q=P.useCallback(()=>{S()},[S]);return{architecture:e.present,hasUnsavedChanges:i,addModule:o,updateModule:u,deleteModule:d,addDependency:p,removeDependency:m,updatePositions:g,undo:x,redo:v,canUndo:e.past.length>0,canRedo:e.future.length>0,setOriginal:y,reset:S,discardChanges:Q}}function pS(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const VA=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`arch-option-${n.name}`;if(n.type==="checkbox")return f.jsxs("label",{htmlFor:s,className:`flex items-start gap-3 ${r?"p-2":"p-3"} rounded-xl bg-surface-800/30 hover:bg-surface-800/50 transition-colors cursor-pointer group`,children:[f.jsx("input",{type:"checkbox",id:s,checked:!!e,onChange:i=>t(i.target.checked),className:"w-4 h-4 mt-0.5 rounded bg-surface-700 border-surface-600 text-accent-500 focus:ring-accent-500 focus:ring-offset-surface-800"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:pS(n.name)}),f.jsx("div",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mt-0.5`,children:n.description})]})]});if(n.type==="range"){const i=n.min??0,a=n.max??1,o=n.step??.1,u=e??n.defaultValue??i;return f.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:pS(n.name)}),f.jsx("span",{className:`${r?"text-xs":"text-sm"} font-mono text-accent-400 bg-accent-500/10 px-2 py-0.5 rounded-lg`,children:typeof u=="number"?u.toFixed(2):u})]}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),f.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:d=>t(parseFloat(d.target.value)),className:`flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500
|
|
349
|
-
[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4
|
|
350
|
-
[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent-500
|
|
351
|
-
[&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-accent-500/30
|
|
352
|
-
[&::-webkit-slider-thumb]:hover:bg-accent-400 [&::-webkit-slider-thumb]:transition-colors`}),f.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return f.jsxs("div",{children:[f.jsx("label",{htmlFor:s,className:`block ${r?"text-xs":"text-sm"} font-medium text-white mb-1.5`,children:pS(n.name)}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mb-2`,children:n.description}),f.jsx("input",{type:n.type==="number"?"number":"text",id:s,value:e||"",onChange:i=>t(n.type==="number"?i.target.value?Number(i.target.value):"":i.target.value),placeholder:n.placeholder,className:"w-full px-3 py-2.5 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 text-sm transition-all"})]})},Dce=({serverConnected:n,isExecuting:e,onOpenPromptSpace:t,onBatchStart:r,onBatchProgress:s,onBatchComplete:i,executionMode:a,selectedRemoteSession:o,onRemoteJobSubmitted:u})=>{const[d,p]=P.useState(null),[m,g]=P.useState(!0),[x,v]=P.useState(null),[y,S]=P.useState("empty"),[Q,k]=P.useState(""),[$,j]=P.useState(""),[T,R]=P.useState(null),[N,q]=P.useState(""),[z,L]=P.useState(null),[E,V]=P.useState(!1),[B,C]=P.useState(null),[G,A]=P.useState("architecture.json"),[U,H]=P.useState(null),[W,J]=P.useState(!1),[X,D]=P.useState(null),[ee,Z]=P.useState(!1),[I,K]=P.useState(null),[re,se]=P.useState(null),[be,$e]=P.useState(!1),[Xe,ae]=P.useState(!1),[Qe,Oe]=P.useState(!1),[ye,Fe]=P.useState({strength:sn.strength,temperature:sn.temperature,time:sn.time,verbose:sn.verbose,quiet:sn.quiet,force:sn.force,local:sn.local}),Te=P.useRef(!1),[ge,Ke]=P.useState(!1),[ot,st]=P.useState(!1),[ht,Je]=P.useState(new Set),[tt,hn]=P.useState([]),[Qt,zt]=P.useState(!1),[St,en]=P.useState(!1),[ln,pt]=P.useState(!1),[Lt,ct]=P.useState(null),[de,we]=P.useState(!1),[ke,Be]=P.useState(null),[Qn,Dt]=P.useState(new Set),[kn,Zt]=P.useState(window.innerWidth<768),[pn,on]=P.useState(!1),[cs,xr]=P.useState(!1),[Ia,us]=P.useState(null),{architecture:$n,hasUnsavedChanges:mn,addModule:oi,updateModule:fs,deleteModule:br,addDependency:ds,removeDependency:Xs,updatePositions:yr,undo:hs,redo:ps,canUndo:xe,canRedo:_e,setOriginal:Ve,discardChanges:Rt}=Yce([]);P.useEffect(()=>{d&&Ve(d)},[d,Ve]),P.useEffect(()=>{const pe=()=>Zt(window.innerWidth<768);return window.addEventListener("resize",pe),()=>window.removeEventListener("resize",pe)},[]);const On=Qt?$n:d,tr=P.useCallback(async()=>{try{const pe=await Ce.listPrompts();hn(pe);const Pe=new Set(pe.map(De=>De.prompt.split("/").pop()||""));Je(Pe)}catch(pe){console.error("Failed to load existing prompts:",pe)}},[]);P.useEffect(()=>{(async()=>{if(!n){g(!1);return}g(!0);try{if((await Ce.checkArchitectureExists()).exists){const De=await Ce.getArchitecture();p(De),S("graph"),await tr()}else S("empty")}catch(Pe){console.error("Failed to load architecture:",Pe),S("empty")}finally{g(!1)}})()},[n,tr]);const Fl=P.useCallback(async pe=>{try{const Pe=await Ce.getFileContent(pe);if(B==="prd")j(Pe.content),R(pe),y==="empty"&&S("editor");else if(B==="techStack")q(Pe.content),L(pe);else if(B==="architecture")try{const De=JSON.parse(Pe.content);p(De),S("graph"),await tr()}catch(De){console.error("Failed to parse architecture.json:",De),alert("Invalid architecture.json format. Please select a valid architecture file.");return}C(null)}catch(Pe){console.error("Failed to load file:",Pe)}},[B,y,tr]),ci=P.useCallback(async()=>{var pe,Pe;if(!G.trim()){H("Please enter a file path");return}H(null);try{const De=await Ce.getFileContent(G.trim()),cn=JSON.parse(De.content);p(cn),S("graph"),await tr()}catch(De){console.error("Failed to load architecture:",De),(pe=De.message)!=null&&pe.includes("404")||(Pe=De.message)!=null&&Pe.includes("not found")?H(`File not found: ${G}`):De instanceof SyntaxError?H("Invalid JSON format in file"):H(De.message||"Failed to load architecture file")}},[G,tr]),ui=async()=>{if(!$.trim()&&!T){D("Please provide a PRD (Product Requirements Document)");return}J(!0),D(null);try{if(a==="remote"&&o){if(!T&&$.trim()){D('Remote execution requires PRD to be loaded from a file. Please use "Load PRD" to select a file.'),J(!1);return}const pe=[];T&&pe.push(`PRD_FILE=${T}`),z&&pe.push(`TECH_STACK_FILE=${z}`),Q&&pe.push(`APP_NAME=${Q}`);const Pe={output:"architecture.json",template:"architecture/architecture_json",env:pe};if(ye){const{strength:De,temperature:cn,time:mt,verbose:Dn,quiet:vr,force:wr}=ye;De!==void 0&&(Pe.strength=De),cn!==void 0&&(Pe.temperature=cn),mt!==void 0&&(Pe.time=mt),Dn&&(Pe.verbose=!0),vr&&(Pe.quiet=!0),wr&&(Pe.force=!0)}try{await Ce.submitRemoteCommand({sessionId:o,type:"generate",payload:{args:{},options:Pe}}),D(null),J(!1),alert("Architecture generation command submitted to remote session. Check the remote machine for results.")}catch(De){D(`Failed to submit remote command: ${De instanceof Error?De.message:String(De)}`)}}else{const pe=await Ce.generateArchitecture({prdPath:T||void 0,prdContent:T?void 0:$,techStackPath:z||void 0,techStackContent:z?void 0:N||void 0,appName:Q||void 0,globalOptions:ye});if(pe.success){const Pe=await Ce.getArchitecture();p(Pe),S("graph"),Ke(!0)}else D(pe.message||"Generation failed")}}catch(pe){console.error("Failed to generate architecture:",pe),D(pe.message||"Failed to generate architecture")}finally{J(!1)}},Ha=async()=>{try{await Ce.cancelCommand(),J(!1)}catch(pe){console.error("Failed to cancel:",pe)}},ms=P.useCallback(pe=>{const Pe=pe.filename.match(/_([A-Za-z]+)\.prompt$/),De=Pe?Pe[1].toLowerCase():void 0,cn=pe.filename.replace(/_[A-Za-z]+\.prompt$/,""),mt={prompt:`prompts/${pe.filename}`,sync_basename:cn,language:De,code:pe.filepath};t(mt)},[t]),Os=P.useCallback(()=>{Ke(!1),S("editor")},[]),zs=P.useCallback(()=>{!d||d.length===0||ae(!0)},[d]),Ls=P.useCallback(async pe=>{if(ae(!1),pe.length===0)return;Te.current=!1,Z(!0),se(null),$e(!0);const Pe=pe.map(De=>{const cn=De.filename.match(/^(.+)_([^_]+)\.prompt$/);return{module:(cn==null?void 0:cn[1])||De.filename.replace(".prompt",""),langOrFramework:(cn==null?void 0:cn[2])||"Python"}});r==null||r("Generating Prompts",Pe.length);try{if(a==="remote"&&o){const De=[];for(let mt=0;mt<Pe.length&&!Te.current;mt++){const{module:Dn,langOrFramework:vr}=Pe[mt];K({current:mt+1,total:Pe.length,currentModule:Dn}),s==null||s(mt+1,Pe.length,Dn);try{const wr=[`MODULE=${Dn}`,`LANG_OR_FRAMEWORK=${vr}`,"ARCHITECTURE_FILE=architecture.json"];T&&wr.push(`PRD_FILE=${T}`),z&&wr.push(`TECH_STACK_FILE=${z}`);const rr={template:"generic/generate_prompt",env:wr,output:`prompts/${Dn}_${vr}.prompt`};if(ye){const{strength:fi,temperature:Od,time:Vc,verbose:gd,quiet:Yc,force:$O}=ye;fi!==void 0&&(rr.strength=fi),Od!==void 0&&(rr.temperature=Od),Vc!==void 0&&(rr.time=Vc),gd&&(rr.verbose=!0),Yc&&(rr.quiet=!0),$O&&(rr.force=!0)}const{commandId:pd}=await Ce.submitRemoteCommand({sessionId:o,type:"generate",payload:{args:{},options:rr}}),md=`pdd generate --template generic/generate_prompt -o prompts/${Dn}_${vr}.prompt`;u==null||u(`[Remote] ${md}`,"generate",pd,o),De.push({module:`${Dn}_${vr}`,success:!0})}catch(wr){De.push({module:`${Dn}_${vr}`,success:!1,error:wr instanceof Error?wr.message:String(wr)})}}se(De);const cn=De.every(mt=>mt.success);i==null||i(cn)}else{const De=await Ce.batchGeneratePrompts({modules:Pe,architectureFile:"architecture.json",prdFile:T||void 0,techStackFile:z||void 0,globalOptions:ye},(mt,Dn,vr)=>{K({current:mt,total:Dn,currentModule:vr}),s==null||s(mt,Dn,vr)},()=>Te.current);se(De);const cn=De.every(mt=>mt.success);i==null||i(cn)}}catch(De){console.error("Failed to generate prompts:",De),se([{module:"error",success:!1,error:De.message||"Failed to generate prompts"}]),i==null||i(!1)}finally{Z(!1),K(null)}},[T,z,ye,r,s,i,a,o,u]),tn=P.useCallback(async()=>{Te.current=!0;try{await Ce.cancelCommand()}catch(pe){console.error("Failed to cancel command:",pe)}},[]),Kl=P.useCallback(async()=>{$e(!1),se(null),Te.current=!1,await tr()},[tr]),Jl=P.useCallback(()=>{us(null),on(!0)},[]),gs=P.useCallback(async()=>{xr(!0);try{const pe=await Ce.syncArchitectureFromPrompts({dry_run:!1});if(us(pe),pe.success&&pe.validation.valid){const Pe=await Ce.getArchitecture();p(Pe),await tr()}}catch(pe){console.error("Sync failed:",pe),us({success:!1,updated_count:0,skipped_count:0,results:[],validation:{valid:!0,errors:[],warnings:[]},errors:[pe.message||"Unexpected error during sync"]})}finally{xr(!1)}},[tr]),xs=P.useCallback(()=>{on(!1),us(null)},[]),Lc=P.useCallback(()=>{if(Qt&&mn)if(window.confirm("You have unsaved changes. Discard them?"))Rt(),Be(null),Dt(new Set);else return;zt(!Qt)},[Qt,mn,Rt]),eo=P.useCallback(pe=>{ct(pe),en(!0)},[]),to=P.useCallback(pe=>{Lt&&fs(Lt.filename,pe),en(!1),ct(null)},[Lt,fs]),Ji=P.useCallback(pe=>{br(pe),en(!1),ct(null)},[br]),no=P.useCallback(pe=>{oi(pe)},[oi]),ro=P.useCallback((pe,Pe)=>{ds(pe,Pe)},[ds]),bs=P.useCallback((pe,Pe)=>{Xs(pe,Pe)},[Xs]),nr=P.useCallback(pe=>{yr(pe)},[yr]),so=P.useCallback(async()=>{if(!(!$n||$n.length===0)){we(!0),Be(null),Dt(new Set);try{const pe=await Ce.validateArchitecture($n);if(Be(pe),!pe.valid){const De=new Set;for(const cn of pe.errors)cn.modules.forEach(mt=>De.add(mt));Dt(De),we(!1);return}const Pe=await Ce.saveArchitecture($n);Pe.success?(p($n),Ve($n),zt(!1)):alert("Failed to save: "+(Pe.error||"Unknown error"))}catch(pe){console.error("Failed to save architecture:",pe),alert("Failed to save: "+pe.message)}finally{we(!1)}}},[$n,Ve]),Zc=P.useCallback(()=>{mn&&!window.confirm("Are you sure you want to discard all changes?")||(Rt(),Be(null),Dt(new Set))},[mn,Rt]);return P.useEffect(()=>{const pe=Pe=>{if(Qt&&((Pe.ctrlKey||Pe.metaKey)&&Pe.key==="s"&&(Pe.preventDefault(),mn&&so()),(Pe.ctrlKey||Pe.metaKey)&&Pe.key==="z"&&!Pe.shiftKey&&(Pe.preventDefault(),xe&&hs()),(Pe.ctrlKey||Pe.metaKey)&&Pe.key==="z"&&Pe.shiftKey&&(Pe.preventDefault(),_e&&ps()),Pe.key==="Escape"&&(St?(en(!1),ct(null)):ln?pt(!1):mn?Zc():zt(!1)),Pe.key==="n"&&!Pe.ctrlKey&&!Pe.metaKey&&!St&&!ln)){if(Pe.target.tagName==="INPUT"||Pe.target.tagName==="TEXTAREA")return;Pe.preventDefault(),pt(!0)}};return window.addEventListener("keydown",pe),()=>window.removeEventListener("keydown",pe)},[Qt,mn,xe,_e,St,ln,so,Zc,hs,ps]),P.useEffect(()=>{const pe=Pe=>{Qt&&mn&&(Pe.preventDefault(),Pe.returnValue="")};return window.addEventListener("beforeunload",pe),()=>window.removeEventListener("beforeunload",pe)},[Qt,mn]),m?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsxs("div",{className:"flex items-center gap-3 text-surface-400",children:[f.jsxs("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading architecture..."]})}):y==="empty"?f.jsxs("div",{className:"flex items-center justify-center min-h-[400px]",children:[f.jsxs("div",{className:"glass rounded-2xl p-8 max-w-lg text-center border border-surface-700/50",children:[f.jsx("div",{className:"w-16 h-16 rounded-2xl bg-accent-500/20 flex items-center justify-center mx-auto mb-4",children:f.jsx("svg",{className:"w-8 h-8 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),f.jsx("h2",{className:"text-xl font-semibold text-white mb-2",children:"No architecture.json found"}),f.jsx("p",{className:"text-surface-400 text-sm mb-6",children:"Generate a new architecture from a PRD, or load an existing architecture.json file."}),f.jsxs("div",{className:"flex gap-3 justify-center mb-4",children:[f.jsx("button",{onClick:()=>S("editor"),className:"px-4 py-2.5 bg-accent-600 hover:bg-accent-500 text-white rounded-xl font-medium transition-colors",disabled:!n,children:"Write PRD"}),f.jsx("button",{onClick:()=>C("prd"),className:"px-4 py-2.5 bg-surface-700 hover:bg-surface-600 text-white rounded-xl font-medium transition-colors",disabled:!n,children:"Load PRD"})]}),f.jsxs("div",{className:"pt-4 border-t border-surface-700/50",children:[f.jsx("p",{className:"text-surface-500 text-xs mb-3",children:"Or load an existing architecture file"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"text",value:G,onChange:pe=>{A(pe.target.value),H(null)},placeholder:"architecture.json",className:"flex-1 px-3 py-2 bg-surface-900/50 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:border-accent-500",disabled:!n,onKeyDown:pe=>{pe.key==="Enter"&&ci()}}),f.jsx("button",{onClick:()=>C("architecture"),className:"p-2 bg-surface-700 hover:bg-surface-600 text-surface-400 hover:text-white rounded-lg transition-colors",disabled:!n,title:"Browse files",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),f.jsx("button",{onClick:ci,className:"px-4 py-2 bg-surface-700 hover:bg-surface-600 text-surface-300 hover:text-white rounded-lg text-sm font-medium transition-colors",disabled:!n,children:"Load"})]}),U&&f.jsx("p",{className:"text-red-400 text-xs mt-2",children:U})]}),!n&&f.jsx("p",{className:"text-yellow-400 text-xs mt-4",children:"Connect to server to enable architecture generation"})]}),B&&f.jsx(Q2,{onSelect:Fl,onClose:()=>C(null),filter:B==="architecture"?".json":".md",title:B==="prd"?"Select PRD File":B==="architecture"?"Select Architecture File":"Select Tech Stack File"})]}):f.jsxs("div",{className:"flex gap-4 h-[calc(100vh-200px)] min-h-[500px]",children:[f.jsx("div",{className:`flex-shrink-0 transition-all duration-300 ${ge?"w-12":"w-80"}`,children:f.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 h-full flex flex-col overflow-hidden",children:[f.jsxs("div",{className:"p-3 border-b border-surface-700/50 flex items-center justify-between",children:[!ge&&f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx("input",{type:"text",value:Q,onChange:pe=>k(pe.target.value),placeholder:"Project Name",className:"w-full bg-transparent text-white text-sm font-medium placeholder-surface-500 focus:outline-none"})}),f.jsx("button",{onClick:()=>Ke(!ge),className:"p-1.5 hover:bg-surface-700 rounded-lg transition-colors flex-shrink-0",title:ge?"Expand sidebar":"Collapse sidebar",children:f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${ge?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})})]}),!ge&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[f.jsxs("div",{className:"p-2 border-b border-surface-700/50 flex items-center justify-between",children:[f.jsx("span",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider",children:"PRD"}),f.jsx("button",{onClick:()=>C("prd"),className:"p-1 hover:bg-surface-700 rounded text-surface-400 hover:text-white transition-colors",title:"Browse files",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})})]}),T&&f.jsx("div",{className:"px-2 py-1 bg-surface-800/50 text-xs text-surface-400 truncate",children:T}),f.jsx("textarea",{value:$,onChange:pe=>{j(pe.target.value),R(null)},placeholder:`# Product Requirements
|
|
353
|
-
|
|
354
|
-
## Overview
|
|
355
|
-
Describe your product...
|
|
356
|
-
|
|
357
|
-
## Features
|
|
358
|
-
- Feature 1
|
|
359
|
-
- Feature 2`,className:"flex-1 p-3 bg-transparent text-sm text-white placeholder-surface-600 resize-none focus:outline-none font-mono"},T||"prd-manual")]}),f.jsxs("div",{className:"border-t border-surface-700/50",children:[f.jsxs("button",{onClick:()=>{ot||(st(!0),requestAnimationFrame(()=>{V(!E),setTimeout(()=>st(!1),150)}))},className:"w-full p-2 flex items-center justify-between text-left hover:bg-surface-800/30 transition-colors",children:[f.jsx("span",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider",children:"Tech Stack (optional)"}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${E?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),E&&f.jsxs("div",{className:`border-t border-surface-700/30 transition-opacity duration-150 ${ot?"opacity-50":"opacity-100"}`,children:[f.jsx("div",{className:"p-2 flex items-center justify-end",children:f.jsx("button",{onClick:()=>C("techStack"),className:"p-1 hover:bg-surface-700 rounded text-surface-400 hover:text-white transition-colors",title:"Browse files",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})})}),z&&f.jsx("div",{className:"px-2 py-1 bg-surface-800/50 text-xs text-surface-400 truncate",children:z}),f.jsx("textarea",{value:N,onChange:pe=>{q(pe.target.value),L(null)},placeholder:`Backend: Python, FastAPI
|
|
360
|
-
Frontend: React, TypeScript
|
|
361
|
-
Database: PostgreSQL`,className:"w-full h-24 p-3 bg-transparent text-sm text-white placeholder-surface-600 resize-none focus:outline-none font-mono"},z||"tech-manual")]})]}),f.jsxs("div",{className:"border-t border-surface-700/50",children:[f.jsxs("button",{onClick:()=>{ot||(st(!0),requestAnimationFrame(()=>{Oe(!Qe),setTimeout(()=>st(!1),150)}))},className:"w-full p-2 flex items-center justify-between text-left hover:bg-surface-800/30 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),(ye.strength!==sn.strength||ye.temperature!==sn.temperature||ye.time!==sn.time||ye.local||ye.verbose||ye.quiet||ye.force)&&f.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${Qe?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Qe&&f.jsxs("div",{className:`border-t border-surface-700/30 p-3 space-y-3 transition-opacity duration-150 ${ot?"opacity-50":"opacity-100"}`,children:[f.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),ur.filter(pe=>["strength","temperature","time"].includes(pe.name)).map(pe=>f.jsx(VA,{option:pe,value:ye[pe.name],onChange:Pe=>Fe(De=>({...De,[pe.name]:Pe})),compact:!0},pe.name))]}),f.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),ur.filter(pe=>["local","verbose","quiet","force"].includes(pe.name)).map(pe=>f.jsx(VA,{option:pe,value:ye[pe.name],onChange:Pe=>Fe(De=>({...De,[pe.name]:Pe})),compact:!0},pe.name))]})]})]}),f.jsxs("div",{className:"p-3 border-t border-surface-700/50",children:[X&&f.jsx("div",{className:"mb-2 p-2 bg-red-500/10 border border-red-500/20 rounded-lg text-xs text-red-400",children:X}),W?f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("div",{className:"flex-1 px-4 py-2.5 bg-surface-700 rounded-xl flex items-center justify-center gap-2",children:[f.jsxs("svg",{className:"animate-spin h-4 w-4 text-surface-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.jsx("span",{className:"text-sm text-surface-400",children:"Generating..."})]}),f.jsx("button",{onClick:Ha,className:"px-3 py-2.5 bg-red-500/20 hover:bg-red-500/30 text-red-300 border border-red-500/30 rounded-xl text-sm font-medium transition-colors",children:"Stop"})]}):f.jsx("button",{onClick:ui,disabled:e||!n||!$.trim()&&!T,className:`w-full px-4 py-2.5 rounded-xl font-medium transition-all duration-200 flex items-center justify-center gap-2 ${e||!n||!$.trim()&&!T?"bg-surface-700 text-surface-500 cursor-not-allowed":"bg-gradient-to-r from-accent-600 to-accent-500 hover:from-accent-500 hover:to-accent-400 text-white shadow-lg shadow-accent-500/25"}`,children:d?"Regenerate":"Generate Architecture"})]}),f.jsx("div",{className:"border-t border-surface-700/50",children:f.jsxs("div",{className:"p-3",children:[f.jsx("p",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider mb-2",children:"Load Architecture File"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"text",value:G,onChange:pe=>{A(pe.target.value),H(null)},placeholder:"architecture.json",className:"flex-1 px-2 py-1.5 bg-surface-900/50 border border-surface-600 rounded text-xs text-white placeholder-surface-500 focus:outline-none focus:border-accent-500",onKeyDown:pe=>{pe.key==="Enter"&&ci()}}),f.jsx("button",{onClick:()=>C("architecture"),className:"p-1.5 bg-surface-700 hover:bg-surface-600 text-surface-400 hover:text-white rounded transition-colors",title:"Browse files",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),f.jsx("button",{onClick:ci,className:"px-3 py-1.5 bg-surface-700 hover:bg-surface-600 text-surface-300 hover:text-white rounded text-xs font-medium transition-colors",children:"Load"})]}),U&&f.jsx("p",{className:"text-red-400 text-[10px] mt-1",children:U})]})}),f.jsx("div",{className:"border-t border-surface-700/50",children:f.jsx("div",{className:"p-3",children:f.jsxs("button",{onClick:()=>{p(null),j(""),R(null),q(""),L(null),k(""),S("empty"),zt(!1)},className:"w-full px-3 py-2 bg-surface-800/50 hover:bg-surface-700 text-surface-400 hover:text-white rounded-lg text-xs font-medium transition-colors flex items-center justify-center gap-2",title:"Start a new project from scratch",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Start New Project"]})})})]})]})}),f.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[y==="graph"&&On&&f.jsx(Ace,{editMode:Qt,hasUnsavedChanges:mn,onToggleEditMode:Lc,onAddModule:()=>pt(!0),onSave:so,onDiscard:Zc,onUndo:hs,onRedo:ps,canUndo:xe,canRedo:_e,isSaving:de,onSyncFromPrompts:Jl}),ke&&!ke.valid&&f.jsx("div",{className:"bg-red-500/10 border-b border-red-500/30 px-4 py-2",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-red-400 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),f.jsxs("div",{className:"flex-1",children:[f.jsx("p",{className:"text-sm text-red-400 font-medium",children:"Cannot save: validation errors"}),f.jsx("ul",{className:"text-xs text-red-300 mt-1 space-y-0.5",children:ke.errors.map((pe,Pe)=>f.jsx("li",{children:pe.message},Pe))})]})]})}),f.jsx("div",{className:"flex-1 min-h-0",children:y==="graph"&&On?kn?f.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 h-full overflow-y-auto p-4",children:[f.jsxs("div",{className:"text-center mb-6",children:[f.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),f.jsx("h3",{className:"text-white font-semibold mb-2",children:"Architecture Graph"}),f.jsx("p",{className:"text-sm text-surface-400 mb-4",children:"The interactive architecture graph is best viewed on desktop devices (screen width > 768px)"}),f.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-surface-500",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("span",{children:"Module list shown below"})]})]}),f.jsx("div",{className:"space-y-3",children:On.map(pe=>f.jsxs("div",{className:"bg-surface-800/50 p-4 rounded-lg border border-surface-700/30 hover:border-surface-600/50 transition-colors",onClick:()=>ms(pe),children:[f.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[f.jsx("div",{className:"font-medium text-white text-sm flex-1",children:pe.filename}),ht.has(`${pe.filename.replace(".py","")}.prompt`)&&f.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-green-500/10 text-green-400 border border-green-500/20 flex-shrink-0",children:[f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Prompt exists"]})]}),f.jsx("p",{className:"text-xs text-surface-400 line-clamp-2 mb-3",children:pe.description}),pe.dependencies&&pe.dependencies.length>0&&f.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-surface-500",children:[f.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})}),f.jsxs("span",{className:"truncate",children:["Depends on: ",pe.dependencies.join(", ")]})]})]},pe.filename))}),!Qt&&f.jsx("button",{onClick:()=>zs(),disabled:ee,className:"mt-6 w-full px-4 py-3 bg-gradient-to-r from-accent-600 to-accent-500 hover:from-accent-500 hover:to-accent-400 text-white rounded-xl font-medium transition-all duration-200 shadow-lg shadow-accent-500/25 hover:shadow-accent-500/40 disabled:opacity-50 disabled:cursor-not-allowed",children:ee?"Generating Prompts...":"Generate All Prompts"})]}):f.jsx(Cce,{architecture:On,prdContent:$,appName:Q,onRegenerate:Os,onModuleClick:ms,onGeneratePrompts:zs,isGeneratingPrompts:ee,existingPrompts:ht,promptsInfo:tt,editMode:Qt,onModuleEdit:eo,onModuleDelete:Ji,onDependencyAdd:ro,onDependencyRemove:bs,onPositionsChange:nr,highlightedModules:Qn}):f.jsx("div",{className:"glass rounded-xl border border-surface-700/50 h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center text-surface-400",children:[f.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2"})}),f.jsx("p",{className:"text-sm",children:"Write your PRD and click Generate to create the architecture"})]})})})]}),B&&f.jsx(Q2,{onSelect:Fl,onClose:()=>C(null),filter:B==="architecture"?".json":".md",title:B==="prd"?"Select PRD File":B==="architecture"?"Select Architecture File":"Select Tech Stack File"}),Xe&&d&&f.jsx(Ece,{isOpen:Xe,modules:d,existingPrompts:ht,globalOptions:ye,onGlobalOptionsChange:Fe,onClose:()=>ae(!1),onConfirm:Ls}),be&&f.jsx(Rce,{isOpen:be,progress:I,results:re,onClose:Kl,onCancel:ee?tn:void 0}),f.jsx(Mce,{isOpen:St,module:Lt,allModules:$n,onSave:to,onDelete:Ji,onClose:()=>{en(!1),ct(null)}}),f.jsx(Lce,{isOpen:ln,existingModules:$n,onAdd:no,onClose:()=>pt(!1)}),f.jsx(Zce,{isOpen:pn,isSyncing:cs,result:Ia,onSync:gs,onClose:xs})]})},Bce=["python","typescript","javascript","java","go","rust","cpp","c","csharp","ruby","swift","kotlin"],YA={contexts:{default:{paths:["**"],defaults:{generate_output_path:"src/",test_output_path:"tests/",example_output_path:"examples/",default_language:"python"}}}},jn={generate_output_path:{label:"Code Output Directory",description:"Where generated code files will be saved",placeholder:"src/"},test_output_path:{label:"Test Output Directory",description:"Where generated test files will be saved",placeholder:"tests/"},example_output_path:{label:"Example Output Directory",description:"Where generated example files will be saved",placeholder:"examples/"},prompts_dir:{label:"Prompts Directory",description:"Custom directory for prompt files",placeholder:"prompts/"},default_language:{label:"Default Language"},strength:{label:"Model Strength",placeholder:"0.75"},temperature:{label:"Temperature",placeholder:"0.0"},budget:{label:"Budget",placeholder:"5.0"}},Uce=({name:n,context:e,isDefault:t,onChange:r,onDelete:s,onRename:i})=>{const[a,o]=P.useState(!0),[u,d]=P.useState(!1),[p,m]=P.useState(!1),[g,x]=P.useState(n),v=($,j)=>{const T={...e.defaults};j===""||j===void 0?delete T[$]:T[$]=j,r(n,{...e,defaults:T})},y=$=>{const j=$.split(",").map(T=>T.trim()).filter(Boolean);r(n,{...e,paths:j})},S=e.paths||[],Q=e.defaults||{},k=()=>{g&&g!==n&&i(n,g),m(!1)};return f.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 overflow-hidden",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-surface-800/50 transition-colors",onClick:()=>o(!a),children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Vz,{className:"w-5 h-5 text-accent-400"}),p&&!t?f.jsx("input",{type:"text",value:g,onChange:$=>x($.target.value),onBlur:k,onKeyDown:$=>{$.key==="Enter"&&k(),$.key==="Escape"&&(x(n),m(!1))},onClick:$=>$.stopPropagation(),className:"px-2 py-1 bg-surface-900 border border-surface-600 rounded text-white text-sm focus:outline-none focus:border-accent-500",autoFocus:!0}):f.jsxs("span",{className:"font-medium text-white",onDoubleClick:$=>{t||($.stopPropagation(),m(!0))},children:[n,t&&f.jsx("span",{className:"ml-2 text-xs text-surface-400",children:"(default)"})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[!t&&f.jsx(Ur,{content:"Delete context",children:f.jsx("button",{onClick:$=>{$.stopPropagation(),s(n)},className:"p-1.5 hover:bg-red-500/20 rounded-lg transition-colors text-surface-400 hover:text-red-400",children:f.jsx(BJ,{className:"w-4 h-4"})})}),a?f.jsx(pm,{className:"w-5 h-5 text-surface-400"}):f.jsx(mm,{className:"w-5 h-5 text-surface-400"})]})]}),a&&f.jsxs("div",{className:"p-4 pt-0 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"File Patterns"}),f.jsx("input",{type:"text",value:S.join(", "),onChange:$=>y($.target.value),placeholder:"**, frontend/**, backend/**",className:"w-full px-3 py-2 bg-surface-900/50 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 text-sm"}),f.jsx("p",{className:"mt-1 text-xs text-surface-500",children:"Glob patterns to match files (e.g., frontend/**, **/*.py)"})]}),f.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[f.jsx(Js,{label:jn.generate_output_path.label,value:Q.generate_output_path||"",onChange:$=>v("generate_output_path",$),placeholder:jn.generate_output_path.placeholder,description:jn.generate_output_path.description,directoryMode:!0,title:"Select Code Output Directory"}),f.jsx(Js,{label:jn.test_output_path.label,value:Q.test_output_path||"",onChange:$=>v("test_output_path",$),placeholder:jn.test_output_path.placeholder,description:jn.test_output_path.description,directoryMode:!0,title:"Select Test Output Directory"}),f.jsx(Js,{label:jn.example_output_path.label,value:Q.example_output_path||"",onChange:$=>v("example_output_path",$),placeholder:jn.example_output_path.placeholder,description:jn.example_output_path.description,directoryMode:!0,title:"Select Example Output Directory"}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:jn.default_language.label}),f.jsxs("select",{value:Q.default_language||"",onChange:$=>v("default_language",$.target.value),className:"w-full px-3 py-2 bg-surface-900/50 border border-surface-600 rounded-lg text-white focus:outline-none focus:border-accent-500 text-sm",children:[f.jsx("option",{value:"",children:"Select language..."}),Bce.map($=>f.jsx("option",{value:$,children:$.charAt(0).toUpperCase()+$.slice(1)},$))]})]})]}),f.jsxs("button",{onClick:()=>d(!u),className:"flex items-center gap-2 text-sm text-surface-400 hover:text-white transition-colors",children:[u?f.jsx(pm,{className:"w-4 h-4"}):f.jsx(mm,{className:"w-4 h-4"}),"Advanced Options"]}),u&&f.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-3 bg-surface-800/30 rounded-lg",children:[f.jsx(Js,{label:jn.prompts_dir.label,value:Q.prompts_dir||"",onChange:$=>v("prompts_dir",$),placeholder:jn.prompts_dir.placeholder,description:jn.prompts_dir.description,directoryMode:!0,title:"Select Prompts Directory"}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:jn.strength.label}),f.jsx("input",{type:"number",min:"0",max:"1",step:"0.05",value:Q.strength??"",onChange:$=>v("strength",$.target.value?parseFloat($.target.value):void 0),placeholder:jn.strength.placeholder,className:"w-full px-3 py-2 bg-surface-900/50 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 text-sm"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:jn.temperature.label}),f.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:Q.temperature??"",onChange:$=>v("temperature",$.target.value?parseFloat($.target.value):void 0),placeholder:jn.temperature.placeholder,className:"w-full px-3 py-2 bg-surface-900/50 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 text-sm"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:jn.budget.label}),f.jsx("input",{type:"number",min:"0",step:"1",value:Q.budget??"",onChange:$=>v("budget",$.target.value?parseFloat($.target.value):void 0),placeholder:jn.budget.placeholder,className:"w-full px-3 py-2 bg-surface-900/50 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 text-sm"})]})]})]})]})},Wce=()=>{const[n,e]=P.useState(null),[t,r]=P.useState(""),[s,i]=P.useState(!0),[a,o]=P.useState(!1),[u,d]=P.useState(null),[p,m]=P.useState(!1),[g,x]=P.useState(null),[v,y]=P.useState(!1),[S,Q]=P.useState(null),k=async()=>{i(!0),d(null);try{console.log("[ProjectSettings] Loading .pddrc configuration...");const L=await Ce.getPddrc();console.log("[ProjectSettings] Loaded config:",L),L?(e(L),r(JSON.stringify(L))):(console.log("[ProjectSettings] No .pddrc found, using defaults"),e(YA),r(""))}catch(L){console.error("[ProjectSettings] Error loading config:",L),d(L instanceof Error?L.message:"Failed to load configuration"),e(YA)}finally{console.log("[ProjectSettings] Loading complete"),i(!1)}};P.useEffect(()=>{k()},[]),P.useEffect(()=>{(async()=>{try{const E=await Ce.getAuthStatus();x(E)}catch{x({authenticated:!1,cached:!1,expires_at:null})}})()},[]);const $=async()=>{y(!0),Q(null);try{const L=await Ce.logout();if(L.success){Q({success:!0,message:"Tokens cleared. Run any pdd command to re-authenticate with GitHub."});const E=await Ce.getAuthStatus();x(E)}else Q(L)}catch(L){Q({success:!1,message:L instanceof Error?L.message:"Failed to clear tokens"})}finally{y(!1)}},j=P.useCallback(()=>n?JSON.stringify(n)!==t:!1,[n,t]),T=async()=>{if(n){o(!0),d(null);try{const L=await Ce.savePddrc(n);L.success?(r(JSON.stringify(n)),m(!0),setTimeout(()=>m(!1),3e3)):d(L.error||"Failed to save configuration")}catch(L){d(L instanceof Error?L.message:"Failed to save configuration")}finally{o(!1)}}},R=(L,E)=>{n&&e({...n,contexts:{...n.contexts,[L]:E}})},N=L=>{if(!n||L==="default")return;const E={...n.contexts};delete E[L],e({...n,contexts:E})},q=(L,E)=>{if(!n||L==="default"||!E||E===L)return;if(n.contexts[E]){d(`Context "${E}" already exists`);return}const V={};for(const[B,C]of Object.entries(n.contexts))B===L?V[E]=C:V[B]=C;e({...n,contexts:V})},z=()=>{if(!n)return;let L="new-context",E=1;for(;n.contexts[L];)L=`new-context-${E}`,E++;e({...n,contexts:{...n.contexts,[L]:{paths:[],defaults:{}}}})};return s?f.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 bg-surface-900/50 rounded-xl",children:[f.jsx(gf,{className:"w-8 h-8 text-accent-400 animate-spin"}),f.jsx("p",{className:"mt-4 text-surface-400 text-sm",children:"Loading project settings..."})]}):n?f.jsxs("div",{className:"max-w-4xl mx-auto p-4 sm:p-6 lg:p-8 animate-fade-in",children:[f.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center",children:f.jsx(Yz,{className:"w-5 h-5 text-accent-400"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-xl sm:text-2xl font-semibold text-white",children:"Project Settings"}),f.jsx("p",{className:"text-sm text-surface-400",children:"Configure where your code, tests, and examples are saved"})]})]}),f.jsx("button",{onClick:T,disabled:a||!j(),className:`px-4 py-2 rounded-xl font-medium transition-all flex items-center gap-2 ${a||!j()?"bg-surface-700 text-surface-500 cursor-not-allowed":p?"bg-green-600 text-white":"bg-accent-600 hover:bg-accent-500 text-white"}`,children:a?f.jsxs(f.Fragment,{children:[f.jsx(gf,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):p?"Saved!":"Save Changes"})]}),u&&f.jsx("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-500/50 rounded-lg text-red-300 text-sm",children:u}),f.jsx("div",{className:"mb-6 p-4 glass rounded-xl border border-surface-700/50",children:f.jsxs("p",{className:"text-sm text-surface-300",children:["Define output paths for different parts of your project. Each ",f.jsx("strong",{children:"context"})," matches file patterns and applies specific settings. The ",f.jsx("strong",{children:"default"})," context matches all files not covered by other contexts."]})}),f.jsx("div",{className:"space-y-4",children:(n==null?void 0:n.contexts)&&Object.entries(n.contexts).map(([L,E])=>f.jsx(Uce,{name:L,context:E,isDefault:L==="default",onChange:R,onDelete:N,onRename:q},L))}),f.jsxs("button",{onClick:z,className:"mt-4 w-full px-4 py-3 border-2 border-dashed border-surface-600 rounded-xl text-surface-400 hover:text-white hover:border-accent-500 transition-colors flex items-center justify-center gap-2",children:[f.jsx(UJ,{className:"w-5 h-5"}),"Add Context"]}),f.jsxs("div",{className:"mt-8 glass rounded-xl border border-surface-700/50 p-4 sm:p-6",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center",children:f.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})}),f.jsxs("div",{children:[f.jsx("h2",{className:"text-lg font-semibold text-white",children:"PDD Cloud Authentication"}),f.jsx("p",{className:"text-sm text-surface-400",children:"Manage your GitHub authentication for PDD Cloud"})]})]}),f.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface-800/50 mb-4",children:[f.jsx("div",{className:`w-3 h-3 rounded-full ${g!=null&&g.authenticated?"bg-green-400":"bg-yellow-400 animate-pulse"}`}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-white",children:g!=null&&g.authenticated?"Currently Authenticated":"Not Authenticated"}),f.jsx("p",{className:"text-xs text-surface-400",children:g!=null&&g.authenticated?g.cached?"Using cached JWT token":"Using refresh token":"No valid tokens found"})]})]}),f.jsx("p",{className:"text-sm text-surface-300 mb-4",children:"Clear stored tokens to force a fresh GitHub Device Flow login on the next PDD command."}),S&&f.jsx("div",{className:`mb-4 p-3 rounded-lg text-sm ${S.success?"bg-green-500/20 text-green-300 border border-green-500/30":"bg-red-500/20 text-red-300 border border-red-500/30"}`,children:S.message}),f.jsx("button",{onClick:$,disabled:v,className:"px-4 py-2 bg-red-600/80 hover:bg-red-600 text-white rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50",children:v?f.jsxs(f.Fragment,{children:[f.jsx(gf,{className:"w-4 h-4 animate-spin"}),"Clearing..."]}):f.jsxs(f.Fragment,{children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Force Re-authentication"]})}),f.jsx("p",{className:"mt-2 text-xs text-surface-500",children:"Clears JWT cache (~/.pdd/jwt_cache) and refresh token from system keyring."})]}),j()&&f.jsx("div",{className:"mt-4 p-3 bg-yellow-500/20 border border-yellow-500/50 rounded-lg text-yellow-300 text-sm",children:'You have unsaved changes. Click "Save Changes" to persist your configuration.'})]}):f.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 gap-4",children:[f.jsx("p",{className:"text-surface-400",children:"Failed to load configuration"}),f.jsx("button",{onClick:k,className:"px-4 py-2 bg-accent-600 hover:bg-accent-500 text-white rounded-lg transition-colors",children:"Retry"})]})};function DA(n,e){const r=Math.floor((new Date().getTime()-n.getTime())/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60),i=r%60;if(s<60)return`${s}m ${i}s`;const a=Math.floor(s/60),o=s%60;return`${a}h ${o}m`}function Gce(n){const e=Math.floor((new Date().getTime()-n.getTime())/1e3);if(e<60)return`${e}s ago`;const t=Math.floor(e/60);if(t<60)return`${t}m ago`;const r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Ice(n){switch(n){case"queued":return{bg:"bg-yellow-500/20",text:"text-yellow-400",icon:"clock"};case"running":return{bg:"bg-accent-500/20",text:"text-accent-400",icon:"spinner"};case"completed":return{bg:"bg-green-500/20",text:"text-green-400",icon:"check"};case"failed":return{bg:"bg-red-500/20",text:"text-red-400",icon:"x"};case"cancelled":return{bg:"bg-surface-500/20",text:"text-surface-400",icon:"slash"};default:return{bg:"bg-surface-500/20",text:"text-surface-400",icon:"question"}}}const BA=({job:n,isSelected:e,onSelect:t,onCancel:r,onRemove:s,onMarkDone:i,onMarkStatus:a})=>{var g,x;const o=Ice(n.status),u=n.status==="queued"||n.status==="running",d=n.id.startsWith("spawned-"),p=((g=n.metadata)==null?void 0:g.remote)===!0,m=n.progress?Math.round(n.progress.current/n.progress.total*100):null;return f.jsxs("div",{onClick:t,className:`
|
|
362
|
-
relative p-4 rounded-xl border cursor-pointer transition-all duration-200
|
|
363
|
-
${e?"border-accent-500 bg-accent-500/10 shadow-lg shadow-accent-500/10":"border-surface-700/50 bg-surface-800/50 hover:border-surface-600 hover:bg-surface-800/80"}
|
|
364
|
-
`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("h3",{className:"text-sm font-medium text-white truncate",title:n.displayCommand,children:n.displayCommand}),f.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[f.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${o.bg} ${o.text}`,children:[o.icon==="spinner"&&f.jsxs("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),o.icon==="check"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),o.icon==="x"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),o.icon==="clock"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),o.icon==="slash"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})}),n.status]}),f.jsx("span",{className:"text-xs text-surface-500",children:u?DA(n.startedAt):n.completedAt?Gce(n.completedAt):DA(n.startedAt)})]})]}),n.cost>0&&f.jsxs("span",{className:"text-xs text-surface-400 font-mono",children:["$",n.cost.toFixed(3)]})]}),u&&m!==null&&f.jsxs("div",{className:"mb-3",children:[f.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[f.jsx("span",{className:"text-surface-400 truncate max-w-[70%]",children:((x=n.progress)==null?void 0:x.message)||"Processing..."}),f.jsxs("span",{className:"text-accent-400 font-medium",children:[m,"%"]})]}),f.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full bg-gradient-to-r from-accent-600 to-accent-400 rounded-full transition-all duration-300",style:{width:`${m}%`}})})]}),n.status==="running"&&m===null&&f.jsx("div",{className:"mb-3",children:f.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full w-1/3 bg-gradient-to-r from-accent-600 to-accent-400 rounded-full animate-indeterminate"})})}),n.output.length>0&&f.jsx("div",{className:"mb-3 p-2 bg-surface-900/50 rounded-lg",children:f.jsx("p",{className:"text-xs text-surface-400 font-mono truncate",children:n.output[n.output.length-1]})}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u&&d&&!p&&i&&f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:v=>{v.stopPropagation(),i(!0)},className:"px-3 py-1.5 text-xs font-medium text-green-400 bg-green-500/10 hover:bg-green-500/20 border border-green-500/20 rounded-lg transition-colors",title:"Mark as successfully completed",children:"Done"}),f.jsx("button",{onClick:v=>{v.stopPropagation(),i(!1)},className:"px-3 py-1.5 text-xs font-medium text-red-400 bg-red-500/10 hover:bg-red-500/20 border border-red-500/20 rounded-lg transition-colors",title:"Mark as failed",children:"Failed"}),s&&f.jsx("button",{onClick:v=>{v.stopPropagation(),s()},className:"px-3 py-1.5 text-xs font-medium text-surface-400 bg-surface-700/50 hover:bg-surface-700 border border-surface-600/50 rounded-lg transition-colors",title:"Remove from dashboard (close terminal to stop command)",children:"Dismiss"})]}),u&&p&&a&&f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:v=>{v.stopPropagation(),a("completed")},className:"px-3 py-1.5 text-xs font-medium text-green-400 bg-green-500/10 hover:bg-green-500/20 border border-green-500/20 rounded-lg transition-colors",title:"Mark as successfully completed",children:"Done"}),f.jsx("button",{onClick:v=>{v.stopPropagation(),a("failed")},className:"px-3 py-1.5 text-xs font-medium text-red-400 bg-red-500/10 hover:bg-red-500/20 border border-red-500/20 rounded-lg transition-colors",title:"Mark as failed",children:"Failed"}),f.jsx("button",{onClick:v=>{v.stopPropagation(),a("cancelled")},className:"px-3 py-1.5 text-xs font-medium text-surface-400 bg-surface-700/50 hover:bg-surface-700 border border-surface-600/50 rounded-lg transition-colors",title:"Mark as cancelled",children:"Cancelled"})]}),u&&p&&f.jsx("button",{onClick:v=>{v.stopPropagation(),alert("Cancel Remote is not fully implemented yet. Use the manual status buttons above to mark the job status.")},className:"px-3 py-1.5 text-xs font-medium text-purple-400/50 bg-purple-500/5 border border-purple-500/10 rounded-lg cursor-not-allowed",title:"Coming soon - use manual status buttons for now",children:"Cancel Remote (Coming Soon)"}),u&&!d&&!p&&f.jsx("button",{onClick:v=>{v.stopPropagation(),r()},className:"px-3 py-1.5 text-xs font-medium text-red-400 bg-red-500/10 hover:bg-red-500/20 border border-red-500/20 rounded-lg transition-colors",children:"Cancel"}),!u&&s&&f.jsx("button",{onClick:v=>{v.stopPropagation(),s()},className:"px-3 py-1.5 text-xs font-medium text-surface-400 bg-surface-700/50 hover:bg-surface-700 border border-surface-600/50 rounded-lg transition-colors",children:"Remove"}),f.jsx("button",{onClick:v=>{v.stopPropagation(),t()},className:"px-3 py-1.5 text-xs font-medium text-accent-400 bg-accent-500/10 hover:bg-accent-500/20 border border-accent-500/20 rounded-lg transition-colors ml-auto",children:d?"Details":"View Output"})]})]})};function UA(n,e){const r=Math.floor(((e||new Date).getTime()-n.getTime())/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60),i=r%60;if(s<60)return`${s}m ${i}s`;const a=Math.floor(s/60),o=s%60;return`${a}h ${o}m`}const Hce=({job:n,onCancel:e,onClose:t})=>{var v;const r=P.useRef(null),[s,i]=P.useState(!0),[a,o]=P.useState(!1),[u,d]=P.useState(UA(n.startedAt,n.completedAt)),p=n.status==="queued"||n.status==="running",m=n.progress?Math.round(n.progress.current/n.progress.total*100):null;P.useEffect(()=>{if(!p)return;const y=setInterval(()=>{d(UA(n.startedAt,null))},1e3);return()=>clearInterval(y)},[p,n.startedAt]),P.useEffect(()=>{s&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[n.output,s]);const g=()=>{if(!r.current)return;const{scrollTop:y,scrollHeight:S,clientHeight:Q}=r.current,k=S-y-Q<50;i(k)},x=async()=>{const y=n.output.join(`
|
|
365
|
-
`);try{await navigator.clipboard.writeText(y),o(!0),setTimeout(()=>o(!1),2e3)}catch(S){console.error("Failed to copy:",S)}};return f.jsxs("div",{className:"flex flex-col h-full bg-surface-900 rounded-xl border border-surface-700/50 overflow-hidden",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-surface-800/50 border-b border-surface-700/50",children:[f.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[f.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${n.status==="running"?"bg-accent-400 animate-pulse":n.status==="queued"?"bg-yellow-400":n.status==="completed"?"bg-green-400":n.status==="failed"?"bg-red-400":"bg-surface-400"}`}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("h3",{className:"text-sm font-medium text-white truncate",children:n.displayCommand}),f.jsxs("div",{className:"flex items-center gap-2 text-xs text-surface-400",children:[f.jsx("span",{className:"capitalize",children:n.status}),f.jsx("span",{children:"•"}),f.jsx("span",{children:u}),n.cost>0&&f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"•"}),f.jsxs("span",{className:"font-mono",children:["$",n.cost.toFixed(3)]})]})]})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:x,className:"px-3 py-1.5 text-xs font-medium text-surface-300 bg-surface-700/50 hover:bg-surface-700 border border-surface-600/50 rounded-lg transition-colors flex items-center gap-1.5",title:"Copy output",children:a?f.jsxs(f.Fragment,{children:[f.jsx("svg",{className:"w-3.5 h-3.5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]})}),p&&f.jsx("button",{onClick:e,className:"px-3 py-1.5 text-xs font-medium text-red-400 bg-red-500/10 hover:bg-red-500/20 border border-red-500/20 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:t,className:"p-1.5 text-surface-400 hover:text-white hover:bg-surface-700 rounded-lg transition-colors",title:"Close",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),p&&f.jsx("div",{className:"px-4 py-2 bg-surface-800/30 border-b border-surface-700/30",children:m!==null?f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[f.jsx("span",{className:"text-surface-400 truncate max-w-[70%]",children:((v=n.progress)==null?void 0:v.message)||"Processing..."}),f.jsxs("span",{className:"text-accent-400 font-medium",children:[m,"%"]})]}),f.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full bg-gradient-to-r from-accent-600 to-accent-400 rounded-full transition-all duration-300",style:{width:`${m}%`}})})]}):f.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full w-1/3 bg-gradient-to-r from-accent-600 to-accent-400 rounded-full animate-indeterminate"})})}),f.jsxs("div",{ref:r,onScroll:g,className:"flex-1 overflow-auto p-4 font-mono text-sm",children:[n.output.length===0?f.jsx("div",{className:"text-surface-500 text-center py-8",children:p?"Waiting for output...":"No output"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words text-surface-300",children:n.output.map((y,S)=>f.jsx("div",{className:`${y.startsWith("[stderr]")?"text-red-400":y.startsWith(">")?"text-accent-400":""}`,children:y},S))}),!s&&n.output.length>0&&f.jsxs("button",{onClick:()=>{i(!0),r.current&&(r.current.scrollTop=r.current.scrollHeight)},className:"fixed bottom-20 right-8 px-3 py-2 bg-accent-600 hover:bg-accent-500 text-white text-xs font-medium rounded-lg shadow-lg transition-colors flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})]}),n.status==="failed"&&n.error&&f.jsx("div",{className:"px-4 py-3 bg-red-500/10 border-t border-red-500/20",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-red-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("p",{className:"text-sm text-red-400",children:n.error})]})}),n.status==="completed"&&f.jsx("div",{className:"px-4 py-3 bg-green-500/10 border-t border-green-500/20",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),f.jsx("p",{className:"text-sm text-green-400",children:"Job completed successfully"})]})})]})},Fce=({activeJobs:n,completedJobs:e,selectedJob:t,onSelectJob:r,onCancelJob:s,onRemoveJob:i,onClearCompleted:a,onMarkSpawnedDone:o,onMarkJobStatus:u,batchOperation:d,onCancelBatchOperation:p})=>{const[m,g]=P.useState(!1),x=n.length>0||e.length>0,v=d&&d.status==="running";return!x&&!t&&!v?null:f.jsx("div",{className:"fixed bottom-12 left-0 right-0 z-50 pointer-events-none",children:f.jsxs("div",{className:`
|
|
366
|
-
pointer-events-auto mx-4 mb-2 bg-surface-900/95 backdrop-blur-lg rounded-2xl border border-surface-700/50 shadow-2xl
|
|
367
|
-
transition-all duration-300 ease-in-out
|
|
368
|
-
${m?"max-h-14":t?"max-h-[65vh]":"max-h-[35vh]"}
|
|
369
|
-
`,children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-700/50 cursor-pointer",onClick:()=>g(!m),children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${m?"":"rotate-180"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),f.jsx("h2",{className:"text-sm font-medium text-white",children:"Jobs Dashboard"}),v&&f.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-purple-500/20 text-purple-400 rounded-full flex items-center gap-1",children:[f.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.name]}),n.length>0&&f.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-accent-500/20 text-accent-400 rounded-full",children:[n.length," running"]}),e.length>0&&f.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-surface-700 text-surface-400 rounded-full",children:[e.length," completed"]})]}),f.jsx("div",{className:"flex items-center gap-2",onClick:y=>y.stopPropagation(),children:e.length>0&&f.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs font-medium text-surface-400 hover:text-white hover:bg-surface-700 rounded-lg transition-colors",children:"Clear completed"})})]}),!m&&f.jsxs("div",{className:`flex ${t?"h-[calc(65vh-3.5rem)]":"h-[calc(35vh-3.5rem)]"}`,children:[f.jsxs("div",{className:`${t?"w-80 border-r border-surface-700/50":"w-full"} overflow-y-auto p-4`,children:[v&&d&&f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-xs font-medium text-purple-400 uppercase tracking-wider mb-3",children:"Batch Operation"}),f.jsxs("div",{className:"bg-surface-800/50 rounded-xl p-4 border border-purple-500/20",children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx("span",{className:"text-sm font-medium text-white",children:d.name}),p&&f.jsx("button",{onClick:p,className:"px-2 py-1 text-xs text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded transition-colors",children:"Cancel"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs text-surface-400 mb-2",children:[f.jsxs("span",{children:[d.current," / ",d.total]}),f.jsx("span",{className:"text-surface-600",children:"•"}),f.jsx("span",{className:"text-purple-400",children:d.currentItem})]}),f.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full bg-gradient-to-r from-purple-500 to-accent-500 transition-all duration-300",style:{width:`${d.current/d.total*100}%`}})})]})]}),n.length>0&&f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-xs font-medium text-surface-500 uppercase tracking-wider mb-3",children:"Active Jobs"}),f.jsx("div",{className:"space-y-3",children:n.map(y=>f.jsx(BA,{job:y,isSelected:(t==null?void 0:t.id)===y.id,onSelect:()=>r(y.id),onCancel:()=>s(y.id),onRemove:()=>i(y.id),onMarkDone:o?S=>o(y.id,S):void 0,onMarkStatus:u?S=>u(y.id,S):void 0},y.id))})]}),e.length>0&&f.jsxs("div",{children:[f.jsx("h3",{className:"text-xs font-medium text-surface-500 uppercase tracking-wider mb-3",children:"Recent Jobs"}),f.jsx("div",{className:"space-y-3",children:e.slice(0,10).map(y=>f.jsx(BA,{job:y,isSelected:(t==null?void 0:t.id)===y.id,onSelect:()=>r(y.id),onCancel:()=>{},onRemove:()=>i(y.id)},y.id))})]}),n.length===0&&e.length===0&&f.jsxs("div",{className:"text-center py-8",children:[f.jsx("svg",{className:"w-12 h-12 text-surface-600 mx-auto mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),f.jsx("p",{className:"text-surface-500 text-sm",children:"No jobs yet"}),f.jsx("p",{className:"text-surface-600 text-xs mt-1",children:"Run a command to see it here"})]})]}),t&&f.jsx("div",{className:"flex-1 p-4",children:f.jsx(Hce,{job:t,onCancel:()=>s(t.id),onClose:()=>r(null)})})]})]})})};function Kce(n,e){if(!n)return"";const r=Math.floor(((e||new Date).getTime()-n.getTime())/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60),i=r%60;if(s<60)return`${s}m ${i}s`;const a=Math.floor(s/60),o=s%60;return`${a}h ${o}m`}function Jce(n){switch(n){case"pending":return{bg:"bg-surface-500/20",text:"text-surface-400",icon:"clock"};case"running":return{bg:"bg-accent-500/20",text:"text-accent-400",icon:"spinner"};case"completed":return{bg:"bg-green-500/20",text:"text-green-400",icon:"check"};case"failed":return{bg:"bg-red-500/20",text:"text-red-400",icon:"x"};case"skipped":return{bg:"bg-yellow-500/20",text:"text-yellow-400",icon:"skip"};default:return{bg:"bg-surface-500/20",text:"text-surface-400",icon:"question"}}}const eue=({task:n,index:e,onRemove:t,onSkip:r,onRetry:s,onRunNow:i,isDraggable:a,onDragStart:o,onDragOver:u,onDrop:d,onDragEnd:p})=>{if(!n)return null;const m=Jce(n.status||"pending"),g=n.status==="running",x=n.status==="pending",v=n.status==="failed",y=n.status==="completed"||n.status==="skipped";return f.jsxs("div",{draggable:a,onDragStart:o,onDragOver:u,onDrop:d,onDragEnd:p,className:`
|
|
370
|
-
relative p-3 rounded-lg border transition-all duration-200
|
|
371
|
-
${g?"border-accent-500/50 bg-accent-500/10":y?"border-surface-700/30 bg-surface-800/30 opacity-75":"border-surface-700/50 bg-surface-800/50 hover:border-surface-600"}
|
|
372
|
-
${a?"cursor-grab active:cursor-grabbing":""}
|
|
373
|
-
`,children:[f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[a?f.jsx("div",{className:"text-surface-500 hover:text-surface-400 cursor-grab",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8h16M4 16h16"})})}):f.jsx("div",{className:"w-4"}),f.jsx("span",{className:"text-xs text-surface-500 font-mono w-4 text-center",children:e+1})]}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"flex items-start justify-between gap-2",children:f.jsx("h4",{className:"text-sm font-medium text-white truncate",title:n.displayCommand||"Task",children:n.displayCommand||"Task"})}),f.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[f.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${m.bg} ${m.text}`,children:[m.icon==="spinner"&&f.jsxs("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),m.icon==="check"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),m.icon==="x"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),m.icon==="clock"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),m.icon==="skip"&&f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})}),n.status]}),(g||y)&&n.startedAt&&f.jsx("span",{className:"text-xs text-surface-500",children:Kce(n.startedAt,n.completedAt)}),n.jobId&&f.jsxs("span",{className:"text-xs text-surface-600 font-mono",children:["#",n.jobId.slice(-6)]})]}),n.error&&f.jsx("p",{className:"text-xs text-red-400 mt-1 truncate",title:n.error,children:n.error})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[x&&f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:S=>{S.stopPropagation(),i()},className:"p-1.5 text-accent-400 hover:bg-accent-500/20 rounded transition-colors",title:"Run now",children:f.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]})}),f.jsx("button",{onClick:S=>{S.stopPropagation(),r()},className:"p-1.5 text-yellow-400 hover:bg-yellow-500/20 rounded transition-colors",title:"Skip this task",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})})]}),v&&f.jsx("button",{onClick:S=>{S.stopPropagation(),s()},className:"p-1.5 text-accent-400 hover:bg-accent-500/20 rounded transition-colors",title:"Retry this task",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),!g&&f.jsx("button",{onClick:S=>{S.stopPropagation(),t()},className:"p-1.5 text-surface-500 hover:text-red-400 hover:bg-red-500/20 rounded transition-colors",title:"Remove from queue",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),g&&f.jsx("div",{className:"mt-2 h-1 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full w-1/3 bg-gradient-to-r from-accent-600 to-accent-400 rounded-full animate-indeterminate"})})]})},tue=({executionMode:n,isQueueRunning:e,isPaused:t,hasPendingTasks:r,hasCompletedTasks:s,hasAnyTasks:i,progress:a,onSetExecutionMode:o,onStartQueue:u,onPauseQueue:d,onResumeQueue:p,onRunNextTask:m,onClearCompleted:g,onClearAll:x})=>f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-xs text-surface-400",children:"Execution Mode"}),f.jsxs("div",{className:"flex items-center bg-surface-800 rounded-lg p-0.5 border border-surface-700",children:[f.jsx("button",{onClick:()=>o("auto"),className:`
|
|
374
|
-
px-3 py-1 text-xs font-medium rounded-md transition-colors
|
|
375
|
-
${n==="auto"?"bg-accent-600 text-white":"text-surface-400 hover:text-white"}
|
|
376
|
-
`,children:"Auto"}),f.jsx("button",{onClick:()=>o("manual"),className:`
|
|
377
|
-
px-3 py-1 text-xs font-medium rounded-md transition-colors
|
|
378
|
-
${n==="manual"?"bg-accent-600 text-white":"text-surface-400 hover:text-white"}
|
|
379
|
-
`,children:"Manual"})]})]}),i&&f.jsxs("div",{className:"flex items-center justify-between text-xs",children:[f.jsx("span",{className:"text-surface-400",children:"Progress"}),f.jsxs("span",{className:"text-surface-300",children:[a.completed," / ",a.total," completed"]})]}),i&&a.total>0&&f.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full bg-gradient-to-r from-accent-600 to-green-500 rounded-full transition-all duration-300",style:{width:`${a.completed/a.total*100}%`}})}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n==="auto"&&f.jsxs(f.Fragment,{children:[!e&&r&&f.jsxs("button",{onClick:u,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-accent-600 text-white hover:bg-accent-500 rounded-lg transition-colors",children:[f.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Start Queue"]}),e&&!t&&f.jsxs("button",{onClick:d,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-yellow-600 text-white hover:bg-yellow-500 rounded-lg transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Pause"]}),e&&t&&f.jsxs("button",{onClick:p,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-accent-600 text-white hover:bg-accent-500 rounded-lg transition-colors",children:[f.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Resume"]})]}),n==="manual"&&r&&a.running===0&&f.jsxs("button",{onClick:m,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-accent-600 text-white hover:bg-accent-500 rounded-lg transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})}),"Run Next"]}),s&&f.jsxs("button",{onClick:g,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-surface-700 text-surface-300 hover:bg-surface-600 rounded-lg transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Clear Completed"]}),i&&f.jsxs("button",{onClick:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-400 bg-red-500/10 hover:bg-red-500/20 border border-red-500/20 rounded-lg transition-colors",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Clear All"]})]})]}),nue=({tasks:n,executionMode:e,isQueueRunning:t,isPaused:r,progress:s,onSetExecutionMode:i,onStartQueue:a,onPauseQueue:o,onResumeQueue:u,onRunNextTask:d,onRemoveTask:p,onSkipTask:m,onRetryTask:g,onReorderTasks:x,onClearCompleted:v,onClearAll:y})=>{const[S,Q]=P.useState(!1),[k,$]=P.useState(null),j=P.useCallback(E=>V=>{if(!n||!n[E]||n[E].status!=="pending"){V.preventDefault();return}$(E),V.dataTransfer.effectAllowed="move"},[n]),T=P.useCallback(E=>V=>{V.preventDefault(),!(k===null||k===E)&&(!n||!n[E]||n[E].status!=="pending"||(V.dataTransfer.dropEffect="move"))},[k,n]),R=P.useCallback(E=>V=>{V.preventDefault(),!(k===null||k===E)&&(!n||!n[E]||n[E].status!=="pending"||(x(k,E),$(null)))},[k,x,n]),N=P.useCallback(()=>{$(null)},[]);if(!Array.isArray(n))return console.error("TaskQueuePanel: tasks is not an array",n),null;const q=n.some(E=>(E==null?void 0:E.status)==="pending"),z=n.some(E=>(E==null?void 0:E.status)==="completed"||(E==null?void 0:E.status)==="failed"||(E==null?void 0:E.status)==="skipped"),L=n.length>0;return L?f.jsx("div",{className:"fixed top-16 right-4 z-40 pointer-events-none",style:{width:"380px"},children:f.jsxs("div",{className:`
|
|
380
|
-
pointer-events-auto bg-surface-900/95 backdrop-blur-lg rounded-2xl border border-surface-700/50 shadow-2xl
|
|
381
|
-
transition-all duration-300 ease-in-out
|
|
382
|
-
${S?"max-h-14":"max-h-[70vh]"}
|
|
383
|
-
`,children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-700/50 cursor-pointer",onClick:()=>Q(!S),children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${S?"":"rotate-180"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),f.jsxs("h2",{className:"text-sm font-medium text-white flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),"Task Queue"]}),t&&!r&&f.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-accent-500/20 text-accent-400 rounded-full flex items-center gap-1",children:[f.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Running"]}),t&&r&&f.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded-full",children:"Paused"}),f.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-surface-700 text-surface-400 rounded-full",children:[s.pending," pending"]})]}),f.jsx("div",{className:"flex items-center gap-2",onClick:E=>E.stopPropagation(),children:f.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${e==="auto"?"bg-green-500/20 text-green-400":"bg-surface-700 text-surface-400"}`,children:e==="auto"?"Auto":"Manual"})})]}),!S&&f.jsxs("div",{className:"max-h-[calc(70vh-3.5rem)] overflow-hidden flex flex-col",children:[f.jsx("div",{className:"px-4 py-3 border-b border-surface-700/30",children:f.jsx(tue,{executionMode:e,isQueueRunning:t,isPaused:r,hasPendingTasks:q,hasCompletedTasks:z,hasAnyTasks:L,progress:s,onSetExecutionMode:i,onStartQueue:a,onPauseQueue:o,onResumeQueue:u,onRunNextTask:d,onClearCompleted:v,onClearAll:y})}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsx("div",{className:"space-y-2",children:n.map((E,V)=>!E||!E.id?null:f.jsx(eue,{task:E,index:V,isDraggable:E.status==="pending",onRemove:()=>p(E.id),onSkip:()=>m(E.id),onRetry:()=>g(E.id),onRunNow:d,onDragStart:j(V),onDragOver:T(V),onDrop:R(V),onDragEnd:N},E.id))}),n.length===0&&f.jsxs("div",{className:"text-center py-8",children:[f.jsx("svg",{className:"w-12 h-12 text-surface-600 mx-auto mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),f.jsx("p",{className:"text-surface-500 text-sm",children:"Queue is empty"}),f.jsx("p",{className:"text-surface-600 text-xs mt-1",children:"Add tasks to run them in sequence"})]})]})]})]})}):null};function mS(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const OS=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`queue-option-${n.name}`;if(n.type==="checkbox")return f.jsxs("label",{htmlFor:s,className:`flex items-start gap-3 ${r?"p-2":"p-3"} rounded-xl bg-surface-800/30 hover:bg-surface-800/50 transition-colors cursor-pointer group`,children:[f.jsx("input",{type:"checkbox",id:s,checked:!!e,onChange:i=>t(i.target.checked),className:"w-4 h-4 mt-0.5 rounded bg-surface-700 border-surface-600 text-accent-500 focus:ring-accent-500 focus:ring-offset-surface-800"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:mS(n.name)}),f.jsx("div",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mt-0.5`,children:n.description})]})]});if(n.type==="range"){const i=n.min??0,a=n.max??1,o=n.step??.1,u=e??n.defaultValue??i;return f.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:mS(n.name)}),f.jsx("span",{className:`${r?"text-xs":"text-sm"} font-mono text-accent-400 bg-accent-500/10 px-2 py-0.5 rounded-lg`,children:typeof u=="number"?u.toFixed(2):u})]}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),f.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:d=>t(parseFloat(d.target.value)),className:"flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500"}),f.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return f.jsxs("div",{children:[f.jsxs("label",{htmlFor:s,className:`block ${r?"text-xs":"text-sm"} font-medium text-white mb-1.5`,children:[mS(n.name),n.required&&f.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),f.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mb-2`,children:n.description}),f.jsx("input",{type:n.type==="number"?"number":"text",id:s,value:e||"",onChange:i=>t(n.type==="number"?i.target.value?Number(i.target.value):"":i.target.value),placeholder:n.placeholder,required:n.required,className:"w-full px-3 py-2.5 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 text-sm transition-all"})]})},rue=({isOpen:n,prompt:e,preselectedCommand:t,onAddToQueue:r,onClose:s})=>{var S;const i=P.useMemo(()=>Object.values(Ra).filter(Q=>Q.requiresPrompt),[]),[a,o]=P.useState(t||null),[u,d]=P.useState(!1),[p,m]=P.useState({}),g=a?Ra[a]:null;ue.useEffect(()=>{if(!g){m({});return}const Q={};g.options.forEach(k=>{k.defaultValue!==void 0&&(k.type==="checkbox"?Q[k.name]=k.defaultValue==="true"||k.defaultValue===!0:(k.type==="number"||k.type,Q[k.name]=k.defaultValue))}),g.requiresCode&&(e!=null&&e.code)&&(Q._code=e.code),g.requiresTest&&(e!=null&&e.test)&&(Q._test=e.test),g.name===Ze.SUBMIT_EXAMPLE&&(e!=null&&e.example)&&(Q["verification-program"]=e.example),ur.forEach(k=>{Q[`_global_${k.name}`]=k.defaultValue}),m(Q)},[g,e]),ue.useEffect(()=>{n||(o(t||null),d(!1))},[n,t]);const x=(Q,k)=>{m($=>({...$,[Q]:k}))},v=()=>{if(!g||!e||!a)return;const Q=Z2(g.name,e,p);r(g.name,e,p,Q),s()},y=ur.some(Q=>p[`_global_${Q.name}`]!==Q.defaultValue);return n?Array.isArray(i)?f.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-fade-in",onClick:s,children:f.jsxs("div",{className:"glass rounded-none sm:rounded-2xl border-0 sm:border border-surface-600/50 shadow-2xl w-full h-full sm:h-auto sm:max-w-md sm:max-h-[90vh] overflow-y-auto animate-scale-in",onClick:Q=>Q.stopPropagation(),children:[f.jsx("div",{className:"px-4 sm:px-6 py-4 border-b border-surface-700/50",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/20 flex items-center justify-center",children:f.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold text-white",children:"Add to Task Queue"}),f.jsx("p",{className:"text-xs sm:text-sm text-surface-400",children:"Queue this task for later execution"})]})]})}),f.jsxs("div",{className:"px-4 sm:px-6 py-4 space-y-4 max-h-[50vh] sm:max-h-[60vh] overflow-y-auto",children:[e&&f.jsxs("div",{className:"bg-surface-800/50 rounded-xl px-3 py-2.5 border border-surface-700/50",children:[f.jsx("div",{className:"text-xs text-surface-400 mb-0.5",children:"Target Prompt"}),f.jsx("div",{className:"text-sm text-white font-mono truncate",children:e.sync_basename||((S=e.prompt)==null?void 0:S.split("/").pop())||"Unknown"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Command"}),f.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(Q=>Q&&f.jsxs("button",{onClick:()=>o(Q.name),className:`
|
|
384
|
-
flex items-center gap-2 px-3 py-2.5 rounded-xl text-sm text-left transition-all
|
|
385
|
-
${a===Q.name?"bg-accent-600 text-white border border-accent-500":"bg-surface-800/50 text-surface-300 border border-surface-700 hover:bg-surface-700/50"}
|
|
386
|
-
`,children:[f.jsx("span",{children:Q.icon||"▶"}),f.jsx("span",{className:"truncate",children:Q.shortDescription||Q.name})]},Q.name))})]}),g&&f.jsxs(f.Fragment,{children:[g.requiresCode&&f.jsx(Js,{label:"Code File",value:p._code||"",onChange:Q=>x("_code",Q),placeholder:"e.g., src/calculator.py",required:!0,filter:[".py",".ts",".tsx",".js",".jsx",".java",".go",".rs",".rb",".php",".cs",".cpp",".c",".h"],title:"Select Code File",isDetected:!!(e!=null&&e.code)}),g.requiresTest&&f.jsx(Js,{label:"Test File",value:p._test||"",onChange:Q=>x("_test",Q),placeholder:"e.g., tests/test_calculator.py",required:!0,filter:[".py",".ts",".tsx",".js",".jsx",".java",".go",".rs",".rb",".php",".cs",".cpp",".c"],title:"Select Test File",isDetected:!!(e!=null&&e.test)}),g.options.length>0&&f.jsx("div",{className:"space-y-3",children:g.options.map(Q=>f.jsx(OS,{option:Q,value:p[Q.name],onChange:k=>x(Q.name,k)},Q.name))}),f.jsxs("div",{className:"border-t border-surface-700/30 pt-3 mt-2",children:[f.jsxs("button",{type:"button",onClick:()=>d(!u),className:"w-full flex items-center justify-between text-left group",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),y&&f.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),f.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${u?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),u&&f.jsxs("div",{className:"mt-3 space-y-3 animate-slide-down",children:[f.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),ur.filter(Q=>["strength","temperature","time"].includes(Q.name)).map(Q=>f.jsx(OS,{option:Q,value:p[`_global_${Q.name}`],onChange:k=>x(`_global_${Q.name}`,k),compact:!0},Q.name))]}),f.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[f.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),ur.filter(Q=>["local","verbose","quiet","force","review-examples"].includes(Q.name)).map(Q=>f.jsx(OS,{option:Q,value:p[`_global_${Q.name}`],onChange:k=>x(`_global_${Q.name}`,k),compact:!0},Q.name))]})]})]})]})]}),f.jsxs("div",{className:"px-4 sm:px-6 py-4 border-t border-surface-700/50 flex flex-col-reverse sm:flex-row justify-end gap-2 sm:gap-3",children:[f.jsx("button",{type:"button",onClick:s,className:"w-full sm:w-auto px-4 py-2.5 rounded-xl text-sm font-medium bg-surface-700/50 text-surface-300 hover:bg-surface-600 transition-colors",children:"Cancel"}),f.jsxs("button",{type:"button",onClick:v,disabled:!a||!e,className:"w-full sm:w-auto px-4 py-2.5 rounded-xl text-sm font-medium bg-gradient-to-r from-emerald-600 to-emerald-500 hover:from-emerald-500 hover:to-emerald-400 text-white shadow-lg shadow-emerald-500/25 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),f.jsx("span",{children:"Add to Queue"})]})]})]})}):(console.error("AddToQueueModal: availableCommands is not an array"),null):null},sue=({onReauth:n})=>{const[e,t]=P.useState(null),[r,s]=P.useState(!0);if(P.useEffect(()=>{const a=async()=>{try{const u=await Ce.getAuthStatus();t(u)}catch{t({authenticated:!1,cached:!1,expires_at:null})}finally{s(!1)}};a();const o=setInterval(a,3e4);return()=>clearInterval(o)},[]),r)return f.jsxs("div",{className:"flex items-center gap-1.5 px-2 sm:px-3 py-1.5 rounded-full bg-surface-800/50",children:[f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-surface-500 animate-pulse",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),f.jsx("span",{className:"text-xs text-surface-400 hidden sm:inline",children:"Auth..."})]});const i=e==null?void 0:e.authenticated;return f.jsxs("button",{onClick:n,className:`flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-1.5 rounded-full transition-colors ${i?"bg-blue-500/10 text-blue-400 border border-blue-500/20 hover:bg-blue-500/20":"bg-yellow-500/10 text-yellow-400 border border-yellow-500/20 hover:bg-yellow-500/20"}`,title:i?"Cloud Authenticated - Click to manage authentication":"Not authenticated - Click to login",children:[f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),f.jsx("span",{className:"sr-only",children:i?"Cloud Authenticated - Click to manage authentication":"Not authenticated - Click to login"}),f.jsx("span",{className:"hidden xs:inline","aria-hidden":"true",children:i?"Logged In":"Login"}),f.jsx("span",{className:`w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full ${i?"bg-blue-400":"bg-yellow-400 animate-pulse"}`})]})},iue=({onClose:n})=>{const[e,t]=P.useState(null),[r,s]=P.useState({phase:"idle"}),[i,a]=P.useState(!1),[o,u]=P.useState(!1),d=P.useRef(null);P.useEffect(()=>{(async()=>{try{const y=await Ce.getAuthStatus();t(y)}catch{t({authenticated:!1,cached:!1,expires_at:null})}})()},[]),P.useEffect(()=>()=>{d.current&&clearInterval(d.current)},[]);const p=P.useCallback(v=>{d.current&&clearInterval(d.current);const y=async()=>{try{const S=await Ce.pollLoginStatus(v);if(S.status==="completed"){d.current&&(clearInterval(d.current),d.current=null),s({phase:"success"});const Q=await Ce.getAuthStatus();t(Q)}else S.status==="expired"?(d.current&&(clearInterval(d.current),d.current=null),s({phase:"error",message:S.message||"Authentication timed out. Please try again."})):S.status==="error"&&(d.current&&(clearInterval(d.current),d.current=null),s({phase:"error",message:S.message||"Authentication failed."}))}catch(S){console.error("Poll error:",S)}};y(),d.current=window.setInterval(y,3e3)},[]),m=async()=>{s({phase:"starting"}),a(!1);try{const v=await Ce.startLogin({no_browser:o});if(!v.success||!v.user_code||!v.verification_uri||!v.poll_id){s({phase:"error",message:v.error||"Failed to start authentication"});return}const y=Date.now()+(v.expires_in||900)*1e3;s({phase:"waiting",userCode:v.user_code,verificationUri:v.verification_uri,pollId:v.poll_id,expiresAt:y}),p(v.poll_id)}catch(v){s({phase:"error",message:v instanceof Error?v.message:"Failed to start authentication"})}},g=async()=>{if(r.phase==="waiting")try{await navigator.clipboard.writeText(r.userCode),a(!0),setTimeout(()=>a(!1),2e3)}catch(v){console.error("Failed to copy:",v)}},x=()=>{d.current&&(clearInterval(d.current),d.current=null),s({phase:"idle"})};return f.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-fade-in",onClick:n,role:"dialog","aria-modal":"true","aria-labelledby":"reauth-modal-title",children:f.jsxs("div",{className:"bg-gray-800 rounded-none sm:rounded-lg shadow-xl w-full h-full sm:h-auto sm:max-w-md sm:max-h-[90vh] flex flex-col ring-1 ring-white/10 overflow-y-auto",onClick:v=>v.stopPropagation(),children:[f.jsxs("header",{className:"flex items-center justify-between p-4 border-b border-gray-700",children:[f.jsxs("h2",{id:"reauth-modal-title",className:"text-lg font-semibold text-white flex items-center gap-2",children:[f.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),"PDD Cloud Authentication"]}),f.jsx("button",{onClick:n,className:"p-2 rounded-full text-gray-400 hover:bg-gray-700 hover:text-white transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close modal",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("main",{className:"p-6 space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-gray-700/50",children:[f.jsx("div",{className:`w-3 h-3 rounded-full ${e!=null&&e.authenticated?"bg-green-400":"bg-yellow-400 animate-pulse"}`}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-white",children:e!=null&&e.authenticated?"Currently Authenticated":"Not Authenticated"}),f.jsx("p",{className:"text-xs text-gray-400",children:e!=null&&e.authenticated?e.cached?"Using cached JWT token":"Using refresh token":"No valid tokens found"})]})]}),r.phase==="idle"&&f.jsxs("div",{className:"space-y-3",children:[f.jsxs("p",{className:"text-sm text-gray-300",children:["Click the button below to authenticate with GitHub.",!o&&" A browser window will open for you to authorize PDD."]}),f.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400 cursor-pointer hover:text-gray-300 transition-colors",children:[f.jsx("input",{type:"checkbox",checked:o,onChange:v=>u(v.target.checked),className:"w-4 h-4 rounded border-gray-600 bg-gray-700 text-blue-500 focus:ring-2 focus:ring-blue-500 focus:ring-offset-0 cursor-pointer"}),f.jsx("span",{children:"Don't open browser automatically (I'll open the link manually)"})]})]}),r.phase==="starting"&&f.jsxs("div",{className:"flex items-center justify-center gap-3 py-6",children:[f.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-400",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),f.jsx("span",{className:"text-gray-300",children:"Starting GitHub authentication..."})]}),r.phase==="waiting"&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"text-center space-y-2",children:[f.jsx("p",{className:"text-sm text-gray-300",children:o?"Open the link below in your browser and enter this code on GitHub:":"A browser window has opened. Enter this code on GitHub:"}),f.jsxs("button",{onClick:g,className:"group relative inline-flex items-center gap-2 px-6 py-3 bg-gray-700 rounded-lg hover:bg-gray-600 transition-colors",title:"Click to copy",children:[f.jsx("span",{className:"text-2xl font-mono font-bold text-white tracking-wider","aria-label":"Device verification code",children:r.userCode}),f.jsx("svg",{className:"w-5 h-5 text-gray-400 group-hover:text-white transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),i&&f.jsx("span",{className:"absolute -top-8 left-1/2 -translate-x-1/2 px-2 py-1 bg-green-600 text-white text-xs rounded",children:"Copied!"})]})]}),f.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-gray-400",children:[f.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),f.jsx("span",{children:"Waiting for authorization..."})]}),f.jsxs("p",{className:"text-xs text-center text-gray-500",children:[o?"Visit: ":"If the browser didn't open, go to: ",f.jsx("a",{href:r.verificationUri,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:underline",children:r.verificationUri})]})]}),r.phase==="success"&&f.jsxs("div",{className:"p-4 rounded-lg bg-green-500/20 border border-green-500/30 text-center space-y-2",children:[f.jsx("svg",{className:"w-12 h-12 mx-auto text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("p",{className:"text-green-300 font-medium",children:"Authentication Successful!"}),f.jsx("p",{className:"text-sm text-green-400/80",children:"You can now use PDD Cloud features."})]}),r.phase==="error"&&f.jsxs("div",{className:"p-4 rounded-lg bg-red-500/20 border border-red-500/30 space-y-3",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("svg",{className:"w-5 h-5 text-red-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f.jsx("p",{className:"text-sm text-red-300",children:r.message})]}),f.jsx("button",{onClick:x,className:"w-full px-3 py-2 text-sm bg-red-600/30 hover:bg-red-600/50 text-red-200 rounded transition-colors",children:"Try Again"})]})]}),f.jsxs("footer",{className:"px-6 py-4 bg-gray-800/50 border-t border-gray-700 flex justify-end gap-3 rounded-b-lg",children:[f.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 rounded-md text-sm font-medium bg-gray-600 text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-gray-500 transition-colors",children:r.phase==="success"?"Done":"Close"}),(r.phase==="idle"||r.phase==="error")&&f.jsxs("button",{onClick:m,className:"px-4 py-2 rounded-md text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-blue-500 transition-colors flex items-center gap-2",children:[f.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.603-3.369-1.342-3.369-1.342-.454-1.155-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z"})}),"Login with GitHub"]})]})]})})};class aue extends ue.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e,errorInfo:null}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),this.setState({error:e,errorInfo:t})}render(){var e;return this.state.hasError?this.props.fallback?this.props.fallback:f.jsx("div",{className:"min-h-screen bg-surface-950 flex items-center justify-center p-4",children:f.jsxs("div",{className:"bg-red-900/20 border border-red-500/50 rounded-xl p-6 max-w-2xl w-full",children:[f.jsx("h1",{className:"text-xl font-bold text-red-400 mb-4",children:"Something went wrong"}),f.jsxs("div",{className:"bg-surface-900 rounded-lg p-4 mb-4 overflow-auto max-h-64",children:[f.jsx("pre",{className:"text-sm text-red-300 whitespace-pre-wrap",children:(e=this.state.error)==null?void 0:e.toString()}),this.state.errorInfo&&f.jsx("pre",{className:"text-xs text-surface-400 mt-2 whitespace-pre-wrap",children:this.state.errorInfo.componentStack})]}),f.jsx("button",{onClick:()=>{localStorage.removeItem("pdd-task-queue"),window.location.reload()},className:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-500 transition-colors",children:"Clear Queue Data & Reload"})]})}):this.props.children}}const lue=({sessions:n,selectedSessionId:e,onSelectSession:t,disabled:r=!1,error:s=null,onRefresh:i})=>{const[a,o]=P.useState(!1),u=n.find(p=>p.sessionId===e),d=p=>{try{const m=new Date(p),x=new Date().getTime()-m.getTime(),v=Math.floor(x/6e4),y=Math.floor(x/36e5);return v<1?"just now":v<60?`${v}m ago`:y<24?`${y}h ago`:`${Math.floor(y/24)}d ago`}catch{return"unknown"}};return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-1.5 md:gap-2",children:[f.jsx("label",{className:"text-xs sm:text-sm text-surface-300 font-medium whitespace-nowrap",children:"Session:"}),f.jsxs("select",{value:e||"",onChange:p=>t(p.target.value||null),disabled:r||n.length===0,className:"w-full md:w-48 lg:w-56 px-2 sm:px-3 py-1 sm:py-1.5 bg-surface-800 border border-surface-700 rounded-lg text-xs sm:text-sm text-surface-200 focus:outline-none focus:border-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:[f.jsx("option",{value:"",children:"-- Select Session --"}),n.map(p=>f.jsxs("option",{value:p.sessionId,children:[p.projectName," @ ",p.metadata.hostname,p.status==="stale"?" (offline)":""]},p.sessionId))]}),n.length===0&&!s&&f.jsx("span",{className:"text-xs text-surface-500",children:"No sessions"}),s&&f.jsx("span",{className:"text-xs text-red-400",children:"⚠️ Error loading sessions"}),f.jsx("button",{onClick:()=>o(!a),className:"ml-2 px-2 py-0.5 text-xs text-surface-400 hover:text-surface-200 border border-surface-700 hover:border-surface-500 rounded transition-colors",title:"Toggle debug info",children:a?"🔍 Hide Debug":"🔍 Debug"}),i&&f.jsx("button",{onClick:i,className:"ml-1 px-2 py-0.5 text-xs text-surface-400 hover:text-surface-200 border border-surface-700 hover:border-surface-500 rounded transition-colors",title:"Refresh sessions",children:"🔄"}),u&&f.jsxs("div",{className:"w-full md:w-auto mt-1.5 md:mt-0 md:ml-2 flex items-center gap-2 text-xs text-surface-400",children:[f.jsxs("span",{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium ${u.status==="active"?"bg-green-500/10 text-green-400 border border-green-500/20":"bg-yellow-500/10 text-yellow-400 border border-yellow-500/20"}`,children:[f.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u.status==="active"?"bg-green-400":"bg-yellow-400 animate-pulse"}`}),u.status==="active"?"Active":"Offline"]}),f.jsx("span",{className:"hidden lg:inline text-xs text-surface-400",children:d(u.lastHeartbeat)}),f.jsx("span",{className:"hidden xl:inline text-xs text-surface-500 truncate max-w-[150px] lg:max-w-[200px]",title:u.projectPath,children:u.projectPath})]})]}),u&&u.status==="stale"&&f.jsx("div",{className:"mt-2 p-2 bg-yellow-500/10 border border-yellow-500/20 rounded-lg",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-yellow-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),f.jsxs("div",{children:[f.jsx("p",{className:"text-xs font-medium text-yellow-400",children:"Session Offline"}),f.jsx("p",{className:"text-xs text-yellow-200/70 mt-0.5",children:"This session has not sent a heartbeat recently. The remote machine may not be running. Commands submitted may not be executed."})]})]})}),a&&f.jsxs("div",{className:"mt-2 p-3 bg-surface-900/50 border border-surface-700 rounded-lg text-xs",children:[f.jsx("div",{className:"font-semibold text-surface-300 mb-2",children:"🔍 Debug Information"}),f.jsxs("div",{className:"space-y-1 text-surface-400",children:[f.jsxs("div",{className:"flex gap-2",children:[f.jsx("span",{className:"text-surface-500 min-w-[100px]",children:"Sessions:"}),f.jsxs("span",{children:[n.length," found"]})]}),s&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("span",{className:"text-surface-500 min-w-[100px]",children:"Error:"}),f.jsx("span",{className:"text-red-400 flex-1 break-words",children:s})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("span",{className:"text-surface-500 min-w-[100px]",children:"Last Fetch:"}),f.jsx("span",{children:new Date().toLocaleTimeString()})]}),f.jsxs("div",{className:"mt-2 pt-2 border-t border-surface-700",children:[f.jsx("div",{className:"text-surface-500 mb-1",children:"Troubleshooting:"}),f.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-surface-400",children:[(s==null?void 0:s.includes("Not authenticated"))&&f.jsx("li",{children:"Not authenticated. Run: pdd auth login"}),(s==null?void 0:s.includes("401"))||(s==null?void 0:s.includes("403"))&&f.jsx("li",{children:"JWT token expired or invalid. Try: source setup_staging_env.sh"}),(s==null?void 0:s.includes("timeout"))||(s==null?void 0:s.includes("network"))&&f.jsx("li",{children:"Network issue. Check cloud connectivity."}),!s&&n.length===0&&f.jsx("li",{children:"No sessions found. Start one with: pdd connect"})]})]})]})]})]})},oue=({mode:n,onModeChange:e,disabled:t=!1})=>f.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[f.jsx("label",{className:"text-xs sm:text-sm text-surface-300 font-medium whitespace-nowrap",children:"Mode:"}),f.jsxs("div",{className:"flex bg-surface-800 border border-surface-700 rounded-lg p-0.5 sm:p-1",children:[f.jsxs("button",{onClick:()=>e("local"),disabled:t,className:`flex items-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-all ${n==="local"?"bg-blue-500 text-white shadow-sm":"text-surface-400 hover:text-surface-200"} disabled:opacity-50 disabled:cursor-not-allowed`,title:"Execute commands on this machine",children:[f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),f.jsx("span",{children:"Local"})]}),f.jsxs("button",{onClick:()=>e("remote"),disabled:t,className:`flex items-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 rounded-md text-xs sm:text-sm font-medium transition-all ${n==="remote"?"bg-purple-500 text-white shadow-sm":"text-surface-400 hover:text-surface-200"} disabled:opacity-50 disabled:cursor-not-allowed`,title:"Control a remote session via cloud",children:[f.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),f.jsx("span",{children:"Remote"})]})]}),n==="remote"&&!t&&f.jsxs("span",{className:"hidden sm:flex text-xs text-purple-400 items-center gap-1",children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Commands will execute on the selected remote session"]})]}),cue=()=>{const[n,e]=P.useState(window.innerWidth);return P.useEffect(()=>{const t=()=>e(window.innerWidth);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),null},uue=3,WA=5;function fue(n={}){const{onJobComplete:e,maxOutputLines:t=1e3}=n,[r,s]=P.useState(new Map),[i,a]=P.useState(null),o=P.useRef(new Map),u=P.useRef(r);u.current=r,P.useEffect(()=>()=>{o.current.forEach(q=>{q.readyState===WebSocket.OPEN&&q.close()}),o.current.clear()},[]);const d=P.useCallback((q,z)=>{s(L=>{const E=new Map(L),V=E.get(q);if(V){const B=[...V.output,z];B.length>t&&B.splice(0,B.length-t),E.set(q,{...V,output:B})}return E})},[t]),p=P.useCallback((q,z,L,E)=>{s(V=>{const B=new Map(V),C=B.get(q);return C&&B.set(q,{...C,progress:{current:z,total:L,message:E},status:"running"}),B})},[]),m=P.useCallback((q,z,L,E)=>{s(B=>{const C=new Map(B),G=C.get(q);if(G){let A=[...G.output];if(E!=null&&E.stdout&&typeof E.stdout=="string"&&E.stdout.trim()&&(A.length===0||!A.includes(E.stdout))&&A.push(E.stdout),E!=null&&E.stderr&&typeof E.stderr=="string"&&E.stderr.trim()){const H=`[stderr] ${E.stderr}`;A.includes(H)||A.push(H)}const U={...G,output:A,status:z?"completed":"failed",cost:L,completedAt:new Date,error:z?null:(E==null?void 0:E.error)||"Job failed"};C.set(q,U),e&&e(U,z)}return C});const V=o.current.get(q);V&&V.readyState===WebSocket.OPEN&&V.close(),o.current.delete(q)},[e]),g=P.useCallback(async(q,z)=>{const L=u.current,E=Array.from(L.values()).filter(V=>V.status==="queued"||V.status==="running").length;if(E>=WA)throw new Error(`Too many jobs queued (${E}/${WA}). Please wait for some to complete.`);E>=uue&&console.warn(`Warning: ${E} jobs already running. New job will be queued.`);try{const V=await Ce.executeCommand(q),B=V.job_id,C={id:B,command:q.command,displayCommand:z,status:V.status,progress:null,output:[],cost:0,startedAt:new Date,completedAt:null,error:null};s(A=>{const U=new Map(A);return U.set(B,C),U}),a(B);const G=Ce.connectToJobStream(B,{onStdout:A=>d(B,A),onStderr:A=>d(B,`[stderr] ${A}`),onProgress:(A,U,H)=>p(B,A,U,H),onComplete:(A,U,H)=>m(B,A,H,U),onError:A=>{console.error(`WebSocket error for job ${B}:`,A),m(B,!1,0,{error:A.message})},onClose:()=>{const A=u.current.get(B);A&&A.status==="running"&&Ce.getJobStatus(B).then(U=>{const H=U.status==="completed";m(B,H,U.cost||0,U)}).catch(()=>{m(B,!1,0,{error:"Connection lost"})})}});return o.current.set(B,G),B}catch(V){return console.error("Failed to submit job:",V),null}},[d,p,m]),x=P.useCallback(async q=>{var z,L;try{const E=r.get(q);if((z=E==null?void 0:E.metadata)!=null&&z.remote&&((L=E==null?void 0:E.metadata)!=null&&L.sessionId)){await Ce.cancelRemoteCommand({sessionId:E.metadata.sessionId,commandId:q}),s(B=>{const C=new Map(B),G=C.get(q);return G&&C.set(q,{...G,status:"cancelled",completedAt:new Date}),C});return}const V=o.current.get(q);V&&V.readyState===WebSocket.OPEN&&Ce.sendCancelRequest(V),await Ce.cancelJob(q),s(B=>{const C=new Map(B),G=C.get(q);return G&&C.set(q,{...G,status:"cancelled",completedAt:new Date}),C})}catch(E){throw console.error("Failed to cancel job:",E),E}},[r]),v=P.useCallback((q,z)=>{s(L=>{const E=new Map(L),V=E.get(q);return V&&E.set(q,{...V,...z}),E})},[]),y=P.useCallback(q=>{s(L=>{const E=new Map(L);return E.delete(q),E});const z=o.current.get(q);z&&(z.close(),o.current.delete(q)),a(L=>L===q?null:L)},[]),S=P.useCallback(()=>{s(q=>{const z=new Map(q);for(const[L,E]of z.entries())(E.status==="completed"||E.status==="failed"||E.status==="cancelled")&&z.delete(L);return z})},[]),Q=P.useCallback((q,z,L,E)=>{const V=L||`spawned-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,B={id:V,command:z,displayCommand:q,status:"running",progress:null,output:[E!=null&&E.remote?"Command running on remote session.":"Command running in separate terminal window.","","Status will update automatically when command completes."],cost:0,startedAt:new Date,completedAt:null,error:null,metadata:E};return s(C=>{const G=new Map(C);return G.set(V,B),G}),a(V),V},[]),k=P.useCallback((q,z=!0)=>{s(L=>{const E=new Map(L),V=E.get(q);return V&&(E.set(q,{...V,status:z?"completed":"failed",completedAt:new Date,output:[...V.output,z?"Marked as completed by user.":"Marked as failed by user."]}),e&&e({...V,status:z?"completed":"failed"},z)),E})},[e]),$=P.useCallback((q,z)=>{s(L=>{const E=new Map(L),V=E.get(q);if(V){const B={completed:"✓ Manually marked as completed by user.",failed:"✗ Manually marked as failed by user.",cancelled:"⚠ Manually marked as cancelled by user."};E.set(q,{...V,status:z,completedAt:new Date,output:[...V.output,"",B[z]]}),e&&e({...V,status:z},z==="completed")}return E})},[e]);P.useEffect(()=>{const q=Array.from(r.values()).filter(L=>L.id.startsWith("spawned-")&&L.status==="running");if(q.length===0)return;const z=setInterval(async()=>{for(const L of q)try{const E=await Ce.getSpawnedJobStatus(L.id);if(E.status==="completed"||E.status==="failed"){const V=E.status==="completed";s(B=>{const C=new Map(B),G=C.get(L.id);if(G&&G.status==="running"){const A={...G,status:V?"completed":"failed",completedAt:new Date,output:[...G.output,"",V?`✓ Command completed successfully (exit code: ${E.exit_code||0})`:`✗ Command failed (exit code: ${E.exit_code||1})`]};C.set(L.id,A),e&&e(A,V)}return C})}}catch{}},2e3);return()=>clearInterval(z)},[r,e]),P.useEffect(()=>{if(!Array.from(r.values()).filter(E=>{var V;return(V=E.metadata)==null?void 0:V.remote}).some(E=>E.status==="running"))return;const L=setInterval(async()=>{var B,C;const E=u.current,V=Array.from(E.values()).filter(G=>{var A;return((A=G.metadata)==null?void 0:A.remote)&&G.status==="running"});for(const G of V)if((B=G.metadata)!=null&&B.sessionId)try{const A=await Ce.getRemoteCommandStatus(G.metadata.sessionId,G.id);if(!A)continue;if(A.status==="processing"&&((C=A.response)!=null&&C.streaming)&&s(U=>{var J,X;const H=new Map(U),W=H.get(G.id);if(W&&W.status==="running"){const D=[];if((J=A.response)!=null&&J.stdout){const ee=A.response.stdout.split(`
|
|
387
|
-
`).filter(Z=>Z.trim());D.push(...ee)}if((X=A.response)!=null&&X.stderr){const ee=A.response.stderr.split(`
|
|
388
|
-
`).filter(Z=>Z.trim());D.push(...ee.map(Z=>`[stderr] ${Z}`))}if(D.length>0){const ee=W.output.length<=3&&W.output.some(Z=>Z.includes("Command running")||Z.includes("Status will update"));H.set(G.id,{...W,output:D})}}return H}),A.status==="completed"||A.status==="failed"||A.status==="cancelled"){const U=A.status==="completed",H=A.status==="cancelled";let W=null;s(J=>{var ee,Z,I,K,re;const X=new Map(J),D=X.get(G.id);if(D&&(D.status==="running"||D.status==="queued")){const se=[];if((ee=A.response)!=null&&ee.stdout){const $e=A.response.stdout.split(`
|
|
389
|
-
`).filter(Xe=>Xe.trim());se.push(...$e)}if((Z=A.response)!=null&&Z.stderr){const $e=A.response.stderr.split(`
|
|
390
|
-
`).filter(Xe=>Xe.trim());se.push(...$e.map(Xe=>`[stderr] ${Xe}`))}H?se.push("","⚠ Command was cancelled"):U?se.push("","✓ Command completed successfully"):se.push("",`✗ Command failed: ${((I=A.response)==null?void 0:I.message)||"Unknown error"}`);const be={...D,status:H?"cancelled":U?"completed":"failed",completedAt:new Date,output:se.length>0?se:D.output,cost:((K=A.response)==null?void 0:K.cost)||0,error:U?null:((re=A.response)==null?void 0:re.message)||"Command failed"};X.set(G.id,be),W={job:be,success:U}}return X}),W&&e&&e(W.job,W.success)}}catch(A){console.warn("Failed to poll remote job status:",A)}},2e3);return()=>clearInterval(L)},[r,e]);const j=Array.from(r.values()).filter(q=>q.status==="queued"||q.status==="running"),T=Array.from(r.values()).filter(q=>q.status==="completed"||q.status==="failed"||q.status==="cancelled"),R=i&&r.get(i)||null,N=j.length>0;return{jobs:r,activeJobs:j,completedJobs:T,selectedJob:R,selectedJobId:i,isAnyJobRunning:N,submitJob:g,cancelJob:x,removeJob:y,clearCompletedJobs:S,setSelectedJobId:a,addSpawnedJob:Q,markSpawnedJobDone:k,markJobStatus:$,updateSpawnedJobStatus:v}}const GA="pdd-task-queue",IA=50;function due(){return`task-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function hue(n={}){const{onTaskStart:e,onTaskComplete:t,onQueueComplete:r}=n,[s,i]=P.useState([]),[a,o]=P.useState("manual"),[u,d]=P.useState(!1),[p,m]=P.useState(!1),g=P.useRef({tasks:s,executionMode:a,isQueueRunning:u,isPaused:p});g.current={tasks:s,executionMode:a,isQueueRunning:u,isPaused:p};const x=P.useRef({onTaskStart:e,onTaskComplete:t,onQueueComplete:r});x.current={onTaskStart:e,onTaskComplete:t,onQueueComplete:r};const v=P.useRef(null);P.useEffect(()=>{try{const W=localStorage.getItem(GA);if(W){const{tasks:J,executionMode:X}=JSON.parse(W);if(Array.isArray(J)){const D=J.filter(ee=>ee.status==="pending").map(ee=>({...ee,createdAt:new Date(ee.createdAt)}));i(D)}(X==="auto"||X==="manual")&&o(X)}}catch(W){console.warn("Failed to restore task queue from localStorage:",W)}},[]),P.useEffect(()=>{try{const W=s.filter(J=>J.status==="pending");localStorage.setItem(GA,JSON.stringify({tasks:W,executionMode:a}))}catch(W){console.warn("Failed to save task queue to localStorage:",W)}},[s,a]);const y=P.useCallback((W,J,X,D)=>{const ee={id:due(),commandType:W,prompt:J,rawOptions:X,displayCommand:D,status:"pending",createdAt:new Date};return i(Z=>Z.length>=IA?(console.warn(`Task queue is full (${IA} items). Cannot add more tasks.`),Z):[...Z,ee]),ee.id},[]),S=P.useCallback(W=>{i(J=>J.filter(X=>X.id!==W))},[]),Q=P.useCallback((W,J)=>{i(X=>{var Z;const D=[...X];if(((Z=D[W])==null?void 0:Z.status)!=="pending")return X;const[ee]=D.splice(W,1);return D.splice(J,0,ee),D})},[]),k=P.useCallback(()=>{i([]),d(!1),m(!1)},[]),$=P.useCallback(()=>{i(W=>W.filter(J=>J.status==="pending"||J.status==="running"))},[]),j=P.useCallback((W,J)=>{i(X=>X.map(D=>D.id===W?{...D,...J}:D))},[]),T=P.useCallback(async()=>{var X,D,ee,Z,I,K,re,se;const W=g.current;if(W.isPaused)return;const J=W.tasks.find(be=>be.status==="pending");if(!J){d(!1),(D=(X=x.current).onQueueComplete)==null||D.call(X);return}if(!v.current){console.error("submitJob function not set. Cannot run task.");return}j(J.id,{status:"running",startedAt:new Date}),(Z=(ee=x.current).onTaskStart)==null||Z.call(ee,J);try{const be=await v.current(J);be?j(J.id,{jobId:be}):(j(J.id,{status:"failed",completedAt:new Date,error:"Failed to submit job"}),(K=(I=x.current).onTaskComplete)==null||K.call(I,{...J,status:"failed"},!1),W.executionMode==="auto"&&W.isQueueRunning&&!W.isPaused&&setTimeout(()=>T(),100))}catch(be){const $e=be instanceof Error?be.message:"Unknown error";j(J.id,{status:"failed",completedAt:new Date,error:$e}),(se=(re=x.current).onTaskComplete)==null||se.call(re,{...J,status:"failed"},!1),W.executionMode==="auto"&&W.isQueueRunning&&!W.isPaused&&setTimeout(()=>T(),100)}},[j]),R=P.useCallback((W,J)=>{var Z,I;const X=g.current.tasks.find(K=>K.jobId===W);if(!X)return;const D=J?"completed":"failed";j(X.id,{status:D,completedAt:new Date,error:J?void 0:"Job failed"}),(I=(Z=x.current).onTaskComplete)==null||I.call(Z,{...X,status:D},J);const ee=g.current;ee.executionMode==="auto"&&ee.isQueueRunning&&!ee.isPaused&&setTimeout(()=>T(),100)},[j,T]),N=P.useCallback(async()=>{d(!0),m(!1),await T()},[T]),q=P.useCallback(()=>{m(!0)},[]),z=P.useCallback(async()=>{m(!1),g.current.tasks.some(J=>J.status==="running")||await T()},[T]),L=P.useCallback(async()=>{u||d(!0),m(!1),await T()},[T,u]),E=P.useCallback(W=>{var X,D;const J=g.current.tasks.find(ee=>ee.id===W);if(J&&(j(W,{status:"skipped",completedAt:new Date}),(D=(X=x.current).onTaskComplete)==null||D.call(X,{...J,status:"skipped"},!1),J.status==="running"||J.status==="pending")){const ee=g.current;ee.executionMode==="auto"&&ee.isQueueRunning&&!ee.isPaused&&setTimeout(()=>T(),100)}},[j,T]),V=P.useCallback(W=>{j(W,{status:"pending",jobId:void 0,startedAt:void 0,completedAt:void 0,error:void 0})},[j]),B=P.useCallback(W=>{v.current=W},[]),C=s.filter(W=>W.status==="pending"),G=s.filter(W=>W.status==="completed"||W.status==="failed"||W.status==="skipped"),A=s.find(W=>W.status==="running")||null,U=A!==null,H={total:s.length,completed:G.length,pending:C.length,running:U?1:0};return{tasks:s,executionMode:a,isQueueRunning:u,isPaused:p,runningTask:A,pendingTasks:C,completedTasks:G,progress:H,addTask:y,removeTask:S,reorderTasks:Q,clearQueue:k,clearCompleted:$,skipTask:E,retryTask:V,setExecutionMode:o,startQueue:N,pauseQueue:q,resumeQueue:z,runNextTask:L,handleJobComplete:R,setSubmitJob:B}}const g6=P.createContext(null);async function pue(){return"Notification"in window?Notification.permission==="granted"?!0:Notification.permission!=="denied"?await Notification.requestPermission()==="granted":!1:!1}function mue(n,e,t){Notification.permission==="granted"&&new Notification(n,{body:e,icon:"/favicon.ico",silent:!1})}const Oue=({toast:n,onDismiss:e})=>{P.useEffect(()=>{if(n.duration&&n.duration>0){const s=setTimeout(e,n.duration);return()=>clearTimeout(s)}},[n.duration,e]);const r={success:{bg:"bg-green-500/20",border:"border-green-500/30",text:"text-green-400",icon:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})},error:{bg:"bg-red-500/20",border:"border-red-500/30",text:"text-red-400",icon:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})},info:{bg:"bg-accent-500/20",border:"border-accent-500/30",text:"text-accent-400",icon:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}}[n.type];return f.jsxs("div",{className:`
|
|
391
|
-
flex items-center gap-3 px-4 py-3 rounded-xl border backdrop-blur-lg shadow-lg
|
|
392
|
-
${r.bg} ${r.border}
|
|
393
|
-
`,style:{animation:"slideIn 0.3s ease-out"},children:[f.jsx("span",{className:r.text,children:r.icon}),f.jsx("p",{className:"text-sm text-white flex-1",children:n.message}),f.jsx("button",{onClick:e,className:"text-surface-400 hover:text-white transition-colors",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})},gue=()=>f.jsx("style",{children:`
|
|
394
|
-
@keyframes slideIn {
|
|
395
|
-
from {
|
|
396
|
-
transform: translateX(100%);
|
|
397
|
-
opacity: 0;
|
|
398
|
-
}
|
|
399
|
-
to {
|
|
400
|
-
transform: translateX(0);
|
|
401
|
-
opacity: 1;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
@keyframes indeterminate {
|
|
405
|
-
0% {
|
|
406
|
-
transform: translateX(-100%);
|
|
407
|
-
}
|
|
408
|
-
100% {
|
|
409
|
-
transform: translateX(400%);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
.animate-indeterminate {
|
|
413
|
-
animation: indeterminate 1.5s ease-in-out infinite;
|
|
414
|
-
}
|
|
415
|
-
`}),xue=({toasts:n,removeToast:e})=>f.jsxs(f.Fragment,{children:[f.jsx(gue,{}),n.length>0&&f.jsx("div",{className:"fixed top-4 right-4 z-[100] space-y-2 max-w-sm",children:n.map(t=>f.jsx(Oue,{toast:t,onDismiss:()=>e(t.id)},t.id))})]}),bue=({children:n})=>{const[e,t]=P.useState([]),r=P.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]),s=P.useCallback((i,a,o=5e3)=>{const d={id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,message:i,type:a,duration:o};t(p=>[...p,d]),document.hidden&&(a==="success"||a==="error")&&mue(a==="success"?"Job Completed":"Job Failed",i)},[]);return P.useEffect(()=>{pue()},[]),f.jsxs(g6.Provider,{value:{addToast:s,removeToast:r},children:[n,f.jsx(xue,{toasts:e,removeToast:r})]})};function yue(){const n=P.useContext(g6);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const HA=()=>{const n=window.location.hash.slice(1);if(!n)return{view:"architecture"};const[e,...t]=n.split("/"),r=t.length>0?t.join("/"):void 0;return{view:["architecture","prompts","bug","fix","change","settings"].includes(e)?e:"architecture",promptPath:r}},vue=()=>{const n=HA(),[e,t]=P.useState(n.view),[r,s]=P.useState(n.promptPath),[i,a]=P.useState(null),[o,u]=P.useState(null),[d,p]=P.useState(!1),[m,g]=P.useState("idle"),[x,v]=P.useState(null),[y,S]=P.useState(null),[Q,k]=P.useState(!1),[$,j]=P.useState(""),[T,R]=P.useState(""),[N,q]=P.useState(""),[z,L]=P.useState(null),[E,V]=P.useState(!1),[B,C]=P.useState(!1),[G,A]=P.useState(null),{addToast:U}=yue(),[H,W]=P.useState("local"),[J,X]=P.useState([]),[D,ee]=P.useState(null),[Z,I]=P.useState(null),[K,re]=P.useState(!1),se=hue({onTaskStart:de=>{U(`Starting task: ${de.displayCommand}`,"info",3e3)},onTaskComplete:(de,we)=>{U(`Task ${we?"completed":"failed"}: ${de.displayCommand}`,we?"success":"error",5e3)},onQueueComplete:()=>{U("Task queue completed","success",3e3)}}),be=P.useCallback((de,we)=>{U(`${de.displayCommand} ${we?"completed successfully":"failed"}`,we?"success":"error",5e3),se.handleJobComplete(de.id,we)},[U,se]),{activeJobs:$e,completedJobs:Xe,selectedJob:ae,isAnyJobRunning:Qe,cancelJob:Oe,removeJob:ye,clearCompletedJobs:Fe,setSelectedJobId:Te,addSpawnedJob:ge,markSpawnedJobDone:Ke,markJobStatus:ot}=fue({onJobComplete:be}),st=P.useCallback(async de=>{try{const{args:we,options:ke,displayCommand:Be,backendName:Qn}=_j(de.commandType,de.prompt,de.rawOptions);if(H==="remote"&&D){const{commandId:Dt}=await Ce.submitRemoteCommand({sessionId:D,type:Qn,payload:{args:we,options:ke}});return ge(`[Remote] ${Be}`,Qn,Dt,{remote:!0,sessionId:D}),Dt}else{const Dt=await Ce.spawnTerminal({command:Qn,args:we,options:ke});return Dt.success&&Dt.job_id?(ge(Be,Qn,Dt.job_id),Dt.job_id):(console.error("Failed to spawn terminal:",Dt.message),null)}}catch(we){return console.error("Failed to submit job:",we),null}},[ge,H,D]);P.useEffect(()=>{se.setSubmitJob(st)},[se,st]);const ht=P.useCallback((de,we,ke,Be)=>{se.addTask(de,we,ke,Be),U(`Added to queue: ${Be}`,"info",3e3)},[se,U]);P.useCallback(de=>{A(de),C(!0)},[]),P.useEffect(()=>{Ce.getStatus().then(()=>k(!0)).catch(()=>k(!1))},[]),P.useEffect(()=>{o?window.location.hash=`prompts/${o.prompt}`:window.location.hash=e},[e,o]),P.useEffect(()=>{const de=()=>{const{view:we,promptPath:ke}=HA();t(we),ke?s(ke):u(null)};return window.addEventListener("hashchange",de),()=>window.removeEventListener("hashchange",de)},[]),P.useEffect(()=>{Q&&r&&Ce.listPrompts().then(de=>{const we=de.find(ke=>ke.prompt===r);we&&u(we),s(void 0)}).catch(()=>{s(void 0)})},[Q,r]),P.useEffect(()=>{if(!Q)return;const de=async()=>{try{const ke=await Ce.listRemoteSessions();X(ke),I(null)}catch(ke){const Be=ke instanceof Error?ke.message:String(ke);console.error("Failed to fetch remote sessions:",Be),I(Be),Be.includes("Not authenticated")||Be.includes("401")||Be.includes("403")||(Be.includes("timeout")||Be.includes("network")||Be.includes("Failed to fetch")?U("Network error: Cannot reach cloud. Check your connection.","error",5e3):U(`Failed to load remote sessions: ${Be}`,"error",5e3))}};de();const we=setInterval(de,3e4);return()=>clearInterval(we)},[Q,U]);const Je=async(de,we,ke)=>{if(!Q){alert('Server not connected. Run "pdd connect" in your terminal first.');return}const Be=Ra[de];p(!0),g("running");const{args:Qn,options:Dt,displayCommand:kn}=_j(de,we,ke||{});v(kn);try{if(H==="remote"&&D){const Zt=J.find(pn=>pn.sessionId===D);if((Zt==null?void 0:Zt.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
416
|
-
|
|
417
|
-
The remote machine may not be running or has lost connection.
|
|
418
|
-
The command may not be executed.
|
|
419
|
-
|
|
420
|
-
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:pn}=await Ce.submitRemoteCommand({sessionId:D,type:Be.backendName,payload:{args:Qn,options:Dt}});ge(`[Remote] ${kn}`,Be.backendName,pn,{remote:!0,sessionId:D}),g("success"),U("Command submitted to remote session","success",3e3)}catch(pn){g("failed"),U(`Failed to submit remote command: ${pn instanceof Error?pn.message:String(pn)}`,"error",5e3)}}else{const Zt=await Ce.spawnTerminal({command:Be.backendName,args:Qn,options:Dt});Zt.success?(ge(kn,Be.backendName,Zt.job_id),g("success"),U(`Opened terminal: ${kn}`,"success",3e3)):(g("failed"),U(`Failed to open terminal: ${Zt.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(Zt){console.error("Failed to execute command:",Zt),S({success:!1,message:Zt.message||"Failed to execute command",exit_code:1,error_details:Zt.message}),g("failed"),U(`Error: ${Zt.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},1e4)}finally{p(!1)}},tt=async()=>{if(!Q){alert('Server not connected. Run "pdd connect" in your terminal first.');return}if(!$.trim()){alert("Please enter a GitHub issue URL");return}p(!0),g("running");const de=`pdd bug ${$}`;v(de);try{if(H==="remote"&&D){const we=J.find(ke=>ke.sessionId===D);if((we==null?void 0:we.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
421
|
-
|
|
422
|
-
The remote machine may not be running or has lost connection.
|
|
423
|
-
The command may not be executed.
|
|
424
|
-
|
|
425
|
-
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:ke}=await Ce.submitRemoteCommand({sessionId:D,type:"bug",payload:{args:{args:[$]},options:{}}});ge(`[Remote] ${de}`,"bug",ke,{remote:!0,sessionId:D}),g("success"),U("Command submitted to remote session","success",3e3)}catch(ke){g("failed"),U(`Failed to submit remote command: ${ke instanceof Error?ke.message:String(ke)}`,"error",5e3)}}else{const we=await Ce.spawnTerminal({command:"bug",args:{args:[$]},options:{}});we.success?(ge(de,"bug",we.job_id),g("success"),U(`Opened terminal: ${de}`,"success",3e3)):(g("failed"),U(`Failed to open terminal: ${we.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(we){console.error("Failed to execute bug command:",we),g("failed"),U(`Error: ${we.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},5e3)}finally{p(!1)}},hn=async()=>{if(!Q){alert('Server not connected. Run "pdd connect" in your terminal first.');return}if(!T.trim()){alert("Please enter a GitHub PR URL");return}p(!0),g("running");const de=`pdd fix ${T}`;v(de);try{if(H==="remote"&&D){const we=J.find(ke=>ke.sessionId===D);if((we==null?void 0:we.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
426
|
-
|
|
427
|
-
The remote machine may not be running or has lost connection.
|
|
428
|
-
The command may not be executed.
|
|
429
|
-
|
|
430
|
-
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:ke}=await Ce.submitRemoteCommand({sessionId:D,type:"fix",payload:{args:{args:[T]},options:{}}});ge(`[Remote] ${de}`,"fix",ke,{remote:!0,sessionId:D}),g("success"),U("Command submitted to remote session","success",3e3)}catch(ke){g("failed"),U(`Failed to submit remote command: ${ke instanceof Error?ke.message:String(ke)}`,"error",5e3)}}else{const we=await Ce.spawnTerminal({command:"fix",args:{args:[T]},options:{}});we.success?(ge(de,"fix",we.job_id),g("success"),U(`Opened terminal: ${de}`,"success",3e3)):(g("failed"),U(`Failed to open terminal: ${we.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(we){console.error("Failed to execute fix command:",we),g("failed"),U(`Error: ${we.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},5e3)}finally{p(!1)}},Qt=async()=>{if(!Q){alert('Server not connected. Run "pdd connect" in your terminal first.');return}if(!N.trim()){alert("Please enter a GitHub issue URL");return}p(!0),g("running");const de=`pdd change ${N}`;v(de);try{if(H==="remote"&&D){const we=J.find(ke=>ke.sessionId===D);if((we==null?void 0:we.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
431
|
-
|
|
432
|
-
The remote machine may not be running or has lost connection.
|
|
433
|
-
The command may not be executed.
|
|
434
|
-
|
|
435
|
-
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:ke}=await Ce.submitRemoteCommand({sessionId:D,type:"change",payload:{args:{args:[N]},options:{}}});ge(`[Remote] ${de}`,"change",ke,{remote:!0,sessionId:D}),g("success"),U("Command submitted to remote session","success",3e3)}catch(ke){g("failed"),U(`Failed to submit remote command: ${ke instanceof Error?ke.message:String(ke)}`,"error",5e3)}}else{const we=await Ce.spawnTerminal({command:"change",args:{args:[N]},options:{}});we.success?(ge(de,"change",we.job_id),g("success"),U(`Opened terminal: ${de}`,"success",3e3)):(g("failed"),U(`Failed to open terminal: ${we.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(we){console.error("Failed to execute change command:",we),g("failed"),U(`Error: ${we.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},5e3)}finally{p(!1)}},zt=(de,we)=>{o&&Je(de,o,we)},St=(de,we)=>{if(o){const ke=we||{},Be=Z2(de,o,ke);ht(de,o,ke,Be)}},en=async()=>{try{(await Ce.cancelCommand()).cancelled&&(g("failed"),v(null),setTimeout(()=>g("idle"),3e3))}catch(de){console.error("Failed to cancel:",de)}},ln=P.useCallback((de,we)=>{L({id:`batch-${Date.now()}`,name:de,current:0,total:we,currentItem:"",status:"running",startedAt:new Date})},[]),pt=P.useCallback((de,we,ke)=>{L(Be=>Be?{...Be,current:de,total:we,currentItem:ke}:null)},[]),Lt=P.useCallback(de=>{L(we=>we?{...we,status:de?"completed":"failed"}:null),setTimeout(()=>L(null),3e3)},[]),ct=P.useCallback(async()=>{try{await Ce.cancelCommand()}catch(de){console.error("Failed to cancel batch operation:",de)}},[]);return o?f.jsx(uee,{prompt:o,onBack:()=>u(null),onRunCommand:zt,onAddToQueue:St,isExecuting:d,executionStatus:m,lastCommand:x,lastRunResult:y,onCancelCommand:en}):f.jsx(aue,{children:f.jsxs("div",{className:"min-h-screen bg-surface-950",children:[f.jsx("header",{className:"glass sticky top-0 z-40 border-b border-surface-700/50",children:f.jsx("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 2xl:px-12",children:f.jsxs("div",{className:"flex items-center justify-between h-16",children:[f.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",children:[f.jsx("div",{className:"w-8 h-8 sm:w-9 sm:h-9 rounded-lg bg-surface-800/80 flex items-center justify-center shadow-glow p-1",children:f.jsxs("svg",{viewBox:"0 0 1024 1024",className:"w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("defs",{children:f.jsxs("filter",{id:"glow-header",x:"-60%",y:"-60%",width:"220%",height:"220%",children:[f.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"40",result:"blur"}),f.jsxs("feMerge",{children:[f.jsx("feMergeNode",{in:"blur"}),f.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),f.jsxs("g",{stroke:"#00e3ff",strokeWidth:"60",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",filter:"url(#glow-header)",children:[f.jsx("path",{d:"M 260 180 H 600 A 230 230 0 0 1 600 660 H 480 L 260 880 V 180 Z"}),f.jsx("polyline",{points:"505 340 585 420 505 500"})]})]})}),f.jsx("div",{className:"hidden sm:block",children:f.jsx("h1",{className:"text-base sm:text-lg font-bold text-white whitespace-nowrap",children:"Prompt Driven Development"})})]}),f.jsxs("div",{className:"flex gap-1 sm:gap-2 bg-surface-800/50 p-1 rounded-xl max-w-[280px] xs:max-w-none overflow-x-auto scrollbar-hide",children:[f.jsxs("button",{onClick:()=>t("architecture"),className:`px-2 xs:px-3 sm:px-4 py-1 xs:py-1.5 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-all duration-200 ${e==="architecture"?"bg-accent-600 text-white shadow-lg shadow-accent-500/25":"text-surface-300 hover:text-white hover:bg-surface-700"}`,children:[f.jsx(VJ,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Architecture"]}),f.jsxs("button",{onClick:()=>t("prompts"),className:`px-2 xs:px-3 sm:px-4 py-1 xs:py-1.5 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-all duration-200 ${e==="prompts"?"bg-accent-600 text-white shadow-lg shadow-accent-500/25":"text-surface-300 hover:text-white hover:bg-surface-700"}`,children:[f.jsx(Zz,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Prompts"]}),f.jsxs("button",{onClick:()=>t("bug"),className:`px-2 xs:px-3 sm:px-4 py-1 xs:py-1.5 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-all duration-200 ${e==="bug"?"bg-accent-600 text-white shadow-lg shadow-accent-500/25":"text-surface-300 hover:text-white hover:bg-surface-700"}`,children:[f.jsx(Rx,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Bug"]}),f.jsxs("button",{onClick:()=>t("fix"),className:`px-2 xs:px-3 sm:px-4 py-1 xs:py-1.5 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-all duration-200 ${e==="fix"?"bg-accent-600 text-white shadow-lg shadow-accent-500/25":"text-surface-300 hover:text-white hover:bg-surface-700"}`,children:[f.jsx("svg",{className:"hidden sm:inline w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),"Fix"]}),f.jsxs("button",{onClick:()=>t("change"),className:`px-2 xs:px-3 sm:px-4 py-1 xs:py-1.5 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-all duration-200 ${e==="change"?"bg-accent-600 text-white shadow-lg shadow-accent-500/25":"text-surface-300 hover:text-white hover:bg-surface-700"}`,children:[f.jsx("svg",{className:"hidden sm:inline w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})}),"Change"]}),f.jsxs("button",{onClick:()=>t("settings"),className:`px-2 xs:px-3 sm:px-4 py-1 xs:py-1.5 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-all duration-200 ${e==="settings"?"bg-accent-600 text-white shadow-lg shadow-accent-500/25":"text-surface-300 hover:text-white hover:bg-surface-700"}`,children:[f.jsx(Yz,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Settings"]})]}),f.jsxs("button",{onClick:()=>re(!K),className:`flex items-center gap-1.5 px-2 sm:px-3 py-1.5 rounded-lg text-xs sm:text-sm font-medium transition-colors ${H==="remote"?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-surface-700/50 text-surface-400 border border-surface-600/50 hover:bg-surface-700"}`,title:K?"Hide remote session panel":"Show remote session panel",children:[f.jsx("span",{"aria-hidden":"true",children:H==="remote"?"🌐":"💻"}),f.jsx("span",{className:"sr-only",children:H==="remote"?"Remote execution mode":"Local execution mode"}),f.jsx("span",{className:"hidden sm:inline",children:H==="remote"?"Remote":"Local"}),f.jsx("svg",{className:`w-3 h-3 transition-transform ${K?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f.jsxs("div",{className:`flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-1.5 rounded-full transition-colors ${Q?"bg-green-500/10 text-green-400 border border-green-500/20":"bg-yellow-500/10 text-yellow-400 border border-yellow-500/20"}`,children:[f.jsx("span",{className:`w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full ${Q?"bg-green-400 animate-pulse-slow":"bg-yellow-400 animate-pulse"}`}),f.jsx("span",{className:"hidden xs:inline",children:Q?"Connected":"Offline"})]}),f.jsx(sue,{onReauth:()=>V(!0)})]})})}),K&&f.jsx("div",{className:"glass border-b border-surface-700/50 animate-slide-down",children:f.jsxs("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 2xl:px-12 py-3",children:[f.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-3 sm:gap-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs text-surface-400",children:"Mode:"}),f.jsx(oue,{mode:H,onModeChange:W})]}),H==="remote"&&f.jsx("div",{className:"flex-1 w-full sm:w-auto",children:f.jsx(lue,{sessions:J,selectedSessionId:D,onSelectSession:ee,error:Z,onRefresh:async()=>{try{const de=await Ce.listRemoteSessions();X(de),I(null)}catch(de){I(de instanceof Error?de.message:String(de))}}})}),f.jsx("button",{onClick:()=>re(!1),className:"absolute right-4 sm:relative sm:right-auto text-surface-400 hover:text-white p-1 rounded-lg hover:bg-surface-700/50 transition-colors",title:"Close panel","aria-label":"Close remote session panel",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsx("p",{className:"text-xs text-surface-500 mt-2",children:H==="local"?"Commands execute on this machine in terminal windows.":D?"Commands will be sent to the selected remote session via cloud.":"Select a remote session to execute commands remotely."})]})}),m!=="idle"&&f.jsxs("div",{className:`
|
|
436
|
-
px-4 sm:px-6 py-2.5 sm:py-3 text-center text-xs sm:text-sm font-medium border-b animate-slide-down
|
|
437
|
-
${m==="running"?"bg-accent-500/10 text-accent-300 border-accent-500/20":""}
|
|
438
|
-
${m==="success"?"bg-green-500/10 text-green-300 border-green-500/20":""}
|
|
439
|
-
${m==="failed"?"bg-red-500/10 text-red-300 border-red-500/20":""}
|
|
440
|
-
`,children:[m==="running"&&f.jsxs("span",{className:"flex items-center justify-center gap-2 flex-wrap",children:[f.jsxs("svg",{className:"animate-spin h-4 w-4 flex-shrink-0",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),f.jsx("span",{className:"hidden sm:inline",children:"Running:"}),f.jsx("code",{className:"bg-surface-800/80 px-2 py-0.5 rounded font-mono text-xs max-w-[200px] sm:max-w-none truncate",children:x}),f.jsx("span",{className:"text-surface-400 hidden md:inline",children:"(output in terminal)"}),f.jsx("button",{onClick:async()=>{try{(await Ce.cancelCommand()).cancelled&&(g("failed"),v(null),setTimeout(()=>g("idle"),3e3))}catch(de){console.error("Failed to cancel:",de)}},className:"ml-2 sm:ml-4 px-2.5 sm:px-3 py-1 bg-red-500/20 hover:bg-red-500/30 text-red-300 border border-red-500/30 rounded-lg text-xs font-medium transition-colors",children:"Stop"})]}),m==="success"&&f.jsxs("span",{className:"flex items-center justify-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Command completed successfully"]}),m==="failed"&&f.jsxs("span",{className:"flex items-center justify-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),f.jsx("span",{className:"hidden sm:inline",children:"Command failed or cancelled - check terminal"}),f.jsx("span",{className:"sm:hidden",children:"Command failed"})]})]}),f.jsxs("main",{className:"mx-auto px-4 sm:px-6 lg:px-8 2xl:px-12 py-4 sm:py-6 pb-16 sm:pb-20",children:[!Q&&f.jsx("div",{className:"mb-4 sm:mb-6 p-3 sm:p-4 glass-light rounded-xl border border-yellow-500/20 animate-fade-in",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx("div",{className:"w-8 h-8 rounded-lg bg-yellow-500/20 flex items-center justify-center flex-shrink-0",children:f.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),f.jsxs("div",{children:[f.jsx("p",{className:"text-yellow-300 text-sm sm:text-base font-medium",children:"Server not connected"}),f.jsxs("p",{className:"text-yellow-200/70 text-xs sm:text-sm mt-1",children:["Run ",f.jsx("code",{className:"bg-surface-800/80 px-1.5 py-0.5 rounded font-mono text-yellow-300",children:"pdd connect"})," in your terminal to enable command execution."]})]})]})}),e==="architecture"?f.jsx("div",{className:"animate-fade-in",children:f.jsx(Dce,{serverConnected:Q,isExecuting:d,onOpenPromptSpace:de=>u(de),onBatchStart:ln,onBatchProgress:pt,onBatchComplete:Lt,executionMode:H,selectedRemoteSession:D,onRemoteJobSubmitted:(de,we,ke,Be)=>{ge(de,we,ke,{remote:!0,sessionId:Be})}})}):e==="prompts"?f.jsxs("div",{className:"animate-fade-in",children:[f.jsx("div",{className:"mb-4 sm:mb-6",children:f.jsx("p",{className:"text-surface-400 text-xs sm:text-sm",children:"Select a prompt and click a command to run. Output appears in your terminal."})}),f.jsx(FV,{onSelectPrompt:a,onEditPrompt:u,onCreatePrompt:u,selectedPrompt:i})]}):e==="settings"?f.jsx("div",{className:"animate-fade-in",children:f.jsx(Wce,{})}):e==="bug"?f.jsxs("div",{className:"max-w-6xl mx-auto animate-fade-in",children:[f.jsxs("div",{className:"mb-6 text-center sm:text-left",children:[f.jsxs("h2",{className:"text-xl sm:text-2xl font-semibold text-white mb-2 flex items-center justify-center sm:justify-start gap-2",children:[f.jsx("span",{className:"w-10 h-10 rounded-xl bg-red-500/20 flex items-center justify-center",children:f.jsx(Rx,{className:"w-5 h-5"})}),"Bug Investigation Agent"]}),f.jsx("p",{className:"text-surface-400 text-sm",children:"Automatically investigate GitHub issues and generate failing test cases with AI-powered analysis."})]}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-6 border border-surface-700/50",children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:"GitHub Issue URL"}),f.jsx("input",{type:"url",value:$,onChange:de=>j(de.target.value),placeholder:"https://github.com/org/repo/issues/123",className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 transition-all text-sm sm:text-base",disabled:d}),f.jsxs("button",{onClick:tt,disabled:d||!Q||!$.trim(),className:`
|
|
441
|
-
mt-4 w-full px-4 py-2.5 sm:py-3 rounded-xl font-medium transition-all duration-200 flex items-center justify-center gap-2 text-sm sm:text-base
|
|
442
|
-
${d||!Q||!$.trim()?"bg-surface-700 text-surface-500 cursor-not-allowed":"bg-gradient-to-r from-red-600 to-red-500 hover:from-red-500 hover:to-red-400 text-white shadow-lg shadow-red-500/25 hover:shadow-red-500/40"}
|
|
443
|
-
`,children:[f.jsx(Rx,{className:"w-4 h-4"}),f.jsx("span",{children:"Start Investigation"})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Prerequisites"]}),f.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"1"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"GitHub CLI installed"})," - Install from ",f.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"brew install gh"})," or ",f.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 hover:underline",children:"cli.github.com"})]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"2"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Authenticated with GitHub"})," - Run ",f.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"gh auth login"})," if needed"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"3"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Repository cloned locally"})," - The agent works within your local codebase"]})]})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"After Investigation"]}),f.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"1."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Review the draft PR"})," - The agent creates a draft PR with a failing test"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"2."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Fix the bug"})," - Implement the fix to make the test pass"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"3."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Mark PR ready"})," - Convert from draft to ready for review"]})]})]})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Agent Workflow (10 Steps)"]}),f.jsx("div",{className:"space-y-1",children:[{step:1,name:"Duplicate Check",desc:"Search for existing similar issues"},{step:2,name:"Documentation Check",desc:"Verify if it's a known issue or user error"},{step:3,name:"Triage",desc:"Assess if sufficient information is provided"},{step:4,name:"Reproduce",desc:"Attempt to reproduce the reported bug"},{step:5,name:"Root Cause Analysis",desc:"Identify the underlying cause"},{step:6,name:"Test Plan",desc:"Design a testing strategy"},{step:7,name:"Generate Test",desc:"Create a failing unit test"},{step:8,name:"Verify Test",desc:"Ensure test correctly detects the bug"},{step:9,name:"E2E Test",desc:"Run end-to-end tests to verify fix"},{step:10,name:"Create PR",desc:"Open a draft pull request"}].map(de=>f.jsxs("div",{className:"flex items-start gap-3 py-1.5 px-2 rounded-lg hover:bg-surface-800/30 transition-colors",children:[f.jsx("div",{className:"w-5 h-5 rounded-full bg-surface-700 flex items-center justify-center text-[10px] font-medium text-surface-300 flex-shrink-0",children:de.step}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-xs text-white font-medium",children:de.name}),f.jsx("p",{className:"text-[11px] text-surface-500",children:de.desc})]})]},de.step))}),f.jsx("div",{className:"mt-4 pt-3 border-t border-surface-700/50",children:f.jsxs("p",{className:"text-xs text-surface-500",children:[f.jsx("strong",{className:"text-surface-400",children:"Note:"})," The agent may exit early if it detects a duplicate issue, feature request, or insufficient information. Progress is shown in the terminal."]})})]})]})]}):e==="fix"?f.jsxs("div",{className:"max-w-6xl mx-auto animate-fade-in",children:[f.jsxs("div",{className:"mb-6 text-center sm:text-left",children:[f.jsxs("h2",{className:"text-xl sm:text-2xl font-semibold text-white mb-2 flex items-center justify-center sm:justify-start gap-2",children:[f.jsx("span",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center",children:f.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),"PR Fix Agent"]}),f.jsx("p",{className:"text-surface-400 text-sm",children:"Automatically fix code issues based on PR review comments with AI-powered analysis."})]}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-6 border border-surface-700/50",children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:"GitHub PR URL"}),f.jsx("input",{type:"url",value:T,onChange:de=>R(de.target.value),placeholder:"https://github.com/org/repo/pull/123",className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 transition-all text-sm sm:text-base",disabled:d}),f.jsxs("button",{onClick:hn,disabled:d||!Q||!T.trim(),className:`
|
|
444
|
-
mt-4 w-full px-4 py-2.5 sm:py-3 rounded-xl font-medium transition-all duration-200 flex items-center justify-center gap-2 text-sm sm:text-base
|
|
445
|
-
${d||!Q||!T.trim()?"bg-surface-700 text-surface-500 cursor-not-allowed":"bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-500 hover:to-blue-400 text-white shadow-lg shadow-blue-500/25 hover:shadow-blue-500/40"}
|
|
446
|
-
`,children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),f.jsx("span",{children:"Start Fix"})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Prerequisites"]}),f.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"1"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"GitHub CLI installed"})," - Install from ",f.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"brew install gh"})," or ",f.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 hover:underline",children:"cli.github.com"})]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"2"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Authenticated with GitHub"})," - Run ",f.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"gh auth login"})," if needed"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"3"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"PR has review comments"})," - The agent analyzes review comments to understand what needs fixing"]})]})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"After Fix"]}),f.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"1."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Review the changes"})," - The agent commits fixes addressing review comments"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"2."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Run tests"})," - Verify the fixes don't break existing functionality"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"3."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Push changes"})," - Push the fix commits to update the PR"]})]})]})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Agent Workflow"]}),f.jsx("div",{className:"space-y-1",children:[{step:1,name:"Fetch PR Details",desc:"Get PR information and review comments"},{step:2,name:"Analyze Comments",desc:"Understand what changes are requested"},{step:3,name:"Locate Code",desc:"Find the relevant code sections to fix"},{step:4,name:"Plan Changes",desc:"Design the fix approach"},{step:5,name:"Apply Fixes",desc:"Make the necessary code changes"},{step:6,name:"Verify Changes",desc:"Ensure fixes address the comments"},{step:7,name:"Commit",desc:"Create commits with fix descriptions"}].map(de=>f.jsxs("div",{className:"flex items-start gap-3 py-1.5 px-2 rounded-lg hover:bg-surface-800/30 transition-colors",children:[f.jsx("div",{className:"w-5 h-5 rounded-full bg-surface-700 flex items-center justify-center text-[10px] font-medium text-surface-300 flex-shrink-0",children:de.step}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-xs text-white font-medium",children:de.name}),f.jsx("p",{className:"text-[11px] text-surface-500",children:de.desc})]})]},de.step))}),f.jsx("div",{className:"mt-4 pt-3 border-t border-surface-700/50",children:f.jsxs("p",{className:"text-xs text-surface-500",children:[f.jsx("strong",{className:"text-surface-400",children:"Note:"})," The agent focuses on addressing review comments. Progress is shown in the terminal."]})})]})]})]}):e==="change"?f.jsxs("div",{className:"max-w-6xl mx-auto animate-fade-in",children:[f.jsxs("div",{className:"mb-6 text-center sm:text-left",children:[f.jsxs("h2",{className:"text-xl sm:text-2xl font-semibold text-white mb-2 flex items-center justify-center sm:justify-start gap-2",children:[f.jsx("span",{className:"w-10 h-10 rounded-xl bg-purple-500/20 flex items-center justify-center",children:f.jsx("svg",{className:"w-5 h-5 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})})}),"Change Request Agent"]}),f.jsx("p",{className:"text-surface-400 text-sm",children:"Automatically implement feature requests and changes from GitHub issues with AI-powered analysis."})]}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-6 border border-surface-700/50",children:[f.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:"GitHub Issue URL"}),f.jsx("input",{type:"url",value:N,onChange:de=>q(de.target.value),placeholder:"https://github.com/org/repo/issues/123",className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 bg-surface-900/50 border border-surface-600 rounded-xl text-white placeholder-surface-500 focus:outline-none focus:border-accent-500 focus:ring-1 focus:ring-accent-500/50 transition-all text-sm sm:text-base",disabled:d}),f.jsxs("button",{onClick:Qt,disabled:d||!Q||!N.trim(),className:`
|
|
447
|
-
mt-4 w-full px-4 py-2.5 sm:py-3 rounded-xl font-medium transition-all duration-200 flex items-center justify-center gap-2 text-sm sm:text-base
|
|
448
|
-
${d||!Q||!N.trim()?"bg-surface-700 text-surface-500 cursor-not-allowed":"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-500 hover:to-purple-400 text-white shadow-lg shadow-purple-500/25 hover:shadow-purple-500/40"}
|
|
449
|
-
`,children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})}),f.jsx("span",{children:"Start Implementation"})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Prerequisites"]}),f.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"1"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"GitHub CLI installed"})," - Install from ",f.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"brew install gh"})," or ",f.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 hover:underline",children:"cli.github.com"})]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"2"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Authenticated with GitHub"})," - Run ",f.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"gh auth login"})," if needed"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"w-4 h-4 rounded-full bg-surface-700 flex items-center justify-center text-[10px] text-surface-300 flex-shrink-0 mt-0.5",children:"3"}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Clear requirements"})," - The issue should describe the desired change clearly"]})]})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"After Implementation"]}),f.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"1."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Review the draft PR"})," - The agent creates a draft PR with the implementation"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"2."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Test the changes"})," - Verify the implementation works as expected"]})]}),f.jsxs("li",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-green-400",children:"3."}),f.jsxs("span",{children:[f.jsx("strong",{className:"text-surface-300",children:"Mark PR ready"})," - Convert from draft to ready for review"]})]})]})]})]}),f.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[f.jsxs("h3",{className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Agent Workflow"]}),f.jsx("div",{className:"space-y-1",children:[{step:1,name:"Fetch Issue",desc:"Get issue details and requirements"},{step:2,name:"Analyze Requirements",desc:"Understand what needs to be implemented"},{step:3,name:"Explore Codebase",desc:"Find relevant code and patterns"},{step:4,name:"Plan Implementation",desc:"Design the approach and changes needed"},{step:5,name:"Implement Changes",desc:"Write the code for the feature"},{step:6,name:"Add Tests",desc:"Create tests for the new functionality"},{step:7,name:"Verify",desc:"Run tests and verify implementation"},{step:8,name:"Create PR",desc:"Open a draft pull request"}].map(de=>f.jsxs("div",{className:"flex items-start gap-3 py-1.5 px-2 rounded-lg hover:bg-surface-800/30 transition-colors",children:[f.jsx("div",{className:"w-5 h-5 rounded-full bg-surface-700 flex items-center justify-center text-[10px] font-medium text-surface-300 flex-shrink-0",children:de.step}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-xs text-white font-medium",children:de.name}),f.jsx("p",{className:"text-[11px] text-surface-500",children:de.desc})]})]},de.step))}),f.jsx("div",{className:"mt-4 pt-3 border-t border-surface-700/50",children:f.jsxs("p",{className:"text-xs text-surface-500",children:[f.jsx("strong",{className:"text-surface-400",children:"Note:"})," The agent analyzes the issue and implements the requested changes. Progress is shown in the terminal."]})})]})]})]}):null]}),f.jsx(Fce,{activeJobs:$e,completedJobs:Xe,selectedJob:ae,onSelectJob:Te,onCancelJob:Oe,onRemoveJob:ye,onClearCompleted:Fe,onMarkSpawnedDone:Ke,onMarkJobStatus:ot,batchOperation:z,onCancelBatchOperation:ct}),f.jsx(nue,{tasks:se.tasks,executionMode:se.executionMode,isQueueRunning:se.isQueueRunning,isPaused:se.isPaused,progress:se.progress,onSetExecutionMode:se.setExecutionMode,onStartQueue:se.startQueue,onPauseQueue:se.pauseQueue,onResumeQueue:se.resumeQueue,onRunNextTask:se.runNextTask,onRemoveTask:se.removeTask,onSkipTask:se.skipTask,onRetryTask:se.retryTask,onReorderTasks:se.reorderTasks,onClearCompleted:se.clearCompleted,onClearAll:se.clearQueue}),f.jsx(rue,{isOpen:B,prompt:G,onAddToQueue:ht,onClose:()=>{C(!1),A(null)}}),f.jsx("footer",{className:"fixed bottom-0 left-0 right-0 z-40 glass border-t border-surface-700/50 px-4 sm:px-6 py-2.5 sm:py-3",children:f.jsxs("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 2xl:px-12 flex items-center justify-center gap-2 text-xs text-surface-500",children:[f.jsx("span",{className:"w-4 h-4 rounded bg-surface-800/80 flex items-center justify-center p-0.5",children:f.jsx("svg",{viewBox:"0 0 1024 1024",className:"w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:f.jsxs("g",{stroke:"#00e3ff",strokeWidth:"70",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",children:[f.jsx("path",{d:"M 260 180 H 600 A 230 230 0 0 1 600 660 H 480 L 260 880 V 180 Z"}),f.jsx("polyline",{points:"505 340 585 420 505 500"})]})})}),f.jsx("span",{className:"hidden sm:inline",children:"Prompt Driven Development"}),f.jsx("span",{className:"sm:hidden",children:"PDD"}),f.jsx("span",{className:"text-surface-600",children:"•"}),f.jsx("span",{children:Qe?"Jobs running - see dashboard below":"Commands tracked in dashboard"})]})}),E&&f.jsx(iue,{onClose:()=>V(!1)}),f.jsx(cue,{})]})})},x6=document.getElementById("root");if(!x6)throw new Error("Could not find root element to mount to");const wue=R9.createRoot(x6);wue.render(f.jsx(ue.StrictMode,{children:f.jsx(bue,{children:f.jsx(vue,{})})}));
|