pdd-cli 0.0.90__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 +38 -6
- pdd/agentic_bug.py +323 -0
- pdd/agentic_bug_orchestrator.py +506 -0
- pdd/agentic_change.py +231 -0
- pdd/agentic_change_orchestrator.py +537 -0
- pdd/agentic_common.py +533 -770
- pdd/agentic_crash.py +2 -1
- pdd/agentic_e2e_fix.py +319 -0
- pdd/agentic_e2e_fix_orchestrator.py +582 -0
- pdd/agentic_fix.py +118 -3
- pdd/agentic_update.py +27 -9
- pdd/agentic_verify.py +3 -2
- pdd/architecture_sync.py +565 -0
- pdd/auth_service.py +210 -0
- pdd/auto_deps_main.py +63 -53
- pdd/auto_include.py +236 -3
- pdd/auto_update.py +125 -47
- pdd/bug_main.py +195 -23
- pdd/cmd_test_main.py +345 -197
- pdd/code_generator.py +4 -2
- pdd/code_generator_main.py +118 -32
- pdd/commands/__init__.py +6 -0
- pdd/commands/analysis.py +113 -48
- pdd/commands/auth.py +309 -0
- pdd/commands/connect.py +358 -0
- pdd/commands/fix.py +155 -114
- pdd/commands/generate.py +5 -0
- pdd/commands/maintenance.py +3 -2
- pdd/commands/misc.py +8 -0
- pdd/commands/modify.py +225 -163
- pdd/commands/sessions.py +284 -0
- pdd/commands/utility.py +12 -7
- pdd/construct_paths.py +334 -32
- pdd/context_generator_main.py +167 -170
- pdd/continue_generation.py +6 -3
- pdd/core/__init__.py +33 -0
- pdd/core/cli.py +44 -7
- pdd/core/cloud.py +237 -0
- pdd/core/dump.py +68 -20
- pdd/core/errors.py +4 -0
- pdd/core/remote_session.py +61 -0
- pdd/crash_main.py +219 -23
- pdd/data/llm_model.csv +4 -4
- pdd/docs/prompting_guide.md +864 -0
- pdd/docs/whitepaper_with_benchmarks/data_and_functions/benchmark_analysis.py +495 -0
- pdd/docs/whitepaper_with_benchmarks/data_and_functions/creation_compare.py +528 -0
- pdd/fix_code_loop.py +208 -34
- pdd/fix_code_module_errors.py +6 -2
- pdd/fix_error_loop.py +291 -38
- pdd/fix_main.py +208 -6
- pdd/fix_verification_errors_loop.py +235 -26
- pdd/fix_verification_main.py +269 -83
- pdd/frontend/dist/assets/index-B5DZHykP.css +1 -0
- pdd/frontend/dist/assets/index-CUWd8al1.js +450 -0
- pdd/frontend/dist/index.html +376 -0
- pdd/frontend/dist/logo.svg +33 -0
- pdd/generate_output_paths.py +46 -5
- pdd/generate_test.py +212 -151
- pdd/get_comment.py +19 -44
- pdd/get_extension.py +8 -9
- pdd/get_jwt_token.py +309 -20
- pdd/get_language.py +8 -7
- pdd/get_run_command.py +7 -5
- pdd/insert_includes.py +2 -1
- pdd/llm_invoke.py +531 -97
- pdd/load_prompt_template.py +15 -34
- pdd/operation_log.py +342 -0
- pdd/path_resolution.py +140 -0
- pdd/postprocess.py +122 -97
- pdd/preprocess.py +68 -12
- pdd/preprocess_main.py +33 -1
- pdd/prompts/agentic_bug_step10_pr_LLM.prompt +182 -0
- pdd/prompts/agentic_bug_step1_duplicate_LLM.prompt +73 -0
- pdd/prompts/agentic_bug_step2_docs_LLM.prompt +129 -0
- pdd/prompts/agentic_bug_step3_triage_LLM.prompt +95 -0
- pdd/prompts/agentic_bug_step4_reproduce_LLM.prompt +97 -0
- pdd/prompts/agentic_bug_step5_root_cause_LLM.prompt +123 -0
- pdd/prompts/agentic_bug_step6_test_plan_LLM.prompt +107 -0
- pdd/prompts/agentic_bug_step7_generate_LLM.prompt +172 -0
- pdd/prompts/agentic_bug_step8_verify_LLM.prompt +119 -0
- pdd/prompts/agentic_bug_step9_e2e_test_LLM.prompt +289 -0
- pdd/prompts/agentic_change_step10_identify_issues_LLM.prompt +1006 -0
- pdd/prompts/agentic_change_step11_fix_issues_LLM.prompt +984 -0
- pdd/prompts/agentic_change_step12_create_pr_LLM.prompt +140 -0
- pdd/prompts/agentic_change_step1_duplicate_LLM.prompt +73 -0
- pdd/prompts/agentic_change_step2_docs_LLM.prompt +101 -0
- pdd/prompts/agentic_change_step3_research_LLM.prompt +126 -0
- pdd/prompts/agentic_change_step4_clarify_LLM.prompt +164 -0
- pdd/prompts/agentic_change_step5_docs_change_LLM.prompt +981 -0
- pdd/prompts/agentic_change_step6_devunits_LLM.prompt +1005 -0
- pdd/prompts/agentic_change_step7_architecture_LLM.prompt +1044 -0
- pdd/prompts/agentic_change_step8_analyze_LLM.prompt +1027 -0
- pdd/prompts/agentic_change_step9_implement_LLM.prompt +1077 -0
- pdd/prompts/agentic_e2e_fix_step1_unit_tests_LLM.prompt +90 -0
- pdd/prompts/agentic_e2e_fix_step2_e2e_tests_LLM.prompt +91 -0
- pdd/prompts/agentic_e2e_fix_step3_root_cause_LLM.prompt +89 -0
- pdd/prompts/agentic_e2e_fix_step4_fix_e2e_tests_LLM.prompt +96 -0
- pdd/prompts/agentic_e2e_fix_step5_identify_devunits_LLM.prompt +91 -0
- pdd/prompts/agentic_e2e_fix_step6_create_unit_tests_LLM.prompt +106 -0
- pdd/prompts/agentic_e2e_fix_step7_verify_tests_LLM.prompt +116 -0
- pdd/prompts/agentic_e2e_fix_step8_run_pdd_fix_LLM.prompt +120 -0
- pdd/prompts/agentic_e2e_fix_step9_verify_all_LLM.prompt +146 -0
- pdd/prompts/agentic_fix_primary_LLM.prompt +2 -2
- pdd/prompts/agentic_update_LLM.prompt +192 -338
- pdd/prompts/auto_include_LLM.prompt +22 -0
- pdd/prompts/change_LLM.prompt +3093 -1
- pdd/prompts/detect_change_LLM.prompt +571 -14
- pdd/prompts/fix_code_module_errors_LLM.prompt +8 -0
- pdd/prompts/fix_errors_from_unit_tests_LLM.prompt +1 -0
- pdd/prompts/generate_test_LLM.prompt +19 -1
- pdd/prompts/generate_test_from_example_LLM.prompt +366 -0
- pdd/prompts/insert_includes_LLM.prompt +262 -252
- pdd/prompts/prompt_code_diff_LLM.prompt +123 -0
- pdd/prompts/prompt_diff_LLM.prompt +82 -0
- pdd/remote_session.py +876 -0
- pdd/server/__init__.py +52 -0
- pdd/server/app.py +335 -0
- pdd/server/click_executor.py +587 -0
- pdd/server/executor.py +338 -0
- pdd/server/jobs.py +661 -0
- pdd/server/models.py +241 -0
- pdd/server/routes/__init__.py +31 -0
- pdd/server/routes/architecture.py +451 -0
- pdd/server/routes/auth.py +364 -0
- pdd/server/routes/commands.py +929 -0
- pdd/server/routes/config.py +42 -0
- pdd/server/routes/files.py +603 -0
- pdd/server/routes/prompts.py +1347 -0
- pdd/server/routes/websocket.py +473 -0
- pdd/server/security.py +243 -0
- pdd/server/terminal_spawner.py +217 -0
- pdd/server/token_counter.py +222 -0
- pdd/summarize_directory.py +236 -237
- pdd/sync_animation.py +8 -4
- pdd/sync_determine_operation.py +329 -47
- pdd/sync_main.py +272 -28
- pdd/sync_orchestration.py +289 -211
- pdd/sync_order.py +304 -0
- pdd/template_expander.py +161 -0
- pdd/templates/architecture/architecture_json.prompt +41 -46
- pdd/trace.py +1 -1
- pdd/track_cost.py +0 -13
- pdd/unfinished_prompt.py +2 -1
- pdd/update_main.py +68 -26
- {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.121.dist-info}/METADATA +15 -10
- pdd_cli-0.0.121.dist-info/RECORD +229 -0
- pdd_cli-0.0.90.dist-info/RECORD +0 -153
- {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.121.dist-info}/WHEEL +0 -0
- {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.121.dist-info}/entry_points.txt +0 -0
- {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.121.dist-info}/licenses/LICENSE +0 -0
- {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.121.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
var $9=Object.defineProperty;var T9=(n,e,t)=>e in n?$9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Et=(n,e,t)=>T9(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 $m(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ng={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 vj;function j9(){if(vj)return Nu;vj=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 wj;function _9(){return wj||(wj=1,Ng.exports=j9()),Ng.exports}var d=_9(),Cg={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 Sj;function P9(){if(Sj)return We;Sj=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"),f=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,B,K){this.props=X,this.context=B,this.refs=S,this.updater=K||v}Q.prototype.isReactComponent={},Q.prototype.setState=function(X,B){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,B,"setState")},Q.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function k(){}k.prototype=Q.prototype;function $(X,B,K){this.props=X,this.context=B,this.refs=S,this.updater=K||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,B,K){var Z=K.ref;return{$$typeof:n,type:X,key:B,ref:Z!==void 0?Z:null,props:K}}function L(X,B){return z(X.type,B,X.props)}function E(X){return typeof X=="object"&&X!==null&&X.$$typeof===n}function V(X){var B={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(K){return B[K]})}var D=/\/+/g;function C(X,B){return typeof X=="object"&&X!==null&&X.key!=null?V(""+X.key):B.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(B){X.status==="pending"&&(X.status="fulfilled",X.value=B)},function(B){X.status==="pending"&&(X.status="rejected",X.reason=B)})),X.status){case"fulfilled":return X.value;case"rejected":throw X.reason}}throw X}function A(X,B,K,Z,I){var J=typeof X;(J==="undefined"||J==="boolean")&&(X=null);var ne=!1;if(X===null)ne=!0;else switch(J){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(X.$$typeof){case n:case e:ne=!0;break;case p:return ne=X._init,A(ne(X._payload),B,K,Z,I)}}if(ne)return I=I(X),ne=Z===""?"."+C(X,0):Z,T(I)?(K="",ne!=null&&(K=ne.replace(D,"$&/")+"/"),A(I,B,K,"",function(ke){return ke})):I!=null&&(E(I)&&(I=L(I,K+(I.key==null||X&&X.key===I.key?"":(""+I.key).replace(D,"$&/")+"/")+ne)),B.push(I)),1;ne=0;var ce=Z===""?".":Z+":";if(T(X))for(var xe=0;xe<X.length;xe++)Z=X[xe],J=ce+C(Z,xe),ne+=A(Z,B,K,J,I);else if(xe=x(X),typeof xe=="function")for(X=xe.call(X),xe=0;!(Z=X.next()).done;)Z=Z.value,J=ce+C(Z,xe++),ne+=A(Z,B,K,J,I);else if(J==="object"){if(typeof X.then=="function")return A(G(X),B,K,Z,I);throw B=String(X),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(X).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ne}function W(X,B,K){if(X==null)return X;var Z=[],I=0;return A(X,Z,"","",function(J){return B.call(K,J,I++)}),Z}function H(X){if(X._status===-1){var B=X._result;B=B(),B.then(function(K){(X._status===0||X._status===-1)&&(X._status=1,X._result=K)},function(K){(X._status===0||X._status===-1)&&(X._status=2,X._result=K)}),X._status===-1&&(X._status=0,X._result=B)}if(X._status===1)return X._result.default;throw X._result}var U=typeof reportError=="function"?reportError:function(X){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",X);return}console.error(X)},ee={map:W,forEach:function(X,B,K){W(X,function(){B.apply(this,arguments)},K)},count:function(X){var B=0;return W(X,function(){B++}),B},toArray:function(X){return W(X,function(B){return B})||[]},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=ee,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,B,K){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(B!=null)for(J in B.key!==void 0&&(I=""+B.key),B)!q.call(B,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&B.ref===void 0||(Z[J]=B[J]);var J=arguments.length-2;if(J===1)Z.children=K;else if(1<J){for(var ne=Array(J),ce=0;ce<J;ce++)ne[ce]=arguments[ce+2];Z.children=ne}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,B,K){var Z,I={},J=null;if(B!=null)for(Z in B.key!==void 0&&(J=""+B.key),B)q.call(B,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(I[Z]=B[Z]);var ne=arguments.length-2;if(ne===1)I.children=K;else if(1<ne){for(var ce=Array(ne),xe=0;xe<ne;xe++)ce[xe]=arguments[xe+2];I.children=ce}if(X&&X.defaultProps)for(Z in ne=X.defaultProps,ne)I[Z]===void 0&&(I[Z]=ne[Z]);return z(X,J,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,B){return{$$typeof:f,type:X,compare:B===void 0?null:B}},We.startTransition=function(X){var B=N.T,K={};N.T=K;try{var Z=X(),I=N.S;I!==null&&I(K,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,U)}catch(J){U(J)}finally{B!==null&&K.types!==null&&(B.types=K.types),N.T=B}},We.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},We.use=function(X){return N.H.use(X)},We.useActionState=function(X,B,K){return N.H.useActionState(X,B,K)},We.useCallback=function(X,B){return N.H.useCallback(X,B)},We.useContext=function(X){return N.H.useContext(X)},We.useDebugValue=function(){},We.useDeferredValue=function(X,B){return N.H.useDeferredValue(X,B)},We.useEffect=function(X,B){return N.H.useEffect(X,B)},We.useEffectEvent=function(X){return N.H.useEffectEvent(X)},We.useId=function(){return N.H.useId()},We.useImperativeHandle=function(X,B,K){return N.H.useImperativeHandle(X,B,K)},We.useInsertionEffect=function(X,B){return N.H.useInsertionEffect(X,B)},We.useLayoutEffect=function(X,B){return N.H.useLayoutEffect(X,B)},We.useMemo=function(X,B){return N.H.useMemo(X,B)},We.useOptimistic=function(X,B){return N.H.useOptimistic(X,B)},We.useReducer=function(X,B,K){return N.H.useReducer(X,B,K)},We.useRef=function(X){return N.H.useRef(X)},We.useState=function(X){return N.H.useState(X)},We.useSyncExternalStore=function(X,B,K){return N.H.useSyncExternalStore(X,B,K)},We.useTransition=function(){return N.H.useTransition()},We.version="19.2.3",We}var Qj;function Bd(){return Qj||(Qj=1,Cg.exports=P9()),Cg.exports}var P=Bd();const ue=$m(P);var Rg={exports:{}},Cu={},Eg={exports:{}},Ag={};/**
|
|
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 kj;function N9(){return kj||(kj=1,(function(n){function e(A,W){var H=A.length;A.push(W);e:for(;0<H;){var U=H-1>>>1,ee=A[U];if(0<s(ee,W))A[U]=W,A[H]=ee,H=U;else break e}}function t(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var W=A[0],H=A.pop();if(H!==W){A[0]=H;e:for(var U=0,ee=A.length,X=ee>>>1;U<X;){var B=2*(U+1)-1,K=A[B],Z=B+1,I=A[Z];if(0>s(K,H))Z<ee&&0>s(I,K)?(A[U]=I,A[Z]=H,U=Z):(A[U]=K,A[B]=H,U=B);else if(Z<ee&&0>s(I,H))A[U]=I,A[Z]=H,U=Z;else break e}}return W}function s(A,W){var H=A.sortIndex-W.sortIndex;return H!==0?H:A.id-W.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=[],f=[],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 W=t(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=A)r(f),W.sortIndex=W.expirationTime,e(u,W);else break;W=t(f)}}function T(A){if(y=!1,j(A),!v)if(t(u)!==null)v=!0,R||(R=!0,V());else{var W=t(f);W!==null&&G(T,W.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 W=!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 U=m.callback;if(typeof U=="function"){m.callback=null,g=m.priorityLevel;var ee=U(m.expirationTime<=A);if(A=n.unstable_now(),typeof ee=="function"){m.callback=ee,j(A),W=!0;break t}m===t(u)&&r(u),j(A)}else r(u);m=t(u)}if(m!==null)W=!0;else{var X=t(f);X!==null&&G(T,X.startTime-A),W=!1}}break e}finally{m=null,g=H,x=!1}W=void 0}}finally{W?V():R=!1}}}var V;if(typeof $=="function")V=function(){$(E)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,C=D.port2;D.port1.onmessage=E,V=function(){C.postMessage(null)}}else V=function(){Q(E,0)};function G(A,W){N=Q(function(){A(n.unstable_now())},W)}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 W=3;break;default:W=g}var H=g;g=W;try{return A()}finally{g=H}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(A,W){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var H=g;g=A;try{return W()}finally{g=H}},n.unstable_scheduleCallback=function(A,W,H){var U=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?U+H:U):H=U,A){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=H+ee,A={id:p++,callback:W,priorityLevel:A,startTime:H,expirationTime:ee,sortIndex:-1},H>U?(A.sortIndex=H,e(f,A),t(u)===null&&A===t(f)&&(y?(k(N),N=-1):y=!0,G(T,H-U))):(A.sortIndex=ee,e(u,A),v||x||(v=!0,R||(R=!0,V()))),A},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(A){var W=g;return function(){var H=g;g=W;try{return A.apply(this,arguments)}finally{g=H}}}})(Ag)),Ag}var $j;function C9(){return $j||($j=1,Eg.exports=N9()),Eg.exports}var qg={exports:{}},Gn={};/**
|
|
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 Tj;function R9(){if(Tj)return Gn;Tj=1;var n=Bd();function e(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+f+" 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,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:u,containerInfo:f,implementation:p}}var a=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Gn.createPortal=function(u,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return i(u,f,null,p)},Gn.flushSync=function(u){var f=a.T,p=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=f,r.p=p,r.d.f()}},Gn.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(u,f))},Gn.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Gn.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var p=f.as,m=o(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:x}):p==="script"&&r.d.X(u,{crossOrigin:m,integrity:g,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Gn.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=o(f.as,f.crossOrigin);r.d.M(u,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(u)},Gn.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=o(p,f.crossOrigin);r.d.L(u,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Gn.preloadModule=function(u,f){if(typeof u=="string")if(f){var p=o(f.as,f.crossOrigin);r.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(u)},Gn.requestFormReset=function(u){r.d.r(u)},Gn.unstable_batchedUpdates=function(u,f){return u(f)},Gn.useFormState=function(u,f,p){return a.H.useFormState(u,f,p)},Gn.useFormStatus=function(){return a.H.useHostTransitionStatus()},Gn.version="19.2.3",Gn}var jj;function tq(){if(jj)return qg.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(),qg.exports=R9(),qg.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 _j;function E9(){if(_j)return Cu;_j=1;var n=C9(),e=Bd(),t=tq();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 f(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 D=Symbol.for("react.client.reference");function C(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===D?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,W=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},U=[],ee=-1;function X(l){return{current:l}}function B(l){0>ee||(l.current=U[ee],U[ee]=null,ee--)}function K(l,c){ee++,U[ee]=l.current,l.current=c}var Z=X(null),I=X(null),J=X(null),ne=X(null);function ce(l,c){switch(K(J,c),K(I,l),K(Z,null),c.nodeType){case 9:case 11:l=(l=c.documentElement)&&(l=l.namespaceURI)?DT(l):0;break;default:if(l=c.tagName,c=c.namespaceURI)c=DT(c),l=BT(c,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}B(Z),K(Z,l)}function xe(){B(Z),B(I),B(J)}function ke(l){l.memoizedState!==null&&K(ne,l);var c=Z.current,h=BT(c,l.type);c!==h&&(K(I,l),K(Z,h))}function Me(l){I.current===l&&(B(Z),B(I)),ne.current===l&&(B(ne),Tu._currentValue=H)}var se,be;function Oe(l){if(se===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);se=c&&c[1]||"",be=-1<h.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+se+l+be}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(oe){var le=oe}Reflect.construct(l,[],me)}else{try{me.call()}catch(oe){le=oe}l.call(me.prototype)}}else{try{throw Error()}catch(oe){le=oe}(me=l())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(oe){if(oe&&le&&typeof oe.stack=="string")return[oe.stack,le.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
|
+
`),ae=M.split(`
|
|
45
|
+
`);for(b=O=0;O<F.length&&!F[O].includes("DetermineComponentFrameRoot");)O++;for(;b<ae.length&&!ae[b].includes("DetermineComponentFrameRoot");)b++;if(O===F.length||b===ae.length)for(O=F.length-1,b=ae.length-1;1<=O&&0<=b&&F[O]!==ae[b];)b--;for(;1<=O&&0<=b;O--,b--)if(F[O]!==ae[b]){if(O!==1||b!==1)do if(O--,b--,0>b||F[O]!==ae[b]){var de=`
|
|
46
|
+
`+F[O].replace(" at new "," at ");return l.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",l.displayName)),de}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 we(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,ct=n.unstable_scheduleCallback,at=n.unstable_cancelCallback,yt=n.unstable_shouldYield,Ye=n.unstable_requestPaint,tt=n.unstable_now,gn=n.unstable_getCurrentPriorityLevel,kt=n.unstable_ImmediatePriority,Zt=n.unstable_UserBlockingPriority,$t=n.unstable_NormalPriority,rn=n.unstable_LowPriority,dn=n.unstable_IdlePriority,pt=n.log,Dt=n.unstable_setDisableYieldValue,ut=null,lt=null;function Pt(l){if(typeof pt=="function"&&Dt(l),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(ut,l)}catch{}}var vt=Math.clz32?Math.clz32:ge,sn=Math.log,vr=Math.LN2;function ge(l){return l>>>=0,l===0?32:31-(sn(l)/vr|0)|0}var Qe=256,Re=262144,Je=4194304;function Tt(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 Ft(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=Tt(O):(_&=M,_!==0?b=Tt(_):h||(h=M&~l,h!==0&&(b=Tt(h))))):(M=O&~w,M!==0?b=Tt(M):_!==0?b=Tt(_):h||(h=O&~l,h!==0&&(b=Tt(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 _n(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function xn(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 bn(){var l=Je;return Je<<=1,(Je&62914560)===0&&(Je=4194304),l}function yn(l){for(var c=[],h=0;31>h;h++)c.push(l);return c}function fn(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function ci(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,ae=l.hiddenUpdates;for(h=_&~h;0<h;){var de=31-vt(h),me=1<<de;M[de]=0,F[de]=-1;var le=ae[de];if(le!==null)for(ae[de]=null,de=0;de<le.length;de++){var oe=le[de];oe!==null&&(oe.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-vt(c);l.entangledLanes|=c,l.entanglements[O]=l.entanglements[O]|1073741824|h&261930}function wr(l,c){var h=l.entangledLanes|=c;for(l=l.entanglements;h;){var O=31-vt(h),b=1<<O;b&c|l[O]&c&&(l[O]|=c),h&=~b}}function hs(l,c){var h=c&-c;return h=(h&42)!==0?1:zs(h),(h&(l.suspendedLanes|c))!==0?0:h}function zs(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 Sr(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function ps(){var l=W.p;return l!==0?l:(l=window.event,l===void 0?32:pj(l.type))}function ms(l,c){var h=W.p;try{return W.p=l,c()}finally{W.p=h}}var pe=Math.random().toString(36).slice(2),$e="__reactFiber$"+pe,ze="__reactProps$"+pe,Mt="__reactContainer$"+pe,vn="__reactEvents$"+pe,sr="__reactListeners$"+pe,Fl="__reactHandles$"+pe,ui="__reactResources$"+pe,di="__reactMarker$"+pe;function Ha(l){delete l[$e],delete l[ze],delete l[vn],delete l[sr],delete l[Fl]}function Os(l){var c=l[$e];if(c)return c;for(var h=l.parentNode;h;){if(c=h[Mt]||h[$e]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(l=KT(l);l!==null;){if(h=l[$e])return h;l=KT(l)}return c}l=h,h=l.parentNode}return null}function gs(l){if(l=l[$e]||l[Mt]){var c=l.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return l}return null}function Ls(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l.stateNode;throw Error(r(33))}function Zs(l){var c=l[ui];return c||(c=l[ui]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function an(l){l[di]=!0}var Kl=new Set,Jl={};function xs(l,c){bs(l,c),bs(l+"Capture",c)}function bs(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 ea(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(ea(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 ys(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 ir(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 he(l){if(!l._valueTracker){var c=so(l)?"checked":"value";l._valueTracker=Zc(l,c,""+l[c])}}function _e(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 Be(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 hn=/[\n"\\]/g;function mt(l){return l.replace(hn,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Wn(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=""+ir(c)):l.value!==""+ir(c)&&(l.value=""+ir(c)):_!=="submit"&&_!=="reset"||l.removeAttribute("value"),c!=null?kr(l,_,ir(c)):h!=null?kr(l,_,ir(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=""+ir(M):l.removeAttribute("name")}function Qr(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)){he(l);return}h=h!=null?""+ir(h):"",c=c!=null?""+ir(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=_),he(l)}function kr(l,c,h){c==="number"&&Be(l.ownerDocument)===l||l.defaultValue===""+h||(l.defaultValue=""+h)}function ar(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=""+ir(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 pf(l,c,h){if(c!=null&&(c=""+ir(c),c!==l.value&&(l.value=c),h==null)){l.defaultValue!==c&&(l.defaultValue=c);return}l.defaultValue=h!=null?""+ir(h):""}function mf(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=ir(c),l.defaultValue=h,O=l.textContent,O===h&&O!==""&&O!==null&&(l.value=O),he(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 Of=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||Of.has(c)?c==="float"?l.cssFloat=h:l[c]=(""+h).trim():l[c]=h+"px"}function gf(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 TO=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"]]),S6=/^[\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 xf(l){return S6.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function hi(){}var jO=null;function _O(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 Yk(l){var c=gs(l);if(c&&(l=c.stateNode)){var h=l[ze]||null;e:switch(l=c.stateNode,c.type){case"input":if(Wn(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[ze]||null;if(!b)throw Error(r(90));Wn(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&&_e(O)}break e;case"textarea":pf(l,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&ar(l,!!h.multiple,c,!1)}}}var PO=!1;function Dk(l,c,h){if(PO)return l(c,h);PO=!0;try{var O=l(c);return O}finally{if(PO=!1,(io!==null||ao!==null)&&(ih(),io&&(c=io,l=ao,ao=io=null,Yk(c),l)))for(c=0;c<l.length;c++)Yk(l[c])}}function Dc(l,c){var h=l.stateNode;if(h===null)return null;var O=h[ze]||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 pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),NO=!1;if(pi)try{var Bc={};Object.defineProperty(Bc,"passive",{get:function(){NO=!0}}),window.addEventListener("test",Bc,Bc),window.removeEventListener("test",Bc,Bc)}catch{NO=!1}var ta=null,CO=null,bf=null;function Bk(){if(bf)return bf;var l,c=CO,h=c.length,O,b="value"in ta?ta.value:ta.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 bf=b.slice(l,1<O?1-O:void 0)}function yf(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 vf(){return!0}function Uk(){return!1}function lr(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)?vf:Uk,this.isPropagationStopped=Uk,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=vf)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=vf)},persist:function(){},isPersistent:vf}),c}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wf=lr(Fa),Uc=m({},Fa,{view:0,detail:0}),Q6=lr(Uc),RO,EO,Wc,Sf=m({},Uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qO,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"?(RO=l.screenX-Wc.screenX,EO=l.screenY-Wc.screenY):EO=RO=0,Wc=l),RO)},movementY:function(l){return"movementY"in l?l.movementY:EO}}),Wk=lr(Sf),k6=m({},Sf,{dataTransfer:0}),$6=lr(k6),T6=m({},Uc,{relatedTarget:0}),AO=lr(T6),j6=m({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),_6=lr(j6),P6=m({},Fa,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),N6=lr(P6),C6=m({},Fa,{data:0}),Gk=lr(C6),R6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},E6={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"},A6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q6(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=A6[l])?!!c[l]:!1}function qO(){return q6}var M6=m({},Uc,{key:function(l){if(l.key){var c=R6[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=yf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?E6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qO,charCode:function(l){return l.type==="keypress"?yf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?yf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),X6=lr(M6),z6=m({},Sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ik=lr(z6),L6=m({},Uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qO}),Z6=lr(L6),V6=m({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y6=lr(V6),D6=m({},Sf,{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}),B6=lr(D6),U6=m({},Fa,{newState:0,oldState:0}),W6=lr(U6),G6=[9,13,27,32],MO=pi&&"CompositionEvent"in window,Gc=null;pi&&"documentMode"in document&&(Gc=document.documentMode);var I6=pi&&"TextEvent"in window&&!Gc,Hk=pi&&(!MO||Gc&&8<Gc&&11>=Gc),Fk=" ",Kk=!1;function Jk(l,c){switch(l){case"keyup":return G6.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e5(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var lo=!1;function H6(l,c){switch(l){case"compositionend":return e5(c);case"keypress":return c.which!==32?null:(Kk=!0,Fk);case"textInput":return l=c.data,l===Fk&&Kk?null:l;default:return null}}function F6(l,c){if(lo)return l==="compositionend"||!MO&&Jk(l,c)?(l=Bk(),bf=CO=ta=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 Hk&&c.locale!=="ko"?null:c.data;default:return null}}var K6={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 t5(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!K6[l.type]:c==="textarea"}function n5(l,c,h,O){io?ao?ao.push(O):ao=[O]:io=O,c=fh(c,"onChange"),0<c.length&&(h=new wf("onChange","change",null,h,O),l.push({event:h,listeners:c}))}var Ic=null,Hc=null;function J6(l){XT(l,0)}function Qf(l){var c=Ls(l);if(_e(c))return l}function r5(l,c){if(l==="change")return c}var s5=!1;if(pi){var XO;if(pi){var zO="oninput"in document;if(!zO){var i5=document.createElement("div");i5.setAttribute("oninput","return;"),zO=typeof i5.oninput=="function"}XO=zO}else XO=!1;s5=XO&&(!document.documentMode||9<document.documentMode)}function a5(){Ic&&(Ic.detachEvent("onpropertychange",l5),Hc=Ic=null)}function l5(l){if(l.propertyName==="value"&&Qf(Hc)){var c=[];n5(c,Hc,l,_O(l)),Dk(J6,c)}}function e8(l,c,h){l==="focusin"?(a5(),Ic=c,Hc=h,Ic.attachEvent("onpropertychange",l5)):l==="focusout"&&a5()}function t8(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Qf(Hc)}function n8(l,c){if(l==="click")return Qf(c)}function r8(l,c){if(l==="input"||l==="change")return Qf(c)}function s8(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var $r=typeof Object.is=="function"?Object.is:s8;function Fc(l,c){if($r(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)||!$r(l[b],c[b]))return!1}return!0}function o5(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function c5(l,c){var h=o5(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=o5(h)}}function u5(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?u5(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function d5(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var c=Be(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=Be(l.document)}return c}function LO(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 i8=pi&&"documentMode"in document&&11>=document.documentMode,oo=null,ZO=null,Kc=null,VO=!1;function f5(l,c,h){var O=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;VO||oo==null||oo!==Be(O)||(O=oo,"selectionStart"in O&&LO(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=fh(ZO,"onSelect"),0<O.length&&(c=new wf("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")},YO={},h5={};pi&&(h5=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(YO[l])return YO[l];if(!co[l])return l;var c=co[l],h;for(h in c)if(c.hasOwnProperty(h)&&h in h5)return YO[l]=c[h];return l}var p5=Ja("animationend"),m5=Ja("animationiteration"),O5=Ja("animationstart"),a8=Ja("transitionrun"),l8=Ja("transitionstart"),o8=Ja("transitioncancel"),g5=Ja("transitionend"),x5=new Map,DO="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(" ");DO.push("scrollEnd");function vs(l,c){x5.set(l,c),xs(c,[l])}var kf=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)},Zr=[],uo=0,BO=0;function $f(){for(var l=uo,c=BO=uo=0;c<l;){var h=Zr[c];Zr[c++]=null;var O=Zr[c];Zr[c++]=null;var b=Zr[c];Zr[c++]=null;var w=Zr[c];if(Zr[c++]=null,O!==null&&b!==null){var _=O.pending;_===null?b.next=b:(b.next=_.next,_.next=b),O.pending=b}w!==0&&b5(h,b,w)}}function Tf(l,c,h,O){Zr[uo++]=l,Zr[uo++]=c,Zr[uo++]=h,Zr[uo++]=O,BO|=O,l.lanes|=O,l=l.alternate,l!==null&&(l.lanes|=O)}function UO(l,c,h,O){return Tf(l,c,h,O),jf(l)}function el(l,c){return Tf(l,null,null,c),jf(l)}function b5(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-vt(h),l=w.hiddenUpdates,O=l[b],O===null?l[b]=[c]:O.push(c),c.lane=h|536870912),w):null}function jf(l){if(50<yu)throw yu=0,tg=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 c8(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 Tr(l,c,h,O){return new c8(l,c,h,O)}function WO(l){return l=l.prototype,!(!l||!l.isReactComponent)}function mi(l,c){var h=l.alternate;return h===null?(h=Tr(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 y5(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 _f(l,c,h,O,b,w){var _=0;if(O=l,typeof l=="function")WO(l)&&(_=1);else if(typeof l=="string")_=p9(l,h,Z.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case z:return l=Tr(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=Tr(12,h,c,b|2),l.elementType=Q,l.lanes=w,l;case T:return l=Tr(13,h,c,b),l.elementType=T,l.lanes=w,l;case R:return l=Tr(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=Tr(_,h,c,b),c.elementType=l,c.type=O,c.lanes=w,c}function tl(l,c,h,O){return l=Tr(7,l,O,c),l.lanes=h,l}function GO(l,c,h){return l=Tr(6,l,null,c),l.lanes=h,l}function v5(l){var c=Tr(18,null,null,0);return c.stateNode=l,c}function IO(l,c,h){return c=Tr(4,l.children!==null?l.children:[],l.key,c),c.lanes=h,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}var w5=new WeakMap;function Vr(l,c){if(typeof l=="object"&&l!==null){var h=w5.get(l);return h!==void 0?h:(c={value:l,source:c,stack:we(c)},w5.set(l,c),c)}return{value:l,source:c,stack:we(c)}}var ho=[],po=0,Pf=null,Jc=0,Yr=[],Dr=0,na=null,Vs=1,Ys="";function Oi(l,c){ho[po++]=Jc,ho[po++]=Pf,Pf=l,Jc=c}function S5(l,c,h){Yr[Dr++]=Vs,Yr[Dr++]=Ys,Yr[Dr++]=na,na=l;var O=Vs;l=Ys;var b=32-vt(O)-1;O&=~(1<<b),h+=1;var w=32-vt(c)+b;if(30<w){var _=b-b%5;w=(O&(1<<_)-1).toString(32),O>>=_,b-=_,Vs=1<<32-vt(c)+b|h<<b|O,Ys=w+l}else Vs=1<<w|h<<b|O,Ys=l}function HO(l){l.return!==null&&(Oi(l,1),S5(l,1,0))}function FO(l){for(;l===Pf;)Pf=ho[--po],ho[po]=null,Jc=ho[--po],ho[po]=null;for(;l===na;)na=Yr[--Dr],Yr[Dr]=null,Ys=Yr[--Dr],Yr[Dr]=null,Vs=Yr[--Dr],Yr[Dr]=null}function Q5(l,c){Yr[Dr++]=Vs,Yr[Dr++]=Ys,Yr[Dr++]=na,Vs=c.id,Ys=c.overflow,na=l}var Xn=null,Bt=null,ot=!1,ra=null,Br=!1,KO=Error(r(519));function sa(l){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eu(Vr(c,l)),KO}function k5(l){var c=l.stateNode,h=l.type,O=l.memoizedProps;switch(c[$e]=l,c[ze]=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),Qr(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),mf(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||VT(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=hi),c=!0):c=!1,c||sa(l,!0)}function $5(l){for(Xn=l.return;Xn;)switch(Xn.tag){case 5:case 31:case 13:Br=!1;return;case 27:case 3:Br=!0;return;default:Xn=Xn.return}}function mo(l){if(l!==Xn)return!1;if(!ot)return $5(l),ot=!0,!1;var c=l.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=l.type,h=!(h!=="form"&&h!=="button")||Og(l.type,l.memoizedProps)),h=!h),h&&Bt&&sa(l),$5(l),c===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Bt=FT(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Bt=FT(l)}else c===27?(c=Bt,xa(l.type)?(l=vg,vg=null,Bt=l):Bt=c):Bt=Xn?Wr(l.stateNode.nextSibling):null;return!0}function nl(){Bt=Xn=null,ot=!1}function JO(){var l=ra;return l!==null&&(dr===null?dr=l:dr.push.apply(dr,l),ra=null),l}function eu(l){ra===null?ra=[l]:ra.push(l)}var e0=X(null),rl=null,gi=null;function ia(l,c,h){K(e0,c._currentValue),c._currentValue=h}function xi(l){l._currentValue=e0.current,B(e0)}function t0(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 n0(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),t0(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),t0(_,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;$r(b.pendingProps.value,_.value)||(l!==null?l.push(M):l=[M])}}else if(b===ne.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&&n0(c,l,h,O),c.flags|=262144}function Nf(l){for(l=l.firstContext;l!==null;){if(!$r(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function sl(l){rl=l,gi=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function zn(l){return T5(rl,l)}function Cf(l,c){return rl===null&&sl(l),T5(l,c)}function T5(l,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},gi===null){if(l===null)throw Error(r(308));gi=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else gi=gi.next=c;return h}var u8=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()})}},d8=n.unstable_scheduleCallback,f8=n.unstable_NormalPriority,wn={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function r0(){return{controller:new u8,data:new Map,refCount:0}}function tu(l){l.refCount--,l.refCount===0&&d8(f8,function(){l.controller.abort()})}var nu=null,s0=0,go=0,xo=null;function h8(l,c){if(nu===null){var h=nu=[];s0=0,go=lg(),xo={status:"pending",value:void 0,then:function(O){h.push(O)}}}return s0++,c.then(j5,j5),c}function j5(){if(--s0===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 p8(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 _5=A.S;A.S=function(l,c){fT=tt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&h8(l,c),_5!==null&&_5(l,c)};var il=X(null);function i0(){var l=il.current;return l!==null?l:Xt.pooledCache}function Rf(l,c){c===null?K(il,il.current):K(il,c.pool)}function P5(){var l=i0();return l===null?null:{parent:wn._currentValue,pool:l}}var bo=Error(r(460)),a0=Error(r(474)),Ef=Error(r(542)),Af={then:function(){}};function N5(l){return l=l.status,l==="fulfilled"||l==="rejected"}function C5(l,c,h){switch(h=l[h],h===void 0?l.push(c):h!==c&&(c.then(hi,hi),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,E5(l),l;default:if(typeof c.status=="string")c.then(hi,hi);else{if(l=Xt,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,E5(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 R5(){if(ll===null)throw Error(r(459));var l=ll;return ll=null,l}function E5(l){if(l===bo||l===Ef)throw Error(r(483))}var yo=null,ru=0;function qf(l){var c=ru;return ru+=1,yo===null&&(yo=[]),C5(yo,l,c)}function su(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function Mf(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 A5(l){function c(re,te){if(l){var ie=re.deletions;ie===null?(re.deletions=[te],re.flags|=16):ie.push(te)}}function h(re,te){if(!l)return null;for(;te!==null;)c(re,te),te=te.sibling;return null}function O(re){for(var te=new Map;re!==null;)re.key!==null?te.set(re.key,re):te.set(re.index,re),re=re.sibling;return te}function b(re,te){return re=mi(re,te),re.index=0,re.sibling=null,re}function w(re,te,ie){return re.index=ie,l?(ie=re.alternate,ie!==null?(ie=ie.index,ie<te?(re.flags|=67108866,te):ie):(re.flags|=67108866,te)):(re.flags|=1048576,te)}function _(re){return l&&re.alternate===null&&(re.flags|=67108866),re}function M(re,te,ie,fe){return te===null||te.tag!==6?(te=GO(ie,re.mode,fe),te.return=re,te):(te=b(te,ie),te.return=re,te)}function F(re,te,ie,fe){var Ze=ie.type;return Ze===y?de(re,te,ie.props.children,fe,ie.key):te!==null&&(te.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===q&&al(Ze)===te.type)?(te=b(te,ie.props),su(te,ie),te.return=re,te):(te=_f(ie.type,ie.key,ie.props,null,re.mode,fe),su(te,ie),te.return=re,te)}function ae(re,te,ie,fe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ie.containerInfo||te.stateNode.implementation!==ie.implementation?(te=IO(ie,re.mode,fe),te.return=re,te):(te=b(te,ie.children||[]),te.return=re,te)}function de(re,te,ie,fe,Ze){return te===null||te.tag!==7?(te=tl(ie,re.mode,fe,Ze),te.return=re,te):(te=b(te,ie),te.return=re,te)}function me(re,te,ie){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=GO(""+te,re.mode,ie),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return ie=_f(te.type,te.key,te.props,null,re.mode,ie),su(ie,te),ie.return=re,ie;case v:return te=IO(te,re.mode,ie),te.return=re,te;case q:return te=al(te),me(re,te,ie)}if(G(te)||V(te))return te=tl(te,re.mode,ie,null),te.return=re,te;if(typeof te.then=="function")return me(re,qf(te),ie);if(te.$$typeof===$)return me(re,Cf(re,te),ie);Mf(re,te)}return null}function le(re,te,ie,fe){var Ze=te!==null?te.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ze!==null?null:M(re,te,""+ie,fe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ie.key===Ze?F(re,te,ie,fe):null;case v:return ie.key===Ze?ae(re,te,ie,fe):null;case q:return ie=al(ie),le(re,te,ie,fe)}if(G(ie)||V(ie))return Ze!==null?null:de(re,te,ie,fe,null);if(typeof ie.then=="function")return le(re,te,qf(ie),fe);if(ie.$$typeof===$)return le(re,te,Cf(re,ie),fe);Mf(re,ie)}return null}function oe(re,te,ie,fe,Ze){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return re=re.get(ie)||null,M(te,re,""+fe,Ze);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return re=re.get(fe.key===null?ie:fe.key)||null,F(te,re,fe,Ze);case v:return re=re.get(fe.key===null?ie:fe.key)||null,ae(te,re,fe,Ze);case q:return fe=al(fe),oe(re,te,ie,fe,Ze)}if(G(fe)||V(fe))return re=re.get(ie)||null,de(te,re,fe,Ze,null);if(typeof fe.then=="function")return oe(re,te,ie,qf(fe),Ze);if(fe.$$typeof===$)return oe(re,te,ie,Cf(te,fe),Ze);Mf(te,fe)}return null}function Ce(re,te,ie,fe){for(var Ze=null,Ot=null,Ee=te,He=te=0,it=null;Ee!==null&&He<ie.length;He++){Ee.index>He?(it=Ee,Ee=null):it=Ee.sibling;var gt=le(re,Ee,ie[He],fe);if(gt===null){Ee===null&&(Ee=it);break}l&&Ee&>.alternate===null&&c(re,Ee),te=w(gt,te,He),Ot===null?Ze=gt:Ot.sibling=gt,Ot=gt,Ee=it}if(He===ie.length)return h(re,Ee),ot&&Oi(re,He),Ze;if(Ee===null){for(;He<ie.length;He++)Ee=me(re,ie[He],fe),Ee!==null&&(te=w(Ee,te,He),Ot===null?Ze=Ee:Ot.sibling=Ee,Ot=Ee);return ot&&Oi(re,He),Ze}for(Ee=O(Ee);He<ie.length;He++)it=oe(Ee,re,He,ie[He],fe),it!==null&&(l&&it.alternate!==null&&Ee.delete(it.key===null?He:it.key),te=w(it,te,He),Ot===null?Ze=it:Ot.sibling=it,Ot=it);return l&&Ee.forEach(function(Sa){return c(re,Sa)}),ot&&Oi(re,He),Ze}function De(re,te,ie,fe){if(ie==null)throw Error(r(151));for(var Ze=null,Ot=null,Ee=te,He=te=0,it=null,gt=ie.next();Ee!==null&&!gt.done;He++,gt=ie.next()){Ee.index>He?(it=Ee,Ee=null):it=Ee.sibling;var Sa=le(re,Ee,gt.value,fe);if(Sa===null){Ee===null&&(Ee=it);break}l&&Ee&&Sa.alternate===null&&c(re,Ee),te=w(Sa,te,He),Ot===null?Ze=Sa:Ot.sibling=Sa,Ot=Sa,Ee=it}if(gt.done)return h(re,Ee),ot&&Oi(re,He),Ze;if(Ee===null){for(;!gt.done;He++,gt=ie.next())gt=me(re,gt.value,fe),gt!==null&&(te=w(gt,te,He),Ot===null?Ze=gt:Ot.sibling=gt,Ot=gt);return ot&&Oi(re,He),Ze}for(Ee=O(Ee);!gt.done;He++,gt=ie.next())gt=oe(Ee,re,He,gt.value,fe),gt!==null&&(l&>.alternate!==null&&Ee.delete(gt.key===null?He:gt.key),te=w(gt,te,He),Ot===null?Ze=gt:Ot.sibling=gt,Ot=gt);return l&&Ee.forEach(function(k9){return c(re,k9)}),ot&&Oi(re,He),Ze}function Rt(re,te,ie,fe){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 Ze=ie.key;te!==null;){if(te.key===Ze){if(Ze=ie.type,Ze===y){if(te.tag===7){h(re,te.sibling),fe=b(te,ie.props.children),fe.return=re,re=fe;break e}}else if(te.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===q&&al(Ze)===te.type){h(re,te.sibling),fe=b(te,ie.props),su(fe,ie),fe.return=re,re=fe;break e}h(re,te);break}else c(re,te);te=te.sibling}ie.type===y?(fe=tl(ie.props.children,re.mode,fe,ie.key),fe.return=re,re=fe):(fe=_f(ie.type,ie.key,ie.props,null,re.mode,fe),su(fe,ie),fe.return=re,re=fe)}return _(re);case v:e:{for(Ze=ie.key;te!==null;){if(te.key===Ze)if(te.tag===4&&te.stateNode.containerInfo===ie.containerInfo&&te.stateNode.implementation===ie.implementation){h(re,te.sibling),fe=b(te,ie.children||[]),fe.return=re,re=fe;break e}else{h(re,te);break}else c(re,te);te=te.sibling}fe=IO(ie,re.mode,fe),fe.return=re,re=fe}return _(re);case q:return ie=al(ie),Rt(re,te,ie,fe)}if(G(ie))return Ce(re,te,ie,fe);if(V(ie)){if(Ze=V(ie),typeof Ze!="function")throw Error(r(150));return ie=Ze.call(ie),De(re,te,ie,fe)}if(typeof ie.then=="function")return Rt(re,te,qf(ie),fe);if(ie.$$typeof===$)return Rt(re,te,Cf(re,ie),fe);Mf(re,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,te!==null&&te.tag===6?(h(re,te.sibling),fe=b(te,ie),fe.return=re,re=fe):(h(re,te),fe=GO(ie,re.mode,fe),fe.return=re,re=fe),_(re)):h(re,te)}return function(re,te,ie,fe){try{ru=0;var Ze=Rt(re,te,ie,fe);return yo=null,Ze}catch(Ee){if(Ee===bo||Ee===Ef)throw Ee;var Ot=Tr(29,Ee,null,re.mode);return Ot.lanes=fe,Ot.return=re,Ot}finally{}}}var ol=A5(!0),q5=A5(!1),aa=!1;function l0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function o0(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 la(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function oa(l,c,h){var O=l.updateQueue;if(O===null)return null;if(O=O.shared,(wt&2)!==0){var b=O.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),O.pending=c,c=jf(l),b5(l,null,h),c}return Tf(l,O,c,h),jf(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,wr(l,h)}}function c0(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 u0=!1;function au(){if(u0){var l=xo;if(l!==null)throw l}}function lu(l,c,h,O){u0=!1;var b=l.updateQueue;aa=!1;var w=b.firstBaseUpdate,_=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var F=M,ae=F.next;F.next=null,_===null?w=ae:_.next=ae,_=F;var de=l.alternate;de!==null&&(de=de.updateQueue,M=de.lastBaseUpdate,M!==_&&(M===null?de.firstBaseUpdate=ae:M.next=ae,de.lastBaseUpdate=F))}if(w!==null){var me=b.baseState;_=0,de=ae=F=null,M=w;do{var le=M.lane&-536870913,oe=le!==M.lane;if(oe?(st&le)===le:(O&le)===le){le!==0&&le===go&&(u0=!0),de!==null&&(de=de.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Ce=l,De=M;le=c;var Rt=h;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){me=Ce.call(Rt,me,le);break e}me=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,le=typeof Ce=="function"?Ce.call(Rt,me,le):Ce,le==null)break e;me=m({},me,le);break e;case 2:aa=!0}}le=M.callback,le!==null&&(l.flags|=64,oe&&(l.flags|=8192),oe=b.callbacks,oe===null?b.callbacks=[le]:oe.push(le))}else oe={lane:le,tag:M.tag,payload:M.payload,callback:M.callback,next:null},de===null?(ae=de=oe,F=me):de=de.next=oe,_|=le;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;oe=M,M=oe.next,oe.next=null,b.lastBaseUpdate=oe,b.shared.pending=null}}while(!0);de===null&&(F=me),b.baseState=F,b.firstBaseUpdate=ae,b.lastBaseUpdate=de,w===null&&(b.shared.lanes=0),ha|=_,l.lanes=_,l.memoizedState=me}}function M5(l,c){if(typeof l!="function")throw Error(r(191,l));l.call(c)}function X5(l,c){var h=l.callbacks;if(h!==null)for(l.callbacks=null,l=0;l<h.length;l++)M5(h[l],c)}var vo=X(null),Xf=X(0);function z5(l,c){l=Ti,K(Xf,l),K(vo,c),Ti=l|c.baseLanes}function d0(){K(Xf,Ti),K(vo,vo.current)}function f0(){Ti=Xf.current,B(vo),B(Xf)}var jr=X(null),Ur=null;function ca(l){var c=l.alternate;K(pn,pn.current&1),K(jr,l),Ur===null&&(c===null||vo.current!==null||c.memoizedState!==null)&&(Ur=l)}function h0(l){K(pn,pn.current),K(jr,l),Ur===null&&(Ur=l)}function L5(l){l.tag===22?(K(pn,pn.current),K(jr,l),Ur===null&&(Ur=l)):ua()}function ua(){K(pn,pn.current),K(jr,jr.current)}function _r(l){B(jr),Ur===l&&(Ur=null),B(pn)}var pn=X(0);function zf(l){for(var c=l;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||bg(h)||yg(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 bi=0,Ie=null,Nt=null,Sn=null,Lf=!1,wo=!1,cl=!1,Zf=0,ou=0,So=null,m8=0;function ln(){throw Error(r(321))}function p0(l,c){if(c===null)return!1;for(var h=0;h<c.length&&h<l.length;h++)if(!$r(l[h],c[h]))return!1;return!0}function m0(l,c,h,O,b,w){return bi=w,Ie=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,A.H=l===null||l.memoizedState===null?S$:P0,cl=!1,w=h(O,b),cl=!1,wo&&(w=V5(c,h,O,b)),Z5(l),w}function Z5(l){A.H=du;var c=Nt!==null&&Nt.next!==null;if(bi=0,Sn=Nt=Ie=null,Lf=!1,ou=0,So=null,c)throw Error(r(300));l===null||Qn||(l=l.dependencies,l!==null&&Nf(l)&&(Qn=!0))}function V5(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,Sn=Nt=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=Q$,w=c(h,O)}while(wo);return w}function O8(){var l=A.H,c=l.useState()[0];return c=typeof c.then=="function"?cu(c):c,l=l.useState()[0],(Nt!==null?Nt.memoizedState:null)!==l&&(Ie.flags|=1024),c}function O0(){var l=Zf!==0;return Zf=0,l}function g0(l,c,h){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~h}function x0(l){if(Lf){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}Lf=!1}bi=0,Sn=Nt=Ie=null,wo=!1,ou=Zf=0,So=null}function Kn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?Ie.memoizedState=Sn=l:Sn=Sn.next=l,Sn}function mn(){if(Nt===null){var l=Ie.alternate;l=l!==null?l.memoizedState:null}else l=Nt.next;var c=Sn===null?Ie.memoizedState:Sn.next;if(c!==null)Sn=c,Nt=l;else{if(l===null)throw Ie.alternate===null?Error(r(467)):Error(r(310));Nt=l,l={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},Sn===null?Ie.memoizedState=Sn=l:Sn=Sn.next=l}return Sn}function Vf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cu(l){var c=ou;return ou+=1,So===null&&(So=[]),l=C5(So,l,c),c=Ie,(Sn===null?c.memoizedState:Sn.next)===null&&(c=c.alternate,A.H=c===null||c.memoizedState===null?S$:P0),l}function Yf(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return cu(l);if(l.$$typeof===$)return zn(l)}throw Error(r(438,String(l)))}function b0(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=Vf(),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 yi(l,c){return typeof c=="function"?c(l):c}function Df(l){var c=mn();return y0(c,Nt,l)}function y0(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,ae=c,de=!1;do{var me=ae.lane&-536870913;if(me!==ae.lane?(st&me)===me:(bi&me)===me){var le=ae.revertLane;if(le===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),me===go&&(de=!0);else if((bi&le)===le){ae=ae.next,le===go&&(de=!0);continue}else me={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},F===null?(M=F=me,_=w):F=F.next=me,Ie.lanes|=le,ha|=le;me=ae.action,cl&&h(w,me),w=ae.hasEagerState?ae.eagerState:h(w,me)}else le={lane:me,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},F===null?(M=F=le,_=w):F=F.next=le,Ie.lanes|=me,ha|=me;ae=ae.next}while(ae!==null&&ae!==c);if(F===null?_=w:F.next=M,!$r(w,l.memoizedState)&&(Qn=!0,de&&(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 v0(l){var c=mn(),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);$r(w,c.memoizedState)||(Qn=!0),c.memoizedState=w,c.baseQueue===null&&(c.baseState=w),h.lastRenderedState=w}return[w,O]}function Y5(l,c,h){var O=Ie,b=mn(),w=ot;if(w){if(h===void 0)throw Error(r(407));h=h()}else h=c();var _=!$r((Nt||b).memoizedState,h);if(_&&(b.memoizedState=h,Qn=!0),b=b.queue,Q0(U5.bind(null,O,b,l),[l]),b.getSnapshot!==c||_||Sn!==null&&Sn.memoizedState.tag&1){if(O.flags|=2048,Qo(9,{destroy:void 0},B5.bind(null,O,b,h,c),null),Xt===null)throw Error(r(349));w||(bi&127)!==0||D5(O,c,h)}return h}function D5(l,c,h){l.flags|=16384,l={getSnapshot:c,value:h},c=Ie.updateQueue,c===null?(c=Vf(),Ie.updateQueue=c,c.stores=[l]):(h=c.stores,h===null?c.stores=[l]:h.push(l))}function B5(l,c,h,O){c.value=h,c.getSnapshot=O,W5(c)&&G5(l)}function U5(l,c,h){return h(function(){W5(c)&&G5(l)})}function W5(l){var c=l.getSnapshot;l=l.value;try{var h=c();return!$r(l,h)}catch{return!0}}function G5(l){var c=el(l,2);c!==null&&fr(c,l,2)}function w0(l){var c=Kn();if(typeof l=="function"){var h=l;if(l=h(),cl){Pt(!0);try{h()}finally{Pt(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:l},c}function I5(l,c,h,O){return l.baseState=h,y0(l,Nt,typeof O=="function"?O:yi)}function g8(l,c,h,O,b){if(Wf(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,H5(c,w)):(w.next=h.next,c.pending=h.next=w)}}function H5(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),F5(l,c,M)}catch(ae){S0(l,c,ae)}finally{w!==null&&_.types!==null&&(w.types=_.types),A.T=w}}else try{w=h(b,O),F5(l,c,w)}catch(ae){S0(l,c,ae)}}function F5(l,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(O){K5(l,c,O)},function(O){return S0(l,c,O)}):K5(l,c,h)}function K5(l,c,h){c.status="fulfilled",c.value=h,J5(c),l.state=h,c=l.pending,c!==null&&(h=c.next,h===c?l.pending=null:(h=h.next,c.next=h,H5(l,h)))}function S0(l,c,h){var O=l.pending;if(l.pending=null,O!==null){O=O.next;do c.status="rejected",c.reason=h,J5(c),c=c.next;while(c!==O)}l.action=null}function J5(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function e$(l,c){return c}function t$(l,c){if(ot){var h=Xt.formState;if(h!==null){e:{var O=Ie;if(ot){if(Bt){t:{for(var b=Bt,w=Br;b.nodeType!==8;){if(!w){b=null;break t}if(b=Wr(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Bt=Wr(b.nextSibling),O=b.data==="F!";break e}}sa(O)}O=!1}O&&(c=h[0])}}return h=Kn(),h.memoizedState=h.baseState=c,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e$,lastRenderedState:c},h.queue=O,h=y$.bind(null,Ie,O),O.dispatch=h,O=w0(!1),w=_0.bind(null,Ie,!1,O.queue),O=Kn(),b={state:c,dispatch:null,action:l,pending:null},O.queue=b,h=g8.bind(null,Ie,b,w,h),b.dispatch=h,O.memoizedState=l,[c,h,!1]}function n$(l){var c=mn();return r$(c,Nt,l)}function r$(l,c,h){if(c=y0(l,c,e$)[0],l=Df(yi)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var O=cu(c)}catch(_){throw _===bo?Ef:_}else O=c;c=mn();var b=c.queue,w=b.dispatch;return h!==c.memoizedState&&(Ie.flags|=2048,Qo(9,{destroy:void 0},x8.bind(null,b,h),null)),[O,w,l]}function x8(l,c){l.action=c}function s$(l){var c=mn(),h=Nt;if(h!==null)return r$(c,h,l);mn(),c=c.memoizedState,h=mn();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=Vf(),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 i$(){return mn().memoizedState}function Bf(l,c,h,O){var b=Kn();Ie.flags|=l,b.memoizedState=Qo(1|c,{destroy:void 0},h,O===void 0?null:O)}function Uf(l,c,h,O){var b=mn();O=O===void 0?null:O;var w=b.memoizedState.inst;Nt!==null&&O!==null&&p0(O,Nt.memoizedState.deps)?b.memoizedState=Qo(c,w,h,O):(Ie.flags|=l,b.memoizedState=Qo(1|c,w,h,O))}function a$(l,c){Bf(8390656,8,l,c)}function Q0(l,c){Uf(2048,8,l,c)}function b8(l){Ie.flags|=4;var c=Ie.updateQueue;if(c===null)c=Vf(),Ie.updateQueue=c,c.events=[l];else{var h=c.events;h===null?c.events=[l]:h.push(l)}}function l$(l){var c=mn().memoizedState;return b8({ref:c,nextImpl:l}),function(){if((wt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function o$(l,c){return Uf(4,2,l,c)}function c$(l,c){return Uf(4,4,l,c)}function u$(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 d$(l,c,h){h=h!=null?h.concat([l]):null,Uf(4,4,u$.bind(null,c,l),h)}function k0(){}function f$(l,c){var h=mn();c=c===void 0?null:c;var O=h.memoizedState;return c!==null&&p0(c,O[1])?O[0]:(h.memoizedState=[l,c],l)}function h$(l,c){var h=mn();c=c===void 0?null:c;var O=h.memoizedState;if(c!==null&&p0(c,O[1]))return O[0];if(O=l(),cl){Pt(!0);try{l()}finally{Pt(!1)}}return h.memoizedState=[O,c],O}function $0(l,c,h){return h===void 0||(bi&1073741824)!==0&&(st&261930)===0?l.memoizedState=c:(l.memoizedState=h,l=pT(),Ie.lanes|=l,ha|=l,h)}function p$(l,c,h,O){return $r(h,c)?h:vo.current!==null?(l=$0(l,h,O),$r(l,c)||(Qn=!0),l):(bi&42)===0||(bi&1073741824)!==0&&(st&261930)===0?(Qn=!0,l.memoizedState=h):(l=pT(),Ie.lanes|=l,ha|=l,c)}function m$(l,c,h,O,b){var w=W.p;W.p=w!==0&&8>w?w:8;var _=A.T,M={};A.T=M,_0(l,!1,c,h);try{var F=b(),ae=A.S;if(ae!==null&&ae(M,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var de=p8(F,O);uu(l,c,de,Cr(l))}else uu(l,c,O,Cr(l))}catch(me){uu(l,c,{then:function(){},status:"rejected",reason:me},Cr())}finally{W.p=w,_!==null&&M.types!==null&&(_.types=M.types),A.T=_}}function y8(){}function T0(l,c,h,O){if(l.tag!==5)throw Error(r(476));var b=O$(l).queue;m$(l,b,c,H,h===null?y8:function(){return g$(l),h(O)})}function O$(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:yi,lastRenderedState:H},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:h},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function g$(l){var c=O$(l);c.next===null&&(c=l.alternate.memoizedState),uu(l,c.next.queue,{},Cr())}function j0(){return zn(Tu)}function x$(){return mn().memoizedState}function b$(){return mn().memoizedState}function v8(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var h=Cr();l=la(h);var O=oa(c,l,h);O!==null&&(fr(O,c,h),iu(O,c,h)),c={cache:r0()},l.payload=c;return}c=c.return}}function w8(l,c,h){var O=Cr();h={lane:O,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Wf(l)?v$(c,h):(h=UO(l,c,h,O),h!==null&&(fr(h,l,O),w$(h,c,O)))}function y$(l,c,h){var O=Cr();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(Wf(l))v$(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,$r(M,_))return Tf(l,c,b,0),Xt===null&&$f(),!1}catch{}finally{}if(h=UO(l,c,b,O),h!==null)return fr(h,l,O),w$(h,c,O),!0}return!1}function _0(l,c,h,O){if(O={lane:2,revertLane:lg(),gesture:null,action:O,hasEagerState:!1,eagerState:null,next:null},Wf(l)){if(c)throw Error(r(479))}else c=UO(l,h,O,2),c!==null&&fr(c,l,2)}function Wf(l){var c=l.alternate;return l===Ie||c!==null&&c===Ie}function v$(l,c){wo=Lf=!0;var h=l.pending;h===null?c.next=c:(c.next=h.next,h.next=c),l.pending=c}function w$(l,c,h){if((h&4194048)!==0){var O=c.lanes;O&=l.pendingLanes,h|=O,c.lanes=h,wr(l,h)}}var du={readContext:zn,use:Yf,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};du.useEffectEvent=ln;var S$={readContext:zn,use:Yf,useCallback:function(l,c){return Kn().memoizedState=[l,c===void 0?null:c],l},useContext:zn,useEffect:a$,useImperativeHandle:function(l,c,h){h=h!=null?h.concat([l]):null,Bf(4194308,4,u$.bind(null,c,l),h)},useLayoutEffect:function(l,c){return Bf(4194308,4,l,c)},useInsertionEffect:function(l,c){Bf(4,2,l,c)},useMemo:function(l,c){var h=Kn();c=c===void 0?null:c;var O=l();if(cl){Pt(!0);try{l()}finally{Pt(!1)}}return h.memoizedState=[O,c],O},useReducer:function(l,c,h){var O=Kn();if(h!==void 0){var b=h(c);if(cl){Pt(!0);try{h(c)}finally{Pt(!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=w8.bind(null,Ie,l),[O.memoizedState,l]},useRef:function(l){var c=Kn();return l={current:l},c.memoizedState=l},useState:function(l){l=w0(l);var c=l.queue,h=y$.bind(null,Ie,c);return c.dispatch=h,[l.memoizedState,h]},useDebugValue:k0,useDeferredValue:function(l,c){var h=Kn();return $0(h,l,c)},useTransition:function(){var l=w0(!1);return l=m$.bind(null,Ie,l.queue,!0,!1),Kn().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,h){var O=Ie,b=Kn();if(ot){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Xt===null)throw Error(r(349));(st&127)!==0||D5(O,c,h)}b.memoizedState=h;var w={value:h,getSnapshot:c};return b.queue=w,a$(U5.bind(null,O,w,l),[l]),O.flags|=2048,Qo(9,{destroy:void 0},B5.bind(null,O,w,h,c),null),h},useId:function(){var l=Kn(),c=Xt.identifierPrefix;if(ot){var h=Ys,O=Vs;h=(O&~(1<<32-vt(O)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Zf++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=m8++,c="_"+c+"r_"+h.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:j0,useFormState:t$,useActionState:t$,useOptimistic:function(l){var c=Kn();c.memoizedState=c.baseState=l;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=_0.bind(null,Ie,!0,h),h.dispatch=c,[l,c]},useMemoCache:b0,useCacheRefresh:function(){return Kn().memoizedState=v8.bind(null,Ie)},useEffectEvent:function(l){var c=Kn(),h={impl:l};return c.memoizedState=h,function(){if((wt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},P0={readContext:zn,use:Yf,useCallback:f$,useContext:zn,useEffect:Q0,useImperativeHandle:d$,useInsertionEffect:o$,useLayoutEffect:c$,useMemo:h$,useReducer:Df,useRef:i$,useState:function(){return Df(yi)},useDebugValue:k0,useDeferredValue:function(l,c){var h=mn();return p$(h,Nt.memoizedState,l,c)},useTransition:function(){var l=Df(yi)[0],c=mn().memoizedState;return[typeof l=="boolean"?l:cu(l),c]},useSyncExternalStore:Y5,useId:x$,useHostTransitionStatus:j0,useFormState:n$,useActionState:n$,useOptimistic:function(l,c){var h=mn();return I5(h,Nt,l,c)},useMemoCache:b0,useCacheRefresh:b$};P0.useEffectEvent=l$;var Q$={readContext:zn,use:Yf,useCallback:f$,useContext:zn,useEffect:Q0,useImperativeHandle:d$,useInsertionEffect:o$,useLayoutEffect:c$,useMemo:h$,useReducer:v0,useRef:i$,useState:function(){return v0(yi)},useDebugValue:k0,useDeferredValue:function(l,c){var h=mn();return Nt===null?$0(h,l,c):p$(h,Nt.memoizedState,l,c)},useTransition:function(){var l=v0(yi)[0],c=mn().memoizedState;return[typeof l=="boolean"?l:cu(l),c]},useSyncExternalStore:Y5,useId:x$,useHostTransitionStatus:j0,useFormState:s$,useActionState:s$,useOptimistic:function(l,c){var h=mn();return Nt!==null?I5(h,Nt,l,c):(h.baseState=l,[l,h.queue.dispatch])},useMemoCache:b0,useCacheRefresh:b$};Q$.useEffectEvent=l$;function N0(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 C0={enqueueSetState:function(l,c,h){l=l._reactInternals;var O=Cr(),b=la(O);b.payload=c,h!=null&&(b.callback=h),c=oa(l,b,O),c!==null&&(fr(c,l,O),iu(c,l,O))},enqueueReplaceState:function(l,c,h){l=l._reactInternals;var O=Cr(),b=la(O);b.tag=1,b.payload=c,h!=null&&(b.callback=h),c=oa(l,b,O),c!==null&&(fr(c,l,O),iu(c,l,O))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var h=Cr(),O=la(h);O.tag=2,c!=null&&(O.callback=c),c=oa(l,O,h),c!==null&&(fr(c,l,h),iu(c,l,h))}};function k$(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 $$(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&&C0.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 T$(l){kf(l)}function j$(l){console.error(l)}function _$(l){kf(l)}function Gf(l,c){try{var h=l.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(O){setTimeout(function(){throw O})}}function P$(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 R0(l,c,h){return h=la(h),h.tag=3,h.payload={element:null},h.callback=function(){Gf(l,c)},h}function N$(l){return l=la(l),l.tag=3,l}function C$(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(){P$(c,h,O)}}var _=h.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){P$(c,h,O),typeof b!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var M=O.stack;this.componentDidCatch(O.value,{componentStack:M!==null?M:""})})}function S8(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=jr.current,h!==null){switch(h.tag){case 31:case 13:return Ur===null?ah():h.alternate===null&&on===0&&(on=3),h.flags&=-257,h.flags|=65536,h.lanes=b,O===Af?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([O]):c.add(O),sg(l,O,b)),!1;case 22:return h.flags|=65536,O===Af?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)),sg(l,O,b)),!1}throw Error(r(435,h.tag))}return sg(l,O,b),ah(),!1}if(ot)return c=jr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=b,O!==KO&&(l=Error(r(422),{cause:O}),eu(Vr(l,h)))):(O!==KO&&(c=Error(r(423),{cause:O}),eu(Vr(c,h))),l=l.current.alternate,l.flags|=65536,b&=-b,l.lanes|=b,O=Vr(O,h),b=R0(l.stateNode,O,b),c0(l,b),on!==4&&(on=2)),!1;var w=Error(r(520),{cause:O});if(w=Vr(w,h),bu===null?bu=[w]:bu.push(w),on!==4&&(on=2),c===null)return!0;O=Vr(O,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,l=b&-b,h.lanes|=l,l=R0(h.stateNode,O,l),c0(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"&&(pa===null||!pa.has(w))))return h.flags|=65536,b&=-b,h.lanes|=b,b=N$(b),C$(b,l,h,O),c0(h,b),!1}h=h.return}while(h!==null);return!1}var E0=Error(r(461)),Qn=!1;function Ln(l,c,h,O){c.child=l===null?q5(c,null,h,O):ol(c,l.child,h,O)}function R$(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=m0(l,c,h,_,w,b),M=O0(),l!==null&&!Qn?(g0(l,c,b),vi(l,c,b)):(ot&&M&&HO(c),c.flags|=1,Ln(l,c,O,b),c.child)}function E$(l,c,h,O,b){if(l===null){var w=h.type;return typeof w=="function"&&!WO(w)&&w.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=w,A$(l,c,w,O,b)):(l=_f(h.type,null,O,c,c.mode,b),l.ref=c.ref,l.return=c,c.child=l)}if(w=l.child,!V0(l,b)){var _=w.memoizedProps;if(h=h.compare,h=h!==null?h:Fc,h(_,O)&&l.ref===c.ref)return vi(l,c,b)}return c.flags|=1,l=mi(w,O),l.ref=c.ref,l.return=c,c.child=l}function A$(l,c,h,O,b){if(l!==null){var w=l.memoizedProps;if(Fc(w,O)&&l.ref===c.ref)if(Qn=!1,c.pendingProps=O=w,V0(l,b))(l.flags&131072)!==0&&(Qn=!0);else return c.lanes=l.lanes,vi(l,c,b)}return A0(l,c,h,O,b)}function q$(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 M$(l,c,w,h,O)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&Rf(c,w!==null?w.cachePool:null),w!==null?z5(c,w):d0(),L5(c);else return O=c.lanes=536870912,M$(l,c,w!==null?w.baseLanes|h:h,h,O)}else w!==null?(Rf(c,w.cachePool),z5(c,w),ua(),c.memoizedState=null):(l!==null&&Rf(c,null),d0(),ua());return Ln(l,c,b,h),c.child}function fu(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function M$(l,c,h,O,b){var w=i0();return w=w===null?null:{parent:wn._currentValue,pool:w},c.memoizedState={baseLanes:h,cachePool:w},l!==null&&Rf(c,null),d0(),L5(c),l!==null&&Oo(l,c,O,!0),c.childLanes=b,null}function If(l,c){return c=Ff({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function X$(l,c,h){return ol(c,l.child,null,h),l=If(c,c.pendingProps),l.flags|=2,_r(c),c.memoizedState=null,l}function Q8(l,c,h){var O=c.pendingProps,b=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(ot){if(O.mode==="hidden")return l=If(c,O),c.lanes=536870912,fu(null,l);if(h0(c),(l=Bt)?(l=HT(l,Br),l=l!==null&&l.data==="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:na!==null?{id:Vs,overflow:Ys}:null,retryLane:536870912,hydrationErrors:null},h=v5(l),h.return=c,c.child=h,Xn=c,Bt=null)):l=null,l===null)throw sa(c);return c.lanes=536870912,null}return If(c,O)}var w=l.memoizedState;if(w!==null){var _=w.dehydrated;if(h0(c),b)if(c.flags&256)c.flags&=-257,c=X$(l,c,h);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(r(558));else if(Qn||Oo(l,c,h,!1),b=(h&l.childLanes)!==0,Qn||b){if(O=Xt,O!==null&&(_=hs(O,h),_!==0&&_!==w.retryLane))throw w.retryLane=_,el(l,_),fr(O,l,_),E0;ah(),c=X$(l,c,h)}else l=w.treeContext,Bt=Wr(_.nextSibling),Xn=c,ot=!0,ra=null,Br=!1,l!==null&&Q5(c,l),c=If(c,O),c.flags|=4096;return c}return l=mi(l.child,{mode:O.mode,children:O.children}),l.ref=c.ref,c.child=l,l.return=c,l}function Hf(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 A0(l,c,h,O,b){return sl(c),h=m0(l,c,h,O,void 0,b),O=O0(),l!==null&&!Qn?(g0(l,c,b),vi(l,c,b)):(ot&&O&&HO(c),c.flags|=1,Ln(l,c,h,b),c.child)}function z$(l,c,h,O,b,w){return sl(c),c.updateQueue=null,h=V5(c,O,h,b),Z5(l),O=O0(),l!==null&&!Qn?(g0(l,c,w),vi(l,c,w)):(ot&&O&&HO(c),c.flags|=1,Ln(l,c,h,w),c.child)}function L$(l,c,h,O,b){if(sl(c),c.stateNode===null){var w=fo,_=h.contextType;typeof _=="object"&&_!==null&&(w=zn(_)),w=new h(O,w),c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=C0,c.stateNode=w,w._reactInternals=c,w=c.stateNode,w.props=O,w.state=c.memoizedState,w.refs={},l0(c),_=h.contextType,w.context=typeof _=="object"&&_!==null?zn(_):fo,w.state=c.memoizedState,_=h.getDerivedStateFromProps,typeof _=="function"&&(N0(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&&C0.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 ae=w.context,de=h.contextType;_=fo,typeof de=="object"&&de!==null&&(_=zn(de));var me=h.getDerivedStateFromProps;de=typeof me=="function"||typeof w.getSnapshotBeforeUpdate=="function",M=c.pendingProps!==M,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(M||ae!==_)&&$$(c,w,O,_),aa=!1;var le=c.memoizedState;w.state=le,lu(c,O,w,b),au(),ae=c.memoizedState,M||le!==ae||aa?(typeof me=="function"&&(N0(c,h,me,O),ae=c.memoizedState),(F=aa||k$(c,h,F,O,le,ae,_))?(de||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=ae),w.props=O,w.state=ae,w.context=_,O=F):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),O=!1)}else{w=c.stateNode,o0(l,c),_=c.memoizedProps,de=ul(h,_),w.props=de,me=c.pendingProps,le=w.context,ae=h.contextType,F=fo,typeof ae=="object"&&ae!==null&&(F=zn(ae)),M=h.getDerivedStateFromProps,(ae=typeof M=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==me||le!==F)&&$$(c,w,O,F),aa=!1,le=c.memoizedState,w.state=le,lu(c,O,w,b),au();var oe=c.memoizedState;_!==me||le!==oe||aa||l!==null&&l.dependencies!==null&&Nf(l.dependencies)?(typeof M=="function"&&(N0(c,h,M,O),oe=c.memoizedState),(de=aa||k$(c,h,de,O,le,oe,F)||l!==null&&l.dependencies!==null&&Nf(l.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(O,oe,F),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(O,oe,F)),typeof w.componentDidUpdate=="function"&&(c.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===l.memoizedProps&&le===l.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===l.memoizedProps&&le===l.memoizedState||(c.flags|=1024),c.memoizedProps=O,c.memoizedState=oe),w.props=O,w.state=oe,w.context=F,O=de):(typeof w.componentDidUpdate!="function"||_===l.memoizedProps&&le===l.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===l.memoizedProps&&le===l.memoizedState||(c.flags|=1024),O=!1)}return w=O,Hf(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)):Ln(l,c,h,b),c.memoizedState=w.state,l=c.child):l=vi(l,c,b),l}function Z$(l,c,h,O){return nl(),c.flags|=256,Ln(l,c,h,O),c.child}var q0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function M0(l){return{baseLanes:l,cachePool:P5()}}function X0(l,c,h){return l=l!==null?l.childLanes&~h:0,c&&(l|=Nr),l}function V$(l,c,h){var O=c.pendingProps,b=!1,w=(c.flags&128)!==0,_;if((_=w)||(_=l!==null&&l.memoizedState===null?!1:(pn.current&2)!==0),_&&(b=!0,c.flags&=-129),_=(c.flags&32)!==0,c.flags&=-33,l===null){if(ot){if(b?ca(c):ua(),(l=Bt)?(l=HT(l,Br),l=l!==null&&l.data!=="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:na!==null?{id:Vs,overflow:Ys}:null,retryLane:536870912,hydrationErrors:null},h=v5(l),h.return=c,c.child=h,Xn=c,Bt=null)):l=null,l===null)throw sa(c);return yg(l)?c.lanes=32:c.lanes=536870912,null}var M=O.children;return O=O.fallback,b?(ua(),b=c.mode,M=Ff({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=M0(h),O.childLanes=X0(l,_,h),c.memoizedState=q0,fu(null,O)):(ca(c),z0(c,M))}var F=l.memoizedState;if(F!==null&&(M=F.dehydrated,M!==null)){if(w)c.flags&256?(ca(c),c.flags&=-257,c=L0(l,c,h)):c.memoizedState!==null?(ua(),c.child=l.child,c.flags|=128,c=null):(ua(),M=O.fallback,b=c.mode,O=Ff({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=M0(h),O.childLanes=X0(l,_,h),c.memoizedState=q0,c=fu(null,O));else if(ca(c),yg(M)){if(_=M.nextSibling&&M.nextSibling.dataset,_)var ae=_.dgst;_=ae,O=Error(r(419)),O.stack="",O.digest=_,eu({value:O,source:null,stack:null}),c=L0(l,c,h)}else if(Qn||Oo(l,c,h,!1),_=(h&l.childLanes)!==0,Qn||_){if(_=Xt,_!==null&&(O=hs(_,h),O!==0&&O!==F.retryLane))throw F.retryLane=O,el(l,O),fr(_,l,O),E0;bg(M)||ah(),c=L0(l,c,h)}else bg(M)?(c.flags|=192,c.child=l.child,c=null):(l=F.treeContext,Bt=Wr(M.nextSibling),Xn=c,ot=!0,ra=null,Br=!1,l!==null&&Q5(c,l),c=z0(c,O.children),c.flags|=4096);return c}return b?(ua(),M=O.fallback,b=c.mode,F=l.child,ae=F.sibling,O=mi(F,{mode:"hidden",children:O.children}),O.subtreeFlags=F.subtreeFlags&65011712,ae!==null?M=mi(ae,M):(M=tl(M,b,h,null),M.flags|=2),M.return=c,O.return=c,O.sibling=M,c.child=O,fu(null,O),O=c.child,M=l.child.memoizedState,M===null?M=M0(h):(b=M.cachePool,b!==null?(F=wn._currentValue,b=b.parent!==F?{parent:F,pool:F}:b):b=P5(),M={baseLanes:M.baseLanes|h,cachePool:b}),O.memoizedState=M,O.childLanes=X0(l,_,h),c.memoizedState=q0,fu(l.child,O)):(ca(c),h=l.child,l=h.sibling,h=mi(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 z0(l,c){return c=Ff({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function Ff(l,c){return l=Tr(22,l,null,c),l.lanes=0,l}function L0(l,c,h){return ol(c,l.child,null,h),l=z0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Y$(l,c,h){l.lanes|=c;var O=l.alternate;O!==null&&(O.lanes|=c),t0(l.return,c,h)}function Z0(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 D$(l,c,h){var O=c.pendingProps,b=O.revealOrder,w=O.tail;O=O.children;var _=pn.current,M=(_&2)!==0;if(M?(_=_&1|2,c.flags|=128):_&=1,K(pn,_),Ln(l,c,O,h),O=ot?Jc:0,!M&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Y$(l,h,c);else if(l.tag===19)Y$(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&&zf(l)===null&&(b=h),h=h.sibling;h=b,h===null?(b=c.child,c.child=null):(b=h.sibling,h.sibling=null),Z0(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&&zf(l)===null){c.child=b;break}l=b.sibling,b.sibling=h,h=b,b=l}Z0(c,!0,h,null,w,O);break;case"together":Z0(c,!1,null,null,void 0,O);break;default:c.memoizedState=null}return c.child}function vi(l,c,h){if(l!==null&&(c.dependencies=l.dependencies),ha|=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=mi(l,l.pendingProps),c.child=h,h.return=c;l.sibling!==null;)l=l.sibling,h=h.sibling=mi(l,l.pendingProps),h.return=c;h.sibling=null}return c.child}function V0(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&Nf(l)))}function k8(l,c,h){switch(c.tag){case 3:ce(c,c.stateNode.containerInfo),ia(c,wn,l.memoizedState.cache),nl();break;case 27:case 5:ke(c);break;case 4:ce(c,c.stateNode.containerInfo);break;case 10:ia(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,h0(c),null;break;case 13:var O=c.memoizedState;if(O!==null)return O.dehydrated!==null?(ca(c),c.flags|=128,null):(h&c.child.childLanes)!==0?V$(l,c,h):(ca(c),l=vi(l,c,h),l!==null?l.sibling:null);ca(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 D$(l,c,h);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),K(pn,pn.current),O)break;return null;case 22:return c.lanes=0,q$(l,c,h,c.pendingProps);case 24:ia(c,wn,l.memoizedState.cache)}return vi(l,c,h)}function B$(l,c,h){if(l!==null)if(l.memoizedProps!==c.pendingProps)Qn=!0;else{if(!V0(l,h)&&(c.flags&128)===0)return Qn=!1,k8(l,c,h);Qn=(l.flags&131072)!==0}else Qn=!1,ot&&(c.flags&1048576)!==0&&S5(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")WO(l)?(O=ul(l,O),c.tag=1,c=L$(null,c,l,O,h)):(c.tag=0,c=A0(null,c,l,O,h));else{if(l!=null){var b=l.$$typeof;if(b===j){c.tag=11,c=R$(null,c,l,O,h);break e}else if(b===N){c.tag=14,c=E$(null,c,l,O,h);break e}}throw c=C(l)||l,Error(r(306,c,""))}}return c;case 0:return A0(l,c,c.type,c.pendingProps,h);case 1:return O=c.type,b=ul(O,c.pendingProps),L$(l,c,O,b,h);case 3:e:{if(ce(c,c.stateNode.containerInfo),l===null)throw Error(r(387));O=c.pendingProps;var w=c.memoizedState;b=w.element,o0(l,c),lu(c,O,null,h);var _=c.memoizedState;if(O=_.cache,ia(c,wn,O),O!==w.cache&&n0(c,[wn],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=Vr(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(Bt=Wr(l.firstChild),Xn=c,ot=!0,ra=null,Br=!0,h=q5(c,null,O,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(nl(),O===b){c=vi(l,c,h);break e}Ln(l,c,O,h)}c=c.child}return c;case 26:return Hf(l,c),l===null?(h=nj(c.type,null,c.pendingProps,null))?c.memoizedState=h:ot||(h=c.type,l=c.pendingProps,O=hh(J.current).createElement(h),O[$e]=c,O[ze]=l,Zn(O,h,l),an(O),c.stateNode=O):c.memoizedState=nj(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:return ke(c),l===null&&ot&&(O=c.stateNode=JT(c.type,c.pendingProps,J.current),Xn=c,Br=!0,b=Bt,xa(c.type)?(vg=b,Bt=Wr(O.firstChild)):Bt=b),Ln(l,c,c.pendingProps.children,h),Hf(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&&ot&&((b=O=Bt)&&(O=t9(O,c.type,c.pendingProps,Br),O!==null?(c.stateNode=O,Xn=c,Bt=Wr(O.firstChild),Br=!1,b=!0):b=!1),b||sa(c)),ke(c),b=c.type,w=c.pendingProps,_=l!==null?l.memoizedProps:null,O=w.children,Og(b,w)?O=null:_!==null&&Og(b,_)&&(c.flags|=32),c.memoizedState!==null&&(b=m0(l,c,O8,null,null,h),Tu._currentValue=b),Hf(l,c),Ln(l,c,O,h),c.child;case 6:return l===null&&ot&&((l=h=Bt)&&(h=n9(h,c.pendingProps,Br),h!==null?(c.stateNode=h,Xn=c,Bt=null,l=!0):l=!1),l||sa(c)),null;case 13:return V$(l,c,h);case 4:return ce(c,c.stateNode.containerInfo),O=c.pendingProps,l===null?c.child=ol(c,null,O,h):Ln(l,c,O,h),c.child;case 11:return R$(l,c,c.type,c.pendingProps,h);case 7:return Ln(l,c,c.pendingProps,h),c.child;case 8:return Ln(l,c,c.pendingProps.children,h),c.child;case 12:return Ln(l,c,c.pendingProps.children,h),c.child;case 10:return O=c.pendingProps,ia(c,c.type,O.value),Ln(l,c,O.children,h),c.child;case 9:return b=c.type._context,O=c.pendingProps.children,sl(c),b=zn(b),O=O(b),c.flags|=1,Ln(l,c,O,h),c.child;case 14:return E$(l,c,c.type,c.pendingProps,h);case 15:return A$(l,c,c.type,c.pendingProps,h);case 19:return D$(l,c,h);case 31:return Q8(l,c,h);case 22:return q$(l,c,h,c.pendingProps);case 24:return sl(c),O=zn(wn),l===null?(b=i0(),b===null&&(b=Xt,w=r0(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=h),b=w),c.memoizedState={parent:O,cache:b},l0(c),ia(c,wn,b)):((l.lanes&h)!==0&&(o0(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),ia(c,wn,O)):(O=w.cache,ia(c,wn,O),O!==b.cache&&n0(c,[wn],h,!0))),Ln(l,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function wi(l){l.flags|=4}function Y0(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(xT())l.flags|=8192;else throw ll=Af,a0}else l.flags&=-16777217}function U$(l,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!lj(c))if(xT())l.flags|=8192;else throw ll=Af,a0}function Kf(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?bn():536870912,l.lanes|=c,jo|=c)}function hu(l,c){if(!ot)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 Ut(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 $8(l,c,h){var O=c.pendingProps;switch(FO(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(c),null;case 1:return Ut(c),null;case 3:return h=c.stateNode,O=null,l!==null&&(O=l.memoizedState.cache),c.memoizedState.cache!==O&&(c.flags|=2048),xi(wn),xe(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(l===null||l.child===null)&&(mo(c)?wi(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,JO())),Ut(c),null;case 26:var b=c.type,w=c.memoizedState;return l===null?(wi(c),w!==null?(Ut(c),U$(c,w)):(Ut(c),Y0(c,b,null,O,h))):w?w!==l.memoizedState?(wi(c),Ut(c),U$(c,w)):(Ut(c),c.flags&=-16777217):(l=l.memoizedProps,l!==O&&wi(c),Ut(c),Y0(c,b,l,O,h)),null;case 27:if(Me(c),h=J.current,b=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==O&&wi(c);else{if(!O){if(c.stateNode===null)throw Error(r(166));return Ut(c),null}l=Z.current,mo(c)?k5(c):(l=JT(b,O,h),c.stateNode=l,wi(c))}return Ut(c),null;case 5:if(Me(c),b=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==O&&wi(c);else{if(!O){if(c.stateNode===null)throw Error(r(166));return Ut(c),null}if(w=Z.current,mo(c))k5(c);else{var _=hh(J.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[ze]=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(Zn(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&&wi(c)}}return Ut(c),Y0(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,h),null;case 6:if(l&&c.stateNode!=null)l.memoizedProps!==O&&wi(c);else{if(typeof O!="string"&&c.stateNode===null)throw Error(r(166));if(l=J.current,mo(c)){if(l=c.stateNode,h=c.memoizedProps,O=null,b=Xn,b!==null)switch(b.tag){case 27:case 5:O=b.memoizedProps}l[$e]=c,l=!!(l.nodeValue===h||O!==null&&O.suppressHydrationWarning===!0||VT(l.nodeValue,h)),l||sa(c,!0)}else l=hh(l).createTextNode(O),l[$e]=c,c.stateNode=l}return Ut(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;Ut(c),l=!1}else h=JO(),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 Ut(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;Ut(c),b=!1}else b=JO(),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),Kf(c,c.updateQueue),Ut(c),null);case 4:return xe(),l===null&&dg(c.stateNode.containerInfo),Ut(c),null;case 10:return xi(c.type),Ut(c),null;case 19:if(B(pn),O=c.memoizedState,O===null)return Ut(c),null;if(b=(c.flags&128)!==0,w=O.rendering,w===null)if(b)hu(O,!1);else{if(on!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(w=zf(l),w!==null){for(c.flags|=128,hu(O,!1),l=w.updateQueue,c.updateQueue=l,Kf(c,l),c.subtreeFlags=0,l=h,h=c.child;h!==null;)y5(h,l),h=h.sibling;return K(pn,pn.current&1|2),ot&&Oi(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=zf(w),l!==null){if(c.flags|=128,b=!0,l=l.updateQueue,c.updateQueue=l,Kf(c,l),hu(O,!0),O.tail===null&&O.tailMode==="hidden"&&!w.alternate&&!ot)return Ut(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=pn.current,K(pn,b?h&1|2:h&1),ot&&Oi(c,O.treeForkCount),l):(Ut(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&&(Ut(c),c.subtreeFlags&6&&(c.flags|=8192)):Ut(c),h=c.updateQueue,h!==null&&Kf(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&&B(il),null;case 24:return h=null,l!==null&&(h=l.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),xi(wn),Ut(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function T8(l,c){switch(FO(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return xi(wn),xe(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return Me(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 B(pn),null;case 4:return xe(),null;case 10:return xi(c.type),null;case 22:case 23:return _r(c),f0(),l!==null&&B(il),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return xi(wn),null;case 25:return null;default:return null}}function W$(l,c){switch(FO(c),c.tag){case 3:xi(wn),xe();break;case 26:case 27:case 5:Me(c);break;case 4:xe();break;case 31:c.memoizedState!==null&&_r(c);break;case 13:_r(c);break;case 19:B(pn);break;case 10:xi(c.type);break;case 22:case 23:_r(c),f0(),l!==null&&B(il);break;case 24:xi(wn)}}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 da(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,ae=M;try{ae()}catch(de){_t(b,F,de)}}}O=O.next}while(O!==w)}}catch(de){_t(c,c.return,de)}}function G$(l){var c=l.updateQueue;if(c!==null){var h=l.stateNode;try{X5(c,h)}catch(O){_t(l,l.return,O)}}}function I$(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 Ds(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 H$(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 D0(l,c,h){try{var O=l.stateNode;I8(O,l.type,h,c),O[ze]=c}catch(b){_t(l,l.return,b)}}function F$(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&xa(l.type)||l.tag===4}function B0(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||F$(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&&xa(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 U0(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=hi));else if(O!==4&&(O===27&&xa(l.type)&&(h=l.stateNode,c=null),l=l.child,l!==null))for(U0(l,c,h),l=l.sibling;l!==null;)U0(l,c,h),l=l.sibling}function Jf(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&&xa(l.type)&&(h=l.stateNode),l=l.child,l!==null))for(Jf(l,c,h),l=l.sibling;l!==null;)Jf(l,c,h),l=l.sibling}function K$(l){var c=l.stateNode,h=l.memoizedProps;try{for(var O=l.type,b=c.attributes;b.length;)c.removeAttributeNode(b[0]);Zn(c,O,h),c[$e]=l,c[ze]=h}catch(w){_t(l,l.return,w)}}var Si=!1,kn=!1,W0=!1,J$=typeof WeakSet=="function"?WeakSet:Set,An=null;function j8(l,c){if(l=l.containerInfo,pg=yh,l=d5(l),LO(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,ae=0,de=0,me=l,le=null;t:for(;;){for(var oe;me!==h||b!==0&&me.nodeType!==3||(M=_+b),me!==w||O!==0&&me.nodeType!==3||(F=_+O),me.nodeType===3&&(_+=me.nodeValue.length),(oe=me.firstChild)!==null;)le=me,me=oe;for(;;){if(me===l)break t;if(le===h&&++ae===b&&(M=_),le===w&&++de===O&&(F=_),(oe=me.nextSibling)!==null)break;me=le,le=me.parentNode}me=oe}h=M===-1||F===-1?null:{start:M,end:F}}else h=null}h=h||{start:0,end:0}}else h=null;for(mg={focusedElem:l,selectionRange:h},yh=!1,An=c;An!==null;)if(c=An,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,An=l;else for(;An!==null;){switch(c=An,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 Ce=ul(h.type,b);l=O.getSnapshotBeforeUpdate(Ce,w),O.__reactInternalSnapshotBeforeUpdate=l}catch(De){_t(h,h.return,De)}}break;case 3:if((l&1024)!==0){if(l=c.stateNode.containerInfo,h=l.nodeType,h===9)xg(l);else if(h===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":xg(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,An=l;break}An=c.return}}function eT(l,c,h){var O=h.flags;switch(h.tag){case 0:case 11:case 15:ki(l,h),O&4&&pu(5,h);break;case 1:if(ki(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&&G$(h),O&512&&mu(h,h.return);break;case 3:if(ki(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{X5(l,c)}catch(_){_t(h,h.return,_)}}break;case 27:c===null&&O&4&&K$(h);case 26:case 5:ki(l,h),c===null&&O&4&&H$(h),O&512&&mu(h,h.return);break;case 12:ki(l,h);break;case 31:ki(l,h),O&4&&rT(l,h);break;case 13:ki(l,h),O&4&&sT(l,h),O&64&&(l=h.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(h=M8.bind(null,h),r9(l,h))));break;case 22:if(O=h.memoizedState!==null||Si,!O){c=c!==null&&c.memoizedState!==null||kn,b=Si;var w=kn;Si=O,(kn=c)&&!w?$i(l,h,(h.subtreeFlags&8772)!==0):ki(l,h),Si=b,kn=w}break;case 30:break;default:ki(l,h)}}function tT(l){var c=l.alternate;c!==null&&(l.alternate=null,tT(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 Wt=null,or=!1;function Qi(l,c,h){for(h=h.child;h!==null;)nT(l,c,h),h=h.sibling}function nT(l,c,h){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(ut,h)}catch{}switch(h.tag){case 26:kn||Ds(h,c),Qi(l,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:kn||Ds(h,c);var O=Wt,b=or;xa(h.type)&&(Wt=h.stateNode,or=!1),Qi(l,c,h),Qu(h.stateNode),Wt=O,or=b;break;case 5:kn||Ds(h,c);case 6:if(O=Wt,b=or,Wt=null,Qi(l,c,h),Wt=O,or=b,Wt!==null)if(or)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(h.stateNode)}catch(w){_t(h,c,w)}else try{Wt.removeChild(h.stateNode)}catch(w){_t(h,c,w)}break;case 18:Wt!==null&&(or?(l=Wt,GT(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,h.stateNode),qo(l)):GT(Wt,h.stateNode));break;case 4:O=Wt,b=or,Wt=h.stateNode.containerInfo,or=!0,Qi(l,c,h),Wt=O,or=b;break;case 0:case 11:case 14:case 15:da(2,h,c),kn||da(4,h,c),Qi(l,c,h);break;case 1:kn||(Ds(h,c),O=h.stateNode,typeof O.componentWillUnmount=="function"&&I$(h,c,O)),Qi(l,c,h);break;case 21:Qi(l,c,h);break;case 22:kn=(O=kn)||h.memoizedState!==null,Qi(l,c,h),kn=O;break;default:Qi(l,c,h)}}function rT(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 sT(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 _8(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new J$),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new J$),c;default:throw Error(r(435,l.tag))}}function eh(l,c){var h=_8(l);c.forEach(function(O){if(!h.has(O)){h.add(O);var b=X8.bind(null,l,O);O.then(b,b)}})}function cr(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(xa(M.type)){Wt=M.stateNode,or=!1;break e}break;case 5:Wt=M.stateNode,or=!1;break e;case 3:case 4:Wt=M.stateNode.containerInfo,or=!0;break e}M=M.return}if(Wt===null)throw Error(r(160));nT(w,_,b),Wt=null,or=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)iT(c,l),c=c.sibling}var ws=null;function iT(l,c){var h=l.alternate,O=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:cr(c,l),ur(l),O&4&&(da(3,l,l.return),pu(3,l),da(5,l,l.return));break;case 1:cr(c,l),ur(l),O&512&&(kn||h===null||Ds(h,h.return)),O&64&&Si&&(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=ws;if(cr(c,l),ur(l),O&512&&(kn||h===null||Ds(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[di]||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"))),Zn(w,O,h),w[$e]=l,an(w),O=w;break e;case"link":var _=ij("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),Zn(w,O,h),b.head.appendChild(w);break;case"meta":if(_=ij("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),Zn(w,O,h),b.head.appendChild(w);break;default:throw Error(r(468,O))}w[$e]=l,an(w),O=w}l.stateNode=O}else aj(b,l.type,l.stateNode);else l.stateNode=sj(b,O,l.memoizedProps);else w!==O?(w===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):w.count--,O===null?aj(b,l.type,l.stateNode):sj(b,O,l.memoizedProps)):O===null&&l.stateNode!==null&&D0(l,l.memoizedProps,h.memoizedProps)}break;case 27:cr(c,l),ur(l),O&512&&(kn||h===null||Ds(h,h.return)),h!==null&&O&4&&D0(l,l.memoizedProps,h.memoizedProps);break;case 5:if(cr(c,l),ur(l),O&512&&(kn||h===null||Ds(h,h.return)),l.flags&32){b=l.stateNode;try{fi(b,"")}catch(Ce){_t(l,l.return,Ce)}}O&4&&l.stateNode!=null&&(b=l.memoizedProps,D0(l,b,h!==null?h.memoizedProps:b)),O&1024&&(W0=!0);break;case 6:if(cr(c,l),ur(l),O&4){if(l.stateNode===null)throw Error(r(162));O=l.memoizedProps,h=l.stateNode;try{h.nodeValue=O}catch(Ce){_t(l,l.return,Ce)}}break;case 3:if(Oh=null,b=ws,ws=ph(c.containerInfo),cr(c,l),ws=b,ur(l),O&4&&h!==null&&h.memoizedState.isDehydrated)try{qo(c.containerInfo)}catch(Ce){_t(l,l.return,Ce)}W0&&(W0=!1,aT(l));break;case 4:O=ws,ws=ph(l.stateNode.containerInfo),cr(c,l),ur(l),ws=O;break;case 12:cr(c,l),ur(l);break;case 31:cr(c,l),ur(l),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,eh(l,O)));break;case 13:cr(c,l),ur(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,ae=Si,de=kn;if(Si=ae||b,kn=de||F,cr(c,l),kn=de,Si=ae,ur(l),O&8192)e:for(c=l.stateNode,c._visibility=b?c._visibility&-2:c._visibility|1,b&&(h===null||F||Si||kn||dl(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,le=me!=null&&me.hasOwnProperty("display")?me.display:null;M.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Ce){_t(F,F.return,Ce)}}}else if(c.tag===6){if(h===null){F=c;try{F.stateNode.nodeValue=b?"":F.memoizedProps}catch(Ce){_t(F,F.return,Ce)}}}else if(c.tag===18){if(h===null){F=c;try{var oe=F.stateNode;b?IT(oe,!0):IT(F.stateNode,!1)}catch(Ce){_t(F,F.return,Ce)}}}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:cr(c,l),ur(l),O&4&&(O=l.updateQueue,O!==null&&(l.updateQueue=null,eh(l,O)));break;case 30:break;case 21:break;default:cr(c,l),ur(l)}}function ur(l){var c=l.flags;if(c&2){try{for(var h,O=l.return;O!==null;){if(F$(O)){h=O;break}O=O.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,w=B0(l);Jf(l,w,b);break;case 5:var _=h.stateNode;h.flags&32&&(fi(_,""),h.flags&=-33);var M=B0(l);Jf(l,M,_);break;case 3:case 4:var F=h.stateNode.containerInfo,ae=B0(l);U0(l,ae,F);break;default:throw Error(r(161))}}catch(de){_t(l,l.return,de)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function aT(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;aT(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),l=l.sibling}}function ki(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)eT(l,c.alternate,c),c=c.sibling}function dl(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:da(4,c,c.return),dl(c);break;case 1:Ds(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&I$(c,c.return,h),dl(c);break;case 27:Qu(c.stateNode);case 26:case 5:Ds(c,c.return),dl(c);break;case 22:c.memoizedState===null&&dl(c);break;case 30:dl(c);break;default:dl(c)}l=l.sibling}}function $i(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:$i(b,w,h),pu(4,w);break;case 1:if($i(b,w,h),O=w,b=O.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ae){_t(O,O.return,ae)}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++)M5(F[b],M)}catch(ae){_t(O,O.return,ae)}}h&&_&64&&G$(w),mu(w,w.return);break;case 27:K$(w);case 26:case 5:$i(b,w,h),h&&O===null&&_&4&&H$(w),mu(w,w.return);break;case 12:$i(b,w,h);break;case 31:$i(b,w,h),h&&_&4&&rT(b,w);break;case 13:$i(b,w,h),h&&_&4&&sT(b,w);break;case 22:w.memoizedState===null&&$i(b,w,h),mu(w,w.return);break;case 30:break;default:$i(b,w,h)}c=c.sibling}}function G0(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 I0(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 Ss(l,c,h,O){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)lT(l,c,h,O),c=c.sibling}function lT(l,c,h,O){var b=c.flags;switch(c.tag){case 0:case 11:case 15:Ss(l,c,h,O),b&2048&&pu(9,c);break;case 1:Ss(l,c,h,O);break;case 3:Ss(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){Ss(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 Ss(l,c,h,O);break;case 31:Ss(l,c,h,O);break;case 13:Ss(l,c,h,O);break;case 23:break;case 22:w=c.stateNode,_=c.alternate,c.memoizedState!==null?w._visibility&2?Ss(l,c,h,O):Ou(l,c):w._visibility&2?Ss(l,c,h,O):(w._visibility|=2,ko(l,c,h,O,(c.subtreeFlags&10256)!==0||!1)),b&2048&&G0(_,c);break;case 24:Ss(l,c,h,O),b&2048&&I0(c.alternate,c);break;default:Ss(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,ae=_.flags;switch(_.tag){case 0:case 11:case 15:ko(w,_,M,F,b),pu(8,_);break;case 23:break;case 22:var de=_.stateNode;_.memoizedState!==null?de._visibility&2?ko(w,_,M,F,b):Ou(w,_):(de._visibility|=2,ko(w,_,M,F,b)),b&&ae&2048&&G0(_.alternate,_);break;case 24:ko(w,_,M,F,b),b&&ae&2048&&I0(_.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&&G0(O.alternate,O);break;case 24:Ou(h,O),b&2048&&I0(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;)oT(l,c,h),l=l.sibling}function oT(l,c,h){switch(l.tag){case 26:$o(l,c,h),l.flags&gu&&l.memoizedState!==null&&m9(h,ws,l.memoizedState,l.memoizedProps);break;case 5:$o(l,c,h);break;case 3:case 4:var O=ws;ws=ph(l.stateNode.containerInfo),$o(l,c,h),ws=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 cT(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];An=O,dT(O,l)}cT(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)uT(l),l=l.sibling}function uT(l){switch(l.tag){case 0:case 11:case 15:xu(l),l.flags&2048&&da(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];An=O,dT(O,l)}cT(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:da(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 dT(l,c){for(;An!==null;){var h=An;switch(h.tag){case 0:case 11:case 15:da(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,An=O;else e:for(h=l;An!==null;){O=An;var b=O.sibling,w=O.return;if(tT(O),O===h){An=null;break e}if(b!==null){b.return=w,An=b;break e}An=w}}}var P8={getCacheForType:function(l){var c=zn(wn),h=c.data.get(l);return h===void 0&&(h=l(),c.data.set(l,h)),h},cacheSignal:function(){return zn(wn).controller.signal}},N8=typeof WeakMap=="function"?WeakMap:Map,wt=0,Xt=null,nt=null,st=0,jt=0,Pr=null,fa=!1,To=!1,H0=!1,Ti=0,on=0,ha=0,fl=0,F0=0,Nr=0,jo=0,bu=null,dr=null,K0=!1,nh=0,fT=0,rh=1/0,sh=null,pa=null,Pn=0,ma=null,_o=null,ji=0,J0=0,eg=null,hT=null,yu=0,tg=null;function Cr(){return(wt&2)!==0&&st!==0?st&-st:A.T!==null?lg():ps()}function pT(){if(Nr===0)if((st&536870912)===0||ot){var l=Re;Re<<=1,(Re&3932160)===0&&(Re=262144),Nr=l}else Nr=536870912;return l=jr.current,l!==null&&(l.flags|=32),Nr}function fr(l,c,h){(l===Xt&&(jt===2||jt===9)||l.cancelPendingCommit!==null)&&(Po(l,0),Oa(l,st,Nr,!1)),fn(l,h),((wt&2)===0||l!==Xt)&&(l===Xt&&((wt&2)===0&&(fl|=h),on===4&&Oa(l,st,Nr,!1)),Bs(l))}function mT(l,c,h){if((wt&6)!==0)throw Error(r(327));var O=!h&&(c&127)===0&&(c&l.expiredLanes)===0||_n(l,c),b=O?E8(l,c):rg(l,c,!0),w=O;do{if(b===0){To&&!O&&Oa(l,c,0,!1);break}else{if(h=l.current.alternate,w&&!C8(h)){b=rg(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),_=rg(M,_,!1),_!==2){if(H0&&!F){M.errorRecoveryDisabledLanes|=w,fl|=w,b=4;break e}w=dr,dr=b,w!==null&&(dr===null?dr=w:dr.push.apply(dr,w))}b=_}if(w=!1,b!==2)continue}}if(b===1){Po(l,0),Oa(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:Oa(O,c,Nr,!fa);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(b=nh+300-tt(),10<b)){if(Oa(O,c,Nr,!fa),Ft(O,0,!0)!==0)break e;ji=c,O.timeoutHandle=UT(OT.bind(null,O,h,dr,sh,K0,c,Nr,fl,jo,fa,w,"Throttled",-0,0),b);break e}OT(O,h,dr,sh,K0,c,Nr,fl,jo,fa,w,null,-0,0)}}break}while(!0);Bs(l)}function OT(l,c,h,O,b,w,_,M,F,ae,de,me,le,oe){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:hi},oT(c,w,me);var Ce=(w&62914560)===w?nh-tt():(w&4194048)===w?fT-tt():0;if(Ce=O9(me,Ce),Ce!==null){ji=w,l.cancelPendingCommit=Ce(QT.bind(null,l,c,w,h,O,b,_,M,F,de,me,null,le,oe)),Oa(l,w,_,!ae);return}}QT(l,c,w,h,O,b,_,M,F)}function C8(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(!$r(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 Oa(l,c,h,O){c&=~F0,c&=~fl,l.suspendedLanes|=c,l.pingedLanes&=~c,O&&(l.warmLanes|=c),O=l.expirationTimes;for(var b=c;0<b;){var w=31-vt(b),_=1<<w;O[w]=-1,b&=~_}h!==0&&fs(l,h,c)}function ih(){return(wt&6)===0?(vu(0),!1):!0}function ng(){if(nt!==null){if(jt===0)var l=nt.return;else l=nt,gi=rl=null,x0(l),yo=null,ru=0,l=nt;for(;l!==null;)W$(l.alternate,l),l=l.return;nt=null}}function Po(l,c){var h=l.timeoutHandle;h!==-1&&(l.timeoutHandle=-1,K8(h)),h=l.cancelPendingCommit,h!==null&&(l.cancelPendingCommit=null,h()),ji=0,ng(),Xt=l,nt=h=mi(l.current,null),st=c,jt=0,Pr=null,fa=!1,To=_n(l,c),H0=!1,jo=Nr=F0=fl=ha=on=0,dr=bu=null,K0=!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-vt(O),w=1<<b;c|=l[b],O&=~w}return Ti=c,$f(),h}function gT(l,c){Ie=null,A.H=du,c===bo||c===Ef?(c=R5(),jt=3):c===a0?(c=R5(),jt=4):jt=c===E0?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Pr=c,nt===null&&(on=1,Gf(l,Vr(c,l.current)))}function xT(){var l=jr.current;return l===null?!0:(st&4194048)===st?Ur===null:(st&62914560)===st||(st&536870912)!==0?l===Ur:!1}function bT(){var l=A.H;return A.H=du,l===null?du:l}function yT(){var l=A.A;return A.A=P8,l}function ah(){on=4,fa||(st&4194048)!==st&&jr.current!==null||(To=!0),(ha&134217727)===0&&(fl&134217727)===0||Xt===null||Oa(Xt,st,Nr,!1)}function rg(l,c,h){var O=wt;wt|=2;var b=bT(),w=yT();(Xt!==l||st!==c)&&(sh=null,Po(l,c)),c=!1;var _=on;e:do try{if(jt!==0&&nt!==null){var M=nt,F=Pr;switch(jt){case 8:ng(),_=6;break e;case 3:case 2:case 9:case 6:jr.current===null&&(c=!0);var ae=jt;if(jt=0,Pr=null,No(l,M,F,ae),h&&To){_=0;break e}break;default:ae=jt,jt=0,Pr=null,No(l,M,F,ae)}}R8(),_=on;break}catch(de){gT(l,de)}while(!0);return c&&l.shellSuspendCounter++,gi=rl=null,wt=O,A.H=b,A.A=w,nt===null&&(Xt=null,st=0,$f()),_}function R8(){for(;nt!==null;)vT(nt)}function E8(l,c){var h=wt;wt|=2;var O=bT(),b=yT();Xt!==l||st!==c?(sh=null,rh=tt()+500,Po(l,c)):To=_n(l,c);e:do try{if(jt!==0&&nt!==null){c=nt;var w=Pr;t:switch(jt){case 1:jt=0,Pr=null,No(l,c,w,1);break;case 2:case 9:if(N5(w)){jt=0,Pr=null,wT(c);break}c=function(){jt!==2&&jt!==9||Xt!==l||(jt=7),Bs(l)},w.then(c,c);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:N5(w)?(jt=0,Pr=null,wT(c)):(jt=0,Pr=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(_?lj(_):M.stateNode.complete){jt=0,Pr=null;var F=M.sibling;if(F!==null)nt=F;else{var ae=M.return;ae!==null?(nt=ae,lh(ae)):nt=null}break t}}jt=0,Pr=null,No(l,c,w,5);break;case 6:jt=0,Pr=null,No(l,c,w,6);break;case 8:ng(),on=6;break e;default:throw Error(r(462))}}A8();break}catch(de){gT(l,de)}while(!0);return gi=rl=null,A.H=O,A.A=b,wt=h,nt!==null?0:(Xt=null,st=0,$f(),on)}function A8(){for(;nt!==null&&!yt();)vT(nt)}function vT(l){var c=B$(l.alternate,l,Ti);l.memoizedProps=l.pendingProps,c===null?lh(l):nt=c}function wT(l){var c=l,h=c.alternate;switch(c.tag){case 15:case 0:c=z$(h,c,c.pendingProps,c.type,void 0,st);break;case 11:c=z$(h,c,c.pendingProps,c.type.render,c.ref,st);break;case 5:x0(c);default:W$(h,c),c=nt=y5(c,Ti),c=B$(h,c,Ti)}l.memoizedProps=l.pendingProps,c===null?lh(l):nt=c}function No(l,c,h,O){gi=rl=null,x0(c),yo=null,ru=0;var b=c.return;try{if(S8(l,b,c,h,st)){on=1,Gf(l,Vr(h,l.current)),nt=null;return}}catch(w){if(b!==null)throw nt=b,w;on=1,Gf(l,Vr(h,l.current)),nt=null;return}c.flags&32768?(ot||O===1?l=!0:To||(st&536870912)!==0?l=!1:(fa=l=!0,(O===2||O===9||O===3||O===6)&&(O=jr.current,O!==null&&O.tag===13&&(O.flags|=16384))),ST(c,l)):lh(c)}function lh(l){var c=l;do{if((c.flags&32768)!==0){ST(c,fa);return}l=c.return;var h=$8(c.alternate,c,Ti);if(h!==null){nt=h;return}if(c=c.sibling,c!==null){nt=c;return}nt=c=l}while(c!==null);on===0&&(on=5)}function ST(l,c){do{var h=T8(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);on=6,nt=null}function QT(l,c,h,O,b,w,_,M,F){l.cancelPendingCommit=null;do oh();while(Pn!==0);if((wt&6)!==0)throw Error(r(327));if(c!==null){if(c===l.current)throw Error(r(177));if(w=c.lanes|c.childLanes,w|=BO,ci(l,h,w,_,M,F),l===Xt&&(nt=Xt=null,st=0),_o=c,ma=l,ji=h,J0=w,eg=b,hT=O,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,z8($t,function(){return _T(),null})):(l.callbackNode=null,l.callbackPriority=0),O=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||O){O=A.T,A.T=null,b=W.p,W.p=2,_=wt,wt|=4;try{j8(l,c,h)}finally{wt=_,W.p=b,A.T=O}}Pn=1,kT(),$T(),TT()}}function kT(){if(Pn===1){Pn=0;var l=ma,c=_o,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=A.T,A.T=null;var O=W.p;W.p=2;var b=wt;wt|=4;try{iT(c,l);var w=mg,_=d5(l.containerInfo),M=w.focusedElem,F=w.selectionRange;if(_!==M&&M&&M.ownerDocument&&u5(M.ownerDocument.documentElement,M)){if(F!==null&&LO(M)){var ae=F.start,de=F.end;if(de===void 0&&(de=ae),"selectionStart"in M)M.selectionStart=ae,M.selectionEnd=Math.min(de,M.value.length);else{var me=M.ownerDocument||document,le=me&&me.defaultView||window;if(le.getSelection){var oe=le.getSelection(),Ce=M.textContent.length,De=Math.min(F.start,Ce),Rt=F.end===void 0?De:Math.min(F.end,Ce);!oe.extend&&De>Rt&&(_=Rt,Rt=De,De=_);var re=c5(M,De),te=c5(M,Rt);if(re&&te&&(oe.rangeCount!==1||oe.anchorNode!==re.node||oe.anchorOffset!==re.offset||oe.focusNode!==te.node||oe.focusOffset!==te.offset)){var ie=me.createRange();ie.setStart(re.node,re.offset),oe.removeAllRanges(),De>Rt?(oe.addRange(ie),oe.extend(te.node,te.offset)):(ie.setEnd(te.node,te.offset),oe.addRange(ie))}}}}for(me=[],oe=M;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<me.length;M++){var fe=me[M];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}yh=!!pg,mg=pg=null}finally{wt=b,W.p=O,A.T=h}}l.current=c,Pn=2}}function $T(){if(Pn===2){Pn=0;var l=ma,c=_o,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=A.T,A.T=null;var O=W.p;W.p=2;var b=wt;wt|=4;try{eT(l,c.alternate,c)}finally{wt=b,W.p=O,A.T=h}}Pn=3}}function TT(){if(Pn===4||Pn===3){Pn=0,Ye();var l=ma,c=_o,h=ji,O=hT;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Pn=5:(Pn=0,_o=ma=null,jT(l,l.pendingLanes));var b=l.pendingLanes;if(b===0&&(pa=null),Sr(h),c=c.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(ut,c,void 0,(c.current.flags&128)===128)}catch{}if(O!==null){c=A.T,b=W.p,W.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,W.p=b}}(ji&3)!==0&&oh(),Bs(l),b=l.pendingLanes,(h&261930)!==0&&(b&42)!==0?l===tg?yu++:(yu=0,tg=l):yu=0,vu(0)}}function jT(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,tu(c)))}function oh(){return kT(),$T(),TT(),_T()}function _T(){if(Pn!==5)return!1;var l=ma,c=J0;J0=0;var h=Sr(ji),O=A.T,b=W.p;try{W.p=32>h?32:h,A.T=null,h=eg,eg=null;var w=ma,_=ji;if(Pn=0,_o=ma=null,ji=0,(wt&6)!==0)throw Error(r(331));var M=wt;if(wt|=4,uT(w.current),lT(w,w.current,_,h),wt=M,vu(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(ut,w)}catch{}return!0}finally{W.p=b,A.T=O,jT(l,c)}}function PT(l,c,h){c=Vr(h,c),c=R0(l.stateNode,c,2),l=oa(l,c,2),l!==null&&(fn(l,2),Bs(l))}function _t(l,c,h){if(l.tag===3)PT(l,l,h);else for(;c!==null;){if(c.tag===3){PT(c,l,h);break}else if(c.tag===1){var O=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof O.componentDidCatch=="function"&&(pa===null||!pa.has(O))){l=Vr(h,l),h=N$(2),O=oa(c,h,2),O!==null&&(C$(h,O,c,l),fn(O,2),Bs(O));break}}c=c.return}}function sg(l,c,h){var O=l.pingCache;if(O===null){O=l.pingCache=new N8;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)||(H0=!0,b.add(h),l=q8.bind(null,l,c,h),c.then(l,l))}function q8(l,c,h){var O=l.pingCache;O!==null&&O.delete(c),l.pingedLanes|=l.suspendedLanes&h,l.warmLanes&=~h,Xt===l&&(st&h)===h&&(on===4||on===3&&(st&62914560)===st&&300>tt()-nh?(wt&2)===0&&Po(l,0):F0|=h,jo===st&&(jo=0)),Bs(l)}function NT(l,c){c===0&&(c=bn()),l=el(l,c),l!==null&&(fn(l,c),Bs(l))}function M8(l){var c=l.memoizedState,h=0;c!==null&&(h=c.retryLane),NT(l,h)}function X8(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),NT(l,h)}function z8(l,c){return ct(l,c)}var ch=null,Co=null,ig=!1,uh=!1,ag=!1,ga=0;function Bs(l){l!==Co&&l.next===null&&(Co===null?ch=Co=l:Co=Co.next=l),uh=!0,ig||(ig=!0,Z8())}function vu(l,c){if(!ag&&uh){ag=!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-vt(42|l)+1)-1,w&=b&~(_&~M),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(h=!0,AT(O,w))}else w=st,w=Ft(O,O===Xt?w:0,O.cancelPendingCommit!==null||O.timeoutHandle!==-1),(w&3)===0||_n(O,w)||(h=!0,AT(O,w));O=O.next}while(h);ag=!1}}function L8(){CT()}function CT(){uh=ig=!1;var l=0;ga!==0&&F8()&&(l=ga);for(var c=tt(),h=null,O=ch;O!==null;){var b=O.next,w=RT(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}Pn!==0&&Pn!==5||vu(l),ga!==0&&(ga=0)}function RT(l,c){for(var h=l.suspendedLanes,O=l.pingedLanes,b=l.expirationTimes,w=l.pendingLanes&-62914561;0<w;){var _=31-vt(w),M=1<<_,F=b[_];F===-1?((M&h)===0||(M&O)!==0)&&(b[_]=xn(M,c)):F<=c&&(l.expiredLanes|=M),w&=~M}if(c=Xt,h=st,h=Ft(l,l===c?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),O=l.callbackNode,h===0||l===c&&(jt===2||jt===9)||l.cancelPendingCommit!==null)return O!==null&&O!==null&&at(O),l.callbackNode=null,l.callbackPriority=0;if((h&3)===0||_n(l,h)){if(c=h&-h,c===l.callbackPriority)return c;switch(O!==null&&at(O),Sr(h)){case 2:case 8:h=Zt;break;case 32:h=$t;break;case 268435456:h=dn;break;default:h=$t}return O=ET.bind(null,l),h=ct(h,O),l.callbackPriority=c,l.callbackNode=h,c}return O!==null&&O!==null&&at(O),l.callbackPriority=2,l.callbackNode=null,2}function ET(l,c){if(Pn!==0&&Pn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var h=l.callbackNode;if(oh()&&l.callbackNode!==h)return null;var O=st;return O=Ft(l,l===Xt?O:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),O===0?null:(mT(l,O,c),RT(l,tt()),l.callbackNode!=null&&l.callbackNode===h?ET.bind(null,l):null)}function AT(l,c){if(oh())return null;mT(l,c,!0)}function Z8(){J8(function(){(wt&6)!==0?ct(kt,L8):CT()})}function lg(){if(ga===0){var l=go;l===0&&(l=Qe,Qe<<=1,(Qe&261888)===0&&(Qe=256)),ga=l}return ga}function qT(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:xf(""+l)}function MT(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 V8(l,c,h,O,b){if(c==="submit"&&h&&h.stateNode===b){var w=qT((b[ze]||null).action),_=O.submitter;_&&(c=(c=_[ze]||null)?qT(c.formAction):_.getAttribute("formAction"),c!==null&&(w=c,_=null));var M=new wf("action","action",null,O,b);l.push({event:M,listeners:[{instance:null,listener:function(){if(O.defaultPrevented){if(ga!==0){var F=_?MT(b,_):new FormData(b);T0(h,{pending:!0,data:F,method:b.method,action:w},null,F)}}else typeof w=="function"&&(M.preventDefault(),F=_?MT(b,_):new FormData(b),T0(h,{pending:!0,data:F,method:b.method,action:w},w,F))},currentTarget:b}]})}}for(var og=0;og<DO.length;og++){var cg=DO[og],Y8=cg.toLowerCase(),D8=cg[0].toUpperCase()+cg.slice(1);vs(Y8,"on"+D8)}vs(p5,"onAnimationEnd"),vs(m5,"onAnimationIteration"),vs(O5,"onAnimationStart"),vs("dblclick","onDoubleClick"),vs("focusin","onFocus"),vs("focusout","onBlur"),vs(a8,"onTransitionRun"),vs(l8,"onTransitionStart"),vs(o8,"onTransitionCancel"),vs(g5,"onTransitionEnd"),bs("onMouseEnter",["mouseout","mouseover"]),bs("onMouseLeave",["mouseout","mouseover"]),bs("onPointerEnter",["pointerout","pointerover"]),bs("onPointerLeave",["pointerout","pointerover"]),xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xs("onBeforeInput",["compositionend","keypress","textInput","paste"]),xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xs("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(" "),B8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wu));function XT(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,ae=M.currentTarget;if(M=M.listener,F!==w&&b.isPropagationStopped())break e;w=M,b.currentTarget=ae;try{w(b)}catch(de){kf(de)}b.currentTarget=null,w=F}else for(_=0;_<O.length;_++){if(M=O[_],F=M.instance,ae=M.currentTarget,M=M.listener,F!==w&&b.isPropagationStopped())break e;w=M,b.currentTarget=ae;try{w(b)}catch(de){kf(de)}b.currentTarget=null,w=F}}}}function rt(l,c){var h=c[vn];h===void 0&&(h=c[vn]=new Set);var O=l+"__bubble";h.has(O)||(zT(c,l,2,!1),h.add(O))}function ug(l,c,h){var O=0;c&&(O|=4),zT(h,l,O,c)}var dh="_reactListening"+Math.random().toString(36).slice(2);function dg(l){if(!l[dh]){l[dh]=!0,Kl.forEach(function(h){h!=="selectionchange"&&(B8.has(h)||ug(h,!1,l),ug(h,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[dh]||(c[dh]=!0,ug("selectionchange",!1,c))}}function zT(l,c,h,O){switch(pj(c)){case 2:var b=b9;break;case 8:b=y9;break;default:b=$g}h=b.bind(null,c,h,l),b=void 0,!NO||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(_=Os(M),_===null)return;if(F=_.tag,F===5||F===6||F===26||F===27){O=w=_;continue e}M=M.parentNode}}O=O.return}Dk(function(){var ae=w,de=_O(h),me=[];e:{var le=x5.get(l);if(le!==void 0){var oe=wf,Ce=l;switch(l){case"keypress":if(yf(h)===0)break e;case"keydown":case"keyup":oe=X6;break;case"focusin":Ce="focus",oe=AO;break;case"focusout":Ce="blur",oe=AO;break;case"beforeblur":case"afterblur":oe=AO;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":oe=Wk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=$6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Z6;break;case p5:case m5:case O5:oe=_6;break;case g5:oe=Y6;break;case"scroll":case"scrollend":oe=Q6;break;case"wheel":oe=B6;break;case"copy":case"cut":case"paste":oe=N6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Ik;break;case"toggle":case"beforetoggle":oe=W6}var De=(c&4)!==0,Rt=!De&&(l==="scroll"||l==="scrollend"),re=De?le!==null?le+"Capture":null:le;De=[];for(var te=ae,ie;te!==null;){var fe=te;if(ie=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ie===null||re===null||(fe=Dc(te,re),fe!=null&&De.push(Su(te,fe,ie))),Rt)break;te=te.return}0<De.length&&(le=new oe(le,Ce,null,h,de),me.push({event:le,listeners:De}))}}if((c&7)===0){e:{if(le=l==="mouseover"||l==="pointerover",oe=l==="mouseout"||l==="pointerout",le&&h!==jO&&(Ce=h.relatedTarget||h.fromElement)&&(Os(Ce)||Ce[Mt]))break e;if((oe||le)&&(le=de.window===de?de:(le=de.ownerDocument)?le.defaultView||le.parentWindow:window,oe?(Ce=h.relatedTarget||h.toElement,oe=ae,Ce=Ce?Os(Ce):null,Ce!==null&&(Rt=i(Ce),De=Ce.tag,Ce!==Rt||De!==5&&De!==27&&De!==6)&&(Ce=null)):(oe=null,Ce=ae),oe!==Ce)){if(De=Wk,fe="onMouseLeave",re="onMouseEnter",te="mouse",(l==="pointerout"||l==="pointerover")&&(De=Ik,fe="onPointerLeave",re="onPointerEnter",te="pointer"),Rt=oe==null?le:Ls(oe),ie=Ce==null?le:Ls(Ce),le=new De(fe,te+"leave",oe,h,de),le.target=Rt,le.relatedTarget=ie,fe=null,Os(de)===ae&&(De=new De(re,te+"enter",Ce,h,de),De.target=ie,De.relatedTarget=Rt,fe=De),Rt=fe,oe&&Ce)t:{for(De=U8,re=oe,te=Ce,ie=0,fe=re;fe;fe=De(fe))ie++;fe=0;for(var Ze=te;Ze;Ze=De(Ze))fe++;for(;0<ie-fe;)re=De(re),ie--;for(;0<fe-ie;)te=De(te),fe--;for(;ie--;){if(re===te||te!==null&&re===te.alternate){De=re;break t}re=De(re),te=De(te)}De=null}else De=null;oe!==null&<(me,le,oe,De,!1),Ce!==null&&Rt!==null&<(me,Rt,Ce,De,!0)}}e:{if(le=ae?Ls(ae):window,oe=le.nodeName&&le.nodeName.toLowerCase(),oe==="select"||oe==="input"&&le.type==="file")var Ot=r5;else if(t5(le))if(s5)Ot=r8;else{Ot=t8;var Ee=e8}else oe=le.nodeName,!oe||oe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&Yc(ae.elementType)&&(Ot=r5):Ot=n8;if(Ot&&(Ot=Ot(l,ae))){n5(me,Ot,h,de);break e}Ee&&Ee(l,le,ae),l==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&kr(le,"number",le.value)}switch(Ee=ae?Ls(ae):window,l){case"focusin":(t5(Ee)||Ee.contentEditable==="true")&&(oo=Ee,ZO=ae,Kc=null);break;case"focusout":Kc=ZO=oo=null;break;case"mousedown":VO=!0;break;case"contextmenu":case"mouseup":case"dragend":VO=!1,f5(me,h,de);break;case"selectionchange":if(i8)break;case"keydown":case"keyup":f5(me,h,de)}var He;if(MO)e:{switch(l){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else lo?Jk(l,h)&&(it="onCompositionEnd"):l==="keydown"&&h.keyCode===229&&(it="onCompositionStart");it&&(Hk&&h.locale!=="ko"&&(lo||it!=="onCompositionStart"?it==="onCompositionEnd"&&lo&&(He=Bk()):(ta=de,CO="value"in ta?ta.value:ta.textContent,lo=!0)),Ee=fh(ae,it),0<Ee.length&&(it=new Gk(it,l,null,h,de),me.push({event:it,listeners:Ee}),He?it.data=He:(He=e5(h),He!==null&&(it.data=He)))),(He=I6?H6(l,h):F6(l,h))&&(it=fh(ae,"onBeforeInput"),0<it.length&&(Ee=new Gk("onBeforeInput","beforeinput",null,h,de),me.push({event:Ee,listeners:it}),Ee.data=He)),V8(me,l,ae,h,de)}XT(me,c)})}function Su(l,c,h){return{instance:l,listener:c,currentTarget:h}}function fh(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 U8(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function LT(l,c,h,O,b){for(var w=c._reactName,_=[];h!==null&&h!==O;){var M=h,F=M.alternate,ae=M.stateNode;if(M=M.tag,F!==null&&F===O)break;M!==5&&M!==26&&M!==27||ae===null||(F=ae,b?(ae=Dc(h,w),ae!=null&&_.unshift(Su(h,ae,F))):b||(ae=Dc(h,w),ae!=null&&_.push(Su(h,ae,F)))),h=h.return}_.length!==0&&l.push({event:c,listeners:_})}var W8=/\r\n?/g,G8=/\u0000|\uFFFD/g;function ZT(l){return(typeof l=="string"?l:""+l).replace(W8,`
|
|
49
|
+
`).replace(G8,"")}function VT(l,c){return c=ZT(c),ZT(l)===c}function Ct(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":gf(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=xf(""+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"&&Ct(l,c,"name",b.name,b,null),Ct(l,c,"formEncType",b.formEncType,b,null),Ct(l,c,"formMethod",b.formMethod,b,null),Ct(l,c,"formTarget",b.formTarget,b,null)):(Ct(l,c,"encType",b.encType,b,null),Ct(l,c,"method",b.method,b,null),Ct(l,c,"target",b.target,b,null)));if(O==null||typeof O=="symbol"||typeof O=="boolean"){l.removeAttribute(h);break}O=xf(""+O),l.setAttribute(h,O);break;case"onClick":O!=null&&(l.onclick=hi);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=xf(""+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":ys(l,"http://www.w3.org/1999/xlink","xlink:actuate",O);break;case"xlinkArcrole":ys(l,"http://www.w3.org/1999/xlink","xlink:arcrole",O);break;case"xlinkRole":ys(l,"http://www.w3.org/1999/xlink","xlink:role",O);break;case"xlinkShow":ys(l,"http://www.w3.org/1999/xlink","xlink:show",O);break;case"xlinkTitle":ys(l,"http://www.w3.org/1999/xlink","xlink:title",O);break;case"xlinkType":ys(l,"http://www.w3.org/1999/xlink","xlink:type",O);break;case"xmlBase":ys(l,"http://www.w3.org/XML/1998/namespace","xml:base",O);break;case"xmlLang":ys(l,"http://www.w3.org/XML/1998/namespace","xml:lang",O);break;case"xmlSpace":ys(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=TO.get(h)||h,no(l,h,O))}}function hg(l,c,h,O,b,w){switch(h){case"style":gf(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=hi);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[ze]||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 Zn(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:Ct(l,c,w,_,h,null)}}b&&Ct(l,c,"srcSet",h.srcSet,h,null),O&&Ct(l,c,"src",h.src,h,null);return;case"input":rt("invalid",l);var M=w=_=b=null,F=null,ae=null;for(O in h)if(h.hasOwnProperty(O)){var de=h[O];if(de!=null)switch(O){case"name":b=de;break;case"type":_=de;break;case"checked":F=de;break;case"defaultChecked":ae=de;break;case"value":w=de;break;case"defaultValue":M=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,c));break;default:Ct(l,c,O,de,h,null)}}Qr(l,w,M,F,ae,_,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:Ct(l,c,b,M,h,null)}c=w,h=_,l.multiple=!!O,c!=null?ar(l,!!O,c,!1):h!=null&&ar(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:Ct(l,c,_,M,h,null)}mf(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:Ct(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(ae in h)if(h.hasOwnProperty(ae)&&(O=h[ae],O!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Ct(l,c,ae,O,h,null)}return;default:if(Yc(c)){for(de in h)h.hasOwnProperty(de)&&(O=h[de],O!==void 0&&hg(l,c,de,O,h,void 0));return}}for(M in h)h.hasOwnProperty(M)&&(O=h[M],O!=null&&Ct(l,c,M,O,h,null))}function I8(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,ae=null,de=null;for(oe in h){var me=h[oe];if(h.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":F=me;default:O.hasOwnProperty(oe)||Ct(l,c,oe,null,O,me)}}for(var le in O){var oe=O[le];if(me=h[le],O.hasOwnProperty(le)&&(oe!=null||me!=null))switch(le){case"type":w=oe;break;case"name":b=oe;break;case"checked":ae=oe;break;case"defaultChecked":de=oe;break;case"value":_=oe;break;case"defaultValue":M=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,c));break;default:oe!==me&&Ct(l,c,le,oe,O,me)}}Wn(l,_,M,F,ae,de,w,b);return;case"select":oe=_=M=le=null;for(w in h)if(F=h[w],h.hasOwnProperty(w)&&F!=null)switch(w){case"value":break;case"multiple":oe=F;default:O.hasOwnProperty(w)||Ct(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":le=w;break;case"defaultValue":M=w;break;case"multiple":_=w;default:w!==F&&Ct(l,c,b,w,O,F)}c=M,h=_,O=oe,le!=null?ar(l,!!h,le,!1):!!O!=!!h&&(c!=null?ar(l,!!h,c,!0):ar(l,!!h,h?[]:"",!1));return;case"textarea":oe=le=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:Ct(l,c,M,null,O,b)}for(_ in O)if(b=O[_],w=h[_],O.hasOwnProperty(_)&&(b!=null||w!=null))switch(_){case"value":le=b;break;case"defaultValue":oe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&Ct(l,c,_,b,O,w)}pf(l,le,oe);return;case"option":for(var Ce in h)if(le=h[Ce],h.hasOwnProperty(Ce)&&le!=null&&!O.hasOwnProperty(Ce))switch(Ce){case"selected":l.selected=!1;break;default:Ct(l,c,Ce,null,O,le)}for(F in O)if(le=O[F],oe=h[F],O.hasOwnProperty(F)&&le!==oe&&(le!=null||oe!=null))switch(F){case"selected":l.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:Ct(l,c,F,le,O,oe)}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 De in h)le=h[De],h.hasOwnProperty(De)&&le!=null&&!O.hasOwnProperty(De)&&Ct(l,c,De,null,O,le);for(ae in O)if(le=O[ae],oe=h[ae],O.hasOwnProperty(ae)&&le!==oe&&(le!=null||oe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:Ct(l,c,ae,le,O,oe)}return;default:if(Yc(c)){for(var Rt in h)le=h[Rt],h.hasOwnProperty(Rt)&&le!==void 0&&!O.hasOwnProperty(Rt)&&hg(l,c,Rt,void 0,O,le);for(de in O)le=O[de],oe=h[de],!O.hasOwnProperty(de)||le===oe||le===void 0&&oe===void 0||hg(l,c,de,le,O,oe);return}}for(var re in h)le=h[re],h.hasOwnProperty(re)&&le!=null&&!O.hasOwnProperty(re)&&Ct(l,c,re,null,O,le);for(me in O)le=O[me],oe=h[me],!O.hasOwnProperty(me)||le===oe||le==null&&oe==null||Ct(l,c,me,le,O,oe)}function YT(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function H8(){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&&YT(_)){for(_=0,M=b.responseEnd,O+=1;O<h.length;O++){var F=h[O],ae=F.startTime;if(ae>M)break;var de=F.transferSize,me=F.initiatorType;de&&YT(me)&&(F=F.responseEnd,_+=de*(F<M?1:(M-ae)/(F-ae)))}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 pg=null,mg=null;function hh(l){return l.nodeType===9?l:l.ownerDocument}function DT(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 BT(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 Og(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 gg=null;function F8(){var l=window.event;return l&&l.type==="popstate"?l===gg?!1:(gg=l,!0):(gg=null,!1)}var UT=typeof setTimeout=="function"?setTimeout:void 0,K8=typeof clearTimeout=="function"?clearTimeout:void 0,WT=typeof Promise=="function"?Promise:void 0,J8=typeof queueMicrotask=="function"?queueMicrotask:typeof WT<"u"?function(l){return WT.resolve(null).then(l).catch(e9)}:UT;function e9(l){setTimeout(function(){throw l})}function xa(l){return l==="head"}function GT(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[di]||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 IT(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 xg(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":xg(h),Ha(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}l.removeChild(h)}}function t9(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[di])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=Wr(l.nextSibling),l===null)break}return null}function n9(l,c,h){if(c==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!h||(l=Wr(l.nextSibling),l===null))return null;return l}function HT(l,c){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!c||(l=Wr(l.nextSibling),l===null))return null;return l}function bg(l){return l.data==="$?"||l.data==="$~"}function yg(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function r9(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 Wr(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 vg=null;function FT(l){l=l.nextSibling;for(var c=0;l;){if(l.nodeType===8){var h=l.data;if(h==="/$"||h==="/&"){if(c===0)return Wr(l.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}l=l.nextSibling}return null}function KT(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 JT(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 Gr=new Map,ej=new Set;function ph(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var _i=W.d;W.d={f:s9,r:i9,D:a9,C:l9,L:o9,m:c9,X:d9,S:u9,M:f9};function s9(){var l=_i.f(),c=ih();return l||c}function i9(l){var c=gs(l);c!==null&&c.tag===5&&c.type==="form"?g$(c):_i.r(l)}var Ro=typeof document>"u"?null:document;function tj(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+'"]'),ej.has(b)||(ej.add(b),l={rel:l,crossOrigin:h,href:c},O.querySelector(b)===null&&(c=O.createElement("link"),Zn(c,"link",l),an(c),O.head.appendChild(c)))}}function a9(l){_i.D(l),tj("dns-prefetch",l,null)}function l9(l,c){_i.C(l,c),tj("preconnect",l,c)}function o9(l,c,h){_i.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)}Gr.has(w)||(l=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:l,as:c},h),Gr.set(w,l),O.querySelector(b)!==null||c==="style"&&O.querySelector(ku(w))||c==="script"&&O.querySelector($u(w))||(c=O.createElement("link"),Zn(c,"link",l),an(c),O.head.appendChild(c)))}}function c9(l,c){_i.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(!Gr.has(w)&&(l=m({rel:"modulepreload",href:l},c),Gr.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"),Zn(O,"link",l),an(O),h.head.appendChild(O)}}}function u9(l,c,h){_i.S(l,c,h);var O=Ro;if(O&&l){var b=Zs(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=Gr.get(w))&&wg(l,h);var F=_=O.createElement("link");an(F),Zn(F,"link",l),F._p=new Promise(function(ae,de){F.onload=ae,F.onerror=de}),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 d9(l,c){_i.X(l,c);var h=Ro;if(h&&l){var O=Zs(h).hoistableScripts,b=Ao(l),w=O.get(b);w||(w=h.querySelector($u(b)),w||(l=m({src:l,async:!0},c),(c=Gr.get(b))&&Sg(l,c),w=h.createElement("script"),an(w),Zn(w,"link",l),h.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},O.set(b,w))}}function f9(l,c){_i.M(l,c);var h=Ro;if(h&&l){var O=Zs(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=Gr.get(b))&&Sg(l,c),w=h.createElement("script"),an(w),Zn(w,"link",l),h.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},O.set(b,w))}}function nj(l,c,h,O){var b=(b=J.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=Zs(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=Zs(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),Gr.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},Gr.set(l,h),w||h9(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=Zs(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 rj(l){return m({},l,{"data-precedence":l.precedence,precedence:null})}function h9(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}),Zn(c,"link",h),an(c),l.head.appendChild(c))}function Ao(l){return'[src="'+mt(l)+'"]'}function $u(l){return"script[async]"+l}function sj(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,an(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"),an(O),Zn(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,an(w),w;O=rj(h),(b=Gr.get(b))&&wg(O,b),w=(l.ownerDocument||l).createElement("link"),an(w);var _=w;return _._p=new Promise(function(M,F){_.onload=M,_.onerror=F}),Zn(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,an(b),b):(O=h,(b=Gr.get(w))&&(O=m({},h),Sg(O,b)),l=l.ownerDocument||l,b=l.createElement("script"),an(b),Zn(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 wg(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.title==null&&(l.title=c.title)}function Sg(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 ij(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[di]||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 aj(l,c,h){l=l.ownerDocument||l,l.head.insertBefore(h,c==="title"?l.querySelector("head > title"):null)}function p9(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 lj(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function m9(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,an(w);return}w=c.ownerDocument||c,O=rj(O),(b=Gr.get(b))&&wg(O,b),w=w.createElement("link"),an(w);var _=w;_._p=new Promise(function(M,F){_.onload=M,_.onerror=F}),Zn(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 Qg=0;function O9(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&&Qg===0&&(Qg=62500*H8());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>Qg?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(g9,l),xh=null,gh.call(l))}function g9(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 x9(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=yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yn(0),this.hiddenUpdates=yn(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 oj(l,c,h,O,b,w,_,M,F,ae,de,me){return l=new x9(l,c,h,_,F,ae,de,me,M),c=1,w===!0&&(c|=24),w=Tr(3,null,null,c),l.current=w,w.stateNode=l,c=r0(),c.refCount++,l.pooledCache=c,c.refCount++,w.memoizedState={element:O,isDehydrated:h,cache:c},l0(w),l}function cj(l){return l?(l=fo,l):fo}function uj(l,c,h,O,b,w){b=cj(b),O.context===null?O.context=b:O.pendingContext=b,O=la(c),O.payload={element:h},w=w===void 0?null:w,w!==null&&(O.callback=w),h=oa(l,O,c),h!==null&&(fr(h,l,c),iu(h,l,c))}function dj(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var h=l.retryLane;l.retryLane=h!==0&&h<c?h:c}}function kg(l,c){dj(l,c),(l=l.alternate)&&dj(l,c)}function fj(l){if(l.tag===13||l.tag===31){var c=el(l,67108864);c!==null&&fr(c,l,67108864),kg(l,67108864)}}function hj(l){if(l.tag===13||l.tag===31){var c=Cr();c=zs(c);var h=el(l,c);h!==null&&fr(h,l,c),kg(l,c)}}var yh=!0;function b9(l,c,h,O){var b=A.T;A.T=null;var w=W.p;try{W.p=2,$g(l,c,h,O)}finally{W.p=w,A.T=b}}function y9(l,c,h,O){var b=A.T;A.T=null;var w=W.p;try{W.p=8,$g(l,c,h,O)}finally{W.p=w,A.T=b}}function $g(l,c,h,O){if(yh){var b=Tg(O);if(b===null)fg(l,c,O,vh,h),mj(l,O);else if(w9(b,l,c,h,O))O.stopPropagation();else if(mj(l,O),c&4&&-1<v9.indexOf(l)){for(;b!==null;){var w=gs(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var _=Tt(w.pendingLanes);if(_!==0){var M=w;for(M.pendingLanes|=2,M.entangledLanes|=2;_;){var F=1<<31-vt(_);M.entanglements[1]|=F,_&=~F}Bs(w),(wt&6)===0&&(rh=tt()+500,vu(0))}}break;case 31:case 13:M=el(w,2),M!==null&&fr(M,w,2),ih(),kg(w,2)}if(w=Tg(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 Tg(l){return l=_O(l),jg(l)}var vh=null;function jg(l){if(vh=null,l=Os(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 pj(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(gn()){case kt:return 2;case Zt:return 8;case $t:case rn:return 32;case dn:return 268435456;default:return 32}default:return 32}}var _g=!1,ba=null,ya=null,va=null,ju=new Map,_u=new Map,wa=[],v9="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 mj(l,c){switch(l){case"focusin":case"focusout":ba=null;break;case"dragenter":case"dragleave":ya=null;break;case"mouseover":case"mouseout":va=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=gs(c),c!==null&&fj(c)),l):(l.eventSystemFlags|=O,c=l.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),l)}function w9(l,c,h,O,b){switch(c){case"focusin":return ba=Pu(ba,l,c,h,O,b),!0;case"dragenter":return ya=Pu(ya,l,c,h,O,b),!0;case"mouseover":return va=Pu(va,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 Oj(l){var c=Os(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,ms(l.priority,function(){hj(h)});return}}else if(c===31){if(c=o(h),c!==null){l.blockedOn=c,ms(l.priority,function(){hj(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=Tg(l.nativeEvent);if(h===null){h=l.nativeEvent;var O=new h.constructor(h.type,h);jO=O,h.target.dispatchEvent(O),jO=null}else return c=gs(h),c!==null&&fj(c),l.blockedOn=h,!1;c.shift()}return!0}function gj(l,c,h){wh(l)&&h.delete(c)}function S9(){_g=!1,ba!==null&&wh(ba)&&(ba=null),ya!==null&&wh(ya)&&(ya=null),va!==null&&wh(va)&&(va=null),ju.forEach(gj),_u.forEach(gj)}function Sh(l,c){l.blockedOn===c&&(l.blockedOn=null,_g||(_g=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,S9)))}var Qh=null;function xj(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(jg(O||h)===null)continue;break}var w=gs(h);w!==null&&(l.splice(c,3),c-=3,T0(w,{pending:!0,data:b,method:h.method,action:O},O,b))}}))}function qo(l){function c(F){return Sh(F,l)}ba!==null&&Sh(ba,l),ya!==null&&Sh(ya,l),va!==null&&Sh(va,l),ju.forEach(c),_u.forEach(c);for(var h=0;h<wa.length;h++){var O=wa[h];O.blockedOn===l&&(O.blockedOn=null)}for(;0<wa.length&&(h=wa[0],h.blockedOn===null);)Oj(h),h.blockedOn===null&&wa.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[ze]||null;if(typeof w=="function")_||xj(h);else if(_){var M=null;if(w&&w.hasAttribute("formAction")){if(b=w,_=w[ze]||null)M=_.formAction;else if(jg(b)!==null)continue}else M=_.action;typeof M=="function"?h[O+1]=M:(h.splice(O,3),O-=3),xj(h)}}}function bj(){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 Pg(l){this._internalRoot=l}kh.prototype.render=Pg.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,O=Cr();uj(h,O,l,c,null,null)},kh.prototype.unmount=Pg.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;uj(l.current,2,null,l,null,null),ih(),c[Mt]=null}};function kh(l){this._internalRoot=l}kh.prototype.unstable_scheduleHydration=function(l){if(l){var c=ps();l={blockedOn:null,target:l,priority:c};for(var h=0;h<wa.length&&c!==0&&c<wa[h].priority;h++);wa.splice(h,0,l),h===0&&Oj(l)}};var yj=e.version;if(yj!=="19.2.3")throw Error(r(527,yj,"19.2.3"));W.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=f(c),l=l!==null?p(l):null,l=l===null?null:l.stateNode,l};var Q9={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{ut=$h.inject(Q9),lt=$h}catch{}}return Cu.createRoot=function(l,c){if(!s(l))throw Error(r(299));var h=!1,O="",b=T$,w=j$,_=_$;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=oj(l,1,!1,null,null,h,O,null,b,w,_,bj),l[Mt]=c.current,dg(l),new Pg(c)},Cu.hydrateRoot=function(l,c,h){if(!s(l))throw Error(r(299));var O=!1,b="",w=T$,_=j$,M=_$,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=oj(l,1,!0,c,h??null,O,b,F,w,_,M,bj),c.context=cj(null),h=c.current,O=Cr(),O=zs(O),b=la(O),b.callback=null,oa(h,b,O),h=O,c.current.lanes=h,fn(c,h),Bs(c),l[Mt]=c.current,dg(l),new kh(c)},Cu.version="19.2.3",Cu}var Pj;function A9(){if(Pj)return Rg.exports;Pj=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(),Rg.exports=E9(),Rg.exports}var q9=A9();const M9=$m(q9);var Ve=(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))(Ve||{});const cn={strength:1,temperature:0,time:.25,verbose:!1,quiet:!1,force:!1,local:!1,reviewExamples:!1},hr=[{name:"strength",cliFlag:"--strength",type:"range",placeholder:"1",description:"Model strength: <0.5 = cheaper models, 0.5 = base, >0.5 = stronger models",defaultValue:cn.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:cn.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:cn.time,min:0,max:1,step:.05},{name:"verbose",cliFlag:"--verbose",type:"checkbox",placeholder:"",description:"Increase output verbosity for debugging",defaultValue:cn.verbose},{name:"quiet",cliFlag:"--quiet",type:"checkbox",placeholder:"",description:"Decrease output verbosity",defaultValue:cn.quiet},{name:"force",cliFlag:"--force",type:"checkbox",placeholder:"",description:"Skip interactive prompts (useful for automation)",defaultValue:cn.force},{name:"local",cliFlag:"--local",type:"checkbox",placeholder:"",description:"Run commands locally instead of in the cloud",defaultValue:cn.local},{name:"review-examples",cliFlag:"--review-examples",type:"checkbox",placeholder:"",description:"Review and optionally exclude few-shot examples before execution",defaultValue:cn.reviewExamples}],Ea={[Ve.SYNC]:{name:Ve.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"}]},[Ve.UPDATE]:{name:Ve.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"}]},[Ve.GENERATE]:{name:Ve.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"}]},[Ve.TEST]:{name:Ve.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 %"}]},[Ve.EXAMPLE]:{name:Ve.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"}]},[Ve.FIX]:{name:Ve.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"}]},[Ve.BUG]:{name:Ve.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"}]},[Ve.CRASH]:{name:Ve.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}]},[Ve.VERIFY]:{name:Ve.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}]},[Ve.SUBMIT_EXAMPLE]:{name:Ve.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}]},[Ve.SPLIT]:{name:Ve.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"}]},[Ve.CHANGE]:{name:Ve.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"}]},[Ve.DETECT]:{name:Ve.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"}]},[Ve.AUTO_DEPS]:{name:Ve.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"}]},[Ve.CONFLICTS]:{name:Ve.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"}]},[Ve.PREPROCESS]:{name:Ve.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"}]}},X9=[{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 z9(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 L9(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 Z9(n,e,t,r,s){const i={};switch(n){case Ve.SYNC:i.basename=e.sync_basename,e.context&&(s.context=e.context);break;case Ve.UPDATE:t?i.args=[t]:i.args=[];break;case Ve.GENERATE:i.prompt_file=e.prompt;break;case Ve.TEST:i.prompt_file=e.prompt,i.code_file=t;break;case Ve.EXAMPLE:i.prompt_file=e.prompt,i.code_file=t;break;case Ve.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 Ve.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 Ve.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 Ve.DETECT:{const a=s["prompt-files"]||"",o=s["change-file"]||"",u=a.split(",").map(f=>f.trim()).filter(Boolean);i.args=[...u,o].filter(Boolean),delete s["prompt-files"],delete s["change-file"]}break;case Ve.AUTO_DEPS:i.prompt_file=e.prompt,s["directory-path"]&&(i.directory_path=s["directory-path"],delete s["directory-path"]);break;case Ve.CONFLICTS:i.prompt_file=e.prompt,s.prompt2&&(i.prompt2=s.prompt2,delete s.prompt2);break;case Ve.PREPROCESS:i.prompt_file=e.prompt;break;case Ve.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 Ve.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 Ve.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 Ve.BUG:s.args&&(i.args=s.args,delete s.args);break}return i}function Y2(n,e,t){const r=Ea[n],s=n===Ve.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 Nj(n,e,t={}){const{options:r,codeFile:s,testFile:i}=L9(t,e),a=Z9(n,e,s,i,r),o=Y2(n,e,r),u=Ea[n];return{args:a,options:r,displayCommand:o,backendName:u.backendName}}const D2=Symbol.for("yaml.alias"),bS=Symbol.for("yaml.document"),Aa=Symbol.for("yaml.map"),nq=Symbol.for("yaml.pair"),ii=Symbol.for("yaml.scalar"),$c=Symbol.for("yaml.seq"),is=Symbol.for("yaml.node.type"),Ua=n=>!!n&&typeof n=="object"&&n[is]===D2,Zl=n=>!!n&&typeof n=="object"&&n[is]===bS,Tc=n=>!!n&&typeof n=="object"&&n[is]===Aa,It=n=>!!n&&typeof n=="object"&&n[is]===nq,Lt=n=>!!n&&typeof n=="object"&&n[is]===ii,jc=n=>!!n&&typeof n=="object"&&n[is]===$c;function Jt(n){if(n&&typeof n=="object")switch(n[is]){case Aa:case $c:return!0}return!1}function tn(n){if(n&&typeof n=="object")switch(n[is]){case D2:case Aa:case ii:case $c:return!0}return!1}const rq=n=>(Lt(n)||Jt(n))&&!!n.anchor,pr=Symbol("break visit"),sq=Symbol("skip children"),ti=Symbol("remove node");function Vl(n,e){const t=iq(e);Zl(n)?Do(null,n.contents,t,Object.freeze([n]))===ti&&(n.contents=null):Do(null,n,t,Object.freeze([]))}Vl.BREAK=pr;Vl.SKIP=sq;Vl.REMOVE=ti;function Do(n,e,t,r){const s=aq(n,e,t,r);if(tn(s)||It(s))return lq(n,r,s),Do(n,s,t,r);if(typeof s!="symbol"){if(Jt(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===pr)return pr;a===ti&&(e.items.splice(i,1),i-=1)}}}else if(It(e)){r=Object.freeze(r.concat(e));const i=Do("key",e.key,t,r);if(i===pr)return pr;i===ti&&(e.key=null);const a=Do("value",e.value,t,r);if(a===pr)return pr;a===ti&&(e.value=null)}}return s}async function Tm(n,e){const t=iq(e);Zl(n)?await Bo(null,n.contents,t,Object.freeze([n]))===ti&&(n.contents=null):await Bo(null,n,t,Object.freeze([]))}Tm.BREAK=pr;Tm.SKIP=sq;Tm.REMOVE=ti;async function Bo(n,e,t,r){const s=await aq(n,e,t,r);if(tn(s)||It(s))return lq(n,r,s),Bo(n,s,t,r);if(typeof s!="symbol"){if(Jt(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===pr)return pr;a===ti&&(e.items.splice(i,1),i-=1)}}}else if(It(e)){r=Object.freeze(r.concat(e));const i=await Bo("key",e.key,t,r);if(i===pr)return pr;i===ti&&(e.key=null);const a=await Bo("value",e.value,t,r);if(a===pr)return pr;a===ti&&(e.value=null)}}return s}function iq(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 aq(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(It(e))return(a=t.Pair)==null?void 0:a.call(t,n,e,r);if(Lt(e))return(o=t.Scalar)==null?void 0:o.call(t,n,e,r);if(Ua(e))return(u=t.Alias)==null?void 0:u.call(t,n,e,r)}function lq(n,e,t){const r=e[e.length-1];if(Jt(r))r.items[n]=t;else if(It(r))n==="key"?r.key=t:r.value=t;else if(Zl(r))r.contents=t;else{const s=Ua(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const V9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Y9=n=>n.replace(/[!,[\]{}]/g,e=>V9[e]);class Jn{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Jn.defaultYaml,e),this.tags=Object.assign({},Jn.defaultTags,t)}clone(){const e=new Jn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Jn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Jn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Jn.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Jn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Jn.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+Y9(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&&tn(e.contents)){const i={};Vl(e.contents,(a,o)=>{tn(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
|
+
`)}}Jn.defaultYaml={explicit:!1,version:"1.2"};Jn.defaultTags={"!!":"tag:yaml.org,2002:"};function oq(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 cq(n){const e=new Set;return Vl(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function uq(n,e){for(let t=1;;++t){const r=`${n}${t}`;if(!e.has(r))return r}}function D9(n,e){const t=[],r=new Map;let s=null;return{onAnchor:i=>{t.push(i),s??(s=cq(n));const a=uq(e,s);return s.add(a),a},setAnchors:()=>{for(const i of t){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(Lt(a.node)||Jt(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 rs(n,e,t){if(Array.isArray(n))return n.map((r,s)=>rs(r,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!rq(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 B2{constructor(e){Object.defineProperty(this,is,{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=rs(this,"",a);if(typeof s=="function")for(const{count:u,res:f}of a.anchors.values())s(f,u);return typeof i=="function"?Uo(i,{"":o},"",o):o}}class jm extends B2{constructor(e){super(D2),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)=>{(Ua(a)||rq(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||(rs(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=pp(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(oq(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 pp(n,e,t){if(Ua(e)){const r=e.resolve(n),s=t&&r&&t.get(r);return s?s.count*s.aliasCount:0}else if(Jt(e)){let r=0;for(const s of e.items){const i=pp(n,s,t);i>r&&(r=i)}return r}else if(It(e)){const r=pp(n,e.key,t),s=pp(n,e.value,t);return Math.max(r,s)}return 1}const dq=n=>!n||typeof n!="function"&&typeof n!="object";class Ge extends B2{constructor(e){super(ii),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:rs(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 B9="tag:yaml.org,2002:";function U9(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 gd(n,e,t){var m,g,x;if(Zl(n)&&(n=n.contents),tn(n))return n;if(It(n)){const v=(g=(m=t.schema[Aa]).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 jm(u.anchor);u={anchor:null,node:null},o.set(n,u)}e!=null&&e.startsWith("!!")&&(e=B9+e.slice(2));let f=U9(n,e,a.tags);if(!f){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const v=new Ge(n);return u&&(u.node=v),v}f=n instanceof Map?a[Aa]:Symbol.iterator in Object(n)?a[$c]:a[Aa]}i&&(i(f),delete t.onTagObj);const p=f!=null&&f.createNode?f.createNode(t.schema,n,t):typeof((x=f==null?void 0:f.nodeClass)==null?void 0:x.from)=="function"?f.nodeClass.from(t.schema,n,t):new Ge(n);return e?p.tag=e:f.default||(p.tag=f.tag),u&&(u.node=p),p}function qp(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 gd(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 fq extends B2{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=>tn(r)||It(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(Jt(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(r,qp(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(Jt(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&&Lt(i)?i.value:i:Jt(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!It(t))return!1;const r=t.value;return r==null||e&&Lt(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 Jt(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(Jt(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(r,qp(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const W9=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function zi(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const bl=(n,e,t)=>n.endsWith(`
|
|
64
|
+
`)?zi(t,e):t.includes(`
|
|
65
|
+
`)?`
|
|
66
|
+
`+zi(t,e):(n.endsWith(" ")?"":" ")+t,hq="flow",yS="block",mp="quoted";function _m(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 f=[],p={};let m=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?f.push(0):m=s-r);let g,x,v=!1,y=-1,S=-1,Q=-1;t===yS&&(y=Cj(n,y,e.length),y!==-1&&(m=y+u));for(let $;$=n[y+=1];){if(t===mp&&$==="\\"){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===yS&&(y=Cj(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)f.push(g),m=g+u,g=void 0;else if(t===mp){for(;x===" "||x===" ";)x=$,$=n[y+=1],v=!0;const j=y>Q+1?y-2:S-1;if(p[j])return n;f.push(j),p[j]=!0,m=j+u,g=void 0}else v=!0}x=$}if(v&&o&&o(),f.length===0)return n;a&&a();let k=n.slice(0,f[0]);for(let $=0;$<f.length;++$){const j=f[$],T=f[$+1]||n.length;j===0?k=`
|
|
70
|
+
${e}${n.slice(0,T)}`:(t===mp&&p[j]&&(k+=`${n[j]}\\`),k+=`
|
|
71
|
+
${e}${n.slice(j+1,T)}`)}return k}function Cj(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 Pm=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Nm=n=>/^(%|---|\.\.\.)/m.test(n);function G9(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 ld(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Nm(n)?" ":"");let a="",o=0;for(let u=0,f=t[u];f;f=t[++u])if(f===" "&&t[u+1]==="\\"&&t[u+2]==="n"&&(a+=t.slice(o,u)+"\\ ",u+=1,o=u,f="\\"),f==="\\")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:_m(a,i,mp,Pm(e,!1))}function vS(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
77
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return ld(n,e);const t=e.indent||(Nm(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
78
|
+
${t}`)+"'";return e.implicitKey?r:_m(r,t,hq,Pm(e,!1))}function Wo(n,e){const{singleQuote:t}=e.options;let r;if(t===!1)r=ld;else{const s=n.includes('"'),i=n.includes("'");s&&!i?r=vS:i&&!s?r=ld:r=t?vS:ld}return r(n,e)}let wS;try{wS=new RegExp(`(^|(?<!
|
|
79
|
+
))
|
|
80
|
+
+(?!
|
|
81
|
+
|$)`,"g")}catch{wS=/\n+(?!\n|$)/g}function Op({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 f=r.indent||(r.forceBlockIndent||Nm(t)?" ":""),p=a==="literal"?!0:a==="folded"||e===Ge.BLOCK_FOLDED?!1:e===Ge.BLOCK_LITERAL?!0:!G9(t,u,f.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(wS,`$&${f}`));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,`$&${f}`));let j=(y?f?"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,`$&${f}`);let R=!1;const N=Pm(r,!0);a!=="folded"&&e!==Ge.BLOCK_FOLDED&&(N.onOverflow=()=>{R=!0});const q=_m(`${k}${T}${x}`,f,yS,N);if(!R)return`>${j}
|
|
89
|
+
${f}${q}`}return t=t.replace(/\n+/g,`$&${f}`),`|${j}
|
|
90
|
+
${f}${k}${t}${x}`}function I9(n,e,t,r){const{type:s,value:i}=n,{actualString:a,implicitKey:o,indent:u,indentStep:f,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):Op(n,e,t,r);if(!o&&!p&&s!==Ge.PLAIN&&i.includes(`
|
|
93
|
+
`))return Op(n,e,t,r);if(Nm(i)){if(u==="")return e.forceBlockIndent=!0,Op(n,e,t,r);if(o&&u===f)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:_m(m,u,hq,Pm(e,!1))}function Ud(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):Op(a,e,t,r);case Ge.QUOTE_DOUBLE:return ld(a.value,e);case Ge.QUOTE_SINGLE:return vS(a.value,e);case Ge.PLAIN:return I9(a,e,t,r);default:return null}};let f=u(o);if(f===null){const{defaultKeyType:p,defaultStringType:m}=e.options,g=s&&p||m;if(f=u(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function pq(n,e){const t=Object.assign({blockQuote:!0,commentString:W9,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 H9(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(Lt(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 F9(n,e,{anchors:t,doc:r}){if(!r.directives)return"";const s=[],i=(Lt(n)||Jt(n))&&n.anchor;i&&oq(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 dc(n,e,t,r){var u;if(It(n))return n.toString(e,t,r);if(Ua(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=tn(n)?n:e.doc.createNode(n,{onTagObj:f=>s=f});s??(s=H9(e.doc.schema.tags,i));const a=F9(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):Lt(i)?Ud(i,e,t,r):i.toString(e,t,r);return a?Lt(i)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
|
|
95
|
+
${e.indent}${o}`:o}function K9({key:n,value:e},t,r,s){const{allNullValues:i,doc:a,indent:o,indentStep:u,options:{commentString:f,indentSeq:p,simpleKeys:m}}=t;let g=tn(n)&&n.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Jt(n)||!tn(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||Jt(n)||(Lt(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=dc(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,f(g)):y&&s&&s(),S;v&&(g=null),x?(g&&(S+=bl(S,t.indent,f(g))),S=`? ${S}
|
|
96
|
+
${o}:`):(S=`${S}:`,g&&(S+=bl(S,t.indent,f(g))));let Q,k,$;tn(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&&Lt(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=dc(e,t,()=>j=!0,()=>y=!0);let R=" ";if(g||Q||k){if(R=Q?`
|
|
97
|
+
`:"",k){const N=f(k);R+=`
|
|
98
|
+
${zi(N,t.indent)}`}T===""&&!t.inFlow?R===`
|
|
99
|
+
`&&$&&(R=`
|
|
100
|
+
|
|
101
|
+
`):R+=`
|
|
102
|
+
${t.indent}`}else if(!x&&Jt(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,f($)):y&&s&&s(),S}function mq(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const jh="<<",Yi={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:Oq}),stringify:()=>jh},J9=(n,e)=>(Yi.identify(e)||Lt(e)&&(!e.type||e.type===Ge.PLAIN)&&Yi.identify(e.value))&&(n==null?void 0:n.doc.schema.tags.some(t=>t.tag===Yi.tag&&t.default));function Oq(n,e,t){if(t=n&&Ua(t)?t.resolve(n.doc):t,jc(t))for(const r of t.items)Mg(n,e,r);else if(Array.isArray(t))for(const r of t)Mg(n,e,r);else Mg(n,e,t)}function Mg(n,e,t){const r=n&&Ua(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 gq(n,e,{key:t,value:r}){if(tn(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(J9(n,t))Oq(n,e,r);else{const s=rs(t,"",n);if(e instanceof Map)e.set(s,rs(r,s,n));else if(e instanceof Set)e.add(s);else{const i=eV(t,s,n),a=rs(r,i,n);i in e?Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[i]=a}}return e}function eV(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(tn(n)&&(t!=null&&t.doc)){const r=pq(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)+'..."'),mq(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 U2(n,e,t){const r=gd(n,void 0,t),s=gd(e,void 0,t);return new Hn(r,s)}class Hn{constructor(e,t=null){Object.defineProperty(this,is,{value:nq}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return tn(t)&&(t=t.clone(e)),tn(r)&&(r=r.clone(e)),new Hn(t,r)}toJSON(e,t){const r=t!=null&&t.mapAsMap?new Map:{};return gq(t,r,this)}toString(e,t,r){return e!=null&&e.doc?K9(this,e,t,r):JSON.stringify(this)}}function xq(n,e,t){return(e.inFlow??n.flow?nV:tV)(n,e,t)}function tV({comment:n,items:e},t,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:u,options:{commentString:f}}=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(tn(y))!m&&y.spaceBefore&&g.push(""),Mp(t,g,y.commentBefore,m),y.comment&&(S=y.comment);else if(It(y)){const k=tn(y.key)?y.key:null;k&&(!m&&k.spaceBefore&&g.push(""),Mp(t,g,k.commentBefore,m))}m=!1;let Q=dc(y,p,()=>S=null,()=>m=!0);S&&(Q+=bl(Q,i,f(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
|
+
`+zi(f(n),u),o&&o()):m&&a&&a(),x}function nV({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 f=!1,p=0;const m=[];for(let v=0;v<n.length;++v){const y=n[v];let S=null;if(tn(y))y.spaceBefore&&m.push(""),Mp(e,m,y.commentBefore,!1),y.comment&&(S=y.comment);else if(It(y)){const k=tn(y.key)?y.key:null;k&&(k.spaceBefore&&m.push(""),Mp(e,m,k.commentBefore,!1),k.comment&&(f=!0));const $=tn(y.value)?y.value:null;$?($.comment&&(S=$.comment),$.commentBefore&&(f=!0)):y.value==null&&(k!=null&&k.comment)&&(S=k.comment)}S&&(f=!0);let Q=dc(y,u,()=>S=null);v<n.length-1&&(Q+=","),S&&(Q+=bl(Q,r,o(S))),!f&&(m.length>p||Q.includes(`
|
|
109
|
+
`))&&(f=!0),m.push(Q),p=m.length}const{start:g,end:x}=t;if(m.length===0)return g+x;if(!f){const v=m.reduce((y,S)=>y+S.length+2,2);f=e.options.lineWidth>0&&v>e.options.lineWidth}if(f){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 Mp({indent:n,options:{commentString:e}},t,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=zi(e(r),n);t.push(i.trimStart())}}function yl(n,e){const t=Lt(e)?e.value:e;for(const r of n)if(It(r)&&(r.key===e||r.key===t||Lt(r.key)&&r.key.value===t))return r}class Xr extends fq{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Aa,e),this.items=[]}static from(e,t,r){const{keepUndefined:s,replacer:i}=r,a=new this(e),o=(u,f)=>{if(typeof i=="function")f=i.call(t,u,f);else if(Array.isArray(i)&&!i.includes(u))return;(f!==void 0||s)&&a.items.push(U2(u,f,r))};if(t instanceof Map)for(const[u,f]of t)o(u,f);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;It(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Hn(e,e==null?void 0:e.value):r=new Hn(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`);Lt(s.value)&&dq(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&&Lt(s)?s.value:s)??void 0}has(e){return!!yl(this.items,e)}set(e,t){this.add(new Hn(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)gq(t,s,i);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(const s of this.items)if(!It(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})),xq(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}const _c={collection:"map",default:!0,nodeClass:Xr,tag:"tag:yaml.org,2002:map",resolve(n,e){return Tc(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>Xr.from(n,e,t)};class Xa extends fq{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&&Lt(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];Lt(s)&&dq(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(rs(i,String(s++),t));return r}toString(e,t,r){return e?xq(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(gd(o,void 0,r))}}return i}}function _h(n){let e=Lt(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:Xa,tag:"tag:yaml.org,2002:seq",resolve(n,e){return jc(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>Xa.from(n,e,t)},Cm={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),Ud(n,e,t,r)}},Rm={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"&&Rm.test.test(n)?n:e.options.nullStr},W2={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&&W2.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 Es({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 bq={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:Es},yq={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():Es(n)}},vq={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:Es},Em=n=>typeof n=="bigint"||Number.isInteger(n),G2=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function wq(n,e,t){const{value:r}=n;return Em(r)&&r>=0?t+r.toString(e):Es(n)}const Sq={identify:n=>Em(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>G2(n,2,8,t),stringify:n=>wq(n,8,"0o")},Qq={identify:Em,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>G2(n,0,10,t),stringify:Es},kq={identify:n=>Em(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>G2(n,2,16,t),stringify:n=>wq(n,16,"0x")},rV=[_c,Pc,Cm,Rm,W2,Sq,Qq,kq,bq,yq,vq];function Rj(n){return typeof n=="bigint"||Number.isInteger(n)}const Ph=({value:n})=>JSON.stringify(n),sV=[{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:Rj,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})=>Rj(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}],iV={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},aV=[_c,Pc].concat(sV,iV),I2={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 f=0;f<a.length;++f)u+=String.fromCharCode(a[f]);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),f=Math.ceil(o.length/u),p=new Array(f);for(let m=0,g=0;m<f;++m,g+=u)p[m]=o.substr(g,u);o=p.join(e===Ge.BLOCK_LITERAL?`
|
|
113
|
+
`:" ")}return Ud({comment:n,type:e,value:o},r,s,i)}};function $q(n,e){if(jc(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!It(r)){if(Tc(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const s=r.items[0]||new Hn(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]=It(r)?r:new Hn(r)}}else e("Expected a sequence for this tag");return n}function Tq(n,e,t){const{replacer:r}=t,s=new Xa(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 f=Object.keys(a);if(f.length===1)o=f[0],u=a[o];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else o=a;s.items.push(U2(o,u,t))}return s}const H2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$q,createNode:Tq};class Jo extends Xa{constructor(){super(),this.add=Xr.prototype.add.bind(this),this.delete=Xr.prototype.delete.bind(this),this.get=Xr.prototype.get.bind(this),this.has=Xr.prototype.has.bind(this),this.set=Xr.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(It(s)?(i=rs(s.key,"",t),a=rs(s.value,i,t)):i=rs(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=Tq(e,t,r),i=new this;return i.items=s.items,i}}Jo.tag="tag:yaml.org,2002:omap";const F2={collection:"seq",identify:n=>n instanceof Map,nodeClass:Jo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=$q(n,e),r=[];for(const{key:s}of t.items)Lt(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 jq({value:n,source:e},t){return e&&(n?_q:Pq).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const _q={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:jq},Pq={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:jq},lV={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:Es},oV={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():Es(n)}},cV={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:Es},Wd=n=>typeof n=="bigint"||Number.isInteger(n);function Am(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 K2(n,e,t){const{value:r}=n;if(Wd(r)){const s=r.toString(e);return r<0?"-"+t+s.substr(1):t+s}return Es(n)}const uV={identify:Wd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Am(n,2,2,t),stringify:n=>K2(n,2,"0b")},dV={identify:Wd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Am(n,1,8,t),stringify:n=>K2(n,8,"0")},fV={identify:Wd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Am(n,0,10,t),stringify:Es},hV={identify:Wd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Am(n,2,16,t),stringify:n=>K2(n,16,"0x")};class ec extends Xr{constructor(e){super(e),this.tag=ec.tag}add(e){let t;It(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Hn(e.key,null):t=new Hn(e,null),yl(this.items,t.key)||this.items.push(t)}get(e,t){const r=yl(this.items,e);return!t&&It(r)?Lt(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 Hn(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(U2(a,null,r));return i}}ec.tag="tag:yaml.org,2002:set";const J2={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 eQ(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 Nq(n){let{value:e}=n,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Es(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 Cq={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})=>eQ(n,t),stringify:Nq},Rq={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=>eQ(n,!1),stringify:Nq},qm={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(qm.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 f=Date.UTC(t,r-1,s,i||0,a||0,o||0,u);const p=e[8];if(p&&p!=="Z"){let m=eQ(p,!1);Math.abs(m)<30&&(m*=60),f-=6e4*m}return new Date(f)},stringify:({value:n})=>(n==null?void 0:n.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Ej=[_c,Pc,Cm,Rm,_q,Pq,uV,dV,fV,hV,lV,oV,cV,I2,Yi,F2,H2,J2,Cq,Rq,qm],Aj=new Map([["core",rV],["failsafe",[_c,Pc,Cm]],["json",aV],["yaml11",Ej],["yaml-1.1",Ej]]),qj={binary:I2,bool:W2,float:vq,floatExp:yq,floatNaN:bq,floatTime:Rq,int:Qq,intHex:kq,intOct:Sq,intTime:Cq,map:_c,merge:Yi,null:Rm,omap:F2,pairs:H2,seq:Pc,set:J2,timestamp:qm},pV={"tag:yaml.org,2002:binary":I2,"tag:yaml.org,2002:merge":Yi,"tag:yaml.org,2002:omap":F2,"tag:yaml.org,2002:pairs":H2,"tag:yaml.org,2002:set":J2,"tag:yaml.org,2002:timestamp":qm};function Xg(n,e,t){const r=Aj.get(e);if(r&&!n)return t&&!r.includes(Yi)?r.concat(Yi):r.slice();let s=r;if(!s)if(Array.isArray(n))s=[];else{const i=Array.from(Aj.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(Yi)),s.reduce((i,a)=>{const o=typeof a=="string"?qj[a]:a;if(!o){const u=JSON.stringify(a),f=Object.keys(qj).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${f}`)}return i.includes(o)||i.push(o),i},[])}const mV=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;let Eq=class Aq{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Xg(e,"compat"):e?Xg(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?pV:{},this.tags=Xg(t,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Aa,{value:_c}),Object.defineProperty(this,ii,{value:Cm}),Object.defineProperty(this,$c,{value:Pc}),this.sortMapEntries=typeof a=="function"?a:a===!0?mV:null}clone(){const e=Object.create(Aq.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function OV(n,e){var u;const t=[];let r=e.directives===!0;if(e.directives!==!1&&n.directives){const f=n.directives.toString(n);f?(t.push(f),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");const s=pq(n,e),{commentString:i}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");const f=i(n.commentBefore);t.unshift(zi(f,""))}let a=!1,o=null;if(n.contents){if(tn(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){const m=i(n.contents.commentBefore);t.push(zi(m,""))}s.forceBlockIndent=!!n.comment,o=n.contents.comment}const f=o?void 0:()=>a=!0;let p=dc(n.contents,s,()=>o=null,f);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(dc(n.contents,s));if((u=n.directives)!=null&&u.docEnd)if(n.comment){const f=i(n.comment);f.includes(`
|
|
116
|
+
`)?(t.push("..."),t.push(zi(f,""))):t.push(`... ${f}`)}else t.push("...");else{let f=n.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||o)&&t[t.length-1]!==""&&t.push(""),t.push(zi(i(f),"")))}return t.join(`
|
|
117
|
+
`)+`
|
|
118
|
+
`}class Nc{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,is,{value:bS});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 Jn({version:a}),this.setSchema(a,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){const e=Object.create(Nc.prototype,{[is]:{value:bS}});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=tn(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=cq(this);e.anchor=!t||r.has(t)?uq(t||"a",r):t}return new jm(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:f,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:x}=D9(this,a||"a"),v={aliasDuplicateObjects:i??!0,keepUndefined:u??!1,onAnchor:m,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:x},y=gd(e,p,v);return o&&Jt(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 Hn(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 Jt(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Iu(e)?!t&&Lt(this.contents)?this.contents.value:this.contents:Jt(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Jt(this.contents)?this.contents.has(e):!1}hasIn(e){return Iu(e)?this.contents!==void 0:Jt(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qp(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=qp(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 Jn({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 Jn({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 Eq(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=rs(this.contents,t??"",o);if(typeof i=="function")for(const{count:f,res:p}of o.anchors.values())i(p,f);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 OV(this,e)}}function Mo(n){if(Jt(n))return!0;throw new Error("Expected a YAML collection as document contents")}class tQ extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}}class vl extends tQ{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class qq extends tQ{constructor(e,t,r){super("YAMLWarning",e,t,r)}}const Xp=(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 f=" ".repeat(i)+"^".repeat(o);t.message+=`:
|
|
120
|
+
|
|
121
|
+
${a}
|
|
122
|
+
${f}
|
|
123
|
+
`}};function fc(n,{flow:e,indicator:t,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let u=!1,f=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&&(f&&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="",f=!1;break}case"newline":f?m?m+=q.source:(!j||t!=="seq-item-ind")&&(u=!0):g+=q.source,f=!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),f=!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),f=!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,f=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){$&&i(q,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),$=q,f=!1,p=!1;break}default:i(q,"UNEXPECTED_TOKEN",`Unexpected ${q.type} token`),f=!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&&(f&&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 xd(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(xd(e.key)||xd(e.value))return!0}return!1;default:return!0}}function SS(n,e,t){if((e==null?void 0:e.type)==="flow-collection"){const r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&xd(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Mq(n,e,t){const{uniqueKeys:r}=n.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||Lt(i)&&Lt(a)&&i.value===a.value;return e.some(i=>s(i.key,t))}const Mj="All mapping items must start at the same column";function gV({composeNode:n,composeEmptyNode:e},t,r,s,i){var p;const a=(i==null?void 0:i.nodeClass)??Xr,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let u=r.offset,f=null;for(const m of r.items){const{start:g,key:x,sep:v,value:y}=m,S=fc(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",Mj)),!S.anchor&&!S.tag&&!v){f=S.end,S.comment&&(o.comment?o.comment+=`
|
|
125
|
+
`+S.comment:o.comment=S.comment);continue}(S.newlineAfterProp||xd(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",Mj);t.atKey=!0;const k=S.end,$=x?n(t,x,S,s):e(t,k,g,null,S,s);t.schema.compat&&SS(r.indent,x,s),t.atKey=!1,Mq(t,o.items,$)&&s(k,"DUPLICATE_KEY","Map keys must be unique");const j=fc(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&&SS(r.indent,y,s),u=T.range[2];const R=new Hn($,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 Hn($);t.options.keepSourceTokens&&(T.srcToken=m),o.items.push(T)}}return f&&f<u&&s(f,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,u,f??u],o}function xV({composeNode:n,composeEmptyNode:e},t,r,s,i){const a=(i==null?void 0:i.nodeClass)??Xa,o=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=r.offset,f=null;for(const{start:p,value:m}of r.items){const g=fc(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{f=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&&SS(r.indent,m,s),u=x.range[2],o.items.push(x)}return o.range=[r.offset,u,f??u],o}function Gd(n,e,t,r){let s="";if(n){let i=!1,a="";for(const o of n){const{source:u,type:f}=o;switch(f){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 ${f} at node end`)}e+=u.length}}return{comment:s,offset:e}}const zg="Block collections are not allowed within flow collections",Lg=n=>n&&(n.type==="block-map"||n.type==="block-seq");function bV({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?Xr:Xa),f=new u(t.schema);f.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=fc($,{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&&(f.comment?f.comment+=`
|
|
127
|
+
`+N.comment:f.comment=N.comment),m=N.end;continue}!a&&t.options.strict&&xd(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=f.items[f.items.length-1];It(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);f.items.push(q),m=q.range[2],Lg(R)&&s(q.range,"BLOCK_IN_FLOW",zg)}else{t.atKey=!0;const q=N.end,z=j?n(t,j,N,s):e(t,q,$,null,N,s);Lg(j)&&s(z.range,"BLOCK_IN_FLOW",zg),t.atKey=!1;const L=fc(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 D of T){if(D===L.found)break;if(D.type==="newline"){s(D,"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?Lg(R)&&s(E.range,"BLOCK_IN_FLOW",zg):L.comment&&(z.comment?z.comment+=`
|
|
129
|
+
`+L.comment:z.comment=L.comment);const V=new Hn(z,E);if(t.options.keepSourceTokens&&(V.srcToken=k),a){const D=f;Mq(t,D.items,z)&&s(q,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(V)}else{const D=new Xr(t.schema);D.flow=!0,D.items.push(V);const C=(E??z).range;D.range=[z.range[0],C[1],C[2]],f.items.push(D)}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=Gd(v,y,t.options.strict,s);Q.comment&&(f.comment?f.comment+=`
|
|
130
|
+
`+Q.comment:f.comment=Q.comment),f.range=[r.offset,y,Q.offset]}else f.range=[r.offset,y,y];return f}function Zg(n,e,t,r,s,i){const a=t.type==="block-map"?gV(n,e,t,r,i):t.type==="block-seq"?xV(n,e,t,r,i):bV(n,e,t,r,i),o=a.constructor;return s==="!"||s===o.tagName?(a.tag=o.tagName,a):(s&&(a.tag=s),a)}function yV(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===Xr.tagName&&o==="map"||a===Xa.tagName&&o==="seq")return Zg(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),Zg(n,e,t,s,a)}const f=Zg(n,e,t,s,a,u),p=((g=u.resolve)==null?void 0:g.call(u,f,x=>s(i,"TAG_RESOLVE_FAILED",x),e.options))??f,m=tn(p)?p:new Ge(p);return m.range=f.range,m.tag=a,u!=null&&u.format&&(m.format=u.format),m}function Xq(n,e,t){const r=e.offset,s=vV(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?wV(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,f=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(f+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(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=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];f+=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(f-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 vV({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 f=!1,p="",m=s.length;for(let g=1;g<e.length;++g){const x=e[g];switch(x.type){case"space":f=!0;case"newline":m+=x.source.length;break;case"comment":t&&!f&&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 wV(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 zq(n,e,t){const{offset:r,type:s,source:i,end:a}=n;let o,u;const f=(g,x,v)=>t(r+g,x,v);switch(s){case"scalar":o=Ge.PLAIN,u=SV(i,f);break;case"single-quoted-scalar":o=Ge.QUOTE_SINGLE,u=QV(i,f);break;case"double-quoted-scalar":o=Ge.QUOTE_DOUBLE,u=kV(i,f);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=Gd(a,p,e,t);return{value:u,type:o,comment:m.comment,range:[r,p,m.offset]}}function SV(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}`),Lq(n)}function QV(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Lq(n.slice(1,-1)).replace(/''/g,"'")}function Lq(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 kV(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}=$V(n,r);t+=i,r=a}else if(s==="\\"){let i=n[++r];const a=TV[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+=jV(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 $V(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 TV={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
160
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function jV(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 Zq(n,e,t,r){const{value:s,type:i,comment:a,range:o}=e.type==="block-scalar"?Xq(n,e,r):zq(e,n.options.strict,r),u=t?n.directives.tagName(t.source,m=>r(t,"TAG_RESOLVE_FAILED",m)):null;let f;n.options.stringKeys&&n.atKey?f=n.schema[ii]:u?f=_V(n.schema,s,u,t,r):e.type==="scalar"?f=PV(n,s,e,r):f=n.schema[ii];let p;try{const m=f.resolve(s,g=>r(t??e,"TAG_RESOLVE_FAILED",g),n.options);p=Lt(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),f.format&&(p.format=f.format),a&&(p.comment=a),p}function _V(n,e,t,r,s){var o;if(t==="!")return n[ii];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[ii])}function PV({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[ii];if(t.compat){const o=t.compat.find(u=>{var f;return u.default&&((f=u.test)==null?void 0:f.test(r))})??t[ii];if(a.tag!==o.tag){const u=e.tagString(a.tag),f=e.tagString(o.tag),p=`Value may be parsed as either ${u} or ${f}`;i(s,"TAG_RESOLVE_FAILED",p,!0)}}return a}function NV(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 CV={composeNode:Vq,composeEmptyNode:nQ};function Vq(n,e,t,r){const s=n.atKey,{spaceBefore:i,comment:a,anchor:o,tag:u}=t;let f,p=!0;switch(e.type){case"alias":f=RV(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":f=Zq(n,e,u,r),o&&(f.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=yV(CV,n,e,t,r),o&&(f.anchor=o.source.substring(1));break;default:{const m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",m),f=nQ(n,e.offset,void 0,null,t,r),p=!1}}return o&&f.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!Lt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(f.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?f.comment=a:f.commentBefore=a),n.options.keepSourceTokens&&p&&(f.srcToken=e),f}function nQ(n,e,t,r,{spaceBefore:s,comment:i,anchor:a,tag:o,end:u},f){const p={type:"scalar",offset:NV(e,t,r),indent:-1,source:""},m=Zq(n,p,o,f);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&f(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(m.spaceBefore=!0),i&&(m.comment=i,m.range[2]=u),m}function RV({options:n},{offset:e,source:t,end:r},s){const i=new jm(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=Gd(r,a,n.strict,s);return i.range=[e,a,o.offset],o.comment&&(i.comment=o.comment),i}function EV(n,e,{offset:t,start:r,value:s,end:i},a){const o=Object.assign({_directives:e},n),u=new Nc(void 0,o),f={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},p=fc(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?Vq(f,s,p,a):nQ(f,p.end,r,null,p,a);const m=u.contents.range[2],g=Gd(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 Xj(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 rQ{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 qq(a,r,s)):this.errors.push(new vl(a,r,s))},this.directives=new Jn({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:r,afterEmptyLine:s}=Xj(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(Jt(i)&&!i.flow&&i.items.length>0){let a=i.items[0];It(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:Xj(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=EV(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=Gd(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 AV(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 zq(n,e,r);case"block-scalar":return Xq({options:{strict:e}},n,r)}}return null}function qV(n,e){const{implicitKey:t=!1,indent:r,inFlow:s=!1,offset:i=-1,type:a="PLAIN"}=e,o=Ud({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 f=o.indexOf(`
|
|
169
|
+
`),p=o.substring(0,f),m=o.substring(f+1)+`
|
|
170
|
+
`,g=[{type:"block-scalar-header",offset:i,indent:r,source:p}];return Yq(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 MV(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 f=n.props[0];if(f.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=f.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const u=Ud({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">":XV(n,u);break;case'"':Vg(n,u,"double-quoted-scalar");break;case"'":Vg(n,u,"single-quoted-scalar");break;default:Vg(n,u,"scalar")}}function XV(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}];Yq(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 Yq(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 Vg(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 zV=n=>"type"in n?zp(n):gp(n);function zp(n){switch(n.type){case"block-scalar":{let e="";for(const t of n.props)e+=zp(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(const t of n.items)e+=gp(t);return e}case"flow-collection":{let e=n.start.source;for(const t of n.items)e+=gp(t);for(const t of n.end)e+=t.source;return e}case"document":{let e=gp(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 gp({start:n,key:e,sep:t,value:r}){let s="";for(const i of n)s+=i.source;if(e&&(s+=zp(e)),t)for(const i of t)s+=i.source;return r&&(s+=zp(r)),s}const QS=Symbol("break visit"),LV=Symbol("skip children"),Dq=Symbol("remove item");function Cl(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),Bq(Object.freeze([]),n,e)}Cl.BREAK=QS;Cl.SKIP=LV;Cl.REMOVE=Dq;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 Bq(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=Bq(Object.freeze(n.concat([[s,a]])),i.items[a],t);if(typeof o=="number")a=o-1;else{if(o===QS)return QS;o===Dq&&(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 Mm="\uFEFF",Xm="",zm="",bd="",ZV=n=>!!n&&"items"in n,VV=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function YV(n){switch(n){case Mm:return"<BOM>";case Xm:return"<DOC>";case zm:return"<FLOW_END>";case bd:return"<SCALAR>";default:return JSON.stringify(n)}}function Uq(n){switch(n){case Mm:return"byte-order-mark";case Xm:return"doc-mode";case zm:return"flow-error-end";case bd: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 DV=Object.freeze(Object.defineProperty({__proto__:null,BOM:Mm,DOCUMENT:Xm,FLOW_END:zm,SCALAR:bd,createScalarToken:qV,isCollection:ZV,isScalar:VV,prettyToken:YV,resolveAsScalar:AV,setScalarValue:MV,stringify:zV,tokenType:Uq,visit:Cl},Symbol.toStringTag,{value:"Module"}));function Qs(n){switch(n){case void 0:case" ":case`
|
|
178
|
+
`:case"\r":case" ":return!0;default:return!1}}const zj=new Set("0123456789ABCDEFabcdef"),BV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Nh=new Set(",[]{}"),UV=new Set(` ,[]{}
|
|
179
|
+
\r `),Yg=n=>!n||UV.has(n);class Wq{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==="...")&&Qs(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]===Mm&&(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 Xm,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==="...")&&Qs(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&&!Qs(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===":")&&Qs(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(Yg),"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("..."))&&Qs(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield zm,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(Yg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Qs(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=>Qs(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 bd,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(Qs(i)||e&&Nh.has(i))break;t=r}else if(Qs(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 bd,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(Yg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Qs(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(;!Qs(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(BV.has(t))t=this.buffer[++e];else if(t==="%"&&zj.has(this.buffer[e+1])&&zj.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 Gq{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 $a(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Lj(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 Iq(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&&!$a(e.start,"explicit-key-ind")&&!$a(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Iq(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 sQ=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 Wq,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=Uq(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&&Lj(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":{Lj(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 f=t.sep[u];switch(f.type){case"newline":o.push(u);break;case"space":break;case"comment":f.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($a(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(Iq(t.key)&&!$a(t.sep,"newline")){const o=Xo(t.start),u=t.key,f=t.sep;f.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:f}]})}else a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if($a(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]}):$a(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&&!$a(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||$a(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 Hq(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Gq||null,prettyErrors:e}}function WV(n,e={}){const{lineCounter:t,prettyErrors:r}=Hq(e),s=new sQ(t==null?void 0:t.addNewLine),i=new rQ(e),a=Array.from(i.compose(s.parse(n)));if(r&&t)for(const o of a)o.errors.forEach(Xp(n,t)),o.warnings.forEach(Xp(n,t));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())}function Fq(n,e={}){const{lineCounter:t,prettyErrors:r}=Hq(e),s=new sQ(t==null?void 0:t.addNewLine),i=new rQ(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(Xp(n,t)),a.warnings.forEach(Xp(n,t))),a}function GV(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);const s=Fq(n,t);if(!s)return null;if(s.warnings.forEach(i=>mq(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 IV(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 Vj=Object.freeze(Object.defineProperty({__proto__:null,Alias:jm,CST:DV,Composer:rQ,Document:Nc,Lexer:Wq,LineCounter:Gq,Pair:Hn,Parser:sQ,Scalar:Ge,Schema:Eq,YAMLError:tQ,YAMLMap:Xr,YAMLParseError:vl,YAMLSeq:Xa,YAMLWarning:qq,isAlias:Ua,isCollection:Jt,isDocument:Zl,isMap:Tc,isNode:tn,isPair:It,isScalar:Lt,isSeq:jc,parse:GV,parseAllDocuments:WV,parseDocument:Fq,stringify:IV,visit:Vl,visitAsync:Tm},Symbol.toStringTag,{value:"Module"})),HV="";class FV{constructor(e=HV){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 Vj.parse(e.content)}catch{return null}}async savePddrc(e){const t=Vj.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:f,quiet:p,force:m}=e.globalOptions;a!==void 0&&(i.strength=a),o!==void 0&&(i.temperature=o),u!==void 0&&(i.time=u),f&&(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,f=[`MODULE=${t}`,`LANG_OR_FRAMEWORK=${r}`,`ARCHITECTURE_FILE=${s||"architecture.json"}`];i&&f.push(`PRD_FILE=${i}`),a&&f.push(`TECH_STACK_FILE=${a}`);const p={template:"generic/generate_prompt",env:f,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:f}=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:f});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,f,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,(f=x.data)==null?void 0:f.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 Ne=new FV,KV=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",Yj=({onClose:n,onCreate:e,isCreating:t,existingPrompts:r})=>{const[s,i]=P.useState(""),[a,o]=P.useState("python"),[u,f]=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=KV(s.trim());if(S){m(S);return}if(x){m("A prompt with this name and language already exists");return}const Q=z9(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 d.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:d.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:[d.jsxs("header",{className:"flex items-center justify-between p-4 border-b border-gray-700",children:[d.jsx("h2",{id:"create-prompt-title",className:"text-lg font-semibold text-white",children:"Create New Prompt"}),d.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:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("form",{onSubmit:v,children:[d.jsxs("main",{className:"p-6 space-y-4",children:[d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"prompt-name",className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Prompt Name ",d.jsx("span",{className:"text-red-400",children:"*"})]}),d.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}),d.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Lowercase letters, numbers, and underscores only"})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"prompt-language",className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Language ",d.jsx("span",{className:"text-red-400",children:"*"})]}),d.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:X9.map(y=>d.jsx("option",{value:y.value,className:"bg-gray-800",children:y.label},y.value))})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"prompt-description",className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Description ",d.jsx("span",{className:"text-gray-500",children:"(optional)"})]}),d.jsx("textarea",{id:"prompt-description",value:u,onChange:y=>f(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}),d.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Brief description - will be included in the prompt template"})]}),g&&d.jsxs("div",{className:`rounded-md p-3 ${x?"bg-red-900/30 ring-1 ring-red-500/30":"bg-gray-900/50"}`,children:[d.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"File will be created at:"}),d.jsx("p",{className:`font-mono text-sm ${x?"text-red-400":"text-blue-400"}`,children:g}),x&&d.jsx("p",{className:"text-xs text-red-400 mt-1",children:"A prompt with this name already exists"})]}),p&&d.jsx("div",{className:"bg-red-900/30 rounded-md p-3 ring-1 ring-red-500/30",children:d.jsx("p",{className:"text-sm text-red-400",children:p})})]}),d.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:[d.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"}),d.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?d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{children:"Creating..."})]}):d.jsx("span",{children:"Create & Edit"})})]})]})]})})},JV={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"},eY=({prompt:n,isSelected:e,onSelect:t,onEditPrompt:r})=>{const s=n.language&&JV[n.language]||"bg-surface-700/50 text-surface-300 border-surface-600",i=o=>{o.stopPropagation(),t()},a=o=>{o.stopPropagation(),r()};return d.jsx(d.Fragment,{children:d.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:d.jsxs("div",{className:"p-3 sm:p-4 cursor-pointer",onClick:i,children:[d.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2 sm:mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[d.jsx("h3",{className:"text-base sm:text-lg font-semibold text-white truncate",children:n.sync_basename}),n.language&&d.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] sm:text-xs border font-medium ${s}`,children:n.language})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.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:[d.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:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Open"})]}),e&&d.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"})]})]}),d.jsx("p",{className:"text-[10px] sm:text-xs text-surface-400 font-mono mb-2 sm:mb-3 truncate",children:n.prompt}),d.jsxs("div",{className:"flex gap-1.5 sm:gap-2 flex-wrap",children:[d.jsx(Rh,{label:"Prompt",path:n.prompt,exists:!0,color:"purple"}),d.jsx(Rh,{label:"Code",path:n.code,exists:!!n.code,color:"green"}),d.jsx(Rh,{label:"Test",path:n.test,exists:!!n.test,color:"yellow"}),d.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 d.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:[d.jsx("span",{className:t?"text-green-400":"text-surface-500",children:t?"✓":"✗"}),d.jsx("span",{children:n})]})},tY=({onSelectPrompt:n,onEditPrompt:e,onCreatePrompt:t,selectedPrompt:r})=>{const[s,i]=P.useState([]),[a,o]=P.useState(!0),[u,f]=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),f(null);try{const $=await Ne.listPrompts();i($)}catch($){f($.message||"Failed to load prompts")}finally{o(!1)}},k=async $=>{y(!0);try{await Ne.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?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 sm:py-20",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center mb-4",children:d.jsxs("svg",{className:"animate-spin h-5 w-5 text-accent-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}),d.jsx("div",{className:"text-surface-400 text-sm",children:"Loading prompts..."})]}):u?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 sm:py-20",children:[d.jsx("div",{className:"w-12 h-12 rounded-xl bg-red-500/20 flex items-center justify-center mb-4",children:d.jsx("svg",{className:"w-6 h-6 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("div",{className:"text-red-400 mb-2 text-center",children:u}),d.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?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 sm:py-20",children:[d.jsx("div",{className:"w-14 h-14 rounded-2xl bg-surface-700/50 flex items-center justify-center mb-5",children:d.jsx("svg",{className:"w-7 h-7 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("div",{className:"text-surface-200 mb-2 font-semibold text-lg",children:"No prompts found"}),d.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 ",d.jsx("code",{className:"bg-surface-800/80 px-1.5 py-0.5 rounded text-accent-300",children:".prompt"})," files to the ",d.jsx("code",{className:"bg-surface-800/80 px-1.5 py-0.5 rounded text-accent-300",children:"prompts/"})," directory."]}),d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Create Your First Prompt"]}),g&&d.jsx(Yj,{onClose:()=>x(!1),onCreate:k,isCreating:v,existingPrompts:s})]}):d.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h2",{className:"text-base sm:text-lg font-semibold text-white flex items-center gap-2",children:[d.jsx("span",{className:"hidden sm:inline",children:"Your Prompts"}),d.jsx("span",{className:"sm:hidden",children:"Prompts"}),d.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}`:""]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),d.jsx("span",{className:"hidden sm:inline",children:"New"})]}),d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]})]})]}),d.jsxs("div",{className:"relative",children:[d.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"}),d.jsx("span",{className:"absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 text-surface-400",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),S.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 sm:py-16",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-700/50 flex items-center justify-center mb-3",children:d.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),d.jsxs("div",{className:"text-surface-400 text-sm text-center",children:['No prompts matching "',d.jsx("span",{className:"text-white",children:p}),'"']})]}):d.jsx("div",{className:"grid gap-3 sm:gap-4",children:S.map($=>d.jsx(eY,{prompt:$,isSelected:(r==null?void 0:r.prompt)===$.prompt,onSelect:()=>n($),onEditPrompt:()=>e($)},$.prompt))}),g&&d.jsx(Yj,{onClose:()=>x(!1),onCreate:k,isCreating:v,existingPrompts:s})]})};let kS=[],Kq=[];(()=>{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,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?Kq:kS).push(t=t+n[e])})();function nY(n){if(n<768)return!1;for(let e=0,t=kS.length;;){let r=e+t>>1;if(n<kS[r])t=r;else if(n>=Kq[r])e=r+1;else return!0;if(e==t)return!1}}function Dj(n){return n>=127462&&n<=127487}const Bj=8205;function rY(n,e,t=!0,r=!0){return(t?Jq:sY)(n,e,r)}function Jq(n,e,t){if(e==n.length)return e;e&&eM(n.charCodeAt(e))&&tM(n.charCodeAt(e-1))&&e--;let r=Dg(n,e);for(e+=Uj(r);e<n.length;){let s=Dg(n,e);if(r==Bj||s==Bj||t&&nY(s))e+=Uj(s),r=s;else if(Dj(s)){let i=0,a=e-2;for(;a>=0&&Dj(Dg(n,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function sY(n,e,t){for(;e>0;){let r=Jq(n,e-2,t);if(r<e)return r;e--}return 0}function Dg(n,e){let t=n.charCodeAt(e);if(!tM(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return eM(r)?(t-55296<<10)+(r-56320)+65536:t}function eM(n){return n>=56320&&n<57344}function tM(n){return n>=55296&&n<56320}function Uj(n){return n<65536?1:2}class ht{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),Hs.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),Hs.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 od(this),i=new od(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 od(this,e)}iterRange(e,t=this.length){return new nM(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 rM(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]?ht.empty:e.length<=32?new On(e):Hs.from(On.split(e,[]))}}class On extends ht{constructor(e,t=iY(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 aY(s,o,r,a);s=o+1,r++}}decompose(e,t,r,s){let i=e<=0&&t>=this.length?this:new On(Wj(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),o=xp(i.text,a.text.slice(),0,i.length);if(o.length<=32)r.push(new On(o,a.length+i.length));else{let u=o.length>>1;r.push(new On(o.slice(0,u)),new On(o.slice(u)))}}else r.push(i)}replace(e,t,r){if(!(r instanceof On))return super.replace(e,t,r);[e,t]=hc(this,e,t);let s=xp(this.text,xp(r.text,Wj(this.text,0,e)),t),i=this.length+r.length-(t-e);return s.length<=32?new On(s,i):Hs.from(On.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 On(r,s)),r=[],s=-1);return s>-1&&t.push(new On(r,s)),t}}class Hs extends ht{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 f=s&((a<=e?1:0)|(u>=t?2:0));a>=e&&u<=t&&!f?r.push(o):o.decompose(e-a,t-a,r,f)}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),f=this.lines-a.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){let p=this.children.slice();return p[s]=u,new Hs(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 Hs))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],f=e.children[i];if(u!=f)return r+u.scanIdentical(f,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 On(x,t)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,o=[],u=0,f=-1,p=[];function m(x){let v;if(x.lines>i&&x instanceof Hs)for(let y of x.children)m(y);else x.lines>a&&(u>a||!u)?(g(),o.push(x)):x instanceof On&&u&&(v=p[p.length-1])instanceof On&&x.lines+v.lines<=32?(u+=x.lines,f+=x.length+1,p[p.length-1]=new On(v.text.concat(x.text),v.length+1+x.length)):(u+x.lines>s&&g(),u+=x.lines,f+=x.length+1,p.push(x))}function g(){u!=0&&(o.push(p.length==1?p[0]:Hs.from(p,f)),f=-1,u=p.length=0)}for(let x of e)m(x);return g(),o.length==1?o[0]:new Hs(o,t)}}ht.empty=new On([""],0);function iY(n){let e=-1;for(let t of n)e+=t.length+1;return e}function xp(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 Wj(n,e,t){return xp(n,[""],e,t)}class od{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 On?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 On?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 On){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 On?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 nM{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new od(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 rM{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"&&(ht.prototype[Symbol.iterator]=function(){return this.iter()},od.prototype[Symbol.iterator]=nM.prototype[Symbol.iterator]=rM.prototype[Symbol.iterator]=function(){return this});let aY=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 Dn(n,e,t=!0,r=!0){return rY(n,e,t,r)}function lY(n){return n>=56320&&n<57344}function oY(n){return n>=55296&&n<56320}function pl(n,e){let t=n.charCodeAt(e);if(!oY(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return lY(r)?(t-55296<<10)+(r-56320)+65536:t}function cY(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 $S=/\r\n?|\n/;var tr=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(tr||(tr={}));class ni{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){TS(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 ni(e)}composeDesc(e){return this.empty?e:e.empty?this:sM(this,e)}mapDesc(e,t=!1){return e.empty?this:jS(this,e,t)}mapPos(e,t=-1,r=tr.Simple){let s=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],u=this.sections[a++],f=s+o;if(u<0){if(f>e)return i+(e-s);i+=o}else{if(r!=tr.Simple&&f>=e&&(r==tr.TrackDel&&s<e&&f>e||r==tr.TrackBefore&&s<e||r==tr.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!o)return e==s||t<0?i:i+u;i+=u}s=f}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 ni(e)}static create(e){return new ni(e)}}class Cn extends ni{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 TS(this,(t,r,s,i,a)=>e=e.replace(s,s+(r-t),a),!1),e}mapDesc(e,t=!1){return jS(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(ht.empty);r.push(a?e.slice(i,i+a):ht.empty)}i+=a}return new Cn(t,r)}compose(e){return this.empty?e:e.empty?this:sM(this,e,!0)}map(e,t=!1){return e.empty?this:jS(this,e,t,!0)}iterChanges(e,t=!1){TS(this,e,t)}get desc(){return ni.create(this.sections)}filter(e){let t=[],r=[],s=[],i=new yd(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);In(s,p,-1);let m=i.ins==-1?-1:i.off==0?i.ins:0;In(t,p,m),m>0&&Ra(r,t,i.text),i.forward(p),o+=p}let f=e[a++];for(;o<f;){if(i.done)break e;let p=Math.min(i.len,f-o);In(t,p,-1),In(s,p,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(p),o+=p}}return{changes:new Cn(t,r),filtered:ni.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&&In(s,t-a,-1);let m=new Cn(s,i);o=o?o.compose(m.map(o)):m,s=[],i=[],a=0}function f(p){if(Array.isArray(p))for(let m of p)f(m);else if(p instanceof Cn){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"?ht.of(x.split(r||$S)):x:ht.empty,y=v.length;if(m==g&&y==0)return;m<a&&u(),m>a&&In(s,m-a,-1),In(s,g-m,y),Ra(i,s,v),a=g}}return f(e),u(!o),o}static empty(e){return new Cn(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(ht.empty);r[s]=ht.of(i.slice(1)),t.push(i[0],r[s].length)}}}return new Cn(t,r)}static createSet(e,t){return new Cn(e,t)}}function In(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 Ra(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(ht.empty);n.push(t)}}function TS(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 f=s,p=i,m=ht.empty;for(;f+=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,f,i,p,m),s=f,i=p}}}function jS(n,e,t,r=!1){let s=[],i=r?[]:null,a=new yd(n),o=new yd(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 f=Math.min(a.len,o.len);In(s,f,-1),a.forward(f),o.forward(f)}else if(o.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(o.len<a.len||o.len==a.len&&!t))){let f=o.len;for(In(s,o.ins,-1);f;){let p=Math.min(a.len,f);a.ins>=0&&u<a.i&&a.len<=p&&(In(s,0,a.ins),i&&Ra(i,s,a.text),u=a.i),a.forward(p),f-=p}o.next()}else if(a.ins>=0){let f=0,p=a.len;for(;p;)if(o.ins==-1){let m=Math.min(p,o.len);f+=m,p-=m,o.forward(m)}else if(o.ins==0&&o.len<p)p-=o.len,o.next();else break;In(s,f,u<a.i?a.ins:0),i&&u<a.i&&Ra(i,s,a.text),u=a.i,a.forward(a.len-p)}else{if(a.done&&o.done)return i?Cn.createSet(s,i):ni.create(s);throw new Error("Mismatched change set lengths")}}}function sM(n,e,t=!1){let r=[],s=t?[]:null,i=new yd(n),a=new yd(e);for(let o=!1;;){if(i.done&&a.done)return s?Cn.createSet(r,s):ni.create(r);if(i.ins==0)In(r,i.len,0,o),i.next();else if(a.len==0&&!a.done)In(r,0,a.ins,o),s&&Ra(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),f=r.length;if(i.ins==-1){let p=a.ins==-1?-1:a.off?0:a.ins;In(r,u,p,o),s&&p&&Ra(s,r,a.text)}else a.ins==-1?(In(r,i.off?0:i.len,u,o),s&&Ra(s,r,i.textBit(u))):(In(r,i.off?0:i.len,a.off?0:a.ins,o),s&&!a.off&&Ra(s,r,a.text));o=(i.ins>u||a.ins>=0&&a.len>u)&&(o||r.length>f),i.forward2(u),a.forward(u)}}}}class yd{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?ht.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?ht.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 iM(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let iQ=0;class qe{constructor(e,t,r,s,i){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=s,this.id=iQ++,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:aQ),!!e.static,e.enables)}of(e){return new bp([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new bp(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new bp(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function aQ(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class bp{constructor(e,t,r,s){this.dependencies=e,this.facet=t,this.type=r,this.value=s,this.id=iQ++}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,f=!1,p=[];for(let m of this.dependencies)m=="doc"?u=!0:m=="selection"?f=!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||f&&(g.docChanged||g.selection)||_S(m,p)){let x=r(m);if(o?!Gj(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=Zp(g,v);if(this.dependencies.every(S=>S instanceof qe?g.facet(S)===m.facet(S):S instanceof ai?g.field(S,!1)==m.field(S,!1):!0)||(o?Gj(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 Gj(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 _S(n,e){let t=!1;for(let r of e)cd(n,r)&1&&(t=!0);return t}function uY(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 f=[];for(let p=0;p<r.length;p++){let m=Zp(u,r[p]);if(s[p]==2)for(let g of m)f.push(g);else f.push(m)}return e.combine(f)}return{create(u){for(let f of r)cd(u,f);return u.values[a]=o(u),1},update(u,f){if(!_S(u,i))return 0;let p=o(u);return e.compare(p,u.values[a])?0:(u.values[a]=p,1)},reconfigure(u,f){let p=_S(u,r),m=f.config.facets[e.id],g=f.facet(e);if(m&&!p&&aQ(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 ai{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 ai(iQ++,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 aM(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 aM{constructor(e,t){this.inner=e,this.prec=t}}class Id{of(e){return new PS(this,e)}reconfigure(e){return Id.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class PS{constructor(e,t){this.compartment=e,this.inner=t}}class Lp{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 dY(e,t,a))g instanceof ai?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let o=Object.create(null),u=[],f=[];for(let g of s)o[g.id]=f.length<<1,f.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,aQ(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]=f.length<<1,f.push(Q=>S.dynamicSlot(Q)));o[v.id]=f.length<<1,f.push(S=>uY(S,v,x))}}let m=f.map(g=>g(o));return new Lp(e,a,m,o,u,i)}}function dY(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 f=r[u].indexOf(a);f>-1&&r[u].splice(f,1),a instanceof PS&&t.delete(a.compartment)}if(s.set(a,o),Array.isArray(a))for(let f of a)i(f,o);else if(a instanceof PS){if(t.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(a.compartment)||a.inner;t.set(a.compartment,f),i(f,o)}else if(a instanceof aM)i(a.inner,a.prec);else if(a instanceof ai)r[o].push(a),a.provides&&i(a.provides,o);else if(a instanceof bp)r[o].push(a),a.facet.extensions&&i(a.facet.extensions,gl.default);else{let f=a.extension;if(!f)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(f,o)}}return i(n,gl.default),r.reduce((a,o)=>a.concat(o))}function cd(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 Zp(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const lM=qe.define(),NS=qe.define({combine:n=>n.some(e=>e),static:!0}),oM=qe.define({combine:n=>n.length?n[0]:void 0,static:!0}),cM=qe.define(),uM=qe.define(),dM=qe.define(),fM=qe.define({combine:n=>n.length?n[0]:!1});class Fi{constructor(e,t){this.type=e,this.value=t}static define(){return new fY}}class fY{of(e){return new Fi(this,e)}}class hY{constructor(e){this.map=e}of(e){return new qt(this,e)}}class qt{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 qt(this.type,t)}is(e){return this.type==e}static define(e={}){return new hY(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}}qt.reconfigure=qt.define();qt.appendConfig=qt.define();class $n{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&&iM(r,t.newLength),i.some(o=>o.type==$n.time)||(this.annotations=i.concat($n.time.of(Date.now())))}static create(e,t,r,s,i,a){return new $n(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($n.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}$n.time=Fi.define();$n.userEvent=Fi.define();$n.addToHistory=Fi.define();$n.remote=Fi.define();function pY(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 hM(n,e,t){var r;let s,i,a;return t?(s=e.changes,i=Cn.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:qt.mapEffects(n.effects,s).concat(qt.mapEffects(e.effects,i)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function CS(n,e,t){let r=e.selection,s=tc(e.annotations);return e.userEvent&&(s=s.concat($n.userEvent.of(e.userEvent))),{changes:e.changes instanceof Cn?e.changes:Cn.of(e.changes||[],t,n.facet(oM)),selection:r&&(r instanceof ve?r:ve.single(r.anchor,r.head)),effects:tc(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function pM(n,e,t){let r=CS(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=hM(r,CS(n,e[i],a?r.changes.newLength:n.doc.length),a)}let s=$n.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return OY(t?mY(s):s)}function mY(n){let e=n.startState,t=!0;for(let s of e.facet(cM)){let i=s(n);if(i===!1){t=!1;break}Array.isArray(i)&&(t=t===!0?i:pY(t,i))}if(t!==!0){let s,i;if(t===!1)i=n.changes.invertedDesc,s=Cn.empty(e.doc.length);else{let a=n.changes.filter(t);s=a.changes,i=a.filtered.mapDesc(a.changes).invertedDesc}n=$n.create(e,s,n.selection&&n.selection.map(i),qt.mapEffects(n.effects,i),n.annotations,n.scrollIntoView)}let r=e.facet(uM);for(let s=r.length-1;s>=0;s--){let i=r[s](n);i instanceof $n?n=i:Array.isArray(i)&&i.length==1&&i[0]instanceof $n?n=i[0]:n=pM(e,tc(i),!1)}return n}function OY(n){let e=n.startState,t=e.facet(dM),r=n;for(let s=t.length-1;s>=0;s--){let i=t[s](n);i&&Object.keys(i).length&&(r=hM(r,CS(e,i,n.changes.newLength),!0))}return r==n?n:$n.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const gY=[];function tc(n){return n==null?gY:Array.isArray(n)?n:[n]}var Li=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Li||(Li={}));const xY=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let RS;try{RS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function bY(n){if(RS)return RS.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||xY.test(t)))return!0}return!1}function yY(n){return e=>{if(!/\S/.test(e))return Li.Space;if(bY(e))return Li.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Li.Word;return Li.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++)cd(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 cd(this,r),Zp(this,r)}update(...e){return pM(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:s}=t;for(let o of e.effects)o.is(Id.reconfigure)?(t&&(s=new Map,t.compartments.forEach((u,f)=>s.set(f,u)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(qt.reconfigure)?(t=null,r=o.value):o.is(qt.appendConfig)&&(t=null,r=tc(r).concat(o.value));let i;t?i=e.startState.values.slice():(t=Lp.resolve(r,s,this),i=new xt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(u,f)=>f.reconfigure(u,this),null).values);let a=e.startState.facet(NS)?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]),f=this.changes(u.changes),p=f.map(s);for(let g=0;g<o;g++)i[g]=i[g].map(p);let m=s.mapDesc(f,!0);i.push(u.range.map(m)),s=s.compose(p),a=qt.mapEffects(a,p).concat(qt.mapEffects(tc(u.effects),m))}return{changes:s,selection:ve.create(i,t.mainIndex),effects:a}}changes(e=[]){return e instanceof Cn?e:Cn.of(e,this.doc.length,this.facet(xt.lineSeparator))}toText(e){return ht.of(e.split(this.facet(xt.lineSeparator)||$S))}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:(cd(this,t),Zp(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 ai&&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=Lp.resolve(e.extensions||[],new Map),r=e.doc instanceof ht?e.doc:ht.of((e.doc||"").split(t.staticFacet(xt.lineSeparator)||$S)),s=e.selection?e.selection instanceof ve?e.selection:ve.single(e.selection.anchor,e.selection.head):ve.single(0);return iM(s,r.length),t.staticFacet(NS)||(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(fM)}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(lM))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 yY(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=Dn(t,a,!1);if(i(t.slice(u,a))!=Li.Word)break;a=u}for(;o<s;){let u=Dn(t,o);if(i(t.slice(o,u))!=Li.Word)break;o=u}return a==o?null:ve.range(a+r,o+r)}}xt.allowMultipleSelections=NS;xt.tabSize=qe.define({combine:n=>n.length?n[0]:4});xt.lineSeparator=oM;xt.readOnly=fM;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=lM;xt.changeFilter=cM;xt.transactionFilter=uM;xt.transactionExtender=dM;Id.reconfigure=qt.define();function lQ(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 za{eq(e){return this==e}range(e,t=e){return ES.create(e,t,this)}}za.prototype.startSide=za.prototype.endSide=0;za.prototype.point=!1;za.prototype.mapMode=tr.TrackDel;function oQ(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let ES=class mM{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new mM(e,t,r)}};function AS(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class cQ{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,f=i[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==a)return f>=0?a:o;f>=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 f=this.value[u],p=this.from[u]+e,m=this.to[u]+e,g,x;if(p==m){let v=t.mapPos(p,f.startSide,f.mapMode);if(v==null||(g=x=v,f.startSide!=f.endSide&&(x=t.mapPos(p,f.endSide),x<g)))continue}else if(g=t.mapPos(p,f.startSide),x=t.mapPos(m,f.endSide),g>x||g==x&&f.startSide>0&&f.endSide<=0)continue;(x-g||f.endSide-f.startSide)<0||(a<0&&(a=g),f.point&&(o=Math.max(o,x-g)),r.push(f),s.push(g-a),i.push(x-a))}return{mapped:r.length?new cQ(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(AS)),this.isEmpty)return t.length?ft.of(t):this;let o=new OM(this,null,-1).goto(0),u=0,f=[],p=new vd;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)||f.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)||f.push(ES.create(o.from,o.to,o.value))),o.next());return p.finishInner(this.nextLayer.isEmpty&&!f.length?ft.empty:this.nextLayer.update({add:f,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],f=e.touchesRange(o,o+u.length);if(f===!1)s=Math.max(s,u.maxPoint),t.push(u),r.push(e.mapPos(o));else if(f===!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 wd.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return wd.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=Ij(a,o,r),f=new Au(a,u,i),p=new Au(o,u,i);r.iterGaps((m,g,x)=>Hj(f,m,p,g,x,s)),r.empty&&r.length==0&&Hj(f,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=Ij(i,a),u=new Au(i,o,0).goto(r),f=new Au(a,o,0).goto(r);for(;;){if(u.to!=f.to||!qS(u.active,f.active)||u.point&&(!f.point||!oQ(u.point,f.point)))return!1;if(u.to>s)return!0;u.next(),f.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 f=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,f,a.point,p,m,a.pointRank),u=Math.min(a.openEnd(f),p.length)}else f>o&&(s.span(o,f,a.active,u),u=a.openEnd(f));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 vd;for(let s of e instanceof ES?[e]:t?vY(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 vY(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(AS(e,r)>0)return n.slice().sort(AS);e=r}return n}ft.empty.nextLayer=ft.empty;class vd{finishChunk(e){this.chunks.push(new cQ(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 vd)).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 Ij(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 OM{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 wd{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 OM(a,t,r,i));return s.length==1?s[0]:new wd(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--)Bg(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--)Bg(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(),Bg(this.heap,0)}}}function Bg(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=wd.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=Fj(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=Fj(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 Hj(n,e,t,r,s,i){n.goto(e),t.goto(r);let a=r+s,o=r,u=r-e,f=!!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&&oQ(n.point,t.point)&&qS(n.activeForPoint(n.to),t.activeForPoint(t.to))||i.comparePoint(o,v,n.point,t.point),p=!1):(p&&i.boundChange(o),v>o&&!qS(n.active,t.active)&&i.compareRange(o,v,n.active,t.active),f&&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 qS(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!oQ(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 Fj(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 Ui(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=Dn(n,s));return r}function wY(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=Dn(n,s)}return n.length}const MS="ͼ",Kj=typeof Symbol>"u"?"__"+MS:Symbol.for(MS),XS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Jj=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class La{constructor(e,t){this.rules=[];let{finish:r}=t||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,o,u,f){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&&!f?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=Jj[Kj]||1;return Jj[Kj]=e+1,MS+e.toString(36)}static mount(e,t,r){let s=e[XS],i=r&&r.nonce;s?i&&s.setNonce(i):s=new SY(e,i),s.mount(Array.isArray(t)?t:[t],e)}}let e_=new Map;class SY{constructor(e,t){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=e_.get(r);if(i)return e[XS]=i;this.sheet=new s.CSSStyleSheet,e_.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[XS]=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 f=0;f<o.rules.length;f++)r.insertRule(o.rules[f],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 Za={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:"'"},Sd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},QY=typeof navigator<"u"&&/Mac/.test(navigator.platform),kY=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yn=0;Yn<10;Yn++)Za[48+Yn]=Za[96+Yn]=String(Yn);for(var Yn=1;Yn<=24;Yn++)Za[Yn+111]="F"+Yn;for(var Yn=65;Yn<=90;Yn++)Za[Yn]=String.fromCharCode(Yn+32),Sd[Yn]=String.fromCharCode(Yn);for(var Ug in Za)Sd.hasOwnProperty(Ug)||(Sd[Ug]=Za[Ug]);function $Y(n){var e=QY&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||kY&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Sd:Za)[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 er=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},zS=typeof document<"u"?document:{documentElement:{style:{}}};const LS=/Edge\/(\d+)/.exec(er.userAgent),gM=/MSIE \d/.test(er.userAgent),ZS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(er.userAgent),Lm=!!(gM||ZS||LS),t_=!Lm&&/gecko\/(\d+)/i.test(er.userAgent),Wg=!Lm&&/Chrome\/(\d+)/.exec(er.userAgent),TY="webkitFontSmoothing"in zS.documentElement.style,VS=!Lm&&/Apple Computer/.test(er.vendor),n_=VS&&(/Mobile\/\w+/.test(er.userAgent)||er.maxTouchPoints>2);var Pe={mac:n_||/Mac/.test(er.platform),windows:/Win/.test(er.platform),linux:/Linux|X11/.test(er.platform),ie:Lm,ie_version:gM?zS.documentMode||6:ZS?+ZS[1]:LS?+LS[1]:0,gecko:t_,gecko_version:t_?+(/Firefox\/(\d+)/.exec(er.userAgent)||[0,0])[1]:0,chrome:!!Wg,chrome_version:Wg?+Wg[1]:0,ios:n_,android:/Android\b/.test(er.userAgent),webkit_version:TY?+(/\bAppleWebKit\/(\d+)/.exec(er.userAgent)||[0,0])[1]:0,safari:VS,safari_version:VS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(er.userAgent)||[0,0])[1]:0,tabSize:zS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function uQ(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 Vp=Object.create(null);function dQ(n,e,t){if(n==e)return!0;n||(n=Vp),e||(e=Vp);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 jY(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 r_(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 _Y(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 Hd{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 br=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(br||(br={}));class Gt extends za{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 Fd(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}=xM(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 Kd(e)}static set(e,t=!1){return ft.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Gt.none=ft.empty;class Fd extends Gt{constructor(e){let{start:t,end:r}=xM(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?uQ(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Vp}eq(e){return this==e||e instanceof Fd&&this.tagName==e.tagName&&dQ(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)}}Fd.prototype.point=!1;class Kd extends Gt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Kd&&this.spec.class==e.spec.class&&dQ(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)}}Kd.prototype.mapMode=tr.TrackBefore;Kd.prototype.point=!0;class Rl extends Gt{constructor(e,t,r,s,i,a){super(t,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?t<=0?tr.TrackBefore:tr.TrackAfter:tr.TrackDel}get type(){return this.startSide!=this.endSide?br.WidgetRange:this.startSide<=0?br.WidgetBefore:br.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Rl&&PY(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 xM(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 PY(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 Qd extends za{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof Qd&&this.tagName==e.tagName&&dQ(this.attributes,e.attributes)}static create(e){return new Qd(e.tagName,e.attributes||Vp)}static set(e,t=!1){return ft.of(e,t)}}Qd.prototype.startSide=Qd.prototype.endSide=-1;function kd(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function YS(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function yp(n,e){if(!e.anchorNode)return!1;try{return YS(n,e.anchorNode)}catch{return!1}}function vp(n){return n.nodeType==3?$d(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function ud(n,e,t,r){return t?s_(n,e,t,r,-1)||s_(n,e,t,r,1):!1}function Va(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Yp(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function s_(n,e,t,r,s){for(;;){if(n==t&&e==r)return!0;if(e==(s<0?0:Wi(n))){if(n.nodeName=="DIV")return!1;let i=n.parentNode;if(!i||i.nodeType!=1)return!1;e=Va(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?Wi(n):0}else return!1}}function Wi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Dp(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function NY(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 bM(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 CY(n,e,t,r,s,i,a,o){let u=n.ownerDocument,f=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=NY(f);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}=bM(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)f.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 RY(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 EY{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?Wi(t):0),r,Math.min(e.focusOffset,r?Wi(r):0))}set(e,t,r,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=s}}let ml=null;Pe.safari&&Pe.safari_version>=26&&(ml=!1);function yM(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 i_;function $d(n,e,t=e){let r=i_||(i_=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 AY(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function qY(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,Wi(t));;)if(r){if(t.nodeType!=1)return!1;let s=t.childNodes[r-1];s.contentEditable=="false"?r--:(t=s,r=Wi(t))}else{if(t==n)return!0;r=Va(t),t=t.parentNode}}function vM(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function wM(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=Wi(t)}else if(t.parentNode&&!Yp(t))r=Va(t),t=t.parentNode;else return null}}function SM(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&&!Yp(t))r=Va(t)+1,t=t.parentNode;else return null}}class Ps{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new Ps(e.parentNode,Va(e),t)}static after(e,t){return new Ps(e.parentNode,Va(e)+1,t)}}var en=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(en||(en={}));const El=en.LTR,fQ=en.RTL;function QM(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const MY=QM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),XY=QM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),DS=Object.create(null),Us=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);DS[e]=t,DS[t]=-e}function kM(n){return n<=247?MY[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?XY[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const zY=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Zi{get dir(){return this.level%2?fQ: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 $M(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||!$M(r.inner,s.inner))return!1}return!0}const zt=[];function LY(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 f=a,p=u,m=u;f<o;f++){let g=kM(n.charCodeAt(f));g==512?g=p:g==8&&m==4&&(g=16),zt[f]=g==4?2:g,g&7&&(m=g),p=g}for(let f=a,p=u,m=u;f<o;f++){let g=zt[f];if(g==128)f<o-1&&p==zt[f+1]&&p&24?g=zt[f]=p:zt[f]=256;else if(g==64){let x=f+1;for(;x<o&&zt[x]==64;)x++;let v=f&&p==8||x<t&&zt[x]==8?m==1?1:8:256;for(let y=f;y<x;y++)zt[y]=v;f=x-1}else g==8&&m==1&&(zt[f]=1);p=g,g&7&&(m=g)}}}function ZY(n,e,t,r,s){let i=s==1?2:1;for(let a=0,o=0,u=0;a<=r.length;a++){let f=a?r[a-1].to:e,p=a<r.length?r[a].from:t;for(let m=f,g,x,v;m<p;m++)if(x=DS[g=n.charCodeAt(m)])if(x<0){for(let y=o-3;y>=0;y-=3)if(Us[y+1]==-x){let S=Us[y+2],Q=S&2?s:S&4?S&1?i:s:0;Q&&(zt[m]=zt[Us[y]]=Q),o=y;break}}else{if(Us.length==189)break;Us[o++]=m,Us[o++]=g,Us[o++]=u}else if((v=zt[m])==2||v==1){let y=v==s;u=y?0:1;for(let S=o-3;S>=0;S-=3){let Q=Us[S+2];if(Q&2)break;if(y)Us[S+2]|=2;else{if(Q&4)break;Us[S+2]|=4}}}}}function VY(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 f=zt[u];if(f==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(zt[p]==256)p++;else break;let m=i==1,g=(p<e?zt[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),zt[--v]=x;u=p}else i=f,u++}}}function BS(n,e,t,r,s,i,a){let o=r%2?2:1;if(r%2==s%2)for(let u=e,f=0;u<t;){let p=!0,m=!1;if(f==i.length||u<i[f].from){let y=zt[u];y!=o&&(p=!1,m=y==16)}let g=!p&&o==1?[]:null,x=p?r:r+1,v=u;e:for(;;)if(f<i.length&&v==i[f].from){if(m)break e;let y=i[f];if(!p)for(let S=y.to,Q=f+1;;){if(S==t)break e;if(Q<i.length&&i[Q].from==S)S=i[Q++].to;else{if(zt[S]==o)break e;break}}if(f++,g)g.push(y);else{y.from>u&&a.push(new Zi(u,y.from,x));let S=y.direction==El!=!(x%2);US(n,S?r+1:r,s,y.inner,y.from,y.to,a),u=y.to}v=y.to}else{if(v==t||(p?zt[v]!=o:zt[v]==o))break;v++}g?BS(n,u,v,r+1,s,g,a):u<v&&a.push(new Zi(u,v,x)),u=v}else for(let u=t,f=i.length;u>e;){let p=!0,m=!1;if(!f||u>i[f-1].to){let y=zt[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(f&&v==i[f-1].to){if(m)break e;let y=i[--f];if(!p)for(let S=y.from,Q=f;;){if(S==e)break e;if(Q&&i[Q-1].to==S)S=i[--Q].from;else{if(zt[S-1]==o)break e;break}}if(g)g.push(y);else{y.to<u&&a.push(new Zi(y.to,u,x));let S=y.direction==El!=!(x%2);US(n,S?r+1:r,s,y.inner,y.from,y.to,a),u=y.from}v=y.from}else{if(v==e||(p?zt[v-1]!=o:zt[v-1]==o))break;v--}g?BS(n,v,u,r+1,s,g,a):v<u&&a.push(new Zi(v,u,x)),u=v}}function US(n,e,t,r,s,i,a){let o=e%2?2:1;LY(n,s,i,r,o),ZY(n,s,i,r,o),VY(s,i,r,o),BS(n,s,i,e,t,r,a)}function YY(n,e,t){if(!n)return[new Zi(0,0,e==fQ?1:0)];if(e==El&&!t.length&&!zY.test(n))return TM(n.length);if(t.length)for(;n.length>zt.length;)zt[zt.length]=256;let r=[],s=e==El?0:1;return US(n,s,s,t,0,n.length,r),r}function TM(n){return[new Zi(0,n,0)]}let jM="";function DY(n,e,t,r,s){var i;let a=r.head-n.from,o=Zi.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),u=e[o],f=u.side(s,t);if(a==f){let g=o+=s?1:-1;if(g<0||g>=e.length)return null;u=e[o=g],a=u.side(!s,t),f=u.side(s,t)}let p=Dn(n.text,a,u.forward(s,t));(p<u.from||p>u.to)&&(p=f),jM=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==f&&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 BY(n,e,t){for(let r=e;r<t;r++){let s=kM(n.charCodeAt(r));if(s==1)return El;if(s==2||s==4)return fQ}return El}const _M=qe.define(),PM=qe.define(),NM=qe.define(),CM=qe.define(),WS=qe.define(),RM=qe.define(),EM=qe.define(),hQ=qe.define(),pQ=qe.define(),AM=qe.define({combine:n=>n.some(e=>e)}),UY=qe.define({combine:n=>n.some(e=>e)}),qM=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=qt.define({map:(n,e)=>n.map(e)}),MM=qt.define();function zr(n,e,t){let r=n.facet(CM);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 Xi=qe.define({combine:n=>n.length?n[0]:!0});let WY=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 Ns{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 Ns(WY++,e,r,s,o=>{let u=[];return a&&u.push(Zm.of(f=>{let p=f.plugin(o);return p?a(p):Gt.none})),i&&u.push(i(o)),u})}static fromClass(e,t){return Ns.define((r,s)=>new e(r,s),t)}}class Gg{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(zr(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){zr(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){zr(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const XM=qe.define(),mQ=qe.define(),Zm=qe.define(),zM=qe.define(),OQ=qe.define(),Jd=qe.define(),LM=qe.define();function a_(n,e){let t=n.state.facet(LM);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 f=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=BY(e.text,f,p)),u>0&&m.length&&(v=m[m.length-1]).to==f&&v.direction==x)v.to=p,m=v.inner;else{let y={from:f,to:p,direction:x,inner:[]};m.push(y),m=y.inner}}}}),s}const ZM=qe.define();function gQ(n){let e=0,t=0,r=0,s=0;for(let i of n.state.facet(ZM)){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 Fr{constructor(e,t,r,s){this.fromA=e,this.toA=t,this.fromB=r,this.toB=s}join(e){return new Fr(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,f=Math.min(o,u);if(f==1e9)break;let p=f+a,m=f,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 Fr(p,g,f,m))}return r}}class Bp{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Cn.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 Fr(i,a,o,u))),this.changedRanges=s}static create(e,t,r){return new Bp(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 GY=[];class Tn{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 GY}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&&jY(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=Va(this.dom),s=this.length?e>0:t>0;return new Ps(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 Ym)return e;return null}static get(e){return e.cmTile}}class Vm extends Tn{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=l_(s);else t.insertBefore(o.dom,s);r=o.dom}for(s=r?r.nextSibling:t.firstChild,i&&s&&(i.written=!0);s;)s=l_(s);this.length=a}}function l_(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Ym extends Vm{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=Tn.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 qa)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 f=u+o.length;if(e>=u&&e<=f){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(r=void 0)}(u<e||e==f&&(t<-1?o.length:o.covers(1)))&&(!r||!o.isWidget()&&r.isWidget())&&(r=o,s=e-u),(f>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 qa extends Vm{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 qa(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class pc extends Vm{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&&HY(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 f=(t<0?s:a)||s||a;return f?{tile:f,offset:f==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):IY(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 Ps(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 Ps(u.dom,0);u==r.tile&&(o=!0)}}return new Ps(this.dom,0)}}function IY(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=vp(e);return t[t.length-1]||null}function HY(n,e){let t=n.coordsIn(0,1),r=e.coordsIn(0,1);return t&&r&&r.top<t.bottom}class Or extends Vm{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let r=new Or(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class Sl extends Tn{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?Pe.chrome||Pe.gecko||(e?(s--,a=1):i<r&&(i++,a=-1)):t<0?s--:i<r&&i++;let o=$d(this.dom,s,i).getClientRects();if(!o.length)return null;let u=o[(a?a<0:t>=0)?0:o.length-1];return Pe.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(o,f=>f.width)||u),a?Dp(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 Tn{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 Dp(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 Dp(a,!o)}}get overrideDOMText(){if(!this.length)return ht.empty;let{root:e}=this;if(!e)return ht.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 Up extends Tn{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 ht.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class FY{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],f=u.breakAfter;(t>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!f,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 KY{constructor(e,t,r,s){this.from=e,this.to=t,this.wrapper=r,this.rank=s}}class JY{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)?Ig(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],f=s.lastChild;if(f instanceof Or&&f.mark.eq(u.mark))f.dom!=u.dom&&f.setDOM(Ig(u.dom)),s=f;else{if(this.cache.reused.get(u)){let m=Tn.get(u.dom);m&&m.setDOM(Ig(u.dom))}let p=Or.of(u.mark,u.dom);s.append(p),s=p}this.cache.reused.set(u,2)}let i=Tn.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=VM);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 Or&&o.mark.eq(a))s=o,t--;else{let u=Or.of(a,(r=this.cache.find(Or,f=>f.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||!o_(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Pe.ios&&o_(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Hg,0,32)||new Al(Hg.toDOM(),0,Hg,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 KY(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 qa&&s.wrapper.eq(r.wrapper))t=s;else{let i=qa.of(r.wrapper,(e=this.cache.find(qa,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(Up,void 0,1);return r&&(r.flags=t),r||new Up(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class eD{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 Wp=[Al,pc,Sl,Or,Up,qa,Ym];for(let n=0;n<Wp.length;n++)Wp[n].bucket=n;class tD{constructor(e){this.view=e,this.buckets=Wp.map(()=>[]),this.index=Wp.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,f=i[u];if((!t||t(f))&&!this.reused.has(f))return i.splice(u,1),u<a&&this.index[s]--,this.reused.set(f,r),f}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 nD{constructor(e,t,r,s,i){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new tD(e),this.text=new eD(e.state.doc),this.builder=new JY(this.cache,new Ym(e,e.contentDOM),ft.iter(r)),this.cache.reused.set(t,2),this.old=new FY(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 f=u-s;this.preserve(f,!a,!o),s=u,i+=f}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=iD(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 f=u>0||o<a.length?Al.of(a.widget,this.view,u-o,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,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 Up)this.cache.add(a);else if(a instanceof Or)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 Or&&s.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?s.length&&(s.length=i=0):a instanceof Or&&(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,f,p,m,g)=>{if(f instanceof Rl){if(this.disallowBlockEffectsFor[g]){if(f.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=f.widget||(f.block?mc.block:mc.inline),v=rD(f),y=this.cache.findWidget(x,u-o,v)||Al.of(x,this.view,u-o,v);f.block?(f.startSide>0&&s.addLineStartIfNotCovered(r),s.addBlockWidget(y)):(s.ensureLine(r),s.addInlineWidget(y,p,m))}r=null}else r=sD(r,f);u>o&&this.text.skip(u-o)},span:(o,u,f,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,f,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=Tn.get(s);if(s==this.view.contentDOM)break;i instanceof Or?t.push(i):i!=null&&i.isLine()?r=i:s.nodeName=="DIV"&&!r&&s!=this.view.contentDOM?r=new pc(s,VM):t.push(Or.of(new Fd({tagName:s.nodeName.toLowerCase(),attributes:_Y(s)}),s))}return{line:r,marks:t}}}function o_(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 rD(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 VM={class:"cm-line"};function sD(n,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(n||(n={class:"cm-line"}),t&&uQ(t,n),r&&(n.class+=" "+r)),n}function iD(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 Or&&e.push(r.mark)}return e}function Ig(n){let e=Tn.get(n);return e&&e.setDOM(n.cloneNode()),n}class mc extends Hd{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 Hg=new class extends Hd{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class c_{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Gt.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 Ym(e,e.contentDOM),this.updateInner([new Fr(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:!pD(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?lD(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:p,to:m}=this.hasComposition;r=new Fr(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,(Pe.ie||Pe.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=uD(a,this.decorations,e.changes);u.length&&(r=Fr.extendWithRanges(r,u));let f=fD(o,this.blockWrappers,e.changes);return f.length&&(r=Fr.extendWithRanges(r,f)),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 nD(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=o.run(e,t),GS(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=Pe.chrome||Pe.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 Fg&&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(MM)&&(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(Xi)||r.tabIndex>-1)&&yp(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,f,p;if(u.empty?p=f=this.inlineDOMNearPos(u.anchor,u.assoc||1):(p=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),f=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),Pe.gecko&&u.empty&&!this.hasComposition&&aD(f)){let g=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(g,f.node.childNodes[f.offset]||null)),f=p=new Ps(g,0),o=!0}let m=this.view.observer.selectionRange;(o||!m.focusNode||(!ud(f.node,f.offset,m.anchorNode,m.anchorOffset)||!ud(p.node,p.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,u))&&(this.view.observer.ignore(()=>{Pe.android&&Pe.chrome&&r.contains(m.focusNode)&&hD(m.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=kd(this.view.root);if(g)if(u.empty){if(Pe.gecko){let x=oD(f.node,f.offset);if(x&&x!=3){let v=(x==1?wM:SM)(f.node,f.offset);v&&(f=new Ps(v.node,v.offset))}}g.collapse(f.node,f.offset),u.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=u.bidiLevel)}else if(g.extend){g.collapse(f.node,f.offset);try{g.extend(p.node,p.offset)}catch{}}else{let x=document.createRange();u.anchor>u.head&&([f,p]=[p,f]),x.setEnd(p.node,p.offset),x.setStart(f.node,f.offset),g.removeAllRanges(),g.addRange(x)}a&&this.view.root.activeElement==r&&(r.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(f,p)),this.impreciseAnchor=f.precise?null:new Ps(m.anchorNode,m.anchorOffset),this.impreciseHead=p.precise?null:new Ps(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ud(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=kd(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),f=this.coordsAt(t.head,1);if(!u||!f||u.bottom>f.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=Wi(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&&!Tn.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((f,p)=>{if(f.isWidget()){if(f.flags&32&&p>=e)return!0;f.flags&16&&(i=!0)}else{let m=p+f.length;if(p<=e&&(r=f,s=e-p,i=m<e),m>=e&&!a&&(a=f,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 Fg?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=Dn(i.text,a);if(o==a)return null;let u=$d(i.dom,a,o).getClientRects();for(let f=0;f<u.length;f++){let p=u[f];if(f==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==en.LTR,f=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&&(f+=Q.top-x.top),y instanceof qa)S>r&&p(y,g,Q);else if(g>=r&&(f>0&&t.push(-f),t.push(k+f),f=0,a)){let $=y.dom.lastChild,j=$?vp($):[];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&&(f+=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"?en.RTL:en.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let o=0,u;for(let f of a.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let p=vp(f.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=vp(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(Gt.replace({widget:new Fg(o),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return Gt.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Zm).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(OQ).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(zM).map(i=>typeof i=="function"?i(this.view):i)}scrollIntoView(e){if(e.isSnapshot){let f=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=f.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let f of this.view.state.facet(qM))try{if(f(this.view,e.range,e))return!0}catch(p){zr(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=gQ(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;CY(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==en.LTR)}lineHasWidget(e){let t=r=>r.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){GS(this.tile)}}function GS(n,e){let t=e==null?void 0:e.get(n);if(t!=1){t==null&&n.destroy();for(let r of n.children)GS(r,e)}}function aD(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 YM(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=wM(t.focusNode,t.focusOffset),s=SM(t.focusNode,t.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let o=Tn.get(s.node);if(!o||o.isText()&&o.text!=s.node.nodeValue)i=s;else if(n.docView.lastCompositionAfterCursor){let u=Tn.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 lD(n,e,t){let r=YM(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 Fr(u.mapPos(i),u.mapPos(a),i,a),text:s}}function oD(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 cD=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 uD(n,e,t){let r=new cD;return ft.compare(n,e,t,r),r.changes}class dD{constructor(){this.changes=[]}compareRange(e,t){nc(e,t,this.changes)}comparePoint(){}boundChange(e){nc(e,e,this.changes)}}function fD(n,e,t){let r=new dD;return ft.compare(n,e,t,r),r.changes}function hD(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 pD(n,e){let t=!1;return e&&n.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(t=!0)}),t}class Fg extends Hd{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 mD(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=Dn(s.text,i,!1):o=Dn(s.text,i);let u=r(s.text.slice(a,o));for(;a>0;){let f=Dn(s.text,a,!1);if(r(s.text.slice(f,a))!=u)break;a=f}for(;o<s.length;){let f=Dn(s.text,o);if(r(s.text.slice(o,f))!=u)break;o=f}return ve.range(a+s.from,o+s.from)}function OD(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+wY(a,i,n.state.tabSize)}function gD(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==br.Text&&(s.type!=i.type||(t<0?i.from<e:i.to>e)))&&(s=i)}}return s||r}return r}function xD(n,e,t,r){let s=gD(n,e.head,e.assoc||-1),i=!r||s.type!=br.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==en.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 u_(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 f=DY(s,i,a,o,t),p=jM;if(!f){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),f=n.visualLineSide(s,!t)}if(u){if(!u(p))return o}else{if(!r)return f;u=r(p)}o=f}}function bD(n,e,t){let r=n.state.charCategorizer(e),s=r(t);return i=>{let a=r(i);return s==Li.Space&&(s=a),s==a}}function yD(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(),f=n.coordsAtPos(s,e.assoc||-1),p=n.documentTop;if(f)a==null&&(a=f.left-u.left),o=i<0?f.top:f.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=IS(n,{x:m,y:v},!1,i);return ve.cursor(y.pos,y.assoc,void 0,a)}}function dd(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 DM(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=dd(n,s.from,0);a!=s.from&&(i=ve.cursor(a,-1))}else{let a=dd(n,s.from,-1),o=dd(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 Kg(n,e,t){let r=dd(n.state.facet(Jd).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 Fs{constructor(e,t){this.pos=e,this.assoc=t}}function IS(n,e,t,r){let s=n.contentDOM.getBoundingClientRect(),i=s.top+n.viewState.paddingTop,{x:a,y:o}=e,u=o-i,f;for(;;){if(u<0)return new Fs(0,1);if(u>n.viewState.docHeight)return new Fs(n.state.doc.length,-1);if(f=n.elementAtHeight(u),r==null)break;if(f.type==br.Text){let g=n.docView.coordsAt(r<0?f.from:f.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?f.bottom+m:f.top-m}if(n.viewport.from>=f.to||n.viewport.to<=f.from){if(t)return null;if(f.type==br.Text){let m=OD(n,s,f,a,o);return new Fs(m,m==f.from?1:-1)}}if(f.type!=br.Text)return u<(f.top+f.bottom)/2?new Fs(f.from,1):new Fs(f.to,-1);let p=n.docView.lineAt(f.from,2);return(!p||p.length!=f.length)&&(p=n.docView.lineAt(f.from,-2)),BM(n,p,f.from,a,o)}function BM(n,e,t,r,s){let i=-1,a=null,o=1e9,u=1e9,f=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>=f&&(f=Math.min(y.top,f),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>=f+2?u=0:(i=x,o=S,u=Q,a=y))}};if(e.isText()){for(let x=0;x<e.length;){let v=Dn(e.text,x);if(m($d(e.dom,x,v).getClientRects(),x),!o&&!u)break;x=v}return r>(a.left+a.right)/2==(d_(n,i+t)==en.LTR)?new Fs(t+Dn(e.text,i),-1):new Fs(t+i,1)}else{if(!e.length)return new Fs(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:$d(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()?BM(n,g,x,Math.max(a.left,Math.min(a.right,r)),s):r>(a.left+a.right)/2==(d_(n,i+t)==en.LTR)?new Fs(x+g.length,-1):new Fs(x,1)}}function d_(n,e){let t=n.state.doc.lineAt(e);return n.bidiSpans(t)[Zi.find(n.bidiSpans(t),e-t.from,-1,1)].dir}const Fu="";class vD{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=Tn.get(s),o=s.nextSibling;if(o==t){a!=null&&a.breakAfter&&!o&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Tn.get(o);(a&&u?a.breakAfter:(a?a.breakAfter:Yp(s))||Yp(o)&&(s.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>i)&&!SD(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=Tn.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+(wD(e,r.node,r.offset)?t:0))}}function wD(n,e,t){for(;;){if(!e||t<Wi(e))return!1;if(e==n)return!0;t=Va(e)+1,e=e.parentNode}}function SD(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=Tn.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 f_{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class QD{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=UM(e.docView.tile,t,r,0))){let o=i||a?[]:$D(e),u=new vD(o,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=TD(o,this.bounds.from)}else{let o=e.observer.selectionRange,u=i&&i.node==o.focusNode&&i.offset==o.focusOffset||!YS(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),f=a&&a.node==o.anchorNode&&a.offset==o.anchorOffset||!YS(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),p=e.viewport;if((Pe.ios||Pe.chrome)&&e.state.selection.main.empty&&u!=f&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(u,f),g=Math.max(u,f),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,f=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(ve.range(f,u)):this.newSel=ve.single(f,u)}}}function UM(n,e,t,r){if(n.isComposite()){let s=-1,i=-1,a=-1,o=-1;for(let u=0,f=r,p=r;u<n.children.length;u++){let m=n.children[u],g=f+m.length;if(f<e&&g>t)return UM(m,e,t,f);if(g>=e&&s==-1&&(s=u,i=f),f>t&&m.dom.parentNode==n.dom){a=u,o=p;break}p=g,f=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 WM(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,f=null;(i===8||Pe.android&&e.text.length<o-a)&&(u=s.to,f="end");let p=GM(n.state.doc.sliceString(a,o,Fu),e.text,u-a,f);p&&(Pe.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:ht.of(e.text.slice(p.from,p.toB).split(Fu))})}else r&&(!n.hasFocus&&n.state.facet(Xi)||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)}:(Pe.mac||Pe.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:ht.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)}:Pe.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:ht.of([" "])}),t)return xQ(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=DM(n.state.facet(Jd).map(u=>u(n)),r))),n.dispatch({selection:r,scrollIntoView:a,userEvent:o}),!0}else return!1}function xQ(n,e,t,r=-1){if(Pe.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(Pe.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=kD(n,e,t));return n.state.facet(RM).some(u=>u(n,e.from,e.to,i,o))||n.dispatch(o()),!0}function kD(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,f=u<0?i.from:i.to,p=dd(s.facet(Jd).map(m=>m(n)),f,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):"",f=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)+f))}else{let u=s.changes(e),f=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&&YM(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:f||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:f?ve.range(Math.max(0,f.anchor+k),Math.max(0,f.head+k)):v.map(Q)}})}else r={changes:u,selection:f&&s.selection.replaceRange(f)}}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 GM(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 $D(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 f_(t,r)),(s!=t||i!=r)&&e.push(new f_(s,i))),e}function TD(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 jD{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,Pe.safari&&e.contentDOM.addEventListener("input",()=>null),Pe.gecko&&YD(e.contentDOM.ownerDocument)}handleEvent(e){!qD(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=_D(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&&HM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Pe.android&&Pe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Pe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=IM.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||PD.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:Pe.safari&&!Pe.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 h_(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(s){zr(t.state,s)}}}function _D(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(h_(r.value,u))}if(a)for(let o in a){let u=a[o];u&&t(o).observers.push(h_(r.value,u))}}for(let r in Cs)t(r).handlers.push(Cs[r]);for(let r in as)t(r).observers.push(as[r]);return e}const IM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],PD="dthko",HM=[16,17,18,20,91,92,224,225],Xh=6;function zh(n){return Math.max(0,n)*.7+8}function ND(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class CD{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=RY(e.contentDOM),this.atoms=e.state.facet(Jd).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)&&RD(e,t),this.dragging=AD(e,t)&&JM(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&&ND(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=gQ(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=DM(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 RD(n,e){let t=n.state.facet(_M);return t.length?t[0](e):Pe.mac?e.metaKey:e.ctrlKey}function ED(n,e){let t=n.state.facet(PM);return t.length?t[0](e):Pe.mac?!e.altKey:!e.ctrlKey}function AD(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=kd(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 qD(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=Tn.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Cs=Object.create(null),as=Object.create(null),FM=Pe.ie&&Pe.ie_version<15||Pe.ios&&Pe.webkit_version<604;function MD(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(),KM(n,t.value)},50)}function Dm(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function KM(n,e){e=Dm(n.state,hQ,e);let{state:t}=n,r,s=1,i=t.toText(e),a=i.lines==t.selection.ranges.length;if(HS!=null&&t.selection.ranges.every(u=>u.empty)&&HS==i.toString()){let u=-1;r=t.changeByRange(f=>{let p=t.doc.lineAt(f.from);if(p.from==u)return{range:f};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(f.from+m.length)}})}else a?r=t.changeByRange(u=>{let f=i.line(s++);return{changes:{from:u.from,to:u.to,insert:f.text},range:ve.cursor(u.from+f.length)}}):r=t.replaceSelection(i);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}as.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Cs.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);as.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};as.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Cs.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(NM))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=zD(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new CD(n,e,t,r)),r&&n.observer.ignore(()=>{yM(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 p_(n,e,t,r){if(r==1)return ve.cursor(e,t);if(r==2)return mD(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 XD=Pe.ie&&Pe.ie_version<=11;let m_=null,O_=0,g_=0;function JM(n){if(!XD)return n.detail;let e=m_,t=g_;return m_=n,g_=Date.now(),O_=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(O_+1)%3:1}function zD(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=JM(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),f,p=p_(n,u.pos,u.assoc,r);if(t.pos!=u.pos&&!a){let m=p_(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&&(f=LD(s,u.pos))?f:o?s.addRange(p):ve.create([p])}}}function LD(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}Cs.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",Dm(n.state,pQ,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Cs.dragend=n=>(n.inputState.draggedContent=null,!1);function x_(n,e,t,r){if(t=Dm(n.state,hQ,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=n.inputState,a=r&&i&&ED(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}Cs.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&&x_(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 x_(n,e,r,!0),!0}return!1};Cs.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=FM?null:e.clipboardData;return t?(KM(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(MD(n),!1)};function ZD(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 VD(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:Dm(n,pQ,e.join(n.lineBreak)),ranges:t,linewise:r}}let HS=null;Cs.copy=Cs.cut=(n,e)=>{let{text:t,ranges:r,linewise:s}=VD(n.state);if(!t&&!s)return!1;HS=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=FM?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",t),!0):(ZD(n,t),!1)};const e7=Fi.define();function t7(n,e){let t=[];for(let r of n.facet(EM)){let s=r(n,e);s&&t.push(s)}return t.length?n.update({effects:t,annotations:e7.of(!0)}):null}function n7(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=t7(n.state,e);t?n.dispatch(t):n.update([])}},10)}as.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),n7(n)};as.blur=n=>{n.observer.clearSelectionRange(),n7(n)};as.compositionstart=as.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};as.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,Pe.chrome&&Pe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};as.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Cs.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),f=n.posAtDOM(o.endContainer,o.endOffset);return xQ(n,{from:u,to:f,insert:n.state.toText(i)},null),!0}}let s;if(Pe.chrome&&Pe.android&&(s=IM.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 Pe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Pe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>as.compositionend(n,e),20),!1};const b_=new Set;function YD(n){b_.has(n)||(b_.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const y_=["pre-wrap","normal","pre-line","break-spaces"];let Oc=!1;function v_(){Oc=!1}class DD{constructor(e){this.lineWrapping=e,this.doc=ht.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 y_.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=y_.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 f=0;f<a.length;f++){let p=a[f];p<0?f++:this.heightSamples[Math.floor(p*10)]=!0}}return u}}class BD{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class js{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"?br.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 js(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Vt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Vt||(Vt={}));const wp=.001;class rr{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)>wp&&(Oc=!0),this.height=e)}replace(e,t,r){return rr.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:f,fromB:p,toB:m}=s[o],g=i.lineAt(u,Vt.ByPosNoHeight,r.setDoc(t),0,0),x=g.to>=f?g:i.lineAt(f,Vt.ByPosNoHeight,r,0,0);for(m+=x.to-f,f=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,Vt.ByPosNoHeight,r,0,0));p+=g.from-u,u=g.from;let v=bQ.build(r.setDoc(a),e,p,m);i=Gp(i,i.replace(u,f,v))}return i.updateHeight(r,0)}static empty(){return new Ar(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 WD(rr.of(e.slice(0,t)),a,rr.of(e.slice(r)))}}function Gp(n,e){return n==e?n:(n.constructor!=e.constructor&&(Oc=!0),e)}rr.prototype.size=1;const UD=Gt.replace({});class r7 extends rr{constructor(e,t,r){super(e,t),this.deco=r,this.spaceAbove=0}mainBlock(e,t){return new js(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 js(s,0,r,this.spaceAbove,UD):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,Vt.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 Ar extends r7{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 js(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 Ar||s instanceof Vn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Vn?s=new Ar(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):rr.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 Vn extends rr{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 f=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),p=t.doc.lineAt(f),m=o+p.length*u,g=Math.max(r,e-m/2);return new js(p.from,p.length,g,m,0)}else{let f=Math.max(0,Math.min(a-i,Math.floor((e-r)/o))),{from:p,length:m}=t.doc.line(i+f);return new js(p,m,r+o*f,o,0)}}lineAt(e,t,r,s,i){if(t==Vt.ByHeight)return this.blockAt(e,r,s,i);if(t==Vt.ByPosNoHeight){let{from:x,to:v}=r.doc.lineAt(e);return new js(x,v-x,0,0,0)}let{firstLine:a,perLine:o,perChar:u}=this.heightMetrics(r,i),f=r.doc.lineAt(e),p=o+f.length*u,m=f.number-a,g=s+o*m+u*(f.from-i-m);return new js(f.from,f.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:f}=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+f*(e-i-v)}let x=u+f*g.length;a(new js(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 Vn?r[r.length-1]=new Vn(i.length+s):r.push(null,new Vn(s-1))}if(e>0){let i=r[0];i instanceof Vn?r[0]=new Vn(e+i.length):r.unshift(new Vn(e-1),null)}return rr.of(r)}decomposeLeft(e,t){t.push(new Vn(e-1),null)}decomposeRight(e,t){t.push(null,new Vn(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 Vn(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)>=wp&&(u=-2);let x=new Ar(p,m,g);x.outdated=!1,a.push(x),o+=p+1}o<=i&&a.push(null,new Vn(i-o).updateHeight(e,o));let f=rr.of(a);return(u<0||Math.abs(f.height-this.height)>=wp||Math.abs(u-this.heightMetrics(e,t).perLine)>=wp)&&(Oc=!0),Gp(this,f)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class WD extends rr{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==Vt.ByHeight?e<a:e<o,f=u?this.left.lineAt(e,t,r,s,i):this.right.lineAt(e,t,r,a,o);if(this.break||(u?f.to<o:f.from>o))return f;let p=t==Vt.ByPosNoHeight?Vt.ByPosNoHeight:Vt.ByPos;return u?f.join(this.right.lineAt(o,p,r,a,o)):this.left.lineAt(o,p,r,s,i).join(f)}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 f=this.lineAt(u,Vt.ByPos,r,s,i);e<f.from&&this.left.forEachLine(e,f.from-1,r,s,i,a),f.to>=e&&f.from<=t&&a(f),t>f.to&&this.right.forEachLine(f.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&&w_(i,a-1),t<this.length){let o=i.length;this.decomposeRight(t,i),w_(i,o)}return rr.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?rr.of(this.break?[e,null,t]:[e,t]):(this.left=Gp(this.left,e),this.right=Gp(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 w_(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof Vn&&(r=n[e+1])instanceof Vn&&n.splice(e-1,3,new Vn(t.length+1+r.length))}const GD=5;class bQ{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 Ar?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ar(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 r7(a,s,r)):(a||i||s>=GD)&&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 Ar(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new Vn(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 Ar)return e;let t=new Ar(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 Ar)&&!this.isCovered?this.nodes.push(new Ar(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 Ar&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,t,r,s){let i=new bQ(r,e);return ft.spans(t,r,s,i,0),i.finish(r)}}function ID(n,e,t){let r=new HD;return ft.compare(n,e,t,r,0),r.changes}class HD{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,s){(e<t||r&&r.heightRelevant||s&&s.heightRelevant)&&nc(e,t,this.changes,5)}}function FD(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 f=n.parentNode;f&&f!=r.body;)if(f.nodeType==1){let p=f,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(f==n.parentNode?s.innerHeight:u,g.bottom)}f=m.position=="absolute"||m.position=="fixed"?p.offsetParent:p.parentNode}else if(f.nodeType==11)f=f.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 KD(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 JD(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Jg{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 Gt.replace({widget:new eB(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class eB extends Hd{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 S_{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=Q_,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=en.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(mQ).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new DD(t),this.stateDeco=k_(e),this.heightMap=rr.empty().applyChanges(this.stateDeco,ht.empty,this.heightOracle.setDoc(e.doc),[new Fr(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=Gt.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?Q_:new yQ(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=k_(this.state);let s=e.changedRanges,i=Fr.extendWithRanges(s,ID(r,this.stateDeco,e?e.changes:Cn.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);v_(),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 f=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(f||!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(UY)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?en.RTL:en.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 f=0,p=0;if(o.width&&o.height){let{scaleX:j,scaleY:T}=bM(t,o);(j>.005&&Math.abs(this.scaleX-j)>.005||T>.005&&Math.abs(this.scaleY-T)>.005)&&(this.scaleX=j,this.scaleY=T,f|=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,f|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=vM(e.scrollDOM);let v=(this.printing?JD:FD)(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&&!KD(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,f|=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,f|=16)}y>0&&S>0?p=Math.max(y,S):y<0&&S<0&&(p=Math.min(y,S)),v_();for(let T of this.viewports){let R=T.from==this.viewport.from?j:e.docView.measureVisibleLineHeights(T);this.heightMap=(a?rr.empty().applyChanges(this.stateDeco,ht.empty,this.heightOracle,[new Fr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new BD(T.from,R))}Oc&&(f|=2)}let $=!this.viewportIsAppropriate(this.viewport,p)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return $&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(p,this.scrollTarget),f|=this.updateForViewport()),(f&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}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,Vt.ByHeight,i,0,0).from,s.lineAt(o+(1-r)*1e3,Vt.ByHeight,i,0,0).to);if(t){let{head:f}=t.range;if(f<u.from||f>u.to){let p=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(f,Vt.ByPos,i,0,0),g;t.y=="center"?g=(m.top+m.bottom)/2-p/2:t.y=="start"||t.y=="nearest"&&f<u.from?g=m.top:g=m.bottom-p,u=new Lh(s.lineAt(g-1e3/2,Vt.ByHeight,i,0,0).from,s.lineAt(g+p+1e3/2,Vt.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,Vt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Vt.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,Vt.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,Vt.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 Jg(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!=en.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=nB(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 Jg(p,m,Q,k)}o.push(S)},f=p=>{if(p.length<a||p.type!=br.Text)return;let m=tB(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(f):f(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){Jg.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Gt.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,Vt.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),Vt.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 tB(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 nB(n,e){for(let t of n)if(e(t))return t}const Q_={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function k_(n){let e=n.facet(Zm).filter(r=>typeof r!="function"),t=n.facet(OQ).filter(r=>typeof r!="function");return t.length&&e.push(ft.join(t)),e}class yQ{constructor(e,t,r){let s=0,i=0,a=0;this.viewports=r.map(({from:o,to:u})=>{let f=t.lineAt(o,Vt.ByPos,e,0,0).top,p=t.lineAt(u,Vt.ByPos,e,0,0).bottom;return s+=p-f,{from:o,to:u,top:f,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 yQ?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 js(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(" ")}),FS=qe.define({combine:n=>n.indexOf(!0)>-1}),KS=La.newName(),s7=La.newName(),i7=La.newName(),a7={"&light":"."+s7,"&dark":"."+i7};function JS(n,e,t){return new La(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 rB=JS("."+KS,{"&":{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"}},a7),sB={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ex=Pe.ie&&Pe.ie_version<=11;class iB{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new EY,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);(Pe.ie&&Pe.ie_version<=11||Pe.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&&Pe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Pe.chrome&&Pe.chrome_version<126)&&(this.editContext=new lB(e),e.state.facet(Xi)&&(e.contentDOM.editContext=this.editContext.editContext)),ex&&(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(Xi)?r.root.activeElement!=this.dom:!yp(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}(Pe.ie&&Pe.ie_version<=11||Pe.android&&Pe.chrome)&&!r.state.selection.main.empty&&s.focusNode&&ud(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=kd(e.root);if(!t)return!1;let r=Pe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&aB(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let s=yp(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&qY(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,sB),ex&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ex&&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&&yp(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 QD(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=WM(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=$_(t,e.previousSibling||e.target.previousSibling,-1),s=$_(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(Xi)!=e.state.facet(Xi)&&(e.view.contentDOM.editContext=e.state.facet(Xi)?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 $_(n,e,t){for(;e;){let r=Tn.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 T_(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 ud(a.node,a.offset,s,i)&&([t,r,s,i]=[s,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}}function aB(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return T_(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?T_(n,t):null}class lB{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 f=u-o>r.text.length;o==this.from&&i<this.from?o=i:u==this.to&&i>this.to&&(u=i);let p=GM(e.state.sliceDoc(o,u),r.text,(f?s.from:s.to)-o,f?"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:ht.of(r.text.slice(p.from,p.toB).split(`
|
|
212
|
+
`))};if((Pe.mac||Pe.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:o,to:u,insert:ht.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);xQ(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),f=this.toEditorPos(i.rangeEnd);if(u<f){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(Gt.mark({attributes:{style:p}}).range(u,f))}}}e.dispatch({effects:MM.of(Gt.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=kd(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,f)=>{if(r)return;let p=f.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(f)){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+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),f.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||AY(e.parent)||document,this.viewState=new S_(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 Gg(s));for(let s of this.plugins)s.update(this);this.observer=new iB(this),this.inputState=new jD(this),this.inputState.ensureHandlers(this.plugins),this.docView=new c_(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 $n?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(e7))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=t7(i,a),u||(o=1));let f=this.observer.delayedAndroidKey,p=null;if(f?(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=Bp.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=Ip.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(WS))try{g(s)}catch(x){zr(this.state,x,"update listener")}(u||p)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),p&&!WM(this,p)&&f.force&&rc(this.contentDOM,f.key,f.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 S_(e),this.plugins=e.facet(Go).map(r=>new Gg(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new c_(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 Gg(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){zr(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(vM(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 f=[];u&4||([this.measureRequests,f]=[f,this.measureRequests]);let p=f.map(x=>{try{return x.read(this)}catch(v){return zr(this.state,v),j_}}),m=Bp.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<f.length;x++)if(p[x]!=j_)try{let v=f[x];v.write&&v.write(p[x],this)}catch(v){zr(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(WS))o(t)}get themeClasses(){return KS+" "+(this.state.facet(FS)?i7:s7)+" "+this.state.facet(Yh)}updateAttrs(){let e=__(this,XM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Xi)?"true":"false",class:"cm-content",style:`${Pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),__(this,mQ,t);let r=this.observer.ignore(()=>{let s=r_(this.contentDOM,this.contentAttrs,t),i=r_(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);La.mount(this.root,this.styleModules.concat(rB).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 Kg(this,e,u_(this,e,t,r))}moveByGroup(e,t){return Kg(this,e,u_(this,e,t,r=>bD(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 xD(this,e,t,r)}moveVertically(e,t,r){return Kg(this,e,yD(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=IS(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),IS(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[Zi.find(i,e-s.from,-1,t)];return Dp(r,a.dir==en.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(AM)||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>oB)return TM(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||$M(i.isolates,r=a_(this,e))))return i.order;r||(r=a_(this,e));let s=YY(e.text,t,r);return this.bidiCache.push(new Ip(e.from,e.to,t,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Pe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{yM(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 Ns.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ns.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=La.newName(),s=[Yh.of(r),Hu.of(JS(`.${r}`,e))];return t&&t.dark&&s.push(FS.of(!0)),s}static baseTheme(e){return Yl.lowest(Hu.of(JS("."+KS,e,a7)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),s=r&&Tn.get(r)||Tn.get(e);return((t=s==null?void 0:s.root)===null||t===void 0?void 0:t.view)||null}}Ae.styleModule=Hu;Ae.inputHandler=RM;Ae.clipboardInputFilter=hQ;Ae.clipboardOutputFilter=pQ;Ae.scrollHandler=qM;Ae.focusChangeEffect=EM;Ae.perLineTextDirection=AM;Ae.exceptionSink=CM;Ae.updateListener=WS;Ae.editable=Xi;Ae.mouseSelectionStyle=NM;Ae.dragMovesSelection=PM;Ae.clickAddsSelectionRange=_M;Ae.decorations=Zm;Ae.blockWrappers=zM;Ae.outerDecorations=OQ;Ae.atomicRanges=Jd;Ae.bidiIsolatedRanges=LM;Ae.scrollMargins=ZM;Ae.darkTheme=FS;Ae.cspNonce=qe.define({combine:n=>n.length?n[0]:""});Ae.contentAttributes=mQ;Ae.editorAttributes=XM;Ae.lineWrapping=Ae.contentAttributes.of({class:"cm-lineWrapping"});Ae.announce=qt.define();const oB=4096,j_={};class Ip{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:en.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 Ip(t.mapPos(a.from,1),t.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function __(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&&uQ(a,t)}return t}const cB=Pe.mac?"mac":Pe.windows?"win":Pe.linux?"linux":"key";function uB(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 f=t[u];if(/^(cmd|meta|m)$/i.test(f))o=!0;else if(/^a(lt)?$/i.test(f))s=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))a=!0;else if(/^mod$/i.test(f))e=="mac"?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}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 dB=Yl.default(Ae.domEventHandlers({keydown(n,e){return mB(fB(e.state),n,e,"editor")}})),Cc=qe.define({enables:dB}),P_=new WeakMap;function fB(n){let e=n.facet(Cc),t=P_.get(e);return t||P_.set(e,t=pB(e.reduce((r,s)=>r.concat(s),[]))),t}let Na=null;const hB=4e3;function pB(n,e=cB){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,f,p)=>{var m,g;let x=t[a]||(t[a]=Object.create(null)),v=o.split(/ (?!$)/).map(Q=>uB(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=Na={view:$,prefix:k,scope:a};return setTimeout(()=>{Na==j&&(Na=null)},hB),!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),f&&(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 f of o){let p=t[f]||(t[f]=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,e2))}let u=a[e]||a.key;if(u)for(let f of o)i(f,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(f,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return t}let e2=null;function mB(n,e,t,r){e2=e;let s=$Y(e),i=pl(s,0),a=Yo(i)==s.length&&s!=" ",o="",u=!1,f=!1,p=!1;Na&&Na.view==t&&Na.scope==r&&(o=Na.prefix+" ",HM.indexOf(e.keyCode)<0&&(f=!0,Na=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),f=!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)&&!(Pe.windows&&e.ctrlKey&&e.altKey)&&!(Pe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=Za[e.keyCode])&&v!=s?(g(x[o+Dh(v,e,!0)])||e.shiftKey&&(y=Sd[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)),f&&(u=!0),u&&p&&e.stopPropagation(),e2=null,u}function N_(){return gB}const OB=Gt.line({class:"cm-activeLine"}),gB=Ns.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(OB.range(s.from)),e=s.from)}return Gt.set(t)}},{decorations:n=>n.decorations}),Bh="-10000px";class xB{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 f=i[u],p=-1;if(f){for(let m=0;m<this.tooltips.length;m++){let g=this.tooltips[m];g&&g.create==f.create&&(p=m)}if(p<0)a[u]=this.createTooltipView(f,u?a[u-1]:null),o&&(o[u]=!!f.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,f)=>t[f]=u),t.length=o.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function bB(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const tx=qe.define({combine:n=>{var e,t,r;return{position:Pe.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)||bB}}}),C_=new WeakMap,l7=Ns.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(tx);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 xB(n,o7,(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(tx);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(Pe.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=gQ(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(tx).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],f=this.manager.tooltipViews[o],{dom:p}=f,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?f.dom.querySelector(".cm-tooltip-arrow"):null,v=x?7:0,y=g.right-g.left,S=(e=C_.get(f))!==null&&e!==void 0?e:g.bottom-g.top,Q=f.offset||vB,k=this.view.textDirection==en.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&&f.resize!==!1){if(T<this.view.defaultLineHeight){p.style.top=Bh;continue}C_.set(f,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(f.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",R_(p,($-n.parent.left)/s)):(p.style.top=R/i+"px",R_(p,$/s)),x){let q=m.left+(k?Q.x:-Q.x)-($+14-7);x.style.left=q/s+"px"}f.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),f.positioned&&f.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 R_(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const yB=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"}}}),vB={x:0,y:0},o7=qe.define({enables:[l7,yB]});function c7(n,e){let t=n.plugin(l7);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}class ql extends za{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=tr.TrackBefore;ql.prototype.startSide=ql.prototype.endSide=-1;ql.prototype.point=!0;const nx=qe.define(),wB=qe.define(),Sp=qe.define(),E_=qe.define({combine:n=>n.some(e=>e)});function SB(n){return[QB]}const QB=Ns.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(Sp).map(e=>new q_(n,e)),this.fixed=!n.state.facet(E_);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(E_)!=!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(nx),this.view.viewport.from),r=[],s=this.gutters.map(i=>new kB(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==br.Text&&a){t2(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==br.Text){t2(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(Sp),t=n.state.facet(Sp),r=n.docChanged||n.heightChanged||n.viewportChanged||!ft.eq(n.startState.facet(nx),n.state.facet(nx),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 q_(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==en.LTR?{left:r,right:s}:{right:r,left:s}})});function A_(n){return Array.isArray(n)?n:[n]}function t2(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class kB{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 u7(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=[];t2(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(wB)){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 q_{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=A_(t.markers(e)),t.initialSpacer&&(this.spacer=new u7(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=A_(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 u7{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":""),$B(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,f=!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,f=!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&&(f?s=s.nextSibling:this.dom.insertBefore(u.toDOM(e),s)),f&&a++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function $B(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 TB=qe.define(),jB=qe.define(),Io=qe.define({combine(n){return lQ(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,f)=>i(o,u,f)||a(o,u,f):a}return r}})}});class rx extends ql{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function sx(n,e){return n.state.facet(Io).formatNumber(e,n.state)}const _B=Sp.compute([Io],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(TB)},lineMarker(e,t,r){return r.some(s=>s.toDOM)?null:new rx(sx(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let s of e.state.facet(jB)){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 rx(sx(e,X_(e.state.doc.lines)))},updateSpacer(e,t){let r=sx(t.view,X_(t.view.state.doc.lines));return r==e.number?e:new rx(r)},domEventHandlers:n.facet(Io).domEventHandlers,side:"before"}));function M_(n={}){return[Io.of(n),SB(),_B]}function X_(n){let e=9;for(;e<n;)e=e*10+9;return e}const d7=1024;let PB=0;class Kr{constructor(e,t){this.from=e,this.to=t}}class Ue{constructor(e={}){this.id=PB++,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=Rn.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 NB=Object.create(null);class Rn{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):NB,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new Rn(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}}}}Rn.none=new Rn("",Object.create(null),0,8);class ef{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 Rn(r.name,s,r.id,r.flags):r)}return new ef(t)}}const Uh=new WeakMap,z_=new WeakMap;var St;(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"})(St||(St={}));class Qt{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 Hp(this.topNode,e)}cursorAt(e,t=0,r=0){let s=Uh.get(this)||this.topNode,i=new Hp(s);return i.moveTo(e,t),Uh.set(this,i._tree),i}get topNode(){return new ls(this,0,0,null)}resolve(e,t=0){let r=Td(Uh.get(this)||this.topNode,e,t,!1);return Uh.set(this,r),r}resolveInner(e,t=0){let r=Td(z_.get(this)||this.topNode,e,t,!0);return z_.set(this,r),r}resolveStack(e,t=0){return EB(this,e,t)}iterate(e){let{enter:t,leave:r,from:s=0,to:i=this.length}=e,a=e.mode||0,o=(a&St.IncludeAnonymous)>0;for(let u=this.cursor(a|St.IncludeAnonymous);;){let f=!1;if(u.from<=i&&u.to>=s&&(!o&&u.type.isAnonymous||t(u)!==!1)){if(u.firstChild())continue;f=!0}for(;f&&r&&(o||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;f=!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:SQ(Rn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,s)=>new Qt(this.type,t,r,s,this.propValues),e.makeTree||((t,r,s)=>new Qt(Rn.none,t,r,s)))}static build(e){return AB(e)}}Qt.empty=new Qt(Rn.none,[],[],0);class vQ{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 vQ(this.buffer,this.index)}}class Ya{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Rn.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&&!(f7(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 f=i[u++]=s[o++]-r;i[u++]=s[o++]-e,a=Math.max(a,f)}return new Ya(i,a,this.set)}}function f7(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 Td(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 ls&&n.index<0?null:n.parent;if(!a)return n;n=a}let i=r?0:St.IgnoreOverlays;if(r)for(let a=n,o=a.parent;o;a=o,o=a.parent)a instanceof ls&&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 h7{cursor(e=0){return new Hp(this,e)}getChild(e,t=null,r=null){let s=L_(this,e,t,r);return s.length?s[0]:null}getChildren(e,t=null,r=null){return L_(this,e,t,r)}resolve(e,t=0){return Td(this,e,t,!1)}resolveInner(e,t=0){return Td(this,e,t,!0)}matchContext(e){return n2(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 ls=class Qp extends h7{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:f}=o._tree,p=t>0?u.length:-1;e!=p;e+=t){let m=u[e],g=f[e]+o.from;if(!(!(i&St.EnterBracketed&&m instanceof Qt&&((a=ic.get(m))===null||a===void 0?void 0:a.overlay)===null&&(g>=r||g+m.length<=r))&&!f7(s,r,g,g+m.length))){if(m instanceof Ya){if(i&St.ExcludeBuffers)continue;let x=m.findChild(0,m.buffer.length,t,r-g,s);if(x>-1)return new Ks(new CB(o,m,e,g),null,x)}else if(i&St.IncludeAnonymous||!m.type.isAnonymous||wQ(m)){let x;if(!(i&St.IgnoreMounts)&&(x=ic.get(m))&&!x.overlay)return new Qp(x.tree,g,e,o);let v=new Qp(m,g,e,o);return i&St.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(t<0?m.children.length-1:0,t,r,s,i)}}}if(i&St.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&St.IgnoreOverlays)&&(s=ic.get(this._tree))&&s.overlay){let i=e-this.from,a=r&St.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 Qp(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 L_(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 n2(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 CB{constructor(e,t,r,s){this.parent=e,this.buffer=t,this.index=r,this.start=s}}class Ks extends h7{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 Ks(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&St.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 Ks(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 Ks(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 Ks(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 Qt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function p7(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 ls&&t.index<0?null:t.parent,s=n.slice();return r?s[e]=r:s.splice(e,1),new RB(s,t)}class RB{constructor(e,t){this.heads=e,this.node=t}get next(){return p7(this.heads)}}function EB(n,e,t){let r=n.resolveInner(e,t),s=null;for(let i=r instanceof ls?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 ls(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(Td(o,e,t,!1))}}return s?p7(s):r}class Hp{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&~St.EnterBracketed,e instanceof ls)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 ls?(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&St.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&St.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&St.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&St.IncludeAnonymous||o instanceof Ya||!o.type.isAnonymous||wQ(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 Ks(this.buffer,t,this.stack[s]);return this.bufferNode=new Ks(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 n2(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 n2(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 wQ(n){return n.children.some(e=>e instanceof Ya||!e.type.isAnonymous||wQ(e))}function AB(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:s=d7,reused:i=[],minRepeatType:a=r.types.length}=n,o=Array.isArray(t)?new vQ(t,t.length):t,u=r.types,f=0,p=0;function m(T,R,N,q,z,L){let{id:E,start:V,end:D,size:C}=o,G=p,A=f;if(C<0)if(o.next(),C==-1){let X=i[E];N.push(X),q.push(V-T);return}else if(C==-3){f=E;return}else if(C==-4){p=E;return}else throw new RangeError(`Unrecognized record size: ${C}`);let W=u[E],H,U,ee=V-T;if(D-V<=s&&(U=S(o.pos-R,z))){let X=new Uint16Array(U.size-U.skip),B=o.pos-U.size,K=X.length;for(;o.pos>B;)K=Q(U.start,X,K);H=new Ya(X,D-U.start,r),ee=U.start-T}else{let X=o.pos-C;o.next();let B=[],K=[],Z=E>=a?E:-1,I=0,J=D;for(;o.pos>X;)Z>=0&&o.id==Z&&o.size>=0?(o.end<=J-s&&(v(B,K,V,I,o.end,J,Z,G,A),I=B.length,J=o.end),o.next()):L>2500?g(V,X,B,K):m(V,X,B,K,Z,L+1);if(Z>=0&&I>0&&I<B.length&&v(B,K,V,I,V,J,Z,G,A),B.reverse(),K.reverse(),Z>-1&&I>0){let ne=x(W,A);H=SQ(W,B,K,0,B.length,0,D-V,ne,ne)}else H=y(W,B,K,D-V,G-D,A)}N.push(H),q.push(ee)}function g(T,R,N,q){let z=[],L=0,E=-1;for(;o.pos>R;){let{id:V,start:D,end:C,size:G}=o;if(G>4)o.next();else{if(E>-1&&D<E)break;E<0&&(E=C-s),z.push(V,D,C),L++,o.next()}}if(L){let V=new Uint16Array(L*4),D=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]-D,V[G++]=z[C+2]-D,V[G++]=G;N.push(new Ya(V,z[2]-D,r)),q.push(D-T)}}function x(T,R){return(N,q,z)=>{let L=0,E=N.length-1,V,D;if(E>=0&&(V=N[E])instanceof Qt){if(!E&&V.type==T&&V.length==z)return V;(D=V.prop(Ue.lookAhead))&&(L=q[E]+V.length+D)}return y(T,N,q,z,L,R)}}function v(T,R,N,q,z,L,E,V,D){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,D)),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 Qt(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 D=N.pos-T;N.pos>D;){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<D||N.start<E)break;let A=N.id>=a?4:0,W=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=W,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 D=o.pos-(E-4);for(;o.pos>D;)N=Q(T,R,N)}R[--N]=V,R[--N]=L-T,R[--N]=z-T,R[--N]=q}else E==-3?f=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 Qt(u[n.topID],k.reverse(),$.reverse(),j)}const Z_=new WeakMap;function kp(n,e){if(!n.isAnonymous||e instanceof Ya||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 Qt)){t=1;break}t+=kp(n,r)}Z_.set(e,t)}return t}function SQ(n,e,t,r,s,i,a,o,u){let f=0;for(let v=r;v<s;v++)f+=kp(n,e[v]);let p=Math.ceil(f*1.5/8),m=[],g=[];function x(v,y,S,Q,k){for(let $=S;$<Q;){let j=$,T=y[$],R=kp(n,v[$]);for($++;$<Q;$++){let N=kp(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(SQ(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 QQ{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 Ks?this.setBuffer(e.context.buffer,e.index,t):e instanceof ls&&this.map.set(e.tree,t)}get(e){return e instanceof Ks?this.getBuffer(e.context.buffer,e.index):e instanceof ls?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 Di{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 Di(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,f=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||f){let x=Math.max(g.from,u)-f,v=Math.min(g.to,m)-f;g=x>=v?null:new Di(x,v,g.tree,g.offset+f,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,f=p.toA-p.toB}return s}}class kQ{startParse(e,t,r){return typeof e=="string"&&(e=new qB(e)),r=r?r.length?r.map(s=>new Kr(s.from,s.to)):[new Kr(0,0)]:[new Kr(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 qB{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 m7(n){return(e,t,r,s)=>new XB(e,n,t,r,s)}class V_{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 Y_(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class MB{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 r2=new Ue({perNode:!0});class XB{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 Qt(r.type,r.children,r.positions,r.length,r.propValues.concat([[r2,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 ZB(this.fragments),t=null,r=null,s=new Hp(new ls(this.baseTree,this.ranges[0].from,0,null),St.IncludeAnonymous|St.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 f=t.mounts.find(p=>p.frag.from<=s.from&&p.frag.to>=s.to&&p.mount.overlay);if(f)for(let p of f.mount.overlay){let m=p.from+f.pos,g=p.to+f.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=zB(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||(LB(s),t&&t.depth++,r&&r.depth++);let f=e.findMounts(s.from,i.parser);if(typeof i.overlay=="function")t=new MB(i.parser,i.overlay,f,this.inner.length,s.from,!!i.bracketed,s.tree,t);else{let p=U_(this.ranges,i.overlay||(s.from<s.to?[new Kr(s.from,s.to)]:[]));p.length&&Y_(p),(p.length||!i.overlay)&&this.inner.push(new V_(i.parser,p.length?i.parser.startParse(this.input,W_(f,p),p):i.parser.startParse(""),i.overlay?i.overlay.map(m=>new Kr(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 Kr(s.from,s.to)),u.from<u.to)){let f=t.ranges.length-1;f>=0&&t.ranges[f].to==u.from?t.ranges[f]={from:t.ranges[f].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 f=U_(this.ranges,t.ranges);f.length&&(Y_(f),this.inner.splice(t.index,0,new V_(t.parser,t.parser.startParse(this.input,W_(t.mounts,f),f),t.ranges.map(p=>new Kr(p.from-t.start,p.to-t.start)),t.bracketed,t.target,f[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function zB(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 D_(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 LB(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 f(p,m,g,x,v,y){let S=t[y],Q=[],k=[];D_(a,p,S,Q,k,x);let $=o[S+1],j=o[S+2];u.push(Q.length);let T=y?f(S+4,o[S+3],a.set.types[o[S]],$,j-$,y-1):e.toTree();return Q.push(T),k.push($-x),D_(a,o[S+3],m,Q,k,x),new Qt(g,Q,k,v)}s.children[i]=f(0,o.length,Rn.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 ls(m,g+n.from,p,n._tree))}}class B_{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(St.IncludeAnonymous|St.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,St.IgnoreOverlays|St.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 Qt)t=t.children[0];else break}return!1}}let ZB=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(r2))!==null&&t!==void 0?t:r.to,this.inner=new B_(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(r2))!==null&&e!==void 0?e:t.to,this.inner=new B_(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 U_(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 Kr(u.from,a),u.to>o&&t.splice(i+1,0,new Kr(o,u.to))):u.to>o?t[i--]=new Kr(o,u.to):t.splice(i--,1))}}return r}function VB(n,e,t,r){let s=0,i=0,a=!1,o=!1,u=-1e9,f=[];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&&f.push(new Kr(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 f}function W_(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),f=Math.min(i.to,o);if(s.overlay){let p=s.overlay.map(g=>new Kr(g.from+r,g.to+r)),m=VB(e,p,u,f);for(let g=0,x=u;;g++){let v=g==m.length,y=v?f:m[g].from;if(y>x&&t.push(new Di(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 Di(u,f,s.tree,-a,i.from>=a||i.openStart,i.to<=o||i.openEnd))}return t}let YB=0;class Mr{constructor(e,t,r,s){this.name=e,this.set=t,this.base=r,this.modified=s,this.id=YB++}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 Mr&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let s=new Mr(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 Fp(e);return r=>r.modified.indexOf(t)>-1?r:Fp.get(r.base||r,r.modified.concat(t).sort((s,i)=>s.id-i.id))}}let DB=0;class Fp{constructor(e){this.name=e,this.instances=[],this.id=DB++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(o=>o.base==e&&BB(t,o.modified));if(r)return r;let s=[],i=new Mr(e.name,s,e,t);for(let o of t)o.instances.push(i);let a=UB(t);for(let o of e.set)if(!o.modified.length)for(let u of a)s.push(Fp.get(o,u));return i}}function BB(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function UB(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 Wa(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,f=i[u];if(!f)throw new RangeError("Invalid path: "+s);let p=new jd(r,a,u>0?i.slice(0,u):null);e[f]=p.sort(e[f])}}return O7.add(e)}const O7=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 jd(s.tags,s.mode,s.context);t?t.next=i:r=i,t=i}return r}});class jd{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}}jd.empty=new jd([],2,null);function g7(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 f=t[u.id];if(f){a=a?a+" "+f:f;break}}return a},scope:r}}function WB(n,e){let t=null;for(let r of n){let s=r.style(e);s&&(t=t?t+" "+s:s)}return t}function GB(n,e,t,r=0,s=n.length){let i=new IB(r,Array.isArray(e)?e:[e],t);i.highlightRange(n.cursor(),r,s,"",i.highlighters),i.flush(s)}class IB{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 f=s,p=HB(e)||jd.empty,m=WB(i,p.tags);if(m&&(f&&(f+=" "),f+=m,p.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(t,o),f),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),f),!(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),f))}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),f)}while(e.nextSibling());e.parent()}}}function HB(n){let e=n.type.prop(O7);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const je=Mr.define,Wh=je(),Ta=je(),G_=je(Ta),I_=je(Ta),ja=je(),Gh=je(ja),ix=je(ja),Is=je(),hl=je(Is),Ws=je(),Gs=je(),s2=je(),qu=je(s2),Ih=je(),Y={comment:Wh,lineComment:je(Wh),blockComment:je(Wh),docComment:je(Wh),name:Ta,variableName:je(Ta),typeName:G_,tagName:je(G_),propertyName:I_,attributeName:je(I_),className:je(Ta),labelName:je(Ta),namespace:je(Ta),macroName:je(Ta),literal:ja,string:Gh,docString:je(Gh),character:je(Gh),attributeValue:je(Gh),number:ix,integer:je(ix),float:je(ix),bool:je(ja),regexp:je(ja),escape:je(ja),color:je(ja),url:je(ja),keyword:Ws,self:je(Ws),null:je(Ws),atom:je(Ws),unit:je(Ws),modifier:je(Ws),operatorKeyword:je(Ws),controlKeyword:je(Ws),definitionKeyword:je(Ws),moduleKeyword:je(Ws),operator:Gs,derefOperator:je(Gs),arithmeticOperator:je(Gs),logicOperator:je(Gs),bitwiseOperator:je(Gs),compareOperator:je(Gs),updateOperator:je(Gs),definitionOperator:je(Gs),typeOperator:je(Gs),controlOperator:je(Gs),punctuation:s2,separator:je(s2),bracket:qu,angleBracket:je(qu),squareBracket:je(qu),paren:je(qu),brace:je(qu),content:Is,heading:hl,heading1:je(hl),heading2:je(hl),heading3:je(hl),heading4:je(hl),heading5:je(hl),heading6:je(hl),contentSeparator:je(Is),list:je(Is),quote:je(Is),emphasis:je(Is),strong:je(Is),link:je(Is),monospace:je(Is),strikethrough:je(Is),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:Ih,documentMeta:je(Ih),annotation:je(Ih),processingInstruction:je(Ih),definition:Mr.defineModifier("definition"),constant:Mr.defineModifier("constant"),function:Mr.defineModifier("function"),standard:Mr.defineModifier("standard"),local:Mr.defineModifier("local"),special:Mr.defineModifier("special")};for(let n in Y){let e=Y[n];e instanceof Mr&&(e.name=n)}g7([{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 ax;const Ql=new Ue;function $Q(n){return qe.define({combine:n?e=>e.concat(n):void 0})}const TQ=new Ue;class Jr{constructor(e,t,r=[],s=""){this.data=e,this.name=s,xt.prototype.hasOwnProperty("tree")||Object.defineProperty(xt.prototype,"tree",{get(){return nn(this)}}),this.parser=t,this.extension=[xc.of(this),xt.languageData.of((i,a,o)=>{let u=H_(i,a,o),f=u.type.prop(Ql);if(!f)return[];let p=i.facet(f),m=u.type.prop(TQ);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 H_(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 f=i.children[u];f instanceof Qt&&s(f,i.positions[u]+a)}};return s(nn(e),0),r}get allowsNesting(){return!0}}Jr.setState=qt.define();function H_(n,e,t){let r=n.facet(xc),s=nn(n).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,t,St.ExcludeBuffers|St.EnterBracketed))i.type.isTop&&(s=i);return s}class Da extends Jr{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=$Q(e.languageData);return new Da(t,e.parser.configure({props:[Ql.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Da(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function nn(n){let e=n.field(Jr.state,!1);return e?e.tree:Qt.empty}class FB{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 _d{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 _d(e,t,[],Qt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new FB(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Qt.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(Di.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(Di.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=F_(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((f,p,m,g)=>u.push({fromA:f,toA:p,fromB:m,toB:g})),r=Di.applyChanges(r,u),s=Qt.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let f of this.skipped){let p=e.mapPos(f.from,1),m=e.mapPos(f.to,-1);p<m&&o.push({from:p,to:m})}}}return new _d(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=F_(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 kQ{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 f of s)u.tempSkipped.push(f);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new Qt(Rn.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 F_(n,e,t){return Di.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=_d.create(e.facet(xc).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new gc(r)}}Jr.state=ai.define({create:gc.init,update(n,e){for(let t of e.effects)if(t.is(Jr.setState))return t.value;return e.startState.facet(xc)!=e.state.facet(xc)?gc.init(e.state):n.apply(e)}});let x7=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(x7=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const lx=typeof navigator<"u"&&(!((ax=navigator.scheduling)===null||ax===void 0)&&ax.isInputPending)?()=>navigator.scheduling.isInputPending():null,KB=Ns.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(Jr.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(Jr.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=x7(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(Jr.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!lx?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<s&&r.doc.length>s+1e3,u=i.context.work(()=>lx&&lx()||Date.now()>a,s+(o?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Jr.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=>zr(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=>[Jr.state,KB,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 Kp{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 Kp(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 JB=qe.define(),tf=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 Jp(n){let e=n.facet(tf);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function em(n,e){let t="",r=n.tabSize,s=n.facet(tf)[0];if(s==" "){for(;e>=r;)t+=" ",e-=r;s=" "}for(let i=0;i<e;i++)t+=s;return t}function b7(n,e){n instanceof xt&&(n=new Bm(n));for(let r of n.state.facet(JB)){let s=r(n,e);if(s!==void 0)return s}let t=nn(n.state);return t.length>=e?eU(n,t,e):null}class Bm{constructor(e,t={}){this.state=e,this.options=t,this.unit=Jp(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 Ui(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 eU(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 y7(r,n,t)}function y7(n,e,t){for(let r=n;r;r=r.next){let s=nU(r.node);if(s)return s(jQ.create(e,t,r))}return 0}function tU(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function nU(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=>v7(a,!0,1,void 0,i&&!tU(a)?s.from:void 0)}return n.parent==null?rU:null}function rU(){return 0}class jQ extends Bm{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 jQ(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(sU(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return y7(this.context.next,this.base,this.pos)}}function sU(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function iU(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 f=/^ */.exec(i.text.slice(t.to-i.from))[0].length;return{from:t.from,to:t.to+f}}o=u.to}}function fd({closing:n,align:e=!0,units:t=1}){return r=>v7(r,e,t,n)}function v7(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?iU(n):null;return u?o?n.column(u.from):n.column(u.to):n.baseIndent+(o?0:n.unit*t)}const w7=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 aU=qe.define(),Bl=new Ue;function Um(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 Wm{constructor(e,t){this.specs=e;let r;function s(o){let u=La.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 Jr?o=>o.prop(Ql)==a.data:a?o=>o==a:void 0,this.style=g7(e.map(o=>({tag:o.tag,class:o.class||s(Object.assign({},o,{tag:null}))})),{all:i}).style,this.module=r?new La(r):null,this.themeType=t.themeType}static define(e,t){return new Wm(e,t||{})}}const i2=qe.define(),lU=qe.define({combine(n){return n.length?[n[0]]:null}});function ox(n){let e=n.facet(i2);return e.length?e:n.facet(lU)}function oU(n,e){let t=[uU],r;return n instanceof Wm&&(n.module&&t.push(Ae.styleModule.of(n.module)),r=n.themeType),r?t.push(i2.computeN([Ae.darkTheme],s=>s.facet(Ae.darkTheme)==(r=="dark")?[n]:[])):t.push(i2.of(n)),t}class cU{constructor(e){this.markCache=Object.create(null),this.tree=nn(e.state),this.decorations=this.buildDeco(e,ox(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=nn(e.state),r=ox(e.state),s=r!=ox(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 Gt.none;let r=new vd;for(let{from:s,to:i}of e.visibleRanges)GB(this.tree,t,(a,o,u)=>{r.add(a,o,this.markCache[u]||(this.markCache[u]=Gt.mark({class:u})))},s,i);return r.finish()}}const uU=Yl.high(Ns.fromClass(cU,{decorations:n=>n.decorations})),dU=1e4,fU="()[]{}",S7=new Ue;function a2(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 l2(n){let e=n.type.prop(S7);return e?e(n.node):n}function Ho(n,e,t,r={}){let s=r.maxScanDistance||dU,i=r.brackets||fU,a=nn(n),o=a.resolveInner(e,t);for(let u=o;u;u=u.parent){let f=a2(u.type,t,i);if(f&&u.from<u.to){let p=l2(u);if(p&&(t>0?e>=p.from&&e<p.to:e>p.from&&e<=p.to))return hU(n,e,t,u,p,f,i)}}return pU(n,e,t,a,o.type,s,i)}function hU(n,e,t,r,s,i,a){let o=r.parent,u={from:s.from,to:s.to},f=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(f==0&&i.indexOf(p.type.name)>-1&&p.from<p.to){let m=l2(p);return{start:u,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(a2(p.type,t,a))f++;else if(a2(p.type,-t,a)){if(f==0){let m=l2(p);return{start:u,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}f--}}while(t<0?p.prevSibling():p.nextSibling());return{start:u,matched:!1}}function pU(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 f={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:f,end:{from:v+y,to:v+y+1},matched:Q>>1==u>>1};m--}}t>0&&(g+=x.length)}return p.done?{start:f,matched:!1}:null}const mU=Object.create(null),K_=[Rn.none],J_=[],eP=Object.create(null),OU=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"]])OU[n]=gU(mU,e);function cx(n,e){J_.indexOf(n)>-1||(J_.push(n),console.warn(e))}function gU(n,e){let t=[];for(let o of e.split(" ")){let u=[];for(let f of o.split(".")){let p=n[f]||Y[f];p?typeof p=="function"?u.length?u=u.map(p):cx(f,`Modifier ${f} used at start of tag`):u.length?cx(f,`Tag ${f} used as modifier`):u=Array.isArray(p)?p:[p]:cx(f,`Unknown highlighting tag ${f}`)}for(let f of u)t.push(f)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+t.map(o=>o.id),i=eP[s];if(i)return i.id;let a=eP[s]=Rn.define({id:K_.length,name:r,props:[Wa({[r]:t})]});return K_.push(a),a.id}en.RTL,en.LTR;const xU=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=PQ(n.state,t.from);return r.line?bU(n):r.block?vU(n):!1};function _Q(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 bU=_Q(QU,0),yU=_Q(Q7,0),vU=_Q((n,e)=>Q7(n,e,SU(e)),0);function PQ(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Xu=50;function wU(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,f=i.length-o;if(i.slice(f-e.length,f)==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 SU(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 Q7(n,e,t=e.selection.ranges){let r=t.map(i=>PQ(e,i.from).block);if(!r.every(i=>i))return null;let s=t.map((i,a)=>wU(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:f,close:p}=o;i.push({from:f.pos-u.open.length,to:f.pos+f.margin},{from:p.pos-p.margin,to:p.pos+u.close.length})}return{changes:i}}return null}function QU(n,e,t=e.selection.ranges){let r=[],s=-1;for(let{from:i,to:a}of t){let o=r.length,u=1e9,f=PQ(e,i).line;if(f){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+f.length)==f?g:-1;g<m.text.length&&g<u&&(u=g),r.push({line:m,comment:v,token:f,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:f,empty:p,single:m}of r)(m||!p)&&i.push({from:o.from+f,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 f=a.from+o,p=f+u.length;a.text[p-a.from]==" "&&p++,i.push({from:f,to:p})}return{changes:i}}return null}const o2=Fi.define(),kU=Fi.define(),$U=qe.define(),k7=qe.define({combine(n){return lQ(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)})}}),$7=ai.define({create(){return Js.empty},update(n,e){let t=e.state.facet(k7),r=e.annotation(o2);if(r){let u=gr.fromTransaction(e,r.selection),f=r.side,p=f==0?n.undone:n.done;return u?p=tm(p,p.length,t.minDepth,u):p=_7(p,e.startState.selection),new Js(f==0?r.rest:p,f==0?p:r.rest)}let s=e.annotation(kU);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation($n.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let i=gr.fromTransaction(e),a=e.annotation($n.time),o=e.annotation($n.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 Js(n.done.map(gr.fromJSON),n.undone.map(gr.fromJSON))}});function TU(n={}){return[$7,k7.of(n),Ae.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?T7:e.inputType=="historyRedo"?c2:null;return r?(e.preventDefault(),r(t)):!1}})]}function Gm(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let s=t.field($7,!1);if(!s)return!1;let i=s.pop(n,t,e);return i?(r(i),!0):!1}}const T7=Gm(0,!1),c2=Gm(1,!1),jU=Gm(0,!0),_U=Gm(1,!0);class gr{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 gr(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 gr(e.changes&&Cn.fromJSON(e.changes),[],e.mapped&&ni.fromJSON(e.mapped),e.startSelection&&ve.fromJSON(e.startSelection),e.selectionsAfter.map(ve.fromJSON))}static fromTransaction(e,t){let r=es;for(let s of e.startState.facet($U)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new gr(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,es)}static selection(e){return new gr(void 0,es,void 0,void 0,e)}}function tm(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 PU(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 f=t[u++],p=t[u++];o>=f&&a<=p&&(r=!0)}}),r}function NU(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function j7(n,e){return n.length?e.length?n.concat(e):n:e}const es=[],CU=200;function _7(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-CU));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),tm(n,n.length-1,1e9,t.setSelAfter(r)))}else return[gr.selection([e])]}function RU(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 ux(n,e){if(!n.length)return n;let t=n.length,r=es;for(;t;){let s=EU(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?[gr.selection(r)]:es}function EU(n,e,t){let r=j7(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):es,t);if(!n.changes)return gr.selection(r);let s=n.changes.map(e),i=e.mapDesc(n.changes,!0),a=n.mapped?n.mapped.composeDesc(i):i;return new gr(s,qt.mapEffects(n.effects,e),a,n.startSelection.map(i),r)}const AU=/^(input\.type|delete)($|\.)/;class Js{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 Js(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||AU.test(r))&&(!o.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,PU(o.changes,e.changes))||r=="input.type.compose")?a=tm(a,a.length-1,s.minDepth,new gr(e.changes.compose(o.changes),j7(qt.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,es)):a=tm(a,a.length,s.minDepth,e),new Js(a,es,t,r)}addSelection(e,t,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:es;return i.length>0&&t-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&NU(i[i.length-1],e)?this:new Js(_7(this.done,e),this.undone,t,r)}addMapping(e){return new Js(ux(this.done,e),ux(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:o2.of({side:e,rest:RU(s),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let o=s.length==1?es:s.slice(0,s.length-1);return i.mapped&&(o=ux(o,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:o2.of({side:e,rest:o,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Js.empty=new Js(es,es);const qU=[{key:"Mod-z",run:T7,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:c2,preventDefault:!0},{linux:"Ctrl-Shift-z",run:c2,preventDefault:!0},{key:"Mod-u",run:jU,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:_U,preventDefault:!0}];function Rc(n,e){return ve.create(n.ranges.map(e),n.mainIndex)}function As(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function qs({state:n,dispatch:e},t){let r=Rc(n.selection,t);return r.eq(n.selection,!0)?!1:(e(As(n,r)),!0)}function Im(n,e){return ve.cursor(e?n.to:n.from)}function P7(n,e){return qs(n,t=>t.empty?n.moveByChar(t,e):Im(t,e))}function Fn(n){return n.textDirectionAt(n.state.selection.main.head)==en.LTR}const N7=n=>P7(n,!Fn(n)),C7=n=>P7(n,Fn(n));function R7(n,e){return qs(n,t=>t.empty?n.moveByGroup(t,e):Im(t,e))}const MU=n=>R7(n,!Fn(n)),XU=n=>R7(n,Fn(n));function zU(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 Hm(n,e,t){let r=nn(n).resolveInner(e.head),s=t?Ue.closedBy:Ue.openedBy;for(let u=e.head;;){let f=t?r.childAfter(u):r.childBefore(u);if(!f)break;zU(n,f,s)?r=f:u=t?f.to:f.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 LU=n=>qs(n,e=>Hm(n.state,e,!Fn(n))),ZU=n=>qs(n,e=>Hm(n.state,e,Fn(n)));function E7(n,e){return qs(n,t=>{if(!t.empty)return Im(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const A7=n=>E7(n,!1),q7=n=>E7(n,!0);function M7(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 X7(n,e){let t=M7(n),{state:r}=n,s=Rc(r.selection,a=>a.empty?n.moveVertically(a,e,t.height):Im(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,f=o.bottom-t.marginBottom;a&&a.top>u&&a.bottom<f&&(i=Ae.scrollIntoView(s.main.head,{y:"start",yMargin:a.top-u}))}return n.dispatch(As(r,s),{effects:i}),!0}const tP=n=>X7(n,!1),u2=n=>X7(n,!0);function Ga(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 VU=n=>qs(n,e=>Ga(n,e,!0)),YU=n=>qs(n,e=>Ga(n,e,!1)),DU=n=>qs(n,e=>Ga(n,e,!Fn(n))),BU=n=>qs(n,e=>Ga(n,e,Fn(n))),UU=n=>qs(n,e=>ve.cursor(n.lineBlockAt(e.head).from,1)),WU=n=>qs(n,e=>ve.cursor(n.lineBlockAt(e.head).to,-1));function GU(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(As(n,s)),!0):!1}const IU=({state:n,dispatch:e})=>GU(n,e);function os(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(As(n.state,t)),!0)}function z7(n,e){return os(n,t=>n.moveByChar(t,e))}const L7=n=>z7(n,!Fn(n)),Z7=n=>z7(n,Fn(n));function V7(n,e){return os(n,t=>n.moveByGroup(t,e))}const HU=n=>V7(n,!Fn(n)),FU=n=>V7(n,Fn(n)),KU=n=>os(n,e=>Hm(n.state,e,!Fn(n))),JU=n=>os(n,e=>Hm(n.state,e,Fn(n)));function Y7(n,e){return os(n,t=>n.moveVertically(t,e))}const D7=n=>Y7(n,!1),B7=n=>Y7(n,!0);function U7(n,e){return os(n,t=>n.moveVertically(t,e,M7(n).height))}const nP=n=>U7(n,!1),rP=n=>U7(n,!0),eW=n=>os(n,e=>Ga(n,e,!0)),tW=n=>os(n,e=>Ga(n,e,!1)),nW=n=>os(n,e=>Ga(n,e,!Fn(n))),rW=n=>os(n,e=>Ga(n,e,Fn(n))),sW=n=>os(n,e=>ve.cursor(n.lineBlockAt(e.head).from)),iW=n=>os(n,e=>ve.cursor(n.lineBlockAt(e.head).to)),sP=({state:n,dispatch:e})=>(e(As(n,{anchor:0})),!0),iP=({state:n,dispatch:e})=>(e(As(n,{anchor:n.doc.length})),!0),aP=({state:n,dispatch:e})=>(e(As(n,{anchor:n.selection.main.anchor,head:0})),!0),lP=({state:n,dispatch:e})=>(e(As(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),aW=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),lW=({state:n,dispatch:e})=>{let t=Fm(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},oW=({state:n,dispatch:e})=>{let t=Rc(n.selection,r=>{let s=nn(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(As(n,t)),!0)};function W7(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(f=>f.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(As(t,ve.create(s,s.length-1))),!0)}const cW=n=>W7(n,!1),uW=n=>W7(n,!0),dW=({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(As(n,r)),!0):!1};function nf(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 G7=(n,e,t)=>nf(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 f=Ui(o,i.tabSize),p=f%Jp(i)||Jp(i);for(let m=0;m<p&&o[o.length-1-m]==" ";m++)s--;u=s}else u=Dn(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=Dn(a.text,u-a.from,!1,!1)+a.from);return u}),d2=n=>G7(n,!1,!0),I7=n=>G7(n,!0,!1),H7=(n,e)=>nf(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=Dn(i.text,r-i.from,e)+i.from,f=i.text.slice(Math.min(r,u)-i.from,Math.max(r,u)-i.from),p=a(f);if(o!=null&&p!=o)break;(f!=" "||r!=t.head)&&(o=p),r=u}return r}),F7=n=>H7(n,!1),fW=n=>H7(n,!0),hW=n=>nf(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),pW=n=>nf(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),mW=n=>nf(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),OW=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ht.of(["",""])},range:ve.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},gW=({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:Dn(i.text,s-i.from,!1)+i.from,o=s==i.to?s+1:Dn(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 Fm(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 K7(n,e,t){if(n.readOnly)return!1;let r=[],s=[];for(let i of Fm(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 xW=({state:n,dispatch:e})=>K7(n,e,!1),bW=({state:n,dispatch:e})=>K7(n,e,!0);function J7(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of Fm(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 yW=({state:n,dispatch:e})=>J7(n,e,!1),vW=({state:n,dispatch:e})=>J7(n,e,!0),wW=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Fm(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 SW(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=nn(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 oP=eX(!1),QW=eX(!0);function eX(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&&SW(e,i);n&&(i=a=(a<=o.to?o:e.doc.lineAt(a)).to);let f=new Bm(e,{simulateBreak:i,simulateDoubleBreak:!!u}),p=b7(f,i);for(p==null&&(p=Ui(/^\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=["",em(e,p)];return u&&m.push(em(e,f.lineIndent(o.from,-1))),{changes:{from:i,to:a,insert:ht.of(m)},range:ve.cursor(i+1+m[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function NQ(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 kW=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Bm(n,{overrideIndentation:i=>{let a=t[i];return a??-1}}),s=NQ(n,(i,a,o)=>{let u=b7(r,i.from);if(u==null)return;/\S/.test(i.text)||(u=0);let f=/^\s*/.exec(i.text)[0],p=em(n,u);(f!=p||o.from<i.from+f.length)&&(t[i.from]=u,a.push({from:i.from,to:i.from+f.length,insert:p}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},$W=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(NQ(n,(t,r)=>{r.push({from:t.from,insert:n.facet(tf)})}),{userEvent:"input.indent"})),!0),TW=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(NQ(n,(t,r)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let i=Ui(s,n.tabSize),a=0,o=em(n,Math.max(0,i-Jp(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),jW=n=>(n.setTabFocusMode(),!0),_W=[{key:"Ctrl-b",run:N7,shift:L7,preventDefault:!0},{key:"Ctrl-f",run:C7,shift:Z7},{key:"Ctrl-p",run:A7,shift:D7},{key:"Ctrl-n",run:q7,shift:B7},{key:"Ctrl-a",run:UU,shift:sW},{key:"Ctrl-e",run:WU,shift:iW},{key:"Ctrl-d",run:I7},{key:"Ctrl-h",run:d2},{key:"Ctrl-k",run:hW},{key:"Ctrl-Alt-h",run:F7},{key:"Ctrl-o",run:OW},{key:"Ctrl-t",run:gW},{key:"Ctrl-v",run:u2}],PW=[{key:"ArrowLeft",run:N7,shift:L7,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:MU,shift:HU,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:DU,shift:nW,preventDefault:!0},{key:"ArrowRight",run:C7,shift:Z7,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:XU,shift:FU,preventDefault:!0},{mac:"Cmd-ArrowRight",run:BU,shift:rW,preventDefault:!0},{key:"ArrowUp",run:A7,shift:D7,preventDefault:!0},{mac:"Cmd-ArrowUp",run:sP,shift:aP},{mac:"Ctrl-ArrowUp",run:tP,shift:nP},{key:"ArrowDown",run:q7,shift:B7,preventDefault:!0},{mac:"Cmd-ArrowDown",run:iP,shift:lP},{mac:"Ctrl-ArrowDown",run:u2,shift:rP},{key:"PageUp",run:tP,shift:nP},{key:"PageDown",run:u2,shift:rP},{key:"Home",run:YU,shift:tW,preventDefault:!0},{key:"Mod-Home",run:sP,shift:aP},{key:"End",run:VU,shift:eW,preventDefault:!0},{key:"Mod-End",run:iP,shift:lP},{key:"Enter",run:oP,shift:oP},{key:"Mod-a",run:aW},{key:"Backspace",run:d2,shift:d2,preventDefault:!0},{key:"Delete",run:I7,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:F7,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:fW,preventDefault:!0},{mac:"Mod-Backspace",run:pW,preventDefault:!0},{mac:"Mod-Delete",run:mW,preventDefault:!0}].concat(_W.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),NW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:LU,shift:KU},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:ZU,shift:JU},{key:"Alt-ArrowUp",run:xW},{key:"Shift-Alt-ArrowUp",run:yW},{key:"Alt-ArrowDown",run:bW},{key:"Shift-Alt-ArrowDown",run:vW},{key:"Mod-Alt-ArrowUp",run:cW},{key:"Mod-Alt-ArrowDown",run:uW},{key:"Escape",run:dW},{key:"Mod-Enter",run:QW},{key:"Alt-l",mac:"Ctrl-l",run:lW},{key:"Mod-i",run:oW,preventDefault:!0},{key:"Mod-[",run:TW},{key:"Mod-]",run:$W},{key:"Mod-Alt-\\",run:kW},{key:"Shift-Mod-k",run:wW},{key:"Shift-Mod-\\",run:IU},{key:"Mod-/",run:xU},{key:"Alt-A",run:yU},{key:"Ctrl-m",mac:"Shift-Alt-m",run:jW}].concat(PW);class CQ{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=nn(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(nX(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 cP(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 CW(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=cP(e)+cP(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function RQ(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:CW(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:t}:null}}function tX(n,e){return t=>{for(let r=nn(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 uP{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 nX(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 EQ=Fi.define();function RW(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 dP=new WeakMap;function EW(n){if(!Array.isArray(n))return n;let e=dP.get(n);return e||dP.set(n,e=RQ(n)),e}const nm=qt.define(),Pd=qt.define();class AW{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,f=0;if(o<0){for(let k=0,$=Math.min(e.length,200);k<$&&f<u;){let j=pl(e,k);(j==t[f]||j==r[f])&&(s[f++]=k),k+=Yo(j)}if(f<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=cY(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 qW{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 qn=qe.define({combine(n){return lQ(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:MW,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=>fP(e(r),t(r)),optionClass:(e,t)=>r=>fP(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function fP(n,e){return n?e?n+" "+e:n:e}function MW(n,e,t,r,s,i){let a=n.textDirection==en.RTL,o=a,u=!1,f="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:(f="bottom",p=e.bottom-t.top)}let S=(e.bottom-e.top)/i.offsetHeight,Q=(e.right-e.left)/i.offsetWidth;return{style:`${f}: ${p/S}px; max-width: ${m/Q}px`,class:"cm-completionInfo-"+(u?a?"left-narrow":"right-narrow":o?"left":"right")}}function XW(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 f=0;f<i.length;){let p=i[f++],m=i[f++];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 dx(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 zW{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(qn);this.optionContent=XW(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=dx(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:f}=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]<f.length){this.applyCompletion(e,f[+m[1]]),u.preventDefault();return}}),this.dom.addEventListener("focusout",u=>{let f=e.state.field(this.stateField,!1);f&&f.tooltip&&e.state.facet(qn).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:Pd.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=dx(i.length,a,e.state.facet(qn).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=dx(t.options.length,t.selected,this.view.state.facet(qn).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=>zr(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&&ZW(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(qn).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:f}=o;if(f){let g=typeof f=="string"?f:f.name;if(g!=i&&(a>r.from||r.from==0))if(i=g,typeof f!="string"&&f.header)s.appendChild(f.header(f));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 LW(n,e){return t=>new zW(t,n,e)}function ZW(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 hP(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function VW(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(qn);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 uP(g,p.source,m?m(g):[],1e9-t.length));else{let g=e.sliceDoc(p.from,p.to),x,v=a.filterStrict?new qW(g):new AW(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 uP(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,f=a.compareCompletions;for(let p of t.sort((m,g)=>g.score-m.score||f(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):hP(p.completion)>hP(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,pP(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,s,i,a){if(s&&!a&&e.some(f=>f.isPending))return s.setDisabled();let o=VW(e,t);if(!o.length)return s&&e.some(f=>f.isPending)?s.setDisabled():null;let u=t.facet(qn).selectOnOpen?0:-1;if(s&&s.selected!=u&&s.selected!=-1){let f=s.options[s.selected].completion;for(let p=0;p<o.length;p++)if(o[p].completion==f){u=p;break}}return new Fo(o,pP(r,u),{pos:e.reduce((f,p)=>p.hasResult()?Math.min(f,p.from):f,1e8),create:GW,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 rm{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new rm(UW,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(qn),i=(r.override||t.languageDataAt("autocomplete",jl(t)).map(EW)).map(u=>(this.active.find(p=>p.source==u)||new ts(u,this.active.some(p=>p.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((u,f)=>u==this.active[f])&&(i=this.active);let a=this.open,o=e.effects.some(u=>u.is(AQ));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!YW(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 ts(u.source,0):u));for(let u of e.effects)u.is(sX)&&(a=a&&a.setSelected(u.value,this.id));return i==this.active&&a==this.open?this:new rm(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?DW:BW}}function YW(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 DW={"aria-autocomplete":"list"},BW={};function pP(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const UW=[];function rX(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(EQ);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 ts{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=rX(e,t),s=this;(r&8||r&16&&this.touches(e))&&(s=new ts(s.source,0)),r&4&&s.state==0&&(s=new ts(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(nm))s=new ts(s.source,1,i.value);else if(i.is(Pd))s=new ts(s.source,0);else if(i.is(AQ))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 ts{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 ts(this.source,t&4?1:0);let u=e.changes.mapPos(this.limit);return WW(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 CQ(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 ts(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 ts(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function WW(n,e,t,r){if(!n)return!1;let s=e.sliceDoc(t,r);return typeof n=="function"?n(s,t,r,e):nX(n,!0).test(s)}const AQ=qt.define({map(n,e){return n.map(t=>t.map(e))}}),sX=qt.define(),mr=ai.define({create(){return rm.start()},update(n,e){return n.update(e)},provide:n=>[o7.from(n,e=>e.tooltip),Ae.contentAttributes.from(n,e=>e.attrs)]});function qQ(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(mr).active.find(s=>s.source==e.source);return r instanceof ac?(typeof t=="string"?n.dispatch({...RW(n.state,t,r.from,r.to),annotations:EQ.of(e.completion)}):t(n,e.completion,r.from,r.to),!0):!1}const GW=LW(mr,qQ);function Fh(n,e="option"){return t=>{let r=t.state.field(mr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(qn).interactionDelay)return!1;let s=1,i;e=="page"&&(i=c7(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:sX.of(o)}),!0}}const iX=n=>{let e=n.state.field(mr,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(qn).interactionDelay?!1:qQ(n,e.open.options[e.open.selected])},fx=n=>n.state.field(mr,!1)?(n.dispatch({effects:nm.of(!0)}),!0):!1,IW=n=>{let e=n.state.field(mr,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Pd.of(null)}),!0)};class HW{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const FW=50,KW=1e3,JW=Ns.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(mr).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(mr),t=n.state.facet(qn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(mr)==e)return;let r=n.transactions.some(i=>{let a=rX(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>FW&&Date.now()-a.time>KW){for(let o of a.context.abortListeners)try{o()}catch(u){zr(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(nm)))&&(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(mr);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(qn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=jl(e),r=new CQ(e,t,n.explicit,this.view),s=new HW(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:Pd.of(null)}),zr(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(qn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(qn),r=this.view.state.field(mr);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)),f=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)f=f.update(p,t);if(f.hasResult()){e.push(f);continue}}let a=r.active.find(o=>o.source==i.active.source);if(a&&a.isPending)if(i.done==null){let o=new ts(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:AQ.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(mr,!1);if(e&&e.tooltip&&this.view.state.facet(qn).closeOnBlur){let t=e.open&&c7(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Pd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:nm.of(!1)}),20),this.composing=0}}}),eG=typeof navigator=="object"&&/Win/.test(navigator.platform),tG=Yl.highest(Ae.domEventHandlers({keydown(n,e){let t=e.state.field(mr,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(eG&&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&&qQ(e,r),!1}})),aX=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 nG{constructor(e,t,r,s){this.field=e,this.line=t,this.from=r,this.to=s}}class MQ{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,tr.TrackDel),r=e.mapPos(this.to,1,tr.TrackDel);return t==null||r==null?null:new MQ(this.field,t,r)}}class XQ{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 f=a,p=/^\t*/.exec(u)[0].length;for(let m=0;m<p;m++)f+=e.facet(tf);s.push(t+f.length-p),u=f+u.slice(p)}r.push(u),t+=u.length+1}let o=this.fieldPositions.map(u=>new MQ(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]||"",f=-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)&&(f=m);if(f<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}),f=m;for(let g of s)g.field>=f&&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 nG(f,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,f)=>{for(let p of s)p.line==r.length&&p.from>f&&(p.from--,p.to--);return u}),r.push(a)}return new XQ(r,s)}}let rG=Gt.widget({widget:new class extends Hd{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),sG=Gt.mark({class:"cm-snippetField"});class Ec{constructor(e,t){this.ranges=e,this.active=t,this.deco=Gt.set(e.map(r=>(r.from==r.to?rG:sG).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 rf=qt.define({map(n,e){return n&&n.map(e)}}),iG=qt.define(),Nd=ai.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(rf))return t.value;if(t.is(iG)&&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:Gt.none)});function zQ(n,e){return ve.create(n.filter(t=>t.field==e).map(t=>ve.range(t.from,t.to)))}function aG(n){let e=XQ.parse(n);return(t,r,s,i)=>{let{text:a,ranges:o}=e.instantiate(t.state,s),{main:u}=t.state.selection,f={changes:{from:s,to:i==u.from?u.to:i,insert:ht.of(a)},scrollIntoView:!0,annotations:r?[EQ.of(r),$n.userEvent.of("input.complete")]:void 0};if(o.length&&(f.selection=zQ(o,0)),o.some(p=>p.field>0)){let p=new Ec(o,0),m=f.effects=[rf.of(p)];t.state.field(Nd,!1)===void 0&&m.push(qt.appendConfig.of([Nd,dG,fG,aX]))}t.dispatch(t.state.update(f))}}function lX(n){return({state:e,dispatch:t})=>{let r=e.field(Nd,!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:zQ(r.ranges,s),effects:rf.of(i?null:new Ec(r.ranges,s)),scrollIntoView:!0})),!0}}const lG=({state:n,dispatch:e})=>n.field(Nd,!1)?(e(n.update({effects:rf.of(null)})),!0):!1,oG=lX(1),cG=lX(-1),uG=[{key:"Tab",run:oG,shift:cG},{key:"Escape",run:lG}],mP=qe.define({combine(n){return n.length?n[0]:uG}}),dG=Yl.highest(Cc.compute([mP],n=>n.facet(mP)));function Kt(n,e){return{...e,apply:aG(n)}}const fG=Ae.domEventHandlers({mousedown(n,e){let t=e.state.field(Nd,!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:zQ(t.ranges,s.field),effects:rf.of(t.ranges.some(i=>i.field>s.field)?new Ec(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),oX=new class extends za{};oX.startSide=1;oX.endSide=-1;function hG(n={}){return[tG,mr,qn.of(n),JW,pG,aX]}const cX=[{key:"Ctrl-Space",run:fx},{mac:"Alt-`",run:fx},{mac:"Alt-i",run:fx},{key:"Escape",run:IW},{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:iX}],pG=Yl.highest(Cc.computeN([qn],n=>n.facet(qn).defaultKeymap?[cX]:[]));class sm{static create(e,t,r,s,i){let a=s+(s<<8)+e+(t<<4)|0;return new sm(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 Qt(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 Qt(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(s,i,a)=>new Qt(Rn.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 mG{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class OG{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 hd(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 OP(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?VQ:ZQ)(t,e,!1);return r>0&&(n.type!=Se.BulletList||LQ(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const uX={[Se.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(dt(Se.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(cs(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]:OP,[Se.BulletList]:OP,[Se.Document](){return!0}};function cs(n){return n==32||n==9||n==10||n==13}function hd(n,e=0){for(;e<n.length&&cs(n.charCodeAt(e));)e++;return e}function gP(n,e,t){for(;e>t&&cs(n.charCodeAt(e-1));)e--;return e}function dX(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 fX(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function LQ(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(!cs(i))return-1}return t&&n.next==45&&mX(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(bX.SetextHeading)>-1||r<3?-1:1}function hX(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||cs(n.text.charCodeAt(n.pos+1)))&&(!t||hX(e,Se.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function VQ(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&&!cs(n.text.charCodeAt(r+1))||t&&!hX(e,Se.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function pX(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 mX(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&&cs(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const f2=/^[ \t]*$/,OX=/-->/,gX=/\?>/,h2=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,OX],[/^\s*<\?/,gX],[/^\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,f2],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,f2]];function xX(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let s=0,i=h2.length-(t?1:0);s<i;s++)if(h2[s][0].test(r))return s;return-1}function xP(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 Qa(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(dt(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(Qa(a,s,i);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){Qa(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 f of o)f.type==Se.CodeText?Qa(a,f.from,f.to):a.push(f);o=[]}Qa(a,n.lineStart-1,n.lineStart);for(let f of e.markers)a.push(f);i=n.lineStart+e.text.length;let u=n.lineStart+e.findColumn(e.baseIndent+4);u<i&&Qa(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=dX(e);if(t<0)return!1;let r=n.lineStart+e.pos,s=e.next,i=t-e.pos,a=e.skipSpace(t),o=gP(e.text,e.text.length,a),u=[dt(Se.CodeMark,r,r+i)];a<o&&u.push(dt(Se.CodeInfo,n.lineStart+a,n.lineStart+o));for(let f=!0,p=!0,m=!1;n.nextLine()&&e.depth>=n.stack.length;f=!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&&Qa(u,n.lineStart-1,n.lineStart),u.push(dt(Se.CodeMark,n.lineStart+e.pos,n.lineStart+g)),n.nextLine();break}else{m=!0,f||(Qa(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&&(Qa(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=fX(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(LQ(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=xP(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=VQ(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=xP(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=pX(e);if(t<0)return!1;let r=e.pos,s=n.lineStart+r,i=gP(e.text,e.text.length,r),a=i;for(;a>r&&e.text.charCodeAt(a-1)==e.next;)a--;(a==i||a==r||!cs(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=xX(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,s=h2[t][1],i=[],a=s!=f2;for(;!s.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){a=!1;break}for(let f of e.markers)i.push(f)}a&&n.nextLine();let o=s==OX?Se.CommentBlock:s==gX?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 gG{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)&&hd(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,dt(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(jX(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(dt(Se.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage($X(e,hd(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=hd(e,this.pos),r=0;if(t>this.pos){let s=TX(e,t,this.start);if(s){let i=hx(e,s.to-this.start);i>0&&(this.nextStage(s),r=i)}}return r||(r=hx(e,this.pos)),r>0&&r<e.length?r:-1}else return hx(e,this.pos)}}}function hx(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!cs(t))return-1}return e}class xG{nextLine(e,t,r){let s=t.depth<e.stack.length?-1:mX(t),i=t.next;if(s<0)return!1;let a=dt(Se.HeaderMark,e.lineStart+t.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(r,dt(i==61?Se.SetextHeading1:Se.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),a])),!0}finish(){return!1}}const bX={LinkReference(n,e){return e.content.charCodeAt(0)==91?new gG(e):null},SetextHeading(){return new xG}},bG=[(n,e)=>pX(e)>=0,(n,e)=>dX(e)>=0,(n,e)=>fX(e)>=0,(n,e)=>ZQ(e,n,!0)>=0,(n,e)=>VQ(e,n,!0)>=0,(n,e)=>LQ(e,n,!0)>=0,(n,e)=>xX(e,n,!0)>=0],yG={text:"",end:0};class vG{constructor(e,t,r,s){this.parser=e,this.input=t,this.ranges=s,this.line=new OG,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=sm.create(Se.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new QG(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 mG(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=_X(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=yG;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=sm.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 Qt(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(m2(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?yX(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=m2(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"?dt(this.parser.getNodeType(e),t,r,s):new SX(e,t)}get buffer(){return new wX(this.parser.nodeSet)}}function yX(n,e,t,r,s){let i=n[e].to,a=[],o=[],u=t.from+r;function f(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){f(p.from+r,!0);let m=p.from+r,g,x=s.get(p.tree);x?g=x:p.to+r>i?(g=yX(n,e,p,r,s),f(p.to+r,!1)):g=p.toTree(),a.push(g),o.push(m-u)}return f(t.to+r,!1),new Qt(t.type,a,o,t.to+r-u,t.tree?t.tree.propValues:void 0)}class Km extends kQ{constructor(e,t,r,s,i,a,o,u,f){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=f,this.nodeTypes=Object.create(null);for(let p of e.types)this.nodeTypes[p.name]=p.id}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}configure(e){let t=p2(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(),f=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(Rn.define({id:$,name:y,props:j&&[[Ue.group,j]]})),k&&(x||(x={}),Array.isArray(k)||k instanceof Mr?x[y]=k:Object.assign(x,k))}r=new ef(g),x&&(r=r.extend(Wa(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=f.indexOf(g.name);if(x>-1)u[x]=g.parse;else{let v=g.before?Jh(f,g.before):g.after?Jh(f,g.after)+1:f.length-1;u.splice(v,0,g.parse),f.splice(v,0,g.name)}}return t.wrap&&(m=m.concat(t.wrap)),new Km(r,i,a,o,p,s,u,f,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 YQ(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 p2(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=p2(n[0]);if(n.length==1)return e;let t=p2(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,f)=>s(i(a,o,u,f),o,u,f):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 vX=[Rn.none];for(let n=1,e;e=Se[n];n++)vX[n]=Rn.define({id:n,name:e,props:n>=Se.Escape?[]:[[Ue.group,n in uX?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const bc=[];class wX{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 Qt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let Cd=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 wX(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class SX{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 dt(n,e,t,r){return new Cd(n,e,t,r)}const QX={resolve:"Emphasis",mark:"EmphasisMark"},kX={resolve:"Emphasis",mark:"EmphasisMark"},xl={},im={};class qr{constructor(e,t,r,s){this.type=e,this.from=t,this.to=r,this.side=s}}const bP="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Rd=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Rd=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const px={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let r=n.char(t+1);for(let s=0;s<bP.length;s++)if(bP.charCodeAt(s)==r)return n.append(dt(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(dt(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(dt(Se.InlineCode,t,r+1,[dt(Se.CodeMark,t,t+s),dt(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(dt(Se.Autolink,t,t+1+s[0].length,[dt(Se.LinkMark,t,t+1),dt(Se.URL,t+1,t+s[0].length),dt(Se.LinkMark,t+s[0].length,t+1+s[0].length)]));let i=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(i)return n.append(dt(Se.Comment,t,t+1+i[0].length));let a=/^\?[^]*?\?>/.exec(r);if(a)return n.append(dt(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(dt(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=Rd.test(s),o=Rd.test(i),u=/\s|^$/.test(s),f=/\s|^$/.test(i),p=!f&&(!o||u||a),m=!u&&(!a||f||o),g=p&&(e==42||!m||a),x=m&&(e==42||!p||o);return n.append(new qr(e==95?QX:kX,t,r,(g?1:0)|(x?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(dt(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(dt(Se.HardBreak,t,r+1))}return-1},Link(n,e,t){return e==91?n.append(new qr(xl,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new qr(im,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 qr&&(s.type==xl||s.type==im)){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]=wG(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 qr&&u.type==xl&&(u.side=0)}return a.to}}return-1}};function wG(n,e,t,r,s){let{text:i}=n,a=n.char(s),o=s;if(e.unshift(dt(Se.LinkMark,r,r+(t==Se.Image?2:1))),e.push(dt(Se.LinkMark,s-1,s)),a==40){let u=n.skipSpace(s+1),f=$X(i,u-n.offset,n.offset),p;f&&(u=n.skipSpace(f.to),u!=f.to&&(p=TX(i,u-n.offset,n.offset),p&&(u=n.skipSpace(p.to)))),n.char(u)==41&&(e.push(dt(Se.LinkMark,s,s+1)),o=u+1,f&&e.push(f),p&&e.push(p),e.push(dt(Se.LinkMark,u,o)))}else if(a==91){let u=jX(i,s-n.offset,n.offset,!1);u&&(e.push(u),o=u.to)}return dt(t,r,o,e)}function $X(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 dt(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(cs(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?dt(Se.URL,e+t,i+t):i==n.length?null:!1}}function TX(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 dt(Se.LinkTitle,e+t,i+1+t);o==92&&(a=!0)}}return null}function jX(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:dt(Se.LinkLabel,e+t,i+1+t);if(r&&!cs(o)&&(r=!1),o==91)return!1;o==92&&(s=!0)}}return null}class YQ{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 qr(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 qr&&(t.type==xl||t.type==im))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 qr&&s.type.resolve&&s.side&2))continue;let i=s.type==QX||s.type==kX,a=s.to-s.from,o,u=r-1;for(;u>=e;u--){let y=this.parts[u];if(y instanceof qr&&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 f=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,f=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 Cd&&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(f,m,g,p);this.parts[u]=i&&o.from!=m?new qr(o.type,o.from,m,o.side):null,(this.parts[r]=i&&s.to!=g?new qr(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 Cd&&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 qr&&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 qr?t:null}skipSpace(e){return hd(this.text,e-this.offset)+this.offset}elt(e,t,r,s){return typeof e=="string"?dt(this.parser.getNodeType(e),t,r,s):new SX(e,t)}}YQ.linkStart=xl;YQ.imageStart=im;function m2(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 Cd&&(t[r]=new Cd(i.type,i.from,i.to,m2(i.children,[s])))}else t.splice(r++,0,s)}return t}const SG=[Se.CodeBlock,Se.ListItem,Se.OrderedList,Se.BulletList];let QG=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,f=o;for(;;){if(t.to-r>s){if(t.type.isAnonymous&&t.firstChild())continue;break}let p=_X(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,p);else{let m=new Qt(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")&&(SG.indexOf(t.type.id)<0?(a=t.to-r,o=e.block.children.length):(a=u,o=f),u=t.to-r,f=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 _X(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 kG=Wa({"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}),$G=new Km(new ef(vX).extend(kG),Object.keys(Kh).map(n=>Kh[n]),Object.keys(Kh).map(n=>bX[n]),Object.keys(Kh),bG,uX,Object.keys(px).map(n=>px[n]),Object.keys(px),[]);function TG(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 jG(n){let{codeParser:e,htmlParser:t}=n;return{wrap:m7((s,i)=>{let a=s.type.id;if(e&&(a==Se.CodeBlock||a==Se.FencedCode)){let o="";if(a==Se.FencedCode){let f=s.node.getChild(Se.CodeInfo);f&&(o=i.read(f.from,f.to))}let u=e(o);if(u)return{parser:u,overlay:f=>f.type.id==Se.CodeText,bracketed:a==Se.FencedCode}}else if(t&&(a==Se.HTMLBlock||a==Se.HTMLTag||a==Se.CommentBlock))return{parser:t,overlay:TG(s.node,s.from,s.to)};return null})}}const _G={resolve:"Strikethrough",mark:"StrikethroughMark"},PG={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=Rd.test(r),u=Rd.test(s);return n.addDelimiter(_G,t,t+2,!a&&(!u||i||o),!i&&(!o||a||u))},after:"Emphasis"}]};function pd(n,e,t=0,r,s=0){let i=0,a=!0,o=-1,u=-1,f=!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&&!f?((!a||o>-1)&&i++,a=!1,r&&(o>-1&&p(),r.push(n.elt("TableDelimiter",m+s,m+s+1))),o=u=-1):(f||g!=32&&g!=9)&&(o<0&&(o=m),u=m+1),f=!f&&g==92}return o>-1&&(i++,r&&p()),i}function yP(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 PX=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class vP{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)&&PX.test(s=t.text.slice(t.pos))){let i=[];pd(e,r.content,0,i,r.start)==pd(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=[];pd(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 NG={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 yP(e.content,0)?new vP:null},endLeaf(n,e,t){if(t.parsers.some(s=>s instanceof vP)||!yP(e.text,e.basePos))return!1;let r=n.peekLine();return PX.test(r)&&pd(n,e.text,e.basePos)==pd(n,r,e.basePos)},before:"SetextHeading"}]};class CG{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 RG={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 CG:null},after:"SetextHeading"}]},wP=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,SP=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,EG=/[\w-]+\.[\w-]+($|\/)/,QP=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,kP=/\/[a-zA-Z\d@.]+/gy;function $P(n,e,t,r){let s=0;for(let i=e;i<t;i++)n[i]==r&&s++;return s}function AG(n,e){SP.lastIndex=e;let t=SP.exec(n);if(!t||EG.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==")"&&$P(n,e,r,")")>$P(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 TP(n,e){QP.lastIndex=e;let t=QP.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 qG={parseInline:[{name:"Autolink",parse(n,e,t){let r=t-n.offset;if(r&&/\w/.test(n.text[r-1]))return-1;wP.lastIndex=r;let s=wP.exec(n.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=AG(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=TP(n.text,r):(i=TP(n.text,r+s[0].length),i>-1&&s[0]=="xmpp:"&&(kP.lastIndex=i,s=kP.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)}}]},MG=[NG,RG,PG,qG];function NX(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)),cs(u))break}return-1}}const XG={defineNodes:[{name:"Superscript",style:Y.special(Y.content)},{name:"SuperscriptMark",style:Y.processingInstruction}],parseInline:[{name:"Superscript",parse:NX(94,"Superscript","SuperscriptMark")}]},zG={defineNodes:[{name:"Subscript",style:Y.special(Y.content)},{name:"SubscriptMark",style:Y.processingInstruction}],parseInline:[{name:"Subscript",parse:NX(126,"Subscript","SubscriptMark")}]},LG={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 jP={};class am{constructor(e,t,r,s,i,a,o,u,f,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=f,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 am(e,[],t,r,r,0,[],0,s?new _P(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),f=u?this.stack[u-2]:this.p.ranges[0].from,p=this.reducePos-f;p>=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=p):this.p.lastBigReductionSize<p&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,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,f,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,f)}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 am(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 ZG(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,f=this.stack.length-o*3;if(f>=0&&e.getGoto(this.stack[f],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 _P(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 _P{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class ZG{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 lm{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 lm(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 lm(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 $p{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const PP=new $p;class VG{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=PP,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=PP,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;CX(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}lc.prototype.contextual=lc.prototype.fallback=lc.prototype.extend=!1;class om{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(CX(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))}}om.prototype.contextual=lc.prototype.fallback=lc.prototype.extend=!1;class Bn{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function CX(n,e,t,r,s,i){let a=0,o=1<<r,{dialect:u}=t.p.parser;e:for(;(o&n[a])!=0;){let f=n[a+1];for(let x=a+3;x<f;x+=2)if((n[x+1]&o)>0){let v=n[x];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||YG(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[f+g*3-3]==65535){a=n[f+g*3-1];continue e}for(;m<g;){let x=m+g>>1,v=f+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 NP(n,e,t){for(let r=e,s;(s=n[r])!=65535;r++)if(s==t)return r-e;return-1}function YG(n,e,t,r){let s=NP(t,r,e);return s<0||NP(t,r,n)<s}const Rr=typeof process<"u"&&jP&&/\bparse\b/.test(jP.LOG);let mx=null;function CP(n,e,t){let r=n.cursor(St.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 DG{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?CP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?CP(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 Qt){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 BG{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new $p)}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 f=0;f<i.length;f++){if((1<<f&a)==0)continue;let p=i[f],m=this.tokens[f];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 $p,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 $p,{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 f=a.stateSlot(i,u?2:1);;f+=3){if(o[f]==65535)if(o[f+1]==1)f=Mi(o,f+2);else{s==0&&o[f+1]==2&&(s=this.putAction(Mi(o,f+2),t,r,s));break}o[f]==t&&(s=this.putAction(Mi(o,f+1),t,r,s))}return s}}class UG{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 VG(t,s),this.tokens=new BG(e,this.stream),this.topTerm=e.top[1];let{from:i}=s[0];this.stacks=[am.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new DG(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&&GG(s);if(a)return Rr&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Rr&&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 Rr&&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 f=r[u];if(o.sameState(f)||o.buffer.length>500&&f.buffer.length>500)if((o.score-f.score||o.buffer.length-f.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=Rr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,p=f?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&&(!f||(m.prop(Ue.contextHash)||0)==p))return e.useNode(m,g),Rr&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof Qt)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof Qt&&m.positions[0]==0)m=x;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),Rr&&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 f=0;f<u.length;){let p=u[f++],m=u[f++],g=u[f++],x=f==u.length||!r,v=x?e:e.split(),y=this.tokens.mainToken;if(v.apply(p,m,y?y.start:v.pos,g),Rr&&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 RP(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],f=t[(a<<1)+1],p=Rr?this.stackID(o)+" -> ":"";if(o.deadEnd&&(i||(i=!0,o.restart(),Rr&&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()&&(Rr&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Rr&&(g=this.stackID(m)+" -> ");for(let x of o.recoverByInsert(u))Rr&&console.log(p+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>o.pos?(f==o.pos&&(f++,u=0),o.recoverByDelete(u,f),Rr&&console.log(p+this.stackID(o)+` (via recover-delete ${this.parser.getName(u)})`),RP(o,r)):(!s||s.score<m.score)&&(s=m)}return s}stackToTree(e){return e.close(),Qt.build({buffer:lm.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=(mx||(mx=new WeakMap)).get(e);return t||mx.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function RP(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 WG{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const Ox=n=>n;class DQ{constructor(e){this.start=e.start,this.shift=e.shift||Ox,this.reduce=e.reduce||Ox,this.reuse=e.reuse||Ox,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ba extends kQ{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,f){s[o].push([u,u.deserialize(String(f))])}if(e.nodeProps)for(let o of e.nodeProps){let u=o[0];typeof u=="string"&&(u=Ue[u]);for(let f=1;f<o.length;){let p=o[f++];if(p>=0)i(p,u,o[f++]);else{let m=o[f+-p];for(let g=-p;g>0;g--)i(o[f++],u,m);f++}}}this.nodeSet=new ef(t.map((o,u)=>Rn.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=d7;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(EP),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 UG(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 f=i+(a>>1);i<f;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=Mi(r,i+2)];else{if(r[i+1]==2)return Mi(r,i+2);break}if(a==t||a==0)return Mi(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=Mi(this.data,i+2);else break;s=t(Mi(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=Mi(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(Ba.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]=EP(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 WG(e,r,s)}static deserialize(e){return new Ba(e)}}function Mi(n,e){return n[e]|n[e+1]<<16}function GG(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 EP(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}const IG=55,HG=1,FG=56,KG=2,JG=57,eI=3,AP=4,tI=5,BQ=6,RX=7,EX=8,AX=9,qX=10,nI=11,rI=12,sI=13,gx=58,iI=14,aI=15,qP=59,MX=21,lI=23,XX=24,oI=25,O2=27,zX=28,cI=29,uI=32,dI=35,fI=37,hI=38,pI=0,mI=1,OI={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},gI={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},MP={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 xI(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let XP=null,zP=null,LP=0;function g2(n,e){let t=n.pos+e;if(LP==t&&zP==n)return XP;let r=n.peek(e),s="";for(;xI(r);)s+=String.fromCharCode(r),r=n.peek(++e);return zP=n,LP=t,XP=s?s.toLowerCase():r==bI||r==yI?void 0:null}const LX=60,cm=62,UQ=47,bI=63,yI=33,vI=45;function ZP(n,e){this.name=n,this.parent=e}const wI=[BQ,qX,RX,EX,AX],SI=new DQ({start:null,shift(n,e,t,r){return wI.indexOf(e)>-1?new ZP(g2(r,1)||"",n):n},reduce(n,e){return e==MX&&n?n.parent:n},reuse(n,e,t,r){let s=e.type.id;return s==BQ||s==fI?new ZP(g2(r,1)||"",n):n},strict:!1}),QI=new Bn((n,e)=>{if(n.next!=LX){n.next<0&&e.context&&n.acceptToken(gx);return}n.advance();let t=n.next==UQ;t&&n.advance();let r=g2(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?aI:iI);let s=e.context?e.context.name:null;if(t){if(r==s)return n.acceptToken(nI);if(s&&gI[s])return n.acceptToken(gx,-2);if(e.dialectEnabled(pI))return n.acceptToken(rI);for(let i=e.context;i;i=i.parent)if(i.name==r)return;n.acceptToken(sI)}else{if(r=="script")return n.acceptToken(RX);if(r=="style")return n.acceptToken(EX);if(r=="textarea")return n.acceptToken(AX);if(OI.hasOwnProperty(r))return n.acceptToken(qX);s&&MP[s]&&MP[s][r]?n.acceptToken(gx,-1):n.acceptToken(BQ)}},{contextual:!0}),kI=new Bn(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(qP);break}if(n.next==vI)e++;else if(n.next==cm&&e>=2){t>=3&&n.acceptToken(qP,-2);break}else e=0;n.advance()}});function $I(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const TI=new Bn((n,e)=>{if(n.next==UQ&&n.peek(1)==cm){let t=e.dialectEnabled(mI)||$I(e.context);n.acceptToken(t?tI:AP,2)}else n.next==cm&&n.acceptToken(AP,1)});function WQ(n,e,t){let r=2+n.length;return new Bn(s=>{for(let i=0,a=0,o=0;;o++){if(s.next<0){o&&s.acceptToken(e);break}if(i==0&&s.next==LX||i==1&&s.next==UQ||i>=2&&i<r&&s.next==n.charCodeAt(i-2))i++,a++;else if(i==r&&s.next==cm){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 jI=WQ("script",IG,HG),_I=WQ("style",FG,KG),PI=WQ("textarea",JG,eI),NI=Wa({"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}),CI=Ba.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%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1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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:SI,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:[NI],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-_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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:[jI,_I,PI,TI,QI,kI,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ZX(n,e){let t=Object.create(null);for(let r of n.getChildren(XX)){let s=r.getChild(oI),i=r.getChild(O2)||r.getChild(zX);s&&(t[e.read(s.from,s.to)]=i?i.type.id==O2?e.read(i.from+1,i.to-1):e.read(i.from,i.to):"")}return t}function VP(n,e){let t=n.getChild(lI);return t?e.read(t.from,t.to):" "}function xx(n,e,t){let r;for(let s of t)if(!s.attrs||s.attrs(r||(r=ZX(n.node.parent.firstChild,e))))return{parser:s.parser,bracketed:!0};return null}function VX(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 m7((o,u)=>{let f=o.type.id;if(f==cI)return xx(o,u,t);if(f==uI)return xx(o,u,r);if(f==dI)return xx(o,u,s);if(f==MX&&i.length){let p=o.node,m=p.firstChild,g=m&&VP(m,u),x;if(g){for(let v of i)if(v.tag==g&&(!v.attrs||v.attrs(x||(x=ZX(m,u))))){let y=p.lastChild,S=y.type.id==hI?y.from:p.to;if(S>m.to)return{parser:v.parser,overlay:[{from:m.to,to:S}]}}}}if(a&&f==XX){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!=VP(p.parent,u))continue;let v=p.lastChild;if(v.type.id==O2){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==zX)return{parser:x.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const RI=122,YP=1,EI=123,AI=124,YX=2,qI=125,MI=3,XI=4,DX=[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],zI=58,LI=40,BX=95,ZI=91,Tp=45,VI=46,YI=35,DI=37,BI=38,UI=92,WI=10,GI=42;function Ed(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function GQ(n){return n>=48&&n<=57}function DP(n){return GQ(n)||n>=97&&n<=102||n>=65&&n<=70}const UX=(n,e,t)=>(r,s)=>{for(let i=!1,a=0,o=0;;o++){let{next:u}=r;if(Ed(u)||u==Tp||u==BX||i&&GQ(u))!i&&(u!=Tp||o>0)&&(i=!0),a===o&&u==Tp&&a++,r.advance();else if(u==UI&&r.peek(1)!=WI){if(r.advance(),DP(r.next)){do r.advance();while(DP(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();i=!0}else{i&&r.acceptToken(a==2&&s.canShift(YX)?e:u==LI?t:n);break}}},II=new Bn(UX(EI,YX,AI)),HI=new Bn(UX(qI,MI,XI)),FI=new Bn(n=>{if(DX.includes(n.peek(-1))){let{next:e}=n;(Ed(e)||e==BX||e==YI||e==VI||e==GI||e==ZI||e==zI&&Ed(n.peek(1))||e==Tp||e==BI)&&n.acceptToken(RI)}}),KI=new Bn(n=>{if(!DX.includes(n.peek(-1))){let{next:e}=n;if(e==DI&&(n.advance(),n.acceptToken(YP)),Ed(e)){do n.advance();while(Ed(n.next)||GQ(n.next));n.acceptToken(YP)}}}),JI=Wa({"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}),eH={__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},tH={__proto__:null,or:98,and:98,not:106,only:106,layer:170},nH={__proto__:null,selector:112,layer:166},rH={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},sH={__proto__:null,to:207},iH=Ba.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_Q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^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet 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:[JI],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%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;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;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[FI,KI,II,HI,1,2,3,4,new om("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=>eH[n]||-1},{term:125,get:n=>tH[n]||-1},{term:4,get:n=>nH[n]||-1},{term:25,get:n=>rH[n]||-1},{term:123,get:n=>sH[n]||-1}],tokenPrec:1963});let bx=null;function yx(){if(!bx&&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)));bx=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return bx||[]}const BP=["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})),UP=["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}))),aH=["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})),lH=["@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})),Pi=/^(\w[\w-]*|-\w[\w-]*|)$/,oH=/^-(-[\w-]*)?$/;function cH(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 WP=new QQ,uH=["Declaration"];function dH(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function WX(n,e,t){if(e.to-e.from>4096){let r=WP.get(e);if(r)return r;let s=[],i=new Set,a=e.cursor(St.IncludeAnonymous);if(a.firstChild())do for(let o of WX(n,a.node,t))i.has(o.label)||(i.add(o.label),s.push(o));while(a.nextSibling());return WP.set(e,s),s}else{let r=[],s=new Set;return e.cursor().iterate(i=>{var a;if(t(i)&&i.matchContext(uH)&&((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 fH=n=>e=>{let{state:t,pos:r}=e,s=nn(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:yx(),validFor:Pi};if(s.name=="ValueName")return{from:s.from,options:UP,validFor:Pi};if(s.name=="PseudoClassName")return{from:s.from,options:BP,validFor:Pi};if(n(s)||(e.explicit||i)&&cH(s,t.doc))return{from:n(s)||i?s.from:r,options:WX(t.doc,dH(s),n),validFor:oH};if(s.name=="TagName"){for(let{parent:u}=s;u;u=u.parent)if(u.name=="Block")return{from:s.from,options:yx(),validFor:Pi};return{from:s.from,options:aH,validFor:Pi}}if(s.name=="AtKeyword")return{from:s.from,options:lH,validFor:Pi};if(!e.explicit)return null;let a=s.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:BP,validFor:Pi}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:UP,validFor:Pi}:a.name=="Block"||a.name=="Styles"?{from:r,options:yx(),validFor:Pi}:null},hH=fH(n=>n.name=="VariableName"),um=Da.define({name:"css",parser:iH.configure({props:[Dl.add({Declaration:Tl()}),Bl.add({"Block KeyframeList":Um})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function pH(){return new Ml(um,um.data.of({autocomplete:hH}))}const mH=316,OH=317,GP=1,gH=2,xH=3,bH=4,yH=318,vH=320,wH=321,SH=5,QH=6,kH=0,x2=[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],GX=125,$H=59,b2=47,TH=42,jH=43,_H=45,PH=60,NH=44,CH=63,RH=46,EH=91,AH=new DQ({start:!1,shift(n,e){return e==SH||e==QH||e==vH?n:e==wH},strict:!1}),qH=new Bn((n,e)=>{let{next:t}=n;(t==GX||t==-1||e.context)&&n.acceptToken(yH)},{contextual:!0,fallback:!0}),MH=new Bn((n,e)=>{let{next:t}=n,r;x2.indexOf(t)>-1||t==b2&&((r=n.peek(1))==b2||r==TH)||t!=GX&&t!=$H&&t!=-1&&!e.context&&n.acceptToken(mH)},{contextual:!0}),XH=new Bn((n,e)=>{n.next==EH&&!e.context&&n.acceptToken(OH)},{contextual:!0}),zH=new Bn((n,e)=>{let{next:t}=n;if(t==jH||t==_H){if(n.advance(),t==n.next){n.advance();let r=!e.context&&e.canShift(GP);n.acceptToken(r?GP:gH)}}else t==CH&&n.peek(1)==RH&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(xH))},{contextual:!0});function vx(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const LH=new Bn((n,e)=>{if(n.next!=PH||!e.dialectEnabled(kH)||(n.advance(),n.next==b2))return;let t=0;for(;x2.indexOf(n.next)>-1;)n.advance(),t++;if(vx(n.next,!0)){for(n.advance(),t++;vx(n.next,!1);)n.advance(),t++;for(;x2.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==NH)return;for(let r=0;;r++){if(r==7){if(!vx(n.next,!0))return;break}if(n.next!="extends".charCodeAt(r))break;n.advance(),t++}}n.acceptToken(bH,-t)}),ZH=Wa({"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)}),VH={__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},YH={__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},DH={__proto__:null,"<":193},BH=Ba.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['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!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$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:AH,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:[ZH],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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:343,get:n=>YH[n]||-1},{term:95,get:n=>DH[n]||-1}],tokenPrec:15201}),IX=[Kt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Kt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Kt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Kt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Kt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Kt(`try {
|
|
218
|
+
\${}
|
|
219
|
+
} catch (\${error}) {
|
|
220
|
+
\${}
|
|
221
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Kt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Kt(`if (\${}) {
|
|
222
|
+
\${}
|
|
223
|
+
} else {
|
|
224
|
+
\${}
|
|
225
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Kt(`class \${name} {
|
|
226
|
+
constructor(\${params}) {
|
|
227
|
+
\${}
|
|
228
|
+
}
|
|
229
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Kt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Kt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],UH=IX.concat([Kt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Kt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Kt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),IP=new QQ,HX=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 WH=["FunctionDeclaration"],GH={FunctionDeclaration:Lu("function"),ClassDeclaration:Lu("class"),ClassExpression:()=>!0,EnumDeclaration:Lu("constant"),TypeAliasDeclaration:Lu("type"),NamespaceDeclaration:Lu("namespace"),VariableDefinition(n,e){n.matchContext(WH)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function FX(n,e){let t=IP.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(St.IncludeAnonymous).iterate(a=>{if(s)s=!1;else if(a.name){let o=GH[a.name];if(o&&o(a,i)||HX.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of FX(n,a.node))r.push(o);return!1}}),IP.set(e,r),r}const HP=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,KX=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function IH(n){let e=nn(n.state).resolveInner(n.pos,-1);if(KX.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&HP.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let s=e;s;s=s.parent)HX.has(s.name)&&(r=r.concat(FX(n.state.doc,s)));return{options:r,from:t?e.from:n.pos,validFor:HP}}const ri=Da.define({name:"javascript",parser:BH.configure({props:[Dl.add({IfStatement:Tl({except:/^\s*({|else\b)/}),TryStatement:Tl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:w7,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:fd({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":Um,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),JX={test:n=>/^JSX/.test(n.name),facet:$Q({commentTokens:{block:{open:"{/*",close:"*/}"}}})},ez=ri.configure({dialect:"ts"},"typescript"),tz=ri.configure({dialect:"jsx",props:[TQ.add(n=>n.isTop?[JX]:void 0)]}),nz=ri.configure({dialect:"jsx ts",props:[TQ.add(n=>n.isTop?[JX]:void 0)]},"typescript");let rz=n=>({label:n,type:"keyword"});const sz="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(rz),HH=sz.concat(["declare","implements","private","protected","public"].map(rz));function iz(n={}){let e=n.jsx?n.typescript?nz:tz:n.typescript?ez:ri,t=n.typescript?UH.concat(HH):IX.concat(sz);return new Ml(e,[ri.data.of({autocomplete:tX(KX,RQ(t))}),ri.data.of({autocomplete:IH}),n.jsx?JH:[]])}function FH(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 FP(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 KH=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),JH=Ae.inputHandler.of((n,e,t,r,s)=>{if((KH?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!ri.isActiveAt(n.state,e,-1))return!1;let i=s(),{state:a}=i,o=a.changeByRange(u=>{var f;let{head:p}=u,m=nn(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=FP(a.doc,v.firstChild,p))||((f=v.firstChild)===null||f===void 0?void 0:f.name)=="JSXFragmentTag")){let y=`${g}>`;return{range:ve.cursor(p+y.length,-1),changes:{from:p,insert:y}}}}else if(r==">"){let x=FH(m);if(x&&x.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(p,p+2))&&(g=FP(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"],wx=["ascii","utf-8","utf-16","latin1","latin1"],Sx=["get","post","put","delete"],Qx=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Er=["true","false"],Xe={},eF={a:{attrs:{href:null,ping:null,type:null,media:null,target:Zu,hreflang:null}},abbr:Xe,address:Xe,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Xe,aside:Xe,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Xe,base:{attrs:{href:null,target:Zu}},bdi:Xe,bdo:Xe,blockquote:{attrs:{cite:null}},body:Xe,br:Xe,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Qx,formmethod:Sx,formnovalidate:["novalidate"],formtarget:Zu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Xe,center:Xe,cite:Xe,code:Xe,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:Xe,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Xe,div:Xe,dl:Xe,dt:Xe,em:Xe,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Xe,figure:Xe,footer:Xe,form:{attrs:{action:null,name:null,"accept-charset":wx,autocomplete:["on","off"],enctype:Qx,method:Sx,novalidate:["novalidate"],target:Zu}},h1:Xe,h2:Xe,h3:Xe,h4:Xe,h5:Xe,h6:Xe,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Xe,hgroup:Xe,hr:Xe,html:{attrs:{manifest:null}},i:Xe,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:Qx,formmethod:Sx,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:Xe,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Xe,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:Xe,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:wx,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:Xe,noscript:Xe,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:Xe,param:{attrs:{name:null,value:null}},pre:Xe,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Xe,rt:Xe,ruby:Xe,samp:Xe,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:wx}},section:Xe,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Xe,source:{attrs:{src:null,type:null,media:null}},span:Xe,strong:Xe,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Xe,summary:Xe,sup:Xe,table:Xe,tbody:Xe,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Xe,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:Xe,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Xe,time:{attrs:{datetime:null}},title:Xe,tr:Xe,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Xe,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:Xe},az={accesskey:null,class:null,contenteditable:Er,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:Er,autocorrect:Er,autocapitalize:Er,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":Er,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Er,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Er,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Er,"aria-hidden":Er,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Er,"aria-multiselectable":Er,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Er,"aria-relevant":null,"aria-required":Er,"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},lz="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 lz)az[n]=null;class Ad{constructor(e,t){this.tags={...eF,...e},this.globalAttrs={...az,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Ad.default=new Ad;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 oz(n,e,t){let r=t.tags[yc(n,vc(e))];return(r==null?void 0:r.children)||t.allTags}function IQ(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 cz=/^[:\-\.\w\u00b7-\uffff]*$/;function KP(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:oz(n.doc,a,e).map(o=>({label:o,type:"type"})).concat(IQ(n.doc,t).map((o,u)=>({label:"/"+o,apply:"/"+o+i,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function JP(n,e,t,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:IQ(n.doc,e).map((i,a)=>({label:i,apply:i+s,type:"type",boost:99-a})),validFor:cz}}function tF(n,e,t,r){let s=[],i=0;for(let a of oz(n.doc,t,e))s.push({label:"<"+a,type:"type"});for(let a of IQ(n.doc,t))s.push({label:"</"+a+">",type:"type",boost:99-i++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function nF(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(f=>({label:f,type:"property"})),validFor:cz}}function rF(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 f=n.sliceDoc(a.from,a.to),p=e.globalAttrs[f];if(!p){let m=vc(t),g=m?e.tags[yc(n.doc,m)]:null;p=(g==null?void 0:g.attrs)&&g.attrs[f]}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 uz(n,e){let{state:t,pos:r}=e,s=nn(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)?JP(t,s,s.from,r):KP(t,n,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?KP(t,n,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?JP(t,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?nF(t,n,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?rF(t,n,s,s.name=="Is"?r:s.from,r):e.explicit&&(i.name=="Element"||i.name=="Text"||i.name=="Document")?tF(t,n,s,r):null}function sF(n){return uz(Ad.default,n)}function iF(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new Ad(e,t):Ad.default;return s=>uz(r,s)}const aF=ri.parser.configure({top:"SingleExpression"}),dz=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:ez.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:tz.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:nz.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:aF},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:ri.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:um.parser}],fz=[{name:"style",parser:um.parser.configure({top:"Styles"})}].concat(lz.map(n=>({name:n,parser:ri.parser}))),hz=Da.define({name:"html",parser:CI.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}}}),S7.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),jp=hz.configure({wrap:VX(dz,fz)});function lF(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=VX((n.nestedLanguages||[]).concat(dz),(n.nestedAttributes||[]).concat(fz)));let r=t?hz.configure({wrap:t,dialect:e}):e?jp.configure({dialect:e}):jp;return new Ml(r,[jp.data.of({autocomplete:iF(n)}),n.autoCloseTags!==!1?oF:[],iz().support,pH().support])}const e4=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),oF=Ae.inputHandler.of((n,e,t,r,s)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!jp.isActiveAt(n.state,e,-1))return!1;let i=s(),{state:a}=i,o=a.changeByRange(u=>{var f,p,m;let g=a.doc.sliceString(u.from-1,u.to)==r,{head:x}=u,v=nn(a).resolveInner(x,-1),y;if(g&&r==">"&&v.name=="EndTag"){let S=v.parent;if(((p=(f=S.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(y=yc(a.doc,S.parent,x))&&!e4.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))&&!e4.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)}),pz=$Q({commentTokens:{block:{open:"<!--",close:"-->"}}}),mz=new Ue,Oz=$G.configure({props:[Bl.add(n=>!n.is("Block")||n.is("Document")||y2(n)!=null||cF(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),mz.add(y2),Dl.add({Document:()=>null}),Ql.add({Document:pz})]});function y2(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function cF(n){return n.name=="OrderedList"||n.name=="BulletList"}function uF(n,e){let t=n;for(;;){let r=t.nextSibling,s;if(!r||(s=y2(r.type))!=null&&s<=e)break;t=r}return t.to}const dF=aU.of((n,e,t)=>{for(let r=nn(n).resolveInner(t,-1);r&&!(r.from<e);r=r.parent){let s=r.type.prop(mz);if(s==null)continue;let i=uF(r,s);if(i>t)return{from:t,to:i}}return null});function HQ(n){return new Jr(pz,n,[],"markdown")}const fF=HQ(Oz),hF=Oz.configure([MG,zG,XG,LG,{props:[Bl.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),dm=HQ(hF);function pF(n,e){return t=>{if(t&&n){let r=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?r=n(t):r=Kp.matchLanguageName(n,t,!0),r instanceof Kp)return r.support?r.support.language.parser:_d.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}let kx=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(+xz(this.item,e)[2]+t):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function gz(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 kx(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 f=a[3],p=a[0].length;f.length>=4&&(f=f.slice(0,f.length-4),p-=4),r.push(new kx(i.parent,u,u+p,a[1],f,a[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(u)))){let f=a[4],p=a[0].length;f.length>4&&(f=f.slice(0,f.length-4),p-=4);let m=a[2];a[3]&&(m+=a[3].replace(/[xX]/," ")),r.push(new kx(i.parent,u,u+p,a[1],f,m,i))}}return r}function xz(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function $x(n,e,t,r=0){for(let s=-1,i=n;;){if(i.name=="ListItem"){let o=xz(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 FQ(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(tf)!=" ")return n;let r=Ui(n,4,t),s="";for(let i=r;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+n.slice(t)}const mF=(n={})=>({state:e,dispatch:t})=>{let r=nn(e),{doc:s}=e,i=null,a=e.changeByRange(o=>{if(!o.empty||!dm.isActiveAt(e,o.from,-1)&&!dm.isActiveAt(e,o.from,1))return i={range:o};let u=o.from,f=s.lineAt(u),p=gz(r.resolveInner(u,-1),s);for(;p.length&&p[p.length-1].from>u-f.from;)p.pop();if(!p.length)return i={range:o};let m=p[p.length-1];if(m.to-m.spaceAfter.length>u-f.from)return i={range:o};let g=u>=m.to-m.spaceAfter.length&&!/\S/.test(f.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||f.from>0&&!/[^\s>]/.test(s.lineAt(f.from-1).text)||n.nonTightLists===!1){let $=p.length>1?p[p.length-2]:null,j,T="";$&&$.item?(j=f.from+$.from,T=$.marker(s,1)):j=f.from+($?$.to:0);let R=[{from:j,to:u,insert:T}];return m.node.name=="OrderedList"&&$x(m.item,s,R,-2),$&&$.node.name=="OrderedList"&&$x($.item,s,R),{range:ve.cursor(j+T.length),changes:R}}else{let $=n4(p,e,f);return{range:ve.cursor(u+$.length+1),changes:{from:f.from,insert:$+e.lineBreak}}}}if(m.node.name=="Blockquote"&&g&&f.from){let Q=s.lineAt(f.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:f.from+m.from,to:f.to}]);return{range:o.map($),changes:$}}}let x=[];m.node.name=="OrderedList"&&$x(m.item,s,x);let v=m.item&&m.item.from<f.from,y="";if(!v||/^[\s\d.)\-+*>]*/.exec(f.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?Ui(f.text,4,p[Q+1].from)-y.length:null);let S=u;for(;S>f.from&&/\s/.test(f.text.charAt(S-f.from-1));)S--;return y=FQ(y,e),gF(m.node,e.doc)&&(y=n4(p,e,f)+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)},OF=mF();function t4(n){return n.name=="QuoteMark"||n.name=="ListMark"}function gF(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 n4(n,e,t){let r="";for(let s=0,i=n.length-2;s<=i;s++)r+=n[s].blank(s<i?Ui(t.text,4,n[s+1].from)-r.length:null,s<i);return FQ(r,e)}function xF(n,e){let t=n.resolveInner(e,-1),r=e;t4(t)&&(r=t.from,t=t.parent);for(let s;s=t.childBefore(r);)if(t4(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")t=s.lastChild,r=t.to;else break;return t}const bF=({state:n,dispatch:e})=>{let t=nn(n),r=null,s=n.changeByRange(i=>{let a=i.from,{doc:o}=n;if(i.empty&&dm.isActiveAt(n,i.from)){let u=o.lineAt(a),f=gz(xF(t,a),o);if(f.length){let p=f[f.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(Ui(u.text,4,p.to)-Ui(u.text,4,p.from));return g==u.from&&(x=FQ(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)},yF=[{key:"Enter",run:OF},{key:"Backspace",run:bF}],bz=lF({matchClosingTags:!1});function vF(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:r=!0,base:{parser:s}=fF,completeHTMLTags:i=!0,pasteURLAsLink:a=!0,htmlTagLanguage:o=bz}=n;if(!(s instanceof Km))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=n.extensions?[n.extensions]:[],f=[o.support,dF],p;a&&f.push(kF),t instanceof Ml?(f.push(t.support),p=t.language):t&&(p=t);let m=e||p?pF(e,p):void 0;u.push(jG({codeParser:m,htmlParser:o.language.parser})),r&&f.push(Yl.high(Cc.of(yF)));let g=HQ(s.configure(u));return i&&f.push(g.data.of({autocomplete:wF})),new Ml(g,f)}function wF(n){let{state:e,pos:t}=n,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!r)return null;let s=nn(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:SF(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Tx=null;function SF(){if(Tx)return Tx;let n=sF(new CQ(xt.create({extensions:bz}),0,!0));return Tx=n?n.options:[]}const QF=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,kF=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),!dm.isActiveAt(e.state,r.from,1)))return!1;let i=nn(e.state),a=!1;return i.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||QF.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)}}),$F=1,yz=194,vz=195,TF=196,r4=197,jF=198,_F=199,PF=200,NF=2,wz=3,s4=201,CF=24,RF=25,EF=49,AF=50,qF=55,MF=56,XF=57,zF=59,LF=60,ZF=61,VF=62,YF=63,DF=65,BF=238,UF=71,WF=241,GF=242,IF=243,HF=244,FF=245,KF=246,JF=247,eK=248,Sz=72,tK=249,nK=250,rK=251,sK=252,iK=253,aK=254,lK=255,oK=256,cK=73,uK=77,dK=263,fK=112,hK=130,pK=151,mK=152,OK=155,Xl=10,qd=13,KQ=32,Jm=9,JQ=35,gK=40,xK=46,v2=123,i4=125,Qz=39,kz=34,a4=92,bK=111,yK=120,vK=78,wK=117,SK=85,QK=new Set([RF,EF,AF,dK,DF,hK,MF,XF,BF,VF,YF,Sz,cK,uK,LF,ZF,pK,mK,OK,fK]);function jx(n){return n==Xl||n==qd}function _x(n){return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}const kK=new Bn((n,e)=>{let t;if(n.next<0)n.acceptToken(_F);else if(e.context.flags&_p)jx(n.next)&&n.acceptToken(jF,1);else if(((t=n.peek(-1))<0||jx(t))&&e.canShift(r4)){let r=0;for(;n.next==KQ||n.next==Jm;)n.advance(),r++;(n.next==Xl||n.next==qd||n.next==JQ)&&n.acceptToken(r4,-r)}else jx(n.next)&&n.acceptToken(TF,1)},{contextual:!0}),$K=new Bn((n,e)=>{let t=e.context;if(t.flags)return;let r=n.peek(-1);if(r==Xl||r==qd){let s=0,i=0;for(;;){if(n.next==KQ)s++;else if(n.next==Jm)s+=8-s%8;else break;n.advance(),i++}s!=t.indent&&n.next!=Xl&&n.next!=qd&&n.next!=JQ&&(s<t.indent?n.acceptToken(vz,-i):n.acceptToken(yz))}}),_p=1,$z=2,Ci=4,Ri=8,Ei=16,Ai=32;function Pp(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 TK=new Pp(null,0,0);function jK(n){let e=0;for(let t=0;t<n.length;t++)e+=n.charCodeAt(t)==Jm?8-e%8:1;return e}const l4=new Map([[WF,0],[GF,Ci],[IF,Ri],[HF,Ri|Ci],[FF,Ei],[KF,Ei|Ci],[JF,Ei|Ri],[eK,Ei|Ri|Ci],[tK,Ai],[nK,Ai|Ci],[rK,Ai|Ri],[sK,Ai|Ri|Ci],[iK,Ai|Ei],[aK,Ai|Ei|Ci],[lK,Ai|Ei|Ri],[oK,Ai|Ei|Ri|Ci]].map(([n,e])=>[n,e|$z])),_K=new DQ({start:TK,reduce(n,e,t,r){return n.flags&_p&&QK.has(e)||(e==UF||e==Sz)&&n.flags&$z?n.parent:n},shift(n,e,t,r){return e==yz?new Pp(n,jK(r.read(r.pos,t.pos)),0):e==vz?n.parent:e==CF||e==qF||e==zF||e==wz?new Pp(n,0,_p):l4.has(e)?new Pp(n,0,l4.get(e)|n.flags&_p):n},hash(n){return n.hash}}),PK=new Bn(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==KQ||t==Jm)){t!=gK&&t!=xK&&t!=Xl&&t!=qd&&t!=JQ&&n.acceptToken($F);return}}}),NK=new Bn((n,e)=>{let{flags:t}=e.context,r=t&Ci?kz:Qz,s=(t&Ri)>0,i=!(t&Ei),a=(t&Ai)>0,o=n.pos;for(;!(n.next<0);)if(a&&n.next==v2)if(n.peek(1)==v2)n.advance(2);else{if(n.pos==o){n.acceptToken(wz,1);return}break}else if(i&&n.next==a4){if(n.pos==o){n.advance();let u=n.next;u>=0&&(n.advance(),CK(n,u)),n.acceptToken(NF);return}break}else if(n.next==a4&&!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(s4,s?3:1);return}break}else if(n.next==Xl){if(s)n.advance();else if(n.pos==o){n.acceptToken(s4);return}break}else n.advance();n.pos>o&&n.acceptToken(PF)});function CK(n,e){if(e==bK)for(let t=0;t<2&&n.next>=48&&n.next<=55;t++)n.advance();else if(e==yK)for(let t=0;t<2&&_x(n.next);t++)n.advance();else if(e==wK)for(let t=0;t<4&&_x(n.next);t++)n.advance();else if(e==SK)for(let t=0;t<8&&_x(n.next);t++)n.advance();else if(e==vK&&n.next==v2){for(n.advance();n.next>=0&&n.next!=i4&&n.next!=Qz&&n.next!=kz&&n.next!=Xl;)n.advance();n.next==i4&&n.advance()}}const RK=Wa({'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}),EK={__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},AK=Ba.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'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQ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U#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:_K,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:[RK],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!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i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`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:[PK,$K,kK,NK,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:n=>EK[n]||-1}],tokenPrec:7668}),o4=new QQ,Tz=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 qK={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 jz(n,e){let t=o4.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(St.IncludeAnonymous).iterate(a=>{if(a.name){let o=qK[a.name];if(o&&o(a,i,s)||!s&&Tz.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let o of jz(n,a.node))r.push(o);return!1}}),o4.set(e,r),r}const c4=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,_z=["String","FormatString","Comment","PropertyName"];function MK(n){let e=nn(n.state).resolveInner(n.pos,-1);if(_z.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&c4.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let s=e;s;s=s.parent)Tz.has(s.name)&&(r=r.concat(jz(n.state.doc,s)));return{options:r,from:t?e.from:n.pos,validFor:c4}}const XK=["__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"}))),zK=[Kt("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Kt("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Kt("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Kt("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Kt(`if \${}:
|
|
230
|
+
|
|
231
|
+
`,{label:"if",detail:"block",type:"keyword"}),Kt("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Kt("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Kt("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Kt("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],LK=tX(_z,RQ(XK.concat(zK)));function Px(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 Nx(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 Cx=Da.define({name:"python",parser:AK.configure({props:[Dl.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&Px(n)||n.node;return(e=Nx(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=Px(n);return(e=Nx(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":fd({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":fd({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":fd({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=Px(n);return(e=t&&Nx(n,t))!==null&&e!==void 0?e:n.continue()}}),Bl.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Um,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 ZK(){return new Ml(Cx,[Cx.data.of({autocomplete:MK}),Cx.data.of({autocomplete:LK})])}const VK=Wa({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}),YK={__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},DK=Ba.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'#GnO4wQPO'#D_O5OQPO'#DzO*pQPO'#E[O5qQPO'#E[OOQO'#DV'#DVO7SQQO'#HaO9^QQO'#EeO9eQPO'#EdO9jQPO'#EfOOQO'#Hb'#HbO7jQQO'#HbO:pQQO'#FhO:wQPO'#ExO:|QPO'#E}O:|QPO'#FPOOQO'#Ha'#HaOOQO'#HY'#HYOOQO'#Gh'#GhOOQO'#HX'#HXO<^QPO'#FiOOQO'#HW'#HWOOQO'#Gg'#GgQ]QPOOOOQO'#Hs'#HsO<cQPO'#HsO<hQPO'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+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:[VK],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##n#r#s#$[#s#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<%lO4eS%VV&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS%qO&YSS%tVOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZS&^VOY%QYZ%lZr%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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=>YK[n]||-1}],tokenPrec:7144}),BK=Da.define({name:"java",parser:DK.configure({props:[Dl.add({IfStatement:Tl({except:/^\s*({|else\b)/}),TryStatement:Tl({except:/^\s*({|catch|finally)\b/}),LabeledStatement:w7,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:fd({closing:"}"}),BlockComment:()=>null,Statement:Tl({except:/^{/})}),Bl.add({"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer":Um,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function UK(){return new Ml(BK)}const WK="#e5c07b",u4="#e06c75",GK="#56b6c2",IK="#ffffff",Np="#abb2bf",w2="#7d8799",HK="#61afef",FK="#98c379",d4="#d19a66",KK="#c678dd",JK="#21252b",f4="#2c313a",h4="#282c34",Rx="#353a42",eJ="#3E4451",p4="#528bff",tJ=Ae.theme({"&":{color:Np,backgroundColor:h4},".cm-content":{caretColor:p4},".cm-cursor, .cm-dropCursor":{borderLeftColor:p4},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:eJ},".cm-panels":{backgroundColor:JK,color:Np},".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:h4,color:w2,border:"none"},".cm-activeLineGutter":{backgroundColor:f4},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Rx},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Rx,borderBottomColor:Rx},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:f4,color:Np}}},{dark:!0}),nJ=Wm.define([{tag:Y.keyword,color:KK},{tag:[Y.name,Y.deleted,Y.character,Y.propertyName,Y.macroName],color:u4},{tag:[Y.function(Y.variableName),Y.labelName],color:HK},{tag:[Y.color,Y.constant(Y.name),Y.standard(Y.name)],color:d4},{tag:[Y.definition(Y.name),Y.separator],color:Np},{tag:[Y.typeName,Y.className,Y.number,Y.changed,Y.annotation,Y.modifier,Y.self,Y.namespace],color:WK},{tag:[Y.operator,Y.operatorKeyword,Y.url,Y.escape,Y.regexp,Y.link,Y.special(Y.string)],color:GK},{tag:[Y.meta,Y.comment],color:w2},{tag:Y.strong,fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.link,color:w2,textDecoration:"underline"},{tag:Y.heading,fontWeight:"bold",color:u4},{tag:[Y.atom,Y.bool,Y.special(Y.variableName)],color:d4},{tag:[Y.processingInstruction,Y.string,Y.inserted],color:FK},{tag:Y.invalid,color:IK}]),m4=[tJ,oU(nJ)];function ek(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ul=ek();function Pz(n){Ul=n}var md={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(nr.caret,"$1"),t=t.replace(s,a),r},getRegex:()=>new RegExp(t,e)};return r}var rJ=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),nr={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")},sJ=/^(?:[ \t]*(?:\n|$))+/,iJ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,aJ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lJ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tk=/(?:[*+-]|\d{1,9}[.)])/,Nz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Cz=bt(Nz).replace(/bull/g,tk).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(),oJ=bt(Nz).replace(/bull/g,tk).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(),nk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cJ=/^[^\n]+/,rk=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,uJ=bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dJ=bt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tk).getRegex(),eO="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",sk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fJ=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",sk).replace("tag",eO).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rz=bt(nk).replace("hr",sf).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",eO).getRegex(),hJ=bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rz).getRegex(),ik={blockquote:hJ,code:iJ,def:uJ,fences:aJ,heading:lJ,hr:sf,html:fJ,lheading:Cz,list:dJ,newline:sJ,paragraph:Rz,table:md,text:cJ},O4=bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",sf).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",eO).getRegex(),pJ={...ik,lheading:oJ,table:O4,paragraph:bt(nk).replace("hr",sf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",O4).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",eO).getRegex()},mJ={...ik,html:bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sk).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:md,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:bt(nk).replace("hr",sf).replace("heading",` *#{1,6} *[^
|
|
232
|
+
]`).replace("lheading",Cz).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},OJ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gJ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ez=/^( {2,}|\\)\n(?!\s*$)/,xJ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tO=/[\p{P}\p{S}]/u,ak=/[\s\p{P}\p{S}]/u,Az=/[^\s\p{P}\p{S}]/u,bJ=bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ak).getRegex(),qz=/(?!~)[\p{P}\p{S}]/u,yJ=/(?!~)[\s\p{P}\p{S}]/u,vJ=/(?:[^\s\p{P}\p{S}]|~)/u,wJ=bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",rJ?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Mz=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,SJ=bt(Mz,"u").replace(/punct/g,tO).getRegex(),QJ=bt(Mz,"u").replace(/punct/g,qz).getRegex(),Xz="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kJ=bt(Xz,"gu").replace(/notPunctSpace/g,Az).replace(/punctSpace/g,ak).replace(/punct/g,tO).getRegex(),$J=bt(Xz,"gu").replace(/notPunctSpace/g,vJ).replace(/punctSpace/g,yJ).replace(/punct/g,qz).getRegex(),TJ=bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Az).replace(/punctSpace/g,ak).replace(/punct/g,tO).getRegex(),jJ=bt(/\\(punct)/,"gu").replace(/punct/g,tO).getRegex(),_J=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(),PJ=bt(sk).replace("(?:-->|$)","-->").getRegex(),NJ=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",PJ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),fm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,CJ=bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",fm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zz=bt(/^!?\[(label)\]\[(ref)\]/).replace("label",fm).replace("ref",rk).getRegex(),Lz=bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",rk).getRegex(),RJ=bt("reflink|nolink(?!\\()","g").replace("reflink",zz).replace("nolink",Lz).getRegex(),g4=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lk={_backpedal:md,anyPunctuation:jJ,autolink:_J,blockSkip:wJ,br:Ez,code:gJ,del:md,emStrongLDelim:SJ,emStrongRDelimAst:kJ,emStrongRDelimUnd:TJ,escape:OJ,link:CJ,nolink:Lz,punctuation:bJ,reflink:zz,reflinkSearch:RJ,tag:NJ,text:xJ,url:md},EJ={...lk,link:bt(/^!?\[(label)\]\((.*?)\)/).replace("label",fm).getRegex(),reflink:bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fm).getRegex()},S2={...lk,emStrongRDelimAst:$J,emStrongLDelim:QJ,url:bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",g4).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",g4).getRegex()},AJ={...S2,br:bt(Ez).replace("{2,}","*").getRegex(),text:bt(S2.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tp={normal:ik,gfm:pJ,pedantic:mJ},Vu={normal:lk,gfm:S2,breaks:AJ,pedantic:EJ},qJ={"&":"&","<":"<",">":">",'"':""","'":"'"},x4=n=>qJ[n];function qi(n,e){if(e){if(nr.escapeTest.test(n))return n.replace(nr.escapeReplace,x4)}else if(nr.escapeTestNoEncode.test(n))return n.replace(nr.escapeReplaceNoEncode,x4);return n}function b4(n){try{n=encodeURI(n).replace(nr.percentDecode,"%")}catch{return null}return n}function y4(n,e){var i;let t=n.replace(nr.findPipe,(a,o,u)=>{let f=!1,p=o;for(;--p>=0&&u[p]==="\\";)f=!f;return f?"|":" |"}),r=t.split(nr.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(nr.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 MJ(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 v4(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 XJ(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 hm=class{constructor(n){Et(this,"options");Et(this,"rules");Et(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=XJ(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 f=o.join(`
|
|
239
|
+
`),p=f.replace(this.rules.other.blockquoteSetextReplace,`
|
|
240
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
241
|
+
${f}`:f,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 f=a.items.at(-1);if(f)f.raw=f.raw.trimEnd(),f.text=f.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=y4(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(y4(o,i.header.length).map((u,f)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[f]})));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=MJ(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)),v4(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 v4(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,f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*n.length+s);(r=f.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}}}},$s=class Q2{constructor(e){Et(this,"tokens");Et(this,"options");Et(this,"state");Et(this,"inlineQueue");Et(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ul,this.options.tokenizer=this.options.tokenizer||new hm,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:nr,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 Q2(t).lex(e)}static lexInline(e,t){return new Q2(t).inlineTokens(e)}lex(e){e=e.replace(nr.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(nr.tabCharGlobal," ").replace(nr.spaceLine,""));e;){let o;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(f=>(o=f.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 f=t.at(-1);o.raw.length===1&&f!==void 0?f.raw+=`
|
|
258
|
+
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let f=t.at(-1);(f==null?void 0:f.type)==="paragraph"||(f==null?void 0:f.type)==="text"?(f.raw+=(f.raw.endsWith(`
|
|
259
|
+
`)?"":`
|
|
260
|
+
`)+o.raw,f.text+=`
|
|
261
|
+
`+o.text,this.inlineQueue.at(-1).src=f.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 f=t.at(-1);(f==null?void 0:f.type)==="paragraph"||(f==null?void 0:f.type)==="text"?(f.raw+=(f.raw.endsWith(`
|
|
262
|
+
`)?"":`
|
|
263
|
+
`)+o.raw,f.text+=`
|
|
264
|
+
`+o.raw,this.inlineQueue.at(-1).src=f.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 f=1/0,p=e.slice(1),m;this.options.extensions.startBlock.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(f=Math.min(f,m))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){let f=t.at(-1);r&&(f==null?void 0:f.type)==="paragraph"?(f.raw+=(f.raw.endsWith(`
|
|
265
|
+
`)?"":`
|
|
266
|
+
`)+o.raw,f.text+=`
|
|
267
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.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 f=t.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=(f.raw.endsWith(`
|
|
268
|
+
`)?"":`
|
|
269
|
+
`)+o.raw,f.text+=`
|
|
270
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):t.push(o);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var u,f,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=((f=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:f.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}},pm=class{constructor(n){Et(this,"options");Et(this,"parser");this.options=n||Ul}space(n){return""}code({text:n,lang:e,escaped:t}){var i;let r=(i=(e||"").match(nr.notSpaceStart))==null?void 0:i[0],s=n.replace(nr.endingNewline,"")+`
|
|
271
|
+
`;return r?'<pre><code class="language-'+qi(r)+'">'+(t?s:qi(s,!0))+`</code></pre>
|
|
272
|
+
`:"<pre><code>"+(t?s:qi(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>${qi(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=b4(n);if(s===null)return r;n=s;let i='<a href="'+n+'"';return e&&(i+=' title="'+qi(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=b4(n);if(s===null)return qi(t);n=s;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${qi(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:qi(n.text)}},ok=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}},Ts=class k2{constructor(e){Et(this,"options");Et(this,"renderer");Et(this,"textRenderer");this.options=e||Ul,this.options.renderer=this.options.renderer||new pm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ok}static parse(e,t){return new k2(t).parse(e)}static parseInline(e,t){return new k2(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,f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){t+=f||"";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 f=this.options.extensions.renderers[o.type].call({parser:this},o);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=f||"";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 f='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return r}},hp,ed=(hp=class{constructor(n){Et(this,"options");Et(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?$s.lex:$s.lexInline}provideParser(){return this.block?Ts.parse:Ts.parseInline}},Et(hp,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Et(hp,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),hp),Zz=class{constructor(...n){Et(this,"defaults",ek());Et(this,"options",this.setOptions);Et(this,"parse",this.parseMarkdown(!0));Et(this,"parseInline",this.parseMarkdown(!1));Et(this,"Parser",Ts);Et(this,"Renderer",pm);Et(this,"TextRenderer",ok);Et(this,"Lexer",$s);Et(this,"Tokenizer",hm);Et(this,"Hooks",ed);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 pm(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]=(...f)=>{let p=o.apply(s,f);return p===!1&&(p=u.apply(s,f)),p||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new hm(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]=(...f)=>{let p=o.apply(s,f);return p===!1&&(p=u.apply(s,f)),p}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new ed;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];ed.passThroughHooks.has(i)?s[a]=f=>{if(this.defaults.async&&ed.passThroughHooksRespectAsync.has(i))return(async()=>{let m=await o.call(s,f);return u.call(s,m)})();let p=o.call(s,f);return u.call(s,p)}:s[a]=(...f)=>{if(this.defaults.async)return(async()=>{let m=await o.apply(s,f);return m===!1&&(m=await u.apply(s,f)),m})();let p=o.apply(s,f);return p===!1&&(p=u.apply(s,f)),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 $s.lex(n,e??this.defaults)}parser(n,e){return Ts.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?$s.lex:$s.lexInline)(a,s),u=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let f=await(s.hooks?await s.hooks.provideParser():n?Ts.parse:Ts.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(f):f})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer():n?$s.lex:$s.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?Ts.parse:Ts.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>"+qi(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},zl=new Zz;function At(n,e){return zl.parse(n,e)}At.options=At.setOptions=function(n){return zl.setOptions(n),At.defaults=zl.defaults,Pz(At.defaults),At};At.getDefaults=ek;At.defaults=Ul;At.use=function(...n){return zl.use(...n),At.defaults=zl.defaults,Pz(At.defaults),At};At.walkTokens=function(n,e){return zl.walkTokens(n,e)};At.parseInline=zl.parseInline;At.Parser=Ts;At.parser=Ts.parse;At.Renderer=pm;At.TextRenderer=ok;At.Lexer=$s;At.lexer=$s.lex;At.Tokenizer=hm;At.Hooks=ed;At.parse=At;At.options;At.setOptions;At.use;At.walkTokens;At.parseInline;Ts.parse;$s.lex;const w4=n=>n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(0)}K`:n.toString(),zJ=n=>n<.01?`$${n.toFixed(3)}`:`$${n.toFixed(2)}`,LJ=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},S4=n=>{const e=n.model.split("/").pop()||n.model;return e.length>25?e.substring(0,22)+"...":e},ZJ=({selectedModel:n,onModelChange:e,className:t=""})=>{const[r,s]=P.useState([]),[i,a]=P.useState(""),[o,u]=P.useState(!1),[f,p]=P.useState(!0),[m,g]=P.useState(null),x=P.useRef(null);P.useEffect(()=>{(async()=>{try{p(!0);const S=await Ne.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=LJ(r);return f?d.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:[d.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{className:"hidden sm:inline",children:"Loading..."})]}):m?d.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:[d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("span",{className:"hidden sm:inline",children:"Error"})]}):d.jsxs("div",{className:`relative ${t}`,ref:x,children:[d.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:[d.jsx("span",{className:"text-surface-400 hidden sm:inline",children:"Model:"}),d.jsx("span",{className:"text-white font-medium truncate max-w-[120px] sm:max-w-[180px]",children:n?S4(n):"Select..."}),n&&n.max_thinking_tokens>0&&d.jsx("span",{className:"px-1 py-0.5 rounded text-[9px] bg-purple-500/20 text-purple-300 hidden sm:inline",children:"Think"}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&d.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)=>d.jsxs("div",{children:[Q>0&&d.jsx("div",{className:"border-t border-surface-700"}),d.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 d.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:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("span",{className:`text-sm truncate ${$?"text-white font-medium":"text-surface-200"}`,children:S4(k)}),j&&d.jsx("span",{className:"px-1 py-0.5 rounded text-[9px] bg-green-500/20 text-green-300 flex-shrink-0",children:"Default"})]}),d.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-surface-400 flex-shrink-0",children:[d.jsx("span",{className:"text-green-400",children:zJ(k.input_cost)}),d.jsxs("span",{children:[w4(k.context_limit)," ctx"]}),d.jsxs("span",{className:"text-yellow-400",children:["ELO ",k.elo]})]})]}),k.max_thinking_tokens>0&&d.jsxs("div",{className:"mt-0.5 text-[10px] text-purple-400 flex items-center gap-1",children:[d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"})}),w4(k.max_thinking_tokens)," thinking tokens"]})]},k.model)})]},y))})]})},VJ=({rawMetrics:n,processedMetrics:e,viewMode:t,onViewModeChange:r,isLoading:s,preprocessingError:i,timeValue:a=.25,promptLineCount:o,codeLineCount:u,contextLimit:f,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)||f||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 d.jsxs("div",{className:"bg-surface-800/30 border-b border-surface-700/50",children:[d.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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400",children:"View:"}),d.jsxs("div",{className:"flex rounded-lg overflow-hidden border border-surface-600/50",children:[d.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"}),d.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"&&d.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&&d.jsx("div",{className:"hidden sm:block ml-2",children:d.jsx(ZJ,{selectedModel:m||null,onModelChange:g})})]}),d.jsx("div",{className:"flex items-center gap-3 sm:gap-5 flex-wrap",children:s?d.jsxs("div",{className:"flex items-center gap-1.5 text-surface-400 text-[10px] sm:text-xs",children:[d.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Analyzing..."]}):x?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400",children:"Tokens:"}),d.jsx("span",{className:"text-xs sm:text-sm font-mono text-white",children:N(x.token_count)})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Context:"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"w-12 sm:w-16 h-1.5 sm:h-2 bg-surface-700 rounded-full overflow-hidden",children:d.jsx("div",{className:`h-full transition-all ${T(x.context_usage_percent)}`,style:{width:`${Math.min(x.context_usage_percent,100)}%`}})}),d.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&&d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Cost:"}),d.jsx("span",{className:"text-xs sm:text-sm font-mono text-green-400",children:R(x.cost_estimate.input_cost)})]}),d.jsxs("div",{className:"flex items-center gap-1.5",title:`${N(S)} thinking tokens (${Math.round(a*100)}% of ${N(y)} max)`,children:[d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Thinking:"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"w-12 sm:w-16 h-1.5 sm:h-2 bg-surface-700 rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full transition-all bg-gradient-to-r from-purple-500 to-blue-500",style:{width:`${Math.min(a*100,100)}%`}})}),d.jsx("span",{className:"text-xs sm:text-sm font-mono text-purple-400",children:N(S)})]})]}),o!==void 0&&o>0&&u!==void 0&&d.jsxs("div",{className:"flex items-center gap-1.5",title:`${u} lines of code / ${o} lines of prompt`,children:[d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-400 hidden sm:inline",children:"Code:Prompt:"}),d.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"]}),d.jsxs("span",{className:"text-[10px] text-surface-500 hidden md:inline",children:["(",u,"/",o,")"]})]})]}):d.jsx("span",{className:"text-[10px] sm:text-xs text-surface-500",children:"No metrics"})})]}),x&&d.jsxs("div",{className:"px-3 sm:px-4 pb-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-[10px] text-surface-500 w-16 sm:w-20 flex-shrink-0",children:[N(v)," ctx"]}),d.jsxs("div",{className:"flex-1 h-2 sm:h-2.5 bg-surface-700/50 rounded-full overflow-hidden flex",children:[d.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${Math.min(z,100)}%`},title:`Input: ${N(Q)} tokens (${z.toFixed(1)}%)`}),d.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)}%)`}),d.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)}%)`})]})]}),d.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[9px] sm:text-[10px] text-surface-500",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"w-2 h-2 rounded-sm bg-blue-500"}),d.jsxs("span",{children:["Input ",N(Q)]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"w-2 h-2 rounded-sm bg-purple-500"}),d.jsxs("span",{children:["Thinking ",N(S)]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:`w-2 h-2 rounded-sm ${$?"bg-orange-500":"bg-green-500/50"}`}),d.jsxs("span",{className:$?"text-orange-400":"",children:["Output ",N(k),$&&" (low)"]})]})]})]})]})},Vz=[{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"}],YJ=[{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."}],Yz={include:"Context Includes",grounding:"Grounding (Cloud)",dynamic:"Dynamic Content",meta:"Comments"},DJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),mm=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})}),Om=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),Dz=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),BJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),Od=n=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.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"})]}),Ex=n=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25v3.75m0 0a3 3 0 003 3h3"}),d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-2.636-2.636"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 8.25l2.636-2.636"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 15.75l-2.636 2.636"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l2.636 2.636"})]}),UJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),Bz=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),Uz=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),WJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),Ax=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),Q4=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),GJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),Wz=n=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),IJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.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"})}),HJ=n=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...n,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),FJ=Vz.reduce((n,e)=>(n[e.category]||(n[e.category]=[]),n[e.category].push(e),n),{}),KJ=["include","dynamic","grounding","meta"],JJ=({directive:n})=>{const[e,t]=P.useState(!1);return d.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:[d.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:[d.jsxs("code",{className:"text-accent-400 font-mono text-sm",children:["<",n.tag,">"]}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e&&d.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-surface-700/50 bg-surface-900/30",children:[d.jsx("p",{className:"text-text-secondary text-xs mb-2",children:n.description}),d.jsx("div",{className:"bg-surface-900 rounded px-2 py-1.5",children:d.jsx("code",{className:"text-xs text-text-muted font-mono break-all",children:n.syntax})}),n.example&&d.jsxs("div",{className:"mt-2",children:[d.jsx("span",{className:"text-xs text-text-muted",children:"Example:"}),d.jsx("div",{className:"bg-surface-900 rounded px-2 py-1.5 mt-1",children:d.jsx("code",{className:"text-xs text-accent-300 font-mono break-all",children:n.example})})]})]})]})},eee=({isOpen:n,onClose:e})=>n?d.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:[d.jsxs("header",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-700 bg-surface-800/80",children:[d.jsxs("h3",{className:"font-semibold text-text-primary flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"]}),d.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:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("section",{className:"p-4",children:[d.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-3",children:"PDD Directives"}),d.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["Type ",d.jsx("code",{className:"text-accent-400 bg-surface-900 px-1 rounded",children:"<"})," in the editor to trigger autocomplete."]}),d.jsx("div",{className:"space-y-4",children:KJ.map(t=>{const r=FJ[t];return!r||r.length===0?null:d.jsxs("div",{children:[d.jsxs("h5",{className:"text-xs font-medium text-text-secondary mb-2 flex items-center gap-1.5",children:[d.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"}`}),Yz[t]]}),d.jsx("div",{className:"space-y-1.5",children:r.map(s=>d.jsx(JJ,{directive:s},s.tag))})]},t)})})]}),d.jsx("div",{className:"border-t border-surface-700 mx-4"}),d.jsxs("section",{className:"p-4",children:[d.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Best Practices"}),d.jsx("div",{className:"space-y-3",children:YJ.map((t,r)=>d.jsxs("div",{className:"rounded-md bg-surface-900/50 p-3",children:[d.jsxs("h5",{className:"text-sm font-medium text-text-primary mb-1 flex items-center gap-2",children:[d.jsx(Dz,{className:"w-3 h-3 text-surface-400 flex-shrink-0"}),t.title]}),d.jsx("p",{className:"text-xs text-text-secondary leading-relaxed",children:t.content})]},r))})]}),d.jsx("section",{className:"p-4 pt-0",children:d.jsxs("div",{className:"rounded-md bg-accent-500/10 border border-accent-500/20 p-3",children:[d.jsxs("h5",{className:"text-xs font-medium text-accent-400 mb-2 flex items-center gap-1.5",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Quick Tip"]}),d.jsxs("p",{className:"text-xs text-text-secondary",children:["Use ",d.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,tee={in_sync:{color:"text-green-400",bgColor:"bg-green-500/10",borderColor:"border-green-500/30",icon:d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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:d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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:d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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:d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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:d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2})}),label:"Not Synced",description:"No sync history exists"}},nee=({basename:n,language:e,refreshTrigger:t,className:r=""})=>{const[s,i]=P.useState(null),[a,o]=P.useState(!0),[u,f]=P.useState(null);if(P.useEffect(()=>{(async()=>{if(!n||!e){o(!1);return}o(!0),f(null);try{const x=await Ne.getSyncStatus(n,e);i(x)}catch(x){console.error("Failed to fetch sync status:",x),f(x.message||"Failed to load")}finally{o(!1)}})()},[n,e,t]),a)return d.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:[d.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{className:"hidden sm:inline",children:"Loading..."})]});if(u||!s)return d.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:[d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Unknown"})]});const p=tee[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}`),d.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,d.jsx("span",{className:"hidden sm:inline font-medium",children:p.label})]})};function ree(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),f=u.lastIndexOf("<");if(f>=0)s=o.from+f,i=u.slice(f+1).toLowerCase();else if(!e)return null}else return null;const a=Vz.filter(o=>o.tag.toLowerCase().startsWith(i)).map(o=>({label:o.tag,type:"keyword",detail:Yz[o.category],info:`${o.description}
|
|
291
|
+
|
|
292
|
+
Syntax: ${o.syntax}
|
|
293
|
+
Example: ${o.example}`,apply:(u,f,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 see=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 iee(){return[hG({override:[ree],icons:!1,optionClass:()=>"cm-pdd-completion",activateOnTyping:!0,activateOnTypingDelay:0}),Cc.of([{key:"Tab",run:iX}]),see]}function aee(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 lee(n){return n.split(",").map(e=>e.trim()).filter(Boolean)}const oee={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"}},cee=({isOpen:n,onClose:e,promptContent:t,codeContent:r,promptPath:s,codePath:i,prompt:a,onRunCommand:o})=>{const[u,f]=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,D]=P.useState(null),[C,G]=P.useState("working"),[A,W]=P.useState(""),[H,U]=P.useState(null),[ee,X]=P.useState(!1),[B,K]=P.useState(new Set),[Z,I]=P.useState(.5),J=se=>{$(be=>{const Oe=new Set(be);return Oe.has(se)?Oe.delete(se):Oe.add(se),Oe})};P.useEffect(()=>{n&&t&&r&&ne()},[n]);const ne=async()=>{m(!0),x(null),$(new Set);try{const se={prompt_content:t,code_content:r,strength:S,mode:v,include_tests:j,prompt_path:s,code_path:i},be=await Ne.analyzeDiff(se);f(be);const Oe=new Set;be.result.sections.filter(ye=>ye.status==="missing"||ye.status==="partial").forEach(ye=>Oe.add(`prompt-${ye.id}`)),be.result.codeSections.filter(ye=>ye.status==="extra").forEach(ye=>Oe.add(`code-${ye.id}`)),$(Oe)}catch(se){x(se instanceof Error?se.message:"Failed to analyze diff")}finally{m(!1)}},ce=async()=>{if(!s){D("No prompt path available");return}E(!0),D(null);try{const se=await Ne.getPromptHistory({prompt_path:s,limit:10});z(se),se.versions.length>0&&!A&&W(se.versions[0].commit_hash)}catch(se){D(se instanceof Error?se.message:"Failed to load history")}finally{E(!1)}},xe=async()=>{if(!(!s||!C||!A)){X(!0),D(null);try{const se=await Ne.getPromptDiff({prompt_path:s,version_a:C,version_b:A,code_path:i,strength:Z});U(se)}catch(se){D(se instanceof Error?se.message:"Failed to compare versions")}finally{X(!1)}}};P.useEffect(()=>{R==="history"&&!q&&s&&ce()},[R,s]),P.useEffect(()=>{if(H){const se=new Set;H.linguistic_changes.forEach((be,Oe)=>{(be.impact==="breaking"||be.impact==="enhancement")&&se.add(Oe)}),K(se)}},[H]);const ke=P.useCallback(()=>{if(!u)return[];const se=[];return u.result.sections.forEach(be=>{se.push({id:`prompt-${be.id}`,type:"prompt",section:be,sortKey:be.promptRange.startLine})}),u.result.codeSections.filter(be=>be.status==="extra").forEach(be=>{var Oe;se.push({id:`code-${be.id}`,type:"code",section:be,sortKey:((Oe=be.codeRanges[0])==null?void 0:Oe.startLine)||0})}),se.sort((be,Oe)=>be.sortKey-Oe.sortKey)},[u]);if(!n)return null;const Me=ke();return d.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 animate-fade-in",children:d.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:[d.jsxs("div",{className:"px-6 py-4 border-b border-surface-700/50 flex items-center justify-between flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.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:d.jsx("svg",{className:"w-5 h-5 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("h2",{className:"text-lg font-semibold text-white",children:"Prompt Analysis"}),d.jsxs("div",{className:"flex items-center bg-surface-800 rounded-lg p-0.5",children:[d.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"}),d.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"})]})]}),d.jsxs("p",{className:"text-sm text-surface-400",children:[R==="alignment"&&(u==null?void 0:u.cached)&&d.jsx("span",{className:"text-emerald-400",children:"(cached) "}),R==="alignment"&&(u==null?void 0:u.tests_included)&&d.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")]})]})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[R==="alignment"&&d.jsxs(d.Fragment,{children:[u&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.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:[d.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?d.jsx("svg",{className:"w-4 h-4 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):d.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-surface-800 rounded-lg",children:[d.jsx("span",{className:"text-xs text-purple-400",children:"Score"}),d.jsxs("span",{className:"text-lg font-bold",style:{color:u.result.overallScore>=80?"#10b981":u.result.overallScore>=50?"#f59e0b":"#ef4444"},children:[u.result.overallScore,"%"]})]})]}),d.jsxs("div",{className:"flex items-center bg-surface-800 rounded-lg p-0.5",children:[d.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"}),d.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"})]}),d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.jsxs("span",{className:"text-[10px] opacity-70",children:["(",u.test_files.length,")"]})]}),d.jsx("button",{onClick:ne,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?d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Analyzing..."]}):d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-3 bg-surface-800 rounded-lg px-3 py-1.5",children:[d.jsx("span",{className:"text-xs text-surface-400",children:"Strength"}),d.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:Z,onChange:se=>I(parseFloat(se.target.value)),className:"w-20 h-1.5 bg-surface-700 rounded-lg appearance-none cursor-pointer accent-purple-500"}),d.jsxs("span",{className:"text-xs text-purple-400 w-8",children:[(Z*100).toFixed(0),"%"]})]}),d.jsx("button",{onClick:ce,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?d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading..."]}):d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})})]}),d.jsx("button",{onClick:e,className:"p-2 text-surface-400 hover:text-white hover:bg-surface-700 rounded-lg transition-colors",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),R==="alignment"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex border-b border-surface-700/50 bg-surface-800/30 flex-shrink-0",children:[d.jsx("div",{className:"flex-1 px-6 py-2 border-r border-surface-700/50",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm font-medium text-purple-400",children:"Prompt Requirements"}),u&&d.jsxs("span",{className:"text-xs text-surface-500",children:[u.result.stats.matchedRequirements,"/",u.result.stats.totalRequirements," matched"]})]})}),d.jsx("div",{className:"flex-1 px-6 py-2",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm font-medium text-emerald-400",children:"Code Implementation"}),u&&d.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[d.jsxs("span",{className:"text-surface-500",children:[u.result.stats.documentedFeatures,"/",u.result.stats.totalCodeFeatures," documented"]}),u.result.hiddenKnowledge&&u.result.hiddenKnowledge.length>0&&d.jsxs("span",{className:"text-orange-400",children:[u.result.hiddenKnowledge.length," hidden"]})]})]})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p&&d.jsx("div",{className:"flex items-center justify-center py-16",children:d.jsxs("div",{className:"text-center",children:[d.jsxs("svg",{className:"w-8 h-8 animate-spin text-purple-500 mx-auto mb-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("p",{className:"text-surface-400",children:"Analyzing prompt and code alignment..."})]})}),g&&d.jsx("div",{className:"p-6",children:d.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-4 flex items-center gap-3",children:[d.jsx("svg",{className:"w-5 h-5 text-red-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("span",{className:"text-red-400",children:g})]})}),!p&&!g&&u&&d.jsxs("div",{className:"divide-y divide-surface-700/30",children:[Me.map(({id:se,type:be,section:Oe})=>{var we,Ke,ct,at,yt;const ye=k.has(se),Fe=oee[Oe.status],Te=Oe.status==="missing"||Oe.status==="extra";return d.jsxs("div",{className:`flex transition-colors ${Te?"bg-red-500/5":""}`,children:[d.jsx("div",{className:`flex-1 border-r border-surface-700/30 ${be==="code"?"bg-red-500/10":""}`,children:be==="prompt"?d.jsxs("div",{className:`p-4 cursor-pointer hover:bg-surface-700/20 transition-colors ${Fe.bg}`,onClick:()=>J(se),children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.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"}`}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-medium text-white text-sm",children:Oe.semanticLabel}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsxs("span",{className:`text-xs ${Fe.text}`,children:[Oe.matchConfidence,"%"]}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),d.jsxs("p",{className:"text-xs text-surface-400 mt-1",children:["Lines ",Oe.promptRange.startLine,"-",Oe.promptRange.endLine]}),Oe.notes&&d.jsx("p",{className:`text-xs mt-2 ${Fe.text}`,children:Oe.notes})]})]}),ye&&Oe.promptRange.text&&d.jsx("div",{className:"mt-3 ml-5",children:d.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})})]}):d.jsxs("div",{className:"p-4 flex flex-col items-center justify-center min-h-[80px] gap-2",children:[d.jsx("span",{className:"text-xs text-red-400/60 italic",children:"Not documented in prompt"}),a&&o&&d.jsxs("button",{onClick:Ye=>{Ye.stopPropagation(),o(Ve.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})]})}),d.jsx("div",{className:`flex-1 ${be==="prompt"&&Oe.status==="missing"?"bg-red-500/10":""}`,children:be==="prompt"&&Oe.status!=="missing"&&Oe.codeRanges.length>0?d.jsxs("div",{className:`p-4 cursor-pointer hover:bg-surface-700/20 transition-colors ${Fe.bg}`,onClick:()=>J(se),children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.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"}`}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-medium text-white text-sm",children:"Implementation"}),d.jsxs("span",{className:"text-xs text-surface-500",children:[Oe.codeRanges.length," location",Oe.codeRanges.length>1?"s":""]})]}),d.jsxs("p",{className:"text-xs text-surface-400 mt-1",children:["Lines ",(we=Oe.codeRanges[0])==null?void 0:we.startLine,"-",(Ke=Oe.codeRanges[0])==null?void 0:Ke.endLine,Oe.codeRanges.length>1&&` (+${Oe.codeRanges.length-1} more)`]})]})]}),ye&&d.jsx("div",{className:"mt-3 ml-5 space-y-2",children:Oe.codeRanges.map((Ye,tt)=>d.jsxs("div",{children:[Oe.codeRanges.length>1&&d.jsxs("span",{className:"text-[10px] text-surface-500 uppercase",children:["Location ",tt+1," (L",Ye.startLine,"-",Ye.endLine,")"]}),d.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:Ye.text||`Lines ${Ye.startLine}-${Ye.endLine}`})]},tt))})]}):be==="prompt"&&Oe.status==="missing"?d.jsxs("div",{className:"p-4 flex flex-col items-center justify-center min-h-[80px] bg-red-500/10 gap-2",children:[d.jsxs("div",{className:"text-center",children:[d.jsx("svg",{className:"w-5 h-5 text-red-400 mx-auto mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"text-xs text-red-400 font-medium",children:"Not implemented"})]}),a&&o&&d.jsxs("button",{onClick:Ye=>{Ye.stopPropagation(),o(Ve.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})]}):be==="code"?d.jsxs("div",{className:"p-4 cursor-pointer hover:bg-surface-700/20 transition-colors bg-red-500/5",onClick:()=>J(se),children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"w-2 h-2 rounded-full mt-1.5 flex-shrink-0 bg-red-500"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-medium text-white text-sm",children:Oe.semanticLabel}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx("span",{className:"text-xs text-red-400",children:"Undocumented"}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),d.jsxs("p",{className:"text-xs text-surface-400 mt-1",children:["Lines ",(ct=Oe.codeRanges[0])==null?void 0:ct.startLine,"-",(at=Oe.codeRanges[0])==null?void 0:at.endLine]}),Oe.notes&&d.jsx("p",{className:"text-xs mt-2 text-red-400",children:Oe.notes})]})]}),ye&&((yt=Oe.codeRanges[0])==null?void 0:yt.text)&&d.jsx("div",{className:"mt-3 ml-5",children:d.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})]},se)}),Me.length===0&&d.jsx("div",{className:"p-12 text-center text-surface-500",children:"No sections found. Try re-analyzing with different settings."})]})]})]}),R==="history"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-6 py-3 border-b border-surface-700/50 bg-surface-800/30 flex-shrink-0",children:!L&&q&&d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[d.jsx("label",{className:"text-xs text-surface-400",children:"Version A:"}),d.jsxs("select",{value:C,onChange:se=>G(se.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:[d.jsx("option",{value:"working",children:"Current (Working)"}),q.versions.map(se=>d.jsxs("option",{value:se.commit_hash,children:[se.commit_hash.slice(0,7)," - ",se.commit_message.slice(0,30)]},se.commit_hash))]})]}),d.jsx("span",{className:"text-surface-500 text-sm",children:"vs"}),d.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[d.jsx("label",{className:"text-xs text-surface-400",children:"Version B:"}),d.jsx("select",{value:A,onChange:se=>W(se.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(se=>d.jsxs("option",{value:se.commit_hash,children:[se.commit_hash.slice(0,7)," - ",se.commit_message.slice(0,30)]},se.commit_hash))})]}),d.jsx("button",{onClick:xe,disabled:ee||!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:ee?"Comparing...":"Compare"})]})}),H&&d.jsxs("div",{className:"flex border-b border-surface-700/50 bg-surface-800/30 flex-shrink-0",children:[d.jsx("div",{className:"flex-1 px-6 py-2 border-r border-surface-700/50",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-sm font-medium text-purple-400",children:["Older: ",H.version_a_label]}),H.versions_swapped&&d.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(se=>se.change_type==="removed").length>0&&d.jsxs("span",{className:"text-xs text-red-400",children:[H.linguistic_changes.filter(se=>se.change_type==="removed").length," removed"]})]})}),d.jsx("div",{className:"flex-1 px-6 py-2",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-sm font-medium text-emerald-400",children:["Newer: ",H.version_b_label]}),H.linguistic_changes.filter(se=>se.change_type==="added").length>0&&d.jsxs("span",{className:"text-xs text-emerald-400",children:[H.linguistic_changes.filter(se=>se.change_type==="added").length," added"]})]})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[L&&d.jsx("div",{className:"flex items-center justify-center py-16",children:d.jsxs("div",{className:"text-center",children:[d.jsxs("svg",{className:"w-8 h-8 animate-spin text-purple-500 mx-auto mb-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("p",{className:"text-surface-400",children:"Loading version history..."})]})}),V&&d.jsx("div",{className:"p-6",children:d.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-4 flex items-center gap-3",children:[d.jsx("svg",{className:"w-5 h-5 text-red-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("span",{className:"text-red-400",children:V})]})}),!L&&q&&!H&&d.jsxs("div",{className:"p-6",children:[d.jsx("div",{className:"mb-6 p-4 bg-surface-800/50 rounded-xl border border-surface-700/50",children:d.jsx("p",{className:"text-sm text-surface-400",children:'Select two versions above and click "Compare" to see side-by-side differences.'})}),d.jsxs("div",{className:"bg-surface-800/50 rounded-xl p-4 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-medium text-white mb-3",children:["Version History (",q.versions.length," commits)",q.has_uncommitted_changes&&d.jsx("span",{className:"ml-2 text-xs text-yellow-400",children:"(uncommitted changes)"})]}),d.jsx("div",{className:"space-y-2",children:q.versions.map(se=>d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-surface-700/30 cursor-pointer ${A===se.commit_hash?"bg-purple-500/20 border border-purple-500/30":""}`,onClick:()=>W(se.commit_hash),children:[d.jsx("div",{className:`w-2 h-2 rounded-full ${A===se.commit_hash?"bg-purple-400":"bg-surface-500"}`}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-mono text-purple-400",children:se.commit_hash.slice(0,7)}),d.jsx("span",{className:"text-sm text-white truncate",children:se.commit_message})]}),d.jsxs("div",{className:"text-xs text-surface-500",children:[se.author," • ",new Date(se.commit_date).toLocaleString()]})]})]},se.commit_hash))})]})]}),H&&d.jsxs("div",{className:"divide-y divide-surface-700/30",children:[d.jsxs("div",{className:"flex bg-surface-800/20",children:[d.jsxs("div",{className:"flex-1 p-4 border-r border-surface-700/30",children:[d.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Summary"}),d.jsx("p",{className:"text-sm text-surface-300",children:H.summary||"No changes detected"})]}),d.jsxs("div",{className:"flex-1 p-4",children:[d.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Changes"}),d.jsxs("div",{className:"flex gap-3 text-xs",children:[H.linguistic_changes.filter(se=>se.impact==="breaking").length>0&&d.jsxs("span",{className:"text-red-400",children:[H.linguistic_changes.filter(se=>se.impact==="breaking").length," breaking"]}),H.linguistic_changes.filter(se=>se.impact==="enhancement").length>0&&d.jsxs("span",{className:"text-emerald-400",children:[H.linguistic_changes.filter(se=>se.impact==="enhancement").length," enhancements"]}),H.linguistic_changes.filter(se=>se.impact==="clarification").length>0&&d.jsxs("span",{className:"text-blue-400",children:[H.linguistic_changes.filter(se=>se.impact==="clarification").length," clarifications"]})]})]})]}),H.linguistic_changes.map((se,be)=>{const Oe=B.has(be),ye=()=>{K(ct=>{const at=new Set(ct);return at.has(be)?at.delete(be):at.add(be),at})},Fe=se.impact==="breaking"?"bg-red-500/5":se.impact==="enhancement"?"bg-emerald-500/5":"bg-blue-500/5";se.impact==="breaking"||se.impact;const we=(ct=>{const at=ct.split(/[.!?]\s/)[0];return at.length<=100?at+(ct.length>at.length?".":""):ct.slice(0,80)+"..."})(se.description),Ke=se.description.length>we.length;return d.jsxs("div",{className:`${Fe} cursor-pointer hover:bg-surface-700/10 transition-colors`,onClick:ye,children:[d.jsx("div",{className:"px-4 pt-4 pb-2 border-b border-surface-700/20",children:d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[d.jsx("div",{className:`w-2.5 h-2.5 rounded-full mt-1 flex-shrink-0 ${se.change_type==="added"?"bg-emerald-500":se.change_type==="removed"?"bg-red-500":"bg-yellow-500"}`}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm text-white font-medium leading-relaxed",children:Oe?se.description:we}),!Oe&&Ke&&d.jsx("span",{className:"text-xs text-surface-500 ml-1",children:"(click to see more)"})]})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${se.change_type==="added"?"bg-emerald-500/20 text-emerald-400":se.change_type==="removed"?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"}`,children:se.change_type}),d.jsx("span",{className:"text-xs text-surface-500",children:se.category}),d.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${se.impact==="breaking"?"bg-red-500/20 text-red-400":se.impact==="enhancement"?"bg-emerald-500/20 text-emerald-400":"bg-blue-500/20 text-blue-400"}`,children:se.impact}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),d.jsxs("div",{className:"flex",children:[d.jsx("div",{className:`flex-1 border-r border-surface-700/30 p-4 pt-2 ${se.change_type==="added"?"bg-surface-800/20":""}`,children:se.old_text?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:`text-xs text-red-400/90 ${Oe?"":"line-clamp-3"}`,children:[Oe?"":se.old_text.slice(0,200),!Oe&&se.old_text.length>200?"...":""]}),Oe&&d.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:se.old_text})]}):d.jsx("p",{className:"text-xs text-surface-500 italic",children:se.change_type==="added"?"Not present in older version":"—"})}),d.jsx("div",{className:`flex-1 p-4 pt-2 ${se.change_type==="removed"?"bg-surface-800/20":""}`,children:se.new_text?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:`text-xs text-emerald-400/90 ${Oe?"":"line-clamp-3"}`,children:[Oe?"":se.new_text.slice(0,200),!Oe&&se.new_text.length>200?"...":""]}),Oe&&d.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:se.new_text})]}):d.jsx("p",{className:"text-xs text-surface-500 italic",children:se.change_type==="removed"?"Removed in newer version":"—"})})]})]},be)}),H.text_diff&&d.jsx("div",{className:"flex",children:d.jsxs("div",{className:"flex-1 p-4 cursor-pointer hover:bg-surface-700/10 transition-colors",onClick:()=>{K(se=>{const be=new Set(se);return be.has(-1)?be.delete(-1):be.add(-1),be})},children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium text-surface-300",children:"Raw Text Diff"}),d.jsxs("span",{className:"text-xs text-surface-500",children:["(",H.text_diff.split(`
|
|
294
|
+
`).filter(se=>se.startsWith("+")).length," additions,",H.text_diff.split(`
|
|
295
|
+
`).filter(se=>se.startsWith("-")).length," deletions)"]})]}),d.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${B.has(-1)?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),B.has(-1)&&d.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((se,be)=>d.jsx("div",{className:se.startsWith("+")&&!se.startsWith("+++")?"text-emerald-400 bg-emerald-500/10":se.startsWith("-")&&!se.startsWith("---")?"text-red-400 bg-red-500/10":se.startsWith("@")?"text-blue-400 bg-blue-500/10":"text-surface-400",children:se},be))})]})}),H.linguistic_changes.length===0&&d.jsx("div",{className:"p-12 text-center text-surface-500",children:"No semantic differences detected between versions."})]}),!L&&!q&&!V&&d.jsx("div",{className:"text-center py-16 text-surface-500",children:d.jsx("p",{children:"No history available. Click Refresh to load."})})]})]}),d.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:[d.jsxs("div",{className:"flex items-center gap-6",children:[R==="alignment"&&u&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"text-sm text-surface-300",children:u.result.summary}),d.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[u.result.stats.criticalGaps>0&&d.jsxs("span",{className:"text-red-400 flex items-center gap-1 font-medium",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.jsxs("span",{className:"text-orange-400 flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500"}),u.result.stats.hiddenKnowledgeCount," hidden knowledge"]}),u.result.stats.missingRequirements>0&&d.jsxs("span",{className:"text-red-400 flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),u.result.stats.missingRequirements," missing"]}),u.result.stats.undocumentedFeatures>0&&d.jsxs("span",{className:"text-red-400 flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),u.result.stats.undocumentedFeatures," undocumented"]}),!u.result.canRegenerate&&d.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&&d.jsxs("span",{className:"text-emerald-400 flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),"Safe to regenerate"]})]})]}),R==="history"&&q&&d.jsxs("div",{className:"text-sm text-surface-300",children:[q.versions.length," version",q.versions.length!==1?"s":""," found",q.has_uncommitted_changes&&d.jsx("span",{className:"text-yellow-400 ml-2",children:"• Uncommitted changes present"})]})]}),R==="alignment"&&u&&d.jsxs("div",{className:"text-xs text-surface-500",children:[u.model," ($",u.cost.toFixed(4),")"]}),R==="history"&&H&&H.cost>0&&d.jsxs("div",{className:"text-xs text-surface-500",children:[H.model," ($",H.cost.toFixed(4),")"]})]})]})})},uee=({type:n,name:e})=>n==="directory"?d.jsx(Uz,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".prompt")?d.jsx(Bz,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".py")?d.jsx(Ax,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".ts")||e.endsWith(".tsx")?d.jsx(Ax,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".js")||e.endsWith(".jsx")?d.jsx(Ax,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".json")?d.jsx(GJ,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):e.endsWith(".md")?d.jsx(Q4,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}):d.jsx(Q4,{className:"w-4 h-4 text-surface-400 mr-2 flex-shrink-0"}),Gz=({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 f=((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&&f.length===0)return null;const p=()=>{o?a(!i):e(n.path)},m=x=>{x.stopPropagation(),e(n.path)};return d.jsxs("div",{children:[d.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&&d.jsx("span",{className:"mr-1 text-surface-400",children:i?d.jsx(Om,{className:"w-4 h-4"}):d.jsx(mm,{className:"w-4 h-4 rotate-90"})}),d.jsx(uee,{type:n.type,name:n.name}),d.jsx("span",{className:`text-sm flex-1 ${o?"text-surface-200":"text-surface-300"}`,children:n.name}),s&&o&&d.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&&f.map((x,v)=>d.jsx(Gz,{node:x,onSelect:e,filter:t,depth:r+1,directoryMode:s},x.path||v))]})},$2=({onSelect:n,onClose:e,filter:t,title:r="Select File",directoryMode:s=!1})=>{const[i,a]=P.useState(null),[o,u]=P.useState(!0),[f,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 Ne.getFileTree("",5);a(Q)}catch(Q){p(Q.message||"Failed to load file tree")}finally{u(!1)}},y=Q=>{n(Q)},S=o?d.jsx("div",{className:"bg-surface-800 rounded-lg p-4 border border-surface-700",children:d.jsx("div",{className:"text-surface-400 text-center",children:"Loading files..."})}):f?d.jsxs("div",{className:"bg-surface-800 rounded-lg p-4 border border-surface-700",children:[d.jsx("div",{className:"text-red-400 text-center",children:f}),d.jsx("button",{onClick:v,className:"mt-2 w-full py-1 bg-surface-700 hover:bg-surface-600 rounded text-sm",children:"Retry"})]}):d.jsxs("div",{className:"bg-surface-800 rounded-lg border border-surface-700 overflow-hidden",children:[d.jsxs("div",{className:"p-3 border-b border-surface-700 flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-medium text-surface-200",children:r}),e&&d.jsx("button",{onClick:e,className:"p-1 hover:bg-surface-700 rounded text-surface-400 hover:text-white transition-colors",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"p-3 border-b border-surface-700/50",children:[d.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?d.jsx("div",{className:"mt-2 text-xs text-surface-500",children:"Showing directories only"}):x&&x.length>0?d.jsxs("div",{className:"mt-2 text-xs text-surface-500",children:["Showing: ",x.join(", ")]}):null]}),d.jsx("div",{className:"max-h-80 overflow-y-auto p-2",children:i?d.jsx(Gz,{node:i,onSelect:y,filter:x,depth:0,directoryMode:s}):d.jsx("div",{className:"text-surface-500 text-center py-4",children:"No files found"})})]});return e?d.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:Q=>{Q.target===Q.currentTarget&&e()},children:d.jsx("div",{className:"w-full max-w-md mx-4",children:S})}):S},ei=({label:n,value:e,onChange:t,placeholder:r="",description:s,required:i=!1,filter:a,directoryMode:o=!1,title:u,isDetected:f,detectedLabel:p="detected",className:m=""})=>{const[g,x]=P.useState(!1),v=Q=>{t(Q),x(!1)},y=Q=>{t(Q.target.value)},S=f!==void 0?f?"border-green-500/50":"border-yellow-500/50":"border-surface-600";return d.jsxs("div",{className:m,children:[d.jsxs("label",{className:"block text-sm font-medium text-white mb-1.5",children:[n,i&&d.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),s&&d.jsx("p",{className:"text-xs text-surface-400 mb-2",children:s}),d.jsxs("div",{className:"relative flex gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.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`}),f&&d.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})]}),d.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:d.jsx(WJ,{className:"w-4 h-4"})})]}),g&&d.jsx($2,{onSelect:v,onClose:()=>x(!1),filter:a,directoryMode:o,title:u||(o?"Select Directory":"Select File")})]})};function dee(n){var t;const e=(t=n.split(".").pop())==null?void 0:t.toLowerCase();switch(e){case"py":return ZK();case"js":case"jsx":case"ts":case"tsx":return iz({jsx:!0,typescript:e==="ts"||e==="tsx"});case"java":return UK();default:return[]}}const fee=new Zz({breaks:!0,gfm:!0});function qx(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const Mx=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`option-${n.name}`;if(n.type==="checkbox")return d.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:[d.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"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:qx(n.name)}),d.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 d.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:qx(n.name)}),d.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})]}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),d.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:f=>t(parseFloat(f.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`}),d.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return d.jsxs("div",{children:[d.jsxs("label",{htmlFor:s,className:`block ${r?"text-xs":"text-sm"} font-medium text-white mb-1.5`,children:[qx(n.name),n.required&&d.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mb-2`,children:n.description}),n.type==="textarea"?d.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"}):d.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"})]})},hee=({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===Ve.SUBMIT_EXAMPLE&&e.example&&(x["verification-program"]=e.example),hr.forEach(v=>{x[`_global_${v.name}`]=v.defaultValue}),x}),f=(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)}),hr.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)}),hr.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=hr.some(x=>o[`_global_${x.name}`]!==x.defaultValue);return d.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:d.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:[d.jsx("div",{className:"px-4 sm:px-6 py-4 border-b border-surface-700/50",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center",children:d.jsx("span",{className:"text-xl",children:n.icon})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:n.shortDescription}),d.jsx("p",{className:"text-xs sm:text-sm text-surface-400 line-clamp-1",children:n.description})]})]})}),d.jsxs("form",{onSubmit:p,children:[d.jsxs("div",{className:"px-4 sm:px-6 py-4 space-y-4 max-h-[50vh] sm:max-h-[60vh] overflow-y-auto",children:[d.jsxs("div",{className:"bg-surface-800/50 rounded-xl px-3 py-2.5 border border-surface-700/50",children:[d.jsx("div",{className:"text-xs text-surface-400 mb-0.5",children:"Target Prompt"}),d.jsx("div",{className:"text-sm text-white font-mono truncate",children:e.sync_basename})]}),n.requiresCode&&d.jsx(ei,{label:"Code File",value:o._code||"",onChange:x=>f("_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&&d.jsx(ei,{label:"Test File",value:o._test||"",onChange:x=>f("_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=>d.jsx(Mx,{option:x,value:o[x.name],onChange:v=>f(x.name,v)},x.name)):!n.requiresCode&&!n.requiresTest?d.jsx("p",{className:"text-surface-400 text-sm",children:"No additional options for this command."}):null,d.jsxs("div",{className:"border-t border-surface-700/30 pt-3 mt-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(!i),className:"w-full flex items-center justify-between text-left group",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),g&&d.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&d.jsxs("div",{className:"mt-3 space-y-3 animate-slide-down",children:[d.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),hr.filter(x=>["strength","temperature","time"].includes(x.name)).map(x=>d.jsx(Mx,{option:x,value:o[`_global_${x.name}`],onChange:v=>f(`_global_${x.name}`,v),compact:!0},x.name))]}),d.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),hr.filter(x=>["local","verbose","quiet","force","review-examples"].includes(x.name)).map(x=>d.jsx(Mx,{option:x,value:o[`_global_${x.name}`],onChange:v=>f(`_global_${x.name}`,v),compact:!0},x.name))]})]})]})]}),d.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:[d.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&&d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),d.jsx("span",{children:"Add to Queue"})]}),d.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:[d.jsx("span",{children:n.icon}),d.jsxs("span",{children:["Run ",n.shortDescription]})]})]})]})]})})},pee=({prompt:n,onBack:e,onRunCommand:t,onAddToQueue:r,isExecuting:s,executionStatus:i="idle",lastCommand:a=null,lastRunResult:o=null,onCancelCommand:u})=>{var ms;const f=P.useRef(null),p=P.useRef(null),m=P.useRef(""),g=P.useRef(""),x=P.useRef(new Id),[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,D]=P.useState("raw"),[C,G]=P.useState(null),[A,W]=P.useState(!1),[H,U]=P.useState(!1),[ee,X]=P.useState(null),[B,K]=P.useState({visible:!1,loading:!1,tagInfo:null,metrics:null,error:null}),[Z,I]=P.useState(""),[J,ne]=P.useState(!1),[ce,xe]=P.useState(null),[ke,Me]=P.useState(!1),[se,be]=P.useState(null),Oe=P.useRef(null),ye=P.useRef(null),[Fe,Te]=P.useState(!1),[we,Ke]=P.useState(null),[ct,at]=P.useState(.5),[yt,Ye]=P.useState(!1),[tt,gn]=P.useState(!1),[kt,Zt]=P.useState(null),[$t,rn]=P.useState(!1),[dn,pt]=P.useState(null),[Dt,ut]=P.useState(!1);P.useEffect(()=>{if(H){let pe;V==="processed"&&(C!=null&&C.processed_content)?pe=C.processed_content:p.current?pe=p.current.state.doc.toString():pe=g.current||k||"",I(pe)}},[H,V,C==null?void 0:C.processed_content,k]);const lt=P.useMemo(()=>{if(!Z)return"";try{const pe=fee.parse(Z);return typeof pe=="string"?pe:""}catch(pe){return console.error("Markdown rendering error:",pe),'<p class="text-red-400">Error rendering markdown</p>'}},[Z]);P.useEffect(()=>{let pe=!1;return(async()=>{y(!0),Q(null);try{const ze=await Ne.getFileContent(n.prompt);pe||(m.current=ze.content,g.current=ze.content,$(ze.content))}catch(ze){pe||Q(ze.message||"Failed to load file")}finally{pe||y(!1)}})(),()=>{pe=!0}},[n.prompt]),P.useEffect(()=>{if(H||k===null||!f.current)return;p.current&&(p.current.destroy(),p.current=null);const pe=g.current||k,$e=xt.create({doc:pe,extensions:[M_(),N_(),TU(),Cc.of([...cX,...NW,...qU]),vF(),m4,...iee(),x.current.of(Ae.editable.of(V==="raw")),Ae.updateListener.of(ze=>{if(ze.docChanged){const Mt=ze.state.doc.toString();ze.view.state.facet(Ae.editable)&&(g.current=Mt),T(Mt!==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:f.current}),()=>{p.current&&(p.current.destroy(),p.current=null)}},[k,H,V]),P.useEffect(()=>{if(k===null)return;const $e=setTimeout(async()=>{W(!0);try{const ze=p.current?p.current.state.doc.toString():g.current||k,Mt=(ee==null?void 0:ee.model)||"claude-sonnet-4-20250514",vn=await Ne.analyzePrompt({path:n.prompt,model:Mt,preprocess:!0,content:ze});G(vn)}catch(ze){console.error("Failed to analyze prompt:",ze)}finally{W(!1)}},500);return()=>clearTimeout($e)},[k,n.prompt,j,ee]);const Pt=P.useCallback(async()=>{if(!n.code){be("No code file associated with this prompt");return}Me(!0),be(null);try{const pe=await Ne.getFileContent(n.code);xe(pe.content)}catch(pe){be(pe.message||"Failed to load code file")}finally{Me(!1)}},[n.code]),vt=P.useCallback(()=>{!J&&!ce&&n.code&&Pt(),ne(!J)},[J,ce,n.code,Pt]),sn=P.useCallback(()=>{Pt()},[Pt]),vr=async()=>{if(!ce)if(n.code)await Pt();else{Zt("No code file associated with this prompt");return}Ye(!0),Zt(null);try{const pe=p.current?p.current.state.doc.toString():g.current||k||"",$e=await Ne.checkMatch({prompt_content:pe,code_content:ce||"",strength:ct});Ke($e)}catch(pe){Zt(pe.message||"Failed to check match")}finally{Ye(!1)}};P.useEffect(()=>{if(!J||ce===null||!Oe.current)return;ye.current&&(ye.current.destroy(),ye.current=null);const pe=xt.create({doc:ce,extensions:[M_(),N_(),Ae.editable.of(!1),dee(n.code||""),m4,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:pe,parent:Oe.current}),()=>{ye.current&&(ye.current.destroy(),ye.current=null)}},[J,ce,n.code]),P.useEffect(()=>{const pe=$e=>{($e.metaKey||$e.ctrlKey)&&$e.key==="."&&($e.preventDefault(),Tt()),$e.key==="Escape"&&B.visible&&Ft()};return window.addEventListener("keydown",pe),()=>window.removeEventListener("keydown",pe)},[B.visible]);const ge=pe=>{if(V==="raw"&&p.current&&(g.current=p.current.state.doc.toString()),D(pe),p.current){let $e;const ze=pe==="raw";pe==="processed"&&(C!=null&&C.processed_content)?$e=C.processed_content:$e=g.current||k||"";const Mt=p.current.state.doc.toString(),vn=[x.current.reconfigure(Ae.editable.of(ze))];Mt!==$e?p.current.dispatch({changes:{from:0,to:Mt.length,insert:$e},effects:vn}):p.current.dispatch({effects:vn})}},Qe=async()=>{if(p.current){N(!0),z(!1),Q(null);try{const pe=p.current.state.doc.toString();await Ne.writeFile(n.prompt,pe),m.current=pe,g.current=pe,T(!1),z(!0),setTimeout(()=>z(!1),2e3)}catch(pe){Q(pe.message||"Failed to save")}finally{N(!1)}}},Re=()=>{j&&!window.confirm("Discard unsaved changes?")||e()},Je=async()=>{if(p.current){rn(!0),pt(null),ut(!1);try{const pe=n.prompt.split("/").pop()||n.prompt,$e=await Ne.generateTagsForPrompt(pe);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 Mt=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(),vn=$e.tags+`
|
|
301
|
+
|
|
302
|
+
`+Mt;p.current.dispatch({changes:{from:0,to:p.current.state.doc.length,insert:vn}})}else{const ze=p.current.state.doc.toString(),Mt=$e.tags+`
|
|
303
|
+
|
|
304
|
+
`+ze;p.current.dispatch({changes:{from:0,to:p.current.state.doc.length,insert:Mt}})}g.current=p.current.state.doc.toString(),T(g.current!==m.current),ut(!0),setTimeout(()=>ut(!1),3e3)}catch(pe){pt(pe.message||"Failed to sync from architecture")}finally{rn(!1)}}},Tt=async()=>{if(!p.current)return;const pe=p.current.state,$e=aee(pe);if(!$e){K({visible:!0,loading:!1,tagInfo:null,metrics:null,error:"Place cursor inside an <include>, <shell>, or <web> tag to analyze"}),setTimeout(()=>K(ze=>({...ze,visible:!1})),3e3);return}K({visible:!0,loading:!0,tagInfo:$e,metrics:null,error:null});try{let ze=$e.path;if($e.tagType==="include-many"){const vn=lee($e.path);vn.length>0&&(ze=vn[0])}const Mt=await Ne.analyzeFile(ze);K({visible:!0,loading:!1,tagInfo:$e,metrics:Mt,error:null})}catch(ze){K({visible:!0,loading:!1,tagInfo:$e,metrics:null,error:ze.message||"Failed to analyze file"})}},Ft=()=>{K(pe=>({...pe,visible:!1}))},_n=pe=>{const $e=Ea[pe];$e.options&&$e.options.length>0||$e.requiresCode||$e.requiresTest?E($e):t(pe)},xn=pe=>{L&&(t(L.name,pe),E(null))},bn=pe=>{L&&r&&(r(L.name,pe),E(null))},yn=pe=>{const $e=[];return pe.requiresCode&&!n.code&&$e.push("code"),pe.requiresTest&&!n.test&&$e.push("test"),$e},fn=Object.values(Ea).filter(pe=>pe.requiresPrompt&&!pe.isAdvanced),ci=Object.values(Ea).filter(pe=>pe.isAdvanced),[fs,wr]=P.useState(!1),[hs,zs]=P.useState(!1),[Sr,ps]=P.useState(!1);return d.jsxs("div",{className:"h-screen flex flex-col bg-surface-950",children:[d.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:[d.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0",children:[d.jsxs("button",{onClick:Re,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:[d.jsx("svg",{className:"w-4 h-4 sm:w-5 sm:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),d.jsx("span",{className:"hidden sm:inline text-sm",children:"Back"})]}),d.jsx("div",{className:"h-5 w-px bg-surface-700 hidden sm:block"}),d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("h1",{className:"text-sm sm:text-lg font-semibold text-white truncate",children:n.sync_basename}),n.language&&d.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&&d.jsx(nee,{basename:n.sync_basename,language:n.language,refreshTrigger:q?1:0})]})]}),d.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[d.jsx("button",{onClick:()=>wr(!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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16m-7 6h7"})})}),j&&d.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:[d.jsx("span",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-yellow-400 rounded-full animate-pulse"}),d.jsx("span",{className:"hidden xs:inline",children:"Unsaved"})]}),q&&d.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:d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),Dt&&d.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:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),d.jsx("span",{className:"hidden sm:inline",children:"Tags injected"})]}),dn&&d.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:dn,children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),d.jsxs("button",{onClick:Je,disabled:$t||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 ${!$t&&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:[$t?d.jsxs("svg",{className:"animate-spin h-3.5 w-3.5 sm:h-4 sm:w-4",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d.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:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:$t?"Syncing...":"Sync from JSON"})]}),d.jsxs("button",{onClick:Qe,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?d.jsxs("svg",{className:"animate-spin h-3.5 w-3.5 sm:h-4 sm:w-4",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d.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:d.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"})}),d.jsx("span",{className:"hidden xs:inline",children:R?"Saving...":"Save"})]})]})]}),i!=="idle"&&d.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"&&d.jsxs("span",{className:"flex items-center justify-center gap-2 flex-wrap",children:[d.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.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&&d.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"&&d.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Done"]}),i==="failed"&&d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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)&&d.jsx("div",{className:"text-xs text-red-200/80 max-w-xl text-center px-4",children:o.error_details})]})]}),d.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[fs&&d.jsx("div",{className:"lg:hidden fixed inset-0 bg-black/50 z-40 animate-fade-in",onClick:()=>wr(!1)}),d.jsxs("aside",{className:`
|
|
310
|
+
${fs?"translate-x-0":"-translate-x-full lg:translate-x-0"}
|
|
311
|
+
${J?"lg:hidden":""}
|
|
312
|
+
fixed lg:relative z-50 lg:z-auto
|
|
313
|
+
w-56 sm:w-52 lg:w-48 h-full
|
|
314
|
+
glass lg:bg-surface-800/30 border-r border-surface-700/50
|
|
315
|
+
flex flex-col transition-transform duration-300 ease-out
|
|
316
|
+
`,children:[d.jsxs("div",{className:"lg:hidden flex items-center justify-between p-3 border-b border-surface-700/50",children:[d.jsx("span",{className:"text-sm font-semibold text-white",children:"Menu"}),d.jsx("button",{onClick:()=>wr(!1),className:"p-1.5 text-surface-400 hover:text-white rounded-lg hover:bg-surface-700/50",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx("div",{className:"p-3 border-b border-surface-700/50 hidden lg:block",children:d.jsx("h2",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Commands"})}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsx("div",{className:"p-2 space-y-1",children:fn.map(pe=>{const $e=yn(pe),ze=$e.length>0;return d.jsxs("button",{onClick:()=>{s||(_n(pe.name),wr(!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:ze?`${pe.description} (${$e.join(", ")} file${$e.length>1?"s":""} not auto-detected)`:pe.description,children:[d.jsx("span",{className:"text-base",children:pe.icon}),d.jsx("span",{className:"flex-1",children:pe.shortDescription}),ze&&d.jsx("span",{className:"w-5 h-5 rounded-full bg-yellow-500/20 text-yellow-400 text-xs flex items-center justify-center",children:"!"})]},pe.name)})}),ci.length>0&&d.jsxs("div",{className:"border-t border-surface-700/30",children:[d.jsxs("button",{onClick:()=>zs(!hs),className:"w-full p-3 flex items-center justify-between text-left hover:bg-surface-700/30 transition-colors",children:[d.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Operations"}),d.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${hs?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),hs&&d.jsx("div",{className:"p-2 pt-0 space-y-1",children:ci.map(pe=>{const ze=yn(pe).length>0;return d.jsxs("button",{onClick:()=>{s||(_n(pe.name),wr(!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:pe.description,children:[d.jsx("span",{className:"text-surface-500 text-xs",children:pe.icon}),d.jsx("span",{className:"flex-1 text-xs",children:pe.shortDescription}),ze&&d.jsx("span",{className:"w-4 h-4 rounded-full bg-yellow-500/20 text-yellow-400 text-[10px] flex items-center justify-center",children:"!"})]},pe.name)})})]})]}),d.jsxs("div",{className:"p-3 border-t border-surface-700/50 space-y-2",children:[d.jsx("h3",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Files"}),d.jsxs("div",{className:"space-y-1.5 text-xs",children:[d.jsx(np,{label:"Prompt",path:n.prompt,exists:!0}),d.jsx(np,{label:"Code",path:n.code,exists:!!n.code}),d.jsx(np,{label:"Test",path:n.test,exists:!!n.test}),d.jsx(np,{label:"Example",path:n.example,exists:!!n.example})]})]})]}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:v?d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center mb-4",children:d.jsxs("svg",{className:"animate-spin h-5 w-5 text-accent-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}),d.jsx("div",{className:"text-surface-400 text-sm",children:"Loading prompt..."})]}):S&&k===null?d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[d.jsx("div",{className:"w-12 h-12 rounded-xl bg-red-500/20 flex items-center justify-center mb-4",children:d.jsx("svg",{className:"w-6 h-6 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("div",{className:"text-red-400 mb-2",children:S}),d.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"})]}):d.jsxs(d.Fragment,{children:[d.jsx(VJ,{rawMetrics:(C==null?void 0:C.raw_metrics)||null,processedMetrics:(C==null?void 0:C.processed_metrics)||null,viewMode:V,onViewModeChange:ge,isLoading:A,preprocessingError:C==null?void 0:C.preprocessing_error,timeValue:cn.time,promptLineCount:k?k.split(`
|
|
317
|
+
`).length:void 0,codeLineCount:ce?ce.split(`
|
|
318
|
+
`).length:void 0,selectedModel:ee,onModelChange:X}),d.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:[d.jsx("span",{className:"truncate flex-1",children:n.prompt}),V==="processed"&&d.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"}),d.jsxs("button",{onClick:Tt,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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Tokens"})]}),d.jsxs("button",{onClick:vt,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?J?"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?J?"Hide code panel":"Show code side-by-side":"No code file available",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),d.jsx("span",{className:"hidden sm:inline",children:"Code"})]}),d.jsxs("button",{onClick:()=>ps(!Sr),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 ${Sr?"bg-accent-600 text-white":"bg-surface-700/50 text-surface-300 hover:bg-surface-600 hover:text-white"}`,title:Sr?"Hide prompting guide":"Show prompting guide",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Guide"})]}),d.jsxs("button",{onClick:()=>Te(!0),disabled:!n.code||yt,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:[yt?d.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Match"})]}),d.jsxs("button",{onClick:()=>gn(!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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"hidden sm:inline",children:"Diff"})]}),d.jsx("button",{onClick:()=>U(!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?d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),d.jsx("span",{className:"hidden sm:inline",children:"Source"})]}):d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),d.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"})]}),d.jsx("span",{className:"hidden sm:inline",children:"Preview"})]})})]}),d.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[d.jsx("div",{className:`flex-1 flex flex-col overflow-hidden ${J?"flex-1":"w-full"}`,children:H?d.jsx("div",{className:"flex-1 overflow-auto bg-surface-900/50 p-4 sm:p-6 lg:p-8",children:d.jsx("div",{className:"markdown-body max-w-4xl mx-auto",dangerouslySetInnerHTML:{__html:lt}})}):d.jsx("div",{ref:f,className:"flex-1 overflow-hidden"})}),J&&d.jsx("div",{className:"flex flex-col items-center justify-center py-4 px-1 bg-surface-800/50 border-x border-surface-700/50",children:d.jsx("div",{className:"flex flex-col gap-1.5",children:fn.map(pe=>{const $e=yn(pe),ze=$e.length>0;return d.jsxs("button",{onClick:()=>{s||_n(pe.name)},disabled:s,className:`flex flex-col items-center gap-1 p-2 rounded-lg text-xs font-medium transition-all duration-200 min-w-[52px] ${s?"text-surface-500 cursor-not-allowed":"text-surface-400 hover:bg-surface-700/70 hover:text-white"}`,title:ze?`${pe.description} (${$e.join(", ")} file${$e.length>1?"s":""} not auto-detected)`:pe.description,children:[d.jsxs("span",{className:"text-lg relative",children:[pe.icon,ze&&d.jsx("span",{className:"absolute -top-1 -right-1 w-2.5 h-2.5 rounded-full bg-yellow-500/80"})]}),d.jsx("span",{className:"text-[10px] leading-tight text-center",children:pe.shortDescription})]},pe.name)})})}),J&&d.jsxs("div",{className:"flex-1 flex flex-col bg-surface-900/50",children:[d.jsxs("div",{className:"px-3 py-2 bg-surface-800/50 border-b border-surface-700/50 flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("svg",{className:"w-4 h-4 text-blue-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),d.jsx("span",{className:"text-xs text-surface-400 font-mono truncate",title:n.code||"",children:((ms=n.code)==null?void 0:ms.split("/").pop())||"Code"}),d.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"})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:sn,disabled:ke,className:"p-1.5 text-surface-400 hover:text-white hover:bg-surface-700 rounded transition-colors",title:"Reload code file",children:d.jsx("svg",{className:`w-3.5 h-3.5 ${ke?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("button",{onClick:()=>ne(!1),className:"p-1.5 text-surface-400 hover:text-white hover:bg-surface-700 rounded transition-colors",title:"Close code panel",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),ke?d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{className:"text-sm text-surface-400",children:"Loading code..."})]})}):se?d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsxs("div",{className:"flex flex-col items-center gap-3 p-4 text-center",children:[d.jsx("svg",{className:"w-8 h-8 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"text-sm text-red-300",children:se}),d.jsx("button",{onClick:sn,className:"px-3 py-1.5 text-xs bg-surface-700 hover:bg-surface-600 rounded-lg transition-colors",children:"Retry"})]})}):d.jsx("div",{ref:Oe,className:"flex-1 overflow-hidden"})]})]}),S&&d.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})]})}),d.jsx(eee,{isOpen:Sr,onClose:()=>ps(!1)})]}),L&&d.jsx(hee,{command:L,prompt:n,onRun:xn,onAddToQueue:r?bn:void 0,onCancel:()=>E(null)}),B.visible&&d.jsx("div",{className:"fixed bottom-4 right-4 z-50 animate-slide-up",children:d.jsxs("div",{className:"bg-surface-800 border border-surface-600 rounded-xl shadow-2xl p-4 w-80",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("h4",{className:"text-sm font-semibold text-white flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"]}),d.jsx("button",{onClick:Ft,className:"p-1 rounded hover:bg-surface-700 text-surface-400 hover:text-white transition-colors",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),B.loading?d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsxs("svg",{className:"animate-spin h-5 w-5 text-accent-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{className:"ml-2 text-sm text-surface-400",children:"Analyzing..."})]}):B.error?d.jsx("div",{className:"text-sm text-surface-400 bg-surface-900/50 rounded-lg p-3",children:B.error}):B.metrics&&B.tagInfo?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[d.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"File"}),d.jsx("div",{className:"text-sm text-white font-mono truncate",children:B.tagInfo.path})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[d.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Tokens"}),d.jsx("div",{className:"text-lg font-semibold text-accent-400",children:B.metrics.token_count.toLocaleString()})]}),d.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[d.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Context Usage"}),d.jsxs("div",{className:"text-lg font-semibold text-white",children:[B.metrics.context_usage_percent.toFixed(1),"%"]})]})]}),B.metrics.cost_estimate&&d.jsxs("div",{className:"bg-surface-900/50 rounded-lg p-3",children:[d.jsx("div",{className:"text-xs text-surface-500 mb-1",children:"Estimated Cost"}),d.jsxs("div",{className:"text-sm text-green-400",children:["$",B.metrics.cost_estimate.input_cost.toFixed(4)," USD"]})]})]}):null,d.jsx("div",{className:"mt-3 pt-3 border-t border-surface-700",children:d.jsxs("p",{className:"text-[10px] text-surface-500",children:["Press ",d.jsx("kbd",{className:"px-1 py-0.5 bg-surface-700 rounded text-surface-400",children:"Cmd+."})," to analyze include at cursor"]})})]})}),Fe&&d.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:d.jsxs("div",{className:"glass rounded-2xl border border-surface-600/50 shadow-2xl w-full max-w-lg animate-scale-in",onClick:pe=>pe.stopPropagation(),children:[d.jsx("div",{className:"px-6 py-4 border-b border-surface-700/50",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-500/20 flex items-center justify-center",children:d.jsx("svg",{className:"w-5 h-5 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:"Check Prompt-Code Match"}),d.jsx("p",{className:"text-sm text-surface-400",children:"Evaluate how well your code implements the prompt"})]})]})}),d.jsxs("div",{className:"px-6 py-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm text-surface-300 mb-2 block",children:"Model Strength"}),d.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(pe=>d.jsxs("button",{onClick:()=>at(pe.value),className:`py-2 px-3 rounded-lg text-xs transition-all ${ct===pe.value?"bg-purple-600 text-white":"bg-surface-700 text-surface-300 hover:bg-surface-600"}`,children:[d.jsx("div",{className:"font-medium",children:pe.label}),d.jsx("div",{className:"text-[10px] opacity-70",children:pe.desc})]},pe.value))})]}),kt&&d.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:d.jsx("p",{className:"text-sm text-red-300",children:kt})}),we&&d.jsxs("div",{className:"p-4 bg-surface-900/50 rounded-xl space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-3xl font-bold",style:{color:we.result.match_score>=80?"#10b981":we.result.match_score>=50?"#f59e0b":"#ef4444"},children:[we.result.match_score,"%"]}),d.jsxs("span",{className:"text-xs text-surface-500",children:[we.model," ($",we.cost.toFixed(4),")"]})]}),d.jsx("p",{className:"text-sm text-surface-300",children:we.result.summary}),we.result.missing&&we.result.missing.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-red-400 font-medium mb-1",children:"Missing Requirements:"}),d.jsx("ul",{className:"text-xs text-surface-400 list-disc ml-4 space-y-0.5",children:we.result.missing.map((pe,$e)=>d.jsx("li",{children:pe},$e))})]}),we.result.extra&&we.result.extra.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-yellow-400 font-medium mb-1",children:"Extra Code (not in prompt):"}),d.jsx("ul",{className:"text-xs text-surface-400 list-disc ml-4 space-y-0.5",children:we.result.extra.map((pe,$e)=>d.jsx("li",{children:pe},$e))})]}),we.result.suggestions&&we.result.suggestions.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-blue-400 font-medium mb-1",children:"Suggestions:"}),d.jsx("ul",{className:"text-xs text-surface-400 list-disc ml-4 space-y-0.5",children:we.result.suggestions.map((pe,$e)=>d.jsx("li",{children:pe},$e))})]})]})]}),d.jsxs("div",{className:"px-6 py-4 border-t border-surface-700/50 flex justify-end gap-3",children:[d.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"}),d.jsx("button",{onClick:vr,disabled:yt,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:yt?d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Checking..."]}):"Run Check"})]})]})}),d.jsx(cee,{isOpen:tt,onClose:()=>gn(!1),promptContent:p.current?p.current.state.doc.toString():g.current||k||"",codeContent:ce||"",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})=>d.jsxs("div",{className:`flex items-center gap-2 ${t?"text-surface-300":"text-surface-500"}`,children:[d.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?"✓":"✗"}),d.jsx("span",{children:n})]});function Un(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=Un(n[t]))!==""&&(e+=(e&&" ")+r);else for(let t in n)n[t]&&(e+=(e&&" ")+t);return e}var Xx={exports:{}},zx={},Lx={exports:{}},Zx={};/**
|
|
319
|
+
* @license React
|
|
320
|
+
* use-sync-external-store-shim.production.js
|
|
321
|
+
*
|
|
322
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license found in the
|
|
325
|
+
* LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/var k4;function mee(){if(k4)return Zx;k4=1;var n=Bd();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 f(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Zx.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,Zx}var $4;function Oee(){return $4||($4=1,Lx.exports=mee()),Lx.exports}/**
|
|
327
|
+
* @license React
|
|
328
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
329
|
+
*
|
|
330
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the MIT license found in the
|
|
333
|
+
* LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/var T4;function gee(){if(T4)return zx;T4=1;var n=Bd(),e=Oee();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&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 zx.useSyncExternalStoreWithSelector=function(f,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(f,v[0],v[1]);return a(function(){y.hasValue=!0,y.value=S},[S]),u(S),S},zx}var j4;function xee(){return j4||(j4=1,Xx.exports=gee()),Xx.exports}var bee=xee();const yee=$m(bee),vee={},_4=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:()=>f,subscribe:p=>(t.add(p),()=>t.delete(p)),destroy:()=>{(vee?"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()}},f=e=n(r,s,u);return u},wee=n=>n?_4(n):_4,{useDebugValue:See}=ue,{useSyncExternalStoreWithSelector:Qee}=yee,kee=n=>n;function Iz(n,e=kee,t){const r=Qee(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return See(r),r}const P4=(n,e)=>{const t=wee(n),r=(s,i=e)=>Iz(t,s,i);return Object.assign(r,t),r},$ee=(n,e)=>n?P4(n,e):P4;function Mn(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 Tee={value:()=>{}};function nO(){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 Cp(t)}function Cp(n){this._=n}function jee(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}})}Cp.prototype=nO.prototype={constructor:Cp,on:function(n,e){var t=this._,r=jee(n+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i<a;)if((s=(n=r[i]).type)&&(s=_ee(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]=N4(t[s],n.name,e);else if(e==null)for(s in t)t[s]=N4(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 Cp(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 _ee(n,e){for(var t=0,r=n.length,s;t<r;++t)if((s=n[t]).name===e)return s.value}function N4(n,e,t){for(var r=0,s=n.length;r<s;++r)if(n[r].name===e){n[r]=Tee,n=n.slice(0,r).concat(n.slice(r+1));break}return t!=null&&n.push({name:e,value:t}),n}var T2="http://www.w3.org/1999/xhtml";const C4={svg:"http://www.w3.org/2000/svg",xhtml:T2,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rO(n){var e=n+="",t=e.indexOf(":");return t>=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),C4.hasOwnProperty(e)?{space:C4[e],local:n}:n}function Pee(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===T2&&e.documentElement.namespaceURI===T2?e.createElement(n):e.createElementNS(t,n)}}function Nee(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Hz(n){var e=rO(n);return(e.local?Nee:Pee)(e)}function Cee(){}function ck(n){return n==null?Cee:function(){return this.querySelector(n)}}function Ree(n){typeof n!="function"&&(n=ck(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,f,p=0;p<a;++p)(u=i[p])&&(f=n.call(u,u.__data__,p,i))&&("__data__"in u&&(f.__data__=u.__data__),o[p]=f);return new Lr(r,this._parents)}function Eee(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function Aee(){return[]}function Fz(n){return n==null?Aee:function(){return this.querySelectorAll(n)}}function qee(n){return function(){return Eee(n.apply(this,arguments))}}function Mee(n){typeof n=="function"?n=qee(n):n=Fz(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,f=0;f<o;++f)(u=a[f])&&(r.push(n.call(u,u.__data__,f,a)),s.push(u));return new Lr(r,s)}function Kz(n){return function(){return this.matches(n)}}function Jz(n){return function(e){return e.matches(n)}}var Xee=Array.prototype.find;function zee(n){return function(){return Xee.call(this.children,n)}}function Lee(){return this.firstElementChild}function Zee(n){return this.select(n==null?Lee:zee(typeof n=="function"?n:Jz(n)))}var Vee=Array.prototype.filter;function Yee(){return Array.from(this.children)}function Dee(n){return function(){return Vee.call(this.children,n)}}function Bee(n){return this.selectAll(n==null?Yee:Dee(typeof n=="function"?n:Jz(n)))}function Uee(n){typeof n!="function"&&(n=Kz(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,f=0;f<a;++f)(u=i[f])&&n.call(u,u.__data__,f,i)&&o.push(u);return new Lr(r,this._parents)}function eL(n){return new Array(n.length)}function Wee(){return new Lr(this._enter||this._groups.map(eL),this._parents)}function gm(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}gm.prototype={constructor:gm,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 Gee(n){return function(){return n}}function Iee(n,e,t,r,s,i){for(var a=0,o,u=e.length,f=i.length;a<f;++a)(o=e[a])?(o.__data__=i[a],r[a]=o):t[a]=new gm(n,i[a]);for(;a<u;++a)(o=e[a])&&(s[a]=o)}function Hee(n,e,t,r,s,i,a){var o,u,f=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)+"",f.has(x)?s[o]=u:f.set(x,u));for(o=0;o<m;++o)x=a.call(n,i[o],o,i)+"",(u=f.get(x))?(r[o]=u,u.__data__=i[o],f.delete(x)):t[o]=new gm(n,i[o]);for(o=0;o<p;++o)(u=e[o])&&f.get(g[o])===u&&(s[o]=u)}function Fee(n){return n.__data__}function Kee(n,e){if(!arguments.length)return Array.from(this,Fee);var t=e?Hee:Iee,r=this._parents,s=this._groups;typeof n!="function"&&(n=Gee(n));for(var i=s.length,a=new Array(i),o=new Array(i),u=new Array(i),f=0;f<i;++f){var p=r[f],m=s[f],g=m.length,x=Jee(n.call(p,p&&p.__data__,f,r)),v=x.length,y=o[f]=new Array(v),S=a[f]=new Array(v),Q=u[f]=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 Lr(a,r),a._enter=o,a._exit=u,a}function Jee(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function ete(){return new Lr(this._exit||this._groups.map(eL),this._parents)}function tte(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 nte(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 f=t[u],p=r[u],m=f.length,g=o[u]=new Array(m),x,v=0;v<m;++v)(x=f[v]||p[v])&&(g[v]=x);for(;u<s;++u)o[u]=t[u];return new Lr(o,this._parents)}function rte(){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 ste(n){n||(n=ite);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),f,p=0;p<o;++p)(f=a[p])&&(u[p]=f);u.sort(e)}return new Lr(s,this._parents).order()}function ite(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function ate(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function lte(){return Array.from(this)}function ote(){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 cte(){let n=0;for(const e of this)++n;return n}function ute(){return!this.node()}function dte(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 fte(n){return function(){this.removeAttribute(n)}}function hte(n){return function(){this.removeAttributeNS(n.space,n.local)}}function pte(n,e){return function(){this.setAttribute(n,e)}}function mte(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function Ote(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttribute(n):this.setAttribute(n,t)}}function gte(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 xte(n,e){var t=rO(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?hte:fte:typeof e=="function"?t.local?gte:Ote:t.local?mte:pte)(t,e))}function tL(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function bte(n){return function(){this.style.removeProperty(n)}}function yte(n,e,t){return function(){this.style.setProperty(n,e,t)}}function vte(n,e,t){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function wte(n,e,t){return arguments.length>1?this.each((e==null?bte:typeof e=="function"?vte:yte)(n,e,t??"")):wc(this.node(),n)}function wc(n,e){return n.style.getPropertyValue(e)||tL(n).getComputedStyle(n,null).getPropertyValue(e)}function Ste(n){return function(){delete this[n]}}function Qte(n,e){return function(){this[n]=e}}function kte(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function $te(n,e){return arguments.length>1?this.each((e==null?Ste:typeof e=="function"?kte:Qte)(n,e)):this.node()[n]}function nL(n){return n.trim().split(/^|\s+/)}function uk(n){return n.classList||new rL(n)}function rL(n){this._node=n,this._names=nL(n.getAttribute("class")||"")}rL.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 sL(n,e){for(var t=uk(n),r=-1,s=e.length;++r<s;)t.add(e[r])}function iL(n,e){for(var t=uk(n),r=-1,s=e.length;++r<s;)t.remove(e[r])}function Tte(n){return function(){sL(this,n)}}function jte(n){return function(){iL(this,n)}}function _te(n,e){return function(){(e.apply(this,arguments)?sL:iL)(this,n)}}function Pte(n,e){var t=nL(n+"");if(arguments.length<2){for(var r=uk(this.node()),s=-1,i=t.length;++s<i;)if(!r.contains(t[s]))return!1;return!0}return this.each((typeof e=="function"?_te:e?Tte:jte)(t,e))}function Nte(){this.textContent=""}function Cte(n){return function(){this.textContent=n}}function Rte(n){return function(){var e=n.apply(this,arguments);this.textContent=e??""}}function Ete(n){return arguments.length?this.each(n==null?Nte:(typeof n=="function"?Rte:Cte)(n)):this.node().textContent}function Ate(){this.innerHTML=""}function qte(n){return function(){this.innerHTML=n}}function Mte(n){return function(){var e=n.apply(this,arguments);this.innerHTML=e??""}}function Xte(n){return arguments.length?this.each(n==null?Ate:(typeof n=="function"?Mte:qte)(n)):this.node().innerHTML}function zte(){this.nextSibling&&this.parentNode.appendChild(this)}function Lte(){return this.each(zte)}function Zte(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Vte(){return this.each(Zte)}function Yte(n){var e=typeof n=="function"?n:Hz(n);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Dte(){return null}function Bte(n,e){var t=typeof n=="function"?n:Hz(n),r=e==null?Dte:typeof e=="function"?e:ck(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)})}function Ute(){var n=this.parentNode;n&&n.removeChild(this)}function Wte(){return this.each(Ute)}function Gte(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Ite(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Hte(n){return this.select(n?Ite:Gte)}function Fte(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Kte(n){return function(e){n.call(this,e,this.__data__)}}function Jte(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 ene(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 tne(n,e,t){return function(){var r=this.__on,s,i=Kte(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 nne(n,e,t){var r=Jte(n+""),s,i=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,f=o.length,p;u<f;++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?tne:ene,s=0;s<i;++s)this.each(o(r[s],e,t));return this}function aL(n,e,t){var r=tL(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 rne(n,e){return function(){return aL(this,n,e)}}function sne(n,e){return function(){return aL(this,n,e.apply(this,arguments))}}function ine(n,e){return this.each((typeof e=="function"?sne:rne)(n,e))}function*ane(){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 lL=[null];function Lr(n,e){this._groups=n,this._parents=e}function af(){return new Lr([[document.documentElement]],lL)}function lne(){return this}Lr.prototype=af.prototype={constructor:Lr,select:Ree,selectAll:Mee,selectChild:Zee,selectChildren:Bee,filter:Uee,data:Kee,enter:Wee,exit:ete,join:tte,merge:nte,selection:lne,order:rte,sort:ste,call:ate,nodes:lte,node:ote,size:cte,empty:ute,each:dte,attr:xte,style:wte,property:$te,classed:Pte,text:Ete,html:Xte,raise:Lte,lower:Vte,append:Yte,insert:Bte,remove:Wte,clone:Hte,datum:Fte,on:nne,dispatch:ine,[Symbol.iterator]:ane};function Hr(n){return typeof n=="string"?new Lr([[document.querySelector(n)]],[document.documentElement]):new Lr([[n]],lL)}function one(n){let e;for(;e=n.sourceEvent;)n=e;return n}function ks(n,e){if(n=one(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 cne={passive:!1},Md={capture:!0,passive:!1};function Vx(n){n.stopImmediatePropagation()}function oc(n){n.preventDefault(),n.stopImmediatePropagation()}function oL(n){var e=n.document.documentElement,t=Hr(n).on("dragstart.drag",oc,Md);"onselectstart"in e?t.on("selectstart.drag",oc,Md):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function cL(n,e){var t=n.document.documentElement,r=Hr(n).on("dragstart.drag",null);e&&(r.on("click.drag",oc,Md),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 j2(n,{sourceEvent:e,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:u,dy:f,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:f,enumerable:!0,configurable:!0},_:{value:p}})}j2.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function une(n){return!n.ctrlKey&&!n.button}function dne(){return this.parentNode}function fne(n,e){return e??{x:n.x,y:n.y}}function hne(){return navigator.maxTouchPoints||"ontouchstart"in this}function pne(){var n=une,e=dne,t=fne,r=hne,s={},i=nO("start","drag","end"),a=0,o,u,f,p,m=0;function g(j){j.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",Q,cne).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&&(Hr(j.view).on("mousemove.drag",v,Md).on("mouseup.drag",y,Md),oL(j.view),Vx(j),f=!1,o=j.clientX,u=j.clientY,R("start",j))}}function v(j){if(oc(j),!f){var T=j.clientX-o,R=j.clientY-u;f=T*T+R*R>m}s.mouse("drag",j)}function y(j){Hr(j.view).on("mousemove.drag mouseup.drag",null),cL(j.view,f),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]))&&(Vx(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])&&(Vx(j),q("end",j,T[N]))}function $(j,T,R,N,q,z){var L=i.copy(),E=ks(z||R,T),V,D,C;if((C=t.call(j,new j2("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,D=C.y-E[1]||0,function G(A,W,H){var U=E,ee;switch(A){case"start":s[q]=G,ee=a++;break;case"end":delete s[q],--a;case"drag":E=ks(H||W,T),ee=a;break}L.call(A,j,new j2(A,{sourceEvent:W,subject:C,target:g,identifier:q,active:ee,x:E[0]+V,y:E[1]+D,dx:E[0]-U[0],dy:E[1]-U[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 dk(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function uL(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function lf(){}var Xd=.7,xm=1/Xd,cc="\\s*([+-]?\\d+)\\s*",zd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mne=/^#([0-9a-f]{3,8})$/,One=new RegExp(`^rgb\\(${cc},${cc},${cc}\\)$`),gne=new RegExp(`^rgb\\(${si},${si},${si}\\)$`),xne=new RegExp(`^rgba\\(${cc},${cc},${cc},${zd}\\)$`),bne=new RegExp(`^rgba\\(${si},${si},${si},${zd}\\)$`),yne=new RegExp(`^hsl\\(${zd},${si},${si}\\)$`),vne=new RegExp(`^hsla\\(${zd},${si},${si},${zd}\\)$`),R4={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};dk(lf,Ld,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:E4,formatHex:E4,formatHex8:wne,formatHsl:Sne,formatRgb:A4,toString:A4});function E4(){return this.rgb().formatHex()}function wne(){return this.rgb().formatHex8()}function Sne(){return dL(this).formatHsl()}function A4(){return this.rgb().formatRgb()}function Ld(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=mne.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?q4(e):t===3?new xr(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=One.exec(n))?new xr(e[1],e[2],e[3],1):(e=gne.exec(n))?new xr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=xne.exec(n))?sp(e[1],e[2],e[3],e[4]):(e=bne.exec(n))?sp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=yne.exec(n))?z4(e[1],e[2]/100,e[3]/100,1):(e=vne.exec(n))?z4(e[1],e[2]/100,e[3]/100,e[4]):R4.hasOwnProperty(n)?q4(R4[n]):n==="transparent"?new xr(NaN,NaN,NaN,0):null}function q4(n){return new xr(n>>16&255,n>>8&255,n&255,1)}function sp(n,e,t,r){return r<=0&&(n=e=t=NaN),new xr(n,e,t,r)}function Qne(n){return n instanceof lf||(n=Ld(n)),n?(n=n.rgb(),new xr(n.r,n.g,n.b,n.opacity)):new xr}function _2(n,e,t,r){return arguments.length===1?Qne(n):new xr(n,e,t,r??1)}function xr(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}dk(xr,_2,uL(lf,{brighter(n){return n=n==null?xm:Math.pow(xm,n),new xr(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Xd:Math.pow(Xd,n),new xr(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new xr(_l(this.r),_l(this.g),_l(this.b),bm(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:M4,formatHex:M4,formatHex8:kne,formatRgb:X4,toString:X4}));function M4(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}`}function kne(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}${kl((isNaN(this.opacity)?1:this.opacity)*255)}`}function X4(){const n=bm(this.opacity);return`${n===1?"rgb(":"rgba("}${_l(this.r)}, ${_l(this.g)}, ${_l(this.b)}${n===1?")":`, ${n})`}`}function bm(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 z4(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new _s(n,e,t,r)}function dL(n){if(n instanceof _s)return new _s(n.h,n.s,n.l,n.opacity);if(n instanceof lf||(n=Ld(n)),!n)return new _s;if(n instanceof _s)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 _s(a,o,u,n.opacity)}function $ne(n,e,t,r){return arguments.length===1?dL(n):new _s(n,e,t,r??1)}function _s(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}dk(_s,$ne,uL(lf,{brighter(n){return n=n==null?xm:Math.pow(xm,n),new _s(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Xd:Math.pow(Xd,n),new _s(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 xr(Yx(n>=240?n-240:n+120,s,r),Yx(n,s,r),Yx(n<120?n+240:n-120,s,r),this.opacity)},clamp(){return new _s(L4(this.h),ip(this.s),ip(this.l),bm(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=bm(this.opacity);return`${n===1?"hsl(":"hsla("}${L4(this.h)}, ${ip(this.s)*100}%, ${ip(this.l)*100}%${n===1?")":`, ${n})`}`}}));function L4(n){return n=(n||0)%360,n<0?n+360:n}function ip(n){return Math.max(0,Math.min(1,n||0))}function Yx(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 fL=n=>()=>n;function Tne(n,e){return function(t){return n+t*e}}function jne(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 _ne(n){return(n=+n)==1?hL:function(e,t){return t-e?jne(e,t,n):fL(isNaN(e)?t:e)}}function hL(n,e){var t=e-n;return t?Tne(n,t):fL(isNaN(n)?e:n)}const Z4=(function n(e){var t=_ne(e);function r(s,i){var a=t((s=_2(s)).r,(i=_2(i)).r),o=t(s.g,i.g),u=t(s.b,i.b),f=hL(s.opacity,i.opacity);return function(p){return s.r=a(p),s.g=o(p),s.b=u(p),s.opacity=f(p),s+""}}return r.gamma=n,r})(1);function _a(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var P2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dx=new RegExp(P2.source,"g");function Pne(n){return function(){return n}}function Nne(n){return function(e){return n(e)+""}}function Cne(n,e){var t=P2.lastIndex=Dx.lastIndex=0,r,s,i,a=-1,o=[],u=[];for(n=n+"",e=e+"";(r=P2.exec(n))&&(s=Dx.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:_a(r,s)})),t=Dx.lastIndex;return t<e.length&&(i=e.slice(t),o[a]?o[a]+=i:o[++a]=i),o.length<2?u[0]?Nne(u[0].x):Pne(e):(e=u.length,function(f){for(var p=0,m;p<e;++p)o[(m=u[p]).i]=m.x(f);return o.join("")})}var V4=180/Math.PI,N2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pL(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)*V4,skewX:Math.atan(u)*V4,scaleX:a,scaleY:o}}var ap;function Rne(n){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?N2:pL(e.a,e.b,e.c,e.d,e.e,e.f)}function Ene(n){return n==null||(ap||(ap=document.createElementNS("http://www.w3.org/2000/svg","g")),ap.setAttribute("transform",n),!(n=ap.transform.baseVal.consolidate()))?N2:(n=n.matrix,pL(n.a,n.b,n.c,n.d,n.e,n.f))}function mL(n,e,t,r){function s(f){return f.length?f.pop()+" ":""}function i(f,p,m,g,x,v){if(f!==m||p!==g){var y=x.push("translate(",null,e,null,t);v.push({i:y-4,x:_a(f,m)},{i:y-2,x:_a(p,g)})}else(m||g)&&x.push("translate("+m+e+g+t)}function a(f,p,m,g){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),g.push({i:m.push(s(m)+"rotate(",null,r)-2,x:_a(f,p)})):p&&m.push(s(m)+"rotate("+p+r)}function o(f,p,m,g){f!==p?g.push({i:m.push(s(m)+"skewX(",null,r)-2,x:_a(f,p)}):p&&m.push(s(m)+"skewX("+p+r)}function u(f,p,m,g,x,v){if(f!==m||p!==g){var y=x.push(s(x)+"scale(",null,",",null,")");v.push({i:y-4,x:_a(f,m)},{i:y-2,x:_a(p,g)})}else(m!==1||g!==1)&&x.push(s(x)+"scale("+m+","+g+")")}return function(f,p){var m=[],g=[];return f=n(f),p=n(p),i(f.translateX,f.translateY,p.translateX,p.translateY,m,g),a(f.rotate,p.rotate,m,g),o(f.skewX,p.skewX,m,g),u(f.scaleX,f.scaleY,p.scaleX,p.scaleY,m,g),f=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 Ane=mL(Rne,"px, ","px)","deg)"),qne=mL(Ene,", ",")",")"),Mne=1e-12;function Y4(n){return((n=Math.exp(n))+1/n)/2}function Xne(n){return((n=Math.exp(n))-1/n)/2}function zne(n){return((n=Math.exp(2*n))-1)/(n+1)}const Lne=(function n(e,t,r){function s(i,a){var o=i[0],u=i[1],f=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<Mne)Q=Math.log(g/f)/e,S=function(N){return[o+N*x,u+N*v,f*Math.exp(e*N*Q)]};else{var k=Math.sqrt(y),$=(g*g-f*f+r*y)/(2*f*t*k),j=(g*g-f*f-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=Y4(T),L=f/(t*k)*(z*zne(e*q+T)-Xne(T));return[o+L*x,u+L*v,f*z/Y4(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,td=0,Du=0,OL=1e3,ym,nd,vm=0,Ll=0,sO=0,Zd=typeof performance=="object"&&performance.now?performance:Date,gL=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function fk(){return Ll||(gL(Zne),Ll=Zd.now()+sO)}function Zne(){Ll=0}function wm(){this._call=this._time=this._next=null}wm.prototype=xL.prototype={constructor:wm,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?fk():+t)+(e==null?0:+e),!this._next&&nd!==this&&(nd?nd._next=this:ym=this,nd=this),this._call=n,this._time=t,C2()},stop:function(){this._call&&(this._call=null,this._time=1/0,C2())}};function xL(n,e,t){var r=new wm;return r.restart(n,e,t),r}function Vne(){fk(),++Sc;for(var n=ym,e;n;)(e=Ll-n._time)>=0&&n._call.call(void 0,e),n=n._next;--Sc}function D4(){Ll=(vm=Zd.now())+sO,Sc=td=0;try{Vne()}finally{Sc=0,Dne(),Ll=0}}function Yne(){var n=Zd.now(),e=n-vm;e>OL&&(sO-=e,vm=n)}function Dne(){for(var n,e=ym,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:ym=t);nd=n,C2(r)}function C2(n){if(!Sc){td&&(td=clearTimeout(td));var e=n-Ll;e>24?(n<1/0&&(td=setTimeout(D4,n-Zd.now()-sO)),Du&&(Du=clearInterval(Du))):(Du||(vm=Zd.now(),Du=setInterval(Yne,OL)),Sc=1,gL(D4))}}function B4(n,e,t){var r=new wm;return e=e==null?0:+e,r.restart(s=>{r.stop(),n(s+e)},e,t),r}var Bne=nO("start","end","cancel","interrupt"),Une=[],bL=0,U4=1,R2=2,Rp=3,W4=4,E2=5,Ep=6;function iO(n,e,t,r,s,i){var a=n.__transition;if(!a)n.__transition={};else if(t in a)return;Wne(n,t,{name:e,index:r,group:s,on:Bne,tween:Une,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:bL})}function hk(n,e){var t=Ms(n,e);if(t.state>bL)throw new Error("too late; already scheduled");return t}function li(n,e){var t=Ms(n,e);if(t.state>Rp)throw new Error("too late; already running");return t}function Ms(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Wne(n,e,t){var r=n.__transition,s;r[e]=t,t.timer=xL(i,0,t.time);function i(f){t.state=U4,t.timer.restart(a,t.delay,t.time),t.delay<=f&&a(f-t.delay)}function a(f){var p,m,g,x;if(t.state!==U4)return u();for(p in r)if(x=r[p],x.name===t.name){if(x.state===Rp)return B4(a);x.state===W4?(x.state=Ep,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete r[p]):+p<e&&(x.state=Ep,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete r[p])}if(B4(function(){t.state===Rp&&(t.state=W4,t.timer.restart(o,t.delay,t.time),o(f))}),t.state=R2,t.on.call("start",n,n.__data__,t.index,t.group),t.state===R2){for(t.state=Rp,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(f){for(var p=f<t.duration?t.ease.call(null,f/t.duration):(t.timer.restart(u),t.state=E2,1),m=-1,g=s.length;++m<g;)s[m].call(n,p);t.state===E2&&(t.on.call("end",n,n.__data__,t.index,t.group),u())}function u(){t.state=Ep,t.timer.stop(),delete r[e];for(var f in r)return;delete n.__transition}}function Ap(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>R2&&r.state<E2,r.state=Ep,r.timer.stop(),r.on.call(s?"interrupt":"cancel",n,n.__data__,r.index,r.group),delete t[a]}i&&delete n.__transition}}function Gne(n){return this.each(function(){Ap(this,n)})}function Ine(n,e){var t,r;return function(){var s=li(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 Hne(n,e,t){var r,s;if(typeof t!="function")throw new Error;return function(){var i=li(this,n),a=i.tween;if(a!==r){s=(r=a).slice();for(var o={name:e,value:t},u=0,f=s.length;u<f;++u)if(s[u].name===e){s[u]=o;break}u===f&&s.push(o)}i.tween=s}}function Fne(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r=Ms(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?Ine:Hne)(t,n,e))}function pk(n,e,t){var r=n._id;return n.each(function(){var s=li(this,r);(s.value||(s.value={}))[e]=t.apply(this,arguments)}),function(s){return Ms(s,r).value[e]}}function yL(n,e){var t;return(typeof e=="number"?_a:e instanceof Ld?Z4:(t=Ld(e))?(e=t,Z4):Cne)(n,e)}function Kne(n){return function(){this.removeAttribute(n)}}function Jne(n){return function(){this.removeAttributeNS(n.space,n.local)}}function ere(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 tre(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 nre(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 rre(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 sre(n,e){var t=rO(n),r=t==="transform"?qne:yL;return this.attrTween(n,typeof e=="function"?(t.local?rre:nre)(t,r,pk(this,"attr."+n,e)):e==null?(t.local?Jne:Kne)(t):(t.local?tre:ere)(t,r,e))}function ire(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}function are(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}function lre(n,e){var t,r;function s(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&are(n,i)),t}return s._value=e,s}function ore(n,e){var t,r;function s(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&ire(n,i)),t}return s._value=e,s}function cre(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=rO(n);return this.tween(t,(r.local?lre:ore)(r,e))}function ure(n,e){return function(){hk(this,n).delay=+e.apply(this,arguments)}}function dre(n,e){return e=+e,function(){hk(this,n).delay=e}}function fre(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?ure:dre)(e,n)):Ms(this.node(),e).delay}function hre(n,e){return function(){li(this,n).duration=+e.apply(this,arguments)}}function pre(n,e){return e=+e,function(){li(this,n).duration=e}}function mre(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?hre:pre)(e,n)):Ms(this.node(),e).duration}function Ore(n,e){if(typeof e!="function")throw new Error;return function(){li(this,n).ease=e}}function gre(n){var e=this._id;return arguments.length?this.each(Ore(e,n)):Ms(this.node(),e).ease}function xre(n,e){return function(){var t=e.apply(this,arguments);if(typeof t!="function")throw new Error;li(this,n).ease=t}}function bre(n){if(typeof n!="function")throw new Error;return this.each(xre(this._id,n))}function yre(n){typeof n!="function"&&(n=Kz(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,f=0;f<a;++f)(u=i[f])&&n.call(u,u.__data__,f,i)&&o.push(u);return new Gi(r,this._parents,this._name,this._id)}function vre(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],f=t[o],p=u.length,m=a[o]=new Array(p),g,x=0;x<p;++x)(g=u[x]||f[x])&&(m[x]=g);for(;o<r;++o)a[o]=e[o];return new Gi(a,this._parents,this._name,this._id)}function wre(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 Sre(n,e,t){var r,s,i=wre(e)?hk:li;return function(){var a=i(this,n),o=a.on;o!==r&&(s=(r=o).copy()).on(e,t),a.on=s}}function Qre(n,e){var t=this._id;return arguments.length<2?Ms(this.node(),t).on.on(n):this.each(Sre(t,n,e))}function kre(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function $re(){return this.on("end.remove",kre(this._id))}function Tre(n){var e=this._name,t=this._id;typeof n!="function"&&(n=ck(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,f=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__),f[g]=m,iO(f[g],e,t,g,f,Ms(p,t)));return new Gi(i,this._parents,e,t)}function jre(n){var e=this._name,t=this._id;typeof n!="function"&&(n=Fz(n));for(var r=this._groups,s=r.length,i=[],a=[],o=0;o<s;++o)for(var u=r[o],f=u.length,p,m=0;m<f;++m)if(p=u[m]){for(var g=n.call(p,p.__data__,m,u),x,v=Ms(p,t),y=0,S=g.length;y<S;++y)(x=g[y])&&iO(x,e,t,y,g,v);i.push(g),a.push(p)}return new Gi(i,a,e,t)}var _re=af.prototype.constructor;function Pre(){return new _re(this._groups,this._parents)}function Nre(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 vL(n){return function(){this.style.removeProperty(n)}}function Cre(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 Rre(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 Ere(n,e){var t,r,s,i="style."+e,a="end."+i,o;return function(){var u=li(this,n),f=u.on,p=u.value[i]==null?o||(o=vL(e)):void 0;(f!==t||s!==p)&&(r=(t=f).copy()).on(a,s=p),u.on=r}}function Are(n,e,t){var r=(n+="")=="transform"?Ane:yL;return e==null?this.styleTween(n,Nre(n,r)).on("end.style."+n,vL(n)):typeof e=="function"?this.styleTween(n,Rre(n,r,pk(this,"style."+n,e))).each(Ere(this._id,n)):this.styleTween(n,Cre(n,r,e),t).on("end.style."+n,null)}function qre(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}function Mre(n,e,t){var r,s;function i(){var a=e.apply(this,arguments);return a!==s&&(r=(s=a)&&qre(n,a,t)),r}return i._value=e,i}function Xre(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,Mre(n,e,t??""))}function zre(n){return function(){this.textContent=n}}function Lre(n){return function(){var e=n(this);this.textContent=e??""}}function Zre(n){return this.tween("text",typeof n=="function"?Lre(pk(this,"text",n)):zre(n==null?"":n+""))}function Vre(n){return function(e){this.textContent=n.call(this,e)}}function Yre(n){var e,t;function r(){var s=n.apply(this,arguments);return s!==t&&(e=(t=s)&&Vre(s)),e}return r._value=n,r}function Dre(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,Yre(n))}function Bre(){for(var n=this._name,e=this._id,t=wL(),r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],o=a.length,u,f=0;f<o;++f)if(u=a[f]){var p=Ms(u,e);iO(u,n,t,f,a,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Gi(r,this._parents,n,t)}function Ure(){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 f=li(this,r),p=f.on;p!==n&&(e=(n=p).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(u)),f.on=e}),s===0&&i()})}var Wre=0;function Gi(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function wL(){return++Wre}var Ni=af.prototype;Gi.prototype={constructor:Gi,select:Tre,selectAll:jre,selectChild:Ni.selectChild,selectChildren:Ni.selectChildren,filter:yre,merge:vre,selection:Pre,transition:Bre,call:Ni.call,nodes:Ni.nodes,node:Ni.node,size:Ni.size,empty:Ni.empty,each:Ni.each,on:Qre,attr:sre,attrTween:cre,style:Are,styleTween:Xre,text:Zre,textTween:Dre,remove:$re,tween:Fne,delay:fre,duration:mre,ease:gre,easeVarying:bre,end:Ure,[Symbol.iterator]:Ni[Symbol.iterator]};function Gre(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var Ire={time:null,delay:0,duration:250,ease:Gre};function Hre(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 Fre(n){var e,t;n instanceof Gi?(e=n._id,n=n._name):(e=wL(),(t=Ire).time=fk(),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,f=0;f<o;++f)(u=a[f])&&iO(u,n,e,f,a,t||Hre(u,e));return new Gi(r,this._parents,n,e)}af.prototype.interrupt=Gne;af.prototype.transition=Fre;const lp=n=>()=>n;function Kre(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 Vi(n,e,t){this.k=n,this.x=e,this.y=t}Vi.prototype={constructor:Vi,scale:function(n){return n===1?this:new Vi(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new Vi(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 Bi=new Vi(1,0,0);Vi.prototype;function Bx(n){n.stopImmediatePropagation()}function Bu(n){n.preventDefault(),n.stopImmediatePropagation()}function Jre(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function ese(){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 G4(){return this.__zoom||Bi}function tse(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function nse(){return navigator.maxTouchPoints||"ontouchstart"in this}function rse(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 SL(){var n=Jre,e=ese,t=rse,r=tse,s=nse,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,u=Lne,f=nO("start","zoom","end"),p,m,g,x=500,v=150,y=0,S=10;function Q(C){C.property("__zoom",G4).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",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}Q.transform=function(C,G,A,W){var H=C.selection?C.selection():C;H.property("__zoom",G4),C!==H?T(C,G,A,W):H.interrupt().each(function(){R(this,arguments).event(W).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},Q.scaleBy=function(C,G,A,W){Q.scaleTo(C,function(){var H=this.__zoom.k,U=typeof G=="function"?G.apply(this,arguments):G;return H*U},A,W)},Q.scaleTo=function(C,G,A,W){Q.transform(C,function(){var H=e.apply(this,arguments),U=this.__zoom,ee=A==null?j(H):typeof A=="function"?A.apply(this,arguments):A,X=U.invert(ee),B=typeof G=="function"?G.apply(this,arguments):G;return t($(k(U,B),ee,X),H,a)},A,W)},Q.translateBy=function(C,G,A,W){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,W)},Q.translateTo=function(C,G,A,W,H){Q.transform(C,function(){var U=e.apply(this,arguments),ee=this.__zoom,X=W==null?j(U):typeof W=="function"?W.apply(this,arguments):W;return t(Bi.translate(X[0],X[1]).scale(ee.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof A=="function"?-A.apply(this,arguments):-A),U,a)},W,H)};function k(C,G){return G=Math.max(i[0],Math.min(i[1],G)),G===C.k?C:new Vi(G,C.x,C.y)}function $(C,G,A){var W=G[0]-A[0]*C.k,H=G[1]-A[1]*C.k;return W===C.x&&H===C.y?C:new Vi(C.k,W,H)}function j(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function T(C,G,A,W){C.on("start.zoom",function(){R(this,arguments).event(W).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(W).end()}).tween("zoom",function(){var H=this,U=arguments,ee=R(H,U).event(W),X=e.apply(H,U),B=A==null?j(X):typeof A=="function"?A.apply(H,U):A,K=Math.max(X[1][0]-X[0][0],X[1][1]-X[0][1]),Z=H.__zoom,I=typeof G=="function"?G.apply(H,U):G,J=u(Z.invert(B).concat(K/Z.k),I.invert(B).concat(K/I.k));return function(ne){if(ne===1)ne=I;else{var ce=J(ne),xe=K/ce[2];ne=new Vi(xe,B[0]-ce[0]*xe,B[1]-ce[1]*xe)}ee.zoom(null,ne)}})}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=Hr(this.that).datum();f.call(C,this.that,new Kre(C,{sourceEvent:this.sourceEvent,target:Q,transform:this.that.__zoom,dispatch:f}),G)}};function q(C,...G){if(!n.apply(this,arguments))return;var A=R(this,G).event(C),W=this.__zoom,H=Math.max(i[0],Math.min(i[1],W.k*Math.pow(2,r.apply(this,arguments)))),U=ks(C);if(A.wheel)(A.mouse[0][0]!==U[0]||A.mouse[0][1]!==U[1])&&(A.mouse[1]=W.invert(A.mouse[0]=U)),clearTimeout(A.wheel);else{if(W.k===H)return;A.mouse=[U,W.invert(U)],Ap(this),A.start()}Bu(C),A.wheel=setTimeout(ee,v),A.zoom("mouse",t($(k(W,H),A.mouse[0],A.mouse[1]),A.extent,a));function ee(){A.wheel=null,A.end()}}function z(C,...G){if(g||!n.apply(this,arguments))return;var A=C.currentTarget,W=R(this,G,!0).event(C),H=Hr(C.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",K,!0),U=ks(C,A),ee=C.clientX,X=C.clientY;oL(C.view),Bx(C),W.mouse=[U,this.__zoom.invert(U)],Ap(this),W.start();function B(Z){if(Bu(Z),!W.moved){var I=Z.clientX-ee,J=Z.clientY-X;W.moved=I*I+J*J>y}W.event(Z).zoom("mouse",t($(W.that.__zoom,W.mouse[0]=ks(Z,A),W.mouse[1]),W.extent,a))}function K(Z){H.on("mousemove.zoom mouseup.zoom",null),cL(Z.view,W.moved),Bu(Z),W.event(Z).end()}}function L(C,...G){if(n.apply(this,arguments)){var A=this.__zoom,W=ks(C.changedTouches?C.changedTouches[0]:C,this),H=A.invert(W),U=A.k*(C.shiftKey?.5:2),ee=t($(k(A,U),W,H),e.apply(this,G),a);Bu(C),o>0?Hr(this).transition().duration(o).call(T,ee,W,C):Hr(this).call(Q.transform,ee,W,C)}}function E(C,...G){if(n.apply(this,arguments)){var A=C.touches,W=A.length,H=R(this,G,C.changedTouches.length===W).event(C),U,ee,X,B;for(Bx(C),ee=0;ee<W;++ee)X=A[ee],B=ks(X,this),B=[B,this.__zoom.invert(B),X.identifier],H.touch0?!H.touch1&&H.touch0[2]!==B[2]&&(H.touch1=B,H.taps=0):(H.touch0=B,U=!0,H.taps=1+!!p);p&&(p=clearTimeout(p)),U&&(H.taps<2&&(m=B[0],p=setTimeout(function(){p=null},x)),Ap(this),H.start())}}function V(C,...G){if(this.__zooming){var A=R(this,G).event(C),W=C.changedTouches,H=W.length,U,ee,X,B;for(Bu(C),U=0;U<H;++U)ee=W[U],X=ks(ee,this),A.touch0&&A.touch0[2]===ee.identifier?A.touch0[0]=X:A.touch1&&A.touch1[2]===ee.identifier&&(A.touch1[0]=X);if(ee=A.that.__zoom,A.touch1){var K=A.touch0[0],Z=A.touch0[1],I=A.touch1[0],J=A.touch1[1],ne=(ne=I[0]-K[0])*ne+(ne=I[1]-K[1])*ne,ce=(ce=J[0]-Z[0])*ce+(ce=J[1]-Z[1])*ce;ee=k(ee,Math.sqrt(ne/ce)),X=[(K[0]+I[0])/2,(K[1]+I[1])/2],B=[(Z[0]+J[0])/2,(Z[1]+J[1])/2]}else if(A.touch0)X=A.touch0[0],B=A.touch0[1];else return;A.zoom("touch",t($(ee,X,B),A.extent,a))}}function D(C,...G){if(this.__zooming){var A=R(this,G).event(C),W=C.changedTouches,H=W.length,U,ee;for(Bx(C),g&&clearTimeout(g),g=setTimeout(function(){g=null},x),U=0;U<H;++U)ee=W[U],A.touch0&&A.touch0[2]===ee.identifier?delete A.touch0:A.touch1&&A.touch1[2]===ee.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&&(ee=ks(ee,this),Math.hypot(m[0]-ee[0],m[1]-ee[1])<S)){var X=Hr(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=f.on.apply(f,arguments);return C===f?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}tq();const aO=P.createContext(null),sse=aO.Provider,Ii={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.`},QL=Ii.error001();function Yt(n,e){const t=P.useContext(aO);if(t===null)throw new Error(QL);return Iz(t,n,e)}const En=()=>{const n=P.useContext(aO);if(n===null)throw new Error(QL);return P.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe,destroy:n.destroy}),[n])},ise=n=>n.userSelectionActive?"none":"all";function lO({position:n,children:e,className:t,style:r,...s}){const i=Yt(ise),a=`${n}`.split("-");return ue.createElement("div",{className:Un(["react-flow__panel",t,...a]),style:{...r,pointerEvents:i},...s},e)}function ase({proOptions:n,position:e="bottom-right"}){return n!=null&&n.hideAttribution?null:ue.createElement(lO,{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 lse=({x:n,y:e,label:t,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:u,className:f,...p})=>{const m=P.useRef(null),[g,x]=P.useState({x:0,y:0,width:0,height:0}),v=Un(["react-flow__edge-textwrapper",f]);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 ose=P.memo(lse);const mk=n=>({width:n.offsetWidth,height:n.offsetHeight}),Qc=(n,e=0,t=1)=>Math.min(Math.max(n,e),t),Ok=(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])}),I4=(n,e,t)=>n<e?Qc(Math.abs(n-e),1,50)/50:n>t?-Qc(Math.abs(n-t),1,50)/50:0,kL=(n,e)=>{const t=I4(n.x,35,e.width-35)*20,r=I4(n.y,35,e.height-35)*20;return[t,r]},$L=n=>{var e;return((e=n.getRootNode)==null?void 0:e.call(n))||(window==null?void 0:window.document)},TL=(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)}),Vd=({x:n,y:e,width:t,height:r})=>({x:n,y:e,x2:n+t,y2:e+r}),jL=({x:n,y:e,x2:t,y2:r})=>({x:n,y:e,width:t-n,height:r-e}),H4=n=>({...n.positionAbsolute||{x:0,y:0},width:n.width||0,height:n.height||0}),cse=(n,e)=>jL(TL(Vd(n),Vd(e))),A2=(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)},use=n=>ns(n.width)&&ns(n.height)&&ns(n.x)&&ns(n.y),ns=n=>!isNaN(n)&&isFinite(n),un=Symbol.for("internals"),_L=["Enter"," ","Escape"],dse=(n,e)=>{},fse=n=>"nativeEvent"in n;function q2(n){var s,i;const e=fse(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 PL=n=>"clientX"in n,Ma=(n,e)=>{var i,a;const t=PL(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)}},Sm=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0},of=({id:n,path:e,labelX:t,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:f,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&&ns(t)&&ns(r)?ue.createElement(ose,{x:t,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:f}):null);of.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 NL({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 CL({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,f=e*.125+i*.375+o*.375+r*.125,p=Math.abs(u-n),m=Math.abs(f-e);return[u,f,p,m]}var Hi;(function(n){n.Strict="strict",n.Loose="loose"})(Hi||(Hi={}));var $l;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})($l||($l={}));var Yd;(function(n){n.Partial="partial",n.Full="full"})(Yd||(Yd={}));var Ca;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Ca||(Ca={}));var Pl;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Pl||(Pl={}));var Le;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(Le||(Le={}));function F4({pos:n,x1:e,y1:t,x2:r,y2:s}){return n===Le.Left||n===Le.Right?[.5*(e+r),t]:[e,.5*(t+s)]}function RL({sourceX:n,sourceY:e,sourcePosition:t=Le.Bottom,targetX:r,targetY:s,targetPosition:i=Le.Top}){const[a,o]=F4({pos:t,x1:n,y1:e,x2:r,y2:s}),[u,f]=F4({pos:i,x1:r,y1:s,x2:n,y2:e}),[p,m,g,x]=CL({sourceX:n,sourceY:e,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:u,targetControlY:f});return[`M${n},${e} C${a},${o} ${u},${f} ${r},${s}`,p,m,g,x]}const gk=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,sourcePosition:s=Le.Bottom,targetPosition:i=Le.Top,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:y})=>{const[S,Q,k]=RL({sourceX:n,sourceY:e,sourcePosition:s,targetX:t,targetY:r,targetPosition:i});return ue.createElement(of,{path:S,labelX:Q,labelY:k,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:y})});gk.displayName="SimpleBezierEdge";const K4={[Le.Left]:{x:-1,y:0},[Le.Right]:{x:1,y:0},[Le.Top]:{x:0,y:-1},[Le.Bottom]:{x:0,y:1}},hse=({source:n,sourcePosition:e=Le.Bottom,target:t})=>e===Le.Left||e===Le.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},J4=(n,e)=>Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));function pse({source:n,sourcePosition:e=Le.Bottom,target:t,targetPosition:r=Le.Top,center:s,offset:i}){const a=K4[e],o=K4[r],u={x:n.x+a.x*i,y:n.y+a.y*i},f={x:t.x+o.x*i,y:t.y+o.y*i},p=hse({source:u,sourcePosition:e,target:f}),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]=NL({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:f.y}],q=[{x:u.x,y},{x:f.x,y}];a[m]===g?x=m==="x"?N:q:x=m==="x"?q:N}else{const N=[{x:u.x,y:f.y}],q=[{x:f.x,y:u.y}];if(m==="x"?x=a.x===g?q:N:x=a.y===g?N:q,e===r){const D=Math.abs(n[m]-t[m]);if(D<=i){const C=Math.min(i-1,i-D);a[m]===g?S[m]=(u[m]>n[m]?-1:1)*C:Q[m]=(f[m]>t[m]?-1:1)*C}}if(e!==r){const D=m==="x"?"y":"x",C=a[m]===o[D],G=u[D]>f[D],A=u[D]<f[D];(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:f.x+Q.x,y:f.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:f.x+Q.x,y:f.y+Q.y},t],v,y,j,T]}function mse(n,e,t,r){const s=Math.min(J4(n,e)/2,J4(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 f=n.x<t.x?-1:1,p=n.y<t.y?1:-1;return`L ${i+s*f},${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 M2({sourceX:n,sourceY:e,sourcePosition:t=Le.Bottom,targetX:r,targetY:s,targetPosition:i=Le.Top,borderRadius:a=5,centerX:o,centerY:u,offset:f=20}){const[p,m,g,x,v]=pse({source:{x:n,y:e},sourcePosition:t,target:{x:r,y:s},targetPosition:i,center:{x:o,y:u},offset:f});return[p.reduce((S,Q,k)=>{let $="";return k>0&&k<p.length-1?$=mse(p[k-1],Q,p[k+1],a):$=`${k===0?"M":"L"}${Q.x} ${Q.y}`,S+=$,S},""),m,g,x,v]}const oO=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:f,style:p,sourcePosition:m=Le.Bottom,targetPosition:g=Le.Top,markerEnd:x,markerStart:v,pathOptions:y,interactionWidth:S})=>{const[Q,k,$]=M2({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(of,{path:Q,labelX:k,labelY:$,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:x,markerStart:v,interactionWidth:S})});oO.displayName="SmoothStepEdge";const xk=P.memo(n=>{var e;return ue.createElement(oO,{...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])})});xk.displayName="StepEdge";function Ose({sourceX:n,sourceY:e,targetX:t,targetY:r}){const[s,i,a,o]=NL({sourceX:n,sourceY:e,targetX:t,targetY:r});return[`M ${n},${e}L ${t},${r}`,s,i,a,o]}const bk=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[v,y,S]=Ose({sourceX:n,sourceY:e,targetX:t,targetY:r});return ue.createElement(of,{path:v,labelX:y,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:m,markerStart:g,interactionWidth:x})});bk.displayName="StraightEdge";function op(n,e){return n>=0?.5*n:e*25*Math.sqrt(-n)}function eN({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}){switch(n){case Le.Left:return[e-op(e-r,i),t];case Le.Right:return[e+op(r-e,i),t];case Le.Top:return[e,t-op(t-s,i)];case Le.Bottom:return[e,t+op(s-t,i)]}}function EL({sourceX:n,sourceY:e,sourcePosition:t=Le.Bottom,targetX:r,targetY:s,targetPosition:i=Le.Top,curvature:a=.25}){const[o,u]=eN({pos:t,x1:n,y1:e,x2:r,y2:s,c:a}),[f,p]=eN({pos:i,x1:r,y1:s,x2:n,y2:e,c:a}),[m,g,x,v]=CL({sourceX:n,sourceY:e,targetX:r,targetY:s,sourceControlX:o,sourceControlY:u,targetControlX:f,targetControlY:p});return[`M${n},${e} C${o},${u} ${f},${p} ${r},${s}`,m,g,x,v]}const Qm=P.memo(({sourceX:n,sourceY:e,targetX:t,targetY:r,sourcePosition:s=Le.Bottom,targetPosition:i=Le.Top,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,pathOptions:y,interactionWidth:S})=>{const[Q,k,$]=EL({sourceX:n,sourceY:e,sourcePosition:s,targetX:t,targetY:r,targetPosition:i,curvature:y==null?void 0:y.curvature});return ue.createElement(of,{path:Q,labelX:k,labelY:$,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:v,interactionWidth:S})});Qm.displayName="BezierEdge";const yk=P.createContext(null),gse=yk.Provider;yk.Consumer;const xse=()=>P.useContext(yk),bse=n=>"id"in n&&"source"in n&&"target"in n,yse=({source:n,sourceHandle:e,target:t,targetHandle:r})=>`reactflow__edge-${n}${e||""}-${t}${r||""}`,X2=(n,e)=>typeof n>"u"?"":typeof n=="string"?n:`${e?`${e}__`:""}${Object.keys(n).sort().map(r=>`${r}=${n[r]}`).join("&")}`,vse=(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)),AL=(n,e)=>{if(!n.source||!n.target)return e;let t;return bse(n)?t={...n}:t={...n,id:yse(n)},vse(t,e)?e:e.concat(t)},z2=({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},qL=({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}},cO=(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 TL(r,Vd({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 jL(t)},ML=(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},f=[];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=A2(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)&&f.push(p)}),f},XL=(n,e)=>{const t=n.map(r=>r.id);return e.filter(r=>t.includes(r.source)||t.includes(r.target))},zL=(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),f=Qc(u,r,s),p=n.x+n.width/2,m=n.y+n.height/2,g=e/2-p*f,x=t/2-m*f;return{x:g,y:x,zoom:f}},Ol=(n,e=0)=>n.transition().duration(e);function tN(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 wse(n,e,t,r,s,i){const{x:a,y:o}=Ma(n),f=e.elementsFromPoint(a,o).find(v=>v.classList.contains("react-flow__handle"));if(f){const v=f.getAttribute("data-nodeid");if(v){const y=vk(void 0,f),S=f.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:LL()};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 Sse={source:null,target:null,sourceHandle:null,targetHandle:null},LL=()=>({handleDomNode:null,isValid:!1,connection:Sse,endHandle:null});function ZL(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}"]`),f={...LL(),handleDomNode:u};if(u){const p=vk(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};f.connection=y,x&&v&&(e===Hi.Strict?o&&p==="source"||!o&&p==="target":m!==t||g!==r)&&(f.endHandle={nodeId:m,handleId:g,type:p},f.isValid=i(y))}return f}function Qse({nodes:n,nodeId:e,handleId:t,handleType:r}){return n.reduce((s,i)=>{if(i[un]){const{handleBounds:a}=i[un];let o=[],u=[];a&&(o=tN(i,a,"source",`${e}-${t}-${r}`),u=tN(i,a,"target",`${e}-${t}-${r}`)),s.push(...o,...u)}return s},[])}function vk(n,e){return n||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function Ux(n){n==null||n.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function kse(n,e){let t=null;return e?t="valid":n&&!e&&(t="invalid"),t}function VL({event:n,handleId:e,nodeId:t,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:o,edgeUpdaterType:u,onReconnectEnd:f}){const p=$L(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}=Ma(n),N=p==null?void 0:p.elementFromPoint(T,R),q=vk(u,N),z=g==null?void 0:g.getBoundingClientRect();if(!z||!q)return;let L,E=Ma(n,z),V=!1,D=null,C=!1,G=null;const A=Qse({nodes:Q(),nodeId:t,handleId:e,handleType:q}),W=()=>{if(!x)return;const[ee,X]=kL(E,z);S({x:ee,y:X}),$=requestAnimationFrame(W)};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(ee){const{transform:X}=i();E=Ma(ee,z);const{handle:B,validHandleResult:K}=wse(ee,p,z2(E,X,!1,[1,1]),v,A,Z=>ZL(Z,m,t,e,s?"target":"source",o,p));if(j=B,V||(W(),V=!0),G=K.handleDomNode,D=K.connection,C=K.isValid,a({connectionPosition:j&&C?qL({x:j.x,y:j.y},X):E,connectionStatus:kse(!!j,C),connectionEndHandle:K.endHandle}),!j&&!C&&!G)return Ux(L);D.source!==D.target&&G&&(Ux(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 U(ee){var X,B;(j||G)&&D&&C&&(r==null||r(D)),(B=(X=i()).onConnectEnd)==null||B.call(X,ee),u&&(f==null||f(ee)),Ux(L),k(),cancelAnimationFrame($),V=!1,C=!1,D=null,G=null,p.removeEventListener("mousemove",H),p.removeEventListener("mouseup",U),p.removeEventListener("touchmove",H),p.removeEventListener("touchend",U)}p.addEventListener("mousemove",H),p.addEventListener("mouseup",U),p.addEventListener("touchmove",H),p.addEventListener("touchend",U)}const nN=()=>!0,$se=n=>({connectionStartHandle:n.connectionStartHandle,connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName}),Tse=(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}},YL=P.forwardRef(({type:n="source",position:e=Le.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:u,className:f,onMouseDown:p,onTouchStart:m,...g},x)=>{var z,L;const v=a||null,y=n==="target",S=En(),Q=xse(),{connectOnClick:k,noPanClassName:$}=Yt($se,Mn),{connecting:j,clickConnecting:T}=Yt(Tse(Q,v,n),Mn);Q||(L=(z=S.getState()).onError)==null||L.call(z,"010",Ii.error010());const R=E=>{const{defaultEdgeOptions:V,onConnect:D,hasDefaultEdges:C}=S.getState(),G={...V,...E};if(C){const{edges:A,setEdges:W}=S.getState();W(AL(G,A))}D==null||D(G),o==null||o(G)},N=E=>{if(!Q)return;const V=PL(E);s&&(V&&E.button===0||!V)&&VL({event:E,handleId:v,nodeId:Q,onConnect:R,isTarget:y,getState:S.getState,setState:S.setState,isValidConnection:t||S.getState().isValidConnection||nN}),V?p==null||p(E):m==null||m(E)},q=E=>{const{onClickConnectStart:V,onClickConnectEnd:D,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 W=$L(E.target),H=t||A||nN,{connection:U,isValid:ee}=ZL({nodeId:Q,id:v,type:n},G,C.nodeId,C.handleId||null,C.type,H,W);ee&&R(U),D==null||D(E),S.setState({connectionClickStartHandle:null})};return ue.createElement("div",{"data-handleid":v,"data-nodeid":Q,"data-handlepos":e,"data-id":`${Q}-${v}-${n}`,className:Un(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",$,f,{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)});YL.displayName="Handle";var kc=P.memo(YL);const DL=({data:n,isConnectable:e,targetPosition:t=Le.Top,sourcePosition:r=Le.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}));DL.displayName="DefaultNode";var L2=P.memo(DL);const BL=({data:n,isConnectable:e,sourcePosition:t=Le.Bottom})=>ue.createElement(ue.Fragment,null,n==null?void 0:n.label,ue.createElement(kc,{type:"source",position:t,isConnectable:e}));BL.displayName="InputNode";var UL=P.memo(BL);const WL=({data:n,isConnectable:e,targetPosition:t=Le.Top})=>ue.createElement(ue.Fragment,null,ue.createElement(kc,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label);WL.displayName="OutputNode";var GL=P.memo(WL);const wk=()=>null;wk.displayName="GroupNode";const jse=n=>({selectedNodes:n.getNodes().filter(e=>e.selected),selectedEdges:n.edges.filter(e=>e.selected).map(e=>({...e}))}),cp=n=>n.id;function _se(n,e){return Mn(n.selectedNodes.map(cp),e.selectedNodes.map(cp))&&Mn(n.selectedEdges.map(cp),e.selectedEdges.map(cp))}const IL=P.memo(({onSelectionChange:n})=>{const e=En(),{selectedNodes:t,selectedEdges:r}=Yt(jse,_se);return P.useEffect(()=>{const s={nodes:t,edges:r};n==null||n(s),e.getState().onSelectionChange.forEach(i=>i(s))},[t,r,n]),null});IL.displayName="SelectionListener";const Pse=n=>!!n.onSelectionChange;function Nse({onSelectionChange:n}){const e=Yt(Pse);return n||e?ue.createElement(IL,{onSelectionChange:n}):null}const Cse=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 Rse=({nodes:n,edges:e,defaultNodes:t,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:o,onClickConnectEnd:u,nodesDraggable:f,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:D,onEdgesDelete:C,onNodeDrag:G,onNodeDragStart:A,onNodeDragStop:W,onSelectionDrag:H,onSelectionDragStart:U,onSelectionDragStop:ee,noPanClassName:X,nodeOrigin:B,rfId:K,autoPanOnConnect:Z,autoPanOnNodeDrag:I,onError:J,connectionRadius:ne,isValidConnection:ce,nodeDragThreshold:xe})=>{const{setNodes:ke,setEdges:Me,setDefaultNodesAndEdges:se,setMinZoom:be,setMaxZoom:Oe,setTranslateExtent:ye,setNodeExtent:Fe,reset:Te}=Yt(Cse,Mn),we=En();return P.useEffect(()=>{const Ke=r==null?void 0:r.map(ct=>({...ct,...L}));return se(t,Ke),()=>{Te()}},[]),et("defaultEdgeOptions",L,we.setState),et("connectionMode",T,we.setState),et("onConnect",s,we.setState),et("onConnectStart",i,we.setState),et("onConnectEnd",a,we.setState),et("onClickConnectStart",o,we.setState),et("onClickConnectEnd",u,we.setState),et("nodesDraggable",f,we.setState),et("nodesConnectable",p,we.setState),et("nodesFocusable",m,we.setState),et("edgesFocusable",g,we.setState),et("edgesUpdatable",x,we.setState),et("elementsSelectable",j,we.setState),et("elevateNodesOnSelect",v,we.setState),et("snapToGrid",N,we.setState),et("snapGrid",R,we.setState),et("onNodesChange",k,we.setState),et("onEdgesChange",$,we.setState),et("connectOnClick",z,we.setState),et("fitViewOnInit",E,we.setState),et("fitViewOnInitOptions",V,we.setState),et("onNodesDelete",D,we.setState),et("onEdgesDelete",C,we.setState),et("onNodeDrag",G,we.setState),et("onNodeDragStart",A,we.setState),et("onNodeDragStop",W,we.setState),et("onSelectionDrag",H,we.setState),et("onSelectionDragStart",U,we.setState),et("onSelectionDragStop",ee,we.setState),et("noPanClassName",X,we.setState),et("nodeOrigin",B,we.setState),et("rfId",K,we.setState),et("autoPanOnConnect",Z,we.setState),et("autoPanOnNodeDrag",I,we.setState),et("onError",J,we.setState),et("connectionRadius",ne,we.setState),et("isValidConnection",ce,we.setState),et("nodeDragThreshold",xe,we.setState),zo(n,ke),zo(e,Me),zo(y,be),zo(S,Oe),zo(q,ye),zo(Q,Fe),null},rN={display:"none"},Ese={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},HL="react-flow__node-desc",FL="react-flow__edge-desc",Ase="react-flow__aria-live",qse=n=>n.ariaLiveMessage;function Mse({rfId:n}){const e=Yt(qse);return ue.createElement("div",{id:`${Ase}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:Ese},e)}function Xse({rfId:n,disableKeyboardA11y:e}){return ue.createElement(ue.Fragment,null,ue.createElement("div",{id:`${HL}-${n}`,style:rN},"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:`${FL}-${n}`,style:rN},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&ue.createElement(Mse,{rfId:n}))}var Dd=(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 f=(Array.isArray(n)?n:[n]).filter(m=>typeof m=="string").map(m=>m.split("+")),p=f.reduce((m,g)=>m.concat(...g),[]);return[f,p]}return[[],[]]},[n]);return P.useEffect(()=>{const u=typeof document<"u"?document:null,f=(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)&&q2(x))return!1;const y=iN(x.code,o);i.current.add(x[y]),sN(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&q2(x))return!1;const y=iN(x.code,o);sN(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 f==null||f.addEventListener("keydown",p),f==null||f.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{f==null||f.removeEventListener("keydown",p),f==null||f.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[n,r]),t};function sN(n,e,t){return n.filter(r=>t||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function iN(n,e){return e.includes(n)?"code":"key"}function KL(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 KL(i,e,{x:(t.x??0)+a.x,y:(t.y??0)+a.y,z:(((o=i[un])==null?void 0:o.z)??0)>(t.z??0)?((u=i[un])==null?void 0:u.z)??0:t.z??0},r)}function JL(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}=KL(r,n,{...r.position,z:((i=r[un])==null?void 0:i.z)??0},e);r.positionAbsolute={x:a,y:o},r[un].z=u,t!=null&&t[r.id]&&(r[un].isParent=!0)}})}function Wx(n,e,t,r){const s=new Map,i={},a=r?1e3:0;return n.forEach(o=>{var x;const u=(ns(o.zIndex)?o.zIndex:0)+(o.selected?a:0),f=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=(f==null?void 0:f.type)&&(f==null?void 0:f.type)!==o.type;Object.defineProperty(p,un,{enumerable:!1,value:{handleBounds:g||(x=f==null?void 0:f[un])==null?void 0:x.handleBounds,z:u}}),s.set(o.id,p)}),JL(s,t,i),s}function eZ(n,e={}){const{getNodes:t,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:o,d3Selection:u,fitViewOnInitDone:f,fitViewOnInit:p,nodeOrigin:m}=n(),g=e.initial&&!f&&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=cO(v,m),{x:Q,y:k,zoom:$}=zL(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),j=Bi.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 zse(n,e){return n.forEach(t=>{const r=e.get(t.id);r&&e.set(r.id,{...r,[un]:r[un],selected:t.selected})}),new Map(e)}function Lse(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:f}=t();n!=null&&n.length&&(u&&r({nodeInternals:zse(n,s)}),a==null||a(n)),e!=null&&e.length&&(f&&r({edges:Lse(e,i)}),o==null||o(e))}const Lo=()=>{},Zse={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},Vse=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection}),Yse=()=>{const n=En(),{d3Zoom:e,d3Selection:t}=Yt(Vse,Mn);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,f=Bi.translate(s.x??a,s.y??o).scale(s.zoom??u);e.transform(Ol(t,i==null?void 0:i.duration),f)},getViewport:()=>{const[s,i,a]=n.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>eZ(n.getState,s),setCenter:(s,i,a)=>{const{width:o,height:u,maxZoom:f}=n.getState(),p=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:f,m=o/2-s*p,g=u/2-i*p,x=Bi.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:f}=n.getState(),{x:p,y:m,zoom:g}=zL(s,a,o,u,f,(i==null?void 0:i.padding)??.1),x=Bi.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"),z2(s,i,a,o)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:o,domNode:u}=n.getState();if(!u)return s;const{x:f,y:p}=u.getBoundingClientRect(),m={x:s.x-f,y:s.y-p};return z2(m,i,a,o)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=n.getState();if(!a)return s;const{x:o,y:u}=a.getBoundingClientRect(),f=qL(s,i);return{x:f.x+o,y:f.y+u}},viewportInitialized:!0}:Zse,[e,t])};function Sk(){const n=Yse(),e=En(),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)}},[]),f=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 W=A.parentNode||A.parentId,H=!L.includes(A.id)&&W&&G.find(ee=>ee.id===W);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(L.includes(A.id)||H)&&G.push(A),G},[]),D=$.filter(G=>typeof G.deletable=="boolean"?G.deletable:!0),C=D.filter(G=>E.includes(G.id));if(V||C){const G=XL(V,D),A=[...C,...G],W=A.reduce((H,U)=>(H.includes(U.id)||H.push(U.id),H),[]);if((T||j)&&(T&&e.setState({edges:$.filter(H=>!W.includes(H.id))}),j&&(V.forEach(H=>{Q.delete(H.id)}),e.setState({nodeInternals:new Map(Q)}))),W.length>0&&(N==null||N(A),z&&z(W.map(H=>({id:H,type:"remove"})))),V.length>0&&(R==null||R(V),q)){const H=V.map(U=>({id:U.id,type:"remove"}));q(H)}}},[]),g=P.useCallback(y=>{const S=use(y),Q=S?null:e.getState().nodeInternals.get(y.id);return!S&&!Q?[null,null,S]:[S?y:H4(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=H4(T),N=A2(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 $=A2(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:f,toObject:p,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:v}),[n,t,r,s,i,a,o,u,f,p,m,x,v])}const Dse={actInsideInputWithModifier:!1};var Bse=({deleteKeyCode:n,multiSelectionKeyCode:e})=>{const t=En(),{deleteElements:r}=Sk(),s=Dd(n,Dse),i=Dd(e);P.useEffect(()=>{if(s){const{edges:a,getNodes:o}=t.getState(),u=o().filter(p=>p.selected),f=a.filter(p=>p.selected);r({nodes:u,edges:f}),t.setState({nodesSelectionActive:!1})}},[s]),P.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])};function Use(n){const e=En();P.useEffect(()=>{let t;const r=()=>{var i,a;if(!n.current)return;const s=mk(n.current);(s.height===0||s.width===0)&&((a=(i=e.getState()).onError)==null||a.call(i,"004",Ii.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 Qk={position:"absolute",width:"100%",height:"100%",top:0,left:0},Wse=(n,e)=>n.x!==e.x||n.y!==e.y||n.zoom!==e.k,dp=n=>({x:n.x,y:n.y,zoom:n.k}),Zo=(n,e)=>n.target.closest(`.${e}`),aN=(n,e)=>e===2&&Array.isArray(n)&&n.includes(2),lN=n=>{const e=n.ctrlKey&&Sm()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*e},Gse=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection,d3ZoomHandler:n.d3ZoomHandler,userSelectionActive:n.userSelectionActive}),Ise=({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:f=!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=En(),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:D,userSelectionActive:C}=Yt(Gse,Mn),G=Dd(S),A=P.useRef(0),W=P.useRef(!1),H=P.useRef();return Use(z),P.useEffect(()=>{if(z.current){const U=z.current.getBoundingClientRect(),ee=SL().scaleExtent([v,y]).translateExtent(x),X=Hr(z.current).call(ee),B=Bi.translate(g.x,g.y).scale(Qc(g.zoom,v,y)),K=[[0,0],[U.width,U.height]],Z=ee.constrain()(B,K,x);ee.transform(X,Z),ee.wheelDelta(lN),R.setState({d3Zoom:ee,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",U=>{if(Zo(U,$))return!1;U.preventDefault(),U.stopImmediatePropagation();const ee=V.property("__zoom").k||1;if(U.ctrlKey&&i){const ce=ks(U),xe=lN(U),ke=ee*Math.pow(2,xe);E.scaleTo(V,ke,ce,U);return}const X=U.deltaMode===1?20:1;let B=u===$l.Vertical?0:U.deltaX*X,K=u===$l.Horizontal?0:U.deltaY*X;!Sm()&&U.shiftKey&&u!==$l.Vertical&&(B=U.deltaY*X,K=0),E.translateBy(V,-(B/ee)*o,-(K/ee)*o,{internal:!0});const Z=dp(V.property("__zoom")),{onViewportChangeStart:I,onViewportChange:J,onViewportChangeEnd:ne}=R.getState();clearTimeout(H.current),W.current||(W.current=!0,e==null||e(U,Z),I==null||I(Z)),W.current&&(n==null||n(U,Z),J==null||J(Z),H.current=setTimeout(()=>{t==null||t(U,Z),ne==null||ne(Z),W.current=!1},150))},{passive:!1}):typeof D<"u"&&V.on("wheel.zoom",function(U,ee){if(!Q&&U.type==="wheel"&&!U.ctrlKey||Zo(U,$))return null;U.preventDefault(),D.call(this,U,ee)},{passive:!1}))},[C,a,u,V,E,D,G,i,Q,$,e,n,t]),P.useEffect(()=>{E&&E.on("start",U=>{var B,K;if(!U.sourceEvent||U.sourceEvent.internal)return null;A.current=(B=U.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:ee}=R.getState(),X=dp(U.transform);N.current=!0,L.current=X,((K=U.sourceEvent)==null?void 0:K.type)==="mousedown"&&R.setState({paneDragging:!0}),ee==null||ee(X),e==null||e(U.sourceEvent,X)})},[E,e]),P.useEffect(()=>{E&&(C&&!N.current?E.on("zoom",null):C||E.on("zoom",U=>{var X;const{onViewportChange:ee}=R.getState();if(R.setState({transform:[U.transform.x,U.transform.y,U.transform.k]}),q.current=!!(r&&aN(m,A.current??0)),(n||ee)&&!((X=U.sourceEvent)!=null&&X.internal)){const B=dp(U.transform);ee==null||ee(B),n==null||n(U.sourceEvent,B)}}))},[C,E,n,m,r]),P.useEffect(()=>{E&&E.on("end",U=>{if(!U.sourceEvent||U.sourceEvent.internal)return null;const{onViewportChangeEnd:ee}=R.getState();if(N.current=!1,R.setState({paneDragging:!1}),r&&aN(m,A.current??0)&&!q.current&&r(U.sourceEvent),q.current=!1,(t||ee)&&Wse(L.current,U.transform)){const X=dp(U.transform);L.current=X,clearTimeout(T.current),T.current=setTimeout(()=>{ee==null||ee(X),t==null||t(U.sourceEvent,X)},a?150:0)}})},[E,a,m,t,r]),P.useEffect(()=>{E&&E.filter(U=>{const ee=G||s,X=i&&U.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&U.button===1&&U.type==="mousedown"&&(Zo(U,"react-flow__node")||Zo(U,"react-flow__edge")))return!0;if(!m&&!ee&&!a&&!f&&!i||C||!f&&U.type==="dblclick"||Zo(U,$)&&U.type==="wheel"||Zo(U,j)&&(U.type!=="wheel"||a&&U.type==="wheel"&&!G)||!i&&U.ctrlKey&&U.type==="wheel"||!ee&&!a&&!X&&U.type==="wheel"||!m&&(U.type==="mousedown"||U.type==="touchstart")||Array.isArray(m)&&!m.includes(U.button)&&U.type==="mousedown")return!1;const B=Array.isArray(m)&&m.includes(U.button)||!U.button||U.button<=1;return(!U.ctrlKey||U.type==="wheel")&&B})},[C,E,s,i,a,f,m,p,G]),ue.createElement("div",{className:"react-flow__renderer",ref:z,style:Qk},k)},Hse=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function Fse(){const{userSelectionActive:n,userSelectionRect:e}=Yt(Hse,Mn);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 oN(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 tZ(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&&oN(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&&oN(r,a);break}case"remove":return r}return r.push(a),r},t)}function nZ(n,e){return tZ(n,e)}function Kse(n,e){return tZ(n,e)}const Pa=(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(Pa(r.id,!0))):r.selected&&!s&&(r.selected=!1,t.push(Pa(r.id,!1))),t},[])}const Gx=(n,e)=>t=>{t.target===e.current&&(n==null||n(t))},Jse=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}),rZ=P.memo(({isSelecting:n,selectionMode:e=Yd.Full,panOnDrag:t,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:o,onPaneMouseEnter:u,onPaneMouseMove:f,onPaneMouseLeave:p,children:m})=>{const g=P.useRef(null),x=En(),v=P.useRef(0),y=P.useRef(0),S=P.useRef(),{userSelectionActive:Q,elementsSelectable:k,dragging:$}=Yt(Jse,Mn),j=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,y.current=0},T=D=>{i==null||i(D),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},R=D=>{if(Array.isArray(t)&&(t!=null&&t.includes(2))){D.preventDefault();return}a==null||a(D)},N=o?D=>o(D):void 0,q=D=>{const{resetSelectedElements:C,domNode:G}=x.getState();if(S.current=G==null?void 0:G.getBoundingClientRect(),!k||!n||D.button!==0||D.target!==g.current||!S.current)return;const{x:A,y:W}=Ma(D,S.current);C(),x.setState({userSelectionRect:{width:0,height:0,startX:A,startY:W,x:A,y:W}}),r==null||r(D)},z=D=>{const{userSelectionRect:C,nodeInternals:G,edges:A,transform:W,onNodesChange:H,onEdgesChange:U,nodeOrigin:ee,getNodes:X}=x.getState();if(!n||!S.current||!C)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=Ma(D,S.current),K=C.startX??0,Z=C.startY??0,I={...C,x:B.x<K?B.x:K,y:B.y<Z?B.y:Z,width:Math.abs(B.x-K),height:Math.abs(B.y-Z)},J=X(),ne=ML(G,I,W,e===Yd.Partial,!0,ee),ce=XL(ne,A).map(ke=>ke.id),xe=ne.map(ke=>ke.id);if(v.current!==xe.length){v.current=xe.length;const ke=Ko(J,xe);ke.length&&(H==null||H(ke))}if(y.current!==ce.length){y.current=ce.length;const ke=Ko(A,ce);ke.length&&(U==null||U(ke))}x.setState({userSelectionRect:I})},L=D=>{if(D.button!==0)return;const{userSelectionRect:C}=x.getState();!Q&&C&&D.target===g.current&&(T==null||T(D)),x.setState({nodesSelectionActive:v.current>0}),j(),s==null||s(D)},E=D=>{Q&&(x.setState({nodesSelectionActive:v.current>0}),s==null||s(D)),j()},V=k&&(n||Q);return ue.createElement("div",{className:Un(["react-flow__pane",{dragging:$,selection:n}]),onClick:V?void 0:Gx(T,g),onContextMenu:Gx(R,g),onWheel:Gx(N,g),onMouseEnter:V?void 0:u,onMouseDown:V?q:void 0,onMouseMove:V?z:f,onMouseUp:V?L:void 0,onMouseLeave:V?E:p,ref:g,style:Qk},m,ue.createElement(Fse,null))});rZ.displayName="Pane";function sZ(n,e){const t=n.parentNode||n.parentId;if(!t)return!1;const r=e.get(t);return r?r.selected?!0:sZ(r,e):!1}function cN(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 eie(n,e,t,r){return Array.from(n.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!sZ(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 tie(n,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(n.width||0),e[1][1]-(n.height||0)]]}function iZ(n,e,t,r,s=[0,0],i){const a=tie(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&&ns(g)&&ns(x)&&ns(m.width)&&ns(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",Ii.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 f={x:0,y:0};if(u){const m=t.get(u);f=Nl(m,s).positionAbsolute}const p=o&&o!=="parent"?Ok(e,o):e;return{position:{x:p.x-f.x,y:p.y-f.y},positionAbsolute:p}}function Ix({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 uN=(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 f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),position:u.getAttribute("data-handlepos"),x:(f.left-a.left-o.x)/t,y:(f.top-a.top-o.y)/t,...mk(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(),f=o.get(n);if(!f){u==null||u("012",Ii.error012(n));return}e.setState({nodesSelectionActive:!1}),f.selected?(t||f.selected&&a)&&(i({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([n])}function nie(){const n=En();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 Hx(n){return(e,t,r)=>n==null?void 0:n(e,r)}function aZ({nodeRef:n,disabled:e=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const o=En(),[u,f]=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),$=nie();return P.useEffect(()=>{if(n!=null&&n.current){const j=Hr(n.current),T=({x:q,y:z})=>{const{nodeInternals:L,onNodeDrag:E,onSelectionDrag:V,updateNodePositions:D,nodeExtent:C,snapGrid:G,snapToGrid:A,nodeOrigin:W,onError:H}=o.getState();m.current={x:q,y:z};let U=!1,ee={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&C){const B=cO(p.current,W);ee=Vd(B)}if(p.current=p.current.map(B=>{const K={x:q-B.distance.x,y:z-B.distance.y};A&&(K.x=G[0]*Math.round(K.x/G[0]),K.y=G[1]*Math.round(K.y/G[1]));const Z=[[C[0][0],C[0][1]],[C[1][0],C[1][1]]];p.current.length>1&&C&&!B.extent&&(Z[0][0]=B.positionAbsolute.x-ee.x+C[0][0],Z[1][0]=B.positionAbsolute.x+(B.width??0)-ee.x2+C[1][0],Z[0][1]=B.positionAbsolute.y-ee.y+C[0][1],Z[1][1]=B.positionAbsolute.y+(B.height??0)-ee.y2+C[1][1]);const I=iZ(B,K,L,Z,W,H);return U=U||B.position.x!==I.position.x||B.position.y!==I.position.y,B.position=I.position,B.positionAbsolute=I.positionAbsolute,B}),!U)return;D(p.current,!0,!0),f(!0);const X=s?E:Hx(V);if(X&&y.current){const[B,K]=Ix({nodeId:s,dragItems:p.current,nodeInternals:L});X(y.current,B,K)}},R=()=>{if(!x.current)return;const[q,z]=kL(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 W;const{nodeInternals:z,multiSelectionActive:L,nodesDraggable:E,unselectNodesAndEdges:V,onNodeDragStart:D,onSelectionDragStart:C}=o.getState();Q.current=!0;const G=s?D:Hx(C);(!a||!i)&&!L&&s&&((W=z.get(s))!=null&&W.selected||V()),s&&i&&a&&Z2({id:s,store:o,nodeRef:n});const A=$(q);if(m.current=A,p.current=eie(z,E,A,s),G&&p.current){const[H,U]=Ix({nodeId:s,dragItems:p.current,nodeInternals:z});G(q.sourceEvent,H,U)}};if(e)j.on(".drag",null);else{const q=pne().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=Ma(z.sourceEvent,x.current)}).on("drag",z=>{var D,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-(((D=m==null?void 0:m.current)==null?void 0:D.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=Ma(z.sourceEvent,x.current),T(L))}}).on("end",z=>{if(!(!Q.current||k.current)&&(f(!1),S.current=!1,Q.current=!1,cancelAnimationFrame(g.current),p.current)){const{updateNodePositions:L,nodeInternals:E,onNodeDragStop:V,onSelectionDragStop:D}=o.getState(),C=s?V:Hx(D);if(L(p.current,!1,!1),C){const[G,A]=Ix({nodeId:s,dragItems:p.current,nodeInternals:E});C(z.sourceEvent,G,A)}}}).filter(z=>{const L=z.target;return!z.button&&(!t||!cN(L,`.${t}`,n))&&(!r||cN(L,r,n))});return j.call(q),()=>{j.on(".drag",null)}}}},[n,e,t,r,i,o,s,a,$]),u}function lZ(){const n=En();return P.useCallback(t=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:o,snapGrid:u,onError:f,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}=iZ(k,$,r,s,void 0,f);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:f,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:D,noDragClassName:C,noPanClassName:G,initialized:A,disableKeyboardA11y:W,ariaLabel:H,rfId:U,hasHandleBounds:ee})=>{const X=En(),B=P.useRef(null),K=P.useRef(null),Z=P.useRef(N),I=P.useRef(q),J=P.useRef(r),ne=$||k||p||m||g||x,ce=lZ(),xe=Wu(t,X.getState,m),ke=Wu(t,X.getState,g),Me=Wu(t,X.getState,x),se=Wu(t,X.getState,v),be=Wu(t,X.getState,y),Oe=Te=>{const{nodeDragThreshold:we}=X.getState();if($&&(!R||!k||we>0)&&Z2({id:t,store:X,nodeRef:B}),p){const Ke=X.getState().nodeInternals.get(t);Ke&&p(Te,{...Ke})}},ye=Te=>{if(!q2(Te)&&!W)if(_L.includes(Te.key)&&$){const we=Te.key==="Escape";Z2({id:t,store:X,unselect:we,nodeRef:B})}else k&&f&&Object.prototype.hasOwnProperty.call(uc,Te.key)&&(X.setState({ariaLiveMessage:`Moved selected node ${Te.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),ce({x:uc[Te.key].x,y:uc[Te.key].y,isShiftPressed:Te.shiftKey}))};P.useEffect(()=>()=>{K.current&&(L==null||L.unobserve(K.current),K.current=null)},[]),P.useEffect(()=>{if(B.current&&!z){const Te=B.current;(!A||!ee||K.current!==Te)&&(K.current&&(L==null||L.unobserve(K.current)),L==null||L.observe(Te),K.current=Te)}},[z,A,ee]),P.useEffect(()=>{const Te=J.current!==r,we=Z.current!==N,Ke=I.current!==q;B.current&&(Te||we||Ke)&&(Te&&(J.current=r),we&&(Z.current=N),Ke&&(I.current=q),X.getState().updateNodeDimensions([{id:t,nodeElement:B.current,forceUpdate:!0}]))},[t,r,N,q]);const Fe=aZ({nodeRef:B,disabled:z||!k,noDragClassName:C,handleSelector:E,nodeId:t,isSelectable:$,selectNodesOnDrag:R});return z?null:ue.createElement("div",{className:Un(["react-flow__node",`react-flow__node-${r}`,{[G]:k},Q,{selected:f,selectable:$,parent:D,dragging:Fe}]),ref:B,style:{zIndex:V,transform:`translate(${o}px,${u}px)`,pointerEvents:ne?"all":"none",visibility:A?"visible":"hidden",...S},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:xe,onMouseMove:ke,onMouseLeave:Me,onContextMenu:se,onClick:Oe,onDoubleClick:be,onKeyDown:T?ye:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":W?void 0:`${HL}-${U}`,"aria-label":H},ue.createElement(gse,{value:t},ue.createElement(n,{id:t,data:s,type:r,xPos:i,yPos:a,selected:f,isConnectable:j,sourcePosition:N,targetPosition:q,dragging:Fe,dragHandle:E,zIndex:V})))};return e.displayName="NodeWrapper",P.memo(e)};const rie=n=>{const e=n.getNodes().filter(t=>t.selected);return{...cO(e,n.nodeOrigin),transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`,userSelectionActive:n.userSelectionActive}};function sie({onSelectionContextMenu:n,noPanClassName:e,disableKeyboardA11y:t}){const r=En(),{width:s,height:i,x:a,y:o,transformString:u,userSelectionActive:f}=Yt(rie,Mn),p=lZ(),m=P.useRef(null);if(P.useEffect(()=>{var v;t||(v=m.current)==null||v.focus({preventScroll:!0})},[t]),aZ({nodeRef:m}),f||!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:Un(["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 iie=P.memo(sie);const aie=n=>n.nodesSelectionActive,oZ=({children:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:o,onMove:u,onMoveStart:f,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:D,maxZoom:C,preventScrolling:G,onSelectionContextMenu:A,noWheelClassName:W,noPanClassName:H,disableKeyboardA11y:U})=>{const ee=Yt(aie),X=Dd(m),B=Dd(Q),K=B||L,Z=B||R,I=X||g&&K!==!0;return Bse({deleteKeyCode:o,multiSelectionKeyCode:S}),ue.createElement(Ise,{onMove:u,onMoveStart:f,onMoveEnd:p,onPaneContextMenu:i,elementsSelectable:$,zoomOnScroll:j,zoomOnPinch:T,panOnScroll:Z,panOnScrollSpeed:N,panOnScrollMode:q,zoomOnDoubleClick:z,panOnDrag:!X&&K,defaultViewport:E,translateExtent:V,minZoom:D,maxZoom:C,zoomActivationKeyCode:k,preventScrolling:G,noWheelClassName:W,noPanClassName:H},ue.createElement(rZ,{onSelectionStart:v,onSelectionEnd:y,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:K,isSelecting:!!I,selectionMode:x},n,ee&&ue.createElement(iie,{onSelectionContextMenu:A,noPanClassName:H,disableKeyboardA11y:U})))};oZ.displayName="FlowRenderer";var lie=P.memo(oZ);function oie(n){return Yt(P.useCallback(t=>n?ML(t.nodeInternals,{x:0,y:0,width:t.width,height:t.height},t.transform,!0):t.getNodes(),[n]))}function cie(n){const e={input:Gu(n.input||UL),default:Gu(n.default||L2),output:Gu(n.output||GL),group:Gu(n.group||wk)},t={},r=Object.keys(n).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=Gu(n[i]||L2),s),t);return{...e,...r}}const uie=({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]},die=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,updateNodeDimensions:n.updateNodeDimensions,onError:n.onError}),cZ=n=>{const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=Yt(die,Mn),o=oie(n.onlyRenderVisibleElements),u=P.useRef(),f=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:Qk},o.map(p=>{var T,R,N;let m=p.type||"default";n.nodeTypes[m]||(a==null||a("003",Ii.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?Ok(p.positionAbsolute,n.nodeExtent):p.positionAbsolute,k=(Q==null?void 0:Q.x)??0,$=(Q==null?void 0:Q.y)??0,j=uie({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||Le.Bottom,targetPosition:p.targetPosition||Le.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:f,dragHandle:p.dragHandle,zIndex:((T=p[un])==null?void 0:T.z)??0,isParent:!!((R=p[un])!=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[un])!=null&&N.handleBounds)})}))};cZ.displayName="NodeRenderer";var fie=P.memo(cZ);const hie=(n,e,t)=>t===Le.Left?n-e:t===Le.Right?n+e:n,pie=(n,e,t)=>t===Le.Top?n-e:t===Le.Bottom?n+e:n,dN="react-flow__edgeupdater",fN=({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:Un([dN,`${dN}-${o}`]),cx:hie(e,r,n),cy:pie(t,r,n),r,stroke:"transparent",fill:"transparent"}),mie=()=>!0;var Vo=n=>{const e=({id:t,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:o,selected:u,animated:f,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:D,onMouseEnter:C,onMouseMove:G,onMouseLeave:A,reconnectRadius:W,onReconnect:H,onReconnectStart:U,onReconnectEnd:ee,markerEnd:X,markerStart:B,rfId:K,ariaLabel:Z,isFocusable:I,isReconnectable:J,pathOptions:ne,interactionWidth:ce,disableKeyboardA11y:xe})=>{const ke=P.useRef(null),[Me,se]=P.useState(!1),[be,Oe]=P.useState(!1),ye=En(),Fe=P.useMemo(()=>`url('#${X2(B,K)}')`,[B,K]),Te=P.useMemo(()=>`url('#${X2(X,K)}')`,[X,K]);if(L)return null;const we=pt=>{var sn;const{edges:Dt,addSelectedEdges:ut,unselectNodesAndEdges:lt,multiSelectionActive:Pt}=ye.getState(),vt=Dt.find(vr=>vr.id===t);vt&&(z&&(ye.setState({nodesSelectionActive:!1}),vt.selected&&Pt?(lt({nodes:[],edges:[vt]}),(sn=ke.current)==null||sn.blur()):ut([t])),a&&a(pt,vt))},Ke=Uu(t,ye.getState,o),ct=Uu(t,ye.getState,D),at=Uu(t,ye.getState,C),yt=Uu(t,ye.getState,G),Ye=Uu(t,ye.getState,A),tt=(pt,Dt)=>{if(pt.button!==0)return;const{edges:ut,isValidConnection:lt}=ye.getState(),Pt=Dt?k:Q,vt=(Dt?V:E)||null,sn=Dt?"target":"source",vr=lt||mie,ge=Dt,Qe=ut.find(Tt=>Tt.id===t);Oe(!0),U==null||U(pt,Qe,sn);const Re=Tt=>{Oe(!1),ee==null||ee(Tt,Qe,sn)};VL({event:pt,handleId:vt,nodeId:Pt,onConnect:Tt=>H==null?void 0:H(Qe,Tt),isTarget:ge,getState:ye.getState,setState:ye.setState,isValidConnection:vr,edgeUpdaterType:sn,onReconnectEnd:Re})},gn=pt=>tt(pt,!0),kt=pt=>tt(pt,!1),Zt=()=>se(!0),$t=()=>se(!1),rn=!z&&!a,dn=pt=>{var Dt;if(!xe&&_L.includes(pt.key)&&z){const{unselectNodesAndEdges:ut,addSelectedEdges:lt,edges:Pt}=ye.getState();pt.key==="Escape"?((Dt=ke.current)==null||Dt.blur(),ut({edges:[Pt.find(sn=>sn.id===t)]})):lt([t])}};return ue.createElement("g",{className:Un(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:u,animated:f,inactive:rn,updating:Me}]),onClick:we,onDoubleClick:Ke,onContextMenu:ct,onMouseEnter:at,onMouseMove:yt,onMouseLeave:Ye,onKeyDown:I?dn: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?`${FL}-${K}`:void 0,ref:ke},!be&&ue.createElement(n,{id:t,source:Q,target:k,selected:u,animated:f,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:ne,interactionWidth:ce}),J&&ue.createElement(ue.Fragment,null,(J==="source"||J===!0)&&ue.createElement(fN,{position:N,centerX:$,centerY:j,radius:W,onMouseDown:gn,onMouseEnter:Zt,onMouseOut:$t,type:"source"}),(J==="target"||J===!0)&&ue.createElement(fN,{position:q,centerX:T,centerY:R,radius:W,onMouseDown:kt,onMouseEnter:Zt,onMouseOut:$t,type:"target"})))};return e.displayName="EdgeWrapper",P.memo(e)};function Oie(n){const e={default:Vo(n.default||Qm),straight:Vo(n.bezier||bk),step:Vo(n.step||xk),smoothstep:Vo(n.step||oO),simplebezier:Vo(n.simplebezier||gk)},t={},r=Object.keys(n).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=Vo(n[i]||Qm),s),t);return{...e,...r}}function hN(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 Le.Top:return{x:r+i/2,y:s};case Le.Right:return{x:r+i,y:s+a/2};case Le.Bottom:return{x:r+i/2,y:s+a};case Le.Left:return{x:r,y:s+a/2}}}function pN(n,e){return n?n.length===1||!e?n[0]:e&&n.find(t=>t.id===e)||null:null}const gie=(n,e,t,r,s,i)=>{const a=hN(t,n,e),o=hN(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:o.x,targetY:o.y}};function xie({sourcePos:n,targetPos:e,sourceWidth:t,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:o,transform:u}){const f={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)};f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const p=Vd({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,f.x2)-Math.max(p.x,f.x)),g=Math.max(0,Math.min(p.y2,f.y2)-Math.max(p.y,f.y));return Math.ceil(m*g)>0}function mN(n){var r,s,i,a,o;const e=((r=n==null?void 0:n[un])==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 bie=[{level:0,isMaxLevel:!0,edges:[]}];function yie(n,e,t=!1){let r=-1;const s=n.reduce((a,o)=>{var p,m;const u=ns(o.zIndex);let f=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[un])==null?void 0:p.z)||0,((m=g==null?void 0:g[un])==null?void 0:m.z)||0,1e3);f=(u?o.zIndex:0)+(v?y:0)}return a[f]?a[f].push(o):a[f]=[o],r=f>r?f:r,a},{}),i=Object.entries(s).map(([a,o])=>{const u=+a;return{edges:o,level:u,isMaxLevel:u===r}});return i.length===0?bie:i}function vie(n,e,t){const r=Yt(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)&&xie({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 yie(r,e,t)}const wie=({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"}),Sie=({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"}),ON={[Pl.Arrow]:wie,[Pl.ArrowClosed]:Sie};function Qie(n){const e=En();return P.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(ON,n)?ON[n]:((i=(s=e.getState()).onError)==null||i.call(s,"009",Ii.error009(n)),null)},[n])}const kie=({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=Qie(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},$ie=({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=X2(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))},uZ=({defaultColor:n,rfId:e})=>{const t=Yt(P.useCallback($ie({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(kie,{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})))};uZ.displayName="MarkerDefinitions";var Tie=P.memo(uZ);const jie=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}),dZ=({defaultMarkerColor:n,onlyRenderVisibleElements:e,elevateEdgesOnSelect:t,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:u,onEdgeMouseLeave:f,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}=Yt(jie,Mn),L=vie(e,q,t);return T?ue.createElement(ue.Fragment,null,L.map(({level:E,edges:V,isMaxLevel:D})=>ue.createElement("svg",{key:E,style:{zIndex:E},width:T,height:R,className:"react-flow__edges react-flow__container"},D&&ue.createElement(Tie,{defaultColor:n,rfId:r}),ue.createElement("g",null,V.map(C=>{const[G,A,W]=mN(q.get(C.source)),[H,U,ee]=mN(q.get(C.target));if(!W||!ee)return null;let X=C.type||"default";s[X]||(z==null||z("011",Ii.error011(X)),X="default");const B=s[X]||s.default,K=N===Hi.Strict?U.target:(U.target??[]).concat(U.source??[]),Z=pN(A.source,C.sourceHandle),I=pN(K,C.targetHandle),J=(Z==null?void 0:Z.position)||Le.Bottom,ne=(I==null?void 0:I.position)||Le.Top,ce=!!(C.focusable||k&&typeof C.focusable>"u"),xe=C.reconnectable||C.updatable,ke=typeof g<"u"&&(xe||$&&typeof xe>"u");if(!Z||!I)return z==null||z("008",Ii.error008(Z,C)),null;const{sourceX:Me,sourceY:se,targetX:be,targetY:Oe}=gie(G,Z,J,H,I,ne);return ue.createElement(B,{key:C.id,id:C.id,className:Un([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:Me,sourceY:se,targetX:be,targetY:Oe,sourcePosition:J,targetPosition:ne,elementsSelectable:j,onContextMenu:a,onMouseEnter:o,onMouseMove:u,onMouseLeave:f,onClick:p,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,reconnectRadius:y,rfId:r,ariaLabel:C.ariaLabel,isFocusable:ce,isReconnectable:ke,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth,disableKeyboardA11y:Q})})))),S):null};dZ.displayName="EdgeRenderer";var _ie=P.memo(dZ);const Pie=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function Nie({children:n}){const e=Yt(Pie);return ue.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},n)}function Cie(n){const e=Sk(),t=P.useRef(!1);P.useEffect(()=>{!t.current&&e.viewportInitialized&&n&&(setTimeout(()=>n(e),1),t.current=!0)},[n,e.viewportInitialized])}const Rie={[Le.Left]:Le.Right,[Le.Right]:Le.Left,[Le.Top]:Le.Bottom,[Le.Bottom]:Le.Top},fZ=({nodeId:n,handleType:e,style:t,type:r=Ca.Bezier,CustomComponent:s,connectionStatus:i})=>{var R,N,q;const{fromNode:a,handleId:o,toX:u,toY:f,connectionMode:p}=Yt(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]),Mn),m=(R=a==null?void 0:a[un])==null?void 0:R.handleBounds;let g=m==null?void 0:m[e];if(p===Hi.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?Rie[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:f,fromPosition:k,toPosition:$,connectionStatus:i});let j="";const T={sourceX:S,sourceY:Q,sourcePosition:k,targetX:u,targetY:f,targetPosition:$};return r===Ca.Bezier?[j]=EL(T):r===Ca.Step?[j]=M2({...T,borderRadius:0}):r===Ca.SmoothStep?[j]=M2(T):r===Ca.SimpleBezier?[j]=RL(T):j=`M${S},${Q} ${u},${f}`,ue.createElement("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};fZ.displayName="ConnectionLine";const Eie=n=>({nodeId:n.connectionNodeId,handleType:n.connectionHandleType,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height});function Aie({containerStyle:n,style:e,type:t,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:o,height:u,connectionStatus:f}=Yt(Eie,Mn);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:Un(["react-flow__connection",f])},ue.createElement(fZ,{nodeId:s,handleType:i,style:e,type:t,CustomComponent:r,connectionStatus:f})))}function gN(n,e){return P.useRef(null),En(),P.useMemo(()=>e(n),[n])}const hZ=({nodeTypes:n,edgeTypes:e,onMove:t,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:u,onEdgeDoubleClick:f,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:D,selectNodesOnDrag:C,defaultViewport:G,translateExtent:A,minZoom:W,maxZoom:H,preventScrolling:U,defaultMarkerColor:ee,zoomOnScroll:X,zoomOnPinch:B,panOnScroll:K,panOnScrollSpeed:Z,panOnScrollMode:I,zoomOnDoubleClick:J,panOnDrag:ne,onPaneClick:ce,onPaneMouseEnter:xe,onPaneMouseMove:ke,onPaneMouseLeave:Me,onPaneScroll:se,onPaneContextMenu:be,onEdgeContextMenu:Oe,onEdgeMouseEnter:ye,onEdgeMouseMove:Fe,onEdgeMouseLeave:Te,onReconnect:we,onReconnectStart:Ke,onReconnectEnd:ct,reconnectRadius:at,noDragClassName:yt,noWheelClassName:Ye,noPanClassName:tt,elevateEdgesOnSelect:gn,disableKeyboardA11y:kt,nodeOrigin:Zt,nodeExtent:$t,rfId:rn})=>{const dn=gN(n,cie),pt=gN(e,Oie);return Cie(i),ue.createElement(lie,{onPaneClick:ce,onPaneMouseEnter:xe,onPaneMouseMove:ke,onPaneMouseLeave:Me,onPaneContextMenu:be,onPaneScroll:se,deleteKeyCode:E,selectionKeyCode:T,selectionOnDrag:R,selectionMode:N,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:q,panActivationKeyCode:z,zoomActivationKeyCode:L,elementsSelectable:D,onMove:t,onMoveStart:r,onMoveEnd:s,zoomOnScroll:X,zoomOnPinch:B,zoomOnDoubleClick:J,panOnScroll:K,panOnScrollSpeed:Z,panOnScrollMode:I,panOnDrag:ne,defaultViewport:G,translateExtent:A,minZoom:W,maxZoom:H,onSelectionContextMenu:v,preventScrolling:U,noDragClassName:yt,noWheelClassName:Ye,noPanClassName:tt,disableKeyboardA11y:kt},ue.createElement(Nie,null,ue.createElement(_ie,{edgeTypes:pt,onEdgeClick:o,onEdgeDoubleClick:f,onlyRenderVisibleElements:V,onEdgeContextMenu:Oe,onEdgeMouseEnter:ye,onEdgeMouseMove:Fe,onEdgeMouseLeave:Te,onReconnect:we,onReconnectStart:Ke,onReconnectEnd:ct,reconnectRadius:at,defaultMarkerColor:ee,noPanClassName:tt,elevateEdgesOnSelect:!!gn,disableKeyboardA11y:kt,rfId:rn},ue.createElement(Aie,{style:k,type:Q,component:$,containerStyle:j})),ue.createElement("div",{className:"react-flow__edgelabel-renderer"}),ue.createElement(fie,{nodeTypes:dn,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:C,onlyRenderVisibleElements:V,noPanClassName:tt,noDragClassName:yt,disableKeyboardA11y:kt,nodeOrigin:Zt,nodeExtent:$t,rfId:rn})))};hZ.displayName="GraphView";var qie=P.memo(hZ);const V2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ka={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:V2,nodeExtent:V2,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Hi.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:dse,isValidConnection:void 0},Mie=()=>$ee((n,e)=>({...ka,setNodes:t=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();n({nodeInternals:Wx(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?Wx(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:f}=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,[un]:{...Q[un],handleBounds:void 0}});else if(Q){const k=mk(S.nodeElement);!!(k.width&&k.height&&(Q.width!==k.width||Q.height!==k.height||S.forceUpdate))&&(s.set(Q.id,{...Q,[un]:{...Q[un],handleBounds:{source:uN(".source",S.nodeElement,g,f),target:uN(".target",S.nodeElement,g,f)}},...k}),y.push({id:Q.id,type:"dimensions",dimensions:k}))}return y},[]);JL(s,f);const v=a||i&&!a&&eZ(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 f=nZ(t,o()),p=Wx(f,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=>Pa(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=>Pa(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,Pa(p.id,!1))),f=o.map(p=>Pa(p.id,!1));up({changedNodes:u,changedEdges:f,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=>Pa(o.id,!1)),a=t.filter(o=>o.selected).map(o=>Pa(o.id,!1));up({changedNodes:i,changedEdges:a,get:e,set:n})},setNodeExtent:t=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=Ok(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 f=Bi.translate(r[0]+t.x,r[1]+t.y).scale(r[2]),p=[[0,0],[s,i]],m=a==null?void 0:a.constrain()(f,p,u);return a.transform(o,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>n({connectionNodeId:ka.connectionNodeId,connectionHandleId:ka.connectionHandleId,connectionHandleType:ka.connectionHandleType,connectionStatus:ka.connectionStatus,connectionStartHandle:ka.connectionStartHandle,connectionEndHandle:ka.connectionEndHandle}),reset:()=>n({...ka})}),Object.is),pZ=({children:n})=>{const e=P.useRef(null);return e.current||(e.current=Mie()),ue.createElement(sse,{value:e.current},n)};pZ.displayName="ReactFlowProvider";const mZ=({children:n})=>P.useContext(aO)?ue.createElement(ue.Fragment,null,n):ue.createElement(pZ,null,n);mZ.displayName="ReactFlowWrapper";const Xie={input:UL,default:L2,output:GL,group:wk},zie={default:Qm,straight:bk,step:xk,smoothstep:oO,simplebezier:gk},Lie=[0,0],Zie=[15,15],Vie={x:0,y:0,zoom:1},Yie={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},OZ=P.forwardRef(({nodes:n,edges:e,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i=Xie,edgeTypes:a=zie,onNodeClick:o,onEdgeClick:u,onInit:f,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:D,onSelectionDrag:C,onSelectionDragStop:G,onSelectionContextMenu:A,onSelectionStart:W,onSelectionEnd:H,connectionMode:U=Hi.Strict,connectionLineType:ee=Ca.Bezier,connectionLineStyle:X,connectionLineComponent:B,connectionLineContainerStyle:K,deleteKeyCode:Z="Backspace",selectionKeyCode:I="Shift",selectionOnDrag:J=!1,selectionMode:ne=Yd.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:xe=Sm()?"Meta":"Control",zoomActivationKeyCode:ke=Sm()?"Meta":"Control",snapToGrid:Me=!1,snapGrid:se=Zie,onlyRenderVisibleElements:be=!1,selectNodesOnDrag:Oe=!0,nodesDraggable:ye,nodesConnectable:Fe,nodesFocusable:Te,nodeOrigin:we=Lie,edgesFocusable:Ke,edgesUpdatable:ct,elementsSelectable:at,defaultViewport:yt=Vie,minZoom:Ye=.5,maxZoom:tt=2,translateExtent:gn=V2,preventScrolling:kt=!0,nodeExtent:Zt,defaultMarkerColor:$t="#b1b1b7",zoomOnScroll:rn=!0,zoomOnPinch:dn=!0,panOnScroll:pt=!1,panOnScrollSpeed:Dt=.5,panOnScrollMode:ut=$l.Free,zoomOnDoubleClick:lt=!0,panOnDrag:Pt=!0,onPaneClick:vt,onPaneMouseEnter:sn,onPaneMouseMove:vr,onPaneMouseLeave:ge,onPaneScroll:Qe,onPaneContextMenu:Re,children:Je,onEdgeContextMenu:Tt,onEdgeDoubleClick:Ft,onEdgeMouseEnter:_n,onEdgeMouseMove:xn,onEdgeMouseLeave:bn,onEdgeUpdate:yn,onEdgeUpdateStart:fn,onEdgeUpdateEnd:ci,onReconnect:fs,onReconnectStart:wr,onReconnectEnd:hs,reconnectRadius:zs=10,edgeUpdaterRadius:Sr=10,onNodesChange:ps,onEdgesChange:ms,noDragClassName:pe="nodrag",noWheelClassName:$e="nowheel",noPanClassName:ze="nopan",fitView:Mt=!1,fitViewOptions:vn,connectOnClick:sr=!0,attributionPosition:Fl,proOptions:ui,defaultEdgeOptions:di,elevateNodesOnSelect:Ha=!0,elevateEdgesOnSelect:Os=!1,disableKeyboardA11y:gs=!1,autoPanOnConnect:Ls=!0,autoPanOnNodeDrag:Zs=!0,connectionRadius:an=20,isValidConnection:Kl,onError:Jl,style:xs,id:bs,nodeDragThreshold:Lc,...eo},to)=>{const ea=bs||"1";return ue.createElement("div",{...eo,style:{...xs,...Yie},ref:to,className:Un(["react-flow",s]),"data-testid":"rf__wrapper",id:bs},ue.createElement(mZ,null,ue.createElement(qie,{onInit:f,onMove:p,onMoveStart:m,onMoveEnd:g,onNodeClick:o,onEdgeClick:u,onNodeMouseEnter:k,onNodeMouseMove:$,onNodeMouseLeave:j,onNodeContextMenu:T,onNodeDoubleClick:R,nodeTypes:i,edgeTypes:a,connectionLineType:ee,connectionLineStyle:X,connectionLineComponent:B,connectionLineContainerStyle:K,selectionKeyCode:I,selectionOnDrag:J,selectionMode:ne,deleteKeyCode:Z,multiSelectionKeyCode:xe,panActivationKeyCode:ce,zoomActivationKeyCode:ke,onlyRenderVisibleElements:be,selectNodesOnDrag:Oe,defaultViewport:yt,translateExtent:gn,minZoom:Ye,maxZoom:tt,preventScrolling:kt,zoomOnScroll:rn,zoomOnPinch:dn,zoomOnDoubleClick:lt,panOnScroll:pt,panOnScrollSpeed:Dt,panOnScrollMode:ut,panOnDrag:Pt,onPaneClick:vt,onPaneMouseEnter:sn,onPaneMouseMove:vr,onPaneMouseLeave:ge,onPaneScroll:Qe,onPaneContextMenu:Re,onSelectionContextMenu:A,onSelectionStart:W,onSelectionEnd:H,onEdgeContextMenu:Tt,onEdgeDoubleClick:Ft,onEdgeMouseEnter:_n,onEdgeMouseMove:xn,onEdgeMouseLeave:bn,onReconnect:fs??yn,onReconnectStart:wr??fn,onReconnectEnd:hs??ci,reconnectRadius:zs??Sr,defaultMarkerColor:$t,noDragClassName:pe,noWheelClassName:$e,noPanClassName:ze,elevateEdgesOnSelect:Os,rfId:ea,disableKeyboardA11y:gs,nodeOrigin:we,nodeExtent:Zt}),ue.createElement(Rse,{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:ct,elementsSelectable:at,elevateNodesOnSelect:Ha,minZoom:Ye,maxZoom:tt,nodeExtent:Zt,onNodesChange:ps,onEdgesChange:ms,snapToGrid:Me,snapGrid:se,connectionMode:U,translateExtent:gn,connectOnClick:sr,defaultEdgeOptions:di,fitView:Mt,fitViewOptions:vn,onNodesDelete:L,onEdgesDelete:E,onNodeDragStart:N,onNodeDrag:q,onNodeDragStop:z,onSelectionDrag:C,onSelectionDragStart:D,onSelectionDragStop:G,noPanClassName:ze,nodeOrigin:we,rfId:ea,autoPanOnConnect:Ls,autoPanOnNodeDrag:Zs,onError:Jl,connectionRadius:an,isValidConnection:Kl,nodeDragThreshold:Lc}),ue.createElement(Nse,{onSelectionChange:V}),Je,ue.createElement(ase,{proOptions:ui,position:Fl}),ue.createElement(Xse,{rfId:ea,disableKeyboardA11y:gs})))});OZ.displayName="ReactFlow";function gZ(n){return e=>{const[t,r]=P.useState(e),s=P.useCallback(i=>r(a=>n(i,a)),[]);return[t,r,s]}}const Die=gZ(nZ),Bie=gZ(Kse),xZ=({id:n,x:e,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:u,className:f,borderRadius:p,shapeRendering:m,onClick:g,selected:x})=>{const{background:v,backgroundColor:y}=i||{},S=a||v||y;return ue.createElement("rect",{className:Un(["react-flow__minimap-node",{selected:x},f]),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})};xZ.displayName="MiniMapNode";var Uie=P.memo(xZ);const Wie=n=>n.nodeOrigin,Gie=n=>n.getNodes().filter(e=>!e.hidden&&e.width&&e.height),Fx=n=>n instanceof Function?n:()=>n;function Iie({nodeStrokeColor:n="transparent",nodeColor:e="#e2e2e2",nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=Uie,onClick:a}){const o=Yt(Gie,Mn),u=Yt(Wie),f=Fx(e),p=Fx(n),m=Fx(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:f(x),borderRadius:r,strokeColor:p(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var Hie=P.memo(Iie);const Fie=200,Kie=150,Jie=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?cse(cO(e,n.nodeOrigin),t):t,rfId:n.rfId}},eae="react-flow__minimap-desc";function bZ({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:f="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=En(),T=P.useRef(null),{boundingRect:R,viewBB:N,rfId:q}=Yt(Jie,Mn),z=(n==null?void 0:n.width)??Fie,L=(n==null?void 0:n.height)??Kie,E=R.width/z,V=R.height/L,D=Math.max(E,V),C=D*z,G=D*L,A=$*D,W=R.x-(C-R.width)/2-A,H=R.y-(G-R.height)/2-A,U=C+A*2,ee=G+A*2,X=`${eae}-${q}`,B=P.useRef(0);B.current=D,P.useEffect(()=>{if(T.current){const I=Hr(T.current),J=xe=>{const{transform:ke,d3Selection:Me,d3Zoom:se}=j.getState();if(xe.sourceEvent.type!=="wheel"||!Me||!se)return;const be=-xe.sourceEvent.deltaY*(xe.sourceEvent.deltaMode===1?.05:xe.sourceEvent.deltaMode?1:.002)*k,Oe=ke[2]*Math.pow(2,be);se.scaleTo(Me,Oe)},ne=xe=>{const{transform:ke,d3Selection:Me,d3Zoom:se,translateExtent:be,width:Oe,height:ye}=j.getState();if(xe.sourceEvent.type!=="mousemove"||!Me||!se)return;const Fe=B.current*Math.max(1,ke[2])*(Q?-1:1),Te={x:ke[0]-xe.sourceEvent.movementX*Fe,y:ke[1]-xe.sourceEvent.movementY*Fe},we=[[0,0],[Oe,ye]],Ke=Bi.translate(Te.x,Te.y).scale(ke[2]),ct=se.constrain()(Ke,we,be);se.transform(Me,ct)},ce=SL().on("zoom",v?ne:null).on("zoom.wheel",y?J:null);return I.call(ce),()=>{I.on("zoom",null)}}},[v,y,Q,k]);const K=g?I=>{const J=ks(I);g(I,{x:J[0],y:J[1]})}:void 0,Z=x?(I,J)=>{const ne=j.getState().nodeInternals.get(J);x(I,ne)}:void 0;return ue.createElement(lO,{position:m,style:n,className:Un(["react-flow__minimap",e]),"data-testid":"rf__minimap"},ue.createElement("svg",{width:z,height:L,viewBox:`${W} ${H} ${U} ${ee}`,role:"img","aria-labelledby":X,ref:T,onClick:K},S&&ue.createElement("title",{id:X},S),ue.createElement(Hie,{onClick:Z,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),ue.createElement("path",{className:"react-flow__minimap-mask",d:`M${W-A},${H-A}h${U+A*2}v${ee+A*2}h${-U-A*2}z
|
|
335
|
+
M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fill:u,fillRule:"evenodd",stroke:f,strokeWidth:p,pointerEvents:"none"})))}bZ.displayName="MiniMap";var tae=P.memo(bZ);function nae(){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 rae(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ue.createElement("path",{d:"M0 0h32v4.2H0z"}))}function sae(){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 iae(){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 aae(){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 rd=({children:n,className:e,...t})=>ue.createElement("button",{type:"button",className:Un(["react-flow__controls-button",e]),...t},n);rd.displayName="ControlButton";const lae=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}),yZ=({style:n,showZoom:e=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:u,className:f,children:p,position:m="bottom-left"})=>{const g=En(),[x,v]=P.useState(!1),{isInteractive:y,minZoomReached:S,maxZoomReached:Q}=Yt(lae,Mn),{zoomIn:k,zoomOut:$,fitView:j}=Sk();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(lO,{className:Un(["react-flow__controls",f]),position:m,style:n,"data-testid":"rf__controls"},e&&ue.createElement(ue.Fragment,null,ue.createElement(rd,{onClick:T,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:Q},ue.createElement(nae,null)),ue.createElement(rd,{onClick:R,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ue.createElement(rae,null))),t&&ue.createElement(rd,{className:"react-flow__controls-fitview",onClick:N,title:"fit view","aria-label":"fit view"},ue.createElement(sae,null)),r&&ue.createElement(rd,{className:"react-flow__controls-interactive",onClick:q,title:"toggle interactivity","aria-label":"toggle interactivity"},y?ue.createElement(aae,null):ue.createElement(iae,null)),p)};yZ.displayName="Controls";var oae=P.memo(yZ),ss;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ss||(ss={}));function cae({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 uae({color:n,radius:e}){return ue.createElement("circle",{cx:e,cy:e,r:e,fill:n})}const dae={[ss.Dots]:"#91919a",[ss.Lines]:"#eee",[ss.Cross]:"#e2e2e2"},fae={[ss.Dots]:1,[ss.Lines]:1,[ss.Cross]:6},hae=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function vZ({id:n,variant:e=ss.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:o,className:u}){const f=P.useRef(null),{transform:p,patternId:m}=Yt(hae,Mn),g=a||dae[e],x=r||fae[e],v=e===ss.Dots,y=e===ss.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:Un(["react-flow__background",u]),style:{...o,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"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(uae,{color:g,radius:k/i}):ue.createElement(cae,{dimensions:$,color:g,lineWidth:s})),ue.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+n})`}))}vZ.displayName="Background";var pae=P.memo(vZ);function kk(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 Kx,xN;function mae(){if(xN)return Kx;xN=1;function n(){this.__data__=[],this.size=0}return Kx=n,Kx}var Jx,bN;function Ac(){if(bN)return Jx;bN=1;function n(e,t){return e===t||e!==e&&t!==t}return Jx=n,Jx}var e1,yN;function uO(){if(yN)return e1;yN=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 e1=e,e1}var t1,vN;function Oae(){if(vN)return t1;vN=1;var n=uO(),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 t1=r,t1}var n1,wN;function gae(){if(wN)return n1;wN=1;var n=uO();function e(t){var r=this.__data__,s=n(r,t);return s<0?void 0:r[s][1]}return n1=e,n1}var r1,SN;function xae(){if(SN)return r1;SN=1;var n=uO();function e(t){return n(this.__data__,t)>-1}return r1=e,r1}var s1,QN;function bae(){if(QN)return s1;QN=1;var n=uO();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 s1=e,s1}var i1,kN;function dO(){if(kN)return i1;kN=1;var n=mae(),e=Oae(),t=gae(),r=xae(),s=bae();function i(a){var o=-1,u=a==null?0:a.length;for(this.clear();++o<u;){var f=a[o];this.set(f[0],f[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=s,i1=i,i1}var a1,$N;function yae(){if($N)return a1;$N=1;var n=dO();function e(){this.__data__=new n,this.size=0}return a1=e,a1}var l1,TN;function vae(){if(TN)return l1;TN=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return l1=n,l1}var o1,jN;function wae(){if(jN)return o1;jN=1;function n(e){return this.__data__.get(e)}return o1=n,o1}var c1,_N;function Sae(){if(_N)return c1;_N=1;function n(e){return this.__data__.has(e)}return c1=n,c1}var u1,PN;function wZ(){if(PN)return u1;PN=1;var n=typeof Th=="object"&&Th&&Th.Object===Object&&Th;return u1=n,u1}var d1,NN;function Xs(){if(NN)return d1;NN=1;var n=wZ(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return d1=t,d1}var f1,CN;function qc(){if(CN)return f1;CN=1;var n=Xs(),e=n.Symbol;return f1=e,f1}var h1,RN;function Qae(){if(RN)return h1;RN=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 f=!0}catch{}var p=r.call(a);return f&&(o?a[s]=u:delete a[s]),p}return h1=i,h1}var p1,EN;function kae(){if(EN)return p1;EN=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return p1=t,p1}var m1,AN;function Wl(){if(AN)return m1;AN=1;var n=qc(),e=Qae(),t=kae(),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 m1=a,m1}var O1,qN;function us(){if(qN)return O1;qN=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return O1=n,O1}var g1,MN;function cf(){if(MN)return g1;MN=1;var n=Wl(),e=us(),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 g1=a,g1}var x1,XN;function $ae(){if(XN)return x1;XN=1;var n=Xs(),e=n["__core-js_shared__"];return x1=e,x1}var b1,zN;function Tae(){if(zN)return b1;zN=1;var n=$ae(),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 b1=t,b1}var y1,LN;function SZ(){if(LN)return y1;LN=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 y1=t,y1}var v1,ZN;function jae(){if(ZN)return v1;ZN=1;var n=cf(),e=Tae(),t=us(),r=SZ(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,o=Object.prototype,u=a.toString,f=o.hasOwnProperty,p=RegExp("^"+u.call(f).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 v1=m,v1}var w1,VN;function _ae(){if(VN)return w1;VN=1;function n(e,t){return e==null?void 0:e[t]}return w1=n,w1}var S1,YN;function Gl(){if(YN)return S1;YN=1;var n=jae(),e=_ae();function t(r,s){var i=e(r,s);return n(i)?i:void 0}return S1=t,S1}var Q1,DN;function $k(){if(DN)return Q1;DN=1;var n=Gl(),e=Xs(),t=n(e,"Map");return Q1=t,Q1}var k1,BN;function fO(){if(BN)return k1;BN=1;var n=Gl(),e=n(Object,"create");return k1=e,k1}var $1,UN;function Pae(){if(UN)return $1;UN=1;var n=fO();function e(){this.__data__=n?n(null):{},this.size=0}return $1=e,$1}var T1,WN;function Nae(){if(WN)return T1;WN=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return T1=n,T1}var j1,GN;function Cae(){if(GN)return j1;GN=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 j1=s,j1}var _1,IN;function Rae(){if(IN)return _1;IN=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 _1=r,_1}var P1,HN;function Eae(){if(HN)return P1;HN=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 P1=t,P1}var N1,FN;function Aae(){if(FN)return N1;FN=1;var n=Pae(),e=Nae(),t=Cae(),r=Rae(),s=Eae();function i(a){var o=-1,u=a==null?0:a.length;for(this.clear();++o<u;){var f=a[o];this.set(f[0],f[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=s,N1=i,N1}var C1,KN;function qae(){if(KN)return C1;KN=1;var n=Aae(),e=dO(),t=$k();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return C1=r,C1}var R1,JN;function Mae(){if(JN)return R1;JN=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return R1=n,R1}var E1,e3;function hO(){if(e3)return E1;e3=1;var n=Mae();function e(t,r){var s=t.__data__;return n(r)?s[typeof r=="string"?"string":"hash"]:s.map}return E1=e,E1}var A1,t3;function Xae(){if(t3)return A1;t3=1;var n=hO();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return A1=e,A1}var q1,n3;function zae(){if(n3)return q1;n3=1;var n=hO();function e(t){return n(this,t).get(t)}return q1=e,q1}var M1,r3;function Lae(){if(r3)return M1;r3=1;var n=hO();function e(t){return n(this,t).has(t)}return M1=e,M1}var X1,s3;function Zae(){if(s3)return X1;s3=1;var n=hO();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 X1=e,X1}var z1,i3;function Tk(){if(i3)return z1;i3=1;var n=qae(),e=Xae(),t=zae(),r=Lae(),s=Zae();function i(a){var o=-1,u=a==null?0:a.length;for(this.clear();++o<u;){var f=a[o];this.set(f[0],f[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=s,z1=i,z1}var L1,a3;function Vae(){if(a3)return L1;a3=1;var n=dO(),e=$k(),t=Tk(),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 L1=s,L1}var Z1,l3;function pO(){if(l3)return Z1;l3=1;var n=dO(),e=yae(),t=vae(),r=wae(),s=Sae(),i=Vae();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,Z1=a,Z1}var V1,o3;function jk(){if(o3)return V1;o3=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 V1=n,V1}var Y1,c3;function QZ(){if(c3)return Y1;c3=1;var n=Gl(),e=(function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Y1=e,Y1}var D1,u3;function mO(){if(u3)return D1;u3=1;var n=QZ();function e(t,r,s){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):t[r]=s}return D1=e,D1}var B1,d3;function OO(){if(d3)return B1;d3=1;var n=mO(),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 B1=s,B1}var U1,f3;function uf(){if(f3)return U1;f3=1;var n=OO(),e=mO();function t(r,s,i,a){var o=!i;i||(i={});for(var u=-1,f=s.length;++u<f;){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 U1=t,U1}var W1,h3;function Yae(){if(h3)return W1;h3=1;function n(e,t){for(var r=-1,s=Array(e);++r<e;)s[r]=t(r);return s}return W1=n,W1}var G1,p3;function oi(){if(p3)return G1;p3=1;function n(e){return e!=null&&typeof e=="object"}return G1=n,G1}var I1,m3;function Dae(){if(m3)return I1;m3=1;var n=Wl(),e=oi(),t="[object Arguments]";function r(s){return e(s)&&n(s)==t}return I1=r,I1}var H1,O3;function df(){if(O3)return H1;O3=1;var n=Dae(),e=oi(),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 H1=i,H1}var F1,g3;function jn(){if(g3)return F1;g3=1;var n=Array.isArray;return F1=n,F1}var sd={exports:{}},K1,x3;function Bae(){if(x3)return K1;x3=1;function n(){return!1}return K1=n,K1}sd.exports;var b3;function Mc(){return b3||(b3=1,(function(n,e){var t=Xs(),r=Bae(),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,f=u||r;n.exports=f})(sd,sd.exports)),sd.exports}var J1,y3;function gO(){if(y3)return J1;y3=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 J1=t,J1}var eb,v3;function _k(){if(v3)return eb;v3=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return eb=e,eb}var tb,w3;function Uae(){if(w3)return tb;w3=1;var n=Wl(),e=_k(),t=oi(),r="[object Arguments]",s="[object Array]",i="[object Boolean]",a="[object Date]",o="[object Error]",u="[object Function]",f="[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[f]=E[p]=E[m]=E[g]=E[x]=E[v]=E[y]=!1;function V(D){return t(D)&&e(D.length)&&!!E[n(D)]}return tb=V,tb}var nb,S3;function xO(){if(S3)return nb;S3=1;function n(e){return function(t){return e(t)}}return nb=n,nb}var id={exports:{}};id.exports;var Q3;function Pk(){return Q3||(Q3=1,(function(n,e){var t=wZ(),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})(id,id.exports)),id.exports}var rb,k3;function ff(){if(k3)return rb;k3=1;var n=Uae(),e=xO(),t=Pk(),r=t&&t.isTypedArray,s=r?e(r):n;return rb=s,rb}var sb,$3;function kZ(){if($3)return sb;$3=1;var n=Yae(),e=df(),t=jn(),r=Mc(),s=gO(),i=ff(),a=Object.prototype,o=a.hasOwnProperty;function u(f,p){var m=t(f),g=!m&&e(f),x=!m&&!g&&r(f),v=!m&&!g&&!x&&i(f),y=m||g||x||v,S=y?n(f.length,String):[],Q=S.length;for(var k in f)(p||o.call(f,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 sb=u,sb}var ib,T3;function bO(){if(T3)return ib;T3=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,s=typeof r=="function"&&r.prototype||n;return t===s}return ib=e,ib}var ab,j3;function $Z(){if(j3)return ab;j3=1;function n(e,t){return function(r){return e(t(r))}}return ab=n,ab}var lb,_3;function Wae(){if(_3)return lb;_3=1;var n=$Z(),e=n(Object.keys,Object);return lb=e,lb}var ob,P3;function Nk(){if(P3)return ob;P3=1;var n=bO(),e=Wae(),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 ob=s,ob}var cb,N3;function Ki(){if(N3)return cb;N3=1;var n=cf(),e=_k();function t(r){return r!=null&&e(r.length)&&!n(r)}return cb=t,cb}var ub,C3;function Ia(){if(C3)return ub;C3=1;var n=kZ(),e=Nk(),t=Ki();function r(s){return t(s)?n(s):e(s)}return ub=r,ub}var db,R3;function Gae(){if(R3)return db;R3=1;var n=uf(),e=Ia();function t(r,s){return r&&n(s,e(s),r)}return db=t,db}var fb,E3;function Iae(){if(E3)return fb;E3=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 hb,A3;function Hae(){if(A3)return hb;A3=1;var n=us(),e=bO(),t=Iae(),r=Object.prototype,s=r.hasOwnProperty;function i(a){if(!n(a))return t(a);var o=e(a),u=[];for(var f in a)f=="constructor"&&(o||!s.call(a,f))||u.push(f);return u}return hb=i,hb}var pb,q3;function Il(){if(q3)return pb;q3=1;var n=kZ(),e=Hae(),t=Ki();function r(s){return t(s)?n(s,!0):e(s)}return pb=r,pb}var mb,M3;function Fae(){if(M3)return mb;M3=1;var n=uf(),e=Il();function t(r,s){return r&&n(s,e(s),r)}return mb=t,mb}var ad={exports:{}};ad.exports;var X3;function TZ(){return X3||(X3=1,(function(n,e){var t=Xs(),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(f,p){if(p)return f.slice();var m=f.length,g=o?o(m):new f.constructor(m);return f.copy(g),g}n.exports=u})(ad,ad.exports)),ad.exports}var Ob,z3;function jZ(){if(z3)return Ob;z3=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 Ob=n,Ob}var gb,L3;function _Z(){if(L3)return gb;L3=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 gb=n,gb}var xb,Z3;function PZ(){if(Z3)return xb;Z3=1;function n(){return[]}return xb=n,xb}var bb,V3;function Ck(){if(V3)return bb;V3=1;var n=_Z(),e=PZ(),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 bb=i,bb}var yb,Y3;function Kae(){if(Y3)return yb;Y3=1;var n=uf(),e=Ck();function t(r,s){return n(r,e(r),s)}return yb=t,yb}var vb,D3;function Rk(){if(D3)return vb;D3=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 vb=n,vb}var wb,B3;function yO(){if(B3)return wb;B3=1;var n=$Z(),e=n(Object.getPrototypeOf,Object);return wb=e,wb}var Sb,U3;function NZ(){if(U3)return Sb;U3=1;var n=Rk(),e=yO(),t=Ck(),r=PZ(),s=Object.getOwnPropertySymbols,i=s?function(a){for(var o=[];a;)n(o,t(a)),a=e(a);return o}:r;return Sb=i,Sb}var Qb,W3;function Jae(){if(W3)return Qb;W3=1;var n=uf(),e=NZ();function t(r,s){return n(r,e(r),s)}return Qb=t,Qb}var kb,G3;function CZ(){if(G3)return kb;G3=1;var n=Rk(),e=jn();function t(r,s,i){var a=s(r);return e(r)?a:n(a,i(r))}return kb=t,kb}var $b,I3;function RZ(){if(I3)return $b;I3=1;var n=CZ(),e=Ck(),t=Ia();function r(s){return n(s,t,e)}return $b=r,$b}var Tb,H3;function ele(){if(H3)return Tb;H3=1;var n=CZ(),e=NZ(),t=Il();function r(s){return n(s,t,e)}return Tb=r,Tb}var jb,F3;function tle(){if(F3)return jb;F3=1;var n=Gl(),e=Xs(),t=n(e,"DataView");return jb=t,jb}var _b,K3;function nle(){if(K3)return _b;K3=1;var n=Gl(),e=Xs(),t=n(e,"Promise");return _b=t,_b}var Pb,J3;function EZ(){if(J3)return Pb;J3=1;var n=Gl(),e=Xs(),t=n(e,"Set");return Pb=t,Pb}var Nb,eC;function rle(){if(eC)return Nb;eC=1;var n=Gl(),e=Xs(),t=n(e,"WeakMap");return Nb=t,Nb}var Cb,tC;function Xc(){if(tC)return Cb;tC=1;var n=tle(),e=$k(),t=nle(),r=EZ(),s=rle(),i=Wl(),a=SZ(),o="[object Map]",u="[object Object]",f="[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())!=f||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 f;case S:return p;case Q:return m}return j}),Cb=k,Cb}var Rb,nC;function sle(){if(nC)return Rb;nC=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 Rb=t,Rb}var Eb,rC;function AZ(){if(rC)return Eb;rC=1;var n=Xs(),e=n.Uint8Array;return Eb=e,Eb}var Ab,sC;function Ek(){if(sC)return Ab;sC=1;var n=AZ();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return Ab=e,Ab}var qb,iC;function ile(){if(iC)return qb;iC=1;var n=Ek();function e(t,r){var s=r?n(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}return qb=e,qb}var Mb,aC;function ale(){if(aC)return Mb;aC=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return Mb=e,Mb}var Xb,lC;function lle(){if(lC)return Xb;lC=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 Xb=r,Xb}var zb,oC;function qZ(){if(oC)return zb;oC=1;var n=Ek();function e(t,r){var s=r?n(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}return zb=e,zb}var Lb,cC;function ole(){if(cC)return Lb;cC=1;var n=Ek(),e=ile(),t=ale(),r=lle(),s=qZ(),i="[object Boolean]",a="[object Date]",o="[object Map]",u="[object Number]",f="[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 f:return t(z);case p:return new V;case g:return r(z)}}return Lb=q,Lb}var Zb,uC;function MZ(){if(uC)return Zb;uC=1;var n=us(),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 Zb=t,Zb}var Vb,dC;function XZ(){if(dC)return Vb;dC=1;var n=MZ(),e=yO(),t=bO();function r(s){return typeof s.constructor=="function"&&!t(s)?n(e(s)):{}}return Vb=r,Vb}var Yb,fC;function cle(){if(fC)return Yb;fC=1;var n=Xc(),e=oi(),t="[object Map]";function r(s){return e(s)&&n(s)==t}return Yb=r,Yb}var Db,hC;function ule(){if(hC)return Db;hC=1;var n=cle(),e=xO(),t=Pk(),r=t&&t.isMap,s=r?e(r):n;return Db=s,Db}var Bb,pC;function dle(){if(pC)return Bb;pC=1;var n=Xc(),e=oi(),t="[object Set]";function r(s){return e(s)&&n(s)==t}return Bb=r,Bb}var Ub,mC;function fle(){if(mC)return Ub;mC=1;var n=dle(),e=xO(),t=Pk(),r=t&&t.isSet,s=r?e(r):n;return Ub=s,Ub}var Wb,OC;function zZ(){if(OC)return Wb;OC=1;var n=pO(),e=jk(),t=OO(),r=Gae(),s=Fae(),i=TZ(),a=jZ(),o=Kae(),u=Jae(),f=RZ(),p=ele(),m=Xc(),g=sle(),x=ole(),v=XZ(),y=jn(),S=Mc(),Q=ule(),k=us(),$=fle(),j=Ia(),T=Il(),R=1,N=2,q=4,z="[object Arguments]",L="[object Array]",E="[object Boolean]",V="[object Date]",D="[object Error]",C="[object Function]",G="[object GeneratorFunction]",A="[object Map]",W="[object Number]",H="[object Object]",U="[object RegExp]",ee="[object Set]",X="[object String]",B="[object Symbol]",K="[object WeakMap]",Z="[object ArrayBuffer]",I="[object DataView]",J="[object Float32Array]",ne="[object Float64Array]",ce="[object Int8Array]",xe="[object Int16Array]",ke="[object Int32Array]",Me="[object Uint8Array]",se="[object Uint8ClampedArray]",be="[object Uint16Array]",Oe="[object Uint32Array]",ye={};ye[z]=ye[L]=ye[Z]=ye[I]=ye[E]=ye[V]=ye[J]=ye[ne]=ye[ce]=ye[xe]=ye[ke]=ye[A]=ye[W]=ye[H]=ye[U]=ye[ee]=ye[X]=ye[B]=ye[Me]=ye[se]=ye[be]=ye[Oe]=!0,ye[D]=ye[C]=ye[K]=!1;function Fe(Te,we,Ke,ct,at,yt){var Ye,tt=we&R,gn=we&N,kt=we&q;if(Ke&&(Ye=at?Ke(Te,ct,at,yt):Ke(Te)),Ye!==void 0)return Ye;if(!k(Te))return Te;var Zt=y(Te);if(Zt){if(Ye=g(Te),!tt)return a(Te,Ye)}else{var $t=m(Te),rn=$t==C||$t==G;if(S(Te))return i(Te,tt);if($t==H||$t==z||rn&&!at){if(Ye=gn||rn?{}:v(Te),!tt)return gn?u(Te,s(Ye,Te)):o(Te,r(Ye,Te))}else{if(!ye[$t])return at?Te:{};Ye=x(Te,$t,tt)}}yt||(yt=new n);var dn=yt.get(Te);if(dn)return dn;yt.set(Te,Ye),$(Te)?Te.forEach(function(ut){Ye.add(Fe(ut,we,Ke,ut,Te,yt))}):Q(Te)&&Te.forEach(function(ut,lt){Ye.set(lt,Fe(ut,we,Ke,lt,Te,yt))});var pt=kt?gn?p:f:gn?T:j,Dt=Zt?void 0:pt(Te);return e(Dt||Te,function(ut,lt){Dt&&(lt=ut,ut=Te[lt]),t(Ye,lt,Fe(ut,we,Ke,lt,Te,yt))}),Ye}return Wb=Fe,Wb}var Gb,gC;function hle(){if(gC)return Gb;gC=1;var n=zZ(),e=4;function t(r){return n(r,e)}return Gb=t,Gb}var Ib,xC;function Ak(){if(xC)return Ib;xC=1;function n(e){return function(){return e}}return Ib=n,Ib}var Hb,bC;function ple(){if(bC)return Hb;bC=1;function n(e){return function(t,r,s){for(var i=-1,a=Object(t),o=s(t),u=o.length;u--;){var f=o[e?u:++i];if(r(a[f],f,a)===!1)break}return t}}return Hb=n,Hb}var Fb,yC;function qk(){if(yC)return Fb;yC=1;var n=ple(),e=n();return Fb=e,Fb}var Kb,vC;function Mk(){if(vC)return Kb;vC=1;var n=qk(),e=Ia();function t(r,s){return r&&n(r,s,e)}return Kb=t,Kb}var Jb,wC;function mle(){if(wC)return Jb;wC=1;var n=Ki();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 Jb=e,Jb}var ey,SC;function vO(){if(SC)return ey;SC=1;var n=Mk(),e=mle(),t=e(n);return ey=t,ey}var ty,QC;function Hl(){if(QC)return ty;QC=1;function n(e){return e}return ty=n,ty}var ny,kC;function LZ(){if(kC)return ny;kC=1;var n=Hl();function e(t){return typeof t=="function"?t:n}return ny=e,ny}var ry,$C;function ZZ(){if($C)return ry;$C=1;var n=jk(),e=vO(),t=LZ(),r=jn();function s(i,a){var o=r(i)?n:e;return o(i,t(a))}return ry=s,ry}var sy,TC;function VZ(){return TC||(TC=1,sy=ZZ()),sy}var iy,jC;function Ole(){if(jC)return iy;jC=1;var n=vO();function e(t,r){var s=[];return n(t,function(i,a,o){r(i,a,o)&&s.push(i)}),s}return iy=e,iy}var ay,_C;function gle(){if(_C)return ay;_C=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return ay=e,ay}var ly,PC;function xle(){if(PC)return ly;PC=1;function n(e){return this.__data__.has(e)}return ly=n,ly}var oy,NC;function YZ(){if(NC)return oy;NC=1;var n=Tk(),e=gle(),t=xle();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,oy=r,oy}var cy,CC;function ble(){if(CC)return cy;CC=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 cy=n,cy}var uy,RC;function DZ(){if(RC)return uy;RC=1;function n(e,t){return e.has(t)}return uy=n,uy}var dy,EC;function BZ(){if(EC)return dy;EC=1;var n=YZ(),e=ble(),t=DZ(),r=1,s=2;function i(a,o,u,f,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(f)var R=g?f(T,j,Q,o,a,m):f(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,f,m)))return $.push(q)})){k=!1;break}}else if(!(j===T||p(j,T,u,f,m))){k=!1;break}}return m.delete(a),m.delete(o),k}return dy=i,dy}var fy,AC;function yle(){if(AC)return fy;AC=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 hy,qC;function Xk(){if(qC)return hy;qC=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(s){r[++t]=s}),r}return hy=n,hy}var py,MC;function vle(){if(MC)return py;MC=1;var n=qc(),e=AZ(),t=Ac(),r=BZ(),s=yle(),i=Xk(),a=1,o=2,u="[object Boolean]",f="[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 f: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 D=s;case v:var C=z&a;if(D||(D=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(D(R),D(N),z,L,E,V);return V.delete(R),A;case S:if(j)return j.call(R)==j.call(N)}return!1}return py=T,py}var my,XC;function wle(){if(XC)return my;XC=1;var n=RZ(),e=1,t=Object.prototype,r=t.hasOwnProperty;function s(i,a,o,u,f,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||f(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 my=s,my}var Oy,zC;function Sle(){if(zC)return Oy;zC=1;var n=pO(),e=BZ(),t=vle(),r=wle(),s=Xc(),i=jn(),a=Mc(),o=ff(),u=1,f="[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==f?m:N,q=q==f?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__"),D=L&&x.call(S,"__wrapped__");if(V||D){var C=V?y.value():y,G=D?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 Oy=v,Oy}var gy,LC;function UZ(){if(LC)return gy;LC=1;var n=Sle(),e=oi();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 gy=t,gy}var xy,ZC;function Qle(){if(ZC)return xy;ZC=1;var n=pO(),e=UZ(),t=1,r=2;function s(i,a,o,u){var f=o.length,p=f,m=!u;if(i==null)return!p;for(i=Object(i);f--;){var g=o[f];if(m&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++f<p;){g=o[f];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 xy=s,xy}var by,VC;function WZ(){if(VC)return by;VC=1;var n=us();function e(t){return t===t&&!n(t)}return by=e,by}var yy,YC;function kle(){if(YC)return yy;YC=1;var n=WZ(),e=Ia();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 yy=t,yy}var vy,DC;function GZ(){if(DC)return vy;DC=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return vy=n,vy}var wy,BC;function $le(){if(BC)return wy;BC=1;var n=Qle(),e=kle(),t=GZ();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 wy=r,wy}var Sy,UC;function zc(){if(UC)return Sy;UC=1;var n=Wl(),e=oi(),t="[object Symbol]";function r(s){return typeof s=="symbol"||e(s)&&n(s)==t}return Sy=r,Sy}var Qy,WC;function zk(){if(WC)return Qy;WC=1;var n=jn(),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 Qy=s,Qy}var ky,GC;function Tle(){if(GC)return ky;GC=1;var n=Tk(),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 f=r.apply(this,a);return i.cache=u.set(o,f)||u,f};return i.cache=new(t.Cache||n),i}return t.Cache=n,ky=t,ky}var $y,IC;function jle(){if(IC)return $y;IC=1;var n=Tle(),e=500;function t(r){var s=n(r,function(a){return i.size===e&&i.clear(),a}),i=s.cache;return s}return $y=t,$y}var Ty,HC;function _le(){if(HC)return Ty;HC=1;var n=jle(),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,f){i.push(u?f.replace(t,"$1"):o||a)}),i});return Ty=r,Ty}var jy,FC;function wO(){if(FC)return jy;FC=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 jy=n,jy}var _y,KC;function Ple(){if(KC)return _y;KC=1;var n=qc(),e=wO(),t=jn(),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 _y=a,_y}var Py,JC;function IZ(){if(JC)return Py;JC=1;var n=Ple();function e(t){return t==null?"":n(t)}return Py=e,Py}var Ny,eR;function SO(){if(eR)return Ny;eR=1;var n=jn(),e=zk(),t=_le(),r=IZ();function s(i,a){return n(i)?i:e(i,a)?[i]:t(r(i))}return Ny=s,Ny}var Cy,tR;function hf(){if(tR)return Cy;tR=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 Cy=e,Cy}var Ry,nR;function QO(){if(nR)return Ry;nR=1;var n=SO(),e=hf();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 Ry=t,Ry}var Ey,rR;function Nle(){if(rR)return Ey;rR=1;var n=QO();function e(t,r,s){var i=t==null?void 0:n(t,r);return i===void 0?s:i}return Ey=e,Ey}var Ay,sR;function Cle(){if(sR)return Ay;sR=1;function n(e,t){return e!=null&&t in Object(e)}return Ay=n,Ay}var qy,iR;function HZ(){if(iR)return qy;iR=1;var n=SO(),e=df(),t=jn(),r=gO(),s=_k(),i=hf();function a(o,u,f){u=n(u,o);for(var p=-1,m=u.length,g=!1;++p<m;){var x=i(u[p]);if(!(g=o!=null&&f(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 qy=a,qy}var My,aR;function FZ(){if(aR)return My;aR=1;var n=Cle(),e=HZ();function t(r,s){return r!=null&&e(r,s,n)}return My=t,My}var Xy,lR;function Rle(){if(lR)return Xy;lR=1;var n=UZ(),e=Nle(),t=FZ(),r=zk(),s=WZ(),i=GZ(),a=hf(),o=1,u=2;function f(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 Xy=f,Xy}var zy,oR;function KZ(){if(oR)return zy;oR=1;function n(e){return function(t){return t==null?void 0:t[e]}}return zy=n,zy}var Ly,cR;function Ele(){if(cR)return Ly;cR=1;var n=QO();function e(t){return function(r){return n(r,t)}}return Ly=e,Ly}var Zy,uR;function Ale(){if(uR)return Zy;uR=1;var n=KZ(),e=Ele(),t=zk(),r=hf();function s(i){return t(i)?n(r(i)):e(i)}return Zy=s,Zy}var Vy,dR;function Ji(){if(dR)return Vy;dR=1;var n=$le(),e=Rle(),t=Hl(),r=jn(),s=Ale();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 Vy=i,Vy}var Yy,fR;function JZ(){if(fR)return Yy;fR=1;var n=_Z(),e=Ole(),t=Ji(),r=jn();function s(i,a){var o=r(i)?n:e;return o(i,t(a,3))}return Yy=s,Yy}var Dy,hR;function qle(){if(hR)return Dy;hR=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,s){return r!=null&&e.call(r,s)}return Dy=t,Dy}var By,pR;function e6(){if(pR)return By;pR=1;var n=qle(),e=HZ();function t(r,s){return r!=null&&e(r,s,n)}return By=t,By}var Uy,mR;function Mle(){if(mR)return Uy;mR=1;var n=Nk(),e=Xc(),t=df(),r=jn(),s=Ki(),i=Mc(),a=bO(),o=ff(),u="[object Map]",f="[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==f)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 Uy=g,Uy}var Wy,OR;function t6(){if(OR)return Wy;OR=1;function n(e){return e===void 0}return Wy=n,Wy}var Gy,gR;function n6(){if(gR)return Gy;gR=1;var n=vO(),e=Ki();function t(r,s){var i=-1,a=e(r)?Array(r.length):[];return n(r,function(o,u,f){a[++i]=s(o,u,f)}),a}return Gy=t,Gy}var Iy,xR;function r6(){if(xR)return Iy;xR=1;var n=wO(),e=Ji(),t=n6(),r=jn();function s(i,a){var o=r(i)?n:t;return o(i,e(a,3))}return Iy=s,Iy}var Hy,bR;function Xle(){if(bR)return Hy;bR=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 Hy=n,Hy}var Fy,yR;function zle(){if(yR)return Fy;yR=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 Fy=n,Fy}var Ky,vR;function s6(){if(vR)return Ky;vR=1;var n=Xle(),e=vO(),t=Ji(),r=zle(),s=jn();function i(a,o,u){var f=s(a)?n:r,p=arguments.length<3;return f(a,t(o,4),u,p,e)}return Ky=i,Ky}var Jy,wR;function Lle(){if(wR)return Jy;wR=1;var n=Wl(),e=jn(),t=oi(),r="[object String]";function s(i){return typeof i=="string"||!e(i)&&t(i)&&n(i)==r}return Jy=s,Jy}var ev,SR;function Zle(){if(SR)return ev;SR=1;var n=KZ(),e=n("length");return ev=e,ev}var tv,QR;function Vle(){if(QR)return tv;QR=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(f){return o.test(f)}return tv=u,tv}var nv,kR;function Yle(){if(kR)return nv;kR=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]",f="(?:"+o+"|"+u+")",p="[^"+n+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",v=f+"?",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 nv=j,nv}var rv,$R;function Dle(){if($R)return rv;$R=1;var n=Zle(),e=Vle(),t=Yle();function r(s){return e(s)?t(s):n(s)}return rv=r,rv}var sv,TR;function Ble(){if(TR)return sv;TR=1;var n=Nk(),e=Xc(),t=Ki(),r=Lle(),s=Dle(),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 f=e(u);return f==i||f==a?u.size:n(u).length}return sv=o,sv}var iv,jR;function Ule(){if(jR)return iv;jR=1;var n=jk(),e=MZ(),t=Mk(),r=Ji(),s=yO(),i=jn(),a=Mc(),o=cf(),u=us(),f=ff();function p(m,g,x){var v=i(m),y=v||a(m)||f(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 iv=p,iv}var av,_R;function Wle(){if(_R)return av;_R=1;var n=qc(),e=df(),t=jn(),r=n?n.isConcatSpreadable:void 0;function s(i){return t(i)||e(i)||!!(r&&i&&i[r])}return av=s,av}var lv,PR;function Lk(){if(PR)return lv;PR=1;var n=Rk(),e=Wle();function t(r,s,i,a,o){var u=-1,f=r.length;for(i||(i=e),o||(o=[]);++u<f;){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 lv=t,lv}var ov,NR;function Gle(){if(NR)return ov;NR=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 ov=n,ov}var cv,CR;function i6(){if(CR)return cv;CR=1;var n=Gle(),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),f=Array(u);++o<u;)f[o]=a[s+o];o=-1;for(var p=Array(s+1);++o<s;)p[o]=a[o];return p[s]=i(f),n(r,this,p)}}return cv=t,cv}var uv,RR;function Ile(){if(RR)return uv;RR=1;var n=Ak(),e=QZ(),t=Hl(),r=e?function(s,i){return e(s,"toString",{configurable:!0,enumerable:!1,value:n(i),writable:!0})}:t;return uv=r,uv}var dv,ER;function Hle(){if(ER)return dv;ER=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 dv=r,dv}var fv,AR;function a6(){if(AR)return fv;AR=1;var n=Ile(),e=Hle(),t=e(n);return fv=t,fv}var hv,qR;function kO(){if(qR)return hv;qR=1;var n=Hl(),e=i6(),t=a6();function r(s,i){return t(e(s,i,n),s+"")}return hv=r,hv}var pv,MR;function l6(){if(MR)return pv;MR=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 pv=n,pv}var mv,XR;function Fle(){if(XR)return mv;XR=1;function n(e){return e!==e}return mv=n,mv}var Ov,zR;function Kle(){if(zR)return Ov;zR=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 Ov=n,Ov}var gv,LR;function Jle(){if(LR)return gv;LR=1;var n=l6(),e=Fle(),t=Kle();function r(s,i,a){return i===i?t(s,i,a):n(s,e,a)}return gv=r,gv}var xv,ZR;function eoe(){if(ZR)return xv;ZR=1;var n=Jle();function e(t,r){var s=t==null?0:t.length;return!!s&&n(t,r,0)>-1}return xv=e,xv}var bv,VR;function toe(){if(VR)return bv;VR=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 bv=n,bv}var yv,YR;function noe(){if(YR)return yv;YR=1;function n(){}return yv=n,yv}var vv,DR;function roe(){if(DR)return vv;DR=1;var n=EZ(),e=noe(),t=Xk(),r=1/0,s=n&&1/t(new n([,-0]))[1]==r?function(i){return new n(i)}:e;return vv=s,vv}var wv,BR;function soe(){if(BR)return wv;BR=1;var n=YZ(),e=eoe(),t=toe(),r=DZ(),s=roe(),i=Xk(),a=200;function o(u,f,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=f?null:s(u);if(Q)return i(Q);v=!1,g=r,S=new n}else S=f?[]:y;e:for(;++m<x;){var k=u[m],$=f?f(k):k;if(k=p||k!==0?k:0,v&&$===$){for(var j=S.length;j--;)if(S[j]===$)continue e;f&&S.push($),y.push(k)}else g(S,$,p)||(S!==y&&S.push($),y.push(k))}return y}return wv=o,wv}var Sv,UR;function o6(){if(UR)return Sv;UR=1;var n=Ki(),e=oi();function t(r){return e(r)&&n(r)}return Sv=t,Sv}var Qv,WR;function ioe(){if(WR)return Qv;WR=1;var n=Lk(),e=kO(),t=soe(),r=o6(),s=e(function(i){return t(n(i,1,r,!0))});return Qv=s,Qv}var kv,GR;function aoe(){if(GR)return kv;GR=1;var n=wO();function e(t,r){return n(r,function(s){return t[s]})}return kv=e,kv}var $v,IR;function c6(){if(IR)return $v;IR=1;var n=aoe(),e=Ia();function t(r){return r==null?[]:n(r,e(r))}return $v=t,$v}var Tv,HR;function ds(){if(HR)return Tv;HR=1;var n;if(typeof kk=="function")try{n={clone:hle(),constant:Ak(),each:VZ(),filter:JZ(),has:e6(),isArray:jn(),isEmpty:Mle(),isFunction:cf(),isUndefined:t6(),keys:Ia(),map:r6(),reduce:s6(),size:Ble(),transform:Ule(),union:ioe(),values:c6()}}catch{}return n||(n=window._),Tv=n,Tv}var jv,FR;function Zk(){if(FR)return jv;FR=1;var n=ds();jv=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?f(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?f(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?f(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 f(p,m){return o(p,m.v,m.w,m.name)}return jv}var _v,KR;function loe(){return KR||(KR=1,_v="2.1.8"),_v}var Pv,JR;function ooe(){return JR||(JR=1,Pv={Graph:Zk(),version:loe()}),Pv}var Nv,eE;function coe(){if(eE)return Nv;eE=1;var n=ds(),e=Zk();Nv={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),f=a.parent(o),p={v:o};return n.isUndefined(u)||(p.value=u),n.isUndefined(f)||(p.parent=f),p})}function s(a){return n.map(a.edges(),function(o){var u=a.edge(o),f={v:o.v,w:o.w};return n.isUndefined(o.name)||(f.name=o.name),n.isUndefined(u)||(f.value=u),f})}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 Nv}var Cv,tE;function uoe(){if(tE)return Cv;tE=1;var n=ds();Cv=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 Cv}var Rv,nE;function u6(){if(nE)return Rv;nE=1;var n=ds();Rv=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},Rv}var Ev,rE;function d6(){if(rE)return Ev;rE=1;var n=ds(),e=u6();Ev=r;var t=n.constant(1);function r(i,a,o,u){return s(i,String(a),o||t,u||function(f){return i.outEdges(f)})}function s(i,a,o,u){var f={},p=new e,m,g,x=function(v){var y=v.v!==m?v.v:v.w,S=f[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;f[v]={distance:y},p.add(v,y)});p.size()>0&&(m=p.removeMin(),g=f[m],g.distance!==Number.POSITIVE_INFINITY);)u(m).forEach(x);return f}return Ev}var Av,sE;function doe(){if(sE)return Av;sE=1;var n=d6(),e=ds();Av=t;function t(r,s,i){return e.transform(r.nodes(),function(a,o){a[o]=n(r,o,s,i)},{})}return Av}var qv,iE;function f6(){if(iE)return qv;iE=1;var n=ds();qv=e;function e(t){var r=0,s=[],i={},a=[];function o(u){var f=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&&(f.lowlink=Math.min(f.lowlink,i[g].index)):(o(g),f.lowlink=Math.min(f.lowlink,i[g].lowlink))}),f.lowlink===f.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 qv}var Mv,aE;function foe(){if(aE)return Mv;aE=1;var n=ds(),e=f6();Mv=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 Mv}var Xv,lE;function hoe(){if(lE)return Xv;lE=1;var n=ds();Xv=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(f){o[f]={},o[f][f]={distance:0},u.forEach(function(p){f!==p&&(o[f][p]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(p){var m=p.v===f?p.w:p.v,g=i(p);o[f][m]={distance:g,predecessor:f}})}),u.forEach(function(f){var p=o[f];u.forEach(function(m){var g=o[m];u.forEach(function(x){var v=g[f],y=p[x],S=g[x],Q=v.distance+y.distance;Q<S.distance&&(S.distance=Q,S.predecessor=y.predecessor)})})}),o}return Xv}var zv,oE;function h6(){if(oE)return zv;oE=1;var n=ds();zv=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,zv}var Lv,cE;function poe(){if(cE)return Lv;cE=1;var n=h6();Lv=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return Lv}var Zv,uE;function p6(){if(uE)return Zv;uE=1;var n=ds();Zv=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(f){if(!r.hasNode(f))throw new Error("Graph does not have node: "+f);t(r,f,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(f){t(r,f,i,a,o,u)}),i&&u.push(s))}return Zv}var Vv,dE;function moe(){if(dE)return Vv;dE=1;var n=p6();Vv=e;function e(t,r){return n(t,r,"post")}return Vv}var Yv,fE;function Ooe(){if(fE)return Yv;fE=1;var n=p6();Yv=e;function e(t,r){return n(t,r,"pre")}return Yv}var Dv,hE;function goe(){if(hE)return Dv;hE=1;var n=ds(),e=Zk(),t=u6();Dv=r;function r(s,i){var a=new e,o={},u=new t,f;function p(g){var x=g.v===f?g.w:g.v,v=u.priority(x);if(v!==void 0){var y=i(g);y<v&&(o[x]=f,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(f=u.removeMin(),n.has(o,f))a.setEdge(f,o[f]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(f).forEach(p)}return a}return Dv}var Bv,pE;function xoe(){return pE||(pE=1,Bv={components:uoe(),dijkstra:d6(),dijkstraAll:doe(),findCycles:foe(),floydWarshall:hoe(),isAcyclic:poe(),postorder:moe(),preorder:Ooe(),prim:goe(),tarjan:f6(),topsort:h6()}),Bv}var Uv,mE;function boe(){if(mE)return Uv;mE=1;var n=ooe();return Uv={Graph:n.Graph,json:coe(),alg:xoe(),version:n.version},Uv}var Wv,OE;function Rs(){if(OE)return Wv;OE=1;var n;if(typeof kk=="function")try{n=boe()}catch{}return n||(n=window.graphlib),Wv=n,Wv}var Gv,gE;function yoe(){if(gE)return Gv;gE=1;var n=zZ(),e=1,t=4;function r(s){return n(s,e|t)}return Gv=r,Gv}var Iv,xE;function $O(){if(xE)return Iv;xE=1;var n=Ac(),e=Ki(),t=gO(),r=us();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 Iv=s,Iv}var Hv,bE;function voe(){if(bE)return Hv;bE=1;var n=kO(),e=Ac(),t=$O(),r=Il(),s=Object.prototype,i=s.hasOwnProperty,a=n(function(o,u){o=Object(o);var f=-1,p=u.length,m=p>2?u[2]:void 0;for(m&&t(u[0],u[1],m)&&(p=1);++f<p;)for(var g=u[f],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 Hv=a,Hv}var Fv,yE;function woe(){if(yE)return Fv;yE=1;var n=Ji(),e=Ki(),t=Ia();function r(s){return function(i,a,o){var u=Object(i);if(!e(i)){var f=n(a,3);i=t(i),a=function(m){return f(u[m],m,u)}}var p=s(i,a,o);return p>-1?u[f?i[p]:p]:void 0}}return Fv=r,Fv}var Kv,vE;function Soe(){if(vE)return Kv;vE=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return Kv=e,Kv}var Jv,wE;function Qoe(){if(wE)return Jv;wE=1;var n=Soe(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return Jv=t,Jv}var ew,SE;function koe(){if(SE)return ew;SE=1;var n=Qoe(),e=us(),t=zc(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function u(f){if(typeof f=="number")return f;if(t(f))return r;if(e(f)){var p=typeof f.valueOf=="function"?f.valueOf():f;f=e(p)?p+"":p}if(typeof f!="string")return f===0?f:+f;f=n(f);var m=i.test(f);return m||a.test(f)?o(f.slice(2),m?2:8):s.test(f)?r:+f}return ew=u,ew}var tw,QE;function m6(){if(QE)return tw;QE=1;var n=koe(),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 tw=r,tw}var nw,kE;function $oe(){if(kE)return nw;kE=1;var n=m6();function e(t){var r=n(t),s=r%1;return r===r?s?r-s:r:0}return nw=e,nw}var rw,$E;function Toe(){if($E)return rw;$E=1;var n=l6(),e=Ji(),t=$oe(),r=Math.max;function s(i,a,o){var u=i==null?0:i.length;if(!u)return-1;var f=o==null?0:t(o);return f<0&&(f=r(u+f,0)),n(i,e(a,3),f)}return rw=s,rw}var sw,TE;function joe(){if(TE)return sw;TE=1;var n=woe(),e=Toe(),t=n(e);return sw=t,sw}var iw,jE;function O6(){if(jE)return iw;jE=1;var n=Lk();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return iw=e,iw}var aw,_E;function _oe(){if(_E)return aw;_E=1;var n=qk(),e=LZ(),t=Il();function r(s,i){return s==null?s:n(s,e(i),t)}return aw=r,aw}var lw,PE;function Poe(){if(PE)return lw;PE=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return lw=n,lw}var ow,NE;function Noe(){if(NE)return ow;NE=1;var n=mO(),e=Mk(),t=Ji();function r(s,i){var a={};return i=t(i,3),e(s,function(o,u,f){n(a,u,i(o,u,f))}),a}return ow=r,ow}var cw,CE;function Vk(){if(CE)return cw;CE=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&&(f===void 0?u===u&&!n(u):s(u,f)))var f=u,p=o}return p}return cw=e,cw}var uw,RE;function Coe(){if(RE)return uw;RE=1;function n(e,t){return e>t}return uw=n,uw}var dw,EE;function Roe(){if(EE)return dw;EE=1;var n=Vk(),e=Coe(),t=Hl();function r(s){return s&&s.length?n(s,t,e):void 0}return dw=r,dw}var fw,AE;function g6(){if(AE)return fw;AE=1;var n=mO(),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 hw,qE;function Eoe(){if(qE)return hw;qE=1;var n=Wl(),e=yO(),t=oi(),r="[object Object]",s=Function.prototype,i=Object.prototype,a=s.toString,o=i.hasOwnProperty,u=a.call(Object);function f(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 hw=f,hw}var pw,ME;function x6(){if(ME)return pw;ME=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return pw=n,pw}var mw,XE;function Aoe(){if(XE)return mw;XE=1;var n=uf(),e=Il();function t(r){return n(r,e(r))}return mw=t,mw}var Ow,zE;function qoe(){if(zE)return Ow;zE=1;var n=g6(),e=TZ(),t=qZ(),r=jZ(),s=XZ(),i=df(),a=jn(),o=o6(),u=Mc(),f=cf(),p=us(),m=Eoe(),g=ff(),x=x6(),v=Aoe();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),D=!V&&u(q),C=!V&&!D&&g(q);L=q,V||D||C?a(N)?L=N:o(N)?L=r(N):D?(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)||f(N))&&(L=s(q))):E=!1}E&&(R.set(q,L),j(L,q,$,T,R),R.delete(q)),n(S,k,L)}return Ow=y,Ow}var gw,LE;function Moe(){if(LE)return gw;LE=1;var n=pO(),e=g6(),t=qk(),r=qoe(),s=us(),i=Il(),a=x6();function o(u,f,p,m,g){u!==f&&t(f,function(x,v){if(g||(g=new n),s(x))r(u,f,v,p,o,m,g);else{var y=m?m(a(u,v),x,v+"",u,f,g):void 0;y===void 0&&(y=x),e(u,v,y)}},i)}return gw=o,gw}var xw,ZE;function Xoe(){if(ZE)return xw;ZE=1;var n=kO(),e=$O();function t(r){return n(function(s,i){var a=-1,o=i.length,u=o>1?i[o-1]:void 0,f=o>2?i[2]:void 0;for(u=r.length>3&&typeof u=="function"?(o--,u):void 0,f&&e(i[0],i[1],f)&&(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 xw=t,xw}var bw,VE;function zoe(){if(VE)return bw;VE=1;var n=Moe(),e=Xoe(),t=e(function(r,s,i){n(r,s,i)});return bw=t,bw}var yw,YE;function b6(){if(YE)return yw;YE=1;function n(e,t){return e<t}return yw=n,yw}var vw,DE;function Loe(){if(DE)return vw;DE=1;var n=Vk(),e=b6(),t=Hl();function r(s){return s&&s.length?n(s,t,e):void 0}return vw=r,vw}var ww,BE;function Zoe(){if(BE)return ww;BE=1;var n=Vk(),e=Ji(),t=b6();function r(s,i){return s&&s.length?n(s,e(i,2),t):void 0}return ww=r,ww}var Sw,UE;function Voe(){if(UE)return Sw;UE=1;var n=Xs(),e=function(){return n.Date.now()};return Sw=e,Sw}var Qw,WE;function Yoe(){if(WE)return Qw;WE=1;var n=OO(),e=SO(),t=gO(),r=us(),s=hf();function i(a,o,u,f){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=f?f(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 Qw=i,Qw}var kw,GE;function Doe(){if(GE)return kw;GE=1;var n=QO(),e=Yoe(),t=SO();function r(s,i,a){for(var o=-1,u=i.length,f={};++o<u;){var p=i[o],m=n(s,p);a(m,p)&&e(f,t(p,s),m)}return f}return kw=r,kw}var $w,IE;function Boe(){if(IE)return $w;IE=1;var n=Doe(),e=FZ();function t(r,s){return n(r,s,function(i,a){return e(r,a)})}return $w=t,$w}var Tw,HE;function Uoe(){if(HE)return Tw;HE=1;var n=O6(),e=i6(),t=a6();function r(s){return t(e(s,void 0,n),s+"")}return Tw=r,Tw}var jw,FE;function Woe(){if(FE)return jw;FE=1;var n=Boe(),e=Uoe(),t=e(function(r,s){return r==null?{}:n(r,s)});return jw=t,jw}var _w,KE;function Goe(){if(KE)return _w;KE=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),f=Array(u);u--;)f[a?u:++o]=r,r+=i;return f}return _w=t,_w}var Pw,JE;function Ioe(){if(JE)return Pw;JE=1;var n=Goe(),e=$O(),t=m6();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 Pw=r,Pw}var Nw,eA;function Hoe(){if(eA)return Nw;eA=1;var n=Ioe(),e=n();return Nw=e,Nw}var Cw,tA;function Foe(){if(tA)return Cw;tA=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return Cw=n,Cw}var Rw,nA;function Koe(){if(nA)return Rw;nA=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,f=r===null,p=r===r,m=n(r);if(!f&&!m&&!o&&t>r||o&&u&&p&&!f&&!m||i&&u&&p||!s&&p||!a)return 1;if(!i&&!o&&!m&&t<r||m&&s&&a&&!i&&!o||f&&s&&a||!u&&a||!p)return-1}return 0}return Rw=e,Rw}var Ew,rA;function Joe(){if(rA)return Ew;rA=1;var n=Koe();function e(t,r,s){for(var i=-1,a=t.criteria,o=r.criteria,u=a.length,f=s.length;++i<u;){var p=n(a[i],o[i]);if(p){if(i>=f)return p;var m=s[i];return p*(m=="desc"?-1:1)}}return t.index-r.index}return Ew=e,Ew}var Aw,sA;function ece(){if(sA)return Aw;sA=1;var n=wO(),e=QO(),t=Ji(),r=n6(),s=Foe(),i=xO(),a=Joe(),o=Hl(),u=jn();function f(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 Aw=f,Aw}var qw,iA;function tce(){if(iA)return qw;iA=1;var n=Lk(),e=ece(),t=kO(),r=$O(),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 qw=s,qw}var Mw,aA;function nce(){if(aA)return Mw;aA=1;var n=IZ(),e=0;function t(r){var s=++e;return n(r)+s}return Mw=t,Mw}var Xw,lA;function rce(){if(lA)return Xw;lA=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 Xw=n,Xw}var zw,oA;function sce(){if(oA)return zw;oA=1;var n=OO(),e=rce();function t(r,s){return e(r||[],s||[],n)}return zw=t,zw}var Lw,cA;function Ht(){if(cA)return Lw;cA=1;var n;if(typeof kk=="function")try{n={cloneDeep:yoe(),constant:Ak(),defaults:voe(),each:VZ(),filter:JZ(),find:joe(),flatten:O6(),forEach:ZZ(),forIn:_oe(),has:e6(),isUndefined:t6(),last:Poe(),map:r6(),mapValues:Noe(),max:Roe(),merge:zoe(),min:Loe(),minBy:Zoe(),now:Voe(),pick:Woe(),range:Hoe(),reduce:s6(),sortBy:tce(),uniqueId:nce(),values:c6(),zipObject:sce()}}catch{}return n||(n=window._),Lw=n,Lw}var Zw,uA;function ice(){if(uA)return Zw;uA=1,Zw=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 Zw}var Vw,dA;function ace(){if(dA)return Vw;dA=1;var n=Ht(),e=Rs().Graph,t=ice();Vw=s;var r=n.constant(1);function s(f,p){if(f.nodeCount()<=1)return[];var m=o(f,p||r),g=i(m.graph,m.buckets,m.zeroIdx);return n.flatten(n.map(g,function(x){return f.outEdges(x.v,x.w)}),!0)}function i(f,p,m){for(var g=[],x=p[p.length-1],v=p[0],y;f.nodeCount();){for(;y=v.dequeue();)a(f,p,m,y);for(;y=x.dequeue();)a(f,p,m,y);if(f.nodeCount()){for(var S=p.length-2;S>0;--S)if(y=p[S].dequeue(),y){g=g.concat(a(f,p,m,y,!0));break}}}return g}function a(f,p,m,g,x){var v=x?[]:void 0;return n.forEach(f.inEdges(g.v),function(y){var S=f.edge(y),Q=f.node(y.v);x&&v.push({v:y.v,w:y.w}),Q.out-=S,u(p,m,Q)}),n.forEach(f.outEdges(g.v),function(y){var S=f.edge(y),Q=y.w,k=f.node(Q);k.in-=S,u(p,m,k)}),f.removeNode(g.v),v}function o(f,p){var m=new e,g=0,x=0;n.forEach(f.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),n.forEach(f.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(f,p,m){m.out?m.in?f[m.out-m.in+p].enqueue(m):f[f.length-1].enqueue(m):f[0].enqueue(m)}return Vw}var Yw,fA;function lce(){if(fA)return Yw;fA=1;var n=Ht(),e=ace();Yw={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 f=i.edge(u);i.removeEdge(u),f.forwardName=u.name,f.reversed=!0,i.setEdge(u.w,u.v,f,n.uniqueId("rev"))});function o(u){return function(f){return u.edge(f).weight}}}function r(i){var a=[],o={},u={};function f(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):f(m.w)}),delete o[p])}return n.forEach(i.nodes(),f),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 Yw}var Dw,hA;function yr(){if(hA)return Dw;hA=1;var n=Ht(),e=Rs().Graph;Dw={addDummyNode:t,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:o,buildLayerMatrix:u,normalizeRanks:f,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 f(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 Dw}var Bw,pA;function oce(){if(pA)return Bw;pA=1;var n=Ht(),e=yr();Bw={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,f=a.w,p=i.node(f).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,f,{weight:g.weight},m)}}function s(i){n.forEach(i.graph().dummyChains,function(a){var o=i.node(a),u=o.edgeLabel,f;for(i.setEdge(o.edgeObj,u);o.dummy;)f=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=f,o=i.node(a)})}return Bw}var Uw,mA;function km(){if(mA)return Uw;mA=1;var n=Ht();Uw={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(f){return i(f.w)-r.edge(f).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 Uw}var Ww,OA;function y6(){if(OA)return Ww;OA=1;var n=Ht(),e=Rs().Graph,t=km().slack;Ww=r;function r(o){var u=new e({directed:!1}),f=o.nodes()[0],p=o.nodeCount();u.setNode(f,{});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 f(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,{}),f(x))})}return n.forEach(o.nodes(),f),o.nodeCount()}function i(o,u){return n.minBy(u.edges(),function(f){if(o.hasNode(f.v)!==o.hasNode(f.w))return t(u,f)})}function a(o,u,f){n.forEach(o.nodes(),function(p){u.node(p).rank+=f})}return Ww}var Gw,gA;function cce(){if(gA)return Gw;gA=1;var n=Ht(),e=y6(),t=km().slack,r=km().longestPath,s=Rs().alg.preorder,i=Rs().alg.postorder,a=yr().simplify;Gw=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){f($,j,R)})}function f($,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,D=V?E.w:E.v;if(D!==N){var C=V===q,G=j.edge(E).weight;if(L+=C?G:-G,Q($,T,D)){var A=$.edge(T,D).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(D){return E===k($,$.node(D.v),L)&&E!==k($,$.node(D.w),L)});return n.minBy(V,function(D){return t(j,D)})}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 Gw}var Iw,xA;function uce(){if(xA)return Iw;xA=1;var n=km(),e=n.longestPath,t=y6(),r=cce();Iw=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 Iw}var Hw,bA;function dce(){if(bA)return Hw;bA=1;var n=Ht();Hw=e;function e(s){var i=r(s);n.forEach(s.graph().dummyChains,function(a){for(var o=s.node(a),u=o.edgeObj,f=t(s,i,u.v,u.w),p=f.path,m=f.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=[],f=[],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;)f.push(g);return{path:u.concat(f.reverse()),lca:x}}function r(s){var i={},a=0;function o(u){var f=a;n.forEach(s.children(u),o),i[u]={low:f,lim:a++}}return n.forEach(s.children(),o),i}return Hw}var Fw,yA;function fce(){if(yA)return Fw;yA=1;var n=Ht(),e=yr();Fw={run:t,cleanup:a};function t(o){var u=e.addDummyNode(o,"root",{},"_root"),f=s(o),p=n.max(n.values(f))-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,f,x)}),o.graph().nodeRankFactor=m}function r(o,u,f,p,m,g,x){var v=o.children(x);if(!v.length){x!==u&&o.setEdge(u,x,{weight:0,minlen:f});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,f,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 f(p,m){var g=o.children(p);g&&g.length&&n.forEach(g,function(x){f(x,m+1)}),u[p]=m}return n.forEach(o.children(),function(p){f(p,1)}),u}function i(o){return n.reduce(o.edges(),function(u,f){return u+o.edge(f).weight},0)}function a(o){var u=o.graph();o.removeNode(u.nestingRoot),delete u.nestingRoot,n.forEach(o.edges(),function(f){var p=o.edge(f);p.nestingEdge&&o.removeEdge(f)})}return Fw}var Kw,vA;function hce(){if(vA)return Kw;vA=1;var n=Ht(),e=yr();Kw=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 f=u.minRank,p=u.maxRank+1;f<p;++f)r(s,"borderLeft","_bl",a,u,f),r(s,"borderRight","_br",a,u,f)}}n.forEach(s.children(),i)}function r(s,i,a,o,u,f){var p={width:0,height:0,rank:f,borderType:i},m=u[i][f-1],g=e.addDummyNode(s,"border",p,a);u[i][f]=g,s.setParent(g,o),m&&s.setEdge(m,g,{weight:1})}return Kw}var Jw,wA;function pce(){if(wA)return Jw;wA=1;var n=Ht();Jw={adjust:e,undo:t};function e(f){var p=f.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&r(f)}function t(f){var p=f.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&i(f),(p==="lr"||p==="rl")&&(o(f),r(f))}function r(f){n.forEach(f.nodes(),function(p){s(f.node(p))}),n.forEach(f.edges(),function(p){s(f.edge(p))})}function s(f){var p=f.width;f.width=f.height,f.height=p}function i(f){n.forEach(f.nodes(),function(p){a(f.node(p))}),n.forEach(f.edges(),function(p){var m=f.edge(p);n.forEach(m.points,a),n.has(m,"y")&&a(m)})}function a(f){f.y=-f.y}function o(f){n.forEach(f.nodes(),function(p){u(f.node(p))}),n.forEach(f.edges(),function(p){var m=f.edge(p);n.forEach(m.points,u),n.has(m,"x")&&u(m)})}function u(f){var p=f.x;f.x=f.y,f.y=p}return Jw}var eS,SA;function mce(){if(SA)return eS;SA=1;var n=Ht();eS=e;function e(t){var r={},s=n.filter(t.nodes(),function(f){return!t.children(f).length}),i=n.max(n.map(s,function(f){return t.node(f).rank})),a=n.map(n.range(i+1),function(){return[]});function o(f){if(!n.has(r,f)){r[f]=!0;var p=t.node(f);a[p.rank].push(f),n.forEach(t.successors(f),o)}}var u=n.sortBy(s,function(f){return t.node(f).rank});return n.forEach(u,o),a}return eS}var tS,QA;function Oce(){if(QA)return tS;QA=1;var n=Ht();tS=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 f=2*u-1;u-=1;var p=n.map(new Array(f),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 tS}var nS,kA;function gce(){if(kA)return nS;kA=1;var n=Ht();nS=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 f=t.edge(u),p=t.node(u.v);return{sum:o.sum+f.weight*p.order,weight:o.weight+f.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return nS}var rS,$A;function xce(){if($A)return rS;$A=1;var n=Ht();rS=e;function e(s,i){var a={};n.forEach(s,function(u,f){var p=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:f};n.isUndefined(u.barycenter)||(p.barycenter=u.barycenter,p.weight=u.weight)}),n.forEach(i.edges(),function(u){var f=a[u.v],p=a[u.w];!n.isUndefined(f)&&!n.isUndefined(p)&&(p.indegree++,f.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(f){return function(p){p.merged||(n.isUndefined(p.barycenter)||n.isUndefined(f.barycenter)||p.barycenter>=f.barycenter)&&r(f,p)}}function o(f){return function(p){p.in.push(f),--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(f){return!f.merged}),function(f){return n.pick(f,["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 rS}var sS,TA;function bce(){if(TA)return sS;TA=1;var n=Ht(),e=yr();sS=t;function t(i,a){var o=e.partition(i,function(y){return n.has(y,"barycenter")}),u=o.lhs,f=n.sortBy(o.rhs,function(y){return-y.i}),p=[],m=0,g=0,x=0;u.sort(s(!!a)),x=r(p,f,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,f,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 sS}var iS,jA;function yce(){if(jA)return iS;jA=1;var n=Ht(),e=gce(),t=xce(),r=bce();iS=s;function s(o,u,f,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,f,p);y[T.v]=R,n.has(R,"barycenter")&&a(T,R)}});var Q=t(S,f);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(f){f.vs=n.flatten(f.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 iS}var aS,_A;function vce(){if(_A)return aS;_A=1;var n=Ht(),e=Rs().Graph;aS=t;function t(s,i,a){var o=r(s),u=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(f){return s.node(f)});return n.forEach(s.nodes(),function(f){var p=s.node(f),m=s.parent(f);(p.rank===i||p.minRank<=i&&i<=p.maxRank)&&(u.setNode(f),u.setParent(f,m||o),n.forEach(s[a](f),function(g){var x=g.v===f?g.w:g.v,v=u.edge(x,f),y=n.isUndefined(v)?0:v.weight;u.setEdge(x,f,{weight:s.edge(g).weight+y})}),n.has(p,"minRank")&&u.setNode(f,{borderLeft:p.borderLeft[i],borderRight:p.borderRight[i]}))}),u}function r(s){for(var i;s.hasNode(i=n.uniqueId("_root")););return i}return aS}var lS,PA;function wce(){if(PA)return lS;PA=1;var n=Ht();lS=e;function e(t,r,s){var i={},a;n.forEach(s,function(o){for(var u=t.parent(o),f,p;u;){if(f=t.parent(u),f?(p=i[f],i[f]=u):(p=a,a=u),p&&p!==u){r.setEdge(p,u);return}u=f}})}return lS}var oS,NA;function Sce(){if(NA)return oS;NA=1;var n=Ht(),e=mce(),t=Oce(),r=yce(),s=vce(),i=wce(),a=Rs().Graph,o=yr();oS=u;function u(g){var x=o.maxRank(g),v=f(g,n.range(1,x+1),"inEdges"),y=f(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 f(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 oS}var cS,CA;function Qce(){if(CA)return cS;CA=1;var n=Ht(),e=Rs().Graph,t=yr();cS={positionX:v,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:o,verticalAlignment:u,horizontalCompaction:f,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 D=i(Q,E),C=D?Q.node(D).order:z;(D||E===L)&&(n.forEach(R.slice(q,V+1),function(G){n.forEach(Q.predecessors(G),function(A){var W=Q.node(A),H=W.order;(H<N||C<H)&&!(W.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(D){var C=Q.node(D);C.dummy&&(C.order<z||C.order>L)&&a($,D,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 D=Q.predecessors(E);D.length&&(z=Q.node(D[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,D=Math.floor(V),C=Math.ceil(V);D<=C;++D){var G=E[D];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 f(Q,k,$,j,T){var R={},N=p(Q,k,$,T),q=T?"borderLeft":"borderRight";function z(V,D){for(var C=N.nodes(),G=C.pop(),A={};G;)A[G]?V(G):(A[G]=!0,C.push(G),C=C.concat(D(G))),G=C.pop()}function L(V){R[V]=N.inEdges(V).reduce(function(D,C){return Math.max(D,R[C.v]+N.edge(C))},0)}function E(V){var D=N.outEdges(V).reduce(function(G,A){return Math.min(G,R[A.w]-N.edge(A))},Number.POSITIVE_INFINITY),C=Q.node(V);D!==Number.POSITIVE_INFINITY&&C.borderType!==q&&(R[V]=Math.max(R[V],D))}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],D=T.edge(V,E);T.setEdge(V,E,Math.max(N(Q,L,z),D||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=f(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 cS}var uS,RA;function kce(){if(RA)return uS;RA=1;var n=Ht(),e=yr(),t=Qce().positionX;uS=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(f){var p=n.max(n.map(f,function(m){return i.node(m).height}));n.forEach(f,function(m){i.node(m).y=u+p/2}),u+=p+o})}return uS}var dS,EA;function $ce(){if(EA)return dS;EA=1;var n=Ht(),e=lce(),t=oce(),r=uce(),s=yr().normalizeRanks,i=dce(),a=yr().removeEmptyRanks,o=fce(),u=hce(),f=pce(),p=Sce(),m=kce(),g=yr(),x=Rs().Graph;dS=v;function v(Z,I){var J=I&&I.debugTiming?g.time:g.notime;J("layout",function(){var ne=J(" buildLayoutGraph",function(){return z(Z)});J(" runLayout",function(){y(ne,J)}),J(" updateInputGraph",function(){S(Z,ne)})})}function y(Z,I){I(" makeSpaceForEdgeLabels",function(){L(Z)}),I(" removeSelfEdges",function(){U(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(){D(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(){ee(Z)}),I(" adjustCoordinateSystem",function(){f.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(){f.undo(Z)}),I(" translateGraph",function(){C(Z)}),I(" assignNodeIntersects",function(){G(Z)}),I(" reversePoints",function(){W(Z)}),I(" acyclic.undo",function(){e.undo(Z)})}function S(Z,I){n.forEach(Z.nodes(),function(J){var ne=Z.node(J),ce=I.node(J);ne&&(ne.x=ce.x,ne.y=ce.y,I.children(J).length&&(ne.width=ce.width,ne.height=ce.height))}),n.forEach(Z.edges(),function(J){var ne=Z.edge(J),ce=I.edge(J);ne.points=ce.points,n.has(ce,"x")&&(ne.x=ce.x,ne.y=ce.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}),J=K(Z.graph());return I.setGraph(n.merge({},k,B(J,Q),n.pick(J,$))),n.forEach(Z.nodes(),function(ne){var ce=K(Z.node(ne));I.setNode(ne,n.defaults(B(ce,j),T)),I.setParent(ne,Z.parent(ne))}),n.forEach(Z.edges(),function(ne){var ce=K(Z.edge(ne));I.setEdge(ne,n.merge({},N,B(ce,R),n.pick(ce,q)))}),I}function L(Z){var I=Z.graph();I.ranksep/=2,n.forEach(Z.edges(),function(J){var ne=Z.edge(J);ne.minlen*=2,ne.labelpos.toLowerCase()!=="c"&&(I.rankdir==="TB"||I.rankdir==="BT"?ne.width+=ne.labeloffset:ne.height+=ne.labeloffset)})}function E(Z){n.forEach(Z.edges(),function(I){var J=Z.edge(I);if(J.width&&J.height){var ne=Z.node(I.v),ce=Z.node(I.w),xe={rank:(ce.rank-ne.rank)/2+ne.rank,e:I};g.addDummyNode(Z,"edge-proxy",xe,"_ep")}})}function V(Z){var I=0;n.forEach(Z.nodes(),function(J){var ne=Z.node(J);ne.borderTop&&(ne.minRank=Z.node(ne.borderTop).rank,ne.maxRank=Z.node(ne.borderBottom).rank,I=n.max(I,ne.maxRank))}),Z.graph().maxRank=I}function D(Z){n.forEach(Z.nodes(),function(I){var J=Z.node(I);J.dummy==="edge-proxy"&&(Z.edge(J.e).labelRank=J.rank,Z.removeNode(I))})}function C(Z){var I=Number.POSITIVE_INFINITY,J=0,ne=Number.POSITIVE_INFINITY,ce=0,xe=Z.graph(),ke=xe.marginx||0,Me=xe.marginy||0;function se(be){var Oe=be.x,ye=be.y,Fe=be.width,Te=be.height;I=Math.min(I,Oe-Fe/2),J=Math.max(J,Oe+Fe/2),ne=Math.min(ne,ye-Te/2),ce=Math.max(ce,ye+Te/2)}n.forEach(Z.nodes(),function(be){se(Z.node(be))}),n.forEach(Z.edges(),function(be){var Oe=Z.edge(be);n.has(Oe,"x")&&se(Oe)}),I-=ke,ne-=Me,n.forEach(Z.nodes(),function(be){var Oe=Z.node(be);Oe.x-=I,Oe.y-=ne}),n.forEach(Z.edges(),function(be){var Oe=Z.edge(be);n.forEach(Oe.points,function(ye){ye.x-=I,ye.y-=ne}),n.has(Oe,"x")&&(Oe.x-=I),n.has(Oe,"y")&&(Oe.y-=ne)}),xe.width=J-I+ke,xe.height=ce-ne+Me}function G(Z){n.forEach(Z.edges(),function(I){var J=Z.edge(I),ne=Z.node(I.v),ce=Z.node(I.w),xe,ke;J.points?(xe=J.points[0],ke=J.points[J.points.length-1]):(J.points=[],xe=ce,ke=ne),J.points.unshift(g.intersectRect(ne,xe)),J.points.push(g.intersectRect(ce,ke))})}function A(Z){n.forEach(Z.edges(),function(I){var J=Z.edge(I);if(n.has(J,"x"))switch((J.labelpos==="l"||J.labelpos==="r")&&(J.width-=J.labeloffset),J.labelpos){case"l":J.x-=J.width/2+J.labeloffset;break;case"r":J.x+=J.width/2+J.labeloffset;break}})}function W(Z){n.forEach(Z.edges(),function(I){var J=Z.edge(I);J.reversed&&J.points.reverse()})}function H(Z){n.forEach(Z.nodes(),function(I){if(Z.children(I).length){var J=Z.node(I),ne=Z.node(J.borderTop),ce=Z.node(J.borderBottom),xe=Z.node(n.last(J.borderLeft)),ke=Z.node(n.last(J.borderRight));J.width=Math.abs(ke.x-xe.x),J.height=Math.abs(ce.y-ne.y),J.x=xe.x+J.width/2,J.y=ne.y+J.height/2}}),n.forEach(Z.nodes(),function(I){Z.node(I).dummy==="border"&&Z.removeNode(I)})}function U(Z){n.forEach(Z.edges(),function(I){if(I.v===I.w){var J=Z.node(I.v);J.selfEdges||(J.selfEdges=[]),J.selfEdges.push({e:I,label:Z.edge(I)}),Z.removeEdge(I)}})}function ee(Z){var I=g.buildLayerMatrix(Z);n.forEach(I,function(J){var ne=0;n.forEach(J,function(ce,xe){var ke=Z.node(ce);ke.order=xe+ne,n.forEach(ke.selfEdges,function(Me){g.addDummyNode(Z,"selfedge",{width:Me.label.width,height:Me.label.height,rank:ke.rank,order:xe+ ++ne,e:Me.e,label:Me.label},"_se")}),delete ke.selfEdges})})}function X(Z){n.forEach(Z.nodes(),function(I){var J=Z.node(I);if(J.dummy==="selfedge"){var ne=Z.node(J.e.v),ce=ne.x+ne.width/2,xe=ne.y,ke=J.x-ce,Me=ne.height/2;Z.setEdge(J.e,J.label),Z.removeNode(I),J.label.points=[{x:ce+2*ke/3,y:xe-Me},{x:ce+5*ke/6,y:xe-Me},{x:ce+ke,y:xe},{x:ce+5*ke/6,y:xe+Me},{x:ce+2*ke/3,y:xe+Me}],J.label.x=J.x,J.label.y=J.y}})}function B(Z,I){return n.mapValues(n.pick(Z,I),Number)}function K(Z){var I={};return n.forEach(Z,function(J,ne){I[ne.toLowerCase()]=J}),I}return dS}var fS,AA;function Tce(){if(AA)return fS;AA=1;var n=Ht(),e=yr(),t=Rs().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 f="layer"+u;a.setNode(f,{rank:"same"}),n.reduce(o,function(p,m){return a.setEdge(p,m,{style:"invis"}),m})}),a}return fS}var hS,qA;function jce(){return qA||(qA=1,hS="0.8.5"),hS}var pS,MA;function _ce(){return MA||(MA=1,pS={graphlib:Rs(),layout:$ce(),debug:Tce(),util:{time:yr().time,notime:yr().notime},version:jce()}),pS}var Pce=_ce();const XA=$m(Pce),Ir=({content:n,children:e})=>d.jsxs("div",{className:"relative group flex items-center",children:[e,d.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})]}),Nce=({data:n,selected:e,xPos:t,yPos:r})=>{var k,$;const{label:s,module:i,promptInfo:a,hasPrompt:o,colors:u,onClick:f,editMode:p,onEdit:m,isHighlighted:g}=n,x=!!(a!=null&&a.code),v=!!(a!=null&&a.test),y=!!(a!=null&&a.example),S=()=>{f&&f(i)},Q=j=>{j.stopPropagation(),m&&m(i)};return d.jsxs(d.Fragment,{children:[d.jsx(kc,{type:"target",position:Le.Top,className:"!bg-blue-400 !w-2 !h-2"}),d.jsx(Ir,{content:d.jsxs("div",{className:"max-w-xs",children:[d.jsx("div",{className:"font-medium",children:i.filename}),d.jsx("div",{className:"text-xs text-surface-400 mt-1",children:i.filepath}),d.jsxs("div",{className:"text-xs mt-2",children:[(k=i.description)==null?void 0:k.substring(0,100),"..."]}),o&&d.jsxs("div",{className:"mt-2 pt-2 border-t border-surface-700/50",children:[d.jsxs("div",{className:"text-xs text-emerald-400 flex items-center gap-1 mb-1",children:[d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Prompt exists"]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs mt-1",children:[d.jsxs("span",{className:x?"text-green-400":"text-surface-500",children:[x?"✓":"✗"," Code"]}),d.jsxs("span",{className:v?"text-yellow-400":"text-surface-500",children:[v?"✓":"✗"," Test"]}),d.jsxs("span",{className:y?"text-blue-400":"text-surface-500",children:[y?"✓":"✗"," Example"]})]})]})]}),children:d.jsxs("div",{onClick:S,className:`
|
|
336
|
+
relative px-4 py-3 rounded-xl border cursor-pointer
|
|
337
|
+
transition-all duration-200 hover:scale-105 group
|
|
338
|
+
${u.bg} ${u.border} ${u.hover}
|
|
339
|
+
${o?"ring-2 ring-emerald-500/50":""}
|
|
340
|
+
${e?"ring-2 ring-accent-500":""}
|
|
341
|
+
${g?"ring-2 ring-red-500 animate-pulse":""}
|
|
342
|
+
`,style:{width:200,minHeight:85},children:[p&&d.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:d.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.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:d.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),o&&d.jsxs("div",{className:"absolute -bottom-1.5 right-1 flex gap-0.5 z-10",children:[d.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"}),d.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"}),d.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"})]}),d.jsx("p",{className:"font-medium text-sm text-white truncate w-full",children:s}),!1,d.jsx("p",{className:`text-xs ${u.text} truncate w-full`,children:(($=i.interface)==null?void 0:$.type)||"module"}),d.jsxs("p",{className:"text-xs text-surface-500 truncate w-full",children:["Priority: ",i.priority]})]})}),d.jsx(kc,{type:"source",position:Le.Bottom,className:"!bg-blue-400 !w-2 !h-2"})]})},Cce=P.memo(Nce),zA=200,LA=85,Rce=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"},Ece=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 XA.graphlib.Graph;return r.setGraph({rankdir:t,nodesep:50,ranksep:100,edgesep:20}),r.setDefaultEdgeLabel(()=>({})),n.forEach(i=>{r.setNode(i.id,{width:zA,height:LA})}),e.forEach(i=>{r.setEdge(i.source,i.target)}),XA.layout(r),{nodes:n.map(i=>{const a=r.node(i.id);return{...i,position:{x:a.x-zA/2,y:a.y-LA/2}}}),edges:e}},Ace={moduleNode:Cce},qce=({architecture:n,prdContent:e,appName:t,onRegenerate:r,onModuleClick:s,onGeneratePrompts:i,isGeneratingPrompts:a=!1,existingPrompts:o=new Set,promptsInfo:u=[],editMode:f=!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 J=I.prompt.split("/").pop()||"";Z.set(J,I)}return Z},[u]),{initialNodes:T,initialEdges:R}=P.useMemo(()=>{const Z=n.some(ce=>ce.position),I=n.map(ce=>{const xe=Rce(ce),ke=o.has(ce.filename),Me=y.has(ce.filename);return{id:ce.filename,type:"moduleNode",position:ce.position||{x:0,y:0},data:{label:ce.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,""),module:ce,promptInfo:j.get(ce.filename),hasPrompt:ke,colors:Ece(xe),onClick:s,editMode:f,onEdit:p,onDelete:m,isHighlighted:Me}}}),J=new Set(n.map(ce=>ce.filename)),ne=n.flatMap(ce=>ce.dependencies.filter(xe=>J.has(xe)).map(xe=>({id:`${xe}->${ce.filename}`,source:xe,target:ce.filename,type:"smoothstep",style:{stroke:"#60a5fa",strokeWidth:2},markerEnd:{type:Pl.ArrowClosed,color:"#60a5fa",width:20,height:20},animated:!1,selectable:f,focusable:f,deletable:f,interactionWidth:20})));if(!Z){const ce=ZA(I,ne,"TB");return{initialNodes:ce.nodes,initialEdges:ce.edges}}return{initialNodes:I,initialEdges:ne}},[n,o,j,s,f,p,m,y]),[N,q,z]=Die(T),[L,E,V]=Bie(R),D=P.useCallback(()=>{const Z=ZA(N,L,"TB");q(Z.nodes),E(Z.edges)},[N,L,q,E]),C=P.useCallback(Z=>{!f||!Z.source||!Z.target||(g==null||g(Z.target,Z.source),E(I=>AL({...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)))},[f,g,E]),G=P.useCallback(Z=>{if(f)for(const I of Z)x==null||x(I.target,I.source)},[f,x]),A=P.useCallback((Z,I)=>{f&&($(null),E(J=>J.map(ne=>({...ne,selected:ne.id===I.id,style:{...ne.style,stroke:ne.id===I.id?"#ef4444":"#60a5fa",strokeWidth:ne.id===I.id?3:2},markerEnd:ne.markerEnd?{...ne.markerEnd,color:ne.id===I.id?"#ef4444":"#60a5fa"}:void 0}))))},[f,E]),W=P.useCallback((Z,I)=>{f&&(Z.preventDefault(),$({x:Z.clientX,y:Z.clientY,edge:I}))},[f]),H=P.useCallback(()=>{if(!k)return;const Z=k.edge;x==null||x(Z.target,Z.source),E(I=>I.filter(J=>J.id!==Z.id)),$(null)},[k,x,E]),U=P.useCallback(()=>{$(null)},[]),ee=P.useCallback(Z=>{if(f)for(const I of Z)m==null||m(I.id)},[f,m]),X=P.useCallback((Z,I,J)=>{if(!f)return;const ne=new Map;J.forEach(ce=>{ne.set(ce.id,{x:ce.position.x,y:ce.position.y})}),v==null||v(ne)},[f,v]),B=ue.useRef(n),K=P.useCallback(Z=>Z.map(I=>({filename:I.filename,dependencies:[...I.dependencies].sort().join(",")})).sort((I,J)=>I.filename.localeCompare(J.filename)).map(I=>`${I.filename}:${I.dependencies}`).join("|"),[]);return ue.useEffect(()=>{const Z=K(B.current),I=K(n),J=Z!==I;B.current=n,(J||!f)&&(q(T),E(R))},[T,R,q,E,f,n,K]),d.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 overflow-hidden h-full flex flex-col",children:[d.jsxs("div",{className:"bg-surface-800/80 border-b border-surface-700/50 flex-shrink-0",children:[d.jsxs("div",{className:"flex justify-between items-center p-3",children:[d.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>Q(!S),children:[d.jsx("h3",{className:"font-semibold text-sm text-white",children:t||"Product Requirements Document"}),d.jsxs("p",{className:"text-xs text-surface-400",children:[n.length," modules"]})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-4",children:[i&&d.jsx(Ir,{content:"Generate prompt files for all modules",children:d.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?d.jsx(Od,{className:"w-3.5 h-3.5 animate-spin"}):d.jsx(BJ,{className:"w-3.5 h-3.5"}),d.jsx("span",{children:a?"Generating...":"Generate Prompts"})]})}),d.jsx(Ir,{content:"Regenerate architecture from PRD",children:d.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:[d.jsx(Dz,{className:"w-3.5 h-3.5"}),d.jsx("span",{children:"Regenerate"})]})}),d.jsx(Ir,{content:S?"Collapse":"Expand",children:d.jsx("button",{onClick:()=>Q(!S),className:"p-1.5 rounded-lg hover:bg-surface-700 transition-colors",children:S?d.jsx(mm,{className:"w-4 h-4 text-surface-400"}):d.jsx(Om,{className:"w-4 h-4 text-surface-400"})})})]})]}),S&&d.jsx("div",{className:"border-t border-surface-700/50",children:d.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"})})]}),d.jsx("div",{className:"flex-1 min-h-0",children:d.jsxs(OZ,{nodes:N,edges:L,onNodesChange:z,onEdgesChange:V,onConnect:f?C:void 0,onEdgeClick:f?A:void 0,onEdgeContextMenu:f?W:void 0,onPaneClick:U,onNodeDragStop:f?X:void 0,onEdgesDelete:f?G:void 0,onNodesDelete:f?ee:void 0,nodeTypes:Ace,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:f?Hi.Loose:Hi.Strict,deleteKeyCode:f?["Backspace","Delete"]:null,edgesUpdatable:f,edgesFocusable:f,elementsSelectable:f,selectNodesOnDrag:!1,proOptions:{hideAttribution:!0},children:[d.jsx(pae,{variant:ss.Dots,gap:20,size:1,color:"#374151"}),d.jsx(oae,{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"}),d.jsx(tae,{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)"}),d.jsx(lO,{position:"bottom-right",className:"!m-4",children:d.jsxs("div",{className:"bg-surface-800/90 rounded-lg p-3 border border-surface-700/50 backdrop-blur-sm",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("p",{className:"text-xs text-surface-400 font-medium",children:"Legend"}),d.jsx("button",{onClick:D,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"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded bg-orange-500/40 border border-orange-500/50"}),d.jsx("span",{className:"text-xs text-surface-300",children:"Frontend"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded bg-blue-500/40 border border-blue-500/50"}),d.jsx("span",{className:"text-xs text-surface-300",children:"Backend"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded bg-green-500/40 border border-green-500/50"}),d.jsx("span",{className:"text-xs text-surface-300",children:"Shared"})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-surface-700/50 mt-1",children:[d.jsx("div",{className:"w-3 h-3 rounded-full bg-emerald-500 flex items-center justify-center",children:d.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:"text-xs text-surface-300",children:"Prompt exists"})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-surface-700/50 mt-1",children:[d.jsxs("div",{className:"flex gap-0.5",children:[d.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"}),d.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"}),d.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"})]}),d.jsx("span",{className:"text-xs text-surface-300",children:"Code/Test/Example"})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-surface-700/50 mt-1",children:[d.jsx("div",{className:"flex items-center",children:d.jsxs("svg",{className:"w-6 h-3",viewBox:"0 0 24 12",children:[d.jsx("defs",{children:d.jsx("marker",{id:"arrow-legend",markerWidth:"10",markerHeight:"10",refX:"8",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:d.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#60a5fa"})})}),d.jsx("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:"#60a5fa",strokeWidth:"2",markerEnd:"url(#arrow-legend)"})]})}),d.jsx("span",{className:"text-xs text-surface-300",children:"Arrow shows dependency direction"})]}),f&&d.jsx("div",{className:"pt-1 border-t border-surface-700/50 mt-1",children:d.jsxs("p",{className:"text-[10px] text-surface-400 leading-relaxed",children:[d.jsx("span",{className:"text-orange-400",children:"Edit mode:"})," Right-click edge to delete, or click + Delete/Backspace"]})})]})]})})]})}),k&&d.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:[d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsx("div",{className:"px-4 py-2 text-xs text-surface-500 border-t border-surface-700",children:d.jsxs("div",{className:"font-mono",children:[k.edge.source," → ",k.edge.target]})})]})]})},Mce=({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 d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:i?r:void 0}),d.jsxs("div",{className:"relative glass rounded-2xl border border-surface-700/50 p-6 max-w-md w-full mx-4 shadow-2xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:i?"Generation Complete":"Generating Prompts"}),i&&d.jsx("button",{onClick:r,className:"p-1.5 hover:bg-surface-700 rounded-lg transition-colors",children:d.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e&&!i&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"relative h-2 bg-surface-700 rounded-full overflow-hidden",children:d.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}%`}})}),d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsxs("span",{className:"text-surface-400",children:["Generating prompt ",e.current," of ",e.total]}),d.jsxs("span",{className:"text-white font-medium",children:[Math.round(e.current/e.total*100),"%"]})]}),d.jsxs("div",{className:"flex items-center gap-2 p-3 bg-surface-800/50 rounded-lg",children:[d.jsx(Od,{className:"w-4 h-4 text-emerald-400 animate-spin"}),d.jsx("span",{className:"text-sm text-surface-300 truncate",children:e.currentModule})]}),s&&d.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&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-4 p-3 bg-surface-800/50 rounded-lg",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded-full bg-emerald-500"}),d.jsxs("span",{className:"text-sm text-surface-300",children:[a," succeeded"]})]}),o>0&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),d.jsxs("span",{className:"text-sm text-surface-300",children:[o," failed"]})]})]}),d.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2",children:t.map((u,f)=>d.jsxs("div",{className:`flex items-start gap-2 p-2 rounded-lg ${u.success?"bg-emerald-500/10":"bg-red-500/10"}`,children:[d.jsx("div",{className:"flex-shrink-0 mt-0.5",children:u.success?d.jsx(DJ,{className:"w-4 h-4 text-emerald-400"}):d.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("span",{className:`text-sm ${u.success?"text-emerald-300":"text-red-300"}`,children:[u.module,".prompt"]}),u.error&&d.jsx("p",{className:"text-xs text-red-400 mt-1 truncate",children:u.error})]})]},f))}),d.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 VA(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const YA=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`modal-option-${n.name}`;if(n.type==="checkbox")return d.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:[d.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"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:VA(n.name)}),d.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 d.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:VA(n.name)}),d.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})]}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),d.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:f=>t(parseFloat(f.target.value)),className:`flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500
|
|
343
|
+
[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4
|
|
344
|
+
[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent-500
|
|
345
|
+
[&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-accent-500/30
|
|
346
|
+
[&::-webkit-slider-thumb]:hover:bg-accent-400 [&::-webkit-slider-thumb]:transition-colors`}),d.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return null},Xce=({isOpen:n,modules:e,existingPrompts:t=new Set,globalOptions:r,onGlobalOptionsChange:s,onClose:i,onConfirm:a})=>{const[o,u]=P.useState(!1),[f,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=f.filter(R=>R.selected).map(R=>R.module);a(T)},[f,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=f.filter(T=>T.selected).length;return n?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:i}),d.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:[d.jsxs("div",{className:"p-4 border-b border-surface-700",children:[d.jsx("h2",{className:"text-lg font-semibold text-white",children:"Configure Prompt Generation"}),d.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."})]}),d.jsxs("div",{className:"px-4 py-2 border-b border-surface-700/50 flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.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"}),d.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"}),d.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"})]}),d.jsxs("span",{className:"text-xs text-surface-400",children:[j," of ",f.length," selected"]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:d.jsx("div",{className:"space-y-1",children:f.map((T,R)=>{var N,q;return d.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:[d.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"}),d.jsx("span",{className:"w-6 text-center text-xs font-mono text-surface-500",children:T.selected?f.filter((z,L)=>L<=R&&z.selected).length:"-"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-medium text-sm text-white truncate",children:k(T.module)}),d.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&&d.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:[d.jsx("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"exists"]})]}),d.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?"...":""]})]}),d.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"}),d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.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:d.jsx("svg",{className:"w-3 h-3 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),d.jsx("button",{onClick:()=>x(R),disabled:R===f.length-1,className:"p-1 hover:bg-surface-600 rounded disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Move down",children:d.jsx("svg",{className:"w-3 h-3 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]},T.module.filename)})})}),d.jsxs("div",{className:"border-t border-surface-700/50",children:[d.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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),(r.strength!==cn.strength||r.temperature!==cn.temperature||r.time!==cn.time||r.local||r.verbose||r.quiet||r.force)&&d.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&d.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[d.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),hr.filter(T=>["strength","temperature","time"].includes(T.name)).map(T=>d.jsx(YA,{option:T,value:r[T.name],onChange:R=>s({...r,[T.name]:R}),compact:!0},T.name))]}),d.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),hr.filter(T=>["local","verbose","quiet","force"].includes(T.name)).map(T=>d.jsx(YA,{option:T,value:r[T.name],onChange:R=>s({...r,[T.name]:R}),compact:!0},T.name))]})]})]}),d.jsxs("div",{className:"p-4 border-t border-surface-700 flex items-center justify-between",children:[d.jsx("p",{className:"text-xs text-surface-500",children:"Dependencies are not automatically resolved. Ensure correct order."}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.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"}),d.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},zce=({editMode:n,hasUnsavedChanges:e,onToggleEditMode:t,onAddModule:r,onSave:s,onDiscard:i,onUndo:a,onRedo:o,canUndo:u,canRedo:f,isSaving:p=!1,onSyncFromPrompts:m})=>d.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&&d.jsxs(d.Fragment,{children:[d.jsx(Ir,{content:"Sync architecture.json from prompt metadata tags",children:d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:"Sync from Prompts"})]})}),d.jsx("div",{className:"w-px h-6 bg-surface-700"})]}),d.jsx(Ir,{content:n?"Exit edit mode":"Enter edit mode",children:d.jsxs("button",{onClick:t,className:`
|
|
347
|
+
flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors
|
|
348
|
+
${n?"bg-accent-600 text-white hover:bg-accent-500":"bg-surface-700 text-surface-300 hover:bg-surface-600"}
|
|
349
|
+
`,children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:n?"Editing":"Edit"})]})}),n&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-px h-6 bg-surface-700"}),d.jsx(Ir,{content:"Add new module (N)",children:d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),d.jsx("span",{children:"Add Module"})]})}),d.jsx("div",{className:"w-px h-6 bg-surface-700"}),d.jsx(Ir,{content:"Undo (Ctrl+Z)",children:d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})})}),d.jsx(Ir,{content:"Redo (Ctrl+Shift+Z)",children:d.jsx("button",{onClick:o,disabled:!f,className:"p-1.5 rounded-lg text-surface-300 hover:bg-surface-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a8 8 0 00-8 8v2m18-10l-6 6m6-6l-6-6"})})})}),e&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-px h-6 bg-surface-700"}),d.jsxs("span",{className:"text-xs text-yellow-400 flex items-center gap-1",children:[d.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"]}),d.jsx(Ir,{content:"Save changes (Ctrl+S)",children:d.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?d.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.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"})]}):d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:p?"Saving...":"Save"})]})}),d.jsx(Ir,{content:"Discard changes (Escape)",children:d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),d.jsx("span",{children:"Discard"})]})})]})]})]}),Lce=["module","component","page","api","graphql","cli","job","message","config"],Zce=({isOpen:n,module:e,allModules:t,onSave:r,onDelete:s,onClose:i})=>{const[a,o]=P.useState(""),[u,f]=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(D=>D.filename!==(e==null?void 0:e.filename)),[t,e]);P.useEffect(()=>{var D,C;e&&(o(e.filename),f(e.filepath),m(e.description),x(e.reason),y(e.priority),Q(((D=e.tags)==null?void 0:D.join(", "))||""),$(((C=e.interface)==null?void 0:C.type)||"module"),T(e.dependencies||[]),N(!1))},[e]);const z=P.useMemo(()=>{const D=[];return a.trim()||D.push("Filename is required"),u.trim()||D.push("Filepath is required"),p.trim()||D.push("Description is required"),e&&a!==e.filename&&t.some(C=>C.filename===a)&&D.push("Filename already exists"),D},[a,u,p,e,t]),L=()=>{if(z.length>0)return;const D={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(D),i()},E=()=>{e&&(s(e.filename),i())},V=D=>{T(C=>C.includes(D)?C.filter(G=>G!==D):[...C,D])};return!n||!e?null:d.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:d.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:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-surface-700",children:[d.jsx("h2",{className:"text-lg font-semibold text-white",children:"Edit Module"}),d.jsx("button",{onClick:i,className:"p-1.5 rounded-lg hover:bg-surface-700 transition-colors",children:d.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Filename ",d.jsx("span",{className:"text-red-400",children:"*"})]}),d.jsx("input",{type:"text",value:a,onChange:D=>o(D.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"})]}),d.jsx(ei,{label:"Filepath",value:u,onChange:f,placeholder:"e.g., src/api/user.py",description:"Target path for the generated code",required:!0,title:"Select Output Path"}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Description ",d.jsx("span",{className:"text-red-400",children:"*"})]}),d.jsx("textarea",{value:p,onChange:D=>m(D.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Reason"}),d.jsx("input",{type:"text",value:g,onChange:D=>x(D.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"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Priority"}),d.jsx("input",{type:"number",value:v,onChange:D=>y(parseInt(D.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Interface Type"}),d.jsx("select",{value:k,onChange:D=>$(D.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:Lce.map(D=>d.jsx("option",{value:D,children:D},D))})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Tags ",d.jsx("span",{className:"text-surface-500",children:"(comma-separated)"})]}),d.jsx("input",{type:"text",value:S,onChange:D=>Q(D.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"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:["Dependencies ",d.jsxs("span",{className:"text-surface-500",children:["(",j.length," selected)"]})]}),d.jsx("div",{className:"bg-surface-900 border border-surface-700 rounded-lg p-2 max-h-40 overflow-y-auto",children:q.length===0?d.jsx("p",{className:"text-sm text-surface-500 text-center py-2",children:"No other modules available"}):d.jsx("div",{className:"space-y-1",children:q.map(D=>d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-800 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:j.includes(D.filename),onChange:()=>V(D.filename),className:"rounded border-surface-600 bg-surface-800 text-accent-500 focus:ring-accent-500"}),d.jsx("span",{className:"text-sm text-surface-300 truncate",children:D.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,"")})]},D.filename))})})]}),z.length>0&&d.jsx("div",{className:"bg-red-500/10 border border-red-500/50 rounded-lg p-3",children:d.jsx("ul",{className:"text-sm text-red-400 space-y-1",children:z.map((D,C)=>d.jsxs("li",{className:"flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}),D]},C))})})]}),d.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-surface-700 bg-surface-800/50",children:[d.jsx("div",{children:R?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs text-red-400",children:"Are you sure?"}),d.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"}),d.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"})]}):d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.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"}),d.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"})]})]})]})})},Vce=["Python","TypeScript","JavaScript","Java","Go","Rust","Ruby","C++"],Yce=["module","component","page","api","graphql","cli","job","message","config"],Dce=({isOpen:n,existingModules:e,onAdd:t,onClose:r})=>{const[s,i]=P.useState(""),[a,o]=P.useState("Python"),[u,f]=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"),f(""),m(""),x(""),y(5),Q(""),$("module"),T([])},V=()=>{E(),r()},D=C=>{T(G=>G.includes(C)?G.filter(A=>A!==C):[...G,C])};return n?d.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:d.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:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-surface-700",children:[d.jsx("h2",{className:"text-lg font-semibold text-white",children:"Add New Module"}),d.jsx("button",{onClick:V,className:"p-1.5 rounded-lg hover:bg-surface-700 transition-colors",children:d.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Module Name ",d.jsx("span",{className:"text-red-400",children:"*"})]}),d.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})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Language"}),d.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:Vce.map(C=>d.jsx("option",{value:C,children:C},C))})]})]}),R&&d.jsxs("div",{className:"bg-surface-900/50 rounded-lg px-3 py-2",children:[d.jsx("span",{className:"text-xs text-surface-500",children:"Generated filename: "}),d.jsx("span",{className:"text-xs text-accent-400 font-mono",children:R})]}),d.jsxs("div",{children:[d.jsx(ei,{label:"Filepath",value:u,onChange:f,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&&d.jsxs("p",{className:"text-xs text-surface-500 mt-1",children:["Will use: ",N]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Description ",d.jsx("span",{className:"text-red-400",children:"*"})]}),d.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"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Priority"}),d.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"Interface Type"}),d.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:Yce.map(C=>d.jsx("option",{value:C,children:C},C))})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:["Tags ",d.jsx("span",{className:"text-surface-500",children:"(comma-separated)"})]}),d.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&&d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:["Dependencies ",d.jsxs("span",{className:"text-surface-500",children:["(",j.length," selected)"]})]}),d.jsx("div",{className:"bg-surface-900 border border-surface-700 rounded-lg p-2 max-h-40 overflow-y-auto",children:d.jsx("div",{className:"space-y-1",children:e.map(C=>d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-800 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:j.includes(C.filename),onChange:()=>D(C.filename),className:"rounded border-surface-600 bg-surface-800 text-accent-500 focus:ring-accent-500"}),d.jsx("span",{className:"text-sm text-surface-300 truncate",children:C.filename.replace(/_[A-Za-z]+\.prompt$/,"").replace(/\.prompt$/,"")})]},C.filename))})})]}),z.length>0&&d.jsx("div",{className:"bg-red-500/10 border border-red-500/50 rounded-lg p-3",children:d.jsx("ul",{className:"text-sm text-red-400 space-y-1",children:z.map((C,G)=>d.jsxs("li",{className:"flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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))})})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 px-6 py-4 border-t border-surface-700 bg-surface-800/50",children:[d.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"}),d.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},Bce=({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 d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:e?void 0:s}),d.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:[d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-surface-700/50",children:[d.jsxs("div",{children:[d.jsxs("h2",{className:"text-xl font-semibold text-white flex items-center gap-2",children:[d.jsx("svg",{className:"w-6 h-6 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsx("p",{className:"text-sm text-surface-400 mt-1",children:"Update architecture.json from prompt metadata tags"})]}),!e&&d.jsx("button",{onClick:s,className:"p-2 hover:bg-surface-700 rounded-lg transition-colors",children:d.jsx("svg",{className:"w-5 h-5 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u?d.jsxs("div",{className:"space-y-4",children:[d.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:d.jsxs("div",{className:"flex items-start gap-3",children:[t.success&&t.validation.valid?d.jsx("svg",{className:"w-6 h-6 text-green-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}):d.jsx("svg",{className:"w-6 h-6 text-red-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}),d.jsxs("div",{className:"flex-1",children:[d.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"}),d.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&&d.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4",children:[d.jsx("h4",{className:"text-sm font-medium text-red-300 mb-2",children:"Validation Errors:"}),d.jsx("ul",{className:"text-sm text-red-200/80 space-y-1",children:t.validation.errors.map((f,p)=>d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-red-400 flex-shrink-0",children:"•"}),d.jsx("span",{children:f.message})]},p))})]}),t.errors&&t.errors.length>0&&d.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4",children:[d.jsx("h4",{className:"text-sm font-medium text-yellow-300 mb-2",children:"Sync Warnings:"}),d.jsx("ul",{className:"text-sm text-yellow-200/80 space-y-1",children:t.errors.map((f,p)=>d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-yellow-400 flex-shrink-0",children:"•"}),d.jsx("span",{children:f})]},p))})]}),t.results&&t.results.length>0&&d.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:[d.jsxs("span",{children:[i?"Hide":"Show"," Detailed Changes"]}),d.jsx("svg",{className:`w-4 h-4 transition-transform ${i?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&t.results&&d.jsx("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:t.results.map((f,p)=>d.jsx(Uce,{result:f},p))})]}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"bg-surface-800/50 border border-surface-700/50 rounded-lg p-4",children:[d.jsx("h3",{className:"text-sm font-medium text-white mb-2",children:"What this does:"}),d.jsxs("ul",{className:"text-sm text-surface-300 space-y-1.5 list-disc list-inside",children:[d.jsxs("li",{children:["Scans all prompt files for metadata tags (",d.jsx("code",{className:"text-accent-400",children:"<pdd-reason>"}),", ",d.jsx("code",{className:"text-accent-400",children:"<pdd-interface>"}),", ",d.jsx("code",{className:"text-accent-400",children:"<pdd-dependency>"}),")"]}),d.jsx("li",{children:"Updates corresponding entries in architecture.json"}),d.jsx("li",{children:"Validates the updated architecture for circular dependencies"}),d.jsx("li",{children:"Preserves fields not specified in tags (description, priority, tags)"})]})]}),d.jsxs("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4 flex items-start gap-3",children:[d.jsx("svg",{className:"w-5 h-5 text-blue-400 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-blue-300 mb-1",children:"Source of Truth"}),d.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&&d.jsxs("div",{className:"flex items-center justify-center gap-3 py-8",children:[d.jsxs("svg",{className:"animate-spin h-8 w-8 text-accent-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{className:"text-surface-300",children:"Syncing..."})]})]})}),d.jsx("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-surface-700/50",children:u?d.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"}):d.jsxs(d.Fragment,{children:[d.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"}),d.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&&d.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.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"]})]})})]})]})},Uce=({result:n})=>{const[e,t]=P.useState(!1),r=n.changes&&Object.keys(n.changes).length>0;return d.jsxs("div",{className:"bg-surface-800/50 border border-surface-700/50 rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-start justify-between mb-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[n.success?n.updated?d.jsx("svg",{className:"w-4 h-4 text-green-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}):d.jsx("svg",{className:"w-4 h-4 text-surface-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}):d.jsx("svg",{className:"w-4 h-4 text-red-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}),d.jsx("span",{className:"text-sm font-mono text-white",children:n.filename})]}),r&&d.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",d.jsx("svg",{className:`w-3 h-3 transition-transform ${e?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),d.jsx("p",{className:"text-xs text-surface-400",children:n.updated?`Updated: ${Object.keys(n.changes).join(", ")}`:n.error||"No changes needed"}),e&&r&&d.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 d.jsxs("div",{className:"text-xs",children:[d.jsxs("div",{className:"text-surface-400 font-medium mb-1",children:[s,":"]}),d.jsxs("div",{className:"bg-surface-900/50 rounded p-2 space-y-1",children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-red-400 flex-shrink-0",children:"-"}),d.jsxs("span",{className:"text-red-300/80 break-all",children:[JSON.stringify(a.old).slice(0,100),JSON.stringify(a.old).length>100?"...":""]})]}),d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400 flex-shrink-0",children:"+"}),d.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 Wce(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]),f=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:f,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 mS(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const DA=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`arch-option-${n.name}`;if(n.type==="checkbox")return d.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:[d.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"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:mS(n.name)}),d.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 d.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:mS(n.name)}),d.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})]}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),d.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:f=>t(parseFloat(f.target.value)),className:`flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500
|
|
350
|
+
[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4
|
|
351
|
+
[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent-500
|
|
352
|
+
[&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-accent-500/30
|
|
353
|
+
[&::-webkit-slider-thumb]:hover:bg-accent-400 [&::-webkit-slider-thumb]:transition-colors`}),d.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return d.jsxs("div",{children:[d.jsx("label",{htmlFor:s,className:`block ${r?"text-xs":"text-sm"} font-medium text-white mb-1.5`,children:mS(n.name)}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mb-2`,children:n.description}),d.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"})]})},Gce=({serverConnected:n,isExecuting:e,onOpenPromptSpace:t,onBatchStart:r,onBatchProgress:s,onBatchComplete:i,executionMode:a,selectedRemoteSession:o,onRemoteJobSubmitted:u})=>{const[f,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),[D,C]=P.useState(null),[G,A]=P.useState("architecture.json"),[W,H]=P.useState(null),[U,ee]=P.useState(!1),[X,B]=P.useState(null),[K,Z]=P.useState(!1),[I,J]=P.useState(null),[ne,ce]=P.useState(null),[xe,ke]=P.useState(!1),[Me,se]=P.useState(!1),[be,Oe]=P.useState(!1),[ye,Fe]=P.useState({strength:cn.strength,temperature:cn.temperature,time:cn.time,verbose:cn.verbose,quiet:cn.quiet,force:cn.force,local:cn.local}),Te=P.useRef(!1),[we,Ke]=P.useState(!1),[ct,at]=P.useState(!1),[yt,Ye]=P.useState(new Set),[tt,gn]=P.useState([]),[kt,Zt]=P.useState(!1),[$t,rn]=P.useState(!1),[dn,pt]=P.useState(!1),[Dt,ut]=P.useState(null),[lt,Pt]=P.useState(!1),[vt,sn]=P.useState(null),[vr,ge]=P.useState(new Set),[Qe,Re]=P.useState(window.innerWidth<768),[Je,Tt]=P.useState(!1),[Ft,_n]=P.useState(!1),[xn,bn]=P.useState(null),{architecture:yn,hasUnsavedChanges:fn,addModule:ci,updateModule:fs,deleteModule:wr,addDependency:hs,removeDependency:zs,updatePositions:Sr,undo:ps,redo:ms,canUndo:pe,canRedo:$e,setOriginal:ze,discardChanges:Mt}=Wce([]);P.useEffect(()=>{f&&ze(f)},[f,ze]),P.useEffect(()=>{const he=()=>Re(window.innerWidth<768);return window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[]);const vn=kt?yn:f,sr=P.useCallback(async()=>{try{const he=await Ne.listPrompts();gn(he);const _e=new Set(he.map(Be=>Be.prompt.split("/").pop()||""));Ye(_e)}catch(he){console.error("Failed to load existing prompts:",he)}},[]);P.useEffect(()=>{(async()=>{if(!n){g(!1);return}g(!0);try{if((await Ne.checkArchitectureExists()).exists){const Be=await Ne.getArchitecture();p(Be),S("graph"),await sr()}else S("empty")}catch(_e){console.error("Failed to load architecture:",_e),S("empty")}finally{g(!1)}})()},[n,sr]);const Fl=P.useCallback(async he=>{try{const _e=await Ne.getFileContent(he);if(D==="prd")j(_e.content),R(he),y==="empty"&&S("editor");else if(D==="techStack")q(_e.content),L(he);else if(D==="architecture")try{const Be=JSON.parse(_e.content);p(Be),S("graph"),await sr()}catch(Be){console.error("Failed to parse architecture.json:",Be),alert("Invalid architecture.json format. Please select a valid architecture file.");return}C(null)}catch(_e){console.error("Failed to load file:",_e)}},[D,y,sr]),ui=P.useCallback(async()=>{var he,_e;if(!G.trim()){H("Please enter a file path");return}H(null);try{const Be=await Ne.getFileContent(G.trim()),hn=JSON.parse(Be.content);p(hn),S("graph"),await sr()}catch(Be){console.error("Failed to load architecture:",Be),(he=Be.message)!=null&&he.includes("404")||(_e=Be.message)!=null&&_e.includes("not found")?H(`File not found: ${G}`):Be instanceof SyntaxError?H("Invalid JSON format in file"):H(Be.message||"Failed to load architecture file")}},[G,sr]),di=async()=>{if(!$.trim()&&!T){B("Please provide a PRD (Product Requirements Document)");return}ee(!0),B(null);try{if(a==="remote"&&o){if(!T&&$.trim()){B('Remote execution requires PRD to be loaded from a file. Please use "Load PRD" to select a file.'),ee(!1);return}const he=[];T&&he.push(`PRD_FILE=${T}`),z&&he.push(`TECH_STACK_FILE=${z}`),Q&&he.push(`APP_NAME=${Q}`);const _e={output:"architecture.json",template:"architecture/architecture_json",env:he};if(ye){const{strength:Be,temperature:hn,time:mt,verbose:Wn,quiet:Qr,force:kr}=ye;Be!==void 0&&(_e.strength=Be),hn!==void 0&&(_e.temperature=hn),mt!==void 0&&(_e.time=mt),Wn&&(_e.verbose=!0),Qr&&(_e.quiet=!0),kr&&(_e.force=!0)}try{await Ne.submitRemoteCommand({sessionId:o,type:"generate",payload:{args:{},options:_e}}),B(null),ee(!1),alert("Architecture generation command submitted to remote session. Check the remote machine for results.")}catch(Be){B(`Failed to submit remote command: ${Be instanceof Error?Be.message:String(Be)}`)}}else{const he=await Ne.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(he.success){const _e=await Ne.getArchitecture();p(_e),S("graph"),Ke(!0)}else B(he.message||"Generation failed")}}catch(he){console.error("Failed to generate architecture:",he),B(he.message||"Failed to generate architecture")}finally{ee(!1)}},Ha=async()=>{try{await Ne.cancelCommand(),ee(!1)}catch(he){console.error("Failed to cancel:",he)}},Os=P.useCallback(he=>{const _e=he.filename.match(/_([A-Za-z]+)\.prompt$/),Be=_e?_e[1].toLowerCase():void 0,hn=he.filename.replace(/_[A-Za-z]+\.prompt$/,""),mt={prompt:`prompts/${he.filename}`,sync_basename:hn,language:Be,code:he.filepath};t(mt)},[t]),gs=P.useCallback(()=>{Ke(!1),S("editor")},[]),Ls=P.useCallback(()=>{!f||f.length===0||se(!0)},[f]),Zs=P.useCallback(async he=>{if(se(!1),he.length===0)return;Te.current=!1,Z(!0),ce(null),ke(!0);const _e=he.map(Be=>{const hn=Be.filename.match(/^(.+)_([^_]+)\.prompt$/);return{module:(hn==null?void 0:hn[1])||Be.filename.replace(".prompt",""),langOrFramework:(hn==null?void 0:hn[2])||"Python"}});r==null||r("Generating Prompts",_e.length);try{if(a==="remote"&&o){const Be=[];for(let mt=0;mt<_e.length&&!Te.current;mt++){const{module:Wn,langOrFramework:Qr}=_e[mt];J({current:mt+1,total:_e.length,currentModule:Wn}),s==null||s(mt+1,_e.length,Wn);try{const kr=[`MODULE=${Wn}`,`LANG_OR_FRAMEWORK=${Qr}`,"ARCHITECTURE_FILE=architecture.json"];T&&kr.push(`PRD_FILE=${T}`),z&&kr.push(`TECH_STACK_FILE=${z}`);const ar={template:"generic/generate_prompt",env:kr,output:`prompts/${Wn}_${Qr}.prompt`};if(ye){const{strength:fi,temperature:Of,time:Vc,verbose:gf,quiet:Yc,force:TO}=ye;fi!==void 0&&(ar.strength=fi),Of!==void 0&&(ar.temperature=Of),Vc!==void 0&&(ar.time=Vc),gf&&(ar.verbose=!0),Yc&&(ar.quiet=!0),TO&&(ar.force=!0)}const{commandId:pf}=await Ne.submitRemoteCommand({sessionId:o,type:"generate",payload:{args:{},options:ar}}),mf=`pdd generate --template generic/generate_prompt -o prompts/${Wn}_${Qr}.prompt`;u==null||u(`[Remote] ${mf}`,"generate",pf,o),Be.push({module:`${Wn}_${Qr}`,success:!0})}catch(kr){Be.push({module:`${Wn}_${Qr}`,success:!1,error:kr instanceof Error?kr.message:String(kr)})}}ce(Be);const hn=Be.every(mt=>mt.success);i==null||i(hn)}else{const Be=await Ne.batchGeneratePrompts({modules:_e,architectureFile:"architecture.json",prdFile:T||void 0,techStackFile:z||void 0,globalOptions:ye},(mt,Wn,Qr)=>{J({current:mt,total:Wn,currentModule:Qr}),s==null||s(mt,Wn,Qr)},()=>Te.current);ce(Be);const hn=Be.every(mt=>mt.success);i==null||i(hn)}}catch(Be){console.error("Failed to generate prompts:",Be),ce([{module:"error",success:!1,error:Be.message||"Failed to generate prompts"}]),i==null||i(!1)}finally{Z(!1),J(null)}},[T,z,ye,r,s,i,a,o,u]),an=P.useCallback(async()=>{Te.current=!0;try{await Ne.cancelCommand()}catch(he){console.error("Failed to cancel command:",he)}},[]),Kl=P.useCallback(async()=>{ke(!1),ce(null),Te.current=!1,await sr()},[sr]),Jl=P.useCallback(()=>{bn(null),Tt(!0)},[]),xs=P.useCallback(async()=>{_n(!0);try{const he=await Ne.syncArchitectureFromPrompts({dry_run:!1});if(bn(he),he.success&&he.validation.valid){const _e=await Ne.getArchitecture();p(_e),await sr()}}catch(he){console.error("Sync failed:",he),bn({success:!1,updated_count:0,skipped_count:0,results:[],validation:{valid:!0,errors:[],warnings:[]},errors:[he.message||"Unexpected error during sync"]})}finally{_n(!1)}},[sr]),bs=P.useCallback(()=>{Tt(!1),bn(null)},[]),Lc=P.useCallback(()=>{if(kt&&fn)if(window.confirm("You have unsaved changes. Discard them?"))Mt(),sn(null),ge(new Set);else return;Zt(!kt)},[kt,fn,Mt]),eo=P.useCallback(he=>{ut(he),rn(!0)},[]),to=P.useCallback(he=>{Dt&&fs(Dt.filename,he),rn(!1),ut(null)},[Dt,fs]),ea=P.useCallback(he=>{wr(he),rn(!1),ut(null)},[wr]),no=P.useCallback(he=>{ci(he)},[ci]),ro=P.useCallback((he,_e)=>{hs(he,_e)},[hs]),ys=P.useCallback((he,_e)=>{zs(he,_e)},[zs]),ir=P.useCallback(he=>{Sr(he)},[Sr]),so=P.useCallback(async()=>{if(!(!yn||yn.length===0)){Pt(!0),sn(null),ge(new Set);try{const he=await Ne.validateArchitecture(yn);if(sn(he),!he.valid){const Be=new Set;for(const hn of he.errors)hn.modules.forEach(mt=>Be.add(mt));ge(Be),Pt(!1);return}const _e=await Ne.saveArchitecture(yn);_e.success?(p(yn),ze(yn),Zt(!1)):alert("Failed to save: "+(_e.error||"Unknown error"))}catch(he){console.error("Failed to save architecture:",he),alert("Failed to save: "+he.message)}finally{Pt(!1)}}},[yn,ze]),Zc=P.useCallback(()=>{fn&&!window.confirm("Are you sure you want to discard all changes?")||(Mt(),sn(null),ge(new Set))},[fn,Mt]);return P.useEffect(()=>{const he=_e=>{if(kt&&((_e.ctrlKey||_e.metaKey)&&_e.key==="s"&&(_e.preventDefault(),fn&&so()),(_e.ctrlKey||_e.metaKey)&&_e.key==="z"&&!_e.shiftKey&&(_e.preventDefault(),pe&&ps()),(_e.ctrlKey||_e.metaKey)&&_e.key==="z"&&_e.shiftKey&&(_e.preventDefault(),$e&&ms()),_e.key==="Escape"&&($t?(rn(!1),ut(null)):dn?pt(!1):fn?Zc():Zt(!1)),_e.key==="n"&&!_e.ctrlKey&&!_e.metaKey&&!$t&&!dn)){if(_e.target.tagName==="INPUT"||_e.target.tagName==="TEXTAREA")return;_e.preventDefault(),pt(!0)}};return window.addEventListener("keydown",he),()=>window.removeEventListener("keydown",he)},[kt,fn,pe,$e,$t,dn,so,Zc,ps,ms]),P.useEffect(()=>{const he=_e=>{kt&&fn&&(_e.preventDefault(),_e.returnValue="")};return window.addEventListener("beforeunload",he),()=>window.removeEventListener("beforeunload",he)},[kt,fn]),m?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsxs("div",{className:"flex items-center gap-3 text-surface-400",children:[d.jsxs("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.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"?d.jsxs("div",{className:"flex items-center justify-center min-h-[400px]",children:[d.jsxs("div",{className:"glass rounded-2xl p-8 max-w-lg text-center border border-surface-700/50",children:[d.jsx("div",{className:"w-16 h-16 rounded-2xl bg-accent-500/20 flex items-center justify-center mx-auto mb-4",children:d.jsx("svg",{className:"w-8 h-8 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("h2",{className:"text-xl font-semibold text-white mb-2",children:"No architecture.json found"}),d.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."}),d.jsxs("div",{className:"flex gap-3 justify-center mb-4",children:[d.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"}),d.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"})]}),d.jsxs("div",{className:"pt-4 border-t border-surface-700/50",children:[d.jsx("p",{className:"text-surface-500 text-xs mb-3",children:"Or load an existing architecture file"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:G,onChange:he=>{A(he.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:he=>{he.key==="Enter"&&ui()}}),d.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:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("button",{onClick:ui,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"})]}),W&&d.jsx("p",{className:"text-red-400 text-xs mt-2",children:W})]}),!n&&d.jsx("p",{className:"text-yellow-400 text-xs mt-4",children:"Connect to server to enable architecture generation"})]}),D&&d.jsx($2,{onSelect:Fl,onClose:()=>C(null),filter:D==="architecture"?".json":".md",title:D==="prd"?"Select PRD File":D==="architecture"?"Select Architecture File":"Select Tech Stack File"})]}):d.jsxs("div",{className:"flex gap-4 h-[calc(100vh-200px)] min-h-[500px]",children:[d.jsx("div",{className:`flex-shrink-0 transition-all duration-300 ${we?"w-12":"w-80"}`,children:d.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 h-full flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"p-3 border-b border-surface-700/50 flex items-center justify-between",children:[!we&&d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx("input",{type:"text",value:Q,onChange:he=>k(he.target.value),placeholder:"Project Name",className:"w-full bg-transparent text-white text-sm font-medium placeholder-surface-500 focus:outline-none"})}),d.jsx("button",{onClick:()=>Ke(!we),className:"p-1.5 hover:bg-surface-700 rounded-lg transition-colors flex-shrink-0",title:we?"Expand sidebar":"Collapse sidebar",children:d.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform ${we?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})})]}),!we&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[d.jsxs("div",{className:"p-2 border-b border-surface-700/50 flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider",children:"PRD"}),d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.jsx("div",{className:"px-2 py-1 bg-surface-800/50 text-xs text-surface-400 truncate",children:T}),d.jsx("textarea",{value:$,onChange:he=>{j(he.target.value),R(null)},placeholder:`# Product Requirements
|
|
354
|
+
|
|
355
|
+
## Overview
|
|
356
|
+
Describe your product...
|
|
357
|
+
|
|
358
|
+
## Features
|
|
359
|
+
- Feature 1
|
|
360
|
+
- 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")]}),d.jsxs("div",{className:"border-t border-surface-700/50",children:[d.jsxs("button",{onClick:()=>{ct||(at(!0),requestAnimationFrame(()=>{V(!E),setTimeout(()=>at(!1),150)}))},className:"w-full p-2 flex items-center justify-between text-left hover:bg-surface-800/30 transition-colors",children:[d.jsx("span",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider",children:"Tech Stack (optional)"}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),E&&d.jsxs("div",{className:`border-t border-surface-700/30 transition-opacity duration-150 ${ct?"opacity-50":"opacity-100"}`,children:[d.jsx("div",{className:"p-2 flex items-center justify-end",children:d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.jsx("div",{className:"px-2 py-1 bg-surface-800/50 text-xs text-surface-400 truncate",children:z}),d.jsx("textarea",{value:N,onChange:he=>{q(he.target.value),L(null)},placeholder:`Backend: Python, FastAPI
|
|
361
|
+
Frontend: React, TypeScript
|
|
362
|
+
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")]})]}),d.jsxs("div",{className:"border-t border-surface-700/50",children:[d.jsxs("button",{onClick:()=>{ct||(at(!0),requestAnimationFrame(()=>{Oe(!be),setTimeout(()=>at(!1),150)}))},className:"w-full p-2 flex items-center justify-between text-left hover:bg-surface-800/30 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),(ye.strength!==cn.strength||ye.temperature!==cn.temperature||ye.time!==cn.time||ye.local||ye.verbose||ye.quiet||ye.force)&&d.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),d.jsx("svg",{className:`w-4 h-4 text-surface-400 transition-transform duration-200 ${be?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),be&&d.jsxs("div",{className:`border-t border-surface-700/30 p-3 space-y-3 transition-opacity duration-150 ${ct?"opacity-50":"opacity-100"}`,children:[d.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),hr.filter(he=>["strength","temperature","time"].includes(he.name)).map(he=>d.jsx(DA,{option:he,value:ye[he.name],onChange:_e=>Fe(Be=>({...Be,[he.name]:_e})),compact:!0},he.name))]}),d.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),hr.filter(he=>["local","verbose","quiet","force"].includes(he.name)).map(he=>d.jsx(DA,{option:he,value:ye[he.name],onChange:_e=>Fe(Be=>({...Be,[he.name]:_e})),compact:!0},he.name))]})]})]}),d.jsxs("div",{className:"p-3 border-t border-surface-700/50",children:[X&&d.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}),U?d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("div",{className:"flex-1 px-4 py-2.5 bg-surface-700 rounded-xl flex items-center justify-center gap-2",children:[d.jsxs("svg",{className:"animate-spin h-4 w-4 text-surface-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),d.jsx("span",{className:"text-sm text-surface-400",children:"Generating..."})]}),d.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"})]}):d.jsx("button",{onClick:di,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:f?"Regenerate":"Generate Architecture"})]}),d.jsx("div",{className:"border-t border-surface-700/50",children:d.jsxs("div",{className:"p-3",children:[d.jsx("p",{className:"text-xs font-medium text-surface-400 uppercase tracking-wider mb-2",children:"Load Architecture File"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:G,onChange:he=>{A(he.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:he=>{he.key==="Enter"&&ui()}}),d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("button",{onClick:ui,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"})]}),W&&d.jsx("p",{className:"text-red-400 text-[10px] mt-1",children:W})]})}),d.jsx("div",{className:"border-t border-surface-700/50",children:d.jsx("div",{className:"p-3",children:d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Start New Project"]})})})]})]})}),d.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[y==="graph"&&vn&&d.jsx(zce,{editMode:kt,hasUnsavedChanges:fn,onToggleEditMode:Lc,onAddModule:()=>pt(!0),onSave:so,onDiscard:Zc,onUndo:ps,onRedo:ms,canUndo:pe,canRedo:$e,isSaving:lt,onSyncFromPrompts:Jl}),vt&&!vt.valid&&d.jsx("div",{className:"bg-red-500/10 border-b border-red-500/30 px-4 py-2",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-red-400 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:"text-sm text-red-400 font-medium",children:"Cannot save: validation errors"}),d.jsx("ul",{className:"text-xs text-red-300 mt-1 space-y-0.5",children:vt.errors.map((he,_e)=>d.jsx("li",{children:he.message},_e))})]})]})}),d.jsx("div",{className:"flex-1 min-h-0",children:y==="graph"&&vn?Qe?d.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 h-full overflow-y-auto p-4",children:[d.jsxs("div",{className:"text-center mb-6",children:[d.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 text-surface-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("h3",{className:"text-white font-semibold mb-2",children:"Architecture Graph"}),d.jsx("p",{className:"text-sm text-surface-400 mb-4",children:"The interactive architecture graph is best viewed on desktop devices (screen width > 768px)"}),d.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-surface-500",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:"Module list shown below"})]})]}),d.jsx("div",{className:"space-y-3",children:vn.map(he=>d.jsxs("div",{className:"bg-surface-800/50 p-4 rounded-lg border border-surface-700/30 hover:border-surface-600/50 transition-colors",onClick:()=>Os(he),children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[d.jsx("div",{className:"font-medium text-white text-sm flex-1",children:he.filename}),yt.has(`${he.filename.replace(".py","")}.prompt`)&&d.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:[d.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:d.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"]})]}),d.jsx("p",{className:"text-xs text-surface-400 line-clamp-2 mb-3",children:he.description}),he.dependencies&&he.dependencies.length>0&&d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-surface-500",children:[d.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})}),d.jsxs("span",{className:"truncate",children:["Depends on: ",he.dependencies.join(", ")]})]})]},he.filename))}),!kt&&d.jsx("button",{onClick:()=>Ls(),disabled:K,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:K?"Generating Prompts...":"Generate All Prompts"})]}):d.jsx(qce,{architecture:vn,prdContent:$,appName:Q,onRegenerate:gs,onModuleClick:Os,onGeneratePrompts:Ls,isGeneratingPrompts:K,existingPrompts:yt,promptsInfo:tt,editMode:kt,onModuleEdit:eo,onModuleDelete:ea,onDependencyAdd:ro,onDependencyRemove:ys,onPositionsChange:ir,highlightedModules:vr}):d.jsx("div",{className:"glass rounded-xl border border-surface-700/50 h-full flex items-center justify-center",children:d.jsxs("div",{className:"text-center text-surface-400",children:[d.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("p",{className:"text-sm",children:"Write your PRD and click Generate to create the architecture"})]})})})]}),D&&d.jsx($2,{onSelect:Fl,onClose:()=>C(null),filter:D==="architecture"?".json":".md",title:D==="prd"?"Select PRD File":D==="architecture"?"Select Architecture File":"Select Tech Stack File"}),Me&&f&&d.jsx(Xce,{isOpen:Me,modules:f,existingPrompts:yt,globalOptions:ye,onGlobalOptionsChange:Fe,onClose:()=>se(!1),onConfirm:Zs}),xe&&d.jsx(Mce,{isOpen:xe,progress:I,results:ne,onClose:Kl,onCancel:K?an:void 0}),d.jsx(Zce,{isOpen:$t,module:Dt,allModules:yn,onSave:to,onDelete:ea,onClose:()=>{rn(!1),ut(null)}}),d.jsx(Dce,{isOpen:dn,existingModules:yn,onAdd:no,onClose:()=>pt(!1)}),d.jsx(Bce,{isOpen:Je,isSyncing:Ft,result:xn,onSync:xs,onClose:bs})]})},Ice=["python","typescript","javascript","java","go","rust","cpp","c","csharp","ruby","swift","kotlin"],BA={contexts:{default:{paths:["**"],defaults:{generate_output_path:"src/",test_output_path:"tests/",example_output_path:"examples/",default_language:"python"}}}},Nn={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"}},Hce=({name:n,context:e,isDefault:t,onChange:r,onDelete:s,onRename:i})=>{const[a,o]=P.useState(!0),[u,f]=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 d.jsxs("div",{className:"glass rounded-xl border border-surface-700/50 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-surface-800/50 transition-colors",onClick:()=>o(!a),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Uz,{className:"w-5 h-5 text-accent-400"}),p&&!t?d.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}):d.jsxs("span",{className:"font-medium text-white",onDoubleClick:$=>{t||($.stopPropagation(),m(!0))},children:[n,t&&d.jsx("span",{className:"ml-2 text-xs text-surface-400",children:"(default)"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[!t&&d.jsx(Ir,{content:"Delete context",children:d.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:d.jsx(IJ,{className:"w-4 h-4"})})}),a?d.jsx(mm,{className:"w-5 h-5 text-surface-400"}):d.jsx(Om,{className:"w-5 h-5 text-surface-400"})]})]}),a&&d.jsxs("div",{className:"p-4 pt-0 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:"File Patterns"}),d.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"}),d.jsx("p",{className:"mt-1 text-xs text-surface-500",children:"Glob patterns to match files (e.g., frontend/**, **/*.py)"})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[d.jsx(ei,{label:Nn.generate_output_path.label,value:Q.generate_output_path||"",onChange:$=>v("generate_output_path",$),placeholder:Nn.generate_output_path.placeholder,description:Nn.generate_output_path.description,directoryMode:!0,title:"Select Code Output Directory"}),d.jsx(ei,{label:Nn.test_output_path.label,value:Q.test_output_path||"",onChange:$=>v("test_output_path",$),placeholder:Nn.test_output_path.placeholder,description:Nn.test_output_path.description,directoryMode:!0,title:"Select Test Output Directory"}),d.jsx(ei,{label:Nn.example_output_path.label,value:Q.example_output_path||"",onChange:$=>v("example_output_path",$),placeholder:Nn.example_output_path.placeholder,description:Nn.example_output_path.description,directoryMode:!0,title:"Select Example Output Directory"}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:Nn.default_language.label}),d.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:[d.jsx("option",{value:"",children:"Select language..."}),Ice.map($=>d.jsx("option",{value:$,children:$.charAt(0).toUpperCase()+$.slice(1)},$))]})]})]}),d.jsxs("button",{onClick:()=>f(!u),className:"flex items-center gap-2 text-sm text-surface-400 hover:text-white transition-colors",children:[u?d.jsx(mm,{className:"w-4 h-4"}):d.jsx(Om,{className:"w-4 h-4"}),"Advanced Options"]}),u&&d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-3 bg-surface-800/30 rounded-lg",children:[d.jsx(ei,{label:Nn.prompts_dir.label,value:Q.prompts_dir||"",onChange:$=>v("prompts_dir",$),placeholder:Nn.prompts_dir.placeholder,description:Nn.prompts_dir.description,directoryMode:!0,title:"Select Prompts Directory"}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:Nn.strength.label}),d.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:Nn.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:Nn.temperature.label}),d.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:Nn.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-1",children:Nn.budget.label}),d.jsx("input",{type:"number",min:"0",step:"1",value:Q.budget??"",onChange:$=>v("budget",$.target.value?parseFloat($.target.value):void 0),placeholder:Nn.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"})]})]})]})]})},Fce=()=>{const[n,e]=P.useState(null),[t,r]=P.useState(""),[s,i]=P.useState(!0),[a,o]=P.useState(!1),[u,f]=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),f(null);try{console.log("[ProjectSettings] Loading .pddrc configuration...");const L=await Ne.getPddrc();console.log("[ProjectSettings] Loaded config:",L),L?(e(L),r(JSON.stringify(L))):(console.log("[ProjectSettings] No .pddrc found, using defaults"),e(BA),r(""))}catch(L){console.error("[ProjectSettings] Error loading config:",L),f(L instanceof Error?L.message:"Failed to load configuration"),e(BA)}finally{console.log("[ProjectSettings] Loading complete"),i(!1)}};P.useEffect(()=>{k()},[]),P.useEffect(()=>{(async()=>{try{const E=await Ne.getAuthStatus();x(E)}catch{x({authenticated:!1,cached:!1,expires_at:null})}})()},[]);const $=async()=>{y(!0),Q(null);try{const L=await Ne.logout();if(L.success){Q({success:!0,message:"Tokens cleared. Run any pdd command to re-authenticate with GitHub."});const E=await Ne.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),f(null);try{const L=await Ne.savePddrc(n);L.success?(r(JSON.stringify(n)),m(!0),setTimeout(()=>m(!1),3e3)):f(L.error||"Failed to save configuration")}catch(L){f(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]){f(`Context "${E}" already exists`);return}const V={};for(const[D,C]of Object.entries(n.contexts))D===L?V[E]=C:V[D]=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?d.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 bg-surface-900/50 rounded-xl",children:[d.jsx(Od,{className:"w-8 h-8 text-accent-400 animate-spin"}),d.jsx("p",{className:"mt-4 text-surface-400 text-sm",children:"Loading project settings..."})]}):n?d.jsxs("div",{className:"max-w-4xl mx-auto p-4 sm:p-6 lg:p-8 animate-fade-in",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent-500/20 flex items-center justify-center",children:d.jsx(Wz,{className:"w-5 h-5 text-accent-400"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-xl sm:text-2xl font-semibold text-white",children:"Project Settings"}),d.jsx("p",{className:"text-sm text-surface-400",children:"Configure where your code, tests, and examples are saved"})]})]}),d.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?d.jsxs(d.Fragment,{children:[d.jsx(Od,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):p?"Saved!":"Save Changes"})]}),u&&d.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}),d.jsx("div",{className:"mb-6 p-4 glass rounded-xl border border-surface-700/50",children:d.jsxs("p",{className:"text-sm text-surface-300",children:["Define output paths for different parts of your project. Each ",d.jsx("strong",{children:"context"})," matches file patterns and applies specific settings. The ",d.jsx("strong",{children:"default"})," context matches all files not covered by other contexts."]})}),d.jsx("div",{className:"space-y-4",children:(n==null?void 0:n.contexts)&&Object.entries(n.contexts).map(([L,E])=>d.jsx(Hce,{name:L,context:E,isDefault:L==="default",onChange:R,onDelete:N,onRename:q},L))}),d.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:[d.jsx(HJ,{className:"w-5 h-5"}),"Add Context"]}),d.jsxs("div",{className:"mt-8 glass rounded-xl border border-surface-700/50 p-4 sm:p-6",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center",children:d.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-white",children:"PDD Cloud Authentication"}),d.jsx("p",{className:"text-sm text-surface-400",children:"Manage your GitHub authentication for PDD Cloud"})]})]}),d.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface-800/50 mb-4",children:[d.jsx("div",{className:`w-3 h-3 rounded-full ${g!=null&&g.authenticated?"bg-green-400":"bg-yellow-400 animate-pulse"}`}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-white",children:g!=null&&g.authenticated?"Currently Authenticated":"Not Authenticated"}),d.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"})]})]}),d.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&&d.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}),d.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?d.jsxs(d.Fragment,{children:[d.jsx(Od,{className:"w-4 h-4 animate-spin"}),"Clearing..."]}):d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})}),d.jsx("p",{className:"mt-2 text-xs text-surface-500",children:"Clears JWT cache (~/.pdd/jwt_cache) and refresh token from system keyring."})]}),j()&&d.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.'})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8 gap-4",children:[d.jsx("p",{className:"text-surface-400",children:"Failed to load configuration"}),d.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 UA(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 Kce(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 Jce(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 WA=({job:n,isSelected:e,onSelect:t,onCancel:r,onRemove:s,onMarkDone:i,onMarkStatus:a})=>{var g,x;const o=Jce(n.status),u=n.status==="queued"||n.status==="running",f=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 d.jsxs("div",{onClick:t,className:`
|
|
363
|
+
relative p-4 rounded-xl border cursor-pointer transition-all duration-200
|
|
364
|
+
${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"}
|
|
365
|
+
`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:"text-sm font-medium text-white truncate",title:n.displayCommand,children:n.displayCommand}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.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"&&d.jsxs("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),o.icon==="check"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),o.icon==="x"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),o.icon==="clock"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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]}),d.jsx("span",{className:"text-xs text-surface-500",children:u?UA(n.startedAt):n.completedAt?Kce(n.completedAt):UA(n.startedAt)})]})]}),n.cost>0&&d.jsxs("span",{className:"text-xs text-surface-400 font-mono",children:["$",n.cost.toFixed(3)]})]}),u&&m!==null&&d.jsxs("div",{className:"mb-3",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[d.jsx("span",{className:"text-surface-400 truncate max-w-[70%]",children:((x=n.progress)==null?void 0:x.message)||"Processing..."}),d.jsxs("span",{className:"text-accent-400 font-medium",children:[m,"%"]})]}),d.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:d.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&&d.jsx("div",{className:"mb-3",children:d.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:d.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&&d.jsx("div",{className:"mb-3 p-2 bg-surface-900/50 rounded-lg",children:d.jsx("p",{className:"text-xs text-surface-400 font-mono truncate",children:n.output[n.output.length-1]})}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u&&f&&!p&&i&&d.jsxs(d.Fragment,{children:[d.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"}),d.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&&d.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&&d.jsxs(d.Fragment,{children:[d.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"}),d.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"}),d.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&&d.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&&!f&&!p&&d.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&&d.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"}),d.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:f?"Details":"View Output"})]})]})};function GA(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 eue=({job:n,onCancel:e,onClose:t})=>{var v;const r=P.useRef(null),[s,i]=P.useState(!0),[a,o]=P.useState(!1),[u,f]=P.useState(GA(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(()=>{f(GA(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(`
|
|
366
|
+
`);try{await navigator.clipboard.writeText(y),o(!0),setTimeout(()=>o(!1),2e3)}catch(S){console.error("Failed to copy:",S)}};return d.jsxs("div",{className:"flex flex-col h-full bg-surface-900 rounded-xl border border-surface-700/50 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-surface-800/50 border-b border-surface-700/50",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.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"}`}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h3",{className:"text-sm font-medium text-white truncate",children:n.displayCommand}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-surface-400",children:[d.jsx("span",{className:"capitalize",children:n.status}),d.jsx("span",{children:"•"}),d.jsx("span",{children:u}),n.cost>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"•"}),d.jsxs("span",{className:"font-mono",children:["$",n.cost.toFixed(3)]})]})]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.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?d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-3.5 h-3.5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Copied"]}):d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.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"}),d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),p&&d.jsx("div",{className:"px-4 py-2 bg-surface-800/30 border-b border-surface-700/30",children:m!==null?d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[d.jsx("span",{className:"text-surface-400 truncate max-w-[70%]",children:((v=n.progress)==null?void 0:v.message)||"Processing..."}),d.jsxs("span",{className:"text-accent-400 font-medium",children:[m,"%"]})]}),d.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full bg-gradient-to-r from-accent-600 to-accent-400 rounded-full transition-all duration-300",style:{width:`${m}%`}})})]}):d.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full w-1/3 bg-gradient-to-r from-accent-600 to-accent-400 rounded-full animate-indeterminate"})})}),d.jsxs("div",{ref:r,onScroll:g,className:"flex-1 overflow-auto p-4 font-mono text-sm",children:[n.output.length===0?d.jsx("div",{className:"text-surface-500 text-center py-8",children:p?"Waiting for output...":"No output"}):d.jsx("pre",{className:"whitespace-pre-wrap break-words text-surface-300",children:n.output.map((y,S)=>d.jsx("div",{className:`${y.startsWith("[stderr]")?"text-red-400":y.startsWith(">")?"text-accent-400":""}`,children:y},S))}),!s&&n.output.length>0&&d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.jsx("div",{className:"px-4 py-3 bg-red-500/10 border-t border-red-500/20",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("p",{className:"text-sm text-red-400",children:n.error})]})}),n.status==="completed"&&d.jsx("div",{className:"px-4 py-3 bg-green-500/10 border-t border-green-500/20",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),d.jsx("p",{className:"text-sm text-green-400",children:"Job completed successfully"})]})})]})},tue=({activeJobs:n,completedJobs:e,selectedJob:t,onSelectJob:r,onCancelJob:s,onRemoveJob:i,onClearCompleted:a,onMarkSpawnedDone:o,onMarkJobStatus:u,batchOperation:f,onCancelBatchOperation:p})=>{const[m,g]=P.useState(!1),x=n.length>0||e.length>0,v=f&&f.status==="running";return!x&&!t&&!v?null:d.jsx("div",{className:"fixed bottom-12 left-0 right-0 z-50 pointer-events-none",children:d.jsxs("div",{className:`
|
|
367
|
+
pointer-events-auto mx-4 mb-2 bg-surface-900/95 backdrop-blur-lg rounded-2xl border border-surface-700/50 shadow-2xl
|
|
368
|
+
transition-all duration-300 ease-in-out
|
|
369
|
+
${m?"max-h-14":t?"max-h-[65vh]":"max-h-[35vh]"}
|
|
370
|
+
`,children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-700/50 cursor-pointer",onClick:()=>g(!m),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),d.jsx("h2",{className:"text-sm font-medium text-white",children:"Jobs Dashboard"}),v&&d.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:[d.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),f.name]}),n.length>0&&d.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&&d.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-surface-700 text-surface-400 rounded-full",children:[e.length," completed"]})]}),d.jsx("div",{className:"flex items-center gap-2",onClick:y=>y.stopPropagation(),children:e.length>0&&d.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&&d.jsxs("div",{className:`flex ${t?"h-[calc(65vh-3.5rem)]":"h-[calc(35vh-3.5rem)]"}`,children:[d.jsxs("div",{className:`${t?"w-80 border-r border-surface-700/50":"w-full"} overflow-y-auto p-4`,children:[v&&f&&d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-xs font-medium text-purple-400 uppercase tracking-wider mb-3",children:"Batch Operation"}),d.jsxs("div",{className:"bg-surface-800/50 rounded-xl p-4 border border-purple-500/20",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-sm font-medium text-white",children:f.name}),p&&d.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"})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-surface-400 mb-2",children:[d.jsxs("span",{children:[f.current," / ",f.total]}),d.jsx("span",{className:"text-surface-600",children:"•"}),d.jsx("span",{className:"text-purple-400",children:f.currentItem})]}),d.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full bg-gradient-to-r from-purple-500 to-accent-500 transition-all duration-300",style:{width:`${f.current/f.total*100}%`}})})]})]}),n.length>0&&d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-xs font-medium text-surface-500 uppercase tracking-wider mb-3",children:"Active Jobs"}),d.jsx("div",{className:"space-y-3",children:n.map(y=>d.jsx(WA,{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&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-medium text-surface-500 uppercase tracking-wider mb-3",children:"Recent Jobs"}),d.jsx("div",{className:"space-y-3",children:e.slice(0,10).map(y=>d.jsx(WA,{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&&d.jsxs("div",{className:"text-center py-8",children:[d.jsx("svg",{className:"w-12 h-12 text-surface-600 mx-auto mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("p",{className:"text-surface-500 text-sm",children:"No jobs yet"}),d.jsx("p",{className:"text-surface-600 text-xs mt-1",children:"Run a command to see it here"})]})]}),t&&d.jsx("div",{className:"flex-1 p-4",children:d.jsx(eue,{job:t,onCancel:()=>s(t.id),onClose:()=>r(null)})})]})]})})};function nue(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 rue(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 sue=({task:n,index:e,onRemove:t,onSkip:r,onRetry:s,onRunNow:i,isDraggable:a,onDragStart:o,onDragOver:u,onDrop:f,onDragEnd:p})=>{if(!n)return null;const m=rue(n.status||"pending"),g=n.status==="running",x=n.status==="pending",v=n.status==="failed",y=n.status==="completed"||n.status==="skipped";return d.jsxs("div",{draggable:a,onDragStart:o,onDragOver:u,onDrop:f,onDragEnd:p,className:`
|
|
371
|
+
relative p-3 rounded-lg border transition-all duration-200
|
|
372
|
+
${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"}
|
|
373
|
+
${a?"cursor-grab active:cursor-grabbing":""}
|
|
374
|
+
`,children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[a?d.jsx("div",{className:"text-surface-500 hover:text-surface-400 cursor-grab",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8h16M4 16h16"})})}):d.jsx("div",{className:"w-4"}),d.jsx("span",{className:"text-xs text-surface-500 font-mono w-4 text-center",children:e+1})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"flex items-start justify-between gap-2",children:d.jsx("h4",{className:"text-sm font-medium text-white truncate",title:n.displayCommand||"Task",children:n.displayCommand||"Task"})}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.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"&&d.jsxs("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),m.icon==="check"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),m.icon==="x"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),m.icon==="clock"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"&&d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})}),n.status]}),(g||y)&&n.startedAt&&d.jsx("span",{className:"text-xs text-surface-500",children:nue(n.startedAt,n.completedAt)}),n.jobId&&d.jsxs("span",{className:"text-xs text-surface-600 font-mono",children:["#",n.jobId.slice(-6)]})]}),n.error&&d.jsx("p",{className:"text-xs text-red-400 mt-1 truncate",title:n.error,children:n.error})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[x&&d.jsxs(d.Fragment,{children:[d.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:d.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]})}),d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})})]}),v&&d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),g&&d.jsx("div",{className:"mt-2 h-1 bg-surface-700 rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full w-1/3 bg-gradient-to-r from-accent-600 to-accent-400 rounded-full animate-indeterminate"})})]})},iue=({executionMode:n,isQueueRunning:e,isPaused:t,hasPendingTasks:r,hasCompletedTasks:s,hasAnyTasks:i,progress:a,onSetExecutionMode:o,onStartQueue:u,onPauseQueue:f,onResumeQueue:p,onRunNextTask:m,onClearCompleted:g,onClearAll:x})=>d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs text-surface-400",children:"Execution Mode"}),d.jsxs("div",{className:"flex items-center bg-surface-800 rounded-lg p-0.5 border border-surface-700",children:[d.jsx("button",{onClick:()=>o("auto"),className:`
|
|
375
|
+
px-3 py-1 text-xs font-medium rounded-md transition-colors
|
|
376
|
+
${n==="auto"?"bg-accent-600 text-white":"text-surface-400 hover:text-white"}
|
|
377
|
+
`,children:"Auto"}),d.jsx("button",{onClick:()=>o("manual"),className:`
|
|
378
|
+
px-3 py-1 text-xs font-medium rounded-md transition-colors
|
|
379
|
+
${n==="manual"?"bg-accent-600 text-white":"text-surface-400 hover:text-white"}
|
|
380
|
+
`,children:"Manual"})]})]}),i&&d.jsxs("div",{className:"flex items-center justify-between text-xs",children:[d.jsx("span",{className:"text-surface-400",children:"Progress"}),d.jsxs("span",{className:"text-surface-300",children:[a.completed," / ",a.total," completed"]})]}),i&&a.total>0&&d.jsx("div",{className:"h-1.5 bg-surface-700 rounded-full overflow-hidden",children:d.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}%`}})}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n==="auto"&&d.jsxs(d.Fragment,{children:[!e&&r&&d.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:[d.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[d.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"}),d.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&&d.jsxs("button",{onClick:f,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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.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:[d.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[d.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"}),d.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&&d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})}),"Run Next"]}),s&&d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Clear Completed"]}),i&&d.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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})]})]}),aue=({tasks:n,executionMode:e,isQueueRunning:t,isPaused:r,progress:s,onSetExecutionMode:i,onStartQueue:a,onPauseQueue:o,onResumeQueue:u,onRunNextTask:f,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?d.jsx("div",{className:"fixed top-16 right-4 z-40 pointer-events-none",style:{width:"380px"},children:d.jsxs("div",{className:`
|
|
381
|
+
pointer-events-auto bg-surface-900/95 backdrop-blur-lg rounded-2xl border border-surface-700/50 shadow-2xl
|
|
382
|
+
transition-all duration-300 ease-in-out
|
|
383
|
+
${S?"max-h-14":"max-h-[70vh]"}
|
|
384
|
+
`,children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-700/50 cursor-pointer",onClick:()=>Q(!S),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),d.jsxs("h2",{className:"text-sm font-medium text-white flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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&&d.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:[d.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Running"]}),t&&r&&d.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded-full",children:"Paused"}),d.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium bg-surface-700 text-surface-400 rounded-full",children:[s.pending," pending"]})]}),d.jsx("div",{className:"flex items-center gap-2",onClick:E=>E.stopPropagation(),children:d.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&&d.jsxs("div",{className:"max-h-[calc(70vh-3.5rem)] overflow-hidden flex flex-col",children:[d.jsx("div",{className:"px-4 py-3 border-b border-surface-700/30",children:d.jsx(iue,{executionMode:e,isQueueRunning:t,isPaused:r,hasPendingTasks:q,hasCompletedTasks:z,hasAnyTasks:L,progress:s,onSetExecutionMode:i,onStartQueue:a,onPauseQueue:o,onResumeQueue:u,onRunNextTask:f,onClearCompleted:v,onClearAll:y})}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[d.jsx("div",{className:"space-y-2",children:n.map((E,V)=>!E||!E.id?null:d.jsx(sue,{task:E,index:V,isDraggable:E.status==="pending",onRemove:()=>p(E.id),onSkip:()=>m(E.id),onRetry:()=>g(E.id),onRunNow:f,onDragStart:j(V),onDragOver:T(V),onDrop:R(V),onDragEnd:N},E.id))}),n.length===0&&d.jsxs("div",{className:"text-center py-8",children:[d.jsx("svg",{className:"w-12 h-12 text-surface-600 mx-auto mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("p",{className:"text-surface-500 text-sm",children:"Queue is empty"}),d.jsx("p",{className:"text-surface-600 text-xs mt-1",children:"Add tasks to run them in sequence"})]})]})]})]})}):null};function OS(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const gS=({option:n,value:e,onChange:t,compact:r=!1})=>{const s=`queue-option-${n.name}`;if(n.type==="checkbox")return d.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:[d.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"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`${r?"text-xs":"text-sm"} font-medium text-white group-hover:text-accent-300 transition-colors`,children:OS(n.name)}),d.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 d.jsxs("div",{className:r?"space-y-1.5":"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{htmlFor:s,className:`${r?"text-xs":"text-sm"} font-medium text-white`,children:OS(n.name)}),d.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})]}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400`,children:n.description}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"text-[10px] text-surface-500 w-6 text-right",children:i}),d.jsx("input",{type:"range",id:s,min:i,max:a,step:o,value:u,onChange:f=>t(parseFloat(f.target.value)),className:"flex-1 h-2 bg-surface-700 rounded-full appearance-none cursor-pointer accent-accent-500"}),d.jsx("span",{className:"text-[10px] text-surface-500 w-6",children:a})]})]})}return d.jsxs("div",{children:[d.jsxs("label",{htmlFor:s,className:`block ${r?"text-xs":"text-sm"} font-medium text-white mb-1.5`,children:[OS(n.name),n.required&&d.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),d.jsx("p",{className:`${r?"text-[10px]":"text-xs"} text-surface-400 mb-2`,children:n.description}),d.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"})]})},lue=({isOpen:n,prompt:e,preselectedCommand:t,onAddToQueue:r,onClose:s})=>{var S;const i=P.useMemo(()=>Object.values(Ea).filter(Q=>Q.requiresPrompt),[]),[a,o]=P.useState(t||null),[u,f]=P.useState(!1),[p,m]=P.useState({}),g=a?Ea[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===Ve.SUBMIT_EXAMPLE&&(e!=null&&e.example)&&(Q["verification-program"]=e.example),hr.forEach(k=>{Q[`_global_${k.name}`]=k.defaultValue}),m(Q)},[g,e]),ue.useEffect(()=>{n||(o(t||null),f(!1))},[n,t]);const x=(Q,k)=>{m($=>({...$,[Q]:k}))},v=()=>{if(!g||!e||!a)return;const Q=Y2(g.name,e,p);r(g.name,e,p,Q),s()},y=hr.some(Q=>p[`_global_${Q.name}`]!==Q.defaultValue);return n?Array.isArray(i)?d.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:d.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:[d.jsx("div",{className:"px-4 sm:px-6 py-4 border-b border-surface-700/50",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/20 flex items-center justify-center",children:d.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:"Add to Task Queue"}),d.jsx("p",{className:"text-xs sm:text-sm text-surface-400",children:"Queue this task for later execution"})]})]})}),d.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&&d.jsxs("div",{className:"bg-surface-800/50 rounded-xl px-3 py-2.5 border border-surface-700/50",children:[d.jsx("div",{className:"text-xs text-surface-400 mb-0.5",children:"Target Prompt"}),d.jsx("div",{className:"text-sm text-white font-mono truncate",children:e.sync_basename||((S=e.prompt)==null?void 0:S.split("/").pop())||"Unknown"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Command"}),d.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(Q=>Q&&d.jsxs("button",{onClick:()=>o(Q.name),className:`
|
|
385
|
+
flex items-center gap-2 px-3 py-2.5 rounded-xl text-sm text-left transition-all
|
|
386
|
+
${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"}
|
|
387
|
+
`,children:[d.jsx("span",{children:Q.icon||"▶"}),d.jsx("span",{className:"truncate",children:Q.shortDescription||Q.name})]},Q.name))})]}),g&&d.jsxs(d.Fragment,{children:[g.requiresCode&&d.jsx(ei,{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&&d.jsx(ei,{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&&d.jsx("div",{className:"space-y-3",children:g.options.map(Q=>d.jsx(gS,{option:Q,value:p[Q.name],onChange:k=>x(Q.name,k)},Q.name))}),d.jsxs("div",{className:"border-t border-surface-700/30 pt-3 mt-2",children:[d.jsxs("button",{type:"button",onClick:()=>f(!u),className:"w-full flex items-center justify-between text-left group",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-semibold text-surface-400 uppercase tracking-wider",children:"Advanced Options"}),y&&d.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-500 animate-pulse",title:"Custom settings applied"})]}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),u&&d.jsxs("div",{className:"mt-3 space-y-3 animate-slide-down",children:[d.jsxs("div",{className:"space-y-3 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider",children:"Model Settings"}),hr.filter(Q=>["strength","temperature","time"].includes(Q.name)).map(Q=>d.jsx(gS,{option:Q,value:p[`_global_${Q.name}`],onChange:k=>x(`_global_${Q.name}`,k),compact:!0},Q.name))]}),d.jsxs("div",{className:"space-y-1 p-3 rounded-xl bg-surface-800/20 border border-surface-700/30",children:[d.jsx("div",{className:"text-[10px] font-medium text-surface-500 uppercase tracking-wider mb-2",children:"Execution Options"}),hr.filter(Q=>["local","verbose","quiet","force","review-examples"].includes(Q.name)).map(Q=>d.jsx(gS,{option:Q,value:p[`_global_${Q.name}`],onChange:k=>x(`_global_${Q.name}`,k),compact:!0},Q.name))]})]})]})]})]}),d.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:[d.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"}),d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),d.jsx("span",{children:"Add to Queue"})]})]})]})}):(console.error("AddToQueueModal: availableCommands is not an array"),null):null},oue=({onReauth:n})=>{const[e,t]=P.useState(null),[r,s]=P.useState(!0);if(P.useEffect(()=>{const a=async()=>{try{const u=await Ne.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 d.jsxs("div",{className:"flex items-center gap-1.5 px-2 sm:px-3 py-1.5 rounded-full bg-surface-800/50",children:[d.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:d.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"})}),d.jsx("span",{className:"text-xs text-surface-400 hidden sm:inline",children:"Auth..."})]});const i=e==null?void 0:e.authenticated;return d.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:[d.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:d.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"})}),d.jsx("span",{className:"sr-only",children:i?"Cloud Authenticated - Click to manage authentication":"Not authenticated - Click to login"}),d.jsx("span",{className:"hidden xs:inline","aria-hidden":"true",children:i?"Logged In":"Login"}),d.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"}`})]})},cue=({onClose:n})=>{const[e,t]=P.useState(null),[r,s]=P.useState({phase:"idle"}),[i,a]=P.useState(!1),[o,u]=P.useState(!1),f=P.useRef(null);P.useEffect(()=>{(async()=>{try{const y=await Ne.getAuthStatus();t(y)}catch{t({authenticated:!1,cached:!1,expires_at:null})}})()},[]),P.useEffect(()=>()=>{f.current&&clearInterval(f.current)},[]);const p=P.useCallback(v=>{f.current&&clearInterval(f.current);const y=async()=>{try{const S=await Ne.pollLoginStatus(v);if(S.status==="completed"){f.current&&(clearInterval(f.current),f.current=null),s({phase:"success"});const Q=await Ne.getAuthStatus();t(Q)}else S.status==="expired"?(f.current&&(clearInterval(f.current),f.current=null),s({phase:"error",message:S.message||"Authentication timed out. Please try again."})):S.status==="error"&&(f.current&&(clearInterval(f.current),f.current=null),s({phase:"error",message:S.message||"Authentication failed."}))}catch(S){console.error("Poll error:",S)}};y(),f.current=window.setInterval(y,3e3)},[]),m=async()=>{s({phase:"starting"}),a(!1);try{const v=await Ne.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=()=>{f.current&&(clearInterval(f.current),f.current=null),s({phase:"idle"})};return d.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:d.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:[d.jsxs("header",{className:"flex items-center justify-between p-4 border-b border-gray-700",children:[d.jsxs("h2",{id:"reauth-modal-title",className:"text-lg font-semibold text-white flex items-center gap-2",children:[d.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.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:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("main",{className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-gray-700/50",children:[d.jsx("div",{className:`w-3 h-3 rounded-full ${e!=null&&e.authenticated?"bg-green-400":"bg-yellow-400 animate-pulse"}`}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-white",children:e!=null&&e.authenticated?"Currently Authenticated":"Not Authenticated"}),d.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"&&d.jsxs("div",{className:"space-y-3",children:[d.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."]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400 cursor-pointer hover:text-gray-300 transition-colors",children:[d.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"}),d.jsx("span",{children:"Don't open browser automatically (I'll open the link manually)"})]})]}),r.phase==="starting"&&d.jsxs("div",{className:"flex items-center justify-center gap-3 py-6",children:[d.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-400",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.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"})]}),d.jsx("span",{className:"text-gray-300",children:"Starting GitHub authentication..."})]}),r.phase==="waiting"&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"text-center space-y-2",children:[d.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:"}),d.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:[d.jsx("span",{className:"text-2xl font-mono font-bold text-white tracking-wider","aria-label":"Device verification code",children:r.userCode}),d.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:d.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&&d.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!"})]})]}),d.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-gray-400",children:[d.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.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"})]}),d.jsx("span",{children:"Waiting for authorization..."})]}),d.jsxs("p",{className:"text-xs text-center text-gray-500",children:[o?"Visit: ":"If the browser didn't open, go to: ",d.jsx("a",{href:r.verificationUri,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:underline",children:r.verificationUri})]})]}),r.phase==="success"&&d.jsxs("div",{className:"p-4 rounded-lg bg-green-500/20 border border-green-500/30 text-center space-y-2",children:[d.jsx("svg",{className:"w-12 h-12 mx-auto text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("p",{className:"text-green-300 font-medium",children:"Authentication Successful!"}),d.jsx("p",{className:"text-sm text-green-400/80",children:"You can now use PDD Cloud features."})]}),r.phase==="error"&&d.jsxs("div",{className:"p-4 rounded-lg bg-red-500/20 border border-red-500/30 space-y-3",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("p",{className:"text-sm text-red-300",children:r.message})]}),d.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"})]})]}),d.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:[d.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")&&d.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:[d.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:d.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 uue 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:d.jsx("div",{className:"min-h-screen bg-surface-950 flex items-center justify-center p-4",children:d.jsxs("div",{className:"bg-red-900/20 border border-red-500/50 rounded-xl p-6 max-w-2xl w-full",children:[d.jsx("h1",{className:"text-xl font-bold text-red-400 mb-4",children:"Something went wrong"}),d.jsxs("div",{className:"bg-surface-900 rounded-lg p-4 mb-4 overflow-auto max-h-64",children:[d.jsx("pre",{className:"text-sm text-red-300 whitespace-pre-wrap",children:(e=this.state.error)==null?void 0:e.toString()}),this.state.errorInfo&&d.jsx("pre",{className:"text-xs text-surface-400 mt-2 whitespace-pre-wrap",children:this.state.errorInfo.componentStack})]}),d.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 due=({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),f=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 d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-1.5 md:gap-2",children:[d.jsx("label",{className:"text-xs sm:text-sm text-surface-300 font-medium whitespace-nowrap",children:"Session:"}),d.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:[d.jsx("option",{value:"",children:"-- Select Session --"}),n.map(p=>d.jsxs("option",{value:p.sessionId,children:[p.projectName," @ ",p.metadata.hostname,p.status==="stale"?" (offline)":""]},p.sessionId))]}),n.length===0&&!s&&d.jsx("span",{className:"text-xs text-surface-500",children:"No sessions"}),s&&d.jsx("span",{className:"text-xs text-red-400",children:"⚠️ Error loading sessions"}),d.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&&d.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&&d.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:[d.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:[d.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"]}),d.jsx("span",{className:"hidden lg:inline text-xs text-surface-400",children:f(u.lastHeartbeat)}),d.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"&&d.jsx("div",{className:"mt-2 p-2 bg-yellow-500/10 border border-yellow-500/20 rounded-lg",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.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:d.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"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-medium text-yellow-400",children:"Session Offline"}),d.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&&d.jsxs("div",{className:"mt-2 p-3 bg-surface-900/50 border border-surface-700 rounded-lg text-xs",children:[d.jsx("div",{className:"font-semibold text-surface-300 mb-2",children:"🔍 Debug Information"}),d.jsxs("div",{className:"space-y-1 text-surface-400",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-surface-500 min-w-[100px]",children:"Sessions:"}),d.jsxs("span",{children:[n.length," found"]})]}),s&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-surface-500 min-w-[100px]",children:"Error:"}),d.jsx("span",{className:"text-red-400 flex-1 break-words",children:s})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-surface-500 min-w-[100px]",children:"Last Fetch:"}),d.jsx("span",{children:new Date().toLocaleTimeString()})]}),d.jsxs("div",{className:"mt-2 pt-2 border-t border-surface-700",children:[d.jsx("div",{className:"text-surface-500 mb-1",children:"Troubleshooting:"}),d.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-surface-400",children:[(s==null?void 0:s.includes("Not authenticated"))&&d.jsx("li",{children:"Not authenticated. Run: pdd auth login"}),(s==null?void 0:s.includes("401"))||(s==null?void 0:s.includes("403"))&&d.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"))&&d.jsx("li",{children:"Network issue. Check cloud connectivity."}),!s&&n.length===0&&d.jsx("li",{children:"No sessions found. Start one with: pdd connect"})]})]})]})]})]})},fue=({mode:n,onModeChange:e,disabled:t=!1})=>d.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[d.jsx("label",{className:"text-xs sm:text-sm text-surface-300 font-medium whitespace-nowrap",children:"Mode:"}),d.jsxs("div",{className:"flex bg-surface-800 border border-surface-700 rounded-lg p-0.5 sm:p-1",children:[d.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:[d.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:d.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"})}),d.jsx("span",{children:"Local"})]}),d.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:[d.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:d.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"})}),d.jsx("span",{children:"Remote"})]})]}),n==="remote"&&!t&&d.jsxs("span",{className:"hidden sm:flex text-xs text-purple-400 items-center gap-1",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})]}),hue=()=>{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},pue=3,IA=5;function mue(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 f=P.useCallback((q,z)=>{s(L=>{const E=new Map(L),V=E.get(q);if(V){const D=[...V.output,z];D.length>t&&D.splice(0,D.length-t),E.set(q,{...V,output:D})}return E})},[t]),p=P.useCallback((q,z,L,E)=>{s(V=>{const D=new Map(V),C=D.get(q);return C&&D.set(q,{...C,progress:{current:z,total:L,message:E},status:"running"}),D})},[]),m=P.useCallback((q,z,L,E)=>{s(D=>{const C=new Map(D),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 W={...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,W),e&&e(W,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>=IA)throw new Error(`Too many jobs queued (${E}/${IA}). Please wait for some to complete.`);E>=pue&&console.warn(`Warning: ${E} jobs already running. New job will be queued.`);try{const V=await Ne.executeCommand(q),D=V.job_id,C={id:D,command:q.command,displayCommand:z,status:V.status,progress:null,output:[],cost:0,startedAt:new Date,completedAt:null,error:null};s(A=>{const W=new Map(A);return W.set(D,C),W}),a(D);const G=Ne.connectToJobStream(D,{onStdout:A=>f(D,A),onStderr:A=>f(D,`[stderr] ${A}`),onProgress:(A,W,H)=>p(D,A,W,H),onComplete:(A,W,H)=>m(D,A,H,W),onError:A=>{console.error(`WebSocket error for job ${D}:`,A),m(D,!1,0,{error:A.message})},onClose:()=>{const A=u.current.get(D);A&&A.status==="running"&&Ne.getJobStatus(D).then(W=>{const H=W.status==="completed";m(D,H,W.cost||0,W)}).catch(()=>{m(D,!1,0,{error:"Connection lost"})})}});return o.current.set(D,G),D}catch(V){return console.error("Failed to submit job:",V),null}},[f,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 Ne.cancelRemoteCommand({sessionId:E.metadata.sessionId,commandId:q}),s(D=>{const C=new Map(D),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&&Ne.sendCancelRequest(V),await Ne.cancelJob(q),s(D=>{const C=new Map(D),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)}`,D={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,D),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 D={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,"",D[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 Ne.getSpawnedJobStatus(L.id);if(E.status==="completed"||E.status==="failed"){const V=E.status==="completed";s(D=>{const C=new Map(D),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 D,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((D=G.metadata)!=null&&D.sessionId)try{const A=await Ne.getRemoteCommandStatus(G.metadata.sessionId,G.id);if(!A)continue;if(A.status==="processing"&&((C=A.response)!=null&&C.streaming)&&s(W=>{var ee,X;const H=new Map(W),U=H.get(G.id);if(U&&U.status==="running"){const B=[];if((ee=A.response)!=null&&ee.stdout){const K=A.response.stdout.split(`
|
|
388
|
+
`).filter(Z=>Z.trim());B.push(...K)}if((X=A.response)!=null&&X.stderr){const K=A.response.stderr.split(`
|
|
389
|
+
`).filter(Z=>Z.trim());B.push(...K.map(Z=>`[stderr] ${Z}`))}if(B.length>0){const K=U.output.length<=3&&U.output.some(Z=>Z.includes("Command running")||Z.includes("Status will update"));H.set(G.id,{...U,output:B})}}return H}),A.status==="completed"||A.status==="failed"||A.status==="cancelled"){const W=A.status==="completed",H=A.status==="cancelled";let U=null;s(ee=>{var K,Z,I,J,ne;const X=new Map(ee),B=X.get(G.id);if(B&&(B.status==="running"||B.status==="queued")){const ce=[];if((K=A.response)!=null&&K.stdout){const ke=A.response.stdout.split(`
|
|
390
|
+
`).filter(Me=>Me.trim());ce.push(...ke)}if((Z=A.response)!=null&&Z.stderr){const ke=A.response.stderr.split(`
|
|
391
|
+
`).filter(Me=>Me.trim());ce.push(...ke.map(Me=>`[stderr] ${Me}`))}H?ce.push("","⚠ Command was cancelled"):W?ce.push("","✓ Command completed successfully"):ce.push("",`✗ Command failed: ${((I=A.response)==null?void 0:I.message)||"Unknown error"}`);const xe={...B,status:H?"cancelled":W?"completed":"failed",completedAt:new Date,output:ce.length>0?ce:B.output,cost:((J=A.response)==null?void 0:J.cost)||0,error:W?null:((ne=A.response)==null?void 0:ne.message)||"Command failed"};X.set(G.id,xe),U={job:xe,success:W}}return X}),U&&e&&e(U.job,U.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 HA="pdd-task-queue",FA=50;function Oue(){return`task-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function gue(n={}){const{onTaskStart:e,onTaskComplete:t,onQueueComplete:r}=n,[s,i]=P.useState([]),[a,o]=P.useState("manual"),[u,f]=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 U=localStorage.getItem(HA);if(U){const{tasks:ee,executionMode:X}=JSON.parse(U);if(Array.isArray(ee)){const B=ee.filter(K=>K.status==="pending").map(K=>({...K,createdAt:new Date(K.createdAt)}));i(B)}(X==="auto"||X==="manual")&&o(X)}}catch(U){console.warn("Failed to restore task queue from localStorage:",U)}},[]),P.useEffect(()=>{try{const U=s.filter(ee=>ee.status==="pending");localStorage.setItem(HA,JSON.stringify({tasks:U,executionMode:a}))}catch(U){console.warn("Failed to save task queue to localStorage:",U)}},[s,a]);const y=P.useCallback((U,ee,X,B)=>{const K={id:Oue(),commandType:U,prompt:ee,rawOptions:X,displayCommand:B,status:"pending",createdAt:new Date};return i(Z=>Z.length>=FA?(console.warn(`Task queue is full (${FA} items). Cannot add more tasks.`),Z):[...Z,K]),K.id},[]),S=P.useCallback(U=>{i(ee=>ee.filter(X=>X.id!==U))},[]),Q=P.useCallback((U,ee)=>{i(X=>{var Z;const B=[...X];if(((Z=B[U])==null?void 0:Z.status)!=="pending")return X;const[K]=B.splice(U,1);return B.splice(ee,0,K),B})},[]),k=P.useCallback(()=>{i([]),f(!1),m(!1)},[]),$=P.useCallback(()=>{i(U=>U.filter(ee=>ee.status==="pending"||ee.status==="running"))},[]),j=P.useCallback((U,ee)=>{i(X=>X.map(B=>B.id===U?{...B,...ee}:B))},[]),T=P.useCallback(async()=>{var X,B,K,Z,I,J,ne,ce;const U=g.current;if(U.isPaused)return;const ee=U.tasks.find(xe=>xe.status==="pending");if(!ee){f(!1),(B=(X=x.current).onQueueComplete)==null||B.call(X);return}if(!v.current){console.error("submitJob function not set. Cannot run task.");return}j(ee.id,{status:"running",startedAt:new Date}),(Z=(K=x.current).onTaskStart)==null||Z.call(K,ee);try{const xe=await v.current(ee);xe?j(ee.id,{jobId:xe}):(j(ee.id,{status:"failed",completedAt:new Date,error:"Failed to submit job"}),(J=(I=x.current).onTaskComplete)==null||J.call(I,{...ee,status:"failed"},!1),U.executionMode==="auto"&&U.isQueueRunning&&!U.isPaused&&setTimeout(()=>T(),100))}catch(xe){const ke=xe instanceof Error?xe.message:"Unknown error";j(ee.id,{status:"failed",completedAt:new Date,error:ke}),(ce=(ne=x.current).onTaskComplete)==null||ce.call(ne,{...ee,status:"failed"},!1),U.executionMode==="auto"&&U.isQueueRunning&&!U.isPaused&&setTimeout(()=>T(),100)}},[j]),R=P.useCallback((U,ee)=>{var Z,I;const X=g.current.tasks.find(J=>J.jobId===U);if(!X)return;const B=ee?"completed":"failed";j(X.id,{status:B,completedAt:new Date,error:ee?void 0:"Job failed"}),(I=(Z=x.current).onTaskComplete)==null||I.call(Z,{...X,status:B},ee);const K=g.current;K.executionMode==="auto"&&K.isQueueRunning&&!K.isPaused&&setTimeout(()=>T(),100)},[j,T]),N=P.useCallback(async()=>{f(!0),m(!1),await T()},[T]),q=P.useCallback(()=>{m(!0)},[]),z=P.useCallback(async()=>{m(!1),g.current.tasks.some(ee=>ee.status==="running")||await T()},[T]),L=P.useCallback(async()=>{u||f(!0),m(!1),await T()},[T,u]),E=P.useCallback(U=>{var X,B;const ee=g.current.tasks.find(K=>K.id===U);if(ee&&(j(U,{status:"skipped",completedAt:new Date}),(B=(X=x.current).onTaskComplete)==null||B.call(X,{...ee,status:"skipped"},!1),ee.status==="running"||ee.status==="pending")){const K=g.current;K.executionMode==="auto"&&K.isQueueRunning&&!K.isPaused&&setTimeout(()=>T(),100)}},[j,T]),V=P.useCallback(U=>{j(U,{status:"pending",jobId:void 0,startedAt:void 0,completedAt:void 0,error:void 0})},[j]),D=P.useCallback(U=>{v.current=U},[]),C=s.filter(U=>U.status==="pending"),G=s.filter(U=>U.status==="completed"||U.status==="failed"||U.status==="skipped"),A=s.find(U=>U.status==="running")||null,W=A!==null,H={total:s.length,completed:G.length,pending:C.length,running:W?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:D}}const v6=P.createContext(null);async function xue(){return"Notification"in window?Notification.permission==="granted"?!0:Notification.permission!=="denied"?await Notification.requestPermission()==="granted":!1:!1}function bue(n,e,t){Notification.permission==="granted"&&new Notification(n,{body:e,icon:"/favicon.ico",silent:!1})}const yue=({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:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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 d.jsxs("div",{className:`
|
|
392
|
+
flex items-center gap-3 px-4 py-3 rounded-xl border backdrop-blur-lg shadow-lg
|
|
393
|
+
${r.bg} ${r.border}
|
|
394
|
+
`,style:{animation:"slideIn 0.3s ease-out"},children:[d.jsx("span",{className:r.text,children:r.icon}),d.jsx("p",{className:"text-sm text-white flex-1",children:n.message}),d.jsx("button",{onClick:e,className:"text-surface-400 hover:text-white transition-colors",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})},vue=()=>d.jsx("style",{children:`
|
|
395
|
+
@keyframes slideIn {
|
|
396
|
+
from {
|
|
397
|
+
transform: translateX(100%);
|
|
398
|
+
opacity: 0;
|
|
399
|
+
}
|
|
400
|
+
to {
|
|
401
|
+
transform: translateX(0);
|
|
402
|
+
opacity: 1;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
@keyframes indeterminate {
|
|
406
|
+
0% {
|
|
407
|
+
transform: translateX(-100%);
|
|
408
|
+
}
|
|
409
|
+
100% {
|
|
410
|
+
transform: translateX(400%);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
.animate-indeterminate {
|
|
414
|
+
animation: indeterminate 1.5s ease-in-out infinite;
|
|
415
|
+
}
|
|
416
|
+
`}),wue=({toasts:n,removeToast:e})=>d.jsxs(d.Fragment,{children:[d.jsx(vue,{}),n.length>0&&d.jsx("div",{className:"fixed top-4 right-4 z-[100] space-y-2 max-w-sm",children:n.map(t=>d.jsx(yue,{toast:t,onDismiss:()=>e(t.id)},t.id))})]}),Sue=({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 f={id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,message:i,type:a,duration:o};t(p=>[...p,f]),document.hidden&&(a==="success"||a==="error")&&bue(a==="success"?"Job Completed":"Job Failed",i)},[]);return P.useEffect(()=>{xue()},[]),d.jsxs(v6.Provider,{value:{addToast:s,removeToast:r},children:[n,d.jsx(wue,{toasts:e,removeToast:r})]})};function Que(){const n=P.useContext(v6);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const KA="pdd-audio-notifications-enabled";let xS=null;function kue(){return xS||(xS=new AudioContext),xS}async function JA(n){try{const e=kue();e.state==="suspended"&&await e.resume(),n?(fp(e,880,0,.15),fp(e,1108.73,.12,.2)):(fp(e,440,0,.2),fp(e,349.23,.15,.25))}catch(e){console.warn("Audio notification failed:",e)}}function fp(n,e,t,r){const s=n.createOscillator(),i=n.createGain();s.connect(i),i.connect(n.destination),s.type="sine",s.frequency.value=e;const a=n.currentTime;i.gain.setValueAtTime(0,a+t),i.gain.linearRampToValueAtTime(.5,a+t+.02),i.gain.exponentialRampToValueAtTime(.01,a+t+r),s.start(a+t),s.stop(a+t+r)}function $ue(){const[n,e]=P.useState(()=>{try{const a=localStorage.getItem(KA);return a===null?!0:a==="true"}catch{return!0}}),t=P.useRef(n);t.current=n;const r=P.useCallback(a=>{e(a);try{localStorage.setItem(KA,String(a))}catch{}},[]),s=P.useCallback(a=>{t.current&&JA(a)},[]),i=P.useCallback(a=>{JA(a)},[]);return{audioEnabled:n,setAudioEnabled:r,playNotification:s,testSound:i}}const eq=()=>{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}},Tue=()=>{const n=eq(),[e,t]=P.useState(n.view),[r,s]=P.useState(n.promptPath),[i,a]=P.useState(null),[o,u]=P.useState(null),[f,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),[D,C]=P.useState(!1),[G,A]=P.useState(null),{addToast:W}=Que(),{audioEnabled:H,setAudioEnabled:U,playNotification:ee,testSound:X}=$ue(),B=P.useCallback(()=>{const ge=!H;U(ge),ge&&X(!0)},[H,U,X]),[K,Z]=P.useState("local"),[I,J]=P.useState([]),[ne,ce]=P.useState(null),[xe,ke]=P.useState(null),[Me,se]=P.useState(!1),be=gue({onTaskStart:ge=>{W(`Starting task: ${ge.displayCommand}`,"info",3e3)},onTaskComplete:(ge,Qe)=>{W(`Task ${Qe?"completed":"failed"}: ${ge.displayCommand}`,Qe?"success":"error",5e3),ee(Qe)},onQueueComplete:()=>{W("Task queue completed","success",3e3),ee(!0)}}),Oe=P.useCallback((ge,Qe)=>{W(`${ge.displayCommand} ${Qe?"completed successfully":"failed"}`,Qe?"success":"error",5e3),ee(Qe),be.handleJobComplete(ge.id,Qe)},[W,ee,be]),{activeJobs:ye,completedJobs:Fe,selectedJob:Te,isAnyJobRunning:we,cancelJob:Ke,removeJob:ct,clearCompletedJobs:at,setSelectedJobId:yt,addSpawnedJob:Ye,markSpawnedJobDone:tt,markJobStatus:gn}=mue({onJobComplete:Oe}),kt=P.useCallback(async ge=>{try{const{args:Qe,options:Re,displayCommand:Je,backendName:Tt}=Nj(ge.commandType,ge.prompt,ge.rawOptions);if(K==="remote"&&ne){const{commandId:Ft}=await Ne.submitRemoteCommand({sessionId:ne,type:Tt,payload:{args:Qe,options:Re}});return Ye(`[Remote] ${Je}`,Tt,Ft,{remote:!0,sessionId:ne}),Ft}else{const Ft=await Ne.spawnTerminal({command:Tt,args:Qe,options:Re});return Ft.success&&Ft.job_id?(Ye(Je,Tt,Ft.job_id),Ft.job_id):(console.error("Failed to spawn terminal:",Ft.message),null)}}catch(Qe){return console.error("Failed to submit job:",Qe),null}},[Ye,K,ne]);P.useEffect(()=>{be.setSubmitJob(kt)},[be,kt]);const Zt=P.useCallback((ge,Qe,Re,Je)=>{be.addTask(ge,Qe,Re,Je),W(`Added to queue: ${Je}`,"info",3e3)},[be,W]);P.useCallback(ge=>{A(ge),C(!0)},[]),P.useEffect(()=>{Ne.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 ge=()=>{const{view:Qe,promptPath:Re}=eq();t(Qe),Re?s(Re):u(null)};return window.addEventListener("hashchange",ge),()=>window.removeEventListener("hashchange",ge)},[]),P.useEffect(()=>{Q&&r&&Ne.listPrompts().then(ge=>{const Qe=ge.find(Re=>Re.prompt===r);Qe&&u(Qe),s(void 0)}).catch(()=>{s(void 0)})},[Q,r]),P.useEffect(()=>{if(!Q)return;const ge=async()=>{try{const Re=await Ne.listRemoteSessions();J(Re),ke(null)}catch(Re){const Je=Re instanceof Error?Re.message:String(Re);console.error("Failed to fetch remote sessions:",Je),ke(Je),Je.includes("Not authenticated")||Je.includes("401")||Je.includes("403")||(Je.includes("timeout")||Je.includes("network")||Je.includes("Failed to fetch")?W("Network error: Cannot reach cloud. Check your connection.","error",5e3):W(`Failed to load remote sessions: ${Je}`,"error",5e3))}};ge();const Qe=setInterval(ge,3e4);return()=>clearInterval(Qe)},[Q,W]);const $t=async(ge,Qe,Re)=>{if(!Q){alert('Server not connected. Run "pdd connect" in your terminal first.');return}const Je=Ea[ge];p(!0),g("running");const{args:Tt,options:Ft,displayCommand:_n}=Nj(ge,Qe,Re||{});v(_n);try{if(K==="remote"&&ne){const xn=I.find(bn=>bn.sessionId===ne);if((xn==null?void 0:xn.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
417
|
+
|
|
418
|
+
The remote machine may not be running or has lost connection.
|
|
419
|
+
The command may not be executed.
|
|
420
|
+
|
|
421
|
+
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:bn}=await Ne.submitRemoteCommand({sessionId:ne,type:Je.backendName,payload:{args:Tt,options:Ft}});Ye(`[Remote] ${_n}`,Je.backendName,bn,{remote:!0,sessionId:ne}),g("success"),W("Command submitted to remote session","success",3e3)}catch(bn){g("failed"),W(`Failed to submit remote command: ${bn instanceof Error?bn.message:String(bn)}`,"error",5e3)}}else{const xn=await Ne.spawnTerminal({command:Je.backendName,args:Tt,options:Ft});xn.success?(Ye(_n,Je.backendName,xn.job_id),g("success"),W(`Opened terminal: ${_n}`,"success",3e3)):(g("failed"),W(`Failed to open terminal: ${xn.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(xn){console.error("Failed to execute command:",xn),S({success:!1,message:xn.message||"Failed to execute command",exit_code:1,error_details:xn.message}),g("failed"),W(`Error: ${xn.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},1e4)}finally{p(!1)}},rn=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 ge=`pdd bug ${$}`;v(ge);try{if(K==="remote"&&ne){const Qe=I.find(Re=>Re.sessionId===ne);if((Qe==null?void 0:Qe.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
422
|
+
|
|
423
|
+
The remote machine may not be running or has lost connection.
|
|
424
|
+
The command may not be executed.
|
|
425
|
+
|
|
426
|
+
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:Re}=await Ne.submitRemoteCommand({sessionId:ne,type:"bug",payload:{args:{args:[$]},options:{}}});Ye(`[Remote] ${ge}`,"bug",Re,{remote:!0,sessionId:ne}),g("success"),W("Command submitted to remote session","success",3e3)}catch(Re){g("failed"),W(`Failed to submit remote command: ${Re instanceof Error?Re.message:String(Re)}`,"error",5e3)}}else{const Qe=await Ne.spawnTerminal({command:"bug",args:{args:[$]},options:{}});Qe.success?(Ye(ge,"bug",Qe.job_id),g("success"),W(`Opened terminal: ${ge}`,"success",3e3)):(g("failed"),W(`Failed to open terminal: ${Qe.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(Qe){console.error("Failed to execute bug command:",Qe),g("failed"),W(`Error: ${Qe.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},5e3)}finally{p(!1)}},dn=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 ge=`pdd fix ${T}`;v(ge);try{if(K==="remote"&&ne){const Qe=I.find(Re=>Re.sessionId===ne);if((Qe==null?void 0:Qe.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
427
|
+
|
|
428
|
+
The remote machine may not be running or has lost connection.
|
|
429
|
+
The command may not be executed.
|
|
430
|
+
|
|
431
|
+
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:Re}=await Ne.submitRemoteCommand({sessionId:ne,type:"fix",payload:{args:{args:[T]},options:{}}});Ye(`[Remote] ${ge}`,"fix",Re,{remote:!0,sessionId:ne}),g("success"),W("Command submitted to remote session","success",3e3)}catch(Re){g("failed"),W(`Failed to submit remote command: ${Re instanceof Error?Re.message:String(Re)}`,"error",5e3)}}else{const Qe=await Ne.spawnTerminal({command:"fix",args:{args:[T]},options:{}});Qe.success?(Ye(ge,"fix",Qe.job_id),g("success"),W(`Opened terminal: ${ge}`,"success",3e3)):(g("failed"),W(`Failed to open terminal: ${Qe.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(Qe){console.error("Failed to execute fix command:",Qe),g("failed"),W(`Error: ${Qe.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},5e3)}finally{p(!1)}},pt=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 ge=`pdd change ${N}`;v(ge);try{if(K==="remote"&&ne){const Qe=I.find(Re=>Re.sessionId===ne);if((Qe==null?void 0:Qe.status)==="stale"&&!window.confirm(`Warning: The selected session appears to be offline (stale).
|
|
432
|
+
|
|
433
|
+
The remote machine may not be running or has lost connection.
|
|
434
|
+
The command may not be executed.
|
|
435
|
+
|
|
436
|
+
Do you want to submit anyway?`)){p(!1),g("idle");return}try{const{commandId:Re}=await Ne.submitRemoteCommand({sessionId:ne,type:"change",payload:{args:{args:[N]},options:{}}});Ye(`[Remote] ${ge}`,"change",Re,{remote:!0,sessionId:ne}),g("success"),W("Command submitted to remote session","success",3e3)}catch(Re){g("failed"),W(`Failed to submit remote command: ${Re instanceof Error?Re.message:String(Re)}`,"error",5e3)}}else{const Qe=await Ne.spawnTerminal({command:"change",args:{args:[N]},options:{}});Qe.success?(Ye(ge,"change",Qe.job_id),g("success"),W(`Opened terminal: ${ge}`,"success",3e3)):(g("failed"),W(`Failed to open terminal: ${Qe.message}`,"error",5e3))}setTimeout(()=>{g("idle"),v(null)},3e3)}catch(Qe){console.error("Failed to execute change command:",Qe),g("failed"),W(`Error: ${Qe.message}`,"error",5e3),setTimeout(()=>{g("idle"),v(null)},5e3)}finally{p(!1)}},Dt=(ge,Qe)=>{o&&$t(ge,o,Qe)},ut=(ge,Qe)=>{if(o){const Re=Qe||{},Je=Y2(ge,o,Re);Zt(ge,o,Re,Je)}},lt=async()=>{try{(await Ne.cancelCommand()).cancelled&&(g("failed"),v(null),setTimeout(()=>g("idle"),3e3))}catch(ge){console.error("Failed to cancel:",ge)}},Pt=P.useCallback((ge,Qe)=>{L({id:`batch-${Date.now()}`,name:ge,current:0,total:Qe,currentItem:"",status:"running",startedAt:new Date})},[]),vt=P.useCallback((ge,Qe,Re)=>{L(Je=>Je?{...Je,current:ge,total:Qe,currentItem:Re}:null)},[]),sn=P.useCallback(ge=>{L(Qe=>Qe?{...Qe,status:ge?"completed":"failed"}:null),setTimeout(()=>L(null),3e3)},[]),vr=P.useCallback(async()=>{try{await Ne.cancelCommand()}catch(ge){console.error("Failed to cancel batch operation:",ge)}},[]);return o?d.jsx(pee,{prompt:o,onBack:()=>u(null),onRunCommand:Dt,onAddToQueue:ut,isExecuting:f,executionStatus:m,lastCommand:x,lastRunResult:y,onCancelCommand:lt}):d.jsx(uue,{children:d.jsxs("div",{className:"min-h-screen bg-surface-950",children:[d.jsx("header",{className:"glass sticky top-0 z-40 border-b border-surface-700/50",children:d.jsx("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 2xl:px-12",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",children:[d.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:d.jsxs("svg",{viewBox:"0 0 1024 1024",className:"w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("defs",{children:d.jsxs("filter",{id:"glow-header",x:"-60%",y:"-60%",width:"220%",height:"220%",children:[d.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"40",result:"blur"}),d.jsxs("feMerge",{children:[d.jsx("feMergeNode",{in:"blur"}),d.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),d.jsxs("g",{stroke:"#00e3ff",strokeWidth:"60",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",filter:"url(#glow-header)",children:[d.jsx("path",{d:"M 260 180 H 600 A 230 230 0 0 1 600 660 H 480 L 260 880 V 180 Z"}),d.jsx("polyline",{points:"505 340 585 420 505 500"})]})]})}),d.jsx("div",{className:"hidden sm:block",children:d.jsx("h1",{className:"text-base sm:text-lg font-bold text-white whitespace-nowrap",children:"Prompt Driven Development"})})]}),d.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:[d.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:[d.jsx(UJ,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Architecture"]}),d.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:[d.jsx(Bz,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Prompts"]}),d.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:[d.jsx(Ex,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Bug"]}),d.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:[d.jsx("svg",{className:"hidden sm:inline w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.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:[d.jsx("svg",{className:"hidden sm:inline w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.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:[d.jsx(Wz,{className:"hidden sm:inline w-4 h-4 mr-1"}),"Settings"]})]}),d.jsxs("button",{onClick:()=>se(!Me),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 ${K==="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:Me?"Hide remote session panel":"Show remote session panel",children:[d.jsx("span",{"aria-hidden":"true",children:K==="remote"?"🌐":"💻"}),d.jsx("span",{className:"sr-only",children:K==="remote"?"Remote execution mode":"Local execution mode"}),d.jsx("span",{className:"hidden sm:inline",children:K==="remote"?"Remote":"Local"}),d.jsx("svg",{className:`w-3 h-3 transition-transform ${Me?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),d.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:[d.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"}`}),d.jsx("span",{className:"hidden xs:inline",children:Q?"Connected":"Offline"})]}),d.jsx("button",{onClick:B,className:`p-1.5 rounded-lg transition-colors ${H?"text-accent-400 hover:bg-accent-500/20":"text-surface-500 hover:bg-surface-700/50"}`,title:H?"Sound notifications on":"Sound notifications off",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:H?d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}):d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15zm11.707-6.707l4 4m0-4l-4 4"})})}),d.jsx(oue,{onReauth:()=>V(!0)})]})})}),Me&&d.jsx("div",{className:"glass border-b border-surface-700/50 animate-slide-down",children:d.jsxs("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 2xl:px-12 py-3",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-3 sm:gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs text-surface-400",children:"Mode:"}),d.jsx(fue,{mode:K,onModeChange:Z})]}),d.jsxs("button",{onClick:B,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all ${H?"bg-accent-500/20 text-accent-300 hover:bg-accent-500/30":"bg-surface-700/50 text-surface-400 hover:bg-surface-700"}`,title:H?"Audio notifications enabled - click to disable":"Audio notifications disabled - click to enable",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:H?d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}):d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15zm11.707-6.707l4 4m0-4l-4 4"})}),d.jsx("span",{className:"hidden sm:inline",children:H?"Sound On":"Sound Off"})]}),K==="remote"&&d.jsx("div",{className:"flex-1 w-full sm:w-auto",children:d.jsx(due,{sessions:I,selectedSessionId:ne,onSelectSession:ce,error:xe,onRefresh:async()=>{try{const ge=await Ne.listRemoteSessions();J(ge),ke(null)}catch(ge){ke(ge instanceof Error?ge.message:String(ge))}}})}),d.jsx("button",{onClick:()=>se(!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:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx("p",{className:"text-xs text-surface-500 mt-2",children:K==="local"?"Commands execute on this machine in terminal windows.":ne?"Commands will be sent to the selected remote session via cloud.":"Select a remote session to execute commands remotely."})]})}),m!=="idle"&&d.jsxs("div",{className:`
|
|
437
|
+
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
|
|
438
|
+
${m==="running"?"bg-accent-500/10 text-accent-300 border-accent-500/20":""}
|
|
439
|
+
${m==="success"?"bg-green-500/10 text-green-300 border-green-500/20":""}
|
|
440
|
+
${m==="failed"?"bg-red-500/10 text-red-300 border-red-500/20":""}
|
|
441
|
+
`,children:[m==="running"&&d.jsxs("span",{className:"flex items-center justify-center gap-2 flex-wrap",children:[d.jsxs("svg",{className:"animate-spin h-4 w-4 flex-shrink-0",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),d.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"})]}),d.jsx("span",{className:"hidden sm:inline",children:"Running:"}),d.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}),d.jsx("span",{className:"text-surface-400 hidden md:inline",children:"(output in terminal)"}),d.jsx("button",{onClick:async()=>{try{(await Ne.cancelCommand()).cancelled&&(g("failed"),v(null),setTimeout(()=>g("idle"),3e3))}catch(ge){console.error("Failed to cancel:",ge)}},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"&&d.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Command completed successfully"]}),m==="failed"&&d.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),d.jsx("span",{className:"hidden sm:inline",children:"Command failed or cancelled - check terminal"}),d.jsx("span",{className:"sm:hidden",children:"Command failed"})]})]}),d.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&&d.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:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-yellow-500/20 flex items-center justify-center flex-shrink-0",children:d.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-yellow-300 text-sm sm:text-base font-medium",children:"Server not connected"}),d.jsxs("p",{className:"text-yellow-200/70 text-xs sm:text-sm mt-1",children:["Run ",d.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"?d.jsx("div",{className:"animate-fade-in",children:d.jsx(Gce,{serverConnected:Q,isExecuting:f,onOpenPromptSpace:ge=>u(ge),onBatchStart:Pt,onBatchProgress:vt,onBatchComplete:sn,executionMode:K,selectedRemoteSession:ne,onRemoteJobSubmitted:(ge,Qe,Re,Je)=>{Ye(ge,Qe,Re,{remote:!0,sessionId:Je})}})}):e==="prompts"?d.jsxs("div",{className:"animate-fade-in",children:[d.jsx("div",{className:"mb-4 sm:mb-6",children:d.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."})}),d.jsx(tY,{onSelectPrompt:a,onEditPrompt:u,onCreatePrompt:u,selectedPrompt:i})]}):e==="settings"?d.jsx("div",{className:"animate-fade-in",children:d.jsx(Fce,{})}):e==="bug"?d.jsxs("div",{className:"max-w-6xl mx-auto animate-fade-in",children:[d.jsxs("div",{className:"mb-6 text-center sm:text-left",children:[d.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:[d.jsx("span",{className:"w-10 h-10 rounded-xl bg-red-500/20 flex items-center justify-center",children:d.jsx(Ex,{className:"w-5 h-5"})}),"Bug Investigation Agent"]}),d.jsx("p",{className:"text-surface-400 text-sm",children:"Automatically investigate GitHub issues and generate failing test cases with AI-powered analysis."})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-6 border border-surface-700/50",children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:"GitHub Issue URL"}),d.jsx("input",{type:"url",value:$,onChange:ge=>j(ge.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:f}),d.jsxs("button",{onClick:rn,disabled:f||!Q||!$.trim(),className:`
|
|
442
|
+
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
|
|
443
|
+
${f||!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"}
|
|
444
|
+
`,children:[d.jsx(Ex,{className:"w-4 h-4"}),d.jsx("span",{children:"Start Investigation"})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"GitHub CLI installed"})," - Install from ",d.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"brew install gh"})," or ",d.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 hover:underline",children:"cli.github.com"})]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Authenticated with GitHub"})," - Run ",d.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"gh auth login"})," if needed"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Repository cloned locally"})," - The agent works within your local codebase"]})]})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"1."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Review the draft PR"})," - The agent creates a draft PR with a failing test"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"2."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Fix the bug"})," - Implement the fix to make the test pass"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"3."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Mark PR ready"})," - Convert from draft to ready for review"]})]})]})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Agent Workflow (10 Steps)"]}),d.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(ge=>d.jsxs("div",{className:"flex items-start gap-3 py-1.5 px-2 rounded-lg hover:bg-surface-800/30 transition-colors",children:[d.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:ge.step}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs text-white font-medium",children:ge.name}),d.jsx("p",{className:"text-[11px] text-surface-500",children:ge.desc})]})]},ge.step))}),d.jsx("div",{className:"mt-4 pt-3 border-t border-surface-700/50",children:d.jsxs("p",{className:"text-xs text-surface-500",children:[d.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"?d.jsxs("div",{className:"max-w-6xl mx-auto animate-fade-in",children:[d.jsxs("div",{className:"mb-6 text-center sm:text-left",children:[d.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:[d.jsx("span",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center",children:d.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsx("p",{className:"text-surface-400 text-sm",children:"Automatically fix code issues based on PR review comments with AI-powered analysis."})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-6 border border-surface-700/50",children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:"GitHub PR URL"}),d.jsx("input",{type:"url",value:T,onChange:ge=>R(ge.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:f}),d.jsxs("button",{onClick:dn,disabled:f||!Q||!T.trim(),className:`
|
|
445
|
+
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
|
|
446
|
+
${f||!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"}
|
|
447
|
+
`,children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:"Start Fix"})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"GitHub CLI installed"})," - Install from ",d.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"brew install gh"})," or ",d.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 hover:underline",children:"cli.github.com"})]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Authenticated with GitHub"})," - Run ",d.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"gh auth login"})," if needed"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"PR has review comments"})," - The agent analyzes review comments to understand what needs fixing"]})]})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"1."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Review the changes"})," - The agent commits fixes addressing review comments"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"2."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Run tests"})," - Verify the fixes don't break existing functionality"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"3."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Push changes"})," - Push the fix commits to update the PR"]})]})]})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Agent Workflow"]}),d.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(ge=>d.jsxs("div",{className:"flex items-start gap-3 py-1.5 px-2 rounded-lg hover:bg-surface-800/30 transition-colors",children:[d.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:ge.step}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs text-white font-medium",children:ge.name}),d.jsx("p",{className:"text-[11px] text-surface-500",children:ge.desc})]})]},ge.step))}),d.jsx("div",{className:"mt-4 pt-3 border-t border-surface-700/50",children:d.jsxs("p",{className:"text-xs text-surface-500",children:[d.jsx("strong",{className:"text-surface-400",children:"Note:"})," The agent focuses on addressing review comments. Progress is shown in the terminal."]})})]})]})]}):e==="change"?d.jsxs("div",{className:"max-w-6xl mx-auto animate-fade-in",children:[d.jsxs("div",{className:"mb-6 text-center sm:text-left",children:[d.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:[d.jsx("span",{className:"w-10 h-10 rounded-xl bg-purple-500/20 flex items-center justify-center",children:d.jsx("svg",{className:"w-5 h-5 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsx("p",{className:"text-surface-400 text-sm",children:"Automatically implement feature requests and changes from GitHub issues with AI-powered analysis."})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-6 border border-surface-700/50",children:[d.jsx("label",{className:"block text-sm font-medium text-surface-300 mb-2",children:"GitHub Issue URL"}),d.jsx("input",{type:"url",value:N,onChange:ge=>q(ge.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:f}),d.jsxs("button",{onClick:pt,disabled:f||!Q||!N.trim(),className:`
|
|
448
|
+
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
|
|
449
|
+
${f||!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"}
|
|
450
|
+
`,children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:"Start Implementation"})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"GitHub CLI installed"})," - Install from ",d.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"brew install gh"})," or ",d.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-400 hover:underline",children:"cli.github.com"})]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Authenticated with GitHub"})," - Run ",d.jsx("code",{className:"bg-surface-800 px-1 rounded text-accent-300",children:"gh auth login"})," if needed"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.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"}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Clear requirements"})," - The issue should describe the desired change clearly"]})]})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-3 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("ul",{className:"space-y-2 text-xs text-surface-400",children:[d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"1."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Review the draft PR"})," - The agent creates a draft PR with the implementation"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"2."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Test the changes"})," - Verify the implementation works as expected"]})]}),d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{className:"text-green-400",children:"3."}),d.jsxs("span",{children:[d.jsx("strong",{className:"text-surface-300",children:"Mark PR ready"})," - Convert from draft to ready for review"]})]})]})]})]}),d.jsxs("div",{className:"glass rounded-2xl p-4 sm:p-5 border border-surface-700/50",children:[d.jsxs("h3",{className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[d.jsx("svg",{className:"w-4 h-4 text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Agent Workflow"]}),d.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(ge=>d.jsxs("div",{className:"flex items-start gap-3 py-1.5 px-2 rounded-lg hover:bg-surface-800/30 transition-colors",children:[d.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:ge.step}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs text-white font-medium",children:ge.name}),d.jsx("p",{className:"text-[11px] text-surface-500",children:ge.desc})]})]},ge.step))}),d.jsx("div",{className:"mt-4 pt-3 border-t border-surface-700/50",children:d.jsxs("p",{className:"text-xs text-surface-500",children:[d.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]}),d.jsx(tue,{activeJobs:ye,completedJobs:Fe,selectedJob:Te,onSelectJob:yt,onCancelJob:Ke,onRemoveJob:ct,onClearCompleted:at,onMarkSpawnedDone:tt,onMarkJobStatus:gn,batchOperation:z,onCancelBatchOperation:vr}),d.jsx(aue,{tasks:be.tasks,executionMode:be.executionMode,isQueueRunning:be.isQueueRunning,isPaused:be.isPaused,progress:be.progress,onSetExecutionMode:be.setExecutionMode,onStartQueue:be.startQueue,onPauseQueue:be.pauseQueue,onResumeQueue:be.resumeQueue,onRunNextTask:be.runNextTask,onRemoveTask:be.removeTask,onSkipTask:be.skipTask,onRetryTask:be.retryTask,onReorderTasks:be.reorderTasks,onClearCompleted:be.clearCompleted,onClearAll:be.clearQueue}),d.jsx(lue,{isOpen:D,prompt:G,onAddToQueue:Zt,onClose:()=>{C(!1),A(null)}}),d.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:d.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:[d.jsx("span",{className:"w-4 h-4 rounded bg-surface-800/80 flex items-center justify-center p-0.5",children:d.jsx("svg",{viewBox:"0 0 1024 1024",className:"w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:d.jsxs("g",{stroke:"#00e3ff",strokeWidth:"70",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",children:[d.jsx("path",{d:"M 260 180 H 600 A 230 230 0 0 1 600 660 H 480 L 260 880 V 180 Z"}),d.jsx("polyline",{points:"505 340 585 420 505 500"})]})})}),d.jsx("span",{className:"hidden sm:inline",children:"Prompt Driven Development"}),d.jsx("span",{className:"sm:hidden",children:"PDD"}),d.jsx("span",{className:"text-surface-600",children:"•"}),d.jsx("span",{children:we?"Jobs running - see dashboard below":"Commands tracked in dashboard"})]})}),E&&d.jsx(cue,{onClose:()=>V(!1)}),d.jsx(hue,{})]})})},w6=document.getElementById("root");if(!w6)throw new Error("Could not find root element to mount to");const jue=M9.createRoot(w6);jue.render(d.jsx(ue.StrictMode,{children:d.jsx(Sue,{children:d.jsx(Tue,{})})}));
|