interceptr 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +287 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +30 -0
- package/dist/app.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/store.d.ts +65 -0
- package/dist/config/store.d.ts.map +1 -0
- package/dist/config/store.js +448 -0
- package/dist/config/store.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/ring-buffer.d.ts +15 -0
- package/dist/logging/ring-buffer.d.ts.map +1 -0
- package/dist/logging/ring-buffer.js +64 -0
- package/dist/logging/ring-buffer.js.map +1 -0
- package/dist/logging/sse.d.ts +11 -0
- package/dist/logging/sse.d.ts.map +1 -0
- package/dist/logging/sse.js +23 -0
- package/dist/logging/sse.js.map +1 -0
- package/dist/openapi/parser.d.ts +7 -0
- package/dist/openapi/parser.d.ts.map +1 -0
- package/dist/openapi/parser.js +97 -0
- package/dist/openapi/parser.js.map +1 -0
- package/dist/proxy/handler.d.ts +2 -0
- package/dist/proxy/handler.d.ts.map +1 -0
- package/dist/proxy/handler.js +115 -0
- package/dist/proxy/handler.js.map +1 -0
- package/dist/proxy/lifecycle.d.ts +9 -0
- package/dist/proxy/lifecycle.d.ts.map +1 -0
- package/dist/proxy/lifecycle.js +53 -0
- package/dist/proxy/lifecycle.js.map +1 -0
- package/dist/proxy/matcher.d.ts +9 -0
- package/dist/proxy/matcher.d.ts.map +1 -0
- package/dist/proxy/matcher.js +59 -0
- package/dist/proxy/matcher.js.map +1 -0
- package/dist/proxy.d.ts +3 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +8 -0
- package/dist/proxy.js.map +1 -0
- package/dist/public/assets/favicon-16x16-DulSRrIm.png +0 -0
- package/dist/public/assets/favicon-32x32-BBwAW6Wa.png +0 -0
- package/dist/public/assets/index-BRKg43V6.js +29 -0
- package/dist/public/assets/index-IdN9Napd.css +1 -0
- package/dist/public/assets/logo-full-DJtzE5xc.png +0 -0
- package/dist/public/index.html +19 -0
- package/dist/routes/config.d.ts +4 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +29 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/endpoints.d.ts +4 -0
- package/dist/routes/endpoints.d.ts.map +1 -0
- package/dist/routes/endpoints.js +29 -0
- package/dist/routes/endpoints.js.map +1 -0
- package/dist/routes/helpers.d.ts +2 -0
- package/dist/routes/helpers.d.ts.map +1 -0
- package/dist/routes/helpers.js +7 -0
- package/dist/routes/helpers.js.map +1 -0
- package/dist/routes/logs.d.ts +4 -0
- package/dist/routes/logs.d.ts.map +1 -0
- package/dist/routes/logs.js +32 -0
- package/dist/routes/logs.js.map +1 -0
- package/dist/routes/presets.d.ts +4 -0
- package/dist/routes/presets.d.ts.map +1 -0
- package/dist/routes/presets.js +33 -0
- package/dist/routes/presets.js.map +1 -0
- package/dist/routes/projects.d.ts +4 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +47 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/proxy.d.ts +4 -0
- package/dist/routes/proxy.d.ts.map +1 -0
- package/dist/routes/proxy.js +28 -0
- package/dist/routes/proxy.js.map +1 -0
- package/dist/routes/specs.d.ts +4 -0
- package/dist/routes/specs.d.ts.map +1 -0
- package/dist/routes/specs.js +190 -0
- package/dist/routes/specs.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=t(r);fetch(r.href,a)}})();var Qd={exports:{}},va={};var zx;function CM(){if(zx)return va;zx=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var c in r)c!=="key"&&(a[c]=r[c])}else a=r;return r=a.ref,{$$typeof:i,type:n,key:o,ref:r!==void 0?r:null,props:a}}return va.Fragment=e,va.jsx=t,va.jsxs=t,va}var Hx;function AM(){return Hx||(Hx=1,Qd.exports=CM()),Qd.exports}var S=AM(),Gd={exports:{}},xe={};var _x;function MM(){if(_x)return xe;_x=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function M(O,G,$){this.props=O,this.context=G,this.refs=C,this.updater=$||w}M.prototype.isReactComponent={},M.prototype.setState=function(O,G){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,G,"setState")},M.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=M.prototype;function D(O,G,$){this.props=O,this.context=G,this.refs=C,this.updater=$||w}var Q=D.prototype=new R;Q.constructor=D,k(Q,M.prototype),Q.isPureReactComponent=!0;var _=Array.isArray;function K(){}var U={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function Z(O,G,$){var ne=$.ref;return{$$typeof:i,type:O,key:G,ref:ne!==void 0?ne:null,props:$}}function ce(O,G){return Z(O.type,G,O.props)}function ae(O){return typeof O=="object"&&O!==null&&O.$$typeof===i}function P(O){var G={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function($){return G[$]})}var ee=/\/+/g;function fe(O,G){return typeof O=="object"&&O!==null&&O.key!=null?P(""+O.key):G.toString(36)}function de(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(K,K):(O.status="pending",O.then(function(G){O.status==="pending"&&(O.status="fulfilled",O.value=G)},function(G){O.status==="pending"&&(O.status="rejected",O.reason=G)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function H(O,G,$,ne,be){var Se=typeof O;(Se==="undefined"||Se==="boolean")&&(O=null);var Le=!1;if(O===null)Le=!0;else switch(Se){case"bigint":case"string":case"number":Le=!0;break;case"object":switch(O.$$typeof){case i:case e:Le=!0;break;case m:return Le=O._init,H(Le(O._payload),G,$,ne,be)}}if(Le)return be=be(O),Le=ne===""?"."+fe(O,0):ne,_(be)?($="",Le!=null&&($=Le.replace(ee,"$&/")+"/"),H(be,G,$,"",function(Tl){return Tl})):be!=null&&(ae(be)&&(be=ce(be,$+(be.key==null||O&&O.key===be.key?"":(""+be.key).replace(ee,"$&/")+"/")+Le)),G.push(be)),1;Le=0;var Pt=ne===""?".":ne+":";if(_(O))for(var ot=0;ot<O.length;ot++)ne=O[ot],Se=Pt+fe(ne,ot),Le+=H(ne,G,$,Se,be);else if(ot=x(O),typeof ot=="function")for(O=ot.call(O),ot=0;!(ne=O.next()).done;)ne=ne.value,Se=Pt+fe(ne,ot++),Le+=H(ne,G,$,Se,be);else if(Se==="object"){if(typeof O.then=="function")return H(de(O),G,$,ne,be);throw G=String(O),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Le}function X(O,G,$){if(O==null)return O;var ne=[],be=0;return H(O,ne,"","",function(Se){return G.call($,Se,be++)}),ne}function le(O){if(O._status===-1){var G=O._result;G=G(),G.then(function($){(O._status===0||O._status===-1)&&(O._status=1,O._result=$)},function($){(O._status===0||O._status===-1)&&(O._status=2,O._result=$)}),O._status===-1&&(O._status=0,O._result=G)}if(O._status===1)return O._result.default;throw O._result}var ue=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},ge={map:X,forEach:function(O,G,$){X(O,function(){G.apply(this,arguments)},$)},count:function(O){var G=0;return X(O,function(){G++}),G},toArray:function(O){return X(O,function(G){return G})||[]},only:function(O){if(!ae(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return xe.Activity=y,xe.Children=ge,xe.Component=M,xe.Fragment=t,xe.Profiler=r,xe.PureComponent=D,xe.StrictMode=n,xe.Suspense=f,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,xe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return U.H.useMemoCache(O)}},xe.cache=function(O){return function(){return O.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(O,G,$){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ne=k({},O.props),be=O.key;if(G!=null)for(Se in G.key!==void 0&&(be=""+G.key),G)!J.call(G,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&G.ref===void 0||(ne[Se]=G[Se]);var Se=arguments.length-2;if(Se===1)ne.children=$;else if(1<Se){for(var Le=Array(Se),Pt=0;Pt<Se;Pt++)Le[Pt]=arguments[Pt+2];ne.children=Le}return Z(O.type,be,ne)},xe.createContext=function(O){return O={$$typeof:o,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:a,_context:O},O},xe.createElement=function(O,G,$){var ne,be={},Se=null;if(G!=null)for(ne in G.key!==void 0&&(Se=""+G.key),G)J.call(G,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(be[ne]=G[ne]);var Le=arguments.length-2;if(Le===1)be.children=$;else if(1<Le){for(var Pt=Array(Le),ot=0;ot<Le;ot++)Pt[ot]=arguments[ot+2];be.children=Pt}if(O&&O.defaultProps)for(ne in Le=O.defaultProps,Le)be[ne]===void 0&&(be[ne]=Le[ne]);return Z(O,Se,be)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(O){return{$$typeof:c,render:O}},xe.isValidElement=ae,xe.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:le}},xe.memo=function(O,G){return{$$typeof:d,type:O,compare:G===void 0?null:G}},xe.startTransition=function(O){var G=U.T,$={};U.T=$;try{var ne=O(),be=U.S;be!==null&&be($,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(K,ue)}catch(Se){ue(Se)}finally{G!==null&&$.types!==null&&(G.types=$.types),U.T=G}},xe.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},xe.use=function(O){return U.H.use(O)},xe.useActionState=function(O,G,$){return U.H.useActionState(O,G,$)},xe.useCallback=function(O,G){return U.H.useCallback(O,G)},xe.useContext=function(O){return U.H.useContext(O)},xe.useDebugValue=function(){},xe.useDeferredValue=function(O,G){return U.H.useDeferredValue(O,G)},xe.useEffect=function(O,G){return U.H.useEffect(O,G)},xe.useEffectEvent=function(O){return U.H.useEffectEvent(O)},xe.useId=function(){return U.H.useId()},xe.useImperativeHandle=function(O,G,$){return U.H.useImperativeHandle(O,G,$)},xe.useInsertionEffect=function(O,G){return U.H.useInsertionEffect(O,G)},xe.useLayoutEffect=function(O,G){return U.H.useLayoutEffect(O,G)},xe.useMemo=function(O,G){return U.H.useMemo(O,G)},xe.useOptimistic=function(O,G){return U.H.useOptimistic(O,G)},xe.useReducer=function(O,G,$){return U.H.useReducer(O,G,$)},xe.useRef=function(O){return U.H.useRef(O)},xe.useState=function(O){return U.H.useState(O)},xe.useSyncExternalStore=function(O,G,$){return U.H.useSyncExternalStore(O,G,$)},xe.useTransition=function(){return U.H.useTransition()},xe.version="19.2.4",xe}var Ux;function _m(){return Ux||(Ux=1,Gd.exports=MM()),Gd.exports}var E=_m(),Fd={exports:{}},Sa={},Kd={exports:{}},Yd={};var qx;function TM(){return qx||(qx=1,(function(i){function e(H,X){var le=H.length;H.push(X);e:for(;0<le;){var ue=le-1>>>1,ge=H[ue];if(0<r(ge,X))H[ue]=X,H[le]=ge,le=ue;else break e}}function t(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var X=H[0],le=H.pop();if(le!==X){H[0]=le;e:for(var ue=0,ge=H.length,O=ge>>>1;ue<O;){var G=2*(ue+1)-1,$=H[G],ne=G+1,be=H[ne];if(0>r($,le))ne<ge&&0>r(be,$)?(H[ue]=be,H[ne]=le,ue=ne):(H[ue]=$,H[G]=le,ue=G);else if(ne<ge&&0>r(be,le))H[ue]=be,H[ne]=le,ue=ne;else break e}}return X}function r(H,X){var le=H.sortIndex-X.sortIndex;return le!==0?le:H.id-X.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;i.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();i.unstable_now=function(){return o.now()-c}}var f=[],d=[],m=1,y=null,b=3,x=!1,w=!1,k=!1,C=!1,M=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function Q(H){for(var X=t(d);X!==null;){if(X.callback===null)n(d);else if(X.startTime<=H)n(d),X.sortIndex=X.expirationTime,e(f,X);else break;X=t(d)}}function _(H){if(k=!1,Q(H),!w)if(t(f)!==null)w=!0,K||(K=!0,P());else{var X=t(d);X!==null&&de(_,X.startTime-H)}}var K=!1,U=-1,J=5,Z=-1;function ce(){return C?!0:!(i.unstable_now()-Z<J)}function ae(){if(C=!1,K){var H=i.unstable_now();Z=H;var X=!0;try{e:{w=!1,k&&(k=!1,R(U),U=-1),x=!0;var le=b;try{t:{for(Q(H),y=t(f);y!==null&&!(y.expirationTime>H&&ce());){var ue=y.callback;if(typeof ue=="function"){y.callback=null,b=y.priorityLevel;var ge=ue(y.expirationTime<=H);if(H=i.unstable_now(),typeof ge=="function"){y.callback=ge,Q(H),X=!0;break t}y===t(f)&&n(f),Q(H)}else n(f);y=t(f)}if(y!==null)X=!0;else{var O=t(d);O!==null&&de(_,O.startTime-H),X=!1}}break e}finally{y=null,b=le,x=!1}X=void 0}}finally{X?P():K=!1}}}var P;if(typeof D=="function")P=function(){D(ae)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,fe=ee.port2;ee.port1.onmessage=ae,P=function(){fe.postMessage(null)}}else P=function(){M(ae,0)};function de(H,X){U=M(function(){H(i.unstable_now())},X)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(H){H.callback=null},i.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<H?Math.floor(1e3/H):5},i.unstable_getCurrentPriorityLevel=function(){return b},i.unstable_next=function(H){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var le=b;b=X;try{return H()}finally{b=le}},i.unstable_requestPaint=function(){C=!0},i.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var le=b;b=H;try{return X()}finally{b=le}},i.unstable_scheduleCallback=function(H,X,le){var ue=i.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ue+le:ue):le=ue,H){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=le+ge,H={id:m++,callback:X,priorityLevel:H,startTime:le,expirationTime:ge,sortIndex:-1},le>ue?(H.sortIndex=le,e(d,H),t(f)===null&&H===t(d)&&(k?(R(U),U=-1):k=!0,de(_,le-ue))):(H.sortIndex=ge,e(f,H),w||x||(w=!0,K||(K=!0,P()))),H},i.unstable_shouldYield=ce,i.unstable_wrapCallback=function(H){var X=b;return function(){var le=b;b=X;try{return H.apply(this,arguments)}finally{b=le}}}})(Yd)),Yd}var Px;function OM(){return Px||(Px=1,Kd.exports=TM()),Kd.exports}var Id={exports:{}},zt={};var Vx;function EM(){if(Vx)return zt;Vx=1;var i=_m();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var n={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},r=Symbol.for("react.portal");function a(f,d,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:f,containerInfo:d,implementation:m}}var o=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,zt.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return a(f,d,null,m)},zt.flushSync=function(f){var d=o.T,m=n.p;try{if(o.T=null,n.p=2,f)return f()}finally{o.T=d,n.p=m,n.d.f()}},zt.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(f,d))},zt.prefetchDNS=function(f){typeof f=="string"&&n.d.D(f)},zt.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,y=c(m,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?n.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):m==="script"&&n.d.X(f,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},zt.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);n.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&n.d.M(f)},zt.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,y=c(m,d.crossOrigin);n.d.L(f,m,{crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},zt.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);n.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else n.d.m(f)},zt.requestFormReset=function(f){n.d.r(f)},zt.unstable_batchedUpdates=function(f,d){return f(d)},zt.useFormState=function(f,d,m){return o.H.useFormState(f,d,m)},zt.useFormStatus=function(){return o.H.useHostTransitionStatus()},zt.version="19.2.4",zt}var Qx;function NM(){if(Qx)return Id.exports;Qx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Id.exports=EM(),Id.exports}var Gx;function RM(){if(Gx)return Sa;Gx=1;var i=OM(),e=_m(),t=NM();function n(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,u=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(u=l.return),s=l.return;while(s)}return l.tag===3?u:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function f(s){if(a(s)!==s)throw Error(n(188))}function d(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(n(188));return l!==s?null:s}for(var u=s,h=l;;){var p=u.return;if(p===null)break;var g=p.alternate;if(g===null){if(h=p.return,h!==null){u=h;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===u)return f(p),s;if(g===h)return f(p),l;g=g.sibling}throw Error(n(188))}if(u.return!==h.return)u=p,h=g;else{for(var v=!1,A=p.child;A;){if(A===u){v=!0,u=p,h=g;break}if(A===h){v=!0,h=p,u=g;break}A=A.sibling}if(!v){for(A=g.child;A;){if(A===u){v=!0,u=g,h=p;break}if(A===h){v=!0,h=g,u=p;break}A=A.sibling}if(!v)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?s:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(s),l!==null)return l;s=s.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),D=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ce=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function P(s){return s===null||typeof s!="object"?null:(s=ae&&s[ae]||s["@@iterator"],typeof s=="function"?s:null)}var ee=Symbol.for("react.client.reference");function fe(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===ee?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case M:return"Profiler";case C:return"StrictMode";case _:return"Suspense";case K:return"SuspenseList";case Z:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case D:return s.displayName||"Context";case R:return(s._context.displayName||"Context")+".Consumer";case Q:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case U:return l=s.displayName||null,l!==null?l:fe(s.type)||"Memo";case J:l=s._payload,s=s._init;try{return fe(s(l))}catch{}}return null}var de=Array.isArray,H=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],ge=-1;function O(s){return{current:s}}function G(s){0>ge||(s.current=ue[ge],ue[ge]=null,ge--)}function $(s,l){ge++,ue[ge]=s.current,s.current=l}var ne=O(null),be=O(null),Se=O(null),Le=O(null);function Pt(s,l){switch($(Se,l),$(be,s),$(ne,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?rx(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=rx(l),s=lx(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(ne),$(ne,s)}function ot(){G(ne),G(be),G(Se)}function Tl(s){s.memoizedState!==null&&$(Le,s);var l=ne.current,u=lx(l,s.type);l!==u&&($(be,s),$(ne,u))}function So(s){be.current===s&&(G(ne),G(be)),Le.current===s&&(G(Le),ga._currentValue=le)}var Ch,Lg;function Ds(s){if(Ch===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);Ch=l&&l[1]||"",Lg=-1<u.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ch+s+Lg}var Ah=!1;function Mh(s,l){if(!s||Ah)return"";Ah=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(q){var z=q}Reflect.construct(s,[],I)}else{try{I.call()}catch(q){z=q}s.call(I.prototype)}}else{try{throw Error()}catch(q){z=q}(I=s())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(q){if(q&&z&&typeof q.stack=="string")return[q.stack,z.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=h.DetermineComponentFrameRoot(),v=g[0],A=g[1];if(v&&A){var T=v.split(`
|
|
4
|
+
`),L=A.split(`
|
|
5
|
+
`);for(p=h=0;h<T.length&&!T[h].includes("DetermineComponentFrameRoot");)h++;for(;p<L.length&&!L[p].includes("DetermineComponentFrameRoot");)p++;if(h===T.length||p===L.length)for(h=T.length-1,p=L.length-1;1<=h&&0<=p&&T[h]!==L[p];)p--;for(;1<=h&&0<=p;h--,p--)if(T[h]!==L[p]){if(h!==1||p!==1)do if(h--,p--,0>p||T[h]!==L[p]){var F=`
|
|
6
|
+
`+T[h].replace(" at new "," at ");return s.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",s.displayName)),F}while(1<=h&&0<=p);break}}}finally{Ah=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Ds(u):""}function tC(s,l){switch(s.tag){case 26:case 27:case 5:return Ds(s.type);case 16:return Ds("Lazy");case 13:return s.child!==l&&l!==null?Ds("Suspense Fallback"):Ds("Suspense");case 19:return Ds("SuspenseList");case 0:case 15:return Mh(s.type,!1);case 11:return Mh(s.type.render,!1);case 1:return Mh(s.type,!0);case 31:return Ds("Activity");default:return""}}function zg(s){try{var l="",u=null;do l+=tC(s,u),u=s,s=s.return;while(s);return l}catch(h){return`
|
|
7
|
+
Error generating stack: `+h.message+`
|
|
8
|
+
`+h.stack}}var Th=Object.prototype.hasOwnProperty,Oh=i.unstable_scheduleCallback,Eh=i.unstable_cancelCallback,iC=i.unstable_shouldYield,nC=i.unstable_requestPaint,li=i.unstable_now,sC=i.unstable_getCurrentPriorityLevel,Hg=i.unstable_ImmediatePriority,_g=i.unstable_UserBlockingPriority,wo=i.unstable_NormalPriority,rC=i.unstable_LowPriority,Ug=i.unstable_IdlePriority,lC=i.log,aC=i.unstable_setDisableYieldValue,Ol=null,ai=null;function Qn(s){if(typeof lC=="function"&&aC(s),ai&&typeof ai.setStrictMode=="function")try{ai.setStrictMode(Ol,s)}catch{}}var oi=Math.clz32?Math.clz32:cC,oC=Math.log,uC=Math.LN2;function cC(s){return s>>>=0,s===0?32:31-(oC(s)/uC|0)|0}var ko=256,Co=262144,Ao=4194304;function js(s){var l=s&42;if(l!==0)return l;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Mo(s,l,u){var h=s.pendingLanes;if(h===0)return 0;var p=0,g=s.suspendedLanes,v=s.pingedLanes;s=s.warmLanes;var A=h&134217727;return A!==0?(h=A&~g,h!==0?p=js(h):(v&=A,v!==0?p=js(v):u||(u=A&~s,u!==0&&(p=js(u))))):(A=h&~g,A!==0?p=js(A):v!==0?p=js(v):u||(u=h&~s,u!==0&&(p=js(u)))),p===0?0:l!==0&&l!==p&&(l&g)===0&&(g=p&-p,u=l&-l,g>=u||g===32&&(u&4194048)!==0)?l:p}function El(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function hC(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 qg(){var s=Ao;return Ao<<=1,(Ao&62914560)===0&&(Ao=4194304),s}function Nh(s){for(var l=[],u=0;31>u;u++)l.push(s);return l}function Nl(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function fC(s,l,u,h,p,g){var v=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var A=s.entanglements,T=s.expirationTimes,L=s.hiddenUpdates;for(u=v&~u;0<u;){var F=31-oi(u),I=1<<F;A[F]=0,T[F]=-1;var z=L[F];if(z!==null)for(L[F]=null,F=0;F<z.length;F++){var q=z[F];q!==null&&(q.lane&=-536870913)}u&=~I}h!==0&&Pg(s,h,0),g!==0&&p===0&&s.tag!==0&&(s.suspendedLanes|=g&~(v&~l))}function Pg(s,l,u){s.pendingLanes|=l,s.suspendedLanes&=~l;var h=31-oi(l);s.entangledLanes|=l,s.entanglements[h]=s.entanglements[h]|1073741824|u&261930}function Vg(s,l){var u=s.entangledLanes|=l;for(s=s.entanglements;u;){var h=31-oi(u),p=1<<h;p&l|s[h]&l&&(s[h]|=l),u&=~p}}function Qg(s,l){var u=l&-l;return u=(u&42)!==0?1:Rh(u),(u&(s.suspendedLanes|l))!==0?0:u}function Rh(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Dh(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Gg(){var s=X.p;return s!==0?s:(s=window.event,s===void 0?32:Ex(s.type))}function Fg(s,l){var u=X.p;try{return X.p=s,l()}finally{X.p=u}}var Gn=Math.random().toString(36).slice(2),Ot="__reactFiber$"+Gn,Yt="__reactProps$"+Gn,pr="__reactContainer$"+Gn,jh="__reactEvents$"+Gn,dC="__reactListeners$"+Gn,pC="__reactHandles$"+Gn,Kg="__reactResources$"+Gn,Rl="__reactMarker$"+Gn;function Bh(s){delete s[Ot],delete s[Yt],delete s[jh],delete s[dC],delete s[pC]}function mr(s){var l=s[Ot];if(l)return l;for(var u=s.parentNode;u;){if(l=u[pr]||u[Ot]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(s=dx(s);s!==null;){if(u=s[Ot])return u;s=dx(s)}return l}s=u,u=s.parentNode}return null}function gr(s){if(s=s[Ot]||s[pr]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Dl(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(n(33))}function yr(s){var l=s[Kg];return l||(l=s[Kg]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function kt(s){s[Rl]=!0}var Yg=new Set,Ig={};function Bs(s,l){br(s,l),br(s+"Capture",l)}function br(s,l){for(Ig[s]=l,s=0;s<l.length;s++)Yg.add(l[s])}var mC=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]*$"),Wg={},Xg={};function gC(s){return Th.call(Xg,s)?!0:Th.call(Wg,s)?!1:mC.test(s)?Xg[s]=!0:(Wg[s]=!0,!1)}function To(s,l,u){if(gC(l))if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+u)}}function Oo(s,l,u){if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+u)}}function gn(s,l,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(l,u,""+h)}}function Si(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Zg(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function yC(s,l,u){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var p=h.get,g=h.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return p.call(this)},set:function(v){u=""+v,g.call(this,v)}}),Object.defineProperty(s,l,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(v){u=""+v},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Lh(s){if(!s._valueTracker){var l=Zg(s)?"checked":"value";s._valueTracker=yC(s,l,""+s[l])}}function Jg(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return s&&(h=Zg(s)?s.checked?"true":"false":s.value),s=h,s!==u?(l.setValue(s),!0):!1}function Eo(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var bC=/[\n"\\]/g;function wi(s){return s.replace(bC,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function zh(s,l,u,h,p,g,v,A){s.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?s.type=v:s.removeAttribute("type"),l!=null?v==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Si(l)):s.value!==""+Si(l)&&(s.value=""+Si(l)):v!=="submit"&&v!=="reset"||s.removeAttribute("value"),l!=null?Hh(s,v,Si(l)):u!=null?Hh(s,v,Si(u)):h!=null&&s.removeAttribute("value"),p==null&&g!=null&&(s.defaultChecked=!!g),p!=null&&(s.checked=p&&typeof p!="function"&&typeof p!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?s.name=""+Si(A):s.removeAttribute("name")}function $g(s,l,u,h,p,g,v,A){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(s.type=g),l!=null||u!=null){if(!(g!=="submit"&&g!=="reset"||l!=null)){Lh(s);return}u=u!=null?""+Si(u):"",l=l!=null?""+Si(l):u,A||l===s.value||(s.value=l),s.defaultValue=l}h=h??p,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=A?s.checked:!!h,s.defaultChecked=!!h,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(s.name=v),Lh(s)}function Hh(s,l,u){l==="number"&&Eo(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function xr(s,l,u,h){if(s=s.options,l){l={};for(var p=0;p<u.length;p++)l["$"+u[p]]=!0;for(u=0;u<s.length;u++)p=l.hasOwnProperty("$"+s[u].value),s[u].selected!==p&&(s[u].selected=p),p&&h&&(s[u].defaultSelected=!0)}else{for(u=""+Si(u),l=null,p=0;p<s.length;p++){if(s[p].value===u){s[p].selected=!0,h&&(s[p].defaultSelected=!0);return}l!==null||s[p].disabled||(l=s[p])}l!==null&&(l.selected=!0)}}function e0(s,l,u){if(l!=null&&(l=""+Si(l),l!==s.value&&(s.value=l),u==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=u!=null?""+Si(u):""}function t0(s,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(n(92));if(de(h)){if(1<h.length)throw Error(n(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=Si(l),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h),Lh(s)}function vr(s,l){if(l){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=l;return}}s.textContent=l}var xC=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 i0(s,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":h?s.setProperty(l,u):typeof u!="number"||u===0||xC.has(l)?l==="float"?s.cssFloat=u:s[l]=(""+u).trim():s[l]=u+"px"}function n0(s,l,u){if(l!=null&&typeof l!="object")throw Error(n(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var p in l)h=l[p],l.hasOwnProperty(p)&&u[p]!==h&&i0(s,p,h)}else for(var g in l)l.hasOwnProperty(g)&&i0(s,g,l[g])}function _h(s){if(s.indexOf("-")===-1)return!1;switch(s){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 vC=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"]]),SC=/^[\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 No(s){return SC.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function yn(){}var Uh=null;function qh(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Sr=null,wr=null;function s0(s){var l=gr(s);if(l&&(s=l.stateNode)){var u=s[Yt]||null;e:switch(s=l.stateNode,l.type){case"input":if(zh(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+wi(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==s&&h.form===s.form){var p=h[Yt]||null;if(!p)throw Error(n(90));zh(h,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===s.form&&Jg(h)}break e;case"textarea":e0(s,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&xr(s,!!u.multiple,l,!1)}}}var Ph=!1;function r0(s,l,u){if(Ph)return s(l,u);Ph=!0;try{var h=s(l);return h}finally{if(Ph=!1,(Sr!==null||wr!==null)&&(yu(),Sr&&(l=Sr,s=wr,wr=Sr=null,s0(l),s)))for(l=0;l<s.length;l++)s0(s[l])}}function jl(s,l){var u=s.stateNode;if(u===null)return null;var h=u[Yt]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(n(231,l,typeof u));return u}var bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=!1;if(bn)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){Vh=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{Vh=!1}var Fn=null,Qh=null,Ro=null;function l0(){if(Ro)return Ro;var s,l=Qh,u=l.length,h,p="value"in Fn?Fn.value:Fn.textContent,g=p.length;for(s=0;s<u&&l[s]===p[s];s++);var v=u-s;for(h=1;h<=v&&l[u-h]===p[g-h];h++);return Ro=p.slice(s,1<h?1-h:void 0)}function Do(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function jo(){return!0}function a0(){return!1}function It(s){function l(u,h,p,g,v){this._reactName=u,this._targetInst=p,this.type=h,this.nativeEvent=g,this.target=v,this.currentTarget=null;for(var A in s)s.hasOwnProperty(A)&&(u=s[A],this[A]=u?u(g):g[A]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?jo:a0,this.isPropagationStopped=a0,this}return y(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=jo)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=jo)},persist:function(){},isPersistent:jo}),l}var Ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bo=It(Ls),Ll=y({},Ls,{view:0,detail:0}),wC=It(Ll),Gh,Fh,zl,Lo=y({},Ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yh,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==zl&&(zl&&s.type==="mousemove"?(Gh=s.screenX-zl.screenX,Fh=s.screenY-zl.screenY):Fh=Gh=0,zl=s),Gh)},movementY:function(s){return"movementY"in s?s.movementY:Fh}}),o0=It(Lo),kC=y({},Lo,{dataTransfer:0}),CC=It(kC),AC=y({},Ll,{relatedTarget:0}),Kh=It(AC),MC=y({},Ls,{animationName:0,elapsedTime:0,pseudoElement:0}),TC=It(MC),OC=y({},Ls,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),EC=It(OC),NC=y({},Ls,{data:0}),u0=It(NC),RC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DC={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"},jC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BC(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=jC[s])?!!l[s]:!1}function Yh(){return BC}var LC=y({},Ll,{key:function(s){if(s.key){var l=RC[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Do(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?DC[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yh,charCode:function(s){return s.type==="keypress"?Do(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Do(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),zC=It(LC),HC=y({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),c0=It(HC),_C=y({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yh}),UC=It(_C),qC=y({},Ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),PC=It(qC),VC=y({},Lo,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),QC=It(VC),GC=y({},Ls,{newState:0,oldState:0}),FC=It(GC),KC=[9,13,27,32],Ih=bn&&"CompositionEvent"in window,Hl=null;bn&&"documentMode"in document&&(Hl=document.documentMode);var YC=bn&&"TextEvent"in window&&!Hl,h0=bn&&(!Ih||Hl&&8<Hl&&11>=Hl),f0=" ",d0=!1;function p0(s,l){switch(s){case"keyup":return KC.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m0(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var kr=!1;function IC(s,l){switch(s){case"compositionend":return m0(l);case"keypress":return l.which!==32?null:(d0=!0,f0);case"textInput":return s=l.data,s===f0&&d0?null:s;default:return null}}function WC(s,l){if(kr)return s==="compositionend"||!Ih&&p0(s,l)?(s=l0(),Ro=Qh=Fn=null,kr=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return h0&&l.locale!=="ko"?null:l.data;default:return null}}var XC={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 g0(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!XC[s.type]:l==="textarea"}function y0(s,l,u,h){Sr?wr?wr.push(h):wr=[h]:Sr=h,l=Cu(l,"onChange"),0<l.length&&(u=new Bo("onChange","change",null,u,h),s.push({event:u,listeners:l}))}var _l=null,Ul=null;function ZC(s){$b(s,0)}function zo(s){var l=Dl(s);if(Jg(l))return s}function b0(s,l){if(s==="change")return l}var x0=!1;if(bn){var Wh;if(bn){var Xh="oninput"in document;if(!Xh){var v0=document.createElement("div");v0.setAttribute("oninput","return;"),Xh=typeof v0.oninput=="function"}Wh=Xh}else Wh=!1;x0=Wh&&(!document.documentMode||9<document.documentMode)}function S0(){_l&&(_l.detachEvent("onpropertychange",w0),Ul=_l=null)}function w0(s){if(s.propertyName==="value"&&zo(Ul)){var l=[];y0(l,Ul,s,qh(s)),r0(ZC,l)}}function JC(s,l,u){s==="focusin"?(S0(),_l=l,Ul=u,_l.attachEvent("onpropertychange",w0)):s==="focusout"&&S0()}function $C(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return zo(Ul)}function eA(s,l){if(s==="click")return zo(l)}function tA(s,l){if(s==="input"||s==="change")return zo(l)}function iA(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var ui=typeof Object.is=="function"?Object.is:iA;function ql(s,l){if(ui(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var u=Object.keys(s),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var p=u[h];if(!Th.call(l,p)||!ui(s[p],l[p]))return!1}return!0}function k0(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function C0(s,l){var u=k0(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=l&&h>=l)return{node:u,offset:l-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=k0(u)}}function A0(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?A0(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function M0(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Eo(s.document);l instanceof s.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)s=l.contentWindow;else break;l=Eo(s.document)}return l}function Zh(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var nA=bn&&"documentMode"in document&&11>=document.documentMode,Cr=null,Jh=null,Pl=null,$h=!1;function T0(s,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;$h||Cr==null||Cr!==Eo(h)||(h=Cr,"selectionStart"in h&&Zh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Pl&&ql(Pl,h)||(Pl=h,h=Cu(Jh,"onSelect"),0<h.length&&(l=new Bo("onSelect","select",null,l,u),s.push({event:l,listeners:h}),l.target=Cr)))}function zs(s,l){var u={};return u[s.toLowerCase()]=l.toLowerCase(),u["Webkit"+s]="webkit"+l,u["Moz"+s]="moz"+l,u}var Ar={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionrun:zs("Transition","TransitionRun"),transitionstart:zs("Transition","TransitionStart"),transitioncancel:zs("Transition","TransitionCancel"),transitionend:zs("Transition","TransitionEnd")},ef={},O0={};bn&&(O0=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function Hs(s){if(ef[s])return ef[s];if(!Ar[s])return s;var l=Ar[s],u;for(u in l)if(l.hasOwnProperty(u)&&u in O0)return ef[s]=l[u];return s}var E0=Hs("animationend"),N0=Hs("animationiteration"),R0=Hs("animationstart"),sA=Hs("transitionrun"),rA=Hs("transitionstart"),lA=Hs("transitioncancel"),D0=Hs("transitionend"),j0=new Map,tf="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(" ");tf.push("scrollEnd");function Ui(s,l){j0.set(s,l),Bs(l,[s])}var Ho=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ki=[],Mr=0,nf=0;function _o(){for(var s=Mr,l=nf=Mr=0;l<s;){var u=ki[l];ki[l++]=null;var h=ki[l];ki[l++]=null;var p=ki[l];ki[l++]=null;var g=ki[l];if(ki[l++]=null,h!==null&&p!==null){var v=h.pending;v===null?p.next=p:(p.next=v.next,v.next=p),h.pending=p}g!==0&&B0(u,p,g)}}function Uo(s,l,u,h){ki[Mr++]=s,ki[Mr++]=l,ki[Mr++]=u,ki[Mr++]=h,nf|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function sf(s,l,u,h){return Uo(s,l,u,h),qo(s)}function _s(s,l){return Uo(s,null,null,l),qo(s)}function B0(s,l,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var p=!1,g=s.return;g!==null;)g.childLanes|=u,h=g.alternate,h!==null&&(h.childLanes|=u),g.tag===22&&(s=g.stateNode,s===null||s._visibility&1||(p=!0)),s=g,g=g.return;return s.tag===3?(g=s.stateNode,p&&l!==null&&(p=31-oi(u),s=g.hiddenUpdates,h=s[p],h===null?s[p]=[l]:h.push(l),l.lane=u|536870912),g):null}function qo(s){if(50<ua)throw ua=0,dd=null,Error(n(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var Tr={};function aA(s,l,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(s,l,u,h){return new aA(s,l,u,h)}function rf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function xn(s,l){var u=s.alternate;return u===null?(u=ci(s.tag,l,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=l,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,l=s.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function L0(s,l){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,l=u.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function Po(s,l,u,h,p,g){var v=0;if(h=s,typeof s=="function")rf(s)&&(v=1);else if(typeof s=="string")v=fM(s,u,ne.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case Z:return s=ci(31,u,l,p),s.elementType=Z,s.lanes=g,s;case k:return Us(u.children,p,g,l);case C:v=8,p|=24;break;case M:return s=ci(12,u,l,p|2),s.elementType=M,s.lanes=g,s;case _:return s=ci(13,u,l,p),s.elementType=_,s.lanes=g,s;case K:return s=ci(19,u,l,p),s.elementType=K,s.lanes=g,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case D:v=10;break e;case R:v=9;break e;case Q:v=11;break e;case U:v=14;break e;case J:v=16,h=null;break e}v=29,u=Error(n(130,s===null?"null":typeof s,"")),h=null}return l=ci(v,u,l,p),l.elementType=s,l.type=h,l.lanes=g,l}function Us(s,l,u,h){return s=ci(7,s,h,l),s.lanes=u,s}function lf(s,l,u){return s=ci(6,s,null,l),s.lanes=u,s}function z0(s){var l=ci(18,null,null,0);return l.stateNode=s,l}function af(s,l,u){return l=ci(4,s.children!==null?s.children:[],s.key,l),l.lanes=u,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var H0=new WeakMap;function Ci(s,l){if(typeof s=="object"&&s!==null){var u=H0.get(s);return u!==void 0?u:(l={value:s,source:l,stack:zg(l)},H0.set(s,l),l)}return{value:s,source:l,stack:zg(l)}}var Or=[],Er=0,Vo=null,Vl=0,Ai=[],Mi=0,Kn=null,Xi=1,Zi="";function vn(s,l){Or[Er++]=Vl,Or[Er++]=Vo,Vo=s,Vl=l}function _0(s,l,u){Ai[Mi++]=Xi,Ai[Mi++]=Zi,Ai[Mi++]=Kn,Kn=s;var h=Xi;s=Zi;var p=32-oi(h)-1;h&=~(1<<p),u+=1;var g=32-oi(l)+p;if(30<g){var v=p-p%5;g=(h&(1<<v)-1).toString(32),h>>=v,p-=v,Xi=1<<32-oi(l)+p|u<<p|h,Zi=g+s}else Xi=1<<g|u<<p|h,Zi=s}function of(s){s.return!==null&&(vn(s,1),_0(s,1,0))}function uf(s){for(;s===Vo;)Vo=Or[--Er],Or[Er]=null,Vl=Or[--Er],Or[Er]=null;for(;s===Kn;)Kn=Ai[--Mi],Ai[Mi]=null,Zi=Ai[--Mi],Ai[Mi]=null,Xi=Ai[--Mi],Ai[Mi]=null}function U0(s,l){Ai[Mi++]=Xi,Ai[Mi++]=Zi,Ai[Mi++]=Kn,Xi=l.id,Zi=l.overflow,Kn=s}var Et=null,Je=null,De=!1,Yn=null,Ti=!1,cf=Error(n(519));function In(s){var l=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ql(Ci(l,s)),cf}function q0(s){var l=s.stateNode,u=s.type,h=s.memoizedProps;switch(l[Ot]=s,l[Yt]=h,u){case"dialog":Oe("cancel",l),Oe("close",l);break;case"iframe":case"object":case"embed":Oe("load",l);break;case"video":case"audio":for(u=0;u<ha.length;u++)Oe(ha[u],l);break;case"source":Oe("error",l);break;case"img":case"image":case"link":Oe("error",l),Oe("load",l);break;case"details":Oe("toggle",l);break;case"input":Oe("invalid",l),$g(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Oe("invalid",l);break;case"textarea":Oe("invalid",l),t0(l,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||nx(l.textContent,u)?(h.popover!=null&&(Oe("beforetoggle",l),Oe("toggle",l)),h.onScroll!=null&&Oe("scroll",l),h.onScrollEnd!=null&&Oe("scrollend",l),h.onClick!=null&&(l.onclick=yn),l=!0):l=!1,l||In(s,!0)}function P0(s){for(Et=s.return;Et;)switch(Et.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:Et=Et.return}}function Nr(s){if(s!==Et)return!1;if(!De)return P0(s),De=!0,!1;var l=s.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Od(s.type,s.memoizedProps)),u=!u),u&&Je&&In(s),P0(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));Je=fx(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));Je=fx(s)}else l===27?(l=Je,os(s.type)?(s=jd,jd=null,Je=s):Je=l):Je=Et?Ei(s.stateNode.nextSibling):null;return!0}function qs(){Je=Et=null,De=!1}function hf(){var s=Yn;return s!==null&&(Jt===null?Jt=s:Jt.push.apply(Jt,s),Yn=null),s}function Ql(s){Yn===null?Yn=[s]:Yn.push(s)}var ff=O(null),Ps=null,Sn=null;function Wn(s,l,u){$(ff,l._currentValue),l._currentValue=u}function wn(s){s._currentValue=ff.current,G(ff)}function df(s,l,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),s===u)break;s=s.return}}function pf(s,l,u,h){var p=s.child;for(p!==null&&(p.return=s);p!==null;){var g=p.dependencies;if(g!==null){var v=p.child;g=g.firstContext;e:for(;g!==null;){var A=g;g=p;for(var T=0;T<l.length;T++)if(A.context===l[T]){g.lanes|=u,A=g.alternate,A!==null&&(A.lanes|=u),df(g.return,u,s),h||(v=null);break e}g=A.next}}else if(p.tag===18){if(v=p.return,v===null)throw Error(n(341));v.lanes|=u,g=v.alternate,g!==null&&(g.lanes|=u),df(v,u,s),v=null}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===s){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}}function Rr(s,l,u,h){s=null;for(var p=l,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var v=p.alternate;if(v===null)throw Error(n(387));if(v=v.memoizedProps,v!==null){var A=p.type;ui(p.pendingProps.value,v.value)||(s!==null?s.push(A):s=[A])}}else if(p===Le.current){if(v=p.alternate,v===null)throw Error(n(387));v.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(s!==null?s.push(ga):s=[ga])}p=p.return}s!==null&&pf(l,s,u,h),l.flags|=262144}function Qo(s){for(s=s.firstContext;s!==null;){if(!ui(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Vs(s){Ps=s,Sn=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Nt(s){return V0(Ps,s)}function Go(s,l){return Ps===null&&Vs(s),V0(s,l)}function V0(s,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Sn===null){if(s===null)throw Error(n(308));Sn=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Sn=Sn.next=l;return u}var oA=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){l.aborted=!0,s.forEach(function(u){return u()})}},uA=i.unstable_scheduleCallback,cA=i.unstable_NormalPriority,pt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mf(){return{controller:new oA,data:new Map,refCount:0}}function Gl(s){s.refCount--,s.refCount===0&&uA(cA,function(){s.controller.abort()})}var Fl=null,gf=0,Dr=0,jr=null;function hA(s,l){if(Fl===null){var u=Fl=[];gf=0,Dr=xd(),jr={status:"pending",value:void 0,then:function(h){u.push(h)}}}return gf++,l.then(Q0,Q0),l}function Q0(){if(--gf===0&&Fl!==null){jr!==null&&(jr.status="fulfilled");var s=Fl;Fl=null,Dr=0,jr=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function fA(s,l){var u=[],h={status:"pending",value:null,reason:null,then:function(p){u.push(p)}};return s.then(function(){h.status="fulfilled",h.value=l;for(var p=0;p<u.length;p++)(0,u[p])(l)},function(p){for(h.status="rejected",h.reason=p,p=0;p<u.length;p++)(0,u[p])(void 0)}),h}var G0=H.S;H.S=function(s,l){Tb=li(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&hA(s,l),G0!==null&&G0(s,l)};var Qs=O(null);function yf(){var s=Qs.current;return s!==null?s:Ie.pooledCache}function Fo(s,l){l===null?$(Qs,Qs.current):$(Qs,l.pool)}function F0(){var s=yf();return s===null?null:{parent:pt._currentValue,pool:s}}var Br=Error(n(460)),bf=Error(n(474)),Ko=Error(n(542)),Yo={then:function(){}};function K0(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Y0(s,l,u){switch(u=s[u],u===void 0?s.push(l):u!==l&&(l.then(yn,yn),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,W0(s),s;default:if(typeof l.status=="string")l.then(yn,yn);else{if(s=Ie,s!==null&&100<s.shellSuspendCounter)throw Error(n(482));s=l,s.status="pending",s.then(function(h){if(l.status==="pending"){var p=l;p.status="fulfilled",p.value=h}},function(h){if(l.status==="pending"){var p=l;p.status="rejected",p.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,W0(s),s}throw Fs=l,Br}}function Gs(s){try{var l=s._init;return l(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Fs=u,Br):u}}var Fs=null;function I0(){if(Fs===null)throw Error(n(459));var s=Fs;return Fs=null,s}function W0(s){if(s===Br||s===Ko)throw Error(n(483))}var Lr=null,Kl=0;function Io(s){var l=Kl;return Kl+=1,Lr===null&&(Lr=[]),Y0(Lr,s,l)}function Yl(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function Wo(s,l){throw l.$$typeof===b?Error(n(525)):(s=Object.prototype.toString.call(l),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function X0(s){function l(j,N){if(s){var B=j.deletions;B===null?(j.deletions=[N],j.flags|=16):B.push(N)}}function u(j,N){if(!s)return null;for(;N!==null;)l(j,N),N=N.sibling;return null}function h(j){for(var N=new Map;j!==null;)j.key!==null?N.set(j.key,j):N.set(j.index,j),j=j.sibling;return N}function p(j,N){return j=xn(j,N),j.index=0,j.sibling=null,j}function g(j,N,B){return j.index=B,s?(B=j.alternate,B!==null?(B=B.index,B<N?(j.flags|=67108866,N):B):(j.flags|=67108866,N)):(j.flags|=1048576,N)}function v(j){return s&&j.alternate===null&&(j.flags|=67108866),j}function A(j,N,B,Y){return N===null||N.tag!==6?(N=lf(B,j.mode,Y),N.return=j,N):(N=p(N,B),N.return=j,N)}function T(j,N,B,Y){var pe=B.type;return pe===k?F(j,N,B.props.children,Y,B.key):N!==null&&(N.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===J&&Gs(pe)===N.type)?(N=p(N,B.props),Yl(N,B),N.return=j,N):(N=Po(B.type,B.key,B.props,null,j.mode,Y),Yl(N,B),N.return=j,N)}function L(j,N,B,Y){return N===null||N.tag!==4||N.stateNode.containerInfo!==B.containerInfo||N.stateNode.implementation!==B.implementation?(N=af(B,j.mode,Y),N.return=j,N):(N=p(N,B.children||[]),N.return=j,N)}function F(j,N,B,Y,pe){return N===null||N.tag!==7?(N=Us(B,j.mode,Y,pe),N.return=j,N):(N=p(N,B),N.return=j,N)}function I(j,N,B){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=lf(""+N,j.mode,B),N.return=j,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case x:return B=Po(N.type,N.key,N.props,null,j.mode,B),Yl(B,N),B.return=j,B;case w:return N=af(N,j.mode,B),N.return=j,N;case J:return N=Gs(N),I(j,N,B)}if(de(N)||P(N))return N=Us(N,j.mode,B,null),N.return=j,N;if(typeof N.then=="function")return I(j,Io(N),B);if(N.$$typeof===D)return I(j,Go(j,N),B);Wo(j,N)}return null}function z(j,N,B,Y){var pe=N!==null?N.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return pe!==null?null:A(j,N,""+B,Y);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case x:return B.key===pe?T(j,N,B,Y):null;case w:return B.key===pe?L(j,N,B,Y):null;case J:return B=Gs(B),z(j,N,B,Y)}if(de(B)||P(B))return pe!==null?null:F(j,N,B,Y,null);if(typeof B.then=="function")return z(j,N,Io(B),Y);if(B.$$typeof===D)return z(j,N,Go(j,B),Y);Wo(j,B)}return null}function q(j,N,B,Y,pe){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return j=j.get(B)||null,A(N,j,""+Y,pe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case x:return j=j.get(Y.key===null?B:Y.key)||null,T(N,j,Y,pe);case w:return j=j.get(Y.key===null?B:Y.key)||null,L(N,j,Y,pe);case J:return Y=Gs(Y),q(j,N,B,Y,pe)}if(de(Y)||P(Y))return j=j.get(B)||null,F(N,j,Y,pe,null);if(typeof Y.then=="function")return q(j,N,B,Io(Y),pe);if(Y.$$typeof===D)return q(j,N,B,Go(N,Y),pe);Wo(N,Y)}return null}function oe(j,N,B,Y){for(var pe=null,ze=null,he=N,ke=N=0,Re=null;he!==null&&ke<B.length;ke++){he.index>ke?(Re=he,he=null):Re=he.sibling;var He=z(j,he,B[ke],Y);if(He===null){he===null&&(he=Re);break}s&&he&&He.alternate===null&&l(j,he),N=g(He,N,ke),ze===null?pe=He:ze.sibling=He,ze=He,he=Re}if(ke===B.length)return u(j,he),De&&vn(j,ke),pe;if(he===null){for(;ke<B.length;ke++)he=I(j,B[ke],Y),he!==null&&(N=g(he,N,ke),ze===null?pe=he:ze.sibling=he,ze=he);return De&&vn(j,ke),pe}for(he=h(he);ke<B.length;ke++)Re=q(he,j,ke,B[ke],Y),Re!==null&&(s&&Re.alternate!==null&&he.delete(Re.key===null?ke:Re.key),N=g(Re,N,ke),ze===null?pe=Re:ze.sibling=Re,ze=Re);return s&&he.forEach(function(ds){return l(j,ds)}),De&&vn(j,ke),pe}function ye(j,N,B,Y){if(B==null)throw Error(n(151));for(var pe=null,ze=null,he=N,ke=N=0,Re=null,He=B.next();he!==null&&!He.done;ke++,He=B.next()){he.index>ke?(Re=he,he=null):Re=he.sibling;var ds=z(j,he,He.value,Y);if(ds===null){he===null&&(he=Re);break}s&&he&&ds.alternate===null&&l(j,he),N=g(ds,N,ke),ze===null?pe=ds:ze.sibling=ds,ze=ds,he=Re}if(He.done)return u(j,he),De&&vn(j,ke),pe;if(he===null){for(;!He.done;ke++,He=B.next())He=I(j,He.value,Y),He!==null&&(N=g(He,N,ke),ze===null?pe=He:ze.sibling=He,ze=He);return De&&vn(j,ke),pe}for(he=h(he);!He.done;ke++,He=B.next())He=q(he,j,ke,He.value,Y),He!==null&&(s&&He.alternate!==null&&he.delete(He.key===null?ke:He.key),N=g(He,N,ke),ze===null?pe=He:ze.sibling=He,ze=He);return s&&he.forEach(function(kM){return l(j,kM)}),De&&vn(j,ke),pe}function Ke(j,N,B,Y){if(typeof B=="object"&&B!==null&&B.type===k&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case x:e:{for(var pe=B.key;N!==null;){if(N.key===pe){if(pe=B.type,pe===k){if(N.tag===7){u(j,N.sibling),Y=p(N,B.props.children),Y.return=j,j=Y;break e}}else if(N.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===J&&Gs(pe)===N.type){u(j,N.sibling),Y=p(N,B.props),Yl(Y,B),Y.return=j,j=Y;break e}u(j,N);break}else l(j,N);N=N.sibling}B.type===k?(Y=Us(B.props.children,j.mode,Y,B.key),Y.return=j,j=Y):(Y=Po(B.type,B.key,B.props,null,j.mode,Y),Yl(Y,B),Y.return=j,j=Y)}return v(j);case w:e:{for(pe=B.key;N!==null;){if(N.key===pe)if(N.tag===4&&N.stateNode.containerInfo===B.containerInfo&&N.stateNode.implementation===B.implementation){u(j,N.sibling),Y=p(N,B.children||[]),Y.return=j,j=Y;break e}else{u(j,N);break}else l(j,N);N=N.sibling}Y=af(B,j.mode,Y),Y.return=j,j=Y}return v(j);case J:return B=Gs(B),Ke(j,N,B,Y)}if(de(B))return oe(j,N,B,Y);if(P(B)){if(pe=P(B),typeof pe!="function")throw Error(n(150));return B=pe.call(B),ye(j,N,B,Y)}if(typeof B.then=="function")return Ke(j,N,Io(B),Y);if(B.$$typeof===D)return Ke(j,N,Go(j,B),Y);Wo(j,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,N!==null&&N.tag===6?(u(j,N.sibling),Y=p(N,B),Y.return=j,j=Y):(u(j,N),Y=lf(B,j.mode,Y),Y.return=j,j=Y),v(j)):u(j,N)}return function(j,N,B,Y){try{Kl=0;var pe=Ke(j,N,B,Y);return Lr=null,pe}catch(he){if(he===Br||he===Ko)throw he;var ze=ci(29,he,null,j.mode);return ze.lanes=Y,ze.return=j,ze}}}var Ks=X0(!0),Z0=X0(!1),Xn=!1;function xf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vf(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Zn(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Jn(s,l,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(Ue&2)!==0){var p=h.pending;return p===null?l.next=l:(l.next=p.next,p.next=l),h.pending=l,l=qo(s),B0(s,null,u),l}return Uo(s,h,l,u),qo(s)}function Il(s,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,Vg(s,u)}}function Sf(s,l){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var p=null,g=null;if(u=u.firstBaseUpdate,u!==null){do{var v={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};g===null?p=g=v:g=g.next=v,u=u.next}while(u!==null);g===null?p=g=l:g=g.next=l}else p=g=l;u={baseState:h.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=l}var wf=!1;function Wl(){if(wf){var s=jr;if(s!==null)throw s}}function Xl(s,l,u,h){wf=!1;var p=s.updateQueue;Xn=!1;var g=p.firstBaseUpdate,v=p.lastBaseUpdate,A=p.shared.pending;if(A!==null){p.shared.pending=null;var T=A,L=T.next;T.next=null,v===null?g=L:v.next=L,v=T;var F=s.alternate;F!==null&&(F=F.updateQueue,A=F.lastBaseUpdate,A!==v&&(A===null?F.firstBaseUpdate=L:A.next=L,F.lastBaseUpdate=T))}if(g!==null){var I=p.baseState;v=0,F=L=T=null,A=g;do{var z=A.lane&-536870913,q=z!==A.lane;if(q?(Ne&z)===z:(h&z)===z){z!==0&&z===Dr&&(wf=!0),F!==null&&(F=F.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var oe=s,ye=A;z=l;var Ke=u;switch(ye.tag){case 1:if(oe=ye.payload,typeof oe=="function"){I=oe.call(Ke,I,z);break e}I=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=ye.payload,z=typeof oe=="function"?oe.call(Ke,I,z):oe,z==null)break e;I=y({},I,z);break e;case 2:Xn=!0}}z=A.callback,z!==null&&(s.flags|=64,q&&(s.flags|=8192),q=p.callbacks,q===null?p.callbacks=[z]:q.push(z))}else q={lane:z,tag:A.tag,payload:A.payload,callback:A.callback,next:null},F===null?(L=F=q,T=I):F=F.next=q,v|=z;if(A=A.next,A===null){if(A=p.shared.pending,A===null)break;q=A,A=q.next,q.next=null,p.lastBaseUpdate=q,p.shared.pending=null}}while(!0);F===null&&(T=I),p.baseState=T,p.firstBaseUpdate=L,p.lastBaseUpdate=F,g===null&&(p.shared.lanes=0),ns|=v,s.lanes=v,s.memoizedState=I}}function J0(s,l){if(typeof s!="function")throw Error(n(191,s));s.call(l)}function $0(s,l){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)J0(u[s],l)}var zr=O(null),Xo=O(0);function ey(s,l){s=Rn,$(Xo,s),$(zr,l),Rn=s|l.baseLanes}function kf(){$(Xo,Rn),$(zr,zr.current)}function Cf(){Rn=Xo.current,G(zr),G(Xo)}var hi=O(null),Oi=null;function $n(s){var l=s.alternate;$(ut,ut.current&1),$(hi,s),Oi===null&&(l===null||zr.current!==null||l.memoizedState!==null)&&(Oi=s)}function Af(s){$(ut,ut.current),$(hi,s),Oi===null&&(Oi=s)}function ty(s){s.tag===22?($(ut,ut.current),$(hi,s),Oi===null&&(Oi=s)):es()}function es(){$(ut,ut.current),$(hi,hi.current)}function fi(s){G(hi),Oi===s&&(Oi=null),G(ut)}var ut=O(0);function Zo(s){for(var l=s;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Rd(u)||Dd(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var kn=0,we=null,Ge=null,mt=null,Jo=!1,Hr=!1,Ys=!1,$o=0,Zl=0,_r=null,dA=0;function st(){throw Error(n(321))}function Mf(s,l){if(l===null)return!1;for(var u=0;u<l.length&&u<s.length;u++)if(!ui(s[u],l[u]))return!1;return!0}function Tf(s,l,u,h,p,g){return kn=g,we=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,H.H=s===null||s.memoizedState===null?_y:Vf,Ys=!1,g=u(h,p),Ys=!1,Hr&&(g=ny(l,u,h,p)),iy(s),g}function iy(s){H.H=ea;var l=Ge!==null&&Ge.next!==null;if(kn=0,mt=Ge=we=null,Jo=!1,Zl=0,_r=null,l)throw Error(n(300));s===null||gt||(s=s.dependencies,s!==null&&Qo(s)&&(gt=!0))}function ny(s,l,u,h){we=s;var p=0;do{if(Hr&&(_r=null),Zl=0,Hr=!1,25<=p)throw Error(n(301));if(p+=1,mt=Ge=null,s.updateQueue!=null){var g=s.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}H.H=Uy,g=l(u,h)}while(Hr);return g}function pA(){var s=H.H,l=s.useState()[0];return l=typeof l.then=="function"?Jl(l):l,s=s.useState()[0],(Ge!==null?Ge.memoizedState:null)!==s&&(we.flags|=1024),l}function Of(){var s=$o!==0;return $o=0,s}function Ef(s,l,u){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~u}function Nf(s){if(Jo){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}Jo=!1}kn=0,mt=Ge=we=null,Hr=!1,Zl=$o=0,_r=null}function Vt(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?we.memoizedState=mt=s:mt=mt.next=s,mt}function ct(){if(Ge===null){var s=we.alternate;s=s!==null?s.memoizedState:null}else s=Ge.next;var l=mt===null?we.memoizedState:mt.next;if(l!==null)mt=l,Ge=s;else{if(s===null)throw we.alternate===null?Error(n(467)):Error(n(310));Ge=s,s={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},mt===null?we.memoizedState=mt=s:mt=mt.next=s}return mt}function eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jl(s){var l=Zl;return Zl+=1,_r===null&&(_r=[]),s=Y0(_r,s,l),l=we,(mt===null?l.memoizedState:mt.next)===null&&(l=l.alternate,H.H=l===null||l.memoizedState===null?_y:Vf),s}function tu(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Jl(s);if(s.$$typeof===D)return Nt(s)}throw Error(n(438,String(s)))}function Rf(s){var l=null,u=we.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=we.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(p){return p.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=eu(),we.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(s),h=0;h<s;h++)u[h]=ce;return l.index++,u}function Cn(s,l){return typeof l=="function"?l(s):l}function iu(s){var l=ct();return Df(l,Ge,s)}function Df(s,l,u){var h=s.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=u;var p=s.baseQueue,g=h.pending;if(g!==null){if(p!==null){var v=p.next;p.next=g.next,g.next=v}l.baseQueue=p=g,h.pending=null}if(g=s.baseState,p===null)s.memoizedState=g;else{l=p.next;var A=v=null,T=null,L=l,F=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Ne&I)===I:(kn&I)===I){var z=L.revertLane;if(z===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===Dr&&(F=!0);else if((kn&z)===z){L=L.next,z===Dr&&(F=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},T===null?(A=T=I,v=g):T=T.next=I,we.lanes|=z,ns|=z;I=L.action,Ys&&u(g,I),g=L.hasEagerState?L.eagerState:u(g,I)}else z={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},T===null?(A=T=z,v=g):T=T.next=z,we.lanes|=I,ns|=I;L=L.next}while(L!==null&&L!==l);if(T===null?v=g:T.next=A,!ui(g,s.memoizedState)&&(gt=!0,F&&(u=jr,u!==null)))throw u;s.memoizedState=g,s.baseState=v,s.baseQueue=T,h.lastRenderedState=g}return p===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function jf(s){var l=ct(),u=l.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var h=u.dispatch,p=u.pending,g=l.memoizedState;if(p!==null){u.pending=null;var v=p=p.next;do g=s(g,v.action),v=v.next;while(v!==p);ui(g,l.memoizedState)||(gt=!0),l.memoizedState=g,l.baseQueue===null&&(l.baseState=g),u.lastRenderedState=g}return[g,h]}function sy(s,l,u){var h=we,p=ct(),g=De;if(g){if(u===void 0)throw Error(n(407));u=u()}else u=l();var v=!ui((Ge||p).memoizedState,u);if(v&&(p.memoizedState=u,gt=!0),p=p.queue,zf(ay.bind(null,h,p,s),[s]),p.getSnapshot!==l||v||mt!==null&&mt.memoizedState.tag&1){if(h.flags|=2048,Ur(9,{destroy:void 0},ly.bind(null,h,p,u,l),null),Ie===null)throw Error(n(349));g||(kn&127)!==0||ry(h,l,u)}return u}function ry(s,l,u){s.flags|=16384,s={getSnapshot:l,value:u},l=we.updateQueue,l===null?(l=eu(),we.updateQueue=l,l.stores=[s]):(u=l.stores,u===null?l.stores=[s]:u.push(s))}function ly(s,l,u,h){l.value=u,l.getSnapshot=h,oy(l)&&uy(s)}function ay(s,l,u){return u(function(){oy(l)&&uy(s)})}function oy(s){var l=s.getSnapshot;s=s.value;try{var u=l();return!ui(s,u)}catch{return!0}}function uy(s){var l=_s(s,2);l!==null&&$t(l,s,2)}function Bf(s){var l=Vt();if(typeof s=="function"){var u=s;if(s=u(),Ys){Qn(!0);try{u()}finally{Qn(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cn,lastRenderedState:s},l}function cy(s,l,u,h){return s.baseState=u,Df(s,Ge,typeof h=="function"?h:Cn)}function mA(s,l,u,h,p){if(ru(s))throw Error(n(485));if(s=l.action,s!==null){var g={payload:p,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){g.listeners.push(v)}};H.T!==null?u(!0):g.isTransition=!1,h(g),u=l.pending,u===null?(g.next=l.pending=g,hy(l,g)):(g.next=u.next,l.pending=u.next=g)}}function hy(s,l){var u=l.action,h=l.payload,p=s.state;if(l.isTransition){var g=H.T,v={};H.T=v;try{var A=u(p,h),T=H.S;T!==null&&T(v,A),fy(s,l,A)}catch(L){Lf(s,l,L)}finally{g!==null&&v.types!==null&&(g.types=v.types),H.T=g}}else try{g=u(p,h),fy(s,l,g)}catch(L){Lf(s,l,L)}}function fy(s,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){dy(s,l,h)},function(h){return Lf(s,l,h)}):dy(s,l,u)}function dy(s,l,u){l.status="fulfilled",l.value=u,py(l),s.state=u,l=s.pending,l!==null&&(u=l.next,u===l?s.pending=null:(u=u.next,l.next=u,hy(s,u)))}function Lf(s,l,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,py(l),l=l.next;while(l!==h)}s.action=null}function py(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function my(s,l){return l}function gy(s,l){if(De){var u=Ie.formState;if(u!==null){e:{var h=we;if(De){if(Je){t:{for(var p=Je,g=Ti;p.nodeType!==8;){if(!g){p=null;break t}if(p=Ei(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){Je=Ei(p.nextSibling),h=p.data==="F!";break e}}In(h)}h=!1}h&&(l=u[0])}}return u=Vt(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:my,lastRenderedState:l},u.queue=h,u=Ly.bind(null,we,h),h.dispatch=u,h=Bf(!1),g=Pf.bind(null,we,!1,h.queue),h=Vt(),p={state:l,dispatch:null,action:s,pending:null},h.queue=p,u=mA.bind(null,we,p,g,u),p.dispatch=u,h.memoizedState=s,[l,u,!1]}function yy(s){var l=ct();return by(l,Ge,s)}function by(s,l,u){if(l=Df(s,l,my)[0],s=iu(Cn)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=Jl(l)}catch(v){throw v===Br?Ko:v}else h=l;l=ct();var p=l.queue,g=p.dispatch;return u!==l.memoizedState&&(we.flags|=2048,Ur(9,{destroy:void 0},gA.bind(null,p,u),null)),[h,g,s]}function gA(s,l){s.action=l}function xy(s){var l=ct(),u=Ge;if(u!==null)return by(l,u,s);ct(),l=l.memoizedState,u=ct();var h=u.queue.dispatch;return u.memoizedState=s,[l,h,!1]}function Ur(s,l,u,h){return s={tag:s,create:u,deps:h,inst:l,next:null},l=we.updateQueue,l===null&&(l=eu(),we.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,l.lastEffect=s),s}function vy(){return ct().memoizedState}function nu(s,l,u,h){var p=Vt();we.flags|=s,p.memoizedState=Ur(1|l,{destroy:void 0},u,h===void 0?null:h)}function su(s,l,u,h){var p=ct();h=h===void 0?null:h;var g=p.memoizedState.inst;Ge!==null&&h!==null&&Mf(h,Ge.memoizedState.deps)?p.memoizedState=Ur(l,g,u,h):(we.flags|=s,p.memoizedState=Ur(1|l,g,u,h))}function Sy(s,l){nu(8390656,8,s,l)}function zf(s,l){su(2048,8,s,l)}function yA(s){we.flags|=4;var l=we.updateQueue;if(l===null)l=eu(),we.updateQueue=l,l.events=[s];else{var u=l.events;u===null?l.events=[s]:u.push(s)}}function wy(s){var l=ct().memoizedState;return yA({ref:l,nextImpl:s}),function(){if((Ue&2)!==0)throw Error(n(440));return l.impl.apply(void 0,arguments)}}function ky(s,l){return su(4,2,s,l)}function Cy(s,l){return su(4,4,s,l)}function Ay(s,l){if(typeof l=="function"){s=s();var u=l(s);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function My(s,l,u){u=u!=null?u.concat([s]):null,su(4,4,Ay.bind(null,l,s),u)}function Hf(){}function Ty(s,l){var u=ct();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&Mf(l,h[1])?h[0]:(u.memoizedState=[s,l],s)}function Oy(s,l){var u=ct();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&Mf(l,h[1]))return h[0];if(h=s(),Ys){Qn(!0);try{s()}finally{Qn(!1)}}return u.memoizedState=[h,l],h}function _f(s,l,u){return u===void 0||(kn&1073741824)!==0&&(Ne&261930)===0?s.memoizedState=l:(s.memoizedState=u,s=Eb(),we.lanes|=s,ns|=s,u)}function Ey(s,l,u,h){return ui(u,l)?u:zr.current!==null?(s=_f(s,u,h),ui(s,l)||(gt=!0),s):(kn&42)===0||(kn&1073741824)!==0&&(Ne&261930)===0?(gt=!0,s.memoizedState=u):(s=Eb(),we.lanes|=s,ns|=s,l)}function Ny(s,l,u,h,p){var g=X.p;X.p=g!==0&&8>g?g:8;var v=H.T,A={};H.T=A,Pf(s,!1,l,u);try{var T=p(),L=H.S;if(L!==null&&L(A,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var F=fA(T,h);$l(s,l,F,mi(s))}else $l(s,l,h,mi(s))}catch(I){$l(s,l,{then:function(){},status:"rejected",reason:I},mi())}finally{X.p=g,v!==null&&A.types!==null&&(v.types=A.types),H.T=v}}function bA(){}function Uf(s,l,u,h){if(s.tag!==5)throw Error(n(476));var p=Ry(s).queue;Ny(s,p,l,le,u===null?bA:function(){return Dy(s),u(h)})}function Ry(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cn,lastRenderedState:le},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cn,lastRenderedState:u},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function Dy(s){var l=Ry(s);l.next===null&&(l=s.alternate.memoizedState),$l(s,l.next.queue,{},mi())}function qf(){return Nt(ga)}function jy(){return ct().memoizedState}function By(){return ct().memoizedState}function xA(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var u=mi();s=Zn(u);var h=Jn(l,s,u);h!==null&&($t(h,l,u),Il(h,l,u)),l={cache:mf()},s.payload=l;return}l=l.return}}function vA(s,l,u){var h=mi();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ru(s)?zy(l,u):(u=sf(s,l,u,h),u!==null&&($t(u,s,h),Hy(u,l,h)))}function Ly(s,l,u){var h=mi();$l(s,l,u,h)}function $l(s,l,u,h){var p={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ru(s))zy(l,p);else{var g=s.alternate;if(s.lanes===0&&(g===null||g.lanes===0)&&(g=l.lastRenderedReducer,g!==null))try{var v=l.lastRenderedState,A=g(v,u);if(p.hasEagerState=!0,p.eagerState=A,ui(A,v))return Uo(s,l,p,0),Ie===null&&_o(),!1}catch{}if(u=sf(s,l,p,h),u!==null)return $t(u,s,h),Hy(u,l,h),!0}return!1}function Pf(s,l,u,h){if(h={lane:2,revertLane:xd(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ru(s)){if(l)throw Error(n(479))}else l=sf(s,u,h,2),l!==null&&$t(l,s,2)}function ru(s){var l=s.alternate;return s===we||l!==null&&l===we}function zy(s,l){Hr=Jo=!0;var u=s.pending;u===null?l.next=l:(l.next=u.next,u.next=l),s.pending=l}function Hy(s,l,u){if((u&4194048)!==0){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,Vg(s,u)}}var ea={readContext:Nt,use:tu,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};ea.useEffectEvent=st;var _y={readContext:Nt,use:tu,useCallback:function(s,l){return Vt().memoizedState=[s,l===void 0?null:l],s},useContext:Nt,useEffect:Sy,useImperativeHandle:function(s,l,u){u=u!=null?u.concat([s]):null,nu(4194308,4,Ay.bind(null,l,s),u)},useLayoutEffect:function(s,l){return nu(4194308,4,s,l)},useInsertionEffect:function(s,l){nu(4,2,s,l)},useMemo:function(s,l){var u=Vt();l=l===void 0?null:l;var h=s();if(Ys){Qn(!0);try{s()}finally{Qn(!1)}}return u.memoizedState=[h,l],h},useReducer:function(s,l,u){var h=Vt();if(u!==void 0){var p=u(l);if(Ys){Qn(!0);try{u(l)}finally{Qn(!1)}}}else p=l;return h.memoizedState=h.baseState=p,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:p},h.queue=s,s=s.dispatch=vA.bind(null,we,s),[h.memoizedState,s]},useRef:function(s){var l=Vt();return s={current:s},l.memoizedState=s},useState:function(s){s=Bf(s);var l=s.queue,u=Ly.bind(null,we,l);return l.dispatch=u,[s.memoizedState,u]},useDebugValue:Hf,useDeferredValue:function(s,l){var u=Vt();return _f(u,s,l)},useTransition:function(){var s=Bf(!1);return s=Ny.bind(null,we,s.queue,!0,!1),Vt().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,u){var h=we,p=Vt();if(De){if(u===void 0)throw Error(n(407));u=u()}else{if(u=l(),Ie===null)throw Error(n(349));(Ne&127)!==0||ry(h,l,u)}p.memoizedState=u;var g={value:u,getSnapshot:l};return p.queue=g,Sy(ay.bind(null,h,g,s),[s]),h.flags|=2048,Ur(9,{destroy:void 0},ly.bind(null,h,g,u,l),null),u},useId:function(){var s=Vt(),l=Ie.identifierPrefix;if(De){var u=Zi,h=Xi;u=(h&~(1<<32-oi(h)-1)).toString(32)+u,l="_"+l+"R_"+u,u=$o++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=dA++,l="_"+l+"r_"+u.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:qf,useFormState:gy,useActionState:gy,useOptimistic:function(s){var l=Vt();l.memoizedState=l.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Pf.bind(null,we,!0,u),u.dispatch=l,[s,l]},useMemoCache:Rf,useCacheRefresh:function(){return Vt().memoizedState=xA.bind(null,we)},useEffectEvent:function(s){var l=Vt(),u={impl:s};return l.memoizedState=u,function(){if((Ue&2)!==0)throw Error(n(440));return u.impl.apply(void 0,arguments)}}},Vf={readContext:Nt,use:tu,useCallback:Ty,useContext:Nt,useEffect:zf,useImperativeHandle:My,useInsertionEffect:ky,useLayoutEffect:Cy,useMemo:Oy,useReducer:iu,useRef:vy,useState:function(){return iu(Cn)},useDebugValue:Hf,useDeferredValue:function(s,l){var u=ct();return Ey(u,Ge.memoizedState,s,l)},useTransition:function(){var s=iu(Cn)[0],l=ct().memoizedState;return[typeof s=="boolean"?s:Jl(s),l]},useSyncExternalStore:sy,useId:jy,useHostTransitionStatus:qf,useFormState:yy,useActionState:yy,useOptimistic:function(s,l){var u=ct();return cy(u,Ge,s,l)},useMemoCache:Rf,useCacheRefresh:By};Vf.useEffectEvent=wy;var Uy={readContext:Nt,use:tu,useCallback:Ty,useContext:Nt,useEffect:zf,useImperativeHandle:My,useInsertionEffect:ky,useLayoutEffect:Cy,useMemo:Oy,useReducer:jf,useRef:vy,useState:function(){return jf(Cn)},useDebugValue:Hf,useDeferredValue:function(s,l){var u=ct();return Ge===null?_f(u,s,l):Ey(u,Ge.memoizedState,s,l)},useTransition:function(){var s=jf(Cn)[0],l=ct().memoizedState;return[typeof s=="boolean"?s:Jl(s),l]},useSyncExternalStore:sy,useId:jy,useHostTransitionStatus:qf,useFormState:xy,useActionState:xy,useOptimistic:function(s,l){var u=ct();return Ge!==null?cy(u,Ge,s,l):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Rf,useCacheRefresh:By};Uy.useEffectEvent=wy;function Qf(s,l,u,h){l=s.memoizedState,u=u(h,l),u=u==null?l:y({},l,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var Gf={enqueueSetState:function(s,l,u){s=s._reactInternals;var h=mi(),p=Zn(h);p.payload=l,u!=null&&(p.callback=u),l=Jn(s,p,h),l!==null&&($t(l,s,h),Il(l,s,h))},enqueueReplaceState:function(s,l,u){s=s._reactInternals;var h=mi(),p=Zn(h);p.tag=1,p.payload=l,u!=null&&(p.callback=u),l=Jn(s,p,h),l!==null&&($t(l,s,h),Il(l,s,h))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var u=mi(),h=Zn(u);h.tag=2,l!=null&&(h.callback=l),l=Jn(s,h,u),l!==null&&($t(l,s,u),Il(l,s,u))}};function qy(s,l,u,h,p,g,v){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,g,v):l.prototype&&l.prototype.isPureReactComponent?!ql(u,h)||!ql(p,g):!0}function Py(s,l,u,h){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==s&&Gf.enqueueReplaceState(l,l.state,null)}function Is(s,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(s=s.defaultProps){u===l&&(u=y({},u));for(var p in s)u[p]===void 0&&(u[p]=s[p])}return u}function Vy(s){Ho(s)}function Qy(s){console.error(s)}function Gy(s){Ho(s)}function lu(s,l){try{var u=s.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function Fy(s,l,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ff(s,l,u){return u=Zn(u),u.tag=3,u.payload={element:null},u.callback=function(){lu(s,l)},u}function Ky(s){return s=Zn(s),s.tag=3,s}function Yy(s,l,u,h){var p=u.type.getDerivedStateFromError;if(typeof p=="function"){var g=h.value;s.payload=function(){return p(g)},s.callback=function(){Fy(l,u,h)}}var v=u.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(s.callback=function(){Fy(l,u,h),typeof p!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var A=h.stack;this.componentDidCatch(h.value,{componentStack:A!==null?A:""})})}function SA(s,l,u,h,p){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&Rr(l,u,p,!0),u=hi.current,u!==null){switch(u.tag){case 31:case 13:return Oi===null?bu():u.alternate===null&&rt===0&&(rt=3),u.flags&=-257,u.flags|=65536,u.lanes=p,h===Yo?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),gd(s,h,p)),!1;case 22:return u.flags|=65536,h===Yo?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),gd(s,h,p)),!1}throw Error(n(435,u.tag))}return gd(s,h,p),bu(),!1}if(De)return l=hi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=p,h!==cf&&(s=Error(n(422),{cause:h}),Ql(Ci(s,u)))):(h!==cf&&(l=Error(n(423),{cause:h}),Ql(Ci(l,u))),s=s.current.alternate,s.flags|=65536,p&=-p,s.lanes|=p,h=Ci(h,u),p=Ff(s.stateNode,h,p),Sf(s,p),rt!==4&&(rt=2)),!1;var g=Error(n(520),{cause:h});if(g=Ci(g,u),oa===null?oa=[g]:oa.push(g),rt!==4&&(rt=2),l===null)return!0;h=Ci(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,s=p&-p,u.lanes|=s,s=Ff(u.stateNode,h,s),Sf(u,s),!1;case 1:if(l=u.type,g=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ss===null||!ss.has(g))))return u.flags|=65536,p&=-p,u.lanes|=p,p=Ky(p),Yy(p,s,u,h),Sf(u,p),!1}u=u.return}while(u!==null);return!1}var Kf=Error(n(461)),gt=!1;function Rt(s,l,u,h){l.child=s===null?Z0(l,null,u,h):Ks(l,s.child,u,h)}function Iy(s,l,u,h,p){u=u.render;var g=l.ref;if("ref"in h){var v={};for(var A in h)A!=="ref"&&(v[A]=h[A])}else v=h;return Vs(l),h=Tf(s,l,u,v,g,p),A=Of(),s!==null&&!gt?(Ef(s,l,p),An(s,l,p)):(De&&A&&of(l),l.flags|=1,Rt(s,l,h,p),l.child)}function Wy(s,l,u,h,p){if(s===null){var g=u.type;return typeof g=="function"&&!rf(g)&&g.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=g,Xy(s,l,g,h,p)):(s=Po(u.type,null,h,l,l.mode,p),s.ref=l.ref,s.return=l,l.child=s)}if(g=s.child,!ed(s,p)){var v=g.memoizedProps;if(u=u.compare,u=u!==null?u:ql,u(v,h)&&s.ref===l.ref)return An(s,l,p)}return l.flags|=1,s=xn(g,h),s.ref=l.ref,s.return=l,l.child=s}function Xy(s,l,u,h,p){if(s!==null){var g=s.memoizedProps;if(ql(g,h)&&s.ref===l.ref)if(gt=!1,l.pendingProps=h=g,ed(s,p))(s.flags&131072)!==0&&(gt=!0);else return l.lanes=s.lanes,An(s,l,p)}return Yf(s,l,u,h,p)}function Zy(s,l,u,h){var p=h.children,g=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(g=g!==null?g.baseLanes|u:u,s!==null){for(h=l.child=s.child,p=0;h!==null;)p=p|h.lanes|h.childLanes,h=h.sibling;h=p&~g}else h=0,l.child=null;return Jy(s,l,g,u,h)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Fo(l,g!==null?g.cachePool:null),g!==null?ey(l,g):kf(),ty(l);else return h=l.lanes=536870912,Jy(s,l,g!==null?g.baseLanes|u:u,u,h)}else g!==null?(Fo(l,g.cachePool),ey(l,g),es(),l.memoizedState=null):(s!==null&&Fo(l,null),kf(),es());return Rt(s,l,p,u),l.child}function ta(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Jy(s,l,u,h,p){var g=yf();return g=g===null?null:{parent:pt._currentValue,pool:g},l.memoizedState={baseLanes:u,cachePool:g},s!==null&&Fo(l,null),kf(),ty(l),s!==null&&Rr(s,l,h,!0),l.childLanes=p,null}function au(s,l){return l=uu({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function $y(s,l,u){return Ks(l,s.child,null,u),s=au(l,l.pendingProps),s.flags|=2,fi(l),l.memoizedState=null,s}function wA(s,l,u){var h=l.pendingProps,p=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(De){if(h.mode==="hidden")return s=au(l,h),l.lanes=536870912,ta(null,s);if(Af(l),(s=Je)?(s=hx(s,Ti),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Kn!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},u=z0(s),u.return=l,l.child=u,Et=l,Je=null)):s=null,s===null)throw In(l);return l.lanes=536870912,null}return au(l,h)}var g=s.memoizedState;if(g!==null){var v=g.dehydrated;if(Af(l),p)if(l.flags&256)l.flags&=-257,l=$y(s,l,u);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(n(558));else if(gt||Rr(s,l,u,!1),p=(u&s.childLanes)!==0,gt||p){if(h=Ie,h!==null&&(v=Qg(h,u),v!==0&&v!==g.retryLane))throw g.retryLane=v,_s(s,v),$t(h,s,v),Kf;bu(),l=$y(s,l,u)}else s=g.treeContext,Je=Ei(v.nextSibling),Et=l,De=!0,Yn=null,Ti=!1,s!==null&&U0(l,s),l=au(l,h),l.flags|=4096;return l}return s=xn(s.child,{mode:h.mode,children:h.children}),s.ref=l.ref,l.child=s,s.return=l,s}function ou(s,l){var u=l.ref;if(u===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(n(284));(s===null||s.ref!==u)&&(l.flags|=4194816)}}function Yf(s,l,u,h,p){return Vs(l),u=Tf(s,l,u,h,void 0,p),h=Of(),s!==null&&!gt?(Ef(s,l,p),An(s,l,p)):(De&&h&&of(l),l.flags|=1,Rt(s,l,u,p),l.child)}function eb(s,l,u,h,p,g){return Vs(l),l.updateQueue=null,u=ny(l,h,u,p),iy(s),h=Of(),s!==null&&!gt?(Ef(s,l,g),An(s,l,g)):(De&&h&&of(l),l.flags|=1,Rt(s,l,u,g),l.child)}function tb(s,l,u,h,p){if(Vs(l),l.stateNode===null){var g=Tr,v=u.contextType;typeof v=="object"&&v!==null&&(g=Nt(v)),g=new u(h,g),l.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Gf,l.stateNode=g,g._reactInternals=l,g=l.stateNode,g.props=h,g.state=l.memoizedState,g.refs={},xf(l),v=u.contextType,g.context=typeof v=="object"&&v!==null?Nt(v):Tr,g.state=l.memoizedState,v=u.getDerivedStateFromProps,typeof v=="function"&&(Qf(l,u,v,h),g.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(v=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),v!==g.state&&Gf.enqueueReplaceState(g,g.state,null),Xl(l,h,g,p),Wl(),g.state=l.memoizedState),typeof g.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(s===null){g=l.stateNode;var A=l.memoizedProps,T=Is(u,A);g.props=T;var L=g.context,F=u.contextType;v=Tr,typeof F=="object"&&F!==null&&(v=Nt(F));var I=u.getDerivedStateFromProps;F=typeof I=="function"||typeof g.getSnapshotBeforeUpdate=="function",A=l.pendingProps!==A,F||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(A||L!==v)&&Py(l,g,h,v),Xn=!1;var z=l.memoizedState;g.state=z,Xl(l,h,g,p),Wl(),L=l.memoizedState,A||z!==L||Xn?(typeof I=="function"&&(Qf(l,u,I,h),L=l.memoizedState),(T=Xn||qy(l,u,T,h,z,L,v))?(F||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(l.flags|=4194308)):(typeof g.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=L),g.props=h,g.state=L,g.context=v,h=T):(typeof g.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{g=l.stateNode,vf(s,l),v=l.memoizedProps,F=Is(u,v),g.props=F,I=l.pendingProps,z=g.context,L=u.contextType,T=Tr,typeof L=="object"&&L!==null&&(T=Nt(L)),A=u.getDerivedStateFromProps,(L=typeof A=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(v!==I||z!==T)&&Py(l,g,h,T),Xn=!1,z=l.memoizedState,g.state=z,Xl(l,h,g,p),Wl();var q=l.memoizedState;v!==I||z!==q||Xn||s!==null&&s.dependencies!==null&&Qo(s.dependencies)?(typeof A=="function"&&(Qf(l,u,A,h),q=l.memoizedState),(F=Xn||qy(l,u,F,h,z,q,T)||s!==null&&s.dependencies!==null&&Qo(s.dependencies))?(L||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(h,q,T),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(h,q,T)),typeof g.componentDidUpdate=="function"&&(l.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof g.componentDidUpdate!="function"||v===s.memoizedProps&&z===s.memoizedState||(l.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||v===s.memoizedProps&&z===s.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=q),g.props=h,g.state=q,g.context=T,h=F):(typeof g.componentDidUpdate!="function"||v===s.memoizedProps&&z===s.memoizedState||(l.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||v===s.memoizedProps&&z===s.memoizedState||(l.flags|=1024),h=!1)}return g=h,ou(s,l),h=(l.flags&128)!==0,g||h?(g=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:g.render(),l.flags|=1,s!==null&&h?(l.child=Ks(l,s.child,null,p),l.child=Ks(l,null,u,p)):Rt(s,l,u,p),l.memoizedState=g.state,s=l.child):s=An(s,l,p),s}function ib(s,l,u,h){return qs(),l.flags|=256,Rt(s,l,u,h),l.child}var If={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wf(s){return{baseLanes:s,cachePool:F0()}}function Xf(s,l,u){return s=s!==null?s.childLanes&~u:0,l&&(s|=pi),s}function nb(s,l,u){var h=l.pendingProps,p=!1,g=(l.flags&128)!==0,v;if((v=g)||(v=s!==null&&s.memoizedState===null?!1:(ut.current&2)!==0),v&&(p=!0,l.flags&=-129),v=(l.flags&32)!==0,l.flags&=-33,s===null){if(De){if(p?$n(l):es(),(s=Je)?(s=hx(s,Ti),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Kn!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},u=z0(s),u.return=l,l.child=u,Et=l,Je=null)):s=null,s===null)throw In(l);return Dd(s)?l.lanes=32:l.lanes=536870912,null}var A=h.children;return h=h.fallback,p?(es(),p=l.mode,A=uu({mode:"hidden",children:A},p),h=Us(h,p,u,null),A.return=l,h.return=l,A.sibling=h,l.child=A,h=l.child,h.memoizedState=Wf(u),h.childLanes=Xf(s,v,u),l.memoizedState=If,ta(null,h)):($n(l),Zf(l,A))}var T=s.memoizedState;if(T!==null&&(A=T.dehydrated,A!==null)){if(g)l.flags&256?($n(l),l.flags&=-257,l=Jf(s,l,u)):l.memoizedState!==null?(es(),l.child=s.child,l.flags|=128,l=null):(es(),A=h.fallback,p=l.mode,h=uu({mode:"visible",children:h.children},p),A=Us(A,p,u,null),A.flags|=2,h.return=l,A.return=l,h.sibling=A,l.child=h,Ks(l,s.child,null,u),h=l.child,h.memoizedState=Wf(u),h.childLanes=Xf(s,v,u),l.memoizedState=If,l=ta(null,h));else if($n(l),Dd(A)){if(v=A.nextSibling&&A.nextSibling.dataset,v)var L=v.dgst;v=L,h=Error(n(419)),h.stack="",h.digest=v,Ql({value:h,source:null,stack:null}),l=Jf(s,l,u)}else if(gt||Rr(s,l,u,!1),v=(u&s.childLanes)!==0,gt||v){if(v=Ie,v!==null&&(h=Qg(v,u),h!==0&&h!==T.retryLane))throw T.retryLane=h,_s(s,h),$t(v,s,h),Kf;Rd(A)||bu(),l=Jf(s,l,u)}else Rd(A)?(l.flags|=192,l.child=s.child,l=null):(s=T.treeContext,Je=Ei(A.nextSibling),Et=l,De=!0,Yn=null,Ti=!1,s!==null&&U0(l,s),l=Zf(l,h.children),l.flags|=4096);return l}return p?(es(),A=h.fallback,p=l.mode,T=s.child,L=T.sibling,h=xn(T,{mode:"hidden",children:h.children}),h.subtreeFlags=T.subtreeFlags&65011712,L!==null?A=xn(L,A):(A=Us(A,p,u,null),A.flags|=2),A.return=l,h.return=l,h.sibling=A,l.child=h,ta(null,h),h=l.child,A=s.child.memoizedState,A===null?A=Wf(u):(p=A.cachePool,p!==null?(T=pt._currentValue,p=p.parent!==T?{parent:T,pool:T}:p):p=F0(),A={baseLanes:A.baseLanes|u,cachePool:p}),h.memoizedState=A,h.childLanes=Xf(s,v,u),l.memoizedState=If,ta(s.child,h)):($n(l),u=s.child,s=u.sibling,u=xn(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,s!==null&&(v=l.deletions,v===null?(l.deletions=[s],l.flags|=16):v.push(s)),l.child=u,l.memoizedState=null,u)}function Zf(s,l){return l=uu({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function uu(s,l){return s=ci(22,s,null,l),s.lanes=0,s}function Jf(s,l,u){return Ks(l,s.child,null,u),s=Zf(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function sb(s,l,u){s.lanes|=l;var h=s.alternate;h!==null&&(h.lanes|=l),df(s.return,l,u)}function $f(s,l,u,h,p,g){var v=s.memoizedState;v===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:p,treeForkCount:g}:(v.isBackwards=l,v.rendering=null,v.renderingStartTime=0,v.last=h,v.tail=u,v.tailMode=p,v.treeForkCount=g)}function rb(s,l,u){var h=l.pendingProps,p=h.revealOrder,g=h.tail;h=h.children;var v=ut.current,A=(v&2)!==0;if(A?(v=v&1|2,l.flags|=128):v&=1,$(ut,v),Rt(s,l,h,u),h=De?Vl:0,!A&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&sb(s,u,l);else if(s.tag===19)sb(s,u,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(p){case"forwards":for(u=l.child,p=null;u!==null;)s=u.alternate,s!==null&&Zo(s)===null&&(p=u),u=u.sibling;u=p,u===null?(p=l.child,l.child=null):(p=u.sibling,u.sibling=null),$f(l,!1,p,u,g,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,p=l.child,l.child=null;p!==null;){if(s=p.alternate,s!==null&&Zo(s)===null){l.child=p;break}s=p.sibling,p.sibling=u,u=p,p=s}$f(l,!0,u,null,g,h);break;case"together":$f(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function An(s,l,u){if(s!==null&&(l.dependencies=s.dependencies),ns|=l.lanes,(u&l.childLanes)===0)if(s!==null){if(Rr(s,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(n(153));if(l.child!==null){for(s=l.child,u=xn(s,s.pendingProps),l.child=u,u.return=l;s.sibling!==null;)s=s.sibling,u=u.sibling=xn(s,s.pendingProps),u.return=l;u.sibling=null}return l.child}function ed(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Qo(s)))}function kA(s,l,u){switch(l.tag){case 3:Pt(l,l.stateNode.containerInfo),Wn(l,pt,s.memoizedState.cache),qs();break;case 27:case 5:Tl(l);break;case 4:Pt(l,l.stateNode.containerInfo);break;case 10:Wn(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Af(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?($n(l),l.flags|=128,null):(u&l.child.childLanes)!==0?nb(s,l,u):($n(l),s=An(s,l,u),s!==null?s.sibling:null);$n(l);break;case 19:var p=(s.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(Rr(s,l,u,!1),h=(u&l.childLanes)!==0),p){if(h)return rb(s,l,u);l.flags|=128}if(p=l.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),$(ut,ut.current),h)break;return null;case 22:return l.lanes=0,Zy(s,l,u,l.pendingProps);case 24:Wn(l,pt,s.memoizedState.cache)}return An(s,l,u)}function lb(s,l,u){if(s!==null)if(s.memoizedProps!==l.pendingProps)gt=!0;else{if(!ed(s,u)&&(l.flags&128)===0)return gt=!1,kA(s,l,u);gt=(s.flags&131072)!==0}else gt=!1,De&&(l.flags&1048576)!==0&&_0(l,Vl,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(s=Gs(l.elementType),l.type=s,typeof s=="function")rf(s)?(h=Is(s,h),l.tag=1,l=tb(null,l,s,h,u)):(l.tag=0,l=Yf(null,l,s,h,u));else{if(s!=null){var p=s.$$typeof;if(p===Q){l.tag=11,l=Iy(null,l,s,h,u);break e}else if(p===U){l.tag=14,l=Wy(null,l,s,h,u);break e}}throw l=fe(s)||s,Error(n(306,l,""))}}return l;case 0:return Yf(s,l,l.type,l.pendingProps,u);case 1:return h=l.type,p=Is(h,l.pendingProps),tb(s,l,h,p,u);case 3:e:{if(Pt(l,l.stateNode.containerInfo),s===null)throw Error(n(387));h=l.pendingProps;var g=l.memoizedState;p=g.element,vf(s,l),Xl(l,h,null,u);var v=l.memoizedState;if(h=v.cache,Wn(l,pt,h),h!==g.cache&&pf(l,[pt],u,!0),Wl(),h=v.element,g.isDehydrated)if(g={element:h,isDehydrated:!1,cache:v.cache},l.updateQueue.baseState=g,l.memoizedState=g,l.flags&256){l=ib(s,l,h,u);break e}else if(h!==p){p=Ci(Error(n(424)),l),Ql(p),l=ib(s,l,h,u);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Je=Ei(s.firstChild),Et=l,De=!0,Yn=null,Ti=!0,u=Z0(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(qs(),h===p){l=An(s,l,u);break e}Rt(s,l,h,u)}l=l.child}return l;case 26:return ou(s,l),s===null?(u=yx(l.type,null,l.pendingProps,null))?l.memoizedState=u:De||(u=l.type,s=l.pendingProps,h=Au(Se.current).createElement(u),h[Ot]=l,h[Yt]=s,Dt(h,u,s),kt(h),l.stateNode=h):l.memoizedState=yx(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return Tl(l),s===null&&De&&(h=l.stateNode=px(l.type,l.pendingProps,Se.current),Et=l,Ti=!0,p=Je,os(l.type)?(jd=p,Je=Ei(h.firstChild)):Je=p),Rt(s,l,l.pendingProps.children,u),ou(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&De&&((p=h=Je)&&(h=$A(h,l.type,l.pendingProps,Ti),h!==null?(l.stateNode=h,Et=l,Je=Ei(h.firstChild),Ti=!1,p=!0):p=!1),p||In(l)),Tl(l),p=l.type,g=l.pendingProps,v=s!==null?s.memoizedProps:null,h=g.children,Od(p,g)?h=null:v!==null&&Od(p,v)&&(l.flags|=32),l.memoizedState!==null&&(p=Tf(s,l,pA,null,null,u),ga._currentValue=p),ou(s,l),Rt(s,l,h,u),l.child;case 6:return s===null&&De&&((s=u=Je)&&(u=eM(u,l.pendingProps,Ti),u!==null?(l.stateNode=u,Et=l,Je=null,s=!0):s=!1),s||In(l)),null;case 13:return nb(s,l,u);case 4:return Pt(l,l.stateNode.containerInfo),h=l.pendingProps,s===null?l.child=Ks(l,null,h,u):Rt(s,l,h,u),l.child;case 11:return Iy(s,l,l.type,l.pendingProps,u);case 7:return Rt(s,l,l.pendingProps,u),l.child;case 8:return Rt(s,l,l.pendingProps.children,u),l.child;case 12:return Rt(s,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,Wn(l,l.type,h.value),Rt(s,l,h.children,u),l.child;case 9:return p=l.type._context,h=l.pendingProps.children,Vs(l),p=Nt(p),h=h(p),l.flags|=1,Rt(s,l,h,u),l.child;case 14:return Wy(s,l,l.type,l.pendingProps,u);case 15:return Xy(s,l,l.type,l.pendingProps,u);case 19:return rb(s,l,u);case 31:return wA(s,l,u);case 22:return Zy(s,l,u,l.pendingProps);case 24:return Vs(l),h=Nt(pt),s===null?(p=yf(),p===null&&(p=Ie,g=mf(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=u),p=g),l.memoizedState={parent:h,cache:p},xf(l),Wn(l,pt,p)):((s.lanes&u)!==0&&(vf(s,l),Xl(l,null,null,u),Wl()),p=s.memoizedState,g=l.memoizedState,p.parent!==h?(p={parent:h,cache:h},l.memoizedState=p,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=p),Wn(l,pt,h)):(h=g.cache,Wn(l,pt,h),h!==p.cache&&pf(l,[pt],u,!0))),Rt(s,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(n(156,l.tag))}function Mn(s){s.flags|=4}function td(s,l,u,h,p){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(p&335544128)===p)if(s.stateNode.complete)s.flags|=8192;else if(jb())s.flags|=8192;else throw Fs=Yo,bf}else s.flags&=-16777217}function ab(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!wx(l))if(jb())s.flags|=8192;else throw Fs=Yo,bf}function cu(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?qg():536870912,s.lanes|=l,Qr|=l)}function ia(s,l){if(!De)switch(s.tailMode){case"hidden":l=s.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function $e(s){var l=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(l)for(var p=s.child;p!==null;)u|=p.lanes|p.childLanes,h|=p.subtreeFlags&65011712,h|=p.flags&65011712,p.return=s,p=p.sibling;else for(p=s.child;p!==null;)u|=p.lanes|p.childLanes,h|=p.subtreeFlags,h|=p.flags,p.return=s,p=p.sibling;return s.subtreeFlags|=h,s.childLanes=u,l}function CA(s,l,u){var h=l.pendingProps;switch(uf(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(l),null;case 1:return $e(l),null;case 3:return u=l.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),wn(pt),ot(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Nr(l)?Mn(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,hf())),$e(l),null;case 26:var p=l.type,g=l.memoizedState;return s===null?(Mn(l),g!==null?($e(l),ab(l,g)):($e(l),td(l,p,null,h,u))):g?g!==s.memoizedState?(Mn(l),$e(l),ab(l,g)):($e(l),l.flags&=-16777217):(s=s.memoizedProps,s!==h&&Mn(l),$e(l),td(l,p,s,h,u)),null;case 27:if(So(l),u=Se.current,p=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&Mn(l);else{if(!h){if(l.stateNode===null)throw Error(n(166));return $e(l),null}s=ne.current,Nr(l)?q0(l):(s=px(p,h,u),l.stateNode=s,Mn(l))}return $e(l),null;case 5:if(So(l),p=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&Mn(l);else{if(!h){if(l.stateNode===null)throw Error(n(166));return $e(l),null}if(g=ne.current,Nr(l))q0(l);else{var v=Au(Se.current);switch(g){case 1:g=v.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=v.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=v.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=v.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=v.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof h.is=="string"?v.createElement("select",{is:h.is}):v.createElement("select"),h.multiple?g.multiple=!0:h.size&&(g.size=h.size);break;default:g=typeof h.is=="string"?v.createElement(p,{is:h.is}):v.createElement(p)}}g[Ot]=l,g[Yt]=h;e:for(v=l.child;v!==null;){if(v.tag===5||v.tag===6)g.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===l)break e;for(;v.sibling===null;){if(v.return===null||v.return===l)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}l.stateNode=g;e:switch(Dt(g,p,h),p){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Mn(l)}}return $e(l),td(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,u),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==h&&Mn(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(n(166));if(s=Se.current,Nr(l)){if(s=l.stateNode,u=l.memoizedProps,h=null,p=Et,p!==null)switch(p.tag){case 27:case 5:h=p.memoizedProps}s[Ot]=l,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||nx(s.nodeValue,u)),s||In(l,!0)}else s=Au(s).createTextNode(h),s[Ot]=l,l.stateNode=s}return $e(l),null;case 31:if(u=l.memoizedState,s===null||s.memoizedState!==null){if(h=Nr(l),u!==null){if(s===null){if(!h)throw Error(n(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(557));s[Ot]=l}else qs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;$e(l),s=!1}else u=hf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return l.flags&256?(fi(l),l):(fi(l),null);if((l.flags&128)!==0)throw Error(n(558))}return $e(l),null;case 13:if(h=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(p=Nr(l),h!==null&&h.dehydrated!==null){if(s===null){if(!p)throw Error(n(318));if(p=l.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));p[Ot]=l}else qs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;$e(l),p=!1}else p=hf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),p=!0;if(!p)return l.flags&256?(fi(l),l):(fi(l),null)}return fi(l),(l.flags&128)!==0?(l.lanes=u,l):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=l.child,p=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(p=h.alternate.memoizedState.cachePool.pool),g=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(g=h.memoizedState.cachePool.pool),g!==p&&(h.flags|=2048)),u!==s&&u&&(l.child.flags|=8192),cu(l,l.updateQueue),$e(l),null);case 4:return ot(),s===null&&kd(l.stateNode.containerInfo),$e(l),null;case 10:return wn(l.type),$e(l),null;case 19:if(G(ut),h=l.memoizedState,h===null)return $e(l),null;if(p=(l.flags&128)!==0,g=h.rendering,g===null)if(p)ia(h,!1);else{if(rt!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(g=Zo(s),g!==null){for(l.flags|=128,ia(h,!1),s=g.updateQueue,l.updateQueue=s,cu(l,s),l.subtreeFlags=0,s=u,u=l.child;u!==null;)L0(u,s),u=u.sibling;return $(ut,ut.current&1|2),De&&vn(l,h.treeForkCount),l.child}s=s.sibling}h.tail!==null&&li()>mu&&(l.flags|=128,p=!0,ia(h,!1),l.lanes=4194304)}else{if(!p)if(s=Zo(g),s!==null){if(l.flags|=128,p=!0,s=s.updateQueue,l.updateQueue=s,cu(l,s),ia(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!De)return $e(l),null}else 2*li()-h.renderingStartTime>mu&&u!==536870912&&(l.flags|=128,p=!0,ia(h,!1),l.lanes=4194304);h.isBackwards?(g.sibling=l.child,l.child=g):(s=h.last,s!==null?s.sibling=g:l.child=g,h.last=g)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=li(),s.sibling=null,u=ut.current,$(ut,p?u&1|2:u&1),De&&vn(l,h.treeForkCount),s):($e(l),null);case 22:case 23:return fi(l),Cf(),h=l.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&($e(l),l.subtreeFlags&6&&(l.flags|=8192)):$e(l),u=l.updateQueue,u!==null&&cu(l,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),s!==null&&G(Qs),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),wn(pt),$e(l),null;case 25:return null;case 30:return null}throw Error(n(156,l.tag))}function AA(s,l){switch(uf(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return wn(pt),ot(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return So(l),null;case 31:if(l.memoizedState!==null){if(fi(l),l.alternate===null)throw Error(n(340));qs()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(fi(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(n(340));qs()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return G(ut),null;case 4:return ot(),null;case 10:return wn(l.type),null;case 22:case 23:return fi(l),Cf(),s!==null&&G(Qs),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return wn(pt),null;case 25:return null;default:return null}}function ob(s,l){switch(uf(l),l.tag){case 3:wn(pt),ot();break;case 26:case 27:case 5:So(l);break;case 4:ot();break;case 31:l.memoizedState!==null&&fi(l);break;case 13:fi(l);break;case 19:G(ut);break;case 10:wn(l.type);break;case 22:case 23:fi(l),Cf(),s!==null&&G(Qs);break;case 24:wn(pt)}}function na(s,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var p=h.next;u=p;do{if((u.tag&s)===s){h=void 0;var g=u.create,v=u.inst;h=g(),v.destroy=h}u=u.next}while(u!==p)}}catch(A){Qe(l,l.return,A)}}function ts(s,l,u){try{var h=l.updateQueue,p=h!==null?h.lastEffect:null;if(p!==null){var g=p.next;h=g;do{if((h.tag&s)===s){var v=h.inst,A=v.destroy;if(A!==void 0){v.destroy=void 0,p=l;var T=u,L=A;try{L()}catch(F){Qe(p,T,F)}}}h=h.next}while(h!==g)}}catch(F){Qe(l,l.return,F)}}function ub(s){var l=s.updateQueue;if(l!==null){var u=s.stateNode;try{$0(l,u)}catch(h){Qe(s,s.return,h)}}}function cb(s,l,u){u.props=Is(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){Qe(s,l,h)}}function sa(s,l){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(p){Qe(s,l,p)}}function Ji(s,l){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(p){Qe(s,l,p)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(p){Qe(s,l,p)}else u.current=null}function hb(s){var l=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(p){Qe(s,s.return,p)}}function id(s,l,u){try{var h=s.stateNode;YA(h,s.type,u,l),h[Yt]=l}catch(p){Qe(s,s.return,p)}}function fb(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&os(s.type)||s.tag===4}function nd(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||fb(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&os(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function sd(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(s),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=yn));else if(h!==4&&(h===27&&os(s.type)&&(u=s.stateNode,l=null),s=s.child,s!==null))for(sd(s,l,u),s=s.sibling;s!==null;)sd(s,l,u),s=s.sibling}function hu(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?u.insertBefore(s,l):u.appendChild(s);else if(h!==4&&(h===27&&os(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(hu(s,l,u),s=s.sibling;s!==null;)hu(s,l,u),s=s.sibling}function db(s){var l=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,p=l.attributes;p.length;)l.removeAttributeNode(p[0]);Dt(l,h,u),l[Ot]=s,l[Yt]=u}catch(g){Qe(s,s.return,g)}}var Tn=!1,yt=!1,rd=!1,pb=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function MA(s,l){if(s=s.containerInfo,Md=Du,s=M0(s),Zh(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var p=h.anchorOffset,g=h.focusNode;h=h.focusOffset;try{u.nodeType,g.nodeType}catch{u=null;break e}var v=0,A=-1,T=-1,L=0,F=0,I=s,z=null;t:for(;;){for(var q;I!==u||p!==0&&I.nodeType!==3||(A=v+p),I!==g||h!==0&&I.nodeType!==3||(T=v+h),I.nodeType===3&&(v+=I.nodeValue.length),(q=I.firstChild)!==null;)z=I,I=q;for(;;){if(I===s)break t;if(z===u&&++L===p&&(A=v),z===g&&++F===h&&(T=v),(q=I.nextSibling)!==null)break;I=z,z=I.parentNode}I=q}u=A===-1||T===-1?null:{start:A,end:T}}else u=null}u=u||{start:0,end:0}}else u=null;for(Td={focusedElem:s,selectionRange:u},Du=!1,Ct=l;Ct!==null;)if(l=Ct,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Ct=s;else for(;Ct!==null;){switch(l=Ct,g=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)p=s[u],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&g!==null){s=void 0,u=l,p=g.memoizedProps,g=g.memoizedState,h=u.stateNode;try{var oe=Is(u.type,p);s=h.getSnapshotBeforeUpdate(oe,g),h.__reactInternalSnapshotBeforeUpdate=s}catch(ye){Qe(u,u.return,ye)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,u=s.nodeType,u===9)Nd(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Nd(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(n(163))}if(s=l.sibling,s!==null){s.return=l.return,Ct=s;break}Ct=l.return}}function mb(s,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:En(s,u),h&4&&na(5,u);break;case 1:if(En(s,u),h&4)if(s=u.stateNode,l===null)try{s.componentDidMount()}catch(v){Qe(u,u.return,v)}else{var p=Is(u.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(p,l,s.__reactInternalSnapshotBeforeUpdate)}catch(v){Qe(u,u.return,v)}}h&64&&ub(u),h&512&&sa(u,u.return);break;case 3:if(En(s,u),h&64&&(s=u.updateQueue,s!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{$0(s,l)}catch(v){Qe(u,u.return,v)}}break;case 27:l===null&&h&4&&db(u);case 26:case 5:En(s,u),l===null&&h&4&&hb(u),h&512&&sa(u,u.return);break;case 12:En(s,u);break;case 31:En(s,u),h&4&&bb(s,u);break;case 13:En(s,u),h&4&&xb(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=LA.bind(null,u),tM(s,u))));break;case 22:if(h=u.memoizedState!==null||Tn,!h){l=l!==null&&l.memoizedState!==null||yt,p=Tn;var g=yt;Tn=h,(yt=l)&&!g?Nn(s,u,(u.subtreeFlags&8772)!==0):En(s,u),Tn=p,yt=g}break;case 30:break;default:En(s,u)}}function gb(s){var l=s.alternate;l!==null&&(s.alternate=null,gb(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&Bh(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var tt=null,Wt=!1;function On(s,l,u){for(u=u.child;u!==null;)yb(s,l,u),u=u.sibling}function yb(s,l,u){if(ai&&typeof ai.onCommitFiberUnmount=="function")try{ai.onCommitFiberUnmount(Ol,u)}catch{}switch(u.tag){case 26:yt||Ji(u,l),On(s,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:yt||Ji(u,l);var h=tt,p=Wt;os(u.type)&&(tt=u.stateNode,Wt=!1),On(s,l,u),da(u.stateNode),tt=h,Wt=p;break;case 5:yt||Ji(u,l);case 6:if(h=tt,p=Wt,tt=null,On(s,l,u),tt=h,Wt=p,tt!==null)if(Wt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(u.stateNode)}catch(g){Qe(u,l,g)}else try{tt.removeChild(u.stateNode)}catch(g){Qe(u,l,g)}break;case 18:tt!==null&&(Wt?(s=tt,ux(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Zr(s)):ux(tt,u.stateNode));break;case 4:h=tt,p=Wt,tt=u.stateNode.containerInfo,Wt=!0,On(s,l,u),tt=h,Wt=p;break;case 0:case 11:case 14:case 15:ts(2,u,l),yt||ts(4,u,l),On(s,l,u);break;case 1:yt||(Ji(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&cb(u,l,h)),On(s,l,u);break;case 21:On(s,l,u);break;case 22:yt=(h=yt)||u.memoizedState!==null,On(s,l,u),yt=h;break;default:On(s,l,u)}}function bb(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Zr(s)}catch(u){Qe(l,l.return,u)}}}function xb(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Zr(s)}catch(u){Qe(l,l.return,u)}}function TA(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new pb),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new pb),l;default:throw Error(n(435,s.tag))}}function fu(s,l){var u=TA(s);l.forEach(function(h){if(!u.has(h)){u.add(h);var p=zA.bind(null,s,h);h.then(p,p)}})}function Xt(s,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var p=u[h],g=s,v=l,A=v;e:for(;A!==null;){switch(A.tag){case 27:if(os(A.type)){tt=A.stateNode,Wt=!1;break e}break;case 5:tt=A.stateNode,Wt=!1;break e;case 3:case 4:tt=A.stateNode.containerInfo,Wt=!0;break e}A=A.return}if(tt===null)throw Error(n(160));yb(g,v,p),tt=null,Wt=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)vb(l,s),l=l.sibling}var qi=null;function vb(s,l){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Xt(l,s),Zt(s),h&4&&(ts(3,s,s.return),na(3,s),ts(5,s,s.return));break;case 1:Xt(l,s),Zt(s),h&512&&(yt||u===null||Ji(u,u.return)),h&64&&Tn&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var p=qi;if(Xt(l,s),Zt(s),h&512&&(yt||u===null||Ji(u,u.return)),h&4){var g=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,p=p.ownerDocument||p;t:switch(h){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Rl]||g[Ot]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(h),p.head.insertBefore(g,p.querySelector("head > title"))),Dt(g,h,u),g[Ot]=s,kt(g),h=g;break e;case"link":var v=vx("link","href",p).get(h+(u.href||""));if(v){for(var A=0;A<v.length;A++)if(g=v[A],g.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&g.getAttribute("rel")===(u.rel==null?null:u.rel)&&g.getAttribute("title")===(u.title==null?null:u.title)&&g.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){v.splice(A,1);break t}}g=p.createElement(h),Dt(g,h,u),p.head.appendChild(g);break;case"meta":if(v=vx("meta","content",p).get(h+(u.content||""))){for(A=0;A<v.length;A++)if(g=v[A],g.getAttribute("content")===(u.content==null?null:""+u.content)&&g.getAttribute("name")===(u.name==null?null:u.name)&&g.getAttribute("property")===(u.property==null?null:u.property)&&g.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&g.getAttribute("charset")===(u.charSet==null?null:u.charSet)){v.splice(A,1);break t}}g=p.createElement(h),Dt(g,h,u),p.head.appendChild(g);break;default:throw Error(n(468,h))}g[Ot]=s,kt(g),h=g}s.stateNode=h}else Sx(p,s.type,s.stateNode);else s.stateNode=xx(p,h,s.memoizedProps);else g!==h?(g===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):g.count--,h===null?Sx(p,s.type,s.stateNode):xx(p,h,s.memoizedProps)):h===null&&s.stateNode!==null&&id(s,s.memoizedProps,u.memoizedProps)}break;case 27:Xt(l,s),Zt(s),h&512&&(yt||u===null||Ji(u,u.return)),u!==null&&h&4&&id(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Xt(l,s),Zt(s),h&512&&(yt||u===null||Ji(u,u.return)),s.flags&32){p=s.stateNode;try{vr(p,"")}catch(oe){Qe(s,s.return,oe)}}h&4&&s.stateNode!=null&&(p=s.memoizedProps,id(s,p,u!==null?u.memoizedProps:p)),h&1024&&(rd=!0);break;case 6:if(Xt(l,s),Zt(s),h&4){if(s.stateNode===null)throw Error(n(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(oe){Qe(s,s.return,oe)}}break;case 3:if(Ou=null,p=qi,qi=Mu(l.containerInfo),Xt(l,s),qi=p,Zt(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Zr(l.containerInfo)}catch(oe){Qe(s,s.return,oe)}rd&&(rd=!1,Sb(s));break;case 4:h=qi,qi=Mu(s.stateNode.containerInfo),Xt(l,s),Zt(s),qi=h;break;case 12:Xt(l,s),Zt(s);break;case 31:Xt(l,s),Zt(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,fu(s,h)));break;case 13:Xt(l,s),Zt(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(pu=li()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,fu(s,h)));break;case 22:p=s.memoizedState!==null;var T=u!==null&&u.memoizedState!==null,L=Tn,F=yt;if(Tn=L||p,yt=F||T,Xt(l,s),yt=F,Tn=L,Zt(s),h&8192)e:for(l=s.stateNode,l._visibility=p?l._visibility&-2:l._visibility|1,p&&(u===null||T||Tn||yt||Ws(s)),u=null,l=s;;){if(l.tag===5||l.tag===26){if(u===null){T=u=l;try{if(g=T.stateNode,p)v=g.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{A=T.stateNode;var I=T.memoizedProps.style,z=I!=null&&I.hasOwnProperty("display")?I.display:null;A.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(oe){Qe(T,T.return,oe)}}}else if(l.tag===6){if(u===null){T=l;try{T.stateNode.nodeValue=p?"":T.memoizedProps}catch(oe){Qe(T,T.return,oe)}}}else if(l.tag===18){if(u===null){T=l;try{var q=T.stateNode;p?cx(q,!0):cx(T.stateNode,!1)}catch(oe){Qe(T,T.return,oe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,fu(s,u))));break;case 19:Xt(l,s),Zt(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,fu(s,h)));break;case 30:break;case 21:break;default:Xt(l,s),Zt(s)}}function Zt(s){var l=s.flags;if(l&2){try{for(var u,h=s.return;h!==null;){if(fb(h)){u=h;break}h=h.return}if(u==null)throw Error(n(160));switch(u.tag){case 27:var p=u.stateNode,g=nd(s);hu(s,g,p);break;case 5:var v=u.stateNode;u.flags&32&&(vr(v,""),u.flags&=-33);var A=nd(s);hu(s,A,v);break;case 3:case 4:var T=u.stateNode.containerInfo,L=nd(s);sd(s,L,T);break;default:throw Error(n(161))}}catch(F){Qe(s,s.return,F)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function Sb(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;Sb(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function En(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)mb(s,l.alternate,l),l=l.sibling}function Ws(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:ts(4,l,l.return),Ws(l);break;case 1:Ji(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&cb(l,l.return,u),Ws(l);break;case 27:da(l.stateNode);case 26:case 5:Ji(l,l.return),Ws(l);break;case 22:l.memoizedState===null&&Ws(l);break;case 30:Ws(l);break;default:Ws(l)}s=s.sibling}}function Nn(s,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,p=s,g=l,v=g.flags;switch(g.tag){case 0:case 11:case 15:Nn(p,g,u),na(4,g);break;case 1:if(Nn(p,g,u),h=g,p=h.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(L){Qe(h,h.return,L)}if(h=g,p=h.updateQueue,p!==null){var A=h.stateNode;try{var T=p.shared.hiddenCallbacks;if(T!==null)for(p.shared.hiddenCallbacks=null,p=0;p<T.length;p++)J0(T[p],A)}catch(L){Qe(h,h.return,L)}}u&&v&64&&ub(g),sa(g,g.return);break;case 27:db(g);case 26:case 5:Nn(p,g,u),u&&h===null&&v&4&&hb(g),sa(g,g.return);break;case 12:Nn(p,g,u);break;case 31:Nn(p,g,u),u&&v&4&&bb(p,g);break;case 13:Nn(p,g,u),u&&v&4&&xb(p,g);break;case 22:g.memoizedState===null&&Nn(p,g,u),sa(g,g.return);break;case 30:break;default:Nn(p,g,u)}l=l.sibling}}function ld(s,l){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&Gl(u))}function ad(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Gl(s))}function Pi(s,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)wb(s,l,u,h),l=l.sibling}function wb(s,l,u,h){var p=l.flags;switch(l.tag){case 0:case 11:case 15:Pi(s,l,u,h),p&2048&&na(9,l);break;case 1:Pi(s,l,u,h);break;case 3:Pi(s,l,u,h),p&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Gl(s)));break;case 12:if(p&2048){Pi(s,l,u,h),s=l.stateNode;try{var g=l.memoizedProps,v=g.id,A=g.onPostCommit;typeof A=="function"&&A(v,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(T){Qe(l,l.return,T)}}else Pi(s,l,u,h);break;case 31:Pi(s,l,u,h);break;case 13:Pi(s,l,u,h);break;case 23:break;case 22:g=l.stateNode,v=l.alternate,l.memoizedState!==null?g._visibility&2?Pi(s,l,u,h):ra(s,l):g._visibility&2?Pi(s,l,u,h):(g._visibility|=2,qr(s,l,u,h,(l.subtreeFlags&10256)!==0||!1)),p&2048&&ld(v,l);break;case 24:Pi(s,l,u,h),p&2048&&ad(l.alternate,l);break;default:Pi(s,l,u,h)}}function qr(s,l,u,h,p){for(p=p&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var g=s,v=l,A=u,T=h,L=v.flags;switch(v.tag){case 0:case 11:case 15:qr(g,v,A,T,p),na(8,v);break;case 23:break;case 22:var F=v.stateNode;v.memoizedState!==null?F._visibility&2?qr(g,v,A,T,p):ra(g,v):(F._visibility|=2,qr(g,v,A,T,p)),p&&L&2048&&ld(v.alternate,v);break;case 24:qr(g,v,A,T,p),p&&L&2048&&ad(v.alternate,v);break;default:qr(g,v,A,T,p)}l=l.sibling}}function ra(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=s,h=l,p=h.flags;switch(h.tag){case 22:ra(u,h),p&2048&&ld(h.alternate,h);break;case 24:ra(u,h),p&2048&&ad(h.alternate,h);break;default:ra(u,h)}l=l.sibling}}var la=8192;function Pr(s,l,u){if(s.subtreeFlags&la)for(s=s.child;s!==null;)kb(s,l,u),s=s.sibling}function kb(s,l,u){switch(s.tag){case 26:Pr(s,l,u),s.flags&la&&s.memoizedState!==null&&dM(u,qi,s.memoizedState,s.memoizedProps);break;case 5:Pr(s,l,u);break;case 3:case 4:var h=qi;qi=Mu(s.stateNode.containerInfo),Pr(s,l,u),qi=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=la,la=16777216,Pr(s,l,u),la=h):Pr(s,l,u));break;default:Pr(s,l,u)}}function Cb(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function aa(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Ct=h,Mb(h,s)}Cb(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Ab(s),s=s.sibling}function Ab(s){switch(s.tag){case 0:case 11:case 15:aa(s),s.flags&2048&&ts(9,s,s.return);break;case 3:aa(s);break;case 12:aa(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,du(s)):aa(s);break;default:aa(s)}}function du(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Ct=h,Mb(h,s)}Cb(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:ts(8,l,l.return),du(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,du(l));break;default:du(l)}s=s.sibling}}function Mb(s,l){for(;Ct!==null;){var u=Ct;switch(u.tag){case 0:case 11:case 15:ts(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Gl(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Ct=h;else e:for(u=s;Ct!==null;){h=Ct;var p=h.sibling,g=h.return;if(gb(h),h===u){Ct=null;break e}if(p!==null){p.return=g,Ct=p;break e}Ct=g}}}var OA={getCacheForType:function(s){var l=Nt(pt),u=l.data.get(s);return u===void 0&&(u=s(),l.data.set(s,u)),u},cacheSignal:function(){return Nt(pt).controller.signal}},EA=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ie=null,Te=null,Ne=0,Ve=0,di=null,is=!1,Vr=!1,od=!1,Rn=0,rt=0,ns=0,Xs=0,ud=0,pi=0,Qr=0,oa=null,Jt=null,cd=!1,pu=0,Tb=0,mu=1/0,gu=null,ss=null,xt=0,rs=null,Gr=null,Dn=0,hd=0,fd=null,Ob=null,ua=0,dd=null;function mi(){return(Ue&2)!==0&&Ne!==0?Ne&-Ne:H.T!==null?xd():Gg()}function Eb(){if(pi===0)if((Ne&536870912)===0||De){var s=Co;Co<<=1,(Co&3932160)===0&&(Co=262144),pi=s}else pi=536870912;return s=hi.current,s!==null&&(s.flags|=32),pi}function $t(s,l,u){(s===Ie&&(Ve===2||Ve===9)||s.cancelPendingCommit!==null)&&(Fr(s,0),ls(s,Ne,pi,!1)),Nl(s,u),((Ue&2)===0||s!==Ie)&&(s===Ie&&((Ue&2)===0&&(Xs|=u),rt===4&&ls(s,Ne,pi,!1)),$i(s))}function Nb(s,l,u){if((Ue&6)!==0)throw Error(n(327));var h=!u&&(l&127)===0&&(l&s.expiredLanes)===0||El(s,l),p=h?DA(s,l):md(s,l,!0),g=h;do{if(p===0){Vr&&!h&&ls(s,l,0,!1);break}else{if(u=s.current.alternate,g&&!NA(u)){p=md(s,l,!1),g=!1;continue}if(p===2){if(g=l,s.errorRecoveryDisabledLanes&g)var v=0;else v=s.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){l=v;e:{var A=s;p=oa;var T=A.current.memoizedState.isDehydrated;if(T&&(Fr(A,v).flags|=256),v=md(A,v,!1),v!==2){if(od&&!T){A.errorRecoveryDisabledLanes|=g,Xs|=g,p=4;break e}g=Jt,Jt=p,g!==null&&(Jt===null?Jt=g:Jt.push.apply(Jt,g))}p=v}if(g=!1,p!==2)continue}}if(p===1){Fr(s,0),ls(s,l,0,!0);break}e:{switch(h=s,g=p,g){case 0:case 1:throw Error(n(345));case 4:if((l&4194048)!==l)break;case 6:ls(h,l,pi,!is);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(n(329))}if((l&62914560)===l&&(p=pu+300-li(),10<p)){if(ls(h,l,pi,!is),Mo(h,0,!0)!==0)break e;Dn=l,h.timeoutHandle=ax(Rb.bind(null,h,u,Jt,gu,cd,l,pi,Xs,Qr,is,g,"Throttled",-0,0),p);break e}Rb(h,u,Jt,gu,cd,l,pi,Xs,Qr,is,g,null,-0,0)}}break}while(!0);$i(s)}function Rb(s,l,u,h,p,g,v,A,T,L,F,I,z,q){if(s.timeoutHandle=-1,I=l.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},kb(l,g,I);var oe=(g&62914560)===g?pu-li():(g&4194048)===g?Tb-li():0;if(oe=pM(I,oe),oe!==null){Dn=g,s.cancelPendingCommit=oe(Ub.bind(null,s,l,g,u,h,p,v,A,T,F,I,null,z,q)),ls(s,g,v,!L);return}}Ub(s,l,g,u,h,p,v,A,T)}function NA(s){for(var l=s;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var p=u[h],g=p.getSnapshot;p=p.value;try{if(!ui(g(),p))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ls(s,l,u,h){l&=~ud,l&=~Xs,s.suspendedLanes|=l,s.pingedLanes&=~l,h&&(s.warmLanes|=l),h=s.expirationTimes;for(var p=l;0<p;){var g=31-oi(p),v=1<<g;h[g]=-1,p&=~v}u!==0&&Pg(s,u,l)}function yu(){return(Ue&6)===0?(ca(0),!1):!0}function pd(){if(Te!==null){if(Ve===0)var s=Te.return;else s=Te,Sn=Ps=null,Nf(s),Lr=null,Kl=0,s=Te;for(;s!==null;)ob(s.alternate,s),s=s.return;Te=null}}function Fr(s,l){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,XA(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Dn=0,pd(),Ie=s,Te=u=xn(s.current,null),Ne=l,Ve=0,di=null,is=!1,Vr=El(s,l),od=!1,Qr=pi=ud=Xs=ns=rt=0,Jt=oa=null,cd=!1,(l&8)!==0&&(l|=l&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=l;0<h;){var p=31-oi(h),g=1<<p;l|=s[p],h&=~g}return Rn=l,_o(),u}function Db(s,l){we=null,H.H=ea,l===Br||l===Ko?(l=I0(),Ve=3):l===bf?(l=I0(),Ve=4):Ve=l===Kf?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,di=l,Te===null&&(rt=1,lu(s,Ci(l,s.current)))}function jb(){var s=hi.current;return s===null?!0:(Ne&4194048)===Ne?Oi===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?s===Oi:!1}function Bb(){var s=H.H;return H.H=ea,s===null?ea:s}function Lb(){var s=H.A;return H.A=OA,s}function bu(){rt=4,is||(Ne&4194048)!==Ne&&hi.current!==null||(Vr=!0),(ns&134217727)===0&&(Xs&134217727)===0||Ie===null||ls(Ie,Ne,pi,!1)}function md(s,l,u){var h=Ue;Ue|=2;var p=Bb(),g=Lb();(Ie!==s||Ne!==l)&&(gu=null,Fr(s,l)),l=!1;var v=rt;e:do try{if(Ve!==0&&Te!==null){var A=Te,T=di;switch(Ve){case 8:pd(),v=6;break e;case 3:case 2:case 9:case 6:hi.current===null&&(l=!0);var L=Ve;if(Ve=0,di=null,Kr(s,A,T,L),u&&Vr){v=0;break e}break;default:L=Ve,Ve=0,di=null,Kr(s,A,T,L)}}RA(),v=rt;break}catch(F){Db(s,F)}while(!0);return l&&s.shellSuspendCounter++,Sn=Ps=null,Ue=h,H.H=p,H.A=g,Te===null&&(Ie=null,Ne=0,_o()),v}function RA(){for(;Te!==null;)zb(Te)}function DA(s,l){var u=Ue;Ue|=2;var h=Bb(),p=Lb();Ie!==s||Ne!==l?(gu=null,mu=li()+500,Fr(s,l)):Vr=El(s,l);e:do try{if(Ve!==0&&Te!==null){l=Te;var g=di;t:switch(Ve){case 1:Ve=0,di=null,Kr(s,l,g,1);break;case 2:case 9:if(K0(g)){Ve=0,di=null,Hb(l);break}l=function(){Ve!==2&&Ve!==9||Ie!==s||(Ve=7),$i(s)},g.then(l,l);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:K0(g)?(Ve=0,di=null,Hb(l)):(Ve=0,di=null,Kr(s,l,g,7));break;case 5:var v=null;switch(Te.tag){case 26:v=Te.memoizedState;case 5:case 27:var A=Te;if(v?wx(v):A.stateNode.complete){Ve=0,di=null;var T=A.sibling;if(T!==null)Te=T;else{var L=A.return;L!==null?(Te=L,xu(L)):Te=null}break t}}Ve=0,di=null,Kr(s,l,g,5);break;case 6:Ve=0,di=null,Kr(s,l,g,6);break;case 8:pd(),rt=6;break e;default:throw Error(n(462))}}jA();break}catch(F){Db(s,F)}while(!0);return Sn=Ps=null,H.H=h,H.A=p,Ue=u,Te!==null?0:(Ie=null,Ne=0,_o(),rt)}function jA(){for(;Te!==null&&!iC();)zb(Te)}function zb(s){var l=lb(s.alternate,s,Rn);s.memoizedProps=s.pendingProps,l===null?xu(s):Te=l}function Hb(s){var l=s,u=l.alternate;switch(l.tag){case 15:case 0:l=eb(u,l,l.pendingProps,l.type,void 0,Ne);break;case 11:l=eb(u,l,l.pendingProps,l.type.render,l.ref,Ne);break;case 5:Nf(l);default:ob(u,l),l=Te=L0(l,Rn),l=lb(u,l,Rn)}s.memoizedProps=s.pendingProps,l===null?xu(s):Te=l}function Kr(s,l,u,h){Sn=Ps=null,Nf(l),Lr=null,Kl=0;var p=l.return;try{if(SA(s,p,l,u,Ne)){rt=1,lu(s,Ci(u,s.current)),Te=null;return}}catch(g){if(p!==null)throw Te=p,g;rt=1,lu(s,Ci(u,s.current)),Te=null;return}l.flags&32768?(De||h===1?s=!0:Vr||(Ne&536870912)!==0?s=!1:(is=s=!0,(h===2||h===9||h===3||h===6)&&(h=hi.current,h!==null&&h.tag===13&&(h.flags|=16384))),_b(l,s)):xu(l)}function xu(s){var l=s;do{if((l.flags&32768)!==0){_b(l,is);return}s=l.return;var u=CA(l.alternate,l,Rn);if(u!==null){Te=u;return}if(l=l.sibling,l!==null){Te=l;return}Te=l=s}while(l!==null);rt===0&&(rt=5)}function _b(s,l){do{var u=AA(s.alternate,s);if(u!==null){u.flags&=32767,Te=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(s=s.sibling,s!==null)){Te=s;return}Te=s=u}while(s!==null);rt=6,Te=null}function Ub(s,l,u,h,p,g,v,A,T){s.cancelPendingCommit=null;do vu();while(xt!==0);if((Ue&6)!==0)throw Error(n(327));if(l!==null){if(l===s.current)throw Error(n(177));if(g=l.lanes|l.childLanes,g|=nf,fC(s,u,g,v,A,T),s===Ie&&(Te=Ie=null,Ne=0),Gr=l,rs=s,Dn=u,hd=g,fd=p,Ob=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,HA(wo,function(){return Gb(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,p=X.p,X.p=2,v=Ue,Ue|=4;try{MA(s,l,u)}finally{Ue=v,X.p=p,H.T=h}}xt=1,qb(),Pb(),Vb()}}function qb(){if(xt===1){xt=0;var s=rs,l=Gr,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var h=X.p;X.p=2;var p=Ue;Ue|=4;try{vb(l,s);var g=Td,v=M0(s.containerInfo),A=g.focusedElem,T=g.selectionRange;if(v!==A&&A&&A.ownerDocument&&A0(A.ownerDocument.documentElement,A)){if(T!==null&&Zh(A)){var L=T.start,F=T.end;if(F===void 0&&(F=L),"selectionStart"in A)A.selectionStart=L,A.selectionEnd=Math.min(F,A.value.length);else{var I=A.ownerDocument||document,z=I&&I.defaultView||window;if(z.getSelection){var q=z.getSelection(),oe=A.textContent.length,ye=Math.min(T.start,oe),Ke=T.end===void 0?ye:Math.min(T.end,oe);!q.extend&&ye>Ke&&(v=Ke,Ke=ye,ye=v);var j=C0(A,ye),N=C0(A,Ke);if(j&&N&&(q.rangeCount!==1||q.anchorNode!==j.node||q.anchorOffset!==j.offset||q.focusNode!==N.node||q.focusOffset!==N.offset)){var B=I.createRange();B.setStart(j.node,j.offset),q.removeAllRanges(),ye>Ke?(q.addRange(B),q.extend(N.node,N.offset)):(B.setEnd(N.node,N.offset),q.addRange(B))}}}}for(I=[],q=A;q=q.parentNode;)q.nodeType===1&&I.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<I.length;A++){var Y=I[A];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Du=!!Md,Td=Md=null}finally{Ue=p,X.p=h,H.T=u}}s.current=l,xt=2}}function Pb(){if(xt===2){xt=0;var s=rs,l=Gr,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var h=X.p;X.p=2;var p=Ue;Ue|=4;try{mb(s,l.alternate,l)}finally{Ue=p,X.p=h,H.T=u}}xt=3}}function Vb(){if(xt===4||xt===3){xt=0,nC();var s=rs,l=Gr,u=Dn,h=Ob;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?xt=5:(xt=0,Gr=rs=null,Qb(s,s.pendingLanes));var p=s.pendingLanes;if(p===0&&(ss=null),Dh(u),l=l.stateNode,ai&&typeof ai.onCommitFiberRoot=="function")try{ai.onCommitFiberRoot(Ol,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=H.T,p=X.p,X.p=2,H.T=null;try{for(var g=s.onRecoverableError,v=0;v<h.length;v++){var A=h[v];g(A.value,{componentStack:A.stack})}}finally{H.T=l,X.p=p}}(Dn&3)!==0&&vu(),$i(s),p=s.pendingLanes,(u&261930)!==0&&(p&42)!==0?s===dd?ua++:(ua=0,dd=s):ua=0,ca(0)}}function Qb(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,Gl(l)))}function vu(){return qb(),Pb(),Vb(),Gb()}function Gb(){if(xt!==5)return!1;var s=rs,l=hd;hd=0;var u=Dh(Dn),h=H.T,p=X.p;try{X.p=32>u?32:u,H.T=null,u=fd,fd=null;var g=rs,v=Dn;if(xt=0,Gr=rs=null,Dn=0,(Ue&6)!==0)throw Error(n(331));var A=Ue;if(Ue|=4,Ab(g.current),wb(g,g.current,v,u),Ue=A,ca(0,!1),ai&&typeof ai.onPostCommitFiberRoot=="function")try{ai.onPostCommitFiberRoot(Ol,g)}catch{}return!0}finally{X.p=p,H.T=h,Qb(s,l)}}function Fb(s,l,u){l=Ci(u,l),l=Ff(s.stateNode,l,2),s=Jn(s,l,2),s!==null&&(Nl(s,2),$i(s))}function Qe(s,l,u){if(s.tag===3)Fb(s,s,u);else for(;l!==null;){if(l.tag===3){Fb(l,s,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ss===null||!ss.has(h))){s=Ci(u,s),u=Ky(2),h=Jn(l,u,2),h!==null&&(Yy(u,h,l,s),Nl(h,2),$i(h));break}}l=l.return}}function gd(s,l,u){var h=s.pingCache;if(h===null){h=s.pingCache=new EA;var p=new Set;h.set(l,p)}else p=h.get(l),p===void 0&&(p=new Set,h.set(l,p));p.has(u)||(od=!0,p.add(u),s=BA.bind(null,s,l,u),l.then(s,s))}function BA(s,l,u){var h=s.pingCache;h!==null&&h.delete(l),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,Ie===s&&(Ne&u)===u&&(rt===4||rt===3&&(Ne&62914560)===Ne&&300>li()-pu?(Ue&2)===0&&Fr(s,0):ud|=u,Qr===Ne&&(Qr=0)),$i(s)}function Kb(s,l){l===0&&(l=qg()),s=_s(s,l),s!==null&&(Nl(s,l),$i(s))}function LA(s){var l=s.memoizedState,u=0;l!==null&&(u=l.retryLane),Kb(s,u)}function zA(s,l){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,p=s.memoizedState;p!==null&&(u=p.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(n(314))}h!==null&&h.delete(l),Kb(s,u)}function HA(s,l){return Oh(s,l)}var Su=null,Yr=null,yd=!1,wu=!1,bd=!1,as=0;function $i(s){s!==Yr&&s.next===null&&(Yr===null?Su=Yr=s:Yr=Yr.next=s),wu=!0,yd||(yd=!0,UA())}function ca(s,l){if(!bd&&wu){bd=!0;do for(var u=!1,h=Su;h!==null;){if(s!==0){var p=h.pendingLanes;if(p===0)var g=0;else{var v=h.suspendedLanes,A=h.pingedLanes;g=(1<<31-oi(42|s)+1)-1,g&=p&~(v&~A),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(u=!0,Xb(h,g))}else g=Ne,g=Mo(h,h===Ie?g:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(g&3)===0||El(h,g)||(u=!0,Xb(h,g));h=h.next}while(u);bd=!1}}function _A(){Yb()}function Yb(){wu=yd=!1;var s=0;as!==0&&WA()&&(s=as);for(var l=li(),u=null,h=Su;h!==null;){var p=h.next,g=Ib(h,l);g===0?(h.next=null,u===null?Su=p:u.next=p,p===null&&(Yr=u)):(u=h,(s!==0||(g&3)!==0)&&(wu=!0)),h=p}xt!==0&&xt!==5||ca(s),as!==0&&(as=0)}function Ib(s,l){for(var u=s.suspendedLanes,h=s.pingedLanes,p=s.expirationTimes,g=s.pendingLanes&-62914561;0<g;){var v=31-oi(g),A=1<<v,T=p[v];T===-1?((A&u)===0||(A&h)!==0)&&(p[v]=hC(A,l)):T<=l&&(s.expiredLanes|=A),g&=~A}if(l=Ie,u=Ne,u=Mo(s,s===l?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===l&&(Ve===2||Ve===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&Eh(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||El(s,u)){if(l=u&-u,l===s.callbackPriority)return l;switch(h!==null&&Eh(h),Dh(u)){case 2:case 8:u=_g;break;case 32:u=wo;break;case 268435456:u=Ug;break;default:u=wo}return h=Wb.bind(null,s),u=Oh(u,h),s.callbackPriority=l,s.callbackNode=u,l}return h!==null&&h!==null&&Eh(h),s.callbackPriority=2,s.callbackNode=null,2}function Wb(s,l){if(xt!==0&&xt!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(vu()&&s.callbackNode!==u)return null;var h=Ne;return h=Mo(s,s===Ie?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(Nb(s,h,l),Ib(s,li()),s.callbackNode!=null&&s.callbackNode===u?Wb.bind(null,s):null)}function Xb(s,l){if(vu())return null;Nb(s,l,!0)}function UA(){ZA(function(){(Ue&6)!==0?Oh(Hg,_A):Yb()})}function xd(){if(as===0){var s=Dr;s===0&&(s=ko,ko<<=1,(ko&261888)===0&&(ko=256)),as=s}return as}function Zb(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:No(""+s)}function Jb(s,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,s.id&&u.setAttribute("form",s.id),l.parentNode.insertBefore(u,l),s=new FormData(s),u.parentNode.removeChild(u),s}function qA(s,l,u,h,p){if(l==="submit"&&u&&u.stateNode===p){var g=Zb((p[Yt]||null).action),v=h.submitter;v&&(l=(l=v[Yt]||null)?Zb(l.formAction):v.getAttribute("formAction"),l!==null&&(g=l,v=null));var A=new Bo("action","action",null,h,p);s.push({event:A,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(as!==0){var T=v?Jb(p,v):new FormData(p);Uf(u,{pending:!0,data:T,method:p.method,action:g},null,T)}}else typeof g=="function"&&(A.preventDefault(),T=v?Jb(p,v):new FormData(p),Uf(u,{pending:!0,data:T,method:p.method,action:g},g,T))},currentTarget:p}]})}}for(var vd=0;vd<tf.length;vd++){var Sd=tf[vd],PA=Sd.toLowerCase(),VA=Sd[0].toUpperCase()+Sd.slice(1);Ui(PA,"on"+VA)}Ui(E0,"onAnimationEnd"),Ui(N0,"onAnimationIteration"),Ui(R0,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(sA,"onTransitionRun"),Ui(rA,"onTransitionStart"),Ui(lA,"onTransitionCancel"),Ui(D0,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="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(" "),QA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ha));function $b(s,l){l=(l&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],p=h.event;h=h.listeners;e:{var g=void 0;if(l)for(var v=h.length-1;0<=v;v--){var A=h[v],T=A.instance,L=A.currentTarget;if(A=A.listener,T!==g&&p.isPropagationStopped())break e;g=A,p.currentTarget=L;try{g(p)}catch(F){Ho(F)}p.currentTarget=null,g=T}else for(v=0;v<h.length;v++){if(A=h[v],T=A.instance,L=A.currentTarget,A=A.listener,T!==g&&p.isPropagationStopped())break e;g=A,p.currentTarget=L;try{g(p)}catch(F){Ho(F)}p.currentTarget=null,g=T}}}}function Oe(s,l){var u=l[jh];u===void 0&&(u=l[jh]=new Set);var h=s+"__bubble";u.has(h)||(ex(l,s,2,!1),u.add(h))}function wd(s,l,u){var h=0;l&&(h|=4),ex(u,s,h,l)}var ku="_reactListening"+Math.random().toString(36).slice(2);function kd(s){if(!s[ku]){s[ku]=!0,Yg.forEach(function(u){u!=="selectionchange"&&(QA.has(u)||wd(u,!1,s),wd(u,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[ku]||(l[ku]=!0,wd("selectionchange",!1,l))}}function ex(s,l,u,h){switch(Ex(l)){case 2:var p=yM;break;case 8:p=bM;break;default:p=_d}u=p.bind(null,l,u,s),p=void 0,!Vh||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(p=!0),h?p!==void 0?s.addEventListener(l,u,{capture:!0,passive:p}):s.addEventListener(l,u,!0):p!==void 0?s.addEventListener(l,u,{passive:p}):s.addEventListener(l,u,!1)}function Cd(s,l,u,h,p){var g=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var v=h.tag;if(v===3||v===4){var A=h.stateNode.containerInfo;if(A===p)break;if(v===4)for(v=h.return;v!==null;){var T=v.tag;if((T===3||T===4)&&v.stateNode.containerInfo===p)return;v=v.return}for(;A!==null;){if(v=mr(A),v===null)return;if(T=v.tag,T===5||T===6||T===26||T===27){h=g=v;continue e}A=A.parentNode}}h=h.return}r0(function(){var L=g,F=qh(u),I=[];e:{var z=j0.get(s);if(z!==void 0){var q=Bo,oe=s;switch(s){case"keypress":if(Do(u)===0)break e;case"keydown":case"keyup":q=zC;break;case"focusin":oe="focus",q=Kh;break;case"focusout":oe="blur",q=Kh;break;case"beforeblur":case"afterblur":q=Kh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=o0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=CC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=UC;break;case E0:case N0:case R0:q=TC;break;case D0:q=PC;break;case"scroll":case"scrollend":q=wC;break;case"wheel":q=QC;break;case"copy":case"cut":case"paste":q=EC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=c0;break;case"toggle":case"beforetoggle":q=FC}var ye=(l&4)!==0,Ke=!ye&&(s==="scroll"||s==="scrollend"),j=ye?z!==null?z+"Capture":null:z;ye=[];for(var N=L,B;N!==null;){var Y=N;if(B=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||B===null||j===null||(Y=jl(N,j),Y!=null&&ye.push(fa(N,Y,B))),Ke)break;N=N.return}0<ye.length&&(z=new q(z,oe,null,u,F),I.push({event:z,listeners:ye}))}}if((l&7)===0){e:{if(z=s==="mouseover"||s==="pointerover",q=s==="mouseout"||s==="pointerout",z&&u!==Uh&&(oe=u.relatedTarget||u.fromElement)&&(mr(oe)||oe[pr]))break e;if((q||z)&&(z=F.window===F?F:(z=F.ownerDocument)?z.defaultView||z.parentWindow:window,q?(oe=u.relatedTarget||u.toElement,q=L,oe=oe?mr(oe):null,oe!==null&&(Ke=a(oe),ye=oe.tag,oe!==Ke||ye!==5&&ye!==27&&ye!==6)&&(oe=null)):(q=null,oe=L),q!==oe)){if(ye=o0,Y="onMouseLeave",j="onMouseEnter",N="mouse",(s==="pointerout"||s==="pointerover")&&(ye=c0,Y="onPointerLeave",j="onPointerEnter",N="pointer"),Ke=q==null?z:Dl(q),B=oe==null?z:Dl(oe),z=new ye(Y,N+"leave",q,u,F),z.target=Ke,z.relatedTarget=B,Y=null,mr(F)===L&&(ye=new ye(j,N+"enter",oe,u,F),ye.target=B,ye.relatedTarget=Ke,Y=ye),Ke=Y,q&&oe)t:{for(ye=GA,j=q,N=oe,B=0,Y=j;Y;Y=ye(Y))B++;Y=0;for(var pe=N;pe;pe=ye(pe))Y++;for(;0<B-Y;)j=ye(j),B--;for(;0<Y-B;)N=ye(N),Y--;for(;B--;){if(j===N||N!==null&&j===N.alternate){ye=j;break t}j=ye(j),N=ye(N)}ye=null}else ye=null;q!==null&&tx(I,z,q,ye,!1),oe!==null&&Ke!==null&&tx(I,Ke,oe,ye,!0)}}e:{if(z=L?Dl(L):window,q=z.nodeName&&z.nodeName.toLowerCase(),q==="select"||q==="input"&&z.type==="file")var ze=b0;else if(g0(z))if(x0)ze=tA;else{ze=$C;var he=JC}else q=z.nodeName,!q||q.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?L&&_h(L.elementType)&&(ze=b0):ze=eA;if(ze&&(ze=ze(s,L))){y0(I,ze,u,F);break e}he&&he(s,z,L),s==="focusout"&&L&&z.type==="number"&&L.memoizedProps.value!=null&&Hh(z,"number",z.value)}switch(he=L?Dl(L):window,s){case"focusin":(g0(he)||he.contentEditable==="true")&&(Cr=he,Jh=L,Pl=null);break;case"focusout":Pl=Jh=Cr=null;break;case"mousedown":$h=!0;break;case"contextmenu":case"mouseup":case"dragend":$h=!1,T0(I,u,F);break;case"selectionchange":if(nA)break;case"keydown":case"keyup":T0(I,u,F)}var ke;if(Ih)e:{switch(s){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else kr?p0(s,u)&&(Re="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Re="onCompositionStart");Re&&(h0&&u.locale!=="ko"&&(kr||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&kr&&(ke=l0()):(Fn=F,Qh="value"in Fn?Fn.value:Fn.textContent,kr=!0)),he=Cu(L,Re),0<he.length&&(Re=new u0(Re,s,null,u,F),I.push({event:Re,listeners:he}),ke?Re.data=ke:(ke=m0(u),ke!==null&&(Re.data=ke)))),(ke=YC?IC(s,u):WC(s,u))&&(Re=Cu(L,"onBeforeInput"),0<Re.length&&(he=new u0("onBeforeInput","beforeinput",null,u,F),I.push({event:he,listeners:Re}),he.data=ke)),qA(I,s,L,u,F)}$b(I,l)})}function fa(s,l,u){return{instance:s,listener:l,currentTarget:u}}function Cu(s,l){for(var u=l+"Capture",h=[];s!==null;){var p=s,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=jl(s,u),p!=null&&h.unshift(fa(s,p,g)),p=jl(s,l),p!=null&&h.push(fa(s,p,g))),s.tag===3)return h;s=s.return}return[]}function GA(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function tx(s,l,u,h,p){for(var g=l._reactName,v=[];u!==null&&u!==h;){var A=u,T=A.alternate,L=A.stateNode;if(A=A.tag,T!==null&&T===h)break;A!==5&&A!==26&&A!==27||L===null||(T=L,p?(L=jl(u,g),L!=null&&v.unshift(fa(u,L,T))):p||(L=jl(u,g),L!=null&&v.push(fa(u,L,T)))),u=u.return}v.length!==0&&s.push({event:l,listeners:v})}var FA=/\r\n?/g,KA=/\u0000|\uFFFD/g;function ix(s){return(typeof s=="string"?s:""+s).replace(FA,`
|
|
9
|
+
`).replace(KA,"")}function nx(s,l){return l=ix(l),ix(s)===l}function Fe(s,l,u,h,p,g){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||vr(s,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&vr(s,""+h);break;case"className":Oo(s,"class",h);break;case"tabIndex":Oo(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Oo(s,u,h);break;case"style":n0(s,h,g);break;case"data":if(l!=="object"){Oo(s,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=No(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"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 g=="function"&&(u==="formAction"?(l!=="input"&&Fe(s,l,"name",p.name,p,null),Fe(s,l,"formEncType",p.formEncType,p,null),Fe(s,l,"formMethod",p.formMethod,p,null),Fe(s,l,"formTarget",p.formTarget,p,null)):(Fe(s,l,"encType",p.encType,p,null),Fe(s,l,"method",p.method,p,null),Fe(s,l,"target",p.target,p,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=No(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=yn);break;case"onScroll":h!=null&&Oe("scroll",s);break;case"onScrollEnd":h!=null&&Oe("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(n(61));if(u=h.__html,u!=null){if(p.children!=null)throw Error(n(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=No(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);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":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":Oe("beforetoggle",s),Oe("toggle",s),To(s,"popover",h);break;case"xlinkActuate":gn(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":gn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":gn(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":gn(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":gn(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":gn(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":gn(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":gn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":gn(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":To(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=vC.get(u)||u,To(s,u,h))}}function Ad(s,l,u,h,p,g){switch(u){case"style":n0(s,h,g);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(n(61));if(u=h.__html,u!=null){if(p.children!=null)throw Error(n(60));s.innerHTML=u}}break;case"children":typeof h=="string"?vr(s,h):(typeof h=="number"||typeof h=="bigint")&&vr(s,""+h);break;case"onScroll":h!=null&&Oe("scroll",s);break;case"onScrollEnd":h!=null&&Oe("scrollend",s);break;case"onClick":h!=null&&(s.onclick=yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ig.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(p=u.endsWith("Capture"),l=u.slice(2,p?u.length-7:void 0),g=s[Yt]||null,g=g!=null?g[u]:null,typeof g=="function"&&s.removeEventListener(l,g,p),typeof h=="function")){typeof g!="function"&&g!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(l,h,p);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):To(s,u,h)}}}function Dt(s,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",s),Oe("load",s);var h=!1,p=!1,g;for(g in u)if(u.hasOwnProperty(g)){var v=u[g];if(v!=null)switch(g){case"src":h=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:Fe(s,l,g,v,u,null)}}p&&Fe(s,l,"srcSet",u.srcSet,u,null),h&&Fe(s,l,"src",u.src,u,null);return;case"input":Oe("invalid",s);var A=g=v=p=null,T=null,L=null;for(h in u)if(u.hasOwnProperty(h)){var F=u[h];if(F!=null)switch(h){case"name":p=F;break;case"type":v=F;break;case"checked":T=F;break;case"defaultChecked":L=F;break;case"value":g=F;break;case"defaultValue":A=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(n(137,l));break;default:Fe(s,l,h,F,u,null)}}$g(s,g,A,T,L,v,p,!1);return;case"select":Oe("invalid",s),h=v=g=null;for(p in u)if(u.hasOwnProperty(p)&&(A=u[p],A!=null))switch(p){case"value":g=A;break;case"defaultValue":v=A;break;case"multiple":h=A;default:Fe(s,l,p,A,u,null)}l=g,u=v,s.multiple=!!h,l!=null?xr(s,!!h,l,!1):u!=null&&xr(s,!!h,u,!0);return;case"textarea":Oe("invalid",s),g=p=h=null;for(v in u)if(u.hasOwnProperty(v)&&(A=u[v],A!=null))switch(v){case"value":h=A;break;case"defaultValue":p=A;break;case"children":g=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(n(91));break;default:Fe(s,l,v,A,u,null)}t0(s,h,p,g);return;case"option":for(T in u)u.hasOwnProperty(T)&&(h=u[T],h!=null)&&(T==="selected"?s.selected=h&&typeof h!="function"&&typeof h!="symbol":Fe(s,l,T,h,u,null));return;case"dialog":Oe("beforetoggle",s),Oe("toggle",s),Oe("cancel",s),Oe("close",s);break;case"iframe":case"object":Oe("load",s);break;case"video":case"audio":for(h=0;h<ha.length;h++)Oe(ha[h],s);break;case"image":Oe("error",s),Oe("load",s);break;case"details":Oe("toggle",s);break;case"embed":case"source":case"link":Oe("error",s),Oe("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in u)if(u.hasOwnProperty(L)&&(h=u[L],h!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:Fe(s,l,L,h,u,null)}return;default:if(_h(l)){for(F in u)u.hasOwnProperty(F)&&(h=u[F],h!==void 0&&Ad(s,l,F,h,u,void 0));return}}for(A in u)u.hasOwnProperty(A)&&(h=u[A],h!=null&&Fe(s,l,A,h,u,null))}function YA(s,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,v=null,A=null,T=null,L=null,F=null;for(q in u){var I=u[q];if(u.hasOwnProperty(q)&&I!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":T=I;default:h.hasOwnProperty(q)||Fe(s,l,q,null,h,I)}}for(var z in h){var q=h[z];if(I=u[z],h.hasOwnProperty(z)&&(q!=null||I!=null))switch(z){case"type":g=q;break;case"name":p=q;break;case"checked":L=q;break;case"defaultChecked":F=q;break;case"value":v=q;break;case"defaultValue":A=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(n(137,l));break;default:q!==I&&Fe(s,l,z,q,h,I)}}zh(s,v,A,T,L,F,g,p);return;case"select":q=v=A=z=null;for(g in u)if(T=u[g],u.hasOwnProperty(g)&&T!=null)switch(g){case"value":break;case"multiple":q=T;default:h.hasOwnProperty(g)||Fe(s,l,g,null,h,T)}for(p in h)if(g=h[p],T=u[p],h.hasOwnProperty(p)&&(g!=null||T!=null))switch(p){case"value":z=g;break;case"defaultValue":A=g;break;case"multiple":v=g;default:g!==T&&Fe(s,l,p,g,h,T)}l=A,u=v,h=q,z!=null?xr(s,!!u,z,!1):!!h!=!!u&&(l!=null?xr(s,!!u,l,!0):xr(s,!!u,u?[]:"",!1));return;case"textarea":q=z=null;for(A in u)if(p=u[A],u.hasOwnProperty(A)&&p!=null&&!h.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Fe(s,l,A,null,h,p)}for(v in h)if(p=h[v],g=u[v],h.hasOwnProperty(v)&&(p!=null||g!=null))switch(v){case"value":z=p;break;case"defaultValue":q=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(n(91));break;default:p!==g&&Fe(s,l,v,p,h,g)}e0(s,z,q);return;case"option":for(var oe in u)z=u[oe],u.hasOwnProperty(oe)&&z!=null&&!h.hasOwnProperty(oe)&&(oe==="selected"?s.selected=!1:Fe(s,l,oe,null,h,z));for(T in h)z=h[T],q=u[T],h.hasOwnProperty(T)&&z!==q&&(z!=null||q!=null)&&(T==="selected"?s.selected=z&&typeof z!="function"&&typeof z!="symbol":Fe(s,l,T,z,h,q));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in u)z=u[ye],u.hasOwnProperty(ye)&&z!=null&&!h.hasOwnProperty(ye)&&Fe(s,l,ye,null,h,z);for(L in h)if(z=h[L],q=u[L],h.hasOwnProperty(L)&&z!==q&&(z!=null||q!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(n(137,l));break;default:Fe(s,l,L,z,h,q)}return;default:if(_h(l)){for(var Ke in u)z=u[Ke],u.hasOwnProperty(Ke)&&z!==void 0&&!h.hasOwnProperty(Ke)&&Ad(s,l,Ke,void 0,h,z);for(F in h)z=h[F],q=u[F],!h.hasOwnProperty(F)||z===q||z===void 0&&q===void 0||Ad(s,l,F,z,h,q);return}}for(var j in u)z=u[j],u.hasOwnProperty(j)&&z!=null&&!h.hasOwnProperty(j)&&Fe(s,l,j,null,h,z);for(I in h)z=h[I],q=u[I],!h.hasOwnProperty(I)||z===q||z==null&&q==null||Fe(s,l,I,z,h,q)}function sx(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function IA(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var p=u[h],g=p.transferSize,v=p.initiatorType,A=p.duration;if(g&&A&&sx(v)){for(v=0,A=p.responseEnd,h+=1;h<u.length;h++){var T=u[h],L=T.startTime;if(L>A)break;var F=T.transferSize,I=T.initiatorType;F&&sx(I)&&(T=T.responseEnd,v+=F*(T<A?1:(A-L)/(T-L)))}if(--h,l+=8*(g+v)/(p.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Md=null,Td=null;function Au(s){return s.nodeType===9?s:s.ownerDocument}function rx(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lx(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Od(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Ed=null;function WA(){var s=window.event;return s&&s.type==="popstate"?s===Ed?!1:(Ed=s,!0):(Ed=null,!1)}var ax=typeof setTimeout=="function"?setTimeout:void 0,XA=typeof clearTimeout=="function"?clearTimeout:void 0,ox=typeof Promise=="function"?Promise:void 0,ZA=typeof queueMicrotask=="function"?queueMicrotask:typeof ox<"u"?function(s){return ox.resolve(null).then(s).catch(JA)}:ax;function JA(s){setTimeout(function(){throw s})}function os(s){return s==="head"}function ux(s,l){var u=l,h=0;do{var p=u.nextSibling;if(s.removeChild(u),p&&p.nodeType===8)if(u=p.data,u==="/$"||u==="/&"){if(h===0){s.removeChild(p),Zr(l);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")da(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,da(u);for(var g=u.firstChild;g;){var v=g.nextSibling,A=g.nodeName;g[Rl]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&g.rel.toLowerCase()==="stylesheet"||u.removeChild(g),g=v}}else u==="body"&&da(s.ownerDocument.body);u=p}while(u);Zr(l)}function cx(s,l){var u=s;s=0;do{var h=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=h}while(u)}function Nd(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Nd(u),Bh(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function $A(s,l,u,h){for(;s.nodeType===1;){var p=u;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Rl])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(g=s.getAttribute("rel"),g==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(g!==p.rel||s.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||s.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||s.getAttribute("title")!==(p.title==null?null:p.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(g=s.getAttribute("src"),(g!==(p.src==null?null:p.src)||s.getAttribute("type")!==(p.type==null?null:p.type)||s.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&s.getAttribute("name")===g)return s}else return s;if(s=Ei(s.nextSibling),s===null)break}return null}function eM(s,l,u){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ei(s.nextSibling),s===null))return null;return s}function hx(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=Ei(s.nextSibling),s===null))return null;return s}function Rd(s){return s.data==="$?"||s.data==="$~"}function Dd(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function tM(s,l){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||u.readyState!=="loading")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function Ei(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var jd=null;function fx(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(l===0)return Ei(s.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}s=s.nextSibling}return null}function dx(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return s;l--}else u!=="/$"&&u!=="/&"||l++}s=s.previousSibling}return null}function px(s,l,u){switch(l=Au(u),s){case"html":if(s=l.documentElement,!s)throw Error(n(452));return s;case"head":if(s=l.head,!s)throw Error(n(453));return s;case"body":if(s=l.body,!s)throw Error(n(454));return s;default:throw Error(n(451))}}function da(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);Bh(s)}var Ni=new Map,mx=new Set;function Mu(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var jn=X.d;X.d={f:iM,r:nM,D:sM,C:rM,L:lM,m:aM,X:uM,S:oM,M:cM};function iM(){var s=jn.f(),l=yu();return s||l}function nM(s){var l=gr(s);l!==null&&l.tag===5&&l.type==="form"?Dy(l):jn.r(s)}var Ir=typeof document>"u"?null:document;function gx(s,l,u){var h=Ir;if(h&&typeof l=="string"&&l){var p=wi(l);p='link[rel="'+s+'"][href="'+p+'"]',typeof u=="string"&&(p+='[crossorigin="'+u+'"]'),mx.has(p)||(mx.add(p),s={rel:s,crossOrigin:u,href:l},h.querySelector(p)===null&&(l=h.createElement("link"),Dt(l,"link",s),kt(l),h.head.appendChild(l)))}}function sM(s){jn.D(s),gx("dns-prefetch",s,null)}function rM(s,l){jn.C(s,l),gx("preconnect",s,l)}function lM(s,l,u){jn.L(s,l,u);var h=Ir;if(h&&s&&l){var p='link[rel="preload"][as="'+wi(l)+'"]';l==="image"&&u&&u.imageSrcSet?(p+='[imagesrcset="'+wi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(p+='[imagesizes="'+wi(u.imageSizes)+'"]')):p+='[href="'+wi(s)+'"]';var g=p;switch(l){case"style":g=Wr(s);break;case"script":g=Xr(s)}Ni.has(g)||(s=y({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:s,as:l},u),Ni.set(g,s),h.querySelector(p)!==null||l==="style"&&h.querySelector(pa(g))||l==="script"&&h.querySelector(ma(g))||(l=h.createElement("link"),Dt(l,"link",s),kt(l),h.head.appendChild(l)))}}function aM(s,l){jn.m(s,l);var u=Ir;if(u&&s){var h=l&&typeof l.as=="string"?l.as:"script",p='link[rel="modulepreload"][as="'+wi(h)+'"][href="'+wi(s)+'"]',g=p;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Xr(s)}if(!Ni.has(g)&&(s=y({rel:"modulepreload",href:s},l),Ni.set(g,s),u.querySelector(p)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ma(g)))return}h=u.createElement("link"),Dt(h,"link",s),kt(h),u.head.appendChild(h)}}}function oM(s,l,u){jn.S(s,l,u);var h=Ir;if(h&&s){var p=yr(h).hoistableStyles,g=Wr(s);l=l||"default";var v=p.get(g);if(!v){var A={loading:0,preload:null};if(v=h.querySelector(pa(g)))A.loading=5;else{s=y({rel:"stylesheet",href:s,"data-precedence":l},u),(u=Ni.get(g))&&Bd(s,u);var T=v=h.createElement("link");kt(T),Dt(T,"link",s),T._p=new Promise(function(L,F){T.onload=L,T.onerror=F}),T.addEventListener("load",function(){A.loading|=1}),T.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Tu(v,l,h)}v={type:"stylesheet",instance:v,count:1,state:A},p.set(g,v)}}}function uM(s,l){jn.X(s,l);var u=Ir;if(u&&s){var h=yr(u).hoistableScripts,p=Xr(s),g=h.get(p);g||(g=u.querySelector(ma(p)),g||(s=y({src:s,async:!0},l),(l=Ni.get(p))&&Ld(s,l),g=u.createElement("script"),kt(g),Dt(g,"link",s),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(p,g))}}function cM(s,l){jn.M(s,l);var u=Ir;if(u&&s){var h=yr(u).hoistableScripts,p=Xr(s),g=h.get(p);g||(g=u.querySelector(ma(p)),g||(s=y({src:s,async:!0,type:"module"},l),(l=Ni.get(p))&&Ld(s,l),g=u.createElement("script"),kt(g),Dt(g,"link",s),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(p,g))}}function yx(s,l,u,h){var p=(p=Se.current)?Mu(p):null;if(!p)throw Error(n(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Wr(u.href),u=yr(p).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=Wr(u.href);var g=yr(p).hoistableStyles,v=g.get(s);if(v||(p=p.ownerDocument||p,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(s,v),(g=p.querySelector(pa(s)))&&!g._p&&(v.instance=g,v.state.loading=5),Ni.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ni.set(s,u),g||hM(p,s,u,v.state))),l&&h===null)throw Error(n(528,""));return v}if(l&&h!==null)throw Error(n(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Xr(u),u=yr(p).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,s))}}function Wr(s){return'href="'+wi(s)+'"'}function pa(s){return'link[rel="stylesheet"]['+s+"]"}function bx(s){return y({},s,{"data-precedence":s.precedence,precedence:null})}function hM(s,l,u,h){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=s.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Dt(l,"link",u),kt(l),s.head.appendChild(l))}function Xr(s){return'[src="'+wi(s)+'"]'}function ma(s){return"script[async]"+s}function xx(s,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=s.querySelector('style[data-href~="'+wi(u.href)+'"]');if(h)return l.instance=h,kt(h),h;var p=y({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),kt(h),Dt(h,"style",p),Tu(h,u.precedence,s),l.instance=h;case"stylesheet":p=Wr(u.href);var g=s.querySelector(pa(p));if(g)return l.state.loading|=4,l.instance=g,kt(g),g;h=bx(u),(p=Ni.get(p))&&Bd(h,p),g=(s.ownerDocument||s).createElement("link"),kt(g);var v=g;return v._p=new Promise(function(A,T){v.onload=A,v.onerror=T}),Dt(g,"link",h),l.state.loading|=4,Tu(g,u.precedence,s),l.instance=g;case"script":return g=Xr(u.src),(p=s.querySelector(ma(g)))?(l.instance=p,kt(p),p):(h=u,(p=Ni.get(g))&&(h=y({},u),Ld(h,p)),s=s.ownerDocument||s,p=s.createElement("script"),kt(p),Dt(p,"link",h),s.head.appendChild(p),l.instance=p);case"void":return null;default:throw Error(n(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Tu(h,u.precedence,s));return l.instance}function Tu(s,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=h.length?h[h.length-1]:null,g=p,v=0;v<h.length;v++){var A=h[v];if(A.dataset.precedence===l)g=A;else if(g!==p)break}g?g.parentNode.insertBefore(s,g.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(s,l.firstChild))}function Bd(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function Ld(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Ou=null;function vx(s,l,u){if(Ou===null){var h=new Map,p=Ou=new Map;p.set(u,h)}else p=Ou,h=p.get(u),h||(h=new Map,p.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),p=0;p<u.length;p++){var g=u[p];if(!(g[Rl]||g[Ot]||s==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var v=g.getAttribute(l)||"";v=s+v;var A=h.get(v);A?A.push(g):h.set(v,[g])}}return h}function Sx(s,l,u){s=s.ownerDocument||s,s.head.insertBefore(u,l==="title"?s.querySelector("head > title"):null)}function fM(s,l,u){if(u===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function wx(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function dM(s,l,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var p=Wr(h.href),g=l.querySelector(pa(p));if(g){l=g._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Eu.bind(s),l.then(s,s)),u.state.loading|=4,u.instance=g,kt(g);return}g=l.ownerDocument||l,h=bx(h),(p=Ni.get(p))&&Bd(h,p),g=g.createElement("link"),kt(g);var v=g;v._p=new Promise(function(A,T){v.onload=A,v.onerror=T}),Dt(g,"link",h),u.instance=g}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=Eu.bind(s),l.addEventListener("load",u),l.addEventListener("error",u))}}var zd=0;function pM(s,l){return s.stylesheets&&s.count===0&&Ru(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var h=setTimeout(function(){if(s.stylesheets&&Ru(s,s.stylesheets),s.unsuspend){var g=s.unsuspend;s.unsuspend=null,g()}},6e4+l);0<s.imgBytes&&zd===0&&(zd=62500*IA());var p=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Ru(s,s.stylesheets),s.unsuspend)){var g=s.unsuspend;s.unsuspend=null,g()}},(s.imgBytes>zd?50:800)+l);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(p)}}:null}function Eu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ru(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Nu=null;function Ru(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Nu=new Map,l.forEach(mM,s),Nu=null,Eu.call(s))}function mM(s,l){if(!(l.state.loading&4)){var u=Nu.get(s);if(u)var h=u.get(null);else{u=new Map,Nu.set(s,u);for(var p=s.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var v=p[g];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(u.set(v.dataset.precedence,v),h=v)}h&&u.set(null,h)}p=l.instance,v=p.getAttribute("data-precedence"),g=u.get(v)||h,g===h&&u.set(null,p),u.set(v,p),this.count++,h=Eu.bind(this),p.addEventListener("load",h),p.addEventListener("error",h),g?g.parentNode.insertBefore(p,g.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(p,s.firstChild)),l.state.loading|=4}}var ga={$$typeof:D,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function gM(s,l,u,h,p,g,v,A,T){this.tag=1,this.containerInfo=s,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=Nh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nh(0),this.hiddenUpdates=Nh(null),this.identifierPrefix=h,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function kx(s,l,u,h,p,g,v,A,T,L,F,I){return s=new gM(s,l,u,v,T,L,F,I,A),l=1,g===!0&&(l|=24),g=ci(3,null,null,l),s.current=g,g.stateNode=s,l=mf(),l.refCount++,s.pooledCache=l,l.refCount++,g.memoizedState={element:h,isDehydrated:u,cache:l},xf(g),s}function Cx(s){return s?(s=Tr,s):Tr}function Ax(s,l,u,h,p,g){p=Cx(p),h.context===null?h.context=p:h.pendingContext=p,h=Zn(l),h.payload={element:u},g=g===void 0?null:g,g!==null&&(h.callback=g),u=Jn(s,h,l),u!==null&&($t(u,s,l),Il(u,s,l))}function Mx(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<l?u:l}}function Hd(s,l){Mx(s,l),(s=s.alternate)&&Mx(s,l)}function Tx(s){if(s.tag===13||s.tag===31){var l=_s(s,67108864);l!==null&&$t(l,s,67108864),Hd(s,67108864)}}function Ox(s){if(s.tag===13||s.tag===31){var l=mi();l=Rh(l);var u=_s(s,l);u!==null&&$t(u,s,l),Hd(s,l)}}var Du=!0;function yM(s,l,u,h){var p=H.T;H.T=null;var g=X.p;try{X.p=2,_d(s,l,u,h)}finally{X.p=g,H.T=p}}function bM(s,l,u,h){var p=H.T;H.T=null;var g=X.p;try{X.p=8,_d(s,l,u,h)}finally{X.p=g,H.T=p}}function _d(s,l,u,h){if(Du){var p=Ud(h);if(p===null)Cd(s,l,h,ju,u),Nx(s,h);else if(vM(p,s,l,u,h))h.stopPropagation();else if(Nx(s,h),l&4&&-1<xM.indexOf(s)){for(;p!==null;){var g=gr(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var v=js(g.pendingLanes);if(v!==0){var A=g;for(A.pendingLanes|=2,A.entangledLanes|=2;v;){var T=1<<31-oi(v);A.entanglements[1]|=T,v&=~T}$i(g),(Ue&6)===0&&(mu=li()+500,ca(0))}}break;case 31:case 13:A=_s(g,2),A!==null&&$t(A,g,2),yu(),Hd(g,2)}if(g=Ud(h),g===null&&Cd(s,l,h,ju,u),g===p)break;p=g}p!==null&&h.stopPropagation()}else Cd(s,l,h,null,u)}}function Ud(s){return s=qh(s),qd(s)}var ju=null;function qd(s){if(ju=null,s=mr(s),s!==null){var l=a(s);if(l===null)s=null;else{var u=l.tag;if(u===13){if(s=o(l),s!==null)return s;s=null}else if(u===31){if(s=c(l),s!==null)return s;s=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return ju=s,null}function Ex(s){switch(s){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(sC()){case Hg:return 2;case _g:return 8;case wo:case rC:return 32;case Ug:return 268435456;default:return 32}default:return 32}}var Pd=!1,us=null,cs=null,hs=null,ya=new Map,ba=new Map,fs=[],xM="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 Nx(s,l){switch(s){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":cs=null;break;case"mouseover":case"mouseout":hs=null;break;case"pointerover":case"pointerout":ya.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ba.delete(l.pointerId)}}function xa(s,l,u,h,p,g){return s===null||s.nativeEvent!==g?(s={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:g,targetContainers:[p]},l!==null&&(l=gr(l),l!==null&&Tx(l)),s):(s.eventSystemFlags|=h,l=s.targetContainers,p!==null&&l.indexOf(p)===-1&&l.push(p),s)}function vM(s,l,u,h,p){switch(l){case"focusin":return us=xa(us,s,l,u,h,p),!0;case"dragenter":return cs=xa(cs,s,l,u,h,p),!0;case"mouseover":return hs=xa(hs,s,l,u,h,p),!0;case"pointerover":var g=p.pointerId;return ya.set(g,xa(ya.get(g)||null,s,l,u,h,p)),!0;case"gotpointercapture":return g=p.pointerId,ba.set(g,xa(ba.get(g)||null,s,l,u,h,p)),!0}return!1}function Rx(s){var l=mr(s.target);if(l!==null){var u=a(l);if(u!==null){if(l=u.tag,l===13){if(l=o(u),l!==null){s.blockedOn=l,Fg(s.priority,function(){Ox(u)});return}}else if(l===31){if(l=c(u),l!==null){s.blockedOn=l,Fg(s.priority,function(){Ox(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Bu(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var u=Ud(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);Uh=h,u.target.dispatchEvent(h),Uh=null}else return l=gr(u),l!==null&&Tx(l),s.blockedOn=u,!1;l.shift()}return!0}function Dx(s,l,u){Bu(s)&&u.delete(l)}function SM(){Pd=!1,us!==null&&Bu(us)&&(us=null),cs!==null&&Bu(cs)&&(cs=null),hs!==null&&Bu(hs)&&(hs=null),ya.forEach(Dx),ba.forEach(Dx)}function Lu(s,l){s.blockedOn===l&&(s.blockedOn=null,Pd||(Pd=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,SM)))}var zu=null;function jx(s){zu!==s&&(zu=s,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){zu===s&&(zu=null);for(var l=0;l<s.length;l+=3){var u=s[l],h=s[l+1],p=s[l+2];if(typeof h!="function"){if(qd(h||u)===null)continue;break}var g=gr(u);g!==null&&(s.splice(l,3),l-=3,Uf(g,{pending:!0,data:p,method:u.method,action:h},h,p))}}))}function Zr(s){function l(T){return Lu(T,s)}us!==null&&Lu(us,s),cs!==null&&Lu(cs,s),hs!==null&&Lu(hs,s),ya.forEach(l),ba.forEach(l);for(var u=0;u<fs.length;u++){var h=fs[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<fs.length&&(u=fs[0],u.blockedOn===null);)Rx(u),u.blockedOn===null&&fs.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var p=u[h],g=u[h+1],v=p[Yt]||null;if(typeof g=="function")v||jx(u);else if(v){var A=null;if(g&&g.hasAttribute("formAction")){if(p=g,v=g[Yt]||null)A=v.formAction;else if(qd(p)!==null)continue}else A=v.action;typeof A=="function"?u[h+1]=A:(u.splice(h,3),h-=3),jx(u)}}}function Bx(){function s(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(v){return p=v})},focusReset:"manual",scroll:"manual"})}function l(){p!==null&&(p(),p=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,p=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),p!==null&&(p(),p=null)}}}function Vd(s){this._internalRoot=s}Hu.prototype.render=Vd.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(n(409));var u=l.current,h=mi();Ax(u,h,s,l,null,null)},Hu.prototype.unmount=Vd.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;Ax(s.current,2,null,s,null,null),yu(),l[pr]=null}};function Hu(s){this._internalRoot=s}Hu.prototype.unstable_scheduleHydration=function(s){if(s){var l=Gg();s={blockedOn:null,target:s,priority:l};for(var u=0;u<fs.length&&l!==0&&l<fs[u].priority;u++);fs.splice(u,0,s),u===0&&Rx(s)}};var Lx=e.version;if(Lx!=="19.2.4")throw Error(n(527,Lx,"19.2.4"));X.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=d(l),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var wM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_u.isDisabled&&_u.supportsFiber)try{Ol=_u.inject(wM),ai=_u}catch{}}return Sa.createRoot=function(s,l){if(!r(s))throw Error(n(299));var u=!1,h="",p=Vy,g=Qy,v=Gy;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(p=l.onUncaughtError),l.onCaughtError!==void 0&&(g=l.onCaughtError),l.onRecoverableError!==void 0&&(v=l.onRecoverableError)),l=kx(s,1,!1,null,null,u,h,null,p,g,v,Bx),s[pr]=l.current,kd(s),new Vd(l)},Sa.hydrateRoot=function(s,l,u){if(!r(s))throw Error(n(299));var h=!1,p="",g=Vy,v=Qy,A=Gy,T=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(p=u.identifierPrefix),u.onUncaughtError!==void 0&&(g=u.onUncaughtError),u.onCaughtError!==void 0&&(v=u.onCaughtError),u.onRecoverableError!==void 0&&(A=u.onRecoverableError),u.formState!==void 0&&(T=u.formState)),l=kx(s,1,!0,l,u??null,h,p,T,g,v,A,Bx),l.context=Cx(null),u=l.current,h=mi(),h=Rh(h),p=Zn(h),p.callback=null,Jn(u,p,h),u=h,l.current.lanes=u,Nl(l,u),$i(l),s[pr]=l.current,kd(s),new Hu(l)},Sa.version="19.2.4",Sa}var Fx;function DM(){if(Fx)return Fd.exports;Fx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Fd.exports=RM(),Fd.exports}var jM=DM();var Kx="popstate";function Yx(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function BM(i={}){function e(n,r){let a=r.state?.masked,{pathname:o,search:c,hash:f}=a||n.location;return Dp("",{pathname:o,search:c,hash:f},r.state&&r.state.usr||null,r.state&&r.state.key||"default",a?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function t(n,r){return typeof r=="string"?r:Va(r)}return zM(e,t,null,i)}function nt(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function Fi(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function LM(){return Math.random().toString(36).substring(2,10)}function Ix(i,e){return{usr:i.state,key:i.key,idx:e,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Dp(i,e,t=null,n,r){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof e=="string"?xl(e):e,state:t,key:e&&e.key||n||LM(),unstable_mask:r}}function Va({pathname:i="/",search:e="",hash:t=""}){return e&&e!=="?"&&(i+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(i+=t.charAt(0)==="#"?t:"#"+t),i}function xl(i){let e={};if(i){let t=i.indexOf("#");t>=0&&(e.hash=i.substring(t),i=i.substring(0,t));let n=i.indexOf("?");n>=0&&(e.search=i.substring(n),i=i.substring(0,n)),i&&(e.pathname=i)}return e}function zM(i,e,t,n={}){let{window:r=document.defaultView,v5Compat:a=!1}=n,o=r.history,c="POP",f=null,d=m();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function m(){return(o.state||{idx:null}).idx}function y(){c="POP";let C=m(),M=C==null?null:C-d;d=C,f&&f({action:c,location:k.location,delta:M})}function b(C,M){c="PUSH";let R=Yx(C)?C:Dp(k.location,C,M);d=m()+1;let D=Ix(R,d),Q=k.createHref(R.unstable_mask||R);try{o.pushState(D,"",Q)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;r.location.assign(Q)}a&&f&&f({action:c,location:k.location,delta:1})}function x(C,M){c="REPLACE";let R=Yx(C)?C:Dp(k.location,C,M);d=m();let D=Ix(R,d),Q=k.createHref(R.unstable_mask||R);o.replaceState(D,"",Q),a&&f&&f({action:c,location:k.location,delta:0})}function w(C){return HM(C)}let k={get action(){return c},get location(){return i(r,o)},listen(C){if(f)throw new Error("A history only accepts one active listener");return r.addEventListener(Kx,y),f=C,()=>{r.removeEventListener(Kx,y),f=null}},createHref(C){return e(r,C)},createURL:w,encodeLocation(C){let M=w(C);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:b,replace:x,go(C){return o.go(C)}};return k}function HM(i,e=!1){let t="http://localhost";typeof window<"u"&&(t=window.location.origin!=="null"?window.location.origin:window.location.href),nt(t,"No window.location.(origin|href) available to create URL");let n=typeof i=="string"?i:Va(i);return n=n.replace(/ $/,"%20"),!e&&n.startsWith("//")&&(n=t+n),new URL(n,t)}function uS(i,e,t="/"){return _M(i,e,t,!1)}function _M(i,e,t,n){let r=typeof e=="string"?xl(e):e,a=_n(r.pathname||"/",t);if(a==null)return null;let o=cS(i);UM(o);let c=null;for(let f=0;c==null&&f<o.length;++f){let d=XM(a);c=IM(o[f],d,n)}return c}function cS(i,e=[],t=[],n="",r=!1){let a=(o,c,f=r,d)=>{let m={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(n)&&f)return;nt(m.relativePath.startsWith(n),`Absolute route path "${m.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(n.length)}let y=hn([n,m.relativePath]),b=t.concat(m);o.children&&o.children.length>0&&(nt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),cS(o.children,e,b,y,f)),!(o.path==null&&!o.index)&&e.push({path:y,score:KM(y,o.index),routesMeta:b})};return i.forEach((o,c)=>{if(o.path===""||!o.path?.includes("?"))a(o,c);else for(let f of hS(o.path))a(o,c,!0,f)}),e}function hS(i){let e=i.split("/");if(e.length===0)return[];let[t,...n]=e,r=t.endsWith("?"),a=t.replace(/\?$/,"");if(n.length===0)return r?[a,""]:[a];let o=hS(n.join("/")),c=[];return c.push(...o.map(f=>f===""?a:[a,f].join("/"))),r&&c.push(...o),c.map(f=>i.startsWith("/")&&f===""?"/":f)}function UM(i){i.sort((e,t)=>e.score!==t.score?t.score-e.score:YM(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}var qM=/^:[\w-]+$/,PM=3,VM=2,QM=1,GM=10,FM=-2,Wx=i=>i==="*";function KM(i,e){let t=i.split("/"),n=t.length;return t.some(Wx)&&(n+=FM),e&&(n+=VM),t.filter(r=>!Wx(r)).reduce((r,a)=>r+(qM.test(a)?PM:a===""?QM:GM),n)}function YM(i,e){return i.length===e.length&&i.slice(0,-1).every((n,r)=>n===e[r])?i[i.length-1]-e[e.length-1]:0}function IM(i,e,t=!1){let{routesMeta:n}=i,r={},a="/",o=[];for(let c=0;c<n.length;++c){let f=n[c],d=c===n.length-1,m=a==="/"?e:e.slice(a.length)||"/",y=kc({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),b=f.route;if(!y&&d&&t&&!n[n.length-1].route.index&&(y=kc({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!y)return null;Object.assign(r,y.params),o.push({params:r,pathname:hn([a,y.pathname]),pathnameBase:eT(hn([a,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(a=hn([a,y.pathnameBase]))}return o}function kc(i,e){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[t,n]=WM(i.path,i.caseSensitive,i.end),r=e.match(t);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:n.reduce((d,{paramName:m,isOptional:y},b)=>{if(m==="*"){let w=c[b]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const x=c[b];return y&&!x?d[m]=void 0:d[m]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:i}}function WM(i,e=!1,t=!0){Fi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let n=[],r="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,f,d,m)=>{if(n.push({paramName:c,isOptional:f!=null}),f){let y=m.charAt(d+o.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(n.push({paramName:"*"}),r+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":i!==""&&i!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}function XM(i){try{return i.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Fi(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),i}}function _n(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=i.charAt(t);return n&&n!=="/"?null:i.slice(t)||"/"}var ZM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function JM(i,e="/"){let{pathname:t,search:n="",hash:r=""}=typeof i=="string"?xl(i):i,a;return t?(t=t.replace(/\/\/+/g,"/"),t.startsWith("/")?a=Xx(t.substring(1),"/"):a=Xx(t,e)):a=e,{pathname:a,search:tT(n),hash:iT(r)}}function Xx(i,e){let t=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Wd(i,e,t,n){return`Cannot include a '${i}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $M(i){return i.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Um(i){let e=$M(i);return e.map((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)}function rh(i,e,t,n=!1){let r;typeof i=="string"?r=xl(i):(r={...i},nt(!r.pathname||!r.pathname.includes("?"),Wd("?","pathname","search",r)),nt(!r.pathname||!r.pathname.includes("#"),Wd("#","pathname","hash",r)),nt(!r.search||!r.search.includes("#"),Wd("#","search","hash",r)));let a=i===""||r.pathname==="",o=a?"/":r.pathname,c;if(o==null)c=t;else{let y=e.length-1;if(!n&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),y-=1;r.pathname=b.join("/")}c=y>=0?e[y]:"/"}let f=JM(r,c),d=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&t.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var hn=i=>i.join("/").replace(/\/\/+/g,"/"),eT=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),tT=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,iT=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,nT=class{constructor(i,e,t,n=!1){this.status=i,this.statusText=e||"",this.internal=n,t instanceof Error?(this.data=t.toString(),this.error=t):this.data=t}};function sT(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function rT(i){return i.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var fS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function dS(i,e){let t=i;if(typeof t!="string"||!ZM.test(t))return{absoluteURL:void 0,isExternal:!1,to:t};let n=t,r=!1;if(fS)try{let a=new URL(window.location.href),o=t.startsWith("//")?new URL(a.protocol+t):new URL(t),c=_n(o.pathname,e);o.origin===a.origin&&c!=null?t=c+o.search+o.hash:r=!0}catch{Fi(!1,`<Link to="${t}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:r,to:t}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var pS=["POST","PUT","PATCH","DELETE"];new Set(pS);var lT=["GET",...pS];new Set(lT);var vl=E.createContext(null);vl.displayName="DataRouter";var lh=E.createContext(null);lh.displayName="DataRouterState";var aT=E.createContext(!1),mS=E.createContext({isTransitioning:!1});mS.displayName="ViewTransition";var oT=E.createContext(new Map);oT.displayName="Fetchers";var uT=E.createContext(null);uT.displayName="Await";var vi=E.createContext(null);vi.displayName="Navigation";var uo=E.createContext(null);uo.displayName="Location";var Yi=E.createContext({outlet:null,matches:[],isDataRoute:!1});Yi.displayName="Route";var qm=E.createContext(null);qm.displayName="RouteError";var gS="REACT_ROUTER_ERROR",cT="REDIRECT",hT="ROUTE_ERROR_RESPONSE";function fT(i){if(i.startsWith(`${gS}:${cT}:{`))try{let e=JSON.parse(i.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function dT(i){if(i.startsWith(`${gS}:${hT}:{`))try{let e=JSON.parse(i.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new nT(e.status,e.statusText,e.data)}catch{}}function pT(i,{relative:e}={}){nt(Sl(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:n}=E.useContext(vi),{hash:r,pathname:a,search:o}=co(i,{relative:e}),c=a;return t!=="/"&&(c=a==="/"?t:hn([t,a])),n.createHref({pathname:c,search:o,hash:r})}function Sl(){return E.useContext(uo)!=null}function Vn(){return nt(Sl(),"useLocation() may be used only in the context of a <Router> component."),E.useContext(uo).location}var yS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bS(i){E.useContext(vi).static||E.useLayoutEffect(i)}function xS(){let{isDataRoute:i}=E.useContext(Yi);return i?ET():mT()}function mT(){nt(Sl(),"useNavigate() may be used only in the context of a <Router> component.");let i=E.useContext(vl),{basename:e,navigator:t}=E.useContext(vi),{matches:n}=E.useContext(Yi),{pathname:r}=Vn(),a=JSON.stringify(Um(n)),o=E.useRef(!1);return bS(()=>{o.current=!0}),E.useCallback((f,d={})=>{if(Fi(o.current,yS),!o.current)return;if(typeof f=="number"){t.go(f);return}let m=rh(f,JSON.parse(a),r,d.relative==="path");i==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:hn([e,m.pathname])),(d.replace?t.replace:t.push)(m,d.state,d)},[e,t,a,r,i])}var gT=E.createContext(null);function yT(i){let e=E.useContext(Yi).outlet;return E.useMemo(()=>e&&E.createElement(gT.Provider,{value:i},e),[e,i])}function co(i,{relative:e}={}){let{matches:t}=E.useContext(Yi),{pathname:n}=Vn(),r=JSON.stringify(Um(t));return E.useMemo(()=>rh(i,JSON.parse(r),n,e==="path"),[i,r,n,e])}function bT(i,e){return vS(i,e)}function vS(i,e,t){nt(Sl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=E.useContext(vi),{matches:r}=E.useContext(Yi),a=r[r.length-1],o=a?a.params:{},c=a?a.pathname:"/",f=a?a.pathnameBase:"/",d=a&&a.route;{let C=d&&d.path||"";wS(c,!d||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let m=Vn(),y;if(e){let C=typeof e=="string"?xl(e):e;nt(f==="/"||C.pathname?.startsWith(f),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=m;let b=y.pathname||"/",x=b;if(f!=="/"){let C=f.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let w=uS(i,{pathname:x});Fi(d||w!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Fi(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=kT(w&&w.map(C=>Object.assign({},C,{params:Object.assign({},o,C.params),pathname:hn([f,n.encodeLocation?n.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?f:hn([f,n.encodeLocation?n.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,t);return e&&k?E.createElement(uo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},k):k}function xT(){let i=OT(),e=sT(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),t=i instanceof Error?i.stack:null,n="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},o=null;return console.error("Error handled by React Router default ErrorBoundary:",i),o=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:a},"ErrorBoundary")," or"," ",E.createElement("code",{style:a},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),t?E.createElement("pre",{style:r},t):null,o)}var vT=E.createElement(xT,null),SS=class extends E.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,e){return e.location!==i.location||e.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:e.error,location:e.location,revalidation:i.revalidation||e.revalidation}}componentDidCatch(i,e){this.props.onError?this.props.onError(i,e):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const t=dT(i.digest);t&&(i=t)}let e=i!==void 0?E.createElement(Yi.Provider,{value:this.props.routeContext},E.createElement(qm.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?E.createElement(ST,{error:i},e):e}};SS.contextType=aT;var Xd=new WeakMap;function ST({children:i,error:e}){let{basename:t}=E.useContext(vi);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=fT(e.digest);if(n){let r=Xd.get(e);if(r)throw r;let a=dS(n.location,t);if(fS&&!Xd.get(e))if(a.isExternal||n.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:n.replace}));throw Xd.set(e,o),o}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return i}function wT({routeContext:i,match:e,children:t}){let n=E.useContext(vl);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),E.createElement(Yi.Provider,{value:i},t)}function kT(i,e=[],t){let n=t?.state;if(i==null){if(!n)return null;if(n.errors)i=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)i=n.matches;else return null}let r=i,a=n?.errors;if(a!=null){let m=r.findIndex(y=>y.route.id&&a?.[y.route.id]!==void 0);nt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),r=r.slice(0,Math.min(r.length,m+1))}let o=!1,c=-1;if(t&&n){o=n.renderFallback;for(let m=0;m<r.length;m++){let y=r[m];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(c=m),y.route.id){let{loaderData:b,errors:x}=n,w=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!x||x[y.route.id]===void 0);if(y.route.lazy||w){t.isStatic&&(o=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let f=t?.onError,d=n&&f?(m,y)=>{f(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:rT(n.matches),errorInfo:y})}:void 0;return r.reduceRight((m,y,b)=>{let x,w=!1,k=null,C=null;n&&(x=a&&y.route.id?a[y.route.id]:void 0,k=y.route.errorElement||vT,o&&(c<0&&b===0?(wS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):c===b&&(w=!0,C=y.route.hydrateFallbackElement||null)));let M=e.concat(r.slice(0,b+1)),R=()=>{let D;return x?D=k:w?D=C:y.route.Component?D=E.createElement(y.route.Component,null):y.route.element?D=y.route.element:D=m,E.createElement(wT,{match:y,routeContext:{outlet:m,matches:M,isDataRoute:n!=null},children:D})};return n&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?E.createElement(SS,{location:n.location,revalidation:n.revalidation,component:k,error:x,children:R(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:d}):R()},null)}function Pm(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function CT(i){let e=E.useContext(vl);return nt(e,Pm(i)),e}function AT(i){let e=E.useContext(lh);return nt(e,Pm(i)),e}function MT(i){let e=E.useContext(Yi);return nt(e,Pm(i)),e}function Vm(i){let e=MT(i),t=e.matches[e.matches.length-1];return nt(t.route.id,`${i} can only be used on routes that contain a unique "id"`),t.route.id}function TT(){return Vm("useRouteId")}function OT(){let i=E.useContext(qm),e=AT("useRouteError"),t=Vm("useRouteError");return i!==void 0?i:e.errors?.[t]}function ET(){let{router:i}=CT("useNavigate"),e=Vm("useNavigate"),t=E.useRef(!1);return bS(()=>{t.current=!0}),E.useCallback(async(r,a={})=>{Fi(t.current,yS),t.current&&(typeof r=="number"?await i.navigate(r):await i.navigate(r,{fromRouteId:e,...a}))},[i,e])}var Zx={};function wS(i,e,t){!e&&!Zx[i]&&(Zx[i]=!0,Fi(!1,t))}E.memo(NT);function NT({routes:i,future:e,state:t,isStatic:n,onError:r}){return vS(i,void 0,{state:t,isStatic:n,onError:r})}function RT({to:i,replace:e,state:t,relative:n}){nt(Sl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=E.useContext(vi);Fi(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=E.useContext(Yi),{pathname:o}=Vn(),c=xS(),f=rh(i,Um(a),o,n==="path"),d=JSON.stringify(f);return E.useEffect(()=>{c(JSON.parse(d),{replace:e,state:t,relative:n})},[c,d,n,e,t]),null}function DT(i){return yT(i.context)}function hc(i){nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function jT({basename:i="/",children:e=null,location:t,navigationType:n="POP",navigator:r,static:a=!1,unstable_useTransitions:o}){nt(!Sl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),f=E.useMemo(()=>({basename:c,navigator:r,static:a,unstable_useTransitions:o,future:{}}),[c,r,a,o]);typeof t=="string"&&(t=xl(t));let{pathname:d="/",search:m="",hash:y="",state:b=null,key:x="default",unstable_mask:w}=t,k=E.useMemo(()=>{let C=_n(d,c);return C==null?null:{location:{pathname:C,search:m,hash:y,state:b,key:x,unstable_mask:w},navigationType:n}},[c,d,m,y,b,x,n,w]);return Fi(k!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:E.createElement(vi.Provider,{value:f},E.createElement(uo.Provider,{children:e,value:k}))}function BT({children:i,location:e}){return bT(jp(i),e)}function jp(i,e=[]){let t=[];return E.Children.forEach(i,(n,r)=>{if(!E.isValidElement(n))return;let a=[...e,r];if(n.type===E.Fragment){t.push.apply(t,jp(n.props.children,a));return}nt(n.type===hc,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nt(!n.props.index||!n.props.children,"An index route cannot have child routes.");let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=jp(n.props.children,a)),t.push(o)}),t}var fc="get",dc="application/x-www-form-urlencoded";function ah(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function LT(i){return ah(i)&&i.tagName.toLowerCase()==="button"}function zT(i){return ah(i)&&i.tagName.toLowerCase()==="form"}function HT(i){return ah(i)&&i.tagName.toLowerCase()==="input"}function _T(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function UT(i,e){return i.button===0&&(!e||e==="_self")&&!_T(i)}var Uu=null;function qT(){if(Uu===null)try{new FormData(document.createElement("form"),0),Uu=!1}catch{Uu=!0}return Uu}var PT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zd(i){return i!=null&&!PT.has(i)?(Fi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dc}"`),null):i}function VT(i,e){let t,n,r,a,o;if(zT(i)){let c=i.getAttribute("action");n=c?_n(c,e):null,t=i.getAttribute("method")||fc,r=Zd(i.getAttribute("enctype"))||dc,a=new FormData(i)}else if(LT(i)||HT(i)&&(i.type==="submit"||i.type==="image")){let c=i.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=i.getAttribute("formaction")||c.getAttribute("action");if(n=f?_n(f,e):null,t=i.getAttribute("formmethod")||c.getAttribute("method")||fc,r=Zd(i.getAttribute("formenctype"))||Zd(c.getAttribute("enctype"))||dc,a=new FormData(c,i),!qT()){let{name:d,type:m,value:y}=i;if(m==="image"){let b=d?`${d}.`:"";a.append(`${b}x`,"0"),a.append(`${b}y`,"0")}else d&&a.append(d,y)}}else{if(ah(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=fc,n=null,r=dc,o=i}return a&&r==="text/plain"&&(o=a,a=void 0),{action:n,method:t.toLowerCase(),encType:r,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Qm(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function QT(i,e,t,n){let r=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return t?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${n}`:r.pathname=`${r.pathname}.${n}`:r.pathname==="/"?r.pathname=`_root.${n}`:e&&_n(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function GT(i,e){if(i.id in e)return e[i.id];try{let t=await import(i.module);return e[i.id]=t,t}catch(t){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function FT(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function KT(i,e,t){let n=await Promise.all(i.map(async r=>{let a=e.routes[r.route.id];if(a){let o=await GT(a,t);return o.links?o.links():[]}return[]}));return XT(n.flat(1).filter(FT).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Jx(i,e,t,n,r,a){let o=(f,d)=>t[d]?f.route.id!==t[d].route.id:!0,c=(f,d)=>t[d].pathname!==f.pathname||t[d].route.path?.endsWith("*")&&t[d].params["*"]!==f.params["*"];return a==="assets"?e.filter((f,d)=>o(f,d)||c(f,d)):a==="data"?e.filter((f,d)=>{let m=n.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(o(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:t[0]?.params||{},nextUrl:new URL(i,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function YT(i,e,{includeHydrateFallback:t}={}){return IT(i.map(n=>{let r=e.routes[n.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),t&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))}function IT(i){return[...new Set(i)]}function WT(i){let e={},t=Object.keys(i).sort();for(let n of t)e[n]=i[n];return e}function XT(i,e){let t=new Set;return new Set(e),i.reduce((n,r)=>{let a=JSON.stringify(WT(r));return t.has(a)||(t.add(a),n.push({key:a,link:r})),n},[])}function kS(){let i=E.useContext(vl);return Qm(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function ZT(){let i=E.useContext(lh);return Qm(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Gm=E.createContext(void 0);Gm.displayName="FrameworkContext";function CS(){let i=E.useContext(Gm);return Qm(i,"You must render this element inside a <HydratedRouter> element"),i}function JT(i,e){let t=E.useContext(Gm),[n,r]=E.useState(!1),[a,o]=E.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:y}=e,b=E.useRef(null);E.useEffect(()=>{if(i==="render"&&o(!0),i==="viewport"){let k=M=>{M.forEach(R=>{o(R.isIntersecting)})},C=new IntersectionObserver(k,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[i]),E.useEffect(()=>{if(n){let k=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(k)}}},[n]);let x=()=>{r(!0)},w=()=>{r(!1),o(!1)};return t?i!=="intent"?[a,b,{}]:[a,b,{onFocus:wa(c,x),onBlur:wa(f,w),onMouseEnter:wa(d,x),onMouseLeave:wa(m,w),onTouchStart:wa(y,x)}]:[!1,b,{}]}function wa(i,e){return t=>{i&&i(t),t.defaultPrevented||e(t)}}function $T({page:i,...e}){let{router:t}=kS(),n=E.useMemo(()=>uS(t.routes,i,t.basename),[t.routes,i,t.basename]);return n?E.createElement(tO,{page:i,matches:n,...e}):null}function eO(i){let{manifest:e,routeModules:t}=CS(),[n,r]=E.useState([]);return E.useEffect(()=>{let a=!1;return KT(i,e,t).then(o=>{a||r(o)}),()=>{a=!0}},[i,e,t]),n}function tO({page:i,matches:e,...t}){let n=Vn(),{future:r,manifest:a,routeModules:o}=CS(),{basename:c}=kS(),{loaderData:f,matches:d}=ZT(),m=E.useMemo(()=>Jx(i,e,d,a,n,"data"),[i,e,d,a,n]),y=E.useMemo(()=>Jx(i,e,d,a,n,"assets"),[i,e,d,a,n]),b=E.useMemo(()=>{if(i===n.pathname+n.search+n.hash)return[];let k=new Set,C=!1;if(e.forEach(R=>{let D=a.routes[R.route.id];!D||!D.hasLoader||(!m.some(Q=>Q.route.id===R.route.id)&&R.route.id in f&&o[R.route.id]?.shouldRevalidate||D.hasClientLoader?C=!0:k.add(R.route.id))}),k.size===0)return[];let M=QT(i,c,r.unstable_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&M.searchParams.set("_routes",e.filter(R=>k.has(R.route.id)).map(R=>R.route.id).join(",")),[M.pathname+M.search]},[c,r.unstable_trailingSlashAwareDataRequests,f,n,a,m,e,i,o]),x=E.useMemo(()=>YT(y,a),[y,a]),w=eO(y);return E.createElement(E.Fragment,null,b.map(k=>E.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...t})),x.map(k=>E.createElement("link",{key:k,rel:"modulepreload",href:k,...t})),w.map(({key:k,link:C})=>E.createElement("link",{key:k,nonce:t.nonce,...C,crossOrigin:C.crossOrigin??t.crossOrigin})))}function iO(...i){return e=>{i.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var nO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{nO&&(window.__reactRouterVersion="7.13.1")}catch{}function sO({basename:i,children:e,unstable_useTransitions:t,window:n}){let r=E.useRef();r.current==null&&(r.current=BM({window:n,v5Compat:!0}));let a=r.current,[o,c]=E.useState({action:a.action,location:a.location}),f=E.useCallback(d=>{t===!1?c(d):E.startTransition(()=>c(d))},[t]);return E.useLayoutEffect(()=>a.listen(f),[a,f]),E.createElement(jT,{basename:i,children:e,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:t})}var AS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MS=E.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:a,replace:o,unstable_mask:c,state:f,target:d,to:m,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:x,...w},k){let{basename:C,navigator:M,unstable_useTransitions:R}=E.useContext(vi),D=typeof m=="string"&&AS.test(m),Q=dS(m,C);m=Q.to;let _=pT(m,{relative:r}),K=Vn(),U=null;if(c){let de=rh(c,[],K.unstable_mask?K.unstable_mask.pathname:"/",!0);C!=="/"&&(de.pathname=de.pathname==="/"?C:hn([C,de.pathname])),U=M.createHref(de)}let[J,Z,ce]=JT(n,w),ae=oO(m,{replace:o,unstable_mask:c,state:f,target:d,preventScrollReset:y,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:x,unstable_useTransitions:R});function P(de){e&&e(de),de.defaultPrevented||ae(de)}let ee=!(Q.isExternal||a),fe=E.createElement("a",{...w,...ce,href:(ee?U:void 0)||Q.absoluteURL||_,onClick:ee?P:e,ref:iO(k,Z),target:d,"data-discover":!D&&t==="render"?"true":void 0});return J&&!D?E.createElement(E.Fragment,null,fe,E.createElement($T,{page:_})):fe});MS.displayName="Link";var rO=E.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:a,to:o,viewTransition:c,children:f,...d},m){let y=co(o,{relative:d.relative}),b=Vn(),x=E.useContext(lh),{navigator:w,basename:k}=E.useContext(vi),C=x!=null&&dO(y)&&c===!0,M=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,R=b.pathname,D=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;t||(R=R.toLowerCase(),D=D?D.toLowerCase():null,M=M.toLowerCase()),D&&k&&(D=_n(D,k)||D);const Q=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let _=R===M||!r&&R.startsWith(M)&&R.charAt(Q)==="/",K=D!=null&&(D===M||!r&&D.startsWith(M)&&D.charAt(M.length)==="/"),U={isActive:_,isPending:K,isTransitioning:C},J=_?e:void 0,Z;typeof n=="function"?Z=n(U):Z=[n,_?"active":null,K?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let ce=typeof a=="function"?a(U):a;return E.createElement(MS,{...d,"aria-current":J,className:Z,ref:m,style:ce,to:o,viewTransition:c},typeof f=="function"?f(U):f)});rO.displayName="NavLink";var lO=E.forwardRef(({discover:i="render",fetcherKey:e,navigate:t,reloadDocument:n,replace:r,state:a,method:o=fc,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b,...x},w)=>{let{unstable_useTransitions:k}=E.useContext(vi),C=hO(),M=fO(c,{relative:d}),R=o.toLowerCase()==="get"?"get":"post",D=typeof c=="string"&&AS.test(c),Q=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let K=_.nativeEvent.submitter,U=K?.getAttribute("formmethod")||o,J=()=>C(K||_.currentTarget,{fetcherKey:e,method:U,navigate:t,replace:r,state:a,relative:d,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b});k&&t!==!1?E.startTransition(()=>J()):J()};return E.createElement("form",{ref:w,method:R,action:M,onSubmit:n?f:Q,...x,"data-discover":!D&&i==="render"?"true":void 0})});lO.displayName="Form";function aO(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TS(i){let e=E.useContext(vl);return nt(e,aO(i)),e}function oO(i,{target:e,replace:t,unstable_mask:n,state:r,preventScrollReset:a,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let m=xS(),y=Vn(),b=co(i,{relative:o});return E.useCallback(x=>{if(UT(x,e)){x.preventDefault();let w=t!==void 0?t:Va(y)===Va(b),k=()=>m(i,{replace:w,unstable_mask:n,state:r,preventScrollReset:a,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f});d?E.startTransition(()=>k()):k()}},[y,m,b,t,n,r,e,i,a,o,c,f,d])}var uO=0,cO=()=>`__${String(++uO)}__`;function hO(){let{router:i}=TS("useSubmit"),{basename:e}=E.useContext(vi),t=TT(),n=i.fetch,r=i.navigate;return E.useCallback(async(a,o={})=>{let{action:c,method:f,encType:d,formData:m,body:y}=VT(a,e);if(o.navigate===!1){let b=o.fetcherKey||cO();await n(b,t,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:y,formMethod:o.method||f,formEncType:o.encType||d,flushSync:o.flushSync})}else await r(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:y,formMethod:o.method||f,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:t,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,r,e,t])}function fO(i,{relative:e}={}){let{basename:t}=E.useContext(vi),n=E.useContext(Yi);nt(n,"useFormAction must be used inside a RouteContext");let[r]=n.matches.slice(-1),a={...co(i||".",{relative:e})},o=Vn();if(i==null){a.search=o.search;let c=new URLSearchParams(a.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(y=>y).forEach(y=>c.append("index",y));let m=c.toString();a.search=m?`?${m}`:""}}return(!i||i===".")&&r.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(a.pathname=a.pathname==="/"?t:hn([t,a.pathname])),Va(a)}function dO(i,{relative:e}={}){let t=E.useContext(mS);nt(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=TS("useViewTransitionState"),r=co(i,{relative:e});if(!t.isTransitioning)return!1;let a=_n(t.currentLocation.pathname,n)||t.currentLocation.pathname,o=_n(t.nextLocation.pathname,n)||t.nextLocation.pathname;return kc(r.pathname,o)!=null||kc(r.pathname,a)!=null}var wl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pO={setTimeout:(i,e)=>setTimeout(i,e),clearTimeout:i=>clearTimeout(i),setInterval:(i,e)=>setInterval(i,e),clearInterval:i=>clearInterval(i)},mO=class{#e=pO;#t=!1;setTimeoutProvider(i){this.#e=i}setTimeout(i,e){return this.#e.setTimeout(i,e)}clearTimeout(i){this.#e.clearTimeout(i)}setInterval(i,e){return this.#e.setInterval(i,e)}clearInterval(i){this.#e.clearInterval(i)}},tr=new mO;function gO(i){setTimeout(i,0)}var ar=typeof window>"u"||"Deno"in globalThis;function Qt(){}function yO(i,e){return typeof i=="function"?i(e):i}function Bp(i){return typeof i=="number"&&i>=0&&i!==1/0}function OS(i,e){return Math.max(i+(e||0)-Date.now(),0)}function Ss(i,e){return typeof i=="function"?i(e):i}function Ri(i,e){return typeof i=="function"?i(e):i}function $x(i,e){const{type:t="all",exact:n,fetchStatus:r,predicate:a,queryKey:o,stale:c}=i;if(o){if(n){if(e.queryHash!==Fm(o,e.options))return!1}else if(!Qa(e.queryKey,o))return!1}if(t!=="all"){const f=e.isActive();if(t==="active"&&!f||t==="inactive"&&f)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||r&&r!==e.state.fetchStatus||a&&!a(e))}function e1(i,e){const{exact:t,status:n,predicate:r,mutationKey:a}=i;if(a){if(!e.options.mutationKey)return!1;if(t){if(or(e.options.mutationKey)!==or(a))return!1}else if(!Qa(e.options.mutationKey,a))return!1}return!(n&&e.state.status!==n||r&&!r(e))}function Fm(i,e){return(e?.queryKeyHashFn||or)(i)}function or(i){return JSON.stringify(i,(e,t)=>Lp(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t)}function Qa(i,e){return i===e?!0:typeof i!=typeof e?!1:i&&e&&typeof i=="object"&&typeof e=="object"?Object.keys(e).every(t=>Qa(i[t],e[t])):!1}var bO=Object.prototype.hasOwnProperty;function ES(i,e,t=0){if(i===e)return i;if(t>500)return e;const n=t1(i)&&t1(e);if(!n&&!(Lp(i)&&Lp(e)))return e;const a=(n?i:Object.keys(i)).length,o=n?e:Object.keys(e),c=o.length,f=n?new Array(c):{};let d=0;for(let m=0;m<c;m++){const y=n?m:o[m],b=i[y],x=e[y];if(b===x){f[y]=b,(n?m<a:bO.call(i,y))&&d++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){f[y]=x;continue}const w=ES(b,x,t+1);f[y]=w,w===b&&d++}return a===c&&d===a?i:f}function Cc(i,e){if(!e||Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(i[t]!==e[t])return!1;return!0}function t1(i){return Array.isArray(i)&&i.length===Object.keys(i).length}function Lp(i){if(!i1(i))return!1;const e=i.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!i1(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(i)!==Object.prototype)}function i1(i){return Object.prototype.toString.call(i)==="[object Object]"}function xO(i){return new Promise(e=>{tr.setTimeout(e,i)})}function zp(i,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(i,e):t.structuralSharing!==!1?ES(i,e):e}function vO(i,e,t=0){const n=[...i,e];return t&&n.length>t?n.slice(1):n}function SO(i,e,t=0){const n=[e,...i];return t&&n.length>t?n.slice(0,-1):n}var Km=Symbol();function NS(i,e){return!i.queryFn&&e?.initialPromise?()=>e.initialPromise:!i.queryFn||i.queryFn===Km?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function Ym(i,e){return typeof i=="function"?i(...e):!!i}function wO(i,e,t){let n=!1,r;return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(r??=e(),n||(n=!0,r.aborted?t():r.addEventListener("abort",t,{once:!0})),r)}),i}var kO=class extends wl{#e;#t;#i;constructor(){super(),this.#i=i=>{if(!ar&&window.addEventListener){const e=()=>i();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(i){this.#i=i,this.#t?.(),this.#t=i(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(i){this.#e!==i&&(this.#e=i,this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(e=>{e(i)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Im=new kO;function Hp(){let i,e;const t=new Promise((r,a)=>{i=r,e=a});t.status="pending",t.catch(()=>{});function n(r){Object.assign(t,r),delete t.resolve,delete t.reject}return t.resolve=r=>{n({status:"fulfilled",value:r}),i(r)},t.reject=r=>{n({status:"rejected",reason:r}),e(r)},t}var CO=gO;function AO(){let i=[],e=0,t=c=>{c()},n=c=>{c()},r=CO;const a=c=>{e?i.push(c):r(()=>{t(c)})},o=()=>{const c=i;i=[],c.length&&r(()=>{n(()=>{c.forEach(f=>{t(f)})})})};return{batch:c=>{let f;e++;try{f=c()}finally{e--,e||o()}return f},batchCalls:c=>(...f)=>{a(()=>{c(...f)})},schedule:a,setNotifyFunction:c=>{t=c},setBatchNotifyFunction:c=>{n=c},setScheduler:c=>{r=c}}}var St=AO(),MO=class extends wl{#e=!0;#t;#i;constructor(){super(),this.#i=i=>{if(!ar&&window.addEventListener){const e=()=>i(!0),t=()=>i(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(i){this.#i=i,this.#t?.(),this.#t=i(this.setOnline.bind(this))}setOnline(i){this.#e!==i&&(this.#e=i,this.listeners.forEach(t=>{t(i)}))}isOnline(){return this.#e}},Ac=new MO;function TO(i){return Math.min(1e3*2**i,3e4)}function RS(i){return(i??"online")==="online"?Ac.isOnline():!0}var _p=class extends Error{constructor(i){super("CancelledError"),this.revert=i?.revert,this.silent=i?.silent}};function DS(i){let e=!1,t=0,n;const r=Hp(),a=()=>r.status!=="pending",o=k=>{if(!a()){const C=new _p(k);b(C),i.onCancel?.(C)}},c=()=>{e=!0},f=()=>{e=!1},d=()=>Im.isFocused()&&(i.networkMode==="always"||Ac.isOnline())&&i.canRun(),m=()=>RS(i.networkMode)&&i.canRun(),y=k=>{a()||(n?.(),r.resolve(k))},b=k=>{a()||(n?.(),r.reject(k))},x=()=>new Promise(k=>{n=C=>{(a()||d())&&k(C)},i.onPause?.()}).then(()=>{n=void 0,a()||i.onContinue?.()}),w=()=>{if(a())return;let k;const C=t===0?i.initialPromise:void 0;try{k=C??i.fn()}catch(M){k=Promise.reject(M)}Promise.resolve(k).then(y).catch(M=>{if(a())return;const R=i.retry??(ar?0:3),D=i.retryDelay??TO,Q=typeof D=="function"?D(t,M):D,_=R===!0||typeof R=="number"&&t<R||typeof R=="function"&&R(t,M);if(e||!_){b(M);return}t++,i.onFail?.(t,M),xO(Q).then(()=>d()?void 0:x()).then(()=>{e?b(M):w()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(n?.(),r),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():x().then(w),r)}}var jS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bp(this.gcTime)&&(this.#e=tr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(ar?1/0:300*1e3))}clearGcTimeout(){this.#e&&(tr.clearTimeout(this.#e),this.#e=void 0)}},OO=class extends jS{#e;#t;#i;#s;#n;#l;#a;constructor(i){super(),this.#a=!1,this.#l=i.defaultOptions,this.setOptions(i.options),this.observers=[],this.#s=i.client,this.#i=this.#s.getQueryCache(),this.queryKey=i.queryKey,this.queryHash=i.queryHash,this.#e=s1(this.options),this.state=i.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(i){if(this.options={...this.#l,...i},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=s1(this.options);e.data!==void 0&&(this.setState(n1(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(i,e){const t=zp(this.state.data,i,this.options);return this.#r({data:t,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),t}setState(i,e){this.#r({type:"setState",state:i,setStateOptions:e})}cancel(i){const e=this.#n?.promise;return this.#n?.cancel(i),e?e.then(Qt).catch(Qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(i=>Ri(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Km||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Ss(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!OS(this.state.dataUpdatedAt,i)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(e=>e!==i),this.observers.length||(this.#n&&(this.#a?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(i,e){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(i&&this.setOptions(i),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const t=new AbortController,n=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,t.signal)})},r=()=>{const c=NS(this.options,e),d=(()=>{const m={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(m),m})();return this.#a=!1,this.options.persister?this.options.persister(c,d,this):c(d)},o=(()=>{const c={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:r};return n(c),c})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#r({type:"fetch",meta:o.fetchOptions?.meta}),this.#n=DS({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof _p&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),t.abort()},onFail:(c,f)=>{this.#r({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#n.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#i.config.onSuccess?.(c,this),this.#i.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof _p){if(c.silent)return this.#n.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#r({type:"error",error:c}),this.#i.config.onError?.(c,this),this.#i.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#r(i){const e=t=>{switch(i.type){case"failed":return{...t,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...BS(t.data,this.options),fetchMeta:i.meta??null};case"success":const n={...t,...n1(i.data,i.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=i.manual?n:void 0,n;case"error":const r=i.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...i.state}}};this.state=e(this.state),St.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:i})})}};function BS(i,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RS(e.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function n1(i,e){return{data:i,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s1(i){const e=typeof i.initialData=="function"?i.initialData():i.initialData,t=e!==void 0,n=t?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var EO=class extends wl{constructor(i,e){super(),this.options=e,this.#e=i,this.#r=null,this.#a=Hp(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#i=void 0;#s=void 0;#n;#l;#a;#r;#m;#f;#d;#u;#c;#o;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),r1(this.#t,this.options)?this.#h():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Up(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Up(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#S(),this.#t.removeObserver(this)}setOptions(i){const e=this.options,t=this.#t;if(this.options=this.#e.defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ri(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),e._defaulted&&!Cc(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&l1(this.#t,t,this.options,e)&&this.#h(),this.updateResult(),n&&(this.#t!==t||Ri(this.options.enabled,this.#t)!==Ri(e.enabled,this.#t)||Ss(this.options.staleTime,this.#t)!==Ss(e.staleTime,this.#t))&&this.#g();const r=this.#y();n&&(this.#t!==t||Ri(this.options.enabled,this.#t)!==Ri(e.enabled,this.#t)||r!==this.#o)&&this.#b(r)}getOptimisticResult(i){const e=this.#e.getQueryCache().build(this.#e,i),t=this.createResult(e,i);return RO(this,t)&&(this.#s=t,this.#l=this.options,this.#n=this.#t.state),t}getCurrentResult(){return this.#s}trackResult(i,e){return new Proxy(i,{get:(t,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,n))})}trackProp(i){this.#p.add(i)}getCurrentQuery(){return this.#t}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const e=this.#e.defaultQueryOptions(i),t=this.#e.getQueryCache().build(this.#e,e);return t.fetch().then(()=>this.createResult(t,e))}fetch(i){return this.#h({...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(i){this.#w();let e=this.#t.fetch(this.options,i);return i?.throwOnError||(e=e.catch(Qt)),e}#g(){this.#v();const i=Ss(this.options.staleTime,this.#t);if(ar||this.#s.isStale||!Bp(i))return;const t=OS(this.#s.dataUpdatedAt,i)+1;this.#u=tr.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(i){this.#S(),this.#o=i,!(ar||Ri(this.options.enabled,this.#t)===!1||!Bp(this.#o)||this.#o===0)&&(this.#c=tr.setInterval(()=>{(this.options.refetchIntervalInBackground||Im.isFocused())&&this.#h()},this.#o))}#x(){this.#g(),this.#b(this.#y())}#v(){this.#u&&(tr.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(tr.clearInterval(this.#c),this.#c=void 0)}createResult(i,e){const t=this.#t,n=this.options,r=this.#s,a=this.#n,o=this.#l,f=i!==t?i.state:this.#i,{state:d}=i;let m={...d},y=!1,b;if(e._optimisticResults){const J=this.hasListeners(),Z=!J&&r1(i,e),ce=J&&l1(i,t,e,n);(Z||ce)&&(m={...m,...BS(d.data,i.options)}),e._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:k}=m;b=m.data;let C=!1;if(e.placeholderData!==void 0&&b===void 0&&k==="pending"){let J;r?.isPlaceholderData&&e.placeholderData===o?.placeholderData?(J=r.data,C=!0):J=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,J!==void 0&&(k="success",b=zp(r?.data,J,e),y=!0)}if(e.select&&b!==void 0&&!C)if(r&&b===a?.data&&e.select===this.#m)b=this.#f;else try{this.#m=e.select,b=e.select(b),b=zp(r?.data,b,e),this.#f=b,this.#r=null}catch(J){this.#r=J}this.#r&&(x=this.#r,b=this.#f,w=Date.now(),k="error");const M=m.fetchStatus==="fetching",R=k==="pending",D=k==="error",Q=R&&M,_=b!==void 0,U={status:k,fetchStatus:m.fetchStatus,isPending:R,isSuccess:k==="success",isError:D,isInitialLoading:Q,isLoading:Q,data:b,dataUpdatedAt:m.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:M,isRefetching:M&&!R,isLoadingError:D&&!_,isPaused:m.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:D&&_,isStale:Wm(i,e),refetch:this.refetch,promise:this.#a,isEnabled:Ri(e.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const J=U.data!==void 0,Z=U.status==="error"&&!J,ce=ee=>{Z?ee.reject(U.error):J&&ee.resolve(U.data)},ae=()=>{const ee=this.#a=U.promise=Hp();ce(ee)},P=this.#a;switch(P.status){case"pending":i.queryHash===t.queryHash&&ce(P);break;case"fulfilled":(Z||U.data!==P.value)&&ae();break;case"rejected":(!Z||U.error!==P.reason)&&ae();break}}return U}updateResult(){const i=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#l=this.options,this.#n.data!==void 0&&(this.#d=this.#t),Cc(e,i))return;this.#s=e;const t=()=>{if(!i)return!0;const{notifyOnChangeProps:n}=this.options,r=typeof n=="function"?n():n;if(r==="all"||!r&&!this.#p.size)return!0;const a=new Set(r??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(o=>{const c=o;return this.#s[c]!==i[c]&&a.has(c)})};this.#k({listeners:t()})}#w(){const i=this.#e.getQueryCache().build(this.#e,this.options);if(i===this.#t)return;const e=this.#t;this.#t=i,this.#i=i.state,this.hasListeners()&&(e?.removeObserver(this),i.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#k(i){St.batch(()=>{i.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function NO(i,e){return Ri(e.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&e.retryOnMount===!1)}function r1(i,e){return NO(i,e)||i.state.data!==void 0&&Up(i,e,e.refetchOnMount)}function Up(i,e,t){if(Ri(e.enabled,i)!==!1&&Ss(e.staleTime,i)!=="static"){const n=typeof t=="function"?t(i):t;return n==="always"||n!==!1&&Wm(i,e)}return!1}function l1(i,e,t,n){return(i!==e||Ri(n.enabled,i)===!1)&&(!t.suspense||i.state.status!=="error")&&Wm(i,t)}function Wm(i,e){return Ri(e.enabled,i)!==!1&&i.isStaleByTime(Ss(e.staleTime,i))}function RO(i,e){return!Cc(i.getCurrentResult(),e)}function a1(i){return{onFetch:(e,t)=>{const n=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let m=!1;const y=w=>{wO(w,()=>e.signal,()=>m=!0)},b=NS(e.options,e.fetchOptions),x=async(w,k,C)=>{if(m)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const R=(()=>{const K={client:e.client,queryKey:e.queryKey,pageParam:k,direction:C?"backward":"forward",meta:e.options.meta};return y(K),K})(),D=await b(R),{maxPages:Q}=e.options,_=C?SO:vO;return{pages:_(w.pages,D,Q),pageParams:_(w.pageParams,k,Q)}};if(r&&a.length){const w=r==="backward",k=w?DO:o1,C={pages:a,pageParams:o},M=k(n,C);c=await x(C,M,w)}else{const w=i??a.length;do{const k=f===0?o[0]??n.initialPageParam:o1(n,c);if(f>0&&k==null)break;c=await x(c,k),f++}while(f<w)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=d}}}function o1(i,{pages:e,pageParams:t}){const n=e.length-1;return e.length>0?i.getNextPageParam(e[n],e,t[n],t):void 0}function DO(i,{pages:e,pageParams:t}){return e.length>0?i.getPreviousPageParam?.(e[0],e,t[0],t):void 0}var jO=class extends jS{#e;#t;#i;#s;constructor(i){super(),this.#e=i.client,this.mutationId=i.mutationId,this.#i=i.mutationCache,this.#t=[],this.state=i.state||LS(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){this.#t.includes(i)||(this.#t.push(i),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){this.#t=this.#t.filter(e=>e!==i),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#i.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(i){const e=()=>{this.#n({type:"continue"})},t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=DS({fn:()=>this.options.mutationFn?this.options.mutationFn(i,t):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#n({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});const n=this.state.status==="pending",r=!this.#s.canStart();try{if(n)e();else{this.#n({type:"pending",variables:i,isPaused:r}),this.#i.config.onMutate&&await this.#i.config.onMutate(i,this,t);const o=await this.options.onMutate?.(i,t);o!==this.state.context&&this.#n({type:"pending",context:o,variables:i,isPaused:r})}const a=await this.#s.start();return await this.#i.config.onSuccess?.(a,i,this.state.context,this,t),await this.options.onSuccess?.(a,i,this.state.context,t),await this.#i.config.onSettled?.(a,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(a,null,i,this.state.context,t),this.#n({type:"success",data:a}),a}catch(a){try{await this.#i.config.onError?.(a,i,this.state.context,this,t)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,i,this.state.context,t)}catch(o){Promise.reject(o)}try{await this.#i.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,t)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,i,this.state.context,t)}catch(o){Promise.reject(o)}throw this.#n({type:"error",error:a}),a}finally{this.#i.runNext(this)}}#n(i){const e=t=>{switch(i.type){case"failed":return{...t,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...t,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:i.error,failureCount:t.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=e(this.state),St.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(i)}),this.#i.notify({mutation:this,type:"updated",action:i})})}};function LS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var BO=class extends wl{constructor(i={}){super(),this.config=i,this.#e=new Set,this.#t=new Map,this.#i=0}#e;#t;#i;build(i,e,t){const n=new jO({client:i,mutationCache:this,mutationId:++this.#i,options:i.defaultMutationOptions(e),state:t});return this.add(n),n}add(i){this.#e.add(i);const e=qu(i);if(typeof e=="string"){const t=this.#t.get(e);t?t.push(i):this.#t.set(e,[i])}this.notify({type:"added",mutation:i})}remove(i){if(this.#e.delete(i)){const e=qu(i);if(typeof e=="string"){const t=this.#t.get(e);if(t)if(t.length>1){const n=t.indexOf(i);n!==-1&&t.splice(n,1)}else t[0]===i&&this.#t.delete(e)}}this.notify({type:"removed",mutation:i})}canRun(i){const e=qu(i);if(typeof e=="string"){const n=this.#t.get(e)?.find(r=>r.state.status==="pending");return!n||n===i}else return!0}runNext(i){const e=qu(i);return typeof e=="string"?this.#t.get(e)?.find(n=>n!==i&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){St.batch(()=>{this.#e.forEach(i=>{this.notify({type:"removed",mutation:i})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(i){const e={exact:!0,...i};return this.getAll().find(t=>e1(e,t))}findAll(i={}){return this.getAll().filter(e=>e1(i,e))}notify(i){St.batch(()=>{this.listeners.forEach(e=>{e(i)})})}resumePausedMutations(){const i=this.getAll().filter(e=>e.state.isPaused);return St.batch(()=>Promise.all(i.map(e=>e.continue().catch(Qt))))}};function qu(i){return i.options.scope?.id}var LO=class extends wl{#e;#t=void 0;#i;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),Cc(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#i,observer:this}),t?.mutationKey&&this.options.mutationKey&&or(t.mutationKey)!==or(this.options.mutationKey)?this.reset():this.#i?.state.status==="pending"&&this.#i.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#i?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#l(e)}getCurrentResult(){return this.#t}reset(){this.#i?.removeObserver(this),this.#i=void 0,this.#n(),this.#l()}mutate(e,t){return this.#s=t,this.#i?.removeObserver(this),this.#i=this.#e.getMutationCache().build(this.#e,this.options),this.#i.addObserver(this),this.#i.execute(e)}#n(){const e=this.#i?.state??LS();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#l(e){St.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,n,r)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(e.data,null,t,n,r)}catch(a){Promise.reject(a)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,n,r)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,e.error,t,n,r)}catch(a){Promise.reject(a)}}}this.listeners.forEach(t=>{t(this.#t)})})}},zO=class extends wl{constructor(i={}){super(),this.config=i,this.#e=new Map}#e;build(i,e,t){const n=e.queryKey,r=e.queryHash??Fm(n,e);let a=this.get(r);return a||(a=new OO({client:i,queryKey:n,queryHash:r,options:i.defaultQueryOptions(e),state:t,defaultOptions:i.getQueryDefaults(n)}),this.add(a)),a}add(i){this.#e.has(i.queryHash)||(this.#e.set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const e=this.#e.get(i.queryHash);e&&(i.destroy(),e===i&&this.#e.delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){St.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return this.#e.get(i)}getAll(){return[...this.#e.values()]}find(i){const e={exact:!0,...i};return this.getAll().find(t=>$x(e,t))}findAll(i={}){const e=this.getAll();return Object.keys(i).length>0?e.filter(t=>$x(i,t)):e}notify(i){St.batch(()=>{this.listeners.forEach(e=>{e(i)})})}onFocus(){St.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){St.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},HO=class{#e;#t;#i;#s;#n;#l;#a;#r;constructor(i={}){this.#e=i.queryCache||new zO,this.#t=i.mutationCache||new BO,this.#i=i.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#a=Im.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#r=Ac.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#a?.(),this.#a=void 0,this.#r?.(),this.#r=void 0)}isFetching(i){return this.#e.findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return this.#t.findAll({...i,status:"pending"}).length}getQueryData(i){const e=this.defaultQueryOptions({queryKey:i});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(i){const e=this.defaultQueryOptions(i),t=this.#e.build(this,e),n=t.state.data;return n===void 0?this.fetchQuery(i):(i.revalidateIfStale&&t.isStaleByTime(Ss(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(i){return this.#e.findAll(i).map(({queryKey:e,state:t})=>{const n=t.data;return[e,n]})}setQueryData(i,e,t){const n=this.defaultQueryOptions({queryKey:i}),a=this.#e.get(n.queryHash)?.state.data,o=yO(e,a);if(o!==void 0)return this.#e.build(this,n).setData(o,{...t,manual:!0})}setQueriesData(i,e,t){return St.batch(()=>this.#e.findAll(i).map(({queryKey:n})=>[n,this.setQueryData(n,e,t)]))}getQueryState(i){const e=this.defaultQueryOptions({queryKey:i});return this.#e.get(e.queryHash)?.state}removeQueries(i){const e=this.#e;St.batch(()=>{e.findAll(i).forEach(t=>{e.remove(t)})})}resetQueries(i,e){const t=this.#e;return St.batch(()=>(t.findAll(i).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...i},e)))}cancelQueries(i,e={}){const t={revert:!0,...e},n=St.batch(()=>this.#e.findAll(i).map(r=>r.cancel(t)));return Promise.all(n).then(Qt).catch(Qt)}invalidateQueries(i,e={}){return St.batch(()=>(this.#e.findAll(i).forEach(t=>{t.invalidate()}),i?.refetchType==="none"?Promise.resolve():this.refetchQueries({...i,type:i?.refetchType??i?.type??"active"},e)))}refetchQueries(i,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},n=St.batch(()=>this.#e.findAll(i).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let a=r.fetch(void 0,t);return t.throwOnError||(a=a.catch(Qt)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Qt)}fetchQuery(i){const e=this.defaultQueryOptions(i);e.retry===void 0&&(e.retry=!1);const t=this.#e.build(this,e);return t.isStaleByTime(Ss(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(Qt).catch(Qt)}fetchInfiniteQuery(i){return i.behavior=a1(i.pages),this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(Qt).catch(Qt)}ensureInfiniteQueryData(i){return i.behavior=a1(i.pages),this.ensureQueryData(i)}resumePausedMutations(){return Ac.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#i}setDefaultOptions(i){this.#i=i}setQueryDefaults(i,e){this.#s.set(or(i),{queryKey:i,defaultOptions:e})}getQueryDefaults(i){const e=[...this.#s.values()],t={};return e.forEach(n=>{Qa(i,n.queryKey)&&Object.assign(t,n.defaultOptions)}),t}setMutationDefaults(i,e){this.#n.set(or(i),{mutationKey:i,defaultOptions:e})}getMutationDefaults(i){const e=[...this.#n.values()],t={};return e.forEach(n=>{Qa(i,n.mutationKey)&&Object.assign(t,n.defaultOptions)}),t}defaultQueryOptions(i){if(i._defaulted)return i;const e={...this.#i.queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return e.queryHash||(e.queryHash=Fm(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Km&&(e.enabled=!1),e}defaultMutationOptions(i){return i?._defaulted?i:{...this.#i.mutations,...i?.mutationKey&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},zS=E.createContext(void 0),dt=i=>{const e=E.useContext(zS);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},_O=({client:i,children:e})=>(E.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),S.jsx(zS.Provider,{value:i,children:e})),HS=E.createContext(!1),UO=()=>E.useContext(HS);HS.Provider;function qO(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}var PO=E.createContext(qO()),VO=()=>E.useContext(PO),QO=(i,e,t)=>{const n=t?.state.error&&typeof i.throwOnError=="function"?Ym(i.throwOnError,[t.state.error,t]):i.throwOnError;(i.suspense||i.experimental_prefetchInRender||n)&&(e.isReset()||(i.retryOnMount=!1))},GO=i=>{E.useEffect(()=>{i.clearReset()},[i])},FO=({result:i,errorResetBoundary:e,throwOnError:t,query:n,suspense:r})=>i.isError&&!e.isReset()&&!i.isFetching&&n&&(r&&i.data===void 0||Ym(t,[i.error,n])),KO=i=>{if(i.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=i.staleTime;i.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof i.gcTime=="number"&&(i.gcTime=Math.max(i.gcTime,1e3))}},YO=(i,e)=>i.isLoading&&i.isFetching&&!e,IO=(i,e)=>i?.suspense&&e.isPending,u1=(i,e,t)=>e.fetchOptimistic(i).catch(()=>{t.clearReset()});function WO(i,e,t){const n=UO(),r=VO(),a=dt(),o=a.defaultQueryOptions(i);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=a.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",KO(o),QO(o,r,c),GO(r);const f=!a.getQueryCache().get(o.queryHash),[d]=E.useState(()=>new e(a,o)),m=d.getOptimisticResult(o),y=!n&&i.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(b=>{const x=y?d.subscribe(St.batchCalls(b)):Qt;return d.updateResult(),x},[d,y]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),E.useEffect(()=>{d.setOptions(o)},[o,d]),IO(o,m))throw u1(o,d,r);if(FO({result:m,errorResetBoundary:r,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw m.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,m),o.experimental_prefetchInRender&&!ar&&YO(m,n)&&(f?u1(o,d,r):c?.promise)?.catch(Qt).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?m:d.trackResult(m)}function ks(i,e){return WO(i,EO)}function Tt(i,e){const t=dt(),[n]=E.useState(()=>new LO(t,i));E.useEffect(()=>{n.setOptions(i)},[n,i]);const r=E.useSyncExternalStore(E.useCallback(o=>n.subscribe(St.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=E.useCallback((o,c)=>{n.mutate(o,c).catch(Qt)},[n]);if(r.error&&Ym(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}const XO="/api";async function qe(i,e){const t=await fetch(`${XO}${i}`,{headers:{"Content-Type":"application/json",...e?.headers},...e}),n=await t.json();if(!t.ok)throw new Error(n.error??`Request failed: ${t.status}`);return n.data}const Pe={health:()=>qe("/health"),projects:{list:()=>qe("/projects"),create:i=>qe("/projects",{method:"POST",body:JSON.stringify({name:i})}),getActive:()=>qe("/projects/active"),switchActive:i=>qe("/projects/active",{method:"PUT",body:JSON.stringify({projectId:i})}),rename:(i,e)=>qe(`/projects/${i}`,{method:"PUT",body:JSON.stringify({name:e})}),delete:i=>qe(`/projects/${i}`,{method:"DELETE"})},specs:{list:()=>qe("/specs"),upload:(i,e,t)=>qe("/specs",{method:"POST",body:JSON.stringify({spec:i,name:e,upstreamUrl:t})}),uploadFromUrl:(i,e)=>qe("/specs/url",{method:"POST",body:JSON.stringify({url:i,name:e})}),update:(i,e)=>qe(`/specs/${i}`,{method:"PUT",body:JSON.stringify(e)}),toggle:i=>qe(`/specs/${i}/toggle`,{method:"PUT"}),delete:i=>qe(`/specs/${i}`,{method:"DELETE"}),reimport:(i,e)=>qe(`/specs/${i}/reimport`,{method:"POST",body:e?JSON.stringify({spec:e}):"{}"})},endpoints:{list:()=>qe("/endpoints"),update:(i,e)=>qe(`/endpoints/${encodeURIComponent(i)}`,{method:"PUT",body:JSON.stringify(e)}),bulkUpdate:i=>qe("/endpoints/bulk",{method:"PUT",body:JSON.stringify(i)})},config:{get:()=>qe("/config"),update:i=>qe("/config",{method:"PUT",body:JSON.stringify(i)}),export:()=>qe("/config/export"),import:i=>qe("/config/import",{method:"POST",body:JSON.stringify(i)})},logs:{get:(i=100)=>qe(`/logs?limit=${i}`),clear:()=>qe("/logs",{method:"DELETE"})},proxy:{status:()=>qe("/proxy/status"),start:()=>qe("/proxy/start",{method:"POST"}),stop:()=>qe("/proxy/stop",{method:"POST"})},presets:{list:()=>qe("/presets"),create:i=>qe("/presets",{method:"POST",body:JSON.stringify(i)}),delete:i=>qe(`/presets/${encodeURIComponent(i)}`,{method:"DELETE"}),apply:i=>qe(`/presets/${encodeURIComponent(i)}/apply`,{method:"POST"})}};function ZO(){return ks({queryKey:["proxyStatus"],queryFn:Pe.proxy.status,refetchInterval:5e3})}function JO(){const i=dt();return Tt({mutationFn:Pe.proxy.start,onSuccess:()=>{i.invalidateQueries({queryKey:["proxyStatus"]})}})}function $O(){const i=dt();return Tt({mutationFn:Pe.proxy.stop,onSuccess:()=>{i.invalidateQueries({queryKey:["proxyStatus"]})}})}const e3=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_S=(...i)=>i.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();var t3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const i3=E.forwardRef(({color:i="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:r="",children:a,iconNode:o,...c},f)=>E.createElement("svg",{ref:f,...t3,width:e,height:e,stroke:i,strokeWidth:n?Number(t)*24/Number(e):t,className:_S("lucide",r),...c},[...o.map(([d,m])=>E.createElement(d,m)),...Array.isArray(a)?a:[a]]));const Ae=(i,e)=>{const t=E.forwardRef(({className:n,...r},a)=>E.createElement(i3,{ref:a,iconNode:e,className:_S(`lucide-${e3(i)}`,n),...r}));return t.displayName=`${i}`,t};const qp=Ae("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const Pp=Ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Mc=Ae("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Tc=Ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const ho=Ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const US=Ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const fl=Ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const n3=Ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const s3=Ae("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const Vp=Ae("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const r3=Ae("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);const l3=Ae("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);const a3=Ae("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const o3=Ae("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const qS=Ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Oc=Ae("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const PS=Ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Ec=Ae("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const u3=Ae("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);const c3=Ae("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const Nc=Ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const h3=Ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);const f3=Ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const VS=Ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const d3=Ae("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);const p3=Ae("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);const m3=Ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const g3=Ae("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const y3=Ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const b3=Ae("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const x3=Ae("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);const v3=Ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const QS=Ae("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const S3=Ae("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);const Ga=Ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const w3=Ae("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const GS=Ae("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const k3=Ae("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const C3=Ae("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const Fa=Ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Xm=Ae("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function FS(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=FS(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function A3(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=FS(i))&&(n&&(n+=" "),n+=e);return n}const Zm="-",M3=i=>{const e=O3(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=i;return{getClassGroupId:o=>{const c=o.split(Zm);return c[0]===""&&c.length!==1&&c.shift(),KS(c,e)||T3(o)},getConflictingClassGroupIds:(o,c)=>{const f=t[o]||[];return c&&n[o]?[...f,...n[o]]:f}}},KS=(i,e)=>{if(i.length===0)return e.classGroupId;const t=i[0],n=e.nextPart.get(t),r=n?KS(i.slice(1),n):void 0;if(r)return r;if(e.validators.length===0)return;const a=i.join(Zm);return e.validators.find(({validator:o})=>o(a))?.classGroupId},c1=/^\[(.+)\]$/,T3=i=>{if(c1.test(i)){const e=c1.exec(i)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},O3=i=>{const{theme:e,prefix:t}=i,n={nextPart:new Map,validators:[]};return N3(Object.entries(i.classGroups),t).forEach(([a,o])=>{Qp(o,n,a,e)}),n},Qp=(i,e,t,n)=>{i.forEach(r=>{if(typeof r=="string"){const a=r===""?e:h1(e,r);a.classGroupId=t;return}if(typeof r=="function"){if(E3(r)){Qp(r(n),e,t,n);return}e.validators.push({validator:r,classGroupId:t});return}Object.entries(r).forEach(([a,o])=>{Qp(o,h1(e,a),t,n)})})},h1=(i,e)=>{let t=i;return e.split(Zm).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},E3=i=>i.isThemeGetter,N3=(i,e)=>e?i.map(([t,n])=>{const r=n.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,c])=>[e+o,c])):a);return[t,r]}):i,R3=i=>{if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const r=(a,o)=>{t.set(a,o),e++,e>i&&(e=0,n=t,t=new Map)};return{get(a){let o=t.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return r(a,o),o},set(a,o){t.has(a)?t.set(a,o):r(a,o)}}},YS="!",D3=i=>{const{separator:e,experimentalParseClassName:t}=i,n=e.length===1,r=e[0],a=e.length,o=c=>{const f=[];let d=0,m=0,y;for(let C=0;C<c.length;C++){let M=c[C];if(d===0){if(M===r&&(n||c.slice(C,C+a)===e)){f.push(c.slice(m,C)),m=C+a;continue}if(M==="/"){y=C;continue}}M==="["?d++:M==="]"&&d--}const b=f.length===0?c:c.substring(m),x=b.startsWith(YS),w=x?b.substring(1):b,k=y&&y>m?y-m:void 0;return{modifiers:f,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:k}};return t?c=>t({className:c,parseClassName:o}):o},j3=i=>{if(i.length<=1)return i;const e=[];let t=[];return i.forEach(n=>{n[0]==="["?(e.push(...t.sort(),n),t=[]):t.push(n)}),e.push(...t.sort()),e},B3=i=>({cache:R3(i.cacheSize),parseClassName:D3(i),...M3(i)}),L3=/\s+/,z3=(i,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:r}=e,a=[],o=i.trim().split(L3);let c="";for(let f=o.length-1;f>=0;f-=1){const d=o[f],{modifiers:m,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:x}=t(d);let w=!!x,k=n(w?b.substring(0,x):b);if(!k){if(!w){c=d+(c.length>0?" "+c:c);continue}if(k=n(b),!k){c=d+(c.length>0?" "+c:c);continue}w=!1}const C=j3(m).join(":"),M=y?C+YS:C,R=M+k;if(a.includes(R))continue;a.push(R);const D=r(k,w);for(let Q=0;Q<D.length;++Q){const _=D[Q];a.push(M+_)}c=d+(c.length>0?" "+c:c)}return c};function H3(){let i=0,e,t,n="";for(;i<arguments.length;)(e=arguments[i++])&&(t=IS(e))&&(n&&(n+=" "),n+=t);return n}const IS=i=>{if(typeof i=="string")return i;let e,t="";for(let n=0;n<i.length;n++)i[n]&&(e=IS(i[n]))&&(t&&(t+=" "),t+=e);return t};function _3(i,...e){let t,n,r,a=o;function o(f){const d=e.reduce((m,y)=>y(m),i());return t=B3(d),n=t.cache.get,r=t.cache.set,a=c,c(f)}function c(f){const d=n(f);if(d)return d;const m=z3(f,t);return r(f,m),m}return function(){return a(H3.apply(null,arguments))}}const et=i=>{const e=t=>t[i]||[];return e.isThemeGetter=!0,e},WS=/^\[(?:([a-z-]+):)?(.+)\]$/i,U3=/^\d+\/\d+$/,q3=new Set(["px","full","screen"]),P3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Q3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,G3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bn=i=>sl(i)||q3.has(i)||U3.test(i),ps=i=>kl(i,"length",$3),sl=i=>!!i&&!Number.isNaN(Number(i)),Jd=i=>kl(i,"number",sl),ka=i=>!!i&&Number.isInteger(Number(i)),K3=i=>i.endsWith("%")&&sl(i.slice(0,-1)),Ce=i=>WS.test(i),ms=i=>P3.test(i),Y3=new Set(["length","size","percentage"]),I3=i=>kl(i,Y3,XS),W3=i=>kl(i,"position",XS),X3=new Set(["image","url"]),Z3=i=>kl(i,X3,tE),J3=i=>kl(i,"",eE),Ca=()=>!0,kl=(i,e,t)=>{const n=WS.exec(i);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):t(n[2]):!1},$3=i=>V3.test(i)&&!Q3.test(i),XS=()=>!1,eE=i=>G3.test(i),tE=i=>F3.test(i),iE=()=>{const i=et("colors"),e=et("spacing"),t=et("blur"),n=et("brightness"),r=et("borderColor"),a=et("borderRadius"),o=et("borderSpacing"),c=et("borderWidth"),f=et("contrast"),d=et("grayscale"),m=et("hueRotate"),y=et("invert"),b=et("gap"),x=et("gradientColorStops"),w=et("gradientColorStopPositions"),k=et("inset"),C=et("margin"),M=et("opacity"),R=et("padding"),D=et("saturate"),Q=et("scale"),_=et("sepia"),K=et("skew"),U=et("space"),J=et("translate"),Z=()=>["auto","contain","none"],ce=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto",Ce,e],P=()=>[Ce,e],ee=()=>["",Bn,ps],fe=()=>["auto",sl,Ce],de=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>["start","end","center","between","around","evenly","stretch"],ue=()=>["","0",Ce],ge=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[sl,Ce];return{cacheSize:500,separator:":",theme:{colors:[Ca],spacing:[Bn,ps],blur:["none","",ms,Ce],brightness:O(),borderColor:[i],borderRadius:["none","","full",ms,Ce],borderSpacing:P(),borderWidth:ee(),contrast:O(),grayscale:ue(),hueRotate:O(),invert:ue(),gap:P(),gradientColorStops:[i],gradientColorStopPositions:[K3,ps],inset:ae(),margin:ae(),opacity:O(),padding:P(),saturate:O(),scale:O(),sepia:ue(),skew:O(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Ce]}],container:["container"],columns:[{columns:[ms]}],"break-after":[{"break-after":ge()}],"break-before":[{"break-before":ge()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...de(),Ce]}],overflow:[{overflow:ce()}],"overflow-x":[{"overflow-x":ce()}],"overflow-y":[{"overflow-y":ce()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ka,Ce]}],basis:[{basis:ae()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ce]}],grow:[{grow:ue()}],shrink:[{shrink:ue()}],order:[{order:["first","last","none",ka,Ce]}],"grid-cols":[{"grid-cols":[Ca]}],"col-start-end":[{col:["auto",{span:["full",ka,Ce]},Ce]}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":[Ca]}],"row-start-end":[{row:["auto",{span:[ka,Ce]},Ce]}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ce]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ce]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[U]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[U]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ce,e]}],"min-w":[{"min-w":[Ce,e,"min","max","fit"]}],"max-w":[{"max-w":[Ce,e,"none","full","min","max","fit","prose",{screen:[ms]},ms]}],h:[{h:[Ce,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ce,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ce,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ce,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ms,ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jd]}],"font-family":[{font:[Ca]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ce]}],"line-clamp":[{"line-clamp":["none",sl,Jd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bn,Ce]}],"list-image":[{"list-image":["none",Ce]}],"list-style-type":[{list:["none","disc","decimal",Ce]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[M]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bn,ps]}],"underline-offset":[{"underline-offset":["auto",Bn,Ce]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[M]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...de(),W3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",I3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Z3]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[M]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[M]}],"divide-style":[{divide:H()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Bn,Ce]}],"outline-w":[{outline:[Bn,ps]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[M]}],"ring-offset-w":[{"ring-offset":[Bn,ps]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",ms,J3]}],"shadow-color":[{shadow:[Ca]}],opacity:[{opacity:[M]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",ms,Ce]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[y]}],saturate:[{saturate:[D]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[M]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ce]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",Ce]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ce]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Q]}],"scale-x":[{"scale-x":[Q]}],"scale-y":[{"scale-y":[Q]}],rotate:[{rotate:[ka,Ce]}],"translate-x":[{"translate-x":[J]}],"translate-y":[{"translate-y":[J]}],"skew-x":[{"skew-x":[K]}],"skew-y":[{"skew-y":[K]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ce]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ce]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ce]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[Bn,ps,Jd]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},nE=_3(iE);function Be(...i){return nE(A3(i))}function sE(){return ks({queryKey:["projects"],queryFn:Pe.projects.list})}function ZS(){return ks({queryKey:["activeProject"],queryFn:Pe.projects.getActive,retry:!1})}function rE(){const i=dt();return Tt({mutationFn:e=>Pe.projects.create(e),onSuccess:()=>{i.invalidateQueries({queryKey:["projects"]})}})}function lE(){const i=dt();return Tt({mutationFn:e=>Pe.projects.switchActive(e),onSuccess:()=>{i.invalidateQueries()}})}function aE(){const i=dt();return Tt({mutationFn:({id:e,name:t})=>Pe.projects.rename(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:["projects"]}),i.invalidateQueries({queryKey:["activeProject"]})}})}function oE(){const i=dt();return Tt({mutationFn:e=>Pe.projects.delete(e),onSuccess:()=>{i.invalidateQueries({queryKey:["projects"]})}})}function uE(){const{data:i}=sE(),{data:e}=ZS(),t=rE(),n=lE(),r=oE(),[a,o]=E.useState(!1),[c,f]=E.useState(!1),[d,m]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{function x(w){y.current&&!y.current.contains(w.target)&&(o(!1),f(!1))}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const b=()=>{d.trim()&&t.mutate(d.trim(),{onSuccess:()=>{m(""),f(!1)}})};return S.jsxs("div",{className:"relative",ref:y,children:[S.jsxs("button",{onClick:()=>o(!a),className:Be("flex items-center gap-2 px-3 py-1.5 text-sm rounded-lg transition-all border shrink-0",a?"bg-accent border-primary/20":"bg-muted/30 border-border/40 hover:bg-accent/40 hover:border-border/60"),children:[S.jsx(u3,{className:"w-3.5 h-3.5 text-primary opacity-70"}),S.jsx("span",{className:"font-bold truncate max-w-[120px]",children:e?.name??"Select Project"}),S.jsx(ho,{className:Be("w-3 h-3 text-muted-foreground transition-transform",a&&"rotate-180")})]}),a&&S.jsxs("div",{className:"absolute left-0 top-full mt-2 z-50 bg-popover border border-border shadow-2xl rounded-xl py-1.5 min-w-[200px] animate-in fade-in zoom-in-95 duration-200",children:[S.jsx("div",{className:"px-3 py-1 mb-1 border-b border-border/40",children:S.jsx("span",{className:"text-[9px] font-black text-muted-foreground/60 uppercase tracking-widest",children:"Switch Project"})}),S.jsx("div",{className:"max-h-60 overflow-y-auto px-1.5",children:i?.map(x=>S.jsxs("div",{className:Be("group flex items-center gap-2 px-3 py-2 text-sm rounded-lg cursor-pointer transition-all",x.id===e?.id?"bg-primary/10 text-primary font-bold shadow-sm":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[S.jsxs("button",{className:"flex-1 text-left truncate flex items-center gap-2",onClick:()=>{n.mutate(x.id),o(!1)},children:[S.jsx(o3,{className:"w-3.5 h-3.5 opacity-40"}),x.name]}),x.id!==e?.id&&S.jsx("button",{onClick:w=>{w.stopPropagation(),r.mutate(x.id)},className:"p-1 text-muted-foreground hover:text-destructive rounded-md transition-all opacity-0 group-hover:opacity-100",children:S.jsx(Ga,{className:"w-3 h-3"})})]},x.id))}),S.jsx("div",{className:"border-t border-border mt-1.5 pt-1.5 px-1.5",children:c?S.jsxs("div",{className:"px-1 py-1 flex gap-1.5",children:[S.jsx("input",{autoFocus:!0,type:"text",placeholder:"Name...",value:d,onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Enter"&&b(),x.key==="Escape"&&f(!1)},className:"flex-1 px-2.5 py-1.5 text-xs rounded-lg border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary shadow-inner"}),S.jsx("button",{onClick:b,disabled:!d.trim(),className:"px-3 py-1.5 text-xs font-bold rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 shadow-sm",children:"Add"})]}):S.jsxs("button",{onClick:()=>f(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-primary hover:bg-primary/5 rounded-lg transition-all font-bold",children:[S.jsx(VS,{className:"w-3.5 h-3.5"}),"New Project"]})})]})]})}function JS(){return ks({queryKey:["specs"],queryFn:Pe.specs.list})}function cE(){const i=dt();return Tt({mutationFn:({spec:e,name:t,upstreamUrl:n})=>Pe.specs.upload(e,t,n),onSuccess:()=>{i.invalidateQueries({queryKey:["specs"]}),i.invalidateQueries({queryKey:["endpoints"]})}})}function hE(){const i=dt();return Tt({mutationFn:({url:e,name:t})=>Pe.specs.uploadFromUrl(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:["specs"]}),i.invalidateQueries({queryKey:["endpoints"]})}})}function fE(){const i=dt();return Tt({mutationFn:({specId:e,data:t})=>Pe.specs.update(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:["specs"]}),i.invalidateQueries({queryKey:["endpoints"]})}})}function dE(){const i=dt();return Tt({mutationFn:e=>Pe.specs.toggle(e),onSuccess:()=>{i.invalidateQueries({queryKey:["specs"]}),i.invalidateQueries({queryKey:["endpoints"]})}})}function pE(){const i=dt();return Tt({mutationFn:({specId:e,spec:t})=>Pe.specs.reimport(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:["specs"]}),i.invalidateQueries({queryKey:["endpoints"]})}})}function mE(){const i=dt();return Tt({mutationFn:e=>Pe.specs.delete(e),onSuccess:()=>{i.invalidateQueries({queryKey:["specs"]}),i.invalidateQueries({queryKey:["endpoints"]})}})}function gE(){const{data:i}=JS(),e=dE(),t=mE(),n=cE(),r=hE(),a=fE(),o=pE(),[c,f]=E.useState(!1),[d,m]=E.useState(!1),[y,b]=E.useState(null),[x,w]=E.useState("url"),[k,C]=E.useState(""),[M,R]=E.useState(""),[D,Q]=E.useState(""),_=E.useRef(null);E.useEffect(()=>{function P(ee){_.current&&!_.current.contains(ee.target)&&(f(!1),m(!1),b(null))}return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);const K=E.useCallback(async P=>{if(!k.trim())return alert("Enter a spec name");try{const ee=await P.text();n.mutate({spec:JSON.parse(ee),name:k.trim()},{onSuccess:()=>{C(""),m(!1),f(!1)}})}catch{alert("Invalid JSON")}},[n,k]),U=()=>{!M.trim()||!k.trim()||r.mutate({url:M.trim(),name:k.trim()},{onSuccess:()=>{R(""),C(""),m(!1),f(!1)}})},J=P=>{if(P.metadata.sourceUrl)o.mutate({specId:P.id});else{const ee=document.createElement("input");ee.type="file",ee.accept=".json,.yaml,.yml",ee.onchange=async fe=>{const de=fe.target.files?.[0];if(de)try{const H=await de.text();o.mutate({specId:P.id,spec:JSON.parse(H)})}catch{alert("Invalid file")}},ee.click()}},Z=P=>{a.mutate({specId:P,data:{upstreamUrl:D.trim()}},{onSuccess:()=>b(null)})},ce=i?.filter(P=>P.active)??[],ae=ce.length===1?ce[0].name:ce.length>1?`${ce.length} Specs`:"Select Spec";return S.jsxs("div",{className:"relative",ref:_,children:[S.jsxs("button",{onClick:()=>f(!c),className:Be("flex items-center gap-2 px-3 py-1.5 text-sm rounded-lg transition-all border shrink-0",c?"bg-accent border-primary/20":"bg-muted/30 border-border/40 hover:bg-accent/40 hover:border-border/60"),children:[S.jsx(Mc,{className:"w-3.5 h-3.5 text-mode-mock opacity-70"}),S.jsx("span",{className:"font-bold truncate max-w-[150px]",children:ae}),S.jsx(ho,{className:Be("w-3 h-3 text-muted-foreground transition-transform",c&&"rotate-180")})]}),c&&S.jsxs("div",{className:"absolute left-0 top-full mt-2 z-50 bg-popover border border-border shadow-2xl rounded-xl py-1.5 min-w-[340px] animate-in fade-in zoom-in-95 duration-200",children:[S.jsxs("div",{className:"px-3 py-1 mb-1 border-b border-border/40 flex items-center justify-between",children:[S.jsx("span",{className:"text-[9px] font-black text-muted-foreground/60 uppercase tracking-widest",children:"API Specifications"}),S.jsx("button",{onClick:()=>{m(!d),b(null),C(""),R("")},className:"p-1 hover:bg-primary/10 text-primary rounded-md transition-all",children:d?S.jsx(Fa,{className:"w-3.5 h-3.5"}):S.jsx(VS,{className:"w-3.5 h-3.5"})})]}),S.jsx("div",{className:"max-h-[450px] overflow-y-auto px-1.5 py-1 ",children:d?S.jsxs("div",{className:"p-3 space-y-4 animate-in slide-in-from-top-2 duration-200",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-widest px-1",children:"Spec Identifier"}),S.jsx("input",{autoFocus:!0,type:"text",placeholder:"e.g. staging-api",value:k,onChange:P=>C(P.target.value),className:"w-full px-3 py-2 text-xs font-bold rounded-lg border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary shadow-inner"})]}),S.jsxs("div",{className:"flex p-0.5 bg-muted rounded-lg border border-border/40",children:[S.jsxs("button",{onClick:()=>w("url"),className:Be("flex-1 flex items-center justify-center gap-1.5 py-1 text-[9px] font-black uppercase tracking-wider rounded-md transition-all",x==="url"?"bg-background shadow-sm text-primary":"text-muted-foreground"),children:[S.jsx(qS,{className:"w-3 h-3"})," URL"]}),S.jsxs("button",{onClick:()=>w("file"),className:Be("flex-1 flex items-center justify-center gap-1.5 py-1 text-[9px] font-black uppercase tracking-wider rounded-md transition-all",x==="file"?"bg-background shadow-sm text-primary":"text-muted-foreground"),children:[S.jsx(GS,{className:"w-3 h-3"})," File"]})]}),x==="url"?S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"relative group",children:[S.jsx(c3,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground/40 group-focus-within:text-primary transition-colors"}),S.jsx("input",{type:"url",placeholder:"https://api.example.com/spec.json",value:M,onChange:P=>R(P.target.value),className:"w-full pl-9 pr-3 py-2 text-xs font-mono font-bold rounded-lg border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary shadow-inner"})]}),S.jsxs("button",{onClick:U,disabled:!M.trim()||!k.trim()||r.isPending,className:"w-full py-2 bg-primary text-primary-foreground text-[10px] font-black uppercase tracking-widest rounded-lg hover:bg-primary/90 transition-all flex items-center justify-center gap-2",children:[r.isPending?S.jsx(Nc,{className:"w-3.5 h-3.5 animate-spin"}):S.jsx(Tc,{className:"w-3.5 h-3.5"}),"Import from URL"]})]}):S.jsxs("label",{className:"flex flex-col items-center justify-center p-8 border-2 border-dashed border-border/60 rounded-xl hover:border-primary/40 hover:bg-primary/5 transition-all cursor-pointer group",children:[S.jsx(l3,{className:"w-8 h-8 text-muted-foreground/40 group-hover:text-primary transition-colors mb-2"}),S.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground group-hover:text-primary",children:"Click to select file"}),S.jsx("input",{type:"file",accept:".json,.yaml,.yml",className:"hidden",onChange:P=>{const ee=P.target.files?.[0];ee&&K(ee)}})]})]}):S.jsxs("div",{className:"space-y-1",children:[i?.length===0&&S.jsxs("div",{className:"py-10 text-center px-6 space-y-2",children:[S.jsx(Mc,{className:"w-8 h-8 mx-auto text-muted-foreground opacity-20"}),S.jsx("p",{className:"text-[11px] font-bold text-muted-foreground/60 leading-tight",children:"No specifications yet. Import one to start intercepting."})]}),i?.map(P=>S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:Be("group flex items-center gap-3 px-3 py-2.5 text-sm rounded-lg transition-all border border-transparent cursor-pointer relative overflow-hidden",P.active?"bg-primary/10 border-primary/20 shadow-sm ring-1 ring-primary/5":"text-muted-foreground/60 hover:bg-accent/40"),onClick:()=>e.mutate(P.id),children:[S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:Be("font-black truncate text-xs uppercase tracking-tight",P.active?"text-foreground":"text-muted-foreground"),children:P.name}),P.active&&S.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary shadow-[0_0_8px_rgba(var(--color-primary),0.5)]"})]}),S.jsxs("p",{className:"text-[10px] font-bold opacity-40 truncate leading-none mt-1",children:[P.metadata.title," (v",P.metadata.version,")"]})]}),S.jsxs("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[S.jsx("button",{onClick:ee=>{ee.stopPropagation(),b(y===P.id?null:P.id),Q(P.upstreamUrl)},className:"p-1.5 text-muted-foreground hover:text-primary rounded-md hover:bg-primary/10 transition-all",title:"Configure",children:S.jsx(x3,{className:"w-3.5 h-3.5"})}),S.jsx("button",{onClick:ee=>{ee.stopPropagation(),confirm(`Delete spec "${P.name}"?`)&&t.mutate(P.id)},className:"p-1.5 text-muted-foreground hover:text-destructive rounded-md hover:bg-destructive/10 transition-all",title:"Delete",children:S.jsx(Ga,{className:"w-3.5 h-3.5"})})]})]}),y===P.id&&S.jsxs("div",{className:"mx-2 p-3 rounded-xl bg-muted/40 border border-border/40 space-y-3 animate-in slide-in-from-top-2 duration-200 shadow-inner",children:[S.jsxs("div",{className:"space-y-1.5",children:[S.jsx("label",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-widest px-1",children:"Upstream URL"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("input",{autoFocus:!0,type:"url",value:D,onChange:ee=>Q(ee.target.value),className:"flex-1 px-3 py-1.5 text-[11px] font-mono font-bold rounded-lg border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary shadow-inner"}),S.jsx("button",{onClick:()=>Z(P.id),className:"p-1.5 bg-primary/10 text-primary rounded-lg hover:bg-primary hover:text-primary-foreground transition-all",children:S.jsx(Tc,{className:"w-4 h-4"})})]})]}),S.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[S.jsxs("button",{onClick:()=>J(P),disabled:o.isPending,className:"flex-1 flex items-center justify-center gap-2 py-1.5 bg-muted border border-border/60 text-[9px] font-black uppercase tracking-widest rounded-lg hover:bg-accent transition-all",children:[o.isPending?S.jsx(Nc,{className:"w-3 h-3 animate-spin"}):S.jsx(m3,{className:"w-3 h-3"}),"Reimport"]}),S.jsx("button",{onClick:()=>b(null),className:"px-3 py-1.5 text-[9px] font-black uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]})]})]},P.id))]})}),S.jsx("div",{className:"border-t border-border mt-1.5 pt-2 px-3 pb-1",children:S.jsxs("div",{className:"flex items-center justify-between text-[9px] font-black text-muted-foreground/40 uppercase tracking-[0.2em]",children:[S.jsxs("span",{children:["Total: ",i?.length??0]}),S.jsxs("span",{className:"text-primary/60",children:[ce.length," Active"]})]})})]})]})}const $S=E.createContext(void 0);function yE(){const i=E.useContext($S);if(!i)throw new Error("useTheme must be used within a ThemeProvider");return i}const e2="/assets/logo-full-DJtzE5xc.png",bE="#181717",xE=E.forwardRef(function({title:e="GitHub",color:t="currentColor",size:n=24,...r},a){return t==="default"&&(t=bE),S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,fill:t,viewBox:"0 0 24 24",ref:a,...r,children:[S.jsx("title",{children:e}),S.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})});function vE({open:i,onClose:e}){const t=dt(),{data:n}=ks({queryKey:["config"],queryFn:Pe.config.get}),{data:r}=ks({queryKey:["health"],queryFn:Pe.health}),{data:a}=ZS(),o=aE(),[c,f]=E.useState("config"),[d,m]=E.useState(4e3),[y,b]=E.useState(!1),[x,w]=E.useState("");E.useEffect(()=>{n&&m(n.proxyPort)},[n]),E.useEffect(()=>{a&&w(a.name)},[a]);const k=Tt({mutationFn:()=>Pe.config.update({proxyPort:d}),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),e()}}),C=async()=>{const D=await Pe.config.export(),Q=new Blob([JSON.stringify(D,null,2)],{type:"application/json"}),_=URL.createObjectURL(Q),K=document.createElement("a");K.href=_,K.download=`interceptr-config-${new Date().toISOString().slice(0,10)}.json`,K.click(),URL.revokeObjectURL(_)},M=async D=>{const Q=await D.text(),_=JSON.parse(Q);await Pe.config.import(_),t.invalidateQueries()},R=()=>{!a||!x.trim()||o.mutate({id:a.id,name:x.trim()},{onSuccess:()=>b(!1)})};return i?S.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[S.jsx("div",{className:"absolute inset-0 bg-background/60 backdrop-blur-md",onClick:e}),S.jsxs("div",{className:"relative w-full max-w-xl bg-card border border-border/60 shadow-2xl rounded-3xl overflow-hidden flex flex-col max-h-[90vh]",children:[S.jsxs("div",{className:"px-6 py-4 border-b border-border/40 bg-muted flex items-center justify-between shrink-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(b3,{className:"w-4 h-4 text-primary"}),S.jsx("h2",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-foreground/80",children:"System Control"})]}),S.jsx("button",{onClick:e,className:"p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-colors duration-75",children:S.jsx(Fa,{className:"w-4 h-4"})})]}),S.jsxs("div",{className:"flex border-b border-border/20 bg-muted/30 shrink-0 px-4",children:[S.jsx("button",{onClick:()=>f("config"),className:Be("px-4 py-3 text-[10px] font-black uppercase tracking-widest border-b-2 transition-all duration-75",c==="config"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Configuration"}),S.jsx("button",{onClick:()=>f("about"),className:Be("px-4 py-3 text-[10px] font-black uppercase tracking-widest border-b-2 transition-all duration-75",c==="about"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"About"})]}),S.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-8",children:c==="config"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"flex items-center gap-2 px-1",children:[S.jsx(k3,{className:"w-3.5 h-3.5 text-muted-foreground/60"}),S.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground/60",children:"Project Identity"})]}),a&&S.jsx("div",{className:"space-y-3",children:y?S.jsxs("div",{className:"flex gap-2",children:[S.jsx("input",{autoFocus:!0,type:"text",value:x,onChange:D=>w(D.target.value),className:"flex-1 px-4 py-2.5 text-sm font-bold rounded-xl border border-primary/20 bg-background focus:outline-none focus:ring-1 focus:ring-primary shadow-inner"}),S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("button",{onClick:R,className:"p-2.5 bg-success/10 text-success rounded-xl hover:bg-success hover:text-success-foreground transition-colors duration-75 shadow-sm",children:S.jsx(Tc,{className:"w-4 h-4"})}),S.jsx("button",{onClick:()=>{w(a.name),b(!1)},className:"p-2.5 bg-muted text-muted-foreground rounded-xl transition-colors duration-75",children:S.jsx(Fa,{className:"w-4 h-4"})})]})]}):S.jsxs("div",{className:"flex items-center justify-between p-4 rounded-xl border border-border/40 bg-muted/10 group",children:[S.jsxs("div",{className:"flex flex-col",children:[S.jsx("span",{className:"text-sm font-black text-foreground",children:a.name}),S.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground opacity-60 uppercase mt-0.5 tracking-tighter",children:["Project ID: ",a.id]})]}),S.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-2 px-3 py-1.5 text-[10px] font-black uppercase tracking-widest text-primary hover:bg-primary/5 rounded-lg transition-all border border-transparent hover:border-primary/20",children:[S.jsx(f3,{className:"w-3 h-3"}),"Rename"]})]})})]}),S.jsxs("div",{className:"space-y-4 pt-4 border-t border-border/40",children:[S.jsxs("div",{className:"flex items-center gap-2 px-1",children:[S.jsx(qS,{className:"w-3.5 h-3.5 text-muted-foreground/60"}),S.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground/60",children:"Network Environment"})]}),S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsxs("div",{className:"flex-1 space-y-1",children:[S.jsx("p",{className:"text-xs font-black text-foreground uppercase tracking-tight leading-none mb-1",children:"Proxy Port"}),S.jsx("p",{className:"text-[10px] text-muted-foreground/60 font-medium",children:"Internal server interface listener port."})]}),S.jsx("input",{type:"number",value:d,onChange:D=>m(Number(D.target.value)),className:"w-32 px-4 py-2 text-sm font-mono font-black rounded-xl border border-border/60 bg-background focus:outline-none focus:ring-1 focus:ring-primary shadow-inner text-right"})]})]}),S.jsxs("div",{className:"space-y-4 pt-4 border-t border-border/40",children:[S.jsxs("div",{className:"flex items-center gap-2 px-1",children:[S.jsx(n3,{className:"w-3.5 h-3.5 text-muted-foreground/60"}),S.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground/60",children:"Data Sovereignty"})]}),S.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[S.jsxs("button",{onClick:C,className:"flex items-center justify-center gap-2.5 px-4 py-3 text-[10px] font-black uppercase tracking-widest rounded-xl border border-border/60 bg-card/40 hover:bg-accent/40 hover:border-primary/20 transition-all shadow-sm group",children:[S.jsx(s3,{className:"w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors"}),"Backup"]}),S.jsxs("label",{className:"flex items-center justify-center gap-2.5 px-4 py-3 text-[10px] font-black uppercase tracking-widest rounded-xl border border-border/60 bg-card/40 hover:bg-accent/40 hover:border-primary/20 transition-all shadow-sm cursor-pointer group",children:[S.jsx(GS,{className:"w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors"}),"Restore",S.jsx("input",{type:"file",accept:".json",className:"hidden",onChange:D=>{const Q=D.target.files?.[0];Q&&M(Q)}})]})]})]})]}):S.jsxs("div",{className:"flex flex-col items-center text-center space-y-8 py-4",children:[S.jsx("div",{className:"max-w-[300px] p-4",children:S.jsx("img",{src:e2,alt:"Interceptr Full Logo",className:"w-full h-auto object-contain"})}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("h3",{className:"text-xl font-black tracking-tighter uppercase",children:"Interceptr"}),S.jsxs("p",{className:"text-xs font-bold text-muted-foreground uppercase tracking-widest",children:["Version ",r?.version??"—"]})]}),S.jsx("div",{className:"max-w-md",children:S.jsx("p",{className:"text-sm font-medium text-muted-foreground leading-relaxed",children:"A professional-grade HTTP interception proxy and mocking tool designed specifically for modern engineering workflows."})}),S.jsxs("div",{className:"w-full grid grid-cols-1 gap-3 pt-4",children:[S.jsxs("a",{href:"https://github.com/pckhib/interceptr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-4 rounded-2xl border border-border/60 bg-muted/10 hover:bg-primary/5 hover:border-primary/20 transition-all group",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:"w-8 h-8 rounded-lg bg-background border border-border/40 flex items-center justify-center",children:S.jsx(xE,{className:"w-4 h-4"})}),S.jsxs("div",{className:"text-left",children:[S.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest leading-none mb-1",children:"GitHub Repository"}),S.jsx("p",{className:"text-[11px] font-bold text-muted-foreground",children:"Contribute or report issues."})]})]}),S.jsx(Vp,{className:"w-4 h-4 text-muted-foreground/40 group-hover:text-primary transition-colors"})]}),S.jsxs("a",{href:"https://github.com/pckhib",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-4 rounded-2xl border border-border/60 bg-muted/10 hover:bg-primary/5 hover:border-primary/20 transition-all group",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:"w-8 h-8 rounded-lg bg-background border border-border/40 flex items-center justify-center",children:S.jsx(PS,{className:"w-4 h-4 text-primary"})}),S.jsxs("div",{className:"text-left",children:[S.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest leading-none mb-1",children:"Developer"}),S.jsx("p",{className:"text-[11px] font-bold text-muted-foreground",children:"Patrick Hieber"})]})]}),S.jsx(Vp,{className:"w-4 h-4 text-muted-foreground/40 group-hover:text-primary transition-colors"})]})]}),S.jsx("p",{className:"text-[9px] font-black text-muted-foreground/40 uppercase tracking-[0.3em] pt-4",children:"API Simulation Made Simple."})]})}),S.jsx("div",{className:"p-4 border-t border-border/40 bg-muted flex justify-end gap-3 px-6 shrink-0",children:c==="config"?S.jsxs(S.Fragment,{children:[S.jsx("button",{onClick:e,className:"px-6 py-2.5 text-[10px] font-black uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors duration-75",children:"Cancel"}),S.jsx("button",{onClick:()=>k.mutate(),className:"px-6 py-2.5 text-[10px] font-black uppercase tracking-widest bg-primary text-primary-foreground rounded-xl hover:bg-primary/90 transition-all shadow-md active:scale-95",children:"Persist Settings"})]}):S.jsx("button",{onClick:e,className:"px-8 py-2.5 text-[10px] font-black uppercase tracking-widest bg-foreground text-background rounded-xl hover:opacity-90 transition-all shadow-md active:scale-95",children:"Close"})})]})]}):null}function SE(){const{theme:i,toggleTheme:e}=yE(),{data:t}=ZO(),n=JO(),r=$O(),[a,o]=E.useState(!1),c=t?.running??!1,f=n.isPending||r.isPending;return S.jsxs(S.Fragment,{children:[S.jsxs("header",{className:"h-14 border-b-2 border-border/60 bg-card header-gradient flex items-center justify-between px-4 shrink-0 z-50 relative",children:[S.jsx("div",{className:"absolute top-0 left-0 right-0 h-[1px] bg-white/5"}),S.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[S.jsx("div",{className:"flex items-center group cursor-pointer h-8",children:S.jsx("img",{src:e2,alt:"Interceptr",className:"h-7 w-auto object-contain transition-transform duration-75 group-hover:scale-105"})}),S.jsx("div",{className:"h-6 w-px bg-border/40 mx-1 hidden sm:block"}),S.jsx(uE,{}),S.jsx(gE,{})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("div",{className:Be("hidden md:flex items-center gap-2 px-3 py-1.5 rounded-full border text-[10px] font-black uppercase tracking-widest transition-all duration-300",c?"bg-success/10 border-success/30 text-success shadow-[0_0_10px_-2px_rgba(34,197,94,0.3)]":"bg-muted border-border text-muted-foreground/60"),children:[S.jsx("div",{className:Be("w-2 h-2 rounded-full",c?"bg-success animate-pulse":"bg-muted-foreground/20")}),S.jsx("span",{children:c?`:${t?.port}`:"Offline"})]}),S.jsxs("button",{onClick:()=>c?r.mutate():n.mutate(),disabled:f,className:Be("flex items-center gap-2 px-3 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all shadow-sm border",c?"bg-destructive/10 border-destructive/20 text-destructive hover:bg-destructive hover:text-destructive-foreground":"bg-primary border-primary/20 text-primary-foreground hover:bg-primary/90",f&&"opacity-50 cursor-not-allowed"),children:[S.jsx(d3,{className:"w-3.5 h-3.5"}),S.jsx("span",{className:"hidden lg:inline",children:c?"Stop":"Start"})]}),S.jsx("div",{className:"h-6 w-px bg-border/40 mx-1"}),S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx("button",{onClick:e,className:"p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-all",title:"Toggle theme",children:i==="dark"?S.jsx(S3,{className:"w-4 h-4"}):S.jsx(h3,{className:"w-4 h-4"})}),S.jsx("button",{onClick:()=>o(!0),className:"p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-all",title:"Settings",children:S.jsx(v3,{className:"w-4 h-4"})})]})]})]}),S.jsx(vE,{open:a,onClose:()=>o(!1)})]})}function wE(){const[i,e]=E.useState(()=>typeof window<"u"&&localStorage.getItem("theme")||"dark");E.useEffect(()=>{const n=window.document.documentElement;n.classList.remove("light","dark"),n.classList.add(i),localStorage.setItem("theme",i)},[i]);const t=()=>e(n=>n==="light"?"dark":"light");return S.jsx($S.Provider,{value:{theme:i,toggleTheme:t},children:S.jsxs("div",{className:"flex flex-col h-screen overflow-hidden bg-background text-foreground",children:[S.jsx(SE,{}),S.jsx("main",{className:"flex-1 overflow-hidden relative",children:S.jsx(DT,{})})]})})}function t2(){return ks({queryKey:["endpoints"],queryFn:Pe.endpoints.list})}function kE(){const i=dt();return Tt({mutationFn:({id:e,config:t})=>Pe.endpoints.update(e,t),onSuccess:()=>{i.invalidateQueries({queryKey:["endpoints"]})}})}function i2(){const i=dt();return Tt({mutationFn:e=>Pe.endpoints.bulkUpdate(e),onSuccess:()=>{i.invalidateQueries({queryKey:["endpoints"]})}})}const CE={GET:"text-emerald-400 bg-emerald-400/10 border-emerald-400/30 shadow-[0_0_10px_-3px_rgba(52,211,153,0.3)]",POST:"text-blue-400 bg-blue-400/10 border-blue-400/30 shadow-[0_0_10px_-3px_rgba(96,165,250,0.3)]",PUT:"text-amber-400 bg-amber-400/10 border-amber-400/30 shadow-[0_0_10px_-3px_rgba(251,191,36,0.3)]",PATCH:"text-orange-400 bg-orange-400/10 border-orange-400/30 shadow-[0_0_10px_-3px_rgba(251,146,60,0.3)]",DELETE:"text-rose-400 bg-rose-400/10 border-rose-400/30 shadow-[0_0_10px_-3px_rgba(251,113,133,0.3)]",HEAD:"text-purple-400 bg-purple-400/10 border-purple-400/30 shadow-[0_0_10px_-3px_rgba(192,132,252,0.3)]",OPTIONS:"text-slate-400 bg-slate-400/10 border-slate-400/30"};function Jm({method:i}){return S.jsx("span",{className:Be("inline-flex items-center justify-center px-1.5 py-0.5 text-[10px] font-black rounded-[4px] border uppercase tracking-widest w-[52px] shrink-0 font-mono transition-all",CE[i]??"text-muted-foreground bg-muted/20 border-border"),children:i})}const AE=[{value:"passthrough",label:"Pass",icon:Pp,activeClass:"bg-mode-passthrough/20 text-mode-passthrough border-mode-passthrough/30 shadow-[0_0_8px_-2px_rgba(var(--mode-passthrough),0.3)]"},{value:"delay",label:"Delay",icon:fl,activeClass:"bg-mode-delay/20 text-mode-delay border-mode-delay/30 shadow-[0_0_8px_-2px_rgba(var(--mode-delay),0.3)]"},{value:"mock",label:"Mock",icon:r3,activeClass:"bg-mode-mock/20 text-mode-mock border-mode-mock/30 shadow-[0_0_8px_-2px_rgba(var(--mode-mock),0.3)]"}];function ME({value:i,onChange:e}){return S.jsx("div",{className:"inline-flex rounded-lg border border-border/60 bg-muted/30 p-1 shadow-inner backdrop-blur-sm",children:AE.map(({value:t,label:n,icon:r,activeClass:a})=>S.jsxs("button",{onClick:()=>e(t),className:Be("flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-black uppercase tracking-widest rounded-md transition-all duration-200 border border-transparent",i===t?Be("font-bold",a):"text-muted-foreground/60 hover:text-foreground hover:bg-white/5"),children:[S.jsx(r,{className:Be("w-3.5 h-3.5",i===t?"animate-in zoom-in-75 duration-300":"opacity-50")}),S.jsx("span",{className:"hidden sm:inline",children:n})]},t))})}function TE({delay:i,onChange:e}){const[t,n]=E.useState(i.ms),[r,a]=E.useState(i.jitterMs??0);E.useEffect(()=>{n(i.ms),a(i.jitterMs??0)},[i.ms,i.jitterMs]);const o=()=>{e({ms:t,jitterMs:r||void 0})};return S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 max-w-2xl py-2",children:[S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("label",{className:"flex items-center gap-2 text-[11px] font-bold text-muted-foreground uppercase tracking-widest",children:[S.jsx(fl,{className:"w-3.5 h-3.5 text-mode-delay"}),"Base Delay"]}),S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("input",{type:"number",value:t,onChange:c=>n(Number(c.target.value)),onBlur:o,className:"w-20 px-2 py-1 text-xs font-mono font-bold bg-background border border-border/60 rounded-md focus:ring-1 focus:ring-mode-delay focus:border-mode-delay outline-none text-right"}),S.jsx("span",{className:"text-[10px] font-bold text-muted-foreground",children:"ms"})]})]}),S.jsx("input",{type:"range",min:0,max:1e4,step:50,value:t,onChange:c=>n(Number(c.target.value)),onMouseUp:o,className:"w-full accent-mode-delay h-4 bg-transparent cursor-pointer"}),S.jsxs("div",{className:"flex justify-between text-[9px] font-bold text-muted-foreground/40 uppercase tracking-tighter",children:[S.jsx("span",{children:"0ms"}),S.jsx("span",{children:"5,000ms"}),S.jsx("span",{children:"10,000ms"})]})]}),S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("label",{className:"flex items-center gap-2 text-[11px] font-bold text-muted-foreground uppercase tracking-widest",children:[S.jsx(Xm,{className:"w-3.5 h-3.5 text-mode-delay/60"}),"Jitter (±)"]}),S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("input",{type:"number",value:r,onChange:c=>a(Number(c.target.value)),onBlur:o,className:"w-16 px-2 py-1 text-xs font-mono font-bold bg-background border border-border/60 rounded-md focus:ring-1 focus:ring-mode-delay/40 focus:border-mode-delay/40 outline-none text-right"}),S.jsx("span",{className:"text-[10px] font-bold text-muted-foreground",children:"ms"})]})]}),S.jsx("input",{type:"range",min:0,max:2e3,step:10,value:r,onChange:c=>a(Number(c.target.value)),onMouseUp:o,className:"w-full accent-mode-delay/60 h-4 bg-transparent cursor-pointer"}),S.jsxs("div",{className:"flex justify-between text-[9px] font-bold text-muted-foreground/40 uppercase tracking-tighter",children:[S.jsx("span",{children:"0ms"}),S.jsx("span",{children:"1,000ms"}),S.jsx("span",{children:"2,000ms"})]})]})]})}function Gp(){return Gp=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Gp.apply(null,arguments)}function OE(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.indexOf(n)!==-1)continue;t[n]=i[n]}return t}let Fp=[],n2=[];(()=>{let i="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<i.length;e++)(e%2?n2:Fp).push(t=t+i[e])})();function EE(i){if(i<768)return!1;for(let e=0,t=Fp.length;;){let n=e+t>>1;if(i<Fp[n])t=n;else if(i>=n2[n])e=n+1;else return!0;if(e==t)return!1}}function f1(i){return i>=127462&&i<=127487}const d1=8205;function NE(i,e,t=!0,n=!0){return(t?s2:RE)(i,e,n)}function s2(i,e,t){if(e==i.length)return e;e&&r2(i.charCodeAt(e))&&l2(i.charCodeAt(e-1))&&e--;let n=$d(i,e);for(e+=p1(n);e<i.length;){let r=$d(i,e);if(n==d1||r==d1||t&&EE(r))e+=p1(r),n=r;else if(f1(r)){let a=0,o=e-2;for(;o>=0&&f1($d(i,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function RE(i,e,t){for(;e>0;){let n=s2(i,e-2,t);if(n<e)return n;e--}return 0}function $d(i,e){let t=i.charCodeAt(e);if(!l2(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return r2(n)?(t-55296<<10)+(n-56320)+65536:t}function r2(i){return i>=56320&&i<57344}function l2(i){return i>=55296&&i<56320}function p1(i){return i<65536?1:2}class _e{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,n){[e,t]=dl(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),rn.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=dl(this,e,t);let n=[];return this.decompose(e,t,n,0),rn.from(n,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),n=this.length-this.scanIdentical(e,-1),r=new Ba(this),a=new Ba(e);for(let o=t,c=t;;){if(r.next(o),a.next(o),o=0,r.lineBreak!=a.lineBreak||r.done!=a.done||r.value!=a.value)return!1;if(c+=r.value.length,r.done||c>=n)return!0}}iter(e=1){return new Ba(this,e)}iterRange(e,t=this.length){return new a2(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new o2(n)}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]?_e.empty:e.length<=32?new ht(e):rn.from(ht.split(e,[]))}}class ht extends _e{constructor(e,t=DE(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let a=0;;a++){let o=this.text[a],c=r+o.length;if((t?n:c)>=e)return new jE(r,c,n,o);r=c+1,n++}}decompose(e,t,n,r){let a=e<=0&&t>=this.length?this:new ht(m1(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),c=pc(a.text,o.text.slice(),0,a.length);if(c.length<=32)n.push(new ht(c,o.length+a.length));else{let f=c.length>>1;n.push(new ht(c.slice(0,f)),new ht(c.slice(f)))}}else n.push(a)}replace(e,t,n){if(!(n instanceof ht))return super.replace(e,t,n);[e,t]=dl(this,e,t);let r=pc(this.text,pc(n.text,m1(this.text,0,e)),t),a=this.length+n.length-(t-e);return r.length<=32?new ht(r,a):rn.from(ht.split(r,[]),a)}sliceString(e,t=this.length,n=`
|
|
12
|
+
`){[e,t]=dl(this,e,t);let r="";for(let a=0,o=0;a<=t&&o<this.text.length;o++){let c=this.text[o],f=a+c.length;a>e&&o&&(r+=n),e<f&&t>a&&(r+=c.slice(Math.max(0,e-a),t-a)),a=f+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let a of e)n.push(a),r+=a.length+1,n.length==32&&(t.push(new ht(n,r)),n=[],r=-1);return r>-1&&t.push(new ht(n,r)),t}}class rn extends _e{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let a=0;;a++){let o=this.children[a],c=r+o.length,f=n+o.lines-1;if((t?f:c)>=e)return o.lineInner(e,t,n,r);r=c+1,n=f+1}}decompose(e,t,n,r){for(let a=0,o=0;o<=t&&a<this.children.length;a++){let c=this.children[a],f=o+c.length;if(e<=f&&t>=o){let d=r&((o<=e?1:0)|(f>=t?2:0));o>=e&&f<=t&&!d?n.push(c):c.decompose(e-o,t-o,n,d)}o=f+1}}replace(e,t,n){if([e,t]=dl(this,e,t),n.lines<this.lines)for(let r=0,a=0;r<this.children.length;r++){let o=this.children[r],c=a+o.length;if(e>=a&&t<=c){let f=o.replace(e-a,t-a,n),d=this.lines-o.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let m=this.children.slice();return m[r]=f,new rn(m,this.length-(t-e)+n.length)}return super.replace(a,c,f)}a=c+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
|
|
13
|
+
`){[e,t]=dl(this,e,t);let r="";for(let a=0,o=0;a<this.children.length&&o<=t;a++){let c=this.children[a],f=o+c.length;o>e&&a&&(r+=n),e<f&&t>o&&(r+=c.sliceString(e-o,t-o,n)),o=f+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof rn))return 0;let n=0,[r,a,o,c]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,a+=t){if(r==o||a==c)return n;let f=this.children[r],d=e.children[a];if(f!=d)return n+f.scanIdentical(d,t);n+=f.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let x of e)n+=x.lines;if(n<32){let x=[];for(let w of e)w.flatten(x);return new ht(x,t)}let r=Math.max(32,n>>5),a=r<<1,o=r>>1,c=[],f=0,d=-1,m=[];function y(x){let w;if(x.lines>a&&x instanceof rn)for(let k of x.children)y(k);else x.lines>o&&(f>o||!f)?(b(),c.push(x)):x instanceof ht&&f&&(w=m[m.length-1])instanceof ht&&x.lines+w.lines<=32?(f+=x.lines,d+=x.length+1,m[m.length-1]=new ht(w.text.concat(x.text),w.length+1+x.length)):(f+x.lines>r&&b(),f+=x.lines,d+=x.length+1,m.push(x))}function b(){f!=0&&(c.push(m.length==1?m[0]:rn.from(m,d)),d=-1,f=m.length=0)}for(let x of e)y(x);return b(),c.length==1?c[0]:new rn(c,t)}}_e.empty=new ht([""],0);function DE(i){let e=-1;for(let t of i)e+=t.length+1;return e}function pc(i,e,t=0,n=1e9){for(let r=0,a=0,o=!0;a<i.length&&r<=n;a++){let c=i[a],f=r+c.length;f>=t&&(f>n&&(c=c.slice(0,n-r)),r<t&&(c=c.slice(t-r)),o?(e[e.length-1]+=c,o=!1):e.push(c)),r=f+1}return e}function m1(i,e,t){return pc(i,[""],e,t)}class Ba{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 ht?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],a=this.offsets[n],o=a>>1,c=r instanceof ht?r.text.length:r.children.length;if(o==(t>0?c:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
14
|
+
`,this;e--}else if(r instanceof ht){let f=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,f.length>Math.max(0,e))return this.value=e==0?f:t>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=r.children[o+(t<0?-1:0)];e>f.length?(e-=f.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(f),this.offsets.push(t>0?1:(f instanceof ht?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class a2{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Ba(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}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 n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),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 o2{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(_e.prototype[Symbol.iterator]=function(){return this.iter()},Ba.prototype[Symbol.iterator]=a2.prototype[Symbol.iterator]=o2.prototype[Symbol.iterator]=function(){return this});class jE{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function dl(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function Mt(i,e,t=!0,n=!0){return NE(i,e,t,n)}function BE(i){return i>=56320&&i<57344}function LE(i){return i>=55296&&i<56320}function ei(i,e){let t=i.charCodeAt(e);if(!LE(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return BE(n)?(t-55296<<10)+(n-56320)+65536:t}function $m(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function ln(i){return i<65536?1:2}const Kp=/\r\n?|\n/;var Ft=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(Ft||(Ft={}));class fn{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 n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let a=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,a),r+=a):r+=o,n+=a}}iterChangedRanges(e,t=!1){Yp(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new fn(e)}composeDesc(e){return this.empty?e:e.empty?this:u2(this,e)}mapDesc(e,t=!1){return e.empty?this:Ip(this,e,t)}mapPos(e,t=-1,n=Ft.Simple){let r=0,a=0;for(let o=0;o<this.sections.length;){let c=this.sections[o++],f=this.sections[o++],d=r+c;if(f<0){if(d>e)return a+(e-r);a+=c}else{if(n!=Ft.Simple&&d>=e&&(n==Ft.TrackDel&&r<e&&d>e||n==Ft.TrackBefore&&r<e||n==Ft.TrackAfter&&d>e))return null;if(d>e||d==e&&t<0&&!c)return e==r||t<0?a:a+f;a+=f}r=d}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return a}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let a=this.sections[n++],o=this.sections[n++],c=r+a;if(o>=0&&r<=t&&c>=e)return r<e&&c>t?"cover":!0;r=c}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}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 fn(e)}static create(e){return new fn(e)}}class vt extends fn{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 Yp(this,(t,n,r,a,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return Ip(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,a=0;r<t.length;r+=2){let o=t[r],c=t[r+1];if(c>=0){t[r]=c,t[r+1]=o;let f=r>>1;for(;n.length<f;)n.push(_e.empty);n.push(o?e.slice(a,a+o):_e.empty)}a+=o}return new vt(t,n)}compose(e){return this.empty?e:e.empty?this:u2(this,e,!0)}map(e,t=!1){return e.empty?this:Ip(this,e,t,!0)}iterChanges(e,t=!1){Yp(this,e,t)}get desc(){return fn.create(this.sections)}filter(e){let t=[],n=[],r=[],a=new Ka(this);e:for(let o=0,c=0;;){let f=o==e.length?1e9:e[o++];for(;c<f||c==f&&a.len==0;){if(a.done)break e;let m=Math.min(a.len,f-c);Ht(r,m,-1);let y=a.ins==-1?-1:a.off==0?a.ins:0;Ht(t,m,y),y>0&&xs(n,t,a.text),a.forward(m),c+=m}let d=e[o++];for(;c<d;){if(a.done)break e;let m=Math.min(a.len,d-c);Ht(t,m,-1),Ht(r,m,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(m),c+=m}}return{changes:new vt(t,n),filtered:fn.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],a=[],o=0,c=null;function f(m=!1){if(!m&&!r.length)return;o<t&&Ht(r,t-o,-1);let y=new vt(r,a);c=c?c.compose(y.map(c)):y,r=[],a=[],o=0}function d(m){if(Array.isArray(m))for(let y of m)d(y);else if(m instanceof vt){if(m.length!=t)throw new RangeError(`Mismatched change set length (got ${m.length}, expected ${t})`);f(),c=c?c.compose(m.map(c)):m}else{let{from:y,to:b=y,insert:x}=m;if(y>b||y<0||b>t)throw new RangeError(`Invalid change range ${y} to ${b} (in doc of length ${t})`);let w=x?typeof x=="string"?_e.of(x.split(n||Kp)):x:_e.empty,k=w.length;if(y==b&&k==0)return;y<o&&f(),y>o&&Ht(r,y-o,-1),Ht(r,b-y,k),xs(a,r,w),o=b}}return d(e),f(!c),c}static empty(e){return new vt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let a=e[r];if(typeof a=="number")t.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((o,c)=>c&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)t.push(a[0],0);else{for(;n.length<r;)n.push(_e.empty);n[r]=_e.of(a.slice(1)),t.push(a[0],n[r].length)}}}return new vt(t,n)}static createSet(e,t){return new vt(e,t)}}function Ht(i,e,t,n=!1){if(e==0&&t<=0)return;let r=i.length-2;r>=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function xs(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<i.length)i[i.length-1]=i[i.length-1].append(t);else{for(;i.length<n;)i.push(_e.empty);i.push(t)}}function Yp(i,e,t){let n=i.inserted;for(let r=0,a=0,o=0;o<i.sections.length;){let c=i.sections[o++],f=i.sections[o++];if(f<0)r+=c,a+=c;else{let d=r,m=a,y=_e.empty;for(;d+=c,m+=f,f&&n&&(y=y.append(n[o-2>>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)c=i.sections[o++],f=i.sections[o++];e(r,d,a,m,y),r=d,a=m}}}function Ip(i,e,t,n=!1){let r=[],a=n?[]:null,o=new Ka(i),c=new Ka(e);for(let f=-1;;){if(o.done&&c.len||c.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&c.ins==-1){let d=Math.min(o.len,c.len);Ht(r,d,-1),o.forward(d),c.forward(d)}else if(c.ins>=0&&(o.ins<0||f==o.i||o.off==0&&(c.len<o.len||c.len==o.len&&!t))){let d=c.len;for(Ht(r,c.ins,-1);d;){let m=Math.min(o.len,d);o.ins>=0&&f<o.i&&o.len<=m&&(Ht(r,0,o.ins),a&&xs(a,r,o.text),f=o.i),o.forward(m),d-=m}c.next()}else if(o.ins>=0){let d=0,m=o.len;for(;m;)if(c.ins==-1){let y=Math.min(m,c.len);d+=y,m-=y,c.forward(y)}else if(c.ins==0&&c.len<m)m-=c.len,c.next();else break;Ht(r,d,f<o.i?o.ins:0),a&&f<o.i&&xs(a,r,o.text),f=o.i,o.forward(o.len-m)}else{if(o.done&&c.done)return a?vt.createSet(r,a):fn.create(r);throw new Error("Mismatched change set lengths")}}}function u2(i,e,t=!1){let n=[],r=t?[]:null,a=new Ka(i),o=new Ka(e);for(let c=!1;;){if(a.done&&o.done)return r?vt.createSet(n,r):fn.create(n);if(a.ins==0)Ht(n,a.len,0,c),a.next();else if(o.len==0&&!o.done)Ht(n,0,o.ins,c),r&&xs(r,n,o.text),o.next();else{if(a.done||o.done)throw new Error("Mismatched change set lengths");{let f=Math.min(a.len2,o.len),d=n.length;if(a.ins==-1){let m=o.ins==-1?-1:o.off?0:o.ins;Ht(n,f,m,c),r&&m&&xs(r,n,o.text)}else o.ins==-1?(Ht(n,a.off?0:a.len,f,c),r&&xs(r,n,a.textBit(f))):(Ht(n,a.off?0:a.len,o.off?0:o.ins,c),r&&!o.off&&xs(r,n,o.text));c=(a.ins>f||o.ins>=0&&o.len>f)&&(c||n.length>d),a.forward2(f),o.forward(f)}}}}class Ka{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?_e.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?_e.empty:t[n].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 ir{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}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 n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new ir(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return W.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return W.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 W.range(e.anchor,e.head)}static create(e,t,n){return new ir(e,t,n)}}class W{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:W.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new W([this.main],0)}addRange(e,t=!0){return W.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,W.create(n,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 W(e.ranges.map(t=>ir.fromJSON(t)),e.main)}static single(e,t=e){return new W([W.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 n=0,r=0;r<e.length;r++){let a=e[r];if(a.empty?a.from<=n:a.from<n)return W.normalized(e.slice(),t);n=a.to}return new W(e,t)}static cursor(e,t=0,n,r){return ir.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?ir.create(t,e,48|a):ir.create(e,t,(t>e?8:0)|a)}static normalized(e,t=0){let n=e[t];e.sort((r,a)=>r.from-a.from),t=e.indexOf(n);for(let r=1;r<e.length;r++){let a=e[r],o=e[r-1];if(a.empty?a.from<=o.to:a.from<o.to){let c=o.from,f=Math.max(a.to,o.to);r<=t&&t--,e.splice(--r,2,a.anchor>a.head?W.range(f,c):W.range(c,f))}}return new W(e,t)}}function c2(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let eg=0;class re{constructor(e,t,n,r,a){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=eg++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new re(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:tg),!!e.static,e.enables)}of(e){return new mc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new mc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new mc(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function tg(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class mc{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=eg++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,a=this.id,o=e[a]>>1,c=this.type==2,f=!1,d=!1,m=[];for(let y of this.dependencies)y=="doc"?f=!0:y=="selection"?d=!0:(((t=e[y.id])!==null&&t!==void 0?t:1)&1)==0&&m.push(e[y.id]);return{create(y){return y.values[o]=n(y),1},update(y,b){if(f&&b.docChanged||d&&(b.docChanged||b.selection)||Wp(y,m)){let x=n(y);if(c?!g1(x,y.values[o],r):!r(x,y.values[o]))return y.values[o]=x,1}return 0},reconfigure:(y,b)=>{let x,w=b.config.address[a];if(w!=null){let k=Dc(b,w);if(this.dependencies.every(C=>C instanceof re?b.facet(C)===y.facet(C):C instanceof Ut?b.field(C,!1)==y.field(C,!1):!0)||(c?g1(x=n(y),k,r):r(x=n(y),k)))return y.values[o]=k,0}else x=n(y);return y.values[o]=x,1}}}}function g1(i,e,t){if(i.length!=e.length)return!1;for(let n=0;n<i.length;n++)if(!t(i[n],e[n]))return!1;return!0}function Wp(i,e){let t=!1;for(let n of e)La(i,n)&1&&(t=!0);return t}function zE(i,e,t){let n=t.map(f=>i[f.id]),r=t.map(f=>f.type),a=n.filter(f=>!(f&1)),o=i[e.id]>>1;function c(f){let d=[];for(let m=0;m<n.length;m++){let y=Dc(f,n[m]);if(r[m]==2)for(let b of y)d.push(b);else d.push(y)}return e.combine(d)}return{create(f){for(let d of n)La(f,d);return f.values[o]=c(f),1},update(f,d){if(!Wp(f,a))return 0;let m=c(f);return e.compare(m,f.values[o])?0:(f.values[o]=m,1)},reconfigure(f,d){let m=Wp(f,n),y=d.config.facets[e.id],b=d.facet(e);if(y&&!m&&tg(t,y))return f.values[o]=b,0;let x=c(f);return e.compare(x,b)?(f.values[o]=b,0):(f.values[o]=x,1)}}}const Pu=re.define({static:!0});class Ut{constructor(e,t,n,r,a){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=a,this.provides=void 0}static define(e){let t=new Ut(eg++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Pu).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let a=n.values[t],o=this.updateF(a,r);return this.compareF(a,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let a=n.facet(Pu),o=r.facet(Pu),c;return(c=a.find(f=>f.field==this))&&c!=o.find(f=>f.field==this)?(n.values[t]=c.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Pu.of({field:this,create:e})]}get extension(){return this}}const $s={lowest:4,low:3,default:2,high:1,highest:0};function Aa(i){return e=>new h2(e,i)}const dr={highest:Aa($s.highest),high:Aa($s.high),default:Aa($s.default),low:Aa($s.low),lowest:Aa($s.lowest)};class h2{constructor(e,t){this.inner=e,this.prec=t}}class oh{of(e){return new Xp(this,e)}reconfigure(e){return oh.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Xp{constructor(e,t){this.compartment=e,this.inner=t}}class Rc{constructor(e,t,n,r,a,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=a,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.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,n){let r=[],a=Object.create(null),o=new Map;for(let b of HE(e,t,o))b instanceof Ut?r.push(b):(a[b.facet.id]||(a[b.facet.id]=[])).push(b);let c=Object.create(null),f=[],d=[];for(let b of r)c[b.id]=d.length<<1,d.push(x=>b.slot(x));let m=n?.config.facets;for(let b in a){let x=a[b],w=x[0].facet,k=m&&m[b]||[];if(x.every(C=>C.type==0))if(c[w.id]=f.length<<1|1,tg(k,x))f.push(n.facet(w));else{let C=w.combine(x.map(M=>M.value));f.push(n&&w.compare(C,n.facet(w))?n.facet(w):C)}else{for(let C of x)C.type==0?(c[C.id]=f.length<<1|1,f.push(C.value)):(c[C.id]=d.length<<1,d.push(M=>C.dynamicSlot(M)));c[w.id]=d.length<<1,d.push(C=>zE(C,w,x))}}let y=d.map(b=>b(c));return new Rc(e,o,y,c,f,a)}}function HE(i,e,t){let n=[[],[],[],[],[]],r=new Map;function a(o,c){let f=r.get(o);if(f!=null){if(f<=c)return;let d=n[f].indexOf(o);d>-1&&n[f].splice(d,1),o instanceof Xp&&t.delete(o.compartment)}if(r.set(o,c),Array.isArray(o))for(let d of o)a(d,c);else if(o instanceof Xp){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(o.compartment)||o.inner;t.set(o.compartment,d),a(d,c)}else if(o instanceof h2)a(o.inner,o.prec);else if(o instanceof Ut)n[c].push(o),o.provides&&a(o.provides,c);else if(o instanceof mc)n[c].push(o),o.facet.extensions&&a(o.facet.extensions,$s.default);else{let d=o.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(d,c)}}return a(i,$s.default),n.reduce((o,c)=>o.concat(c))}function La(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Dc(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const f2=re.define(),Zp=re.define({combine:i=>i.some(e=>e),static:!0}),d2=re.define({combine:i=>i.length?i[0]:void 0,static:!0}),p2=re.define(),m2=re.define(),g2=re.define(),y2=re.define({combine:i=>i.length?i[0]:!1});class dn{constructor(e,t){this.type=e,this.value=t}static define(){return new _E}}class _E{of(e){return new dn(this,e)}}class UE{constructor(e){this.map=e}of(e){return new ve(this,e)}}class ve{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 ve(this.type,t)}is(e){return this.type==e}static define(e={}){return new UE(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let a=r.map(t);a&&n.push(a)}return n}}ve.reconfigure=ve.define();ve.appendConfig=ve.define();class wt{constructor(e,t,n,r,a,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,n&&c2(n,t.newLength),a.some(c=>c.type==wt.time)||(this.annotations=a.concat(wt.time.of(Date.now())))}static create(e,t,n,r,a,o){return new wt(e,t,n,r,a,o)}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(wt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}wt.time=dn.define();wt.userEvent=dn.define();wt.addToHistory=dn.define();wt.remote=dn.define();function qE(i,e){let t=[];for(let n=0,r=0;;){let a,o;if(n<i.length&&(r==e.length||e[r]>=i[n]))a=i[n++],o=i[n++];else if(r<e.length)a=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<a?t.push(a,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function b2(i,e,t){var n;let r,a,o;return t?(r=e.changes,a=vt.empty(e.changes.length),o=i.changes.compose(e.changes)):(r=e.changes.map(i.changes),a=i.changes.mapDesc(e.changes,!0),o=i.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(a):(n=i.selection)===null||n===void 0?void 0:n.map(r),effects:ve.mapEffects(i.effects,r).concat(ve.mapEffects(e.effects,a)),annotations:i.annotations.length?i.annotations.concat(e.annotations):e.annotations,scrollIntoView:i.scrollIntoView||e.scrollIntoView}}function Jp(i,e,t){let n=e.selection,r=rl(e.annotations);return e.userEvent&&(r=r.concat(wt.userEvent.of(e.userEvent))),{changes:e.changes instanceof vt?e.changes:vt.of(e.changes||[],t,i.facet(d2)),selection:n&&(n instanceof W?n:W.single(n.anchor,n.head)),effects:rl(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function x2(i,e,t){let n=Jp(i,e.length?e[0]:{},i.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(t=!1);let o=!!e[a].sequential;n=b2(n,Jp(i,e[a],o?n.changes.newLength:i.doc.length),o)}let r=wt.create(i,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return VE(t?PE(r):r)}function PE(i){let e=i.startState,t=!0;for(let r of e.facet(p2)){let a=r(i);if(a===!1){t=!1;break}Array.isArray(a)&&(t=t===!0?a:qE(t,a))}if(t!==!0){let r,a;if(t===!1)a=i.changes.invertedDesc,r=vt.empty(e.doc.length);else{let o=i.changes.filter(t);r=o.changes,a=o.filtered.mapDesc(o.changes).invertedDesc}i=wt.create(e,r,i.selection&&i.selection.map(a),ve.mapEffects(i.effects,a),i.annotations,i.scrollIntoView)}let n=e.facet(m2);for(let r=n.length-1;r>=0;r--){let a=n[r](i);a instanceof wt?i=a:Array.isArray(a)&&a.length==1&&a[0]instanceof wt?i=a[0]:i=x2(e,rl(a),!1)}return i}function VE(i){let e=i.startState,t=e.facet(g2),n=i;for(let r=t.length-1;r>=0;r--){let a=t[r](i);a&&Object.keys(a).length&&(n=b2(n,Jp(e,a,i.changes.newLength),!0))}return n==i?i:wt.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const QE=[];function rl(i){return i==null?QE:Array.isArray(i)?i:[i]}var it=(function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i})(it||(it={}));const GE=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let $p;try{$p=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function FE(i){if($p)return $p.test(i);for(let e=0;e<i.length;e++){let t=i[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||GE.test(t)))return!0}return!1}function KE(i){return e=>{if(!/\S/.test(e))return it.Space;if(FE(e))return it.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return it.Word;return it.Other}}class je{constructor(e,t,n,r,a,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=a,o&&(o._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)La(this,c<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return La(this,n),Dc(this,n)}update(...e){return x2(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:r}=t;for(let c of e.effects)c.is(oh.reconfigure)?(t&&(r=new Map,t.compartments.forEach((f,d)=>r.set(d,f)),t=null),r.set(c.value.compartment,c.value.extension)):c.is(ve.reconfigure)?(t=null,n=c.value):c.is(ve.appendConfig)&&(t=null,n=rl(n).concat(c.value));let a;t?a=e.startState.values.slice():(t=Rc.resolve(n,r,this),a=new je(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let o=e.startState.facet(Zp)?e.newSelection:e.newSelection.asSingle();new je(t,e.newDoc,o,a,(c,f)=>f.update(c,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:W.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),a=[n.range],o=rl(n.effects);for(let c=1;c<t.ranges.length;c++){let f=e(t.ranges[c]),d=this.changes(f.changes),m=d.map(r);for(let b=0;b<c;b++)a[b]=a[b].map(m);let y=r.mapDesc(d,!0);a.push(f.range.map(y)),r=r.compose(m),o=ve.mapEffects(o,m).concat(ve.mapEffects(rl(f.effects),y))}return{changes:r,selection:W.create(a,t.mainIndex),effects:o}}changes(e=[]){return e instanceof vt?e:vt.of(e,this.doc.length,this.facet(je.lineSeparator))}toText(e){return _e.of(e.split(this.facet(je.lineSeparator)||Kp))}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:(La(this,t),Dc(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Ut&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let a in n)if(Object.prototype.hasOwnProperty.call(e,a)){let o=n[a],c=e[a];r.push(o.init(f=>o.spec.fromJSON(c,f)))}}return je.create({doc:e.doc,selection:W.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Rc.resolve(e.extensions||[],new Map),n=e.doc instanceof _e?e.doc:_e.of((e.doc||"").split(t.staticFacet(je.lineSeparator)||Kp)),r=e.selection?e.selection instanceof W?e.selection:W.single(e.selection.anchor,e.selection.head):W.single(0);return c2(r,n.length),t.staticFacet(Zp)||(r=r.asSingle()),new je(t,n,r,t.dynamicSlots.map(()=>null),(a,o)=>o.create(a),null)}get tabSize(){return this.facet(je.tabSize)}get lineBreak(){return this.facet(je.lineSeparator)||`
|
|
15
|
+
`}get readOnly(){return this.facet(y2)}phrase(e,...t){for(let n of this.facet(je.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let a=+(r||1);return!a||a>t.length?n:t[a-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let a of this.facet(f2))for(let o of a(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return KE(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),a=this.charCategorizer(e),o=e-n,c=e-n;for(;o>0;){let f=Mt(t,o,!1);if(a(t.slice(f,o))!=it.Word)break;o=f}for(;c<r;){let f=Mt(t,c);if(a(t.slice(c,f))!=it.Word)break;c=f}return o==c?null:W.range(o+n,c+n)}}je.allowMultipleSelections=Zp;je.tabSize=re.define({combine:i=>i.length?i[0]:4});je.lineSeparator=d2;je.readOnly=y2;je.phrases=re.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});je.languageData=f2;je.changeFilter=p2;je.transactionFilter=m2;je.transactionExtender=g2;oh.reconfigure=ve.define();function pn(i,e,t={}){let n={};for(let r of i)for(let a of Object.keys(r)){let o=r[a],c=n[a];if(c===void 0)n[a]=o;else if(!(c===o||o===void 0))if(Object.hasOwnProperty.call(t,a))n[a]=t[a](c,o);else throw new Error("Config merge conflict for field "+a)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class Cs{eq(e){return this==e}range(e,t=e){return em.create(e,t,this)}}Cs.prototype.startSide=Cs.prototype.endSide=0;Cs.prototype.point=!1;Cs.prototype.mapMode=Ft.TrackDel;function ig(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}let em=class v2{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new v2(e,t,n)}};function tm(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class ng{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let a=n?this.to:this.from;for(let o=r,c=a.length;;){if(o==c)return o;let f=o+c>>1,d=a[f]-e||(n?this.value[f].endSide:this.value[f].startSide)-t;if(f==o)return d>=0?o:c;d>=0?c=f:o=f+1}}between(e,t,n,r){for(let a=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,a);a<o;a++)if(r(this.from[a]+e,this.to[a]+e,this.value[a])===!1)return!1}map(e,t){let n=[],r=[],a=[],o=-1,c=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],m=this.from[f]+e,y=this.to[f]+e,b,x;if(m==y){let w=t.mapPos(m,d.startSide,d.mapMode);if(w==null||(b=x=w,d.startSide!=d.endSide&&(x=t.mapPos(m,d.endSide),x<b)))continue}else if(b=t.mapPos(m,d.startSide),x=t.mapPos(y,d.endSide),b>x||b==x&&d.startSide>0&&d.endSide<=0)continue;(x-b||d.endSide-d.startSide)<0||(o<0&&(o=b),d.point&&(c=Math.max(c,x-b)),n.push(d),r.push(b-o),a.push(x-o))}return{mapped:n.length?new ng(r,a,n,c):null,pos:o}}}class Ee{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new Ee(e,t,n,r)}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:n=!1,filterFrom:r=0,filterTo:a=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(tm)),this.isEmpty)return t.length?Ee.of(t):this;let c=new S2(this,null,-1).goto(0),f=0,d=[],m=new Un;for(;c.value||f<t.length;)if(f<t.length&&(c.from-t[f].from||c.startSide-t[f].value.startSide)>=0){let y=t[f++];m.addInner(y.from,y.to,y.value)||d.push(y)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(f==t.length||this.chunkEnd(c.chunkIndex)<t[f].from)&&(!o||r>this.chunkEnd(c.chunkIndex)||a<this.chunkPos[c.chunkIndex])&&m.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!o||r>c.to||a<c.from||o(c.from,c.to,c.value))&&(m.addInner(c.from,c.to,c.value)||d.push(em.create(c.from,c.to,c.value))),c.next());return m.finishInner(this.nextLayer.isEmpty&&!d.length?Ee.empty:this.nextLayer.update({add:d,filter:o,filterFrom:r,filterTo:a}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let c=this.chunkPos[o],f=this.chunk[o],d=e.touchesRange(c,c+f.length);if(d===!1)r=Math.max(r,f.maxPoint),t.push(f),n.push(e.mapPos(c));else if(d===!0){let{mapped:m,pos:y}=f.map(c,e);m&&(r=Math.max(r,m.maxPoint),t.push(m),n.push(y))}}let a=this.nextLayer.map(e);return t.length==0?a:new Ee(n,t,a||Ee.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let a=this.chunkPos[r],o=this.chunk[r];if(t>=a&&e<=a+o.length&&o.between(a,e-a,t-a,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Ya.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ya.from(e).goto(t)}static compare(e,t,n,r,a=-1){let o=e.filter(y=>y.maxPoint>0||!y.isEmpty&&y.maxPoint>=a),c=t.filter(y=>y.maxPoint>0||!y.isEmpty&&y.maxPoint>=a),f=y1(o,c,n),d=new Ma(o,f,a),m=new Ma(c,f,a);n.iterGaps((y,b,x)=>b1(d,y,m,b,x,r)),n.empty&&n.length==0&&b1(d,0,m,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let a=e.filter(m=>!m.isEmpty&&t.indexOf(m)<0),o=t.filter(m=>!m.isEmpty&&e.indexOf(m)<0);if(a.length!=o.length)return!1;if(!a.length)return!0;let c=y1(a,o),f=new Ma(a,c,0).goto(n),d=new Ma(o,c,0).goto(n);for(;;){if(f.to!=d.to||!im(f.active,d.active)||f.point&&(!d.point||!ig(f.point,d.point)))return!1;if(f.to>r)return!0;f.next(),d.next()}}static spans(e,t,n,r,a=-1){let o=new Ma(e,null,a).goto(t),c=t,f=o.openStart;for(;;){let d=Math.min(o.to,n);if(o.point){let m=o.activeForPoint(o.to),y=o.pointFrom<t?m.length+1:o.point.startSide<0?m.length:Math.min(m.length,f);r.point(c,d,o.point,m,y,o.pointRank),f=Math.min(o.openEnd(d),m.length)}else d>c&&(r.span(c,d,o.active,f),f=o.openEnd(d));if(o.to>n)return f+(o.point&&o.to>n?1:0);c=o.to,o.next()}}static of(e,t=!1){let n=new Un;for(let r of e instanceof em?[e]:t?YE(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return Ee.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=Ee.empty;r=r.nextLayer)t=new Ee(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}Ee.empty=new Ee([],[],null,-1);function YE(i){if(i.length>1)for(let e=i[0],t=1;t<i.length;t++){let n=i[t];if(tm(e,n)>0)return i.slice().sort(tm);e=n}return i}Ee.empty.nextLayer=Ee.empty;class Un{finishChunk(e){this.chunks.push(new ng(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,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Un)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<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=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.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 n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ee.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ee.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function y1(i,e,t){let n=new Map;for(let a of i)for(let o=0;o<a.chunk.length;o++)a.chunk[o].maxPoint<=0&&n.set(a.chunk[o],a.chunkPos[o]);let r=new Set;for(let a of e)for(let o=0;o<a.chunk.length;o++){let c=n.get(a.chunk[o]);c!=null&&(t?t.mapPos(c):c)==a.chunkPos[o]&&!t?.touchesRange(c,c+a.chunk[o].length)&&r.add(a.chunk[o])}return r}class S2{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}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,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}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],n=e+t.from[this.rangeIndex];if(this.from=n,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 Ya{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let a=0;a<e.length;a++)for(let o=e[a];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new S2(o,t,n,a));return r.length==1?r[0]:new Ya(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)ep(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)ep(this.heap,n);(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(),ep(this.heap,0)}}}function ep(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1<i.length&&r.compare(i[n+1])>=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}class Ma{constructor(e,t,n){this.minPoint=n,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=Ya.from(e,t,n)}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){Vu(this.active,e),Vu(this.activeTo,e),Vu(this.activeRank,e),this.minActive=x1(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:a}=this.cursor;for(;t<this.activeRank.length&&(a-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Qu(this.active,t,n),Qu(this.activeTo,t,r),Qu(this.activeRank,t,a),e&&Qu(e,t,this.cursor.from),this.minActive=x1(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Vu(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function b1(i,e,t,n,r,a){i.goto(e),t.goto(n);let o=n+r,c=n,f=n-e,d=!!a.boundChange;for(let m=!1;;){let y=i.to+f-t.to,b=y||i.endSide-t.endSide,x=b<0?i.to+f:t.to,w=Math.min(x,o);if(i.point||t.point?(i.point&&t.point&&ig(i.point,t.point)&&im(i.activeForPoint(i.to),t.activeForPoint(t.to))||a.comparePoint(c,w,i.point,t.point),m=!1):(m&&a.boundChange(c),w>c&&!im(i.active,t.active)&&a.compareRange(c,w,i.active,t.active),d&&w<o&&(y||i.openEnd(x)!=t.openEnd(x))&&(m=!0)),x>o)break;c=x,b<=0&&i.next(),b>=0&&t.next()}}function im(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t]&&!ig(i[t],e[t]))return!1;return!0}function Vu(i,e){for(let t=e,n=i.length-1;t<n;t++)i[t]=i[t+1];i.pop()}function Qu(i,e,t){for(let n=i.length-1;n>=e;n--)i[n+1]=i[n];i[e]=t}function x1(i,e){let t=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||i[r].endSide-i[t].endSide)<0&&(t=r,n=e[r]);return t}function Cl(i,e,t=i.length){let n=0;for(let r=0;r<t&&r<i.length;)i.charCodeAt(r)==9?(n+=e-n%e,r++):(n++,r=Mt(i,r));return n}function nm(i,e,t,n){for(let r=0,a=0;;){if(a>=e)return r;if(r==i.length)break;a+=i.charCodeAt(r)==9?t-a%t:1,r=Mt(i,r)}return n===!0?-1:i.length}const sm="ͼ",v1=typeof Symbol>"u"?"__"+sm:Symbol.for(sm),rm=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),S1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class As{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function a(o,c,f,d){let m=[],y=/^@(\w+)\b/.exec(o[0]),b=y&&y[1]=="keyframes";if(y&&c==null)return f.push(o[0]+";");for(let x in c){let w=c[x];if(/&/.test(x))a(x.split(/,\s*/).map(k=>o.map(C=>k.replace(/&/,C))).reduce((k,C)=>k.concat(C)),w,f);else if(w&&typeof w=="object"){if(!y)throw new RangeError("The value of a property ("+x+") should be a primitive value.");a(r(x),w,m,b)}else w!=null&&m.push(x.replace(/_.*/,"").replace(/[A-Z]/g,k=>"-"+k.toLowerCase())+": "+w+";")}(m.length||b)&&f.push((n&&!y&&!d?o.map(n):o).join(", ")+" {"+m.join(" ")+"}")}for(let o in e)a(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
16
|
+
`)}static newName(){let e=S1[v1]||1;return S1[v1]=e+1,sm+e.toString(36)}static mount(e,t,n){let r=e[rm],a=n&&n.nonce;r?a&&r.setNonce(a):r=new IE(e,a),r.mount(Array.isArray(t)?t:[t],e)}}let w1=new Map;class IE{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let a=w1.get(n);if(a)return e[rm]=a;this.sheet=new r.CSSStyleSheet,w1.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[rm]=this}mount(e,t){let n=this.sheet,r=0,a=0;for(let o=0;o<e.length;o++){let c=e[o],f=this.modules.indexOf(c);if(f<a&&f>-1&&(this.modules.splice(f,1),a--,f=-1),f==-1){if(this.modules.splice(a++,0,c),n)for(let d=0;d<c.rules.length;d++)n.insertRule(c.rules[d],r++)}else{for(;a<f;)r+=this.modules[a++].rules.length;r+=c.rules.length,a++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let f=0;f<this.modules.length;f++)o+=this.modules[f].getRules()+`
|
|
17
|
+
`;this.styleTag.textContent=o;let c=t.head||t;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ms={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:"'"},Ia={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},WE=typeof navigator<"u"&&/Mac/.test(navigator.platform),XE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Bt=0;Bt<10;Bt++)Ms[48+Bt]=Ms[96+Bt]=String(Bt);for(var Bt=1;Bt<=24;Bt++)Ms[Bt+111]="F"+Bt;for(var Bt=65;Bt<=90;Bt++)Ms[Bt]=String.fromCharCode(Bt+32),Ia[Bt]=String.fromCharCode(Bt);for(var tp in Ms)Ia.hasOwnProperty(tp)||(Ia[tp]=Ms[tp]);function ZE(i){var e=WE&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||XE&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Ia:Ms)[i.keyCode]||i.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}function Ye(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];typeof r=="string"?i.setAttribute(n,r):r!=null&&(i[n]=r)}e++}for(;e<arguments.length;e++)w2(i,arguments[e]);return i}function w2(i,e){if(typeof e=="string")i.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)i.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)w2(i,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Gt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},lm=typeof document<"u"?document:{documentElement:{style:{}}};const am=/Edge\/(\d+)/.exec(Gt.userAgent),k2=/MSIE \d/.test(Gt.userAgent),om=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gt.userAgent),uh=!!(k2||om||am),k1=!uh&&/gecko\/(\d+)/i.test(Gt.userAgent),ip=!uh&&/Chrome\/(\d+)/.exec(Gt.userAgent),JE="webkitFontSmoothing"in lm.documentElement.style,um=!uh&&/Apple Computer/.test(Gt.vendor),C1=um&&(/Mobile\/\w+/.test(Gt.userAgent)||Gt.maxTouchPoints>2);var se={mac:C1||/Mac/.test(Gt.platform),windows:/Win/.test(Gt.platform),linux:/Linux|X11/.test(Gt.platform),ie:uh,ie_version:k2?lm.documentMode||6:om?+om[1]:am?+am[1]:0,gecko:k1,gecko_version:k1?+(/Firefox\/(\d+)/.exec(Gt.userAgent)||[0,0])[1]:0,chrome:!!ip,chrome_version:ip?+ip[1]:0,ios:C1,android:/Android\b/.test(Gt.userAgent),webkit_version:JE?+(/\bAppleWebKit\/(\d+)/.exec(Gt.userAgent)||[0,0])[1]:0,safari:um,safari_version:um?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gt.userAgent)||[0,0])[1]:0,tabSize:lm.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function sg(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}const jc=Object.create(null);function rg(i,e,t){if(i==e)return!0;i||(i=jc),e||(e=jc);let n=Object.keys(i),r=Object.keys(e);if(n.length-0!=r.length-0)return!1;for(let a of n)if(a!=t&&(r.indexOf(a)==-1||i[a]!==e[a]))return!1;return!0}function $E(i,e){for(let t=i.attributes.length-1;t>=0;t--){let n=i.attributes[t].name;e[n]==null&&i.removeAttribute(n)}for(let t in e){let n=e[t];t=="style"?i.style.cssText=n:i.getAttribute(t)!=n&&i.setAttribute(t,n)}}function A1(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function eN(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let n=i.attributes[t];e[n.name]=n.value}return e}class mn{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,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Lt=(function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i})(Lt||(Lt={}));class me extends Cs{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new fo(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new ur(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:a,end:o}=C2(e,t);n=(a?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new ur(e,n,r,t,e.widget||null,!0)}static line(e){return new po(e)}static set(e,t=!1){return Ee.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}me.none=Ee.empty;class fo extends me{constructor(e){let{start:t,end:n}=C2(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?sg(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||jc}eq(e){return this==e||e instanceof fo&&this.tagName==e.tagName&&rg(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)}}fo.prototype.point=!1;class po extends me{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof po&&this.spec.class==e.spec.class&&rg(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)}}po.prototype.mapMode=Ft.TrackBefore;po.prototype.point=!0;class ur extends me{constructor(e,t,n,r,a,o){super(t,n,a,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?Ft.TrackBefore:Ft.TrackAfter:Ft.TrackDel}get type(){return this.startSide!=this.endSide?Lt.WidgetRange:this.startSide<=0?Lt.WidgetBefore:Lt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ur&&tN(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)}}ur.prototype.point=!0;function C2(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function tN(i,e){return i==e||!!(i&&e&&i.compare(e))}function ll(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}class Wa extends Cs{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof Wa&&this.tagName==e.tagName&&rg(this.attributes,e.attributes)}static create(e){return new Wa(e.tagName,e.attributes||jc)}static set(e,t=!1){return Ee.of(e,t)}}Wa.prototype.startSide=Wa.prototype.endSide=-1;function Xa(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function cm(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function za(i,e){if(!e.anchorNode)return!1;try{return cm(i,e.anchorNode)}catch{return!1}}function Ha(i){return i.nodeType==3?Ja(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function _a(i,e,t,n){return t?M1(i,e,t,n,-1)||M1(i,e,t,n,1):!1}function Ts(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Bc(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function M1(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:qn(i))){if(i.nodeName=="DIV")return!1;let a=i.parentNode;if(!a||a.nodeType!=1)return!1;e=Ts(i)+(r<0?0:1),i=a}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?qn(i):0}else return!1}}function qn(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Za(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function iN(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function A2(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function nN(i,e,t,n,r,a,o,c){let f=i.ownerDocument,d=f.defaultView||window;for(let m=i,y=!1;m&&!y;)if(m.nodeType==1){let b,x=m==f.body,w=1,k=1;if(x)b=iN(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(m).position)&&(y=!0),m.scrollHeight<=m.clientHeight&&m.scrollWidth<=m.clientWidth){m=m.assignedSlot||m.parentNode;continue}let R=m.getBoundingClientRect();({scaleX:w,scaleY:k}=A2(m,R)),b={left:R.left,right:R.left+m.clientWidth*w,top:R.top,bottom:R.top+m.clientHeight*k}}let C=0,M=0;if(r=="nearest")e.top<b.top?(M=e.top-(b.top+o),t>0&&e.bottom>b.bottom+M&&(M=e.bottom-b.bottom+o)):e.bottom>b.bottom&&(M=e.bottom-b.bottom+o,t<0&&e.top-M<b.top&&(M=e.top-(b.top+o)));else{let R=e.bottom-e.top,D=b.bottom-b.top;M=(r=="center"&&R<=D?e.top+R/2-D/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-D+o)-b.top}if(n=="nearest"?e.left<b.left?(C=e.left-(b.left+a),t>0&&e.right>b.right+C&&(C=e.right-b.right+a)):e.right>b.right&&(C=e.right-b.right+a,t<0&&e.left<b.left+C&&(C=e.left-(b.left+a))):C=(n=="center"?e.left+(e.right-e.left)/2-(b.right-b.left)/2:n=="start"==c?e.left-a:e.right-(b.right-b.left)+a)-b.left,C||M)if(x)d.scrollBy(C,M);else{let R=0,D=0;if(M){let Q=m.scrollTop;m.scrollTop+=M/k,D=(m.scrollTop-Q)*k}if(C){let Q=m.scrollLeft;m.scrollLeft+=C/w,R=(m.scrollLeft-Q)*w}e={left:e.left-R,top:e.top-D,right:e.right-R,bottom:e.bottom-D},R&&Math.abs(R-C)<1&&(n="nearest"),D&&Math.abs(D-M)<1&&(r="nearest")}if(x)break;(e.top<b.top||e.bottom>b.bottom||e.left<b.left||e.right>b.right)&&(e={left:Math.max(e.left,b.left),right:Math.min(e.right,b.right),top:Math.max(e.top,b.top),bottom:Math.min(e.bottom,b.bottom)}),m=m.assignedSlot||m.parentNode}else if(m.nodeType==11)m=m.host;else break}function sN(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}class rN{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:n}=e;this.set(t,Math.min(e.anchorOffset,t?qn(t):0),n,Math.min(e.focusOffset,n?qn(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Js=null;se.safari&&se.safari_version>=26&&(Js=!1);function M2(i){if(i.setActive)return i.setActive();if(Js)return i.focus(Js);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Js==null?{get preventScroll(){return Js={preventScroll:!0},!0}}:void 0),!Js){Js=!1;for(let t=0;t<e.length;){let n=e[t++],r=e[t++],a=e[t++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=a&&(n.scrollLeft=a)}}}let T1;function Ja(i,e,t=e){let n=T1||(T1=document.createRange());return n.setEnd(i,t),n.setStart(i,e),n}function al(i,e,t,n){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let a=new KeyboardEvent("keydown",r);a.synthetic=!0,i.dispatchEvent(a);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,i.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function lN(i){for(;i;){if(i&&(i.nodeType==9||i.nodeType==11&&i.host))return i;i=i.assignedSlot||i.parentNode}return null}function aN(i,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,qn(t));;)if(n){if(t.nodeType!=1)return!1;let r=t.childNodes[n-1];r.contentEditable=="false"?n--:(t=r,n=qn(t))}else{if(t==i)return!0;n=Ts(t),t=t.parentNode}}function T2(i){return i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function O2(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=qn(t)}else if(t.parentNode&&!Bc(t))n=Ts(t),t=t.parentNode;else return null}}function E2(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n<t.nodeValue.length)return{node:t,offset:n};if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!Bc(t))n=Ts(t)+1,t=t.parentNode;else return null}}class Qi{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Qi(e.parentNode,Ts(e),t)}static after(e,t){return new Qi(e.parentNode,Ts(e)+1,t)}}var Xe=(function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i})(Xe||(Xe={}));const cr=Xe.LTR,lg=Xe.RTL;function N2(i){let e=[];for(let t=0;t<i.length;t++)e.push(1<<+i[t]);return e}const oN=N2("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),uN=N2("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),hm=Object.create(null),en=[];for(let i of["()","[]","{}"]){let e=i.charCodeAt(0),t=i.charCodeAt(1);hm[e]=t,hm[t]=-e}function R2(i){return i<=247?oN[i]:1424<=i&&i<=1524?2:1536<=i&&i<=1785?uN[i-1536]:1774<=i&&i<=2220?4:8192<=i&&i<=8204?256:64336<=i&&i<=65023?4:1}const cN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class on{get dir(){return this.level%2?lg:cr}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let a=-1;for(let o=0;o<e.length;o++){let c=e[o];if(c.from<=t&&c.to>=t){if(c.level==n)return o;(a<0||(r!=0?r<0?c.from<t:c.to>t:e[a].level>c.level))&&(a=o)}}if(a<0)throw new RangeError("Index out of range");return a}}function D2(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++){let n=i[t],r=e[t];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!D2(n.inner,r.inner))return!1}return!0}const We=[];function hN(i,e,t,n,r){for(let a=0;a<=n.length;a++){let o=a?n[a-1].to:e,c=a<n.length?n[a].from:t,f=a?256:r;for(let d=o,m=f,y=f;d<c;d++){let b=R2(i.charCodeAt(d));b==512?b=m:b==8&&y==4&&(b=16),We[d]=b==4?2:b,b&7&&(y=b),m=b}for(let d=o,m=f,y=f;d<c;d++){let b=We[d];if(b==128)d<c-1&&m==We[d+1]&&m&24?b=We[d]=m:We[d]=256;else if(b==64){let x=d+1;for(;x<c&&We[x]==64;)x++;let w=d&&m==8||x<t&&We[x]==8?y==1?1:8:256;for(let k=d;k<x;k++)We[k]=w;d=x-1}else b==8&&y==1&&(We[d]=1);m=b,b&7&&(y=b)}}}function fN(i,e,t,n,r){let a=r==1?2:1;for(let o=0,c=0,f=0;o<=n.length;o++){let d=o?n[o-1].to:e,m=o<n.length?n[o].from:t;for(let y=d,b,x,w;y<m;y++)if(x=hm[b=i.charCodeAt(y)])if(x<0){for(let k=c-3;k>=0;k-=3)if(en[k+1]==-x){let C=en[k+2],M=C&2?r:C&4?C&1?a:r:0;M&&(We[y]=We[en[k]]=M),c=k;break}}else{if(en.length==189)break;en[c++]=y,en[c++]=b,en[c++]=f}else if((w=We[y])==2||w==1){let k=w==r;f=k?0:1;for(let C=c-3;C>=0;C-=3){let M=en[C+2];if(M&2)break;if(k)en[C+2]|=2;else{if(M&4)break;en[C+2]|=4}}}}}function dN(i,e,t,n){for(let r=0,a=n;r<=t.length;r++){let o=r?t[r-1].to:i,c=r<t.length?t[r].from:e;for(let f=o;f<c;){let d=We[f];if(d==256){let m=f+1;for(;;)if(m==c){if(r==t.length)break;m=t[r++].to,c=r<t.length?t[r].from:e}else if(We[m]==256)m++;else break;let y=a==1,b=(m<e?We[m]:n)==1,x=y==b?y?1:2:n;for(let w=m,k=r,C=k?t[k-1].to:i;w>f;)w==C&&(w=t[--k].from,C=k?t[k-1].to:i),We[--w]=x;f=m}else a=d,f++}}}function fm(i,e,t,n,r,a,o){let c=n%2?2:1;if(n%2==r%2)for(let f=e,d=0;f<t;){let m=!0,y=!1;if(d==a.length||f<a[d].from){let k=We[f];k!=c&&(m=!1,y=k==16)}let b=!m&&c==1?[]:null,x=m?n:n+1,w=f;e:for(;;)if(d<a.length&&w==a[d].from){if(y)break e;let k=a[d];if(!m)for(let C=k.to,M=d+1;;){if(C==t)break e;if(M<a.length&&a[M].from==C)C=a[M++].to;else{if(We[C]==c)break e;break}}if(d++,b)b.push(k);else{k.from>f&&o.push(new on(f,k.from,x));let C=k.direction==cr!=!(x%2);dm(i,C?n+1:n,r,k.inner,k.from,k.to,o),f=k.to}w=k.to}else{if(w==t||(m?We[w]!=c:We[w]==c))break;w++}b?fm(i,f,w,n+1,r,b,o):f<w&&o.push(new on(f,w,x)),f=w}else for(let f=t,d=a.length;f>e;){let m=!0,y=!1;if(!d||f>a[d-1].to){let k=We[f-1];k!=c&&(m=!1,y=k==16)}let b=!m&&c==1?[]:null,x=m?n:n+1,w=f;e:for(;;)if(d&&w==a[d-1].to){if(y)break e;let k=a[--d];if(!m)for(let C=k.from,M=d;;){if(C==e)break e;if(M&&a[M-1].to==C)C=a[--M].from;else{if(We[C-1]==c)break e;break}}if(b)b.push(k);else{k.to<f&&o.push(new on(k.to,f,x));let C=k.direction==cr!=!(x%2);dm(i,C?n+1:n,r,k.inner,k.from,k.to,o),f=k.from}w=k.from}else{if(w==e||(m?We[w-1]!=c:We[w-1]==c))break;w--}b?fm(i,w,f,n+1,r,b,o):w<f&&o.push(new on(w,f,x)),f=w}}function dm(i,e,t,n,r,a,o){let c=e%2?2:1;hN(i,r,a,n,c),fN(i,r,a,n,c),dN(r,a,n,c),fm(i,r,a,e,t,n,o)}function pN(i,e,t){if(!i)return[new on(0,0,e==lg?1:0)];if(e==cr&&!t.length&&!cN.test(i))return j2(i.length);if(t.length)for(;i.length>We.length;)We[We.length]=256;let n=[],r=e==cr?0:1;return dm(i,r,r,t,0,i.length,n),n}function j2(i){return[new on(0,i,0)]}let B2="";function mN(i,e,t,n,r){var a;let o=n.head-i.from,c=on.find(e,o,(a=n.bidiLevel)!==null&&a!==void 0?a:-1,n.assoc),f=e[c],d=f.side(r,t);if(o==d){let b=c+=r?1:-1;if(b<0||b>=e.length)return null;f=e[c=b],o=f.side(!r,t),d=f.side(r,t)}let m=Mt(i.text,o,f.forward(r,t));(m<f.from||m>f.to)&&(m=d),B2=i.text.slice(Math.min(o,m),Math.max(o,m));let y=c==(r?e.length-1:0)?null:e[c+(r?1:-1)];return y&&m==d&&y.level+(r?0:1)<f.level?W.cursor(y.side(!r,t)+i.from,y.forward(r,t)?1:-1,y.level):W.cursor(m+i.from,f.forward(r,t)?-1:1,f.level)}function gN(i,e,t){for(let n=e;n<t;n++){let r=R2(i.charCodeAt(n));if(r==1)return cr;if(r==2||r==4)return lg}return cr}const L2=re.define(),z2=re.define(),H2=re.define(),_2=re.define(),pm=re.define(),U2=re.define(),q2=re.define(),ag=re.define(),og=re.define(),P2=re.define({combine:i=>i.some(e=>e)}),V2=re.define({combine:i=>i.some(e=>e)}),Q2=re.define();class ol{constructor(e,t="nearest",n="nearest",r=5,a=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=a,this.isSnapshot=o}map(e){return e.empty?this:new ol(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 ol(W.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Gu=ve.define({map:(i,e)=>i.map(e)}),G2=ve.define();function ni(i,e,t){let n=i.facet(_2);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const zn=re.define({combine:i=>i.length?i[0]:!0});let yN=0;const el=re.define({combine(i){return i.filter((e,t)=>{for(let n=0;n<t;n++)if(i[n].plugin==e.plugin)return!1;return!0})}});class at{constructor(e,t,n,r,a){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(el.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(el.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:a,decorations:o}=t||{};return new at(yN++,e,n,r,c=>{let f=[];return o&&f.push(ch.of(d=>{let m=d.plugin(c);return m?o(m):me.none})),a&&f.push(a(c)),f})}static fromClass(e,t){return at.define((n,r)=>new e(n,r),t)}}class np{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(n){if(ni(t.state,n,"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){ni(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(n){ni(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const F2=re.define(),ug=re.define(),ch=re.define(),K2=re.define(),cg=re.define(),mo=re.define(),Y2=re.define();function O1(i,e){let t=i.state.facet(Y2);if(!t.length)return t;let n=t.map(a=>a instanceof Function?a(i):a),r=[];return Ee.spans(n,e.from,e.to,{point(){},span(a,o,c,f){let d=a-e.from,m=o-e.from,y=r;for(let b=c.length-1;b>=0;b--,f--){let x=c[b].spec.bidiIsolate,w;if(x==null&&(x=gN(e.text,d,m)),f>0&&y.length&&(w=y[y.length-1]).to==d&&w.direction==x)w.to=m,y=w.inner;else{let k={from:d,to:m,direction:x,inner:[]};y.push(k),y=k.inner}}}}),r}const I2=re.define();function hg(i){let e=0,t=0,n=0,r=0;for(let a of i.state.facet(I2)){let o=a(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}const Na=re.define();class ji{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new ji(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,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let r=0,a=0,o=0;;){let c=r<e.length?e[r].fromB:1e9,f=a<t.length?t[a]:1e9,d=Math.min(c,f);if(d==1e9)break;let m=d+o,y=d,b=m;for(;;)if(a<t.length&&t[a]<=y){let x=t[a+1];a+=2,y=Math.max(y,x);for(let w=r;w<e.length&&e[w].fromB<=y;w++)o=e[w].toA-e[w].toB;b=Math.max(b,x+o)}else if(r<e.length&&e[r].fromB<=y){let x=e[r++];y=Math.max(y,x.toB),b=Math.max(b,x.toA),o=x.toA-x.toB}else break;n.push(new ji(m,b,d,y))}return n}}class Lc{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=vt.empty(this.startState.doc.length);for(let a of n)this.changes=this.changes.compose(a.changes);let r=[];this.changes.iterChangedRanges((a,o,c,f)=>r.push(new ji(a,o,c,f))),this.changedRanges=r}static create(e,t,n){return new Lc(e,t,n)}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 bN=[];class bt{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return bN}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&&$E(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 n=t;for(let r of this.children){if(r==e)return n;n+=r.length+r.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 n=Ts(this.dom),r=this.length?e>0:t>0;return new Qi(this.parent.dom,n+(r?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 fh)return e;return null}static get(e){return e.cmTile}}class hh extends bt{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,n=null,r,a=e?.node==t?e:null,o=0;for(let c of this.children){if(c.sync(e),o+=c.length+c.breakAfter,r=n?n.nextSibling:t.firstChild,a&&r!=c.dom&&(a.written=!0),c.dom.parentNode==t)for(;r&&r!=c.dom;)r=E1(r);else t.insertBefore(c.dom,r);n=c.dom}for(r=n?n.nextSibling:t.firstChild,a&&r&&(a.written=!0);r;)r=E1(r);this.length=o}}function E1(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}class fh extends hh{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=bt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,a=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&a++,r=t.pop()}else{let o=n.children[r++];if(o instanceof Hn)t.push(r),n=o,r=0;else{let c=a+o.length,f=e(o,a);if(f!==void 0)return f;a=c+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,a,o=-1;if(this.blockTiles((c,f)=>{let d=f+c.length;if(e>=f&&e<=d){if(c.isWidget()&&t>=-1&&t<=1){if(c.flags&32)return!0;c.flags&16&&(n=void 0)}(f<e||e==d&&(t<-1?c.length:c.covers(1)))&&(!n||!c.isWidget()&&n.isWidget())&&(n=c,r=e-f),(d>e||e==f&&(t>1?c.length:c.covers(-1)))&&(!a||!c.isWidget()&&a.isWidget())&&(a=c,o=e-f)}}),!n&&!a)throw new Error("No tile at position "+e);return n&&t<0||!a?{tile:n,offset:r}:{tile:a,offset:o}}}class Hn extends hh{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 n=new Hn(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class pl extends hh{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new pl(t||document.createElement("div"),e);return(!t||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,a=-1,o=null,c=-1;function f(m,y){for(let b=0,x=0;b<m.children.length&&x<=y;b++){let w=m.children[b],k=x+w.length;k>=y&&(w.isComposite()?f(w,y-x):(!o||o.isHidden&&(t>0||n&&vN(o,w)))&&(k>y||w.flags&32)?(o=w,c=y-x):(x<y||w.flags&16&&!w.isHidden)&&(r=w,a=y-x)),x=k}}f(this,e);let d=(t<0?r:o)||r||o;return d?{tile:d,offset:d==r?a:c}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):xN(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:r,offset:a}=n;if(this.dom.contains(r.dom))return r.isText()?new Qi(r.dom,Math.min(r.dom.nodeValue.length,a)):r.domPosFor(a,r.flags&16?1:r.flags&32?-1:t);let o=n.tile.parent,c=!1;for(let f of o.children){if(c)return new Qi(f.dom,0);f==n.tile&&(c=!0)}}return new Qi(this.dom,0)}}function xN(i){let e=i.dom.lastChild;if(!e)return i.dom.getBoundingClientRect();let t=Ha(e);return t[t.length-1]||null}function vN(i,e){let t=i.coordsIn(0,1),n=e.coordsIn(0,1);return t&&n&&n.top<t.bottom}class ii extends hh{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new ii(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class nr extends bt{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 n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,a=e,o=0;e==0&&t<0||e==n&&t>=0?se.chrome||se.gecko||(e?(r--,o=1):a<n&&(a++,o=-1)):t<0?r--:a<n&&a++;let c=Ja(this.dom,r,a).getClientRects();if(!c.length)return null;let f=c[(o?o<0:t>=0)?0:c.length-1];return se.safari&&!o&&f.width==0&&(f=Array.prototype.find.call(c,d=>d.width)||f),o?Za(f,o<0):f||null}static of(e,t){let n=new nr(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class hr extends bt{constructor(e,t,n,r){super(e,t,r),this.widget=n}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,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Za(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let a=this.dom.getClientRects(),o=null;if(!a.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=c?a.length-1:0;o=a[f],!(e>0?f==0:f==a.length-1||o.top<o.bottom);f+=c?-1:1);return Za(o,!c)}}get overrideDOMText(){if(!this.length)return _e.empty;let{root:e}=this;if(!e)return _e.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,n,r,a){return a||(a=e.toDOM(t),e.editable||(a.contentEditable="false")),new hr(a,n,e,r)}}class zc extends bt{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 _e.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class SN{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:a,beforeBreak:o,parents:c}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(a==r.children.length){if(!e&&!c.length)break;n&&n.leave(r),o=!!r.breakAfter,{tile:r,index:a}=c.pop(),a++}else{let f=r.children[a],d=f.breakAfter;(t>0?f.length<=e:f.length<e)&&(!n||n.skip(f,0,f.length)!==!1||!f.isComposite)?(o=!!d,a++,e-=f.length):(c.push({tile:r,index:a}),r=f,a=0,n&&f.isComposite()&&n.enter(f))}else if(a==r.length)o=!!r.breakAfter,{tile:r,index:a}=c.pop(),a++;else if(e){let f=Math.min(e,r.length-a);n&&n.skip(r,a,a+f),e-=f,a+=f}else break;return this.tile=r,this.index=a,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class wN{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class kN{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var a;this.flushBuffer();let o=this.ensureMarks(t,n),c=o.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let f=o.children[o.children.length-1]=new nr(c.dom,c.text+e);f.parent=o}else o.append(r||nr.of(e,(a=this.cache.find(nr))===null||a===void 0?void 0:a.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?sp(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let c=t.marks.length-1;c>=0;c--){let f=t.marks[c],d=r.lastChild;if(d instanceof ii&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(sp(f.dom)),r=d;else{if(this.cache.reused.get(f)){let y=bt.get(f.dom);y&&y.setDOM(sp(f.dom))}let m=ii.of(f.mark,f.dom);r.append(m),r=m}this.cache.reused.set(f,2)}let a=bt.get(e.text);a&&this.cache.reused.set(a,2);let o=new nr(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let a=this.ensureMarks(t,n);!r&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).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 n;e||(e=W2);let r=pl.start(e,t||((n=this.cache.find(pl))===null||n===void 0?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}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 n;let r=this.curLine;for(let a=e.length-1;a>=0;a--){let o=e[a],c;if(t>0&&(c=r.lastChild)&&c instanceof ii&&c.mark.eq(o))r=c,t--;else{let f=ii.of(o,(n=this.cache.find(ii,d=>d.mark.eq(o)))===null||n===void 0?void 0:n.dom);r.append(f),r=f,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!N1(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(se.ios&&N1(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(rp,0,32)||new hr(rp.toDOM(),0,rp,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 wN(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof Hn&&r.wrapper.eq(n.wrapper))t=r;else{let a=Hn.of(n.wrapper,(e=this.cache.find(Hn,o=>o.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);t.append(a),t=a}}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),n=this.cache.find(zc,void 0,1);return n&&(n.flags=t),n||new zc(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class CN{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:r,lineBreak:a,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let c=this.textOff=Math.min(e,r.length);return a?null:r.slice(0,c)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const Hc=[hr,pl,nr,ii,zc,Hn,fh];for(let i=0;i<Hc.length;i++)Hc[i].bucket=i;class AN{constructor(e){this.view=e,this.buckets=Hc.map(()=>[]),this.index=Hc.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,a=this.buckets[r],o=this.index[r];for(let c=a.length-1;c>=0;c--){let f=(c+o)%a.length,d=a[f];if((!t||t(d))&&!this.reused.has(d))return a.splice(f,1),f<o&&this.index[r]--,this.reused.set(d,n),d}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let a=0,o=0;;a++){if(a==r.length){if(o)return null;o=1,a=0}let c=r[a];if(!this.reused.has(c)&&(o==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view)))return r.splice(a,1),a<this.index[0]&&this.index[0]--,c.widget==e&&c.length==t&&(c.flags&497)==n?(this.reused.set(c,1),c):(this.reused.set(c,2),new hr(c.dom,t,e,c.flags&-498|n))}}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 MN{constructor(e,t,n,r,a){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new AN(e),this.text=new CN(e.state.doc),this.builder=new kN(this.cache,new fh(e,e.contentDOM),Ee.iter(n)),this.cache.reused.set(t,2),this.old=new SN(t),this.reuseWalker={skip:(o,c,f)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,a=0,o=0;;){let c=o<e.length?e[o++]:null,f=c?c.fromA:this.old.root.length;if(f>r){let d=f-r;this.preserve(d,!o,!c),r=f,a+=d}if(!c)break;t&&c.fromA<=t.range.fromA&&c.toA>=t.range.toA?(this.forward(c.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(a,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,c.toA),this.emit(t.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(a,c.toB)),a=c.toB,r=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=EN(this.old),a=this.openMarks;this.old.advance(e,n?1:-1,{skip:(o,c,f)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(f-c);else{let d=f>0||c<o.length?hr.of(o.widget,this.view,f-c,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,r,a),a=r.length)}else if(o.isText())this.builder.ensureLine(null),!c&&f==o.length?this.builder.addText(o.text,r,a,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(c,f),r,a)),a=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof zc)this.cache.add(o);else if(o instanceof ii)this.builder.ensureLine(null),this.builder.addMark(o,r,a),this.cache.reused.set(o,1),a=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof ii&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=a=0):o instanceof ii&&(r.shift(),a=Math.min(a,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,a=0,o=Ee.spans(this.decorations,e,t,{point:(c,f,d,m,y,b)=>{if(d instanceof ur){if(this.disallowBlockEffectsFor[b]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=m.length,y>m.length)r.continueWidget(f-c);else{let x=d.widget||(d.block?ml.block:ml.inline),w=TN(d),k=this.cache.findWidget(x,f-c,w)||hr.of(x,this.view,f-c,w);d.block?(d.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(k)):(r.ensureLine(n),r.addInlineWidget(k,m,y))}n=null}else n=ON(n,d);f>c&&this.text.skip(f-c)},span:(c,f,d,m)=>{for(let y=c;y<f;){let b=this.text.next(Math.min(512,f-y));b==null?(r.addLineStartIfNotCovered(n),r.addBreak(),y++):(r.ensureLine(n),r.addText(b,d,y==c?m:d.length),y+=b.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=o>a,this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let a=bt.get(r);if(r==this.view.contentDOM)break;a instanceof ii?t.push(a):a?.isLine()?n=a:a instanceof Hn||(r.nodeName=="DIV"&&!n&&r!=this.view.contentDOM?n=new pl(r,W2):n||t.push(ii.of(new fo({tagName:r.nodeName.toLowerCase(),attributes:eN(r)}),r)))}return{line:n,marks:t}}}function N1(i,e){let t=n=>{for(let r of n.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(i)}function TN(i){let e=i.isReplace?(i.startSide<0?64:0)|(i.endSide>0?128:0):i.startSide>0?32:16;return i.block&&(e|=256),e}const W2={class:"cm-line"};function ON(i,e){let t=e.spec.attributes,n=e.spec.class;return!t&&!n||(i||(i={class:"cm-line"}),t&&sg(t,i),n&&(i.class+=" "+n)),i}function EN(i){let e=[];for(let t=i.parents.length;t>1;t--){let n=t==i.parents.length?i.tile:i.parents[t].tile;n instanceof ii&&e.push(n.mark)}return e}function sp(i){let e=bt.get(i);return e&&e.setDOM(i.cloneNode()),i}class ml extends mn{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}}ml.inline=new ml("span");ml.block=new ml("div");const rp=new class extends mn{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class R1{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=me.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 fh(e,e.contentDOM),this.updateInner([new ji(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:m,toA:y})=>y<this.minWidthFrom||m>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 r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!_N(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let a=r>-1?RN(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:m,to:y}=this.hasComposition;n=new ji(m,y,e.changes.mapPos(m,-1),e.changes.mapPos(y,1)).addToSet(n.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(se.ie||se.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,c=this.blockWrappers;this.updateDeco();let f=BN(o,this.decorations,e.changes);f.length&&(n=ji.extendWithRanges(n,f));let d=zN(c,this.blockWrappers,e.changes);return d.length&&(n=ji.extendWithRanges(n,d)),a&&!n.some(m=>m.fromA<=a.range.fromA&&m.toA>=a.range.toA)&&(n=a.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let o=this.tile,c=new MN(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=c.run(e,t),mm(o,c.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 a=se.chrome||se.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||n.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof lp&&r.push(a.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(G2)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,a=r==n,o=!a&&!(this.view.state.facet(zn)||n.tabIndex>-1)&&za(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(a||t||o))return;let c=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,m;if(f.empty?m=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(m=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),se.gecko&&f.empty&&!this.hasComposition&&NN(d)){let b=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(b,d.node.childNodes[d.offset]||null)),d=m=new Qi(b,0),c=!0}let y=this.view.observer.selectionRange;(c||!y.focusNode||(!_a(d.node,d.offset,y.anchorNode,y.anchorOffset)||!_a(m.node,m.offset,y.focusNode,y.focusOffset))&&!this.suppressWidgetCursorChange(y,f))&&(this.view.observer.ignore(()=>{se.android&&se.chrome&&n.contains(y.focusNode)&&HN(y.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let b=Xa(this.view.root);if(b)if(f.empty){if(se.gecko){let x=DN(d.node,d.offset);if(x&&x!=3){let w=(x==1?O2:E2)(d.node,d.offset);w&&(d=new Qi(w.node,w.offset))}}b.collapse(d.node,d.offset),f.bidiLevel!=null&&b.caretBidiLevel!==void 0&&(b.caretBidiLevel=f.bidiLevel)}else if(b.extend){b.collapse(d.node,d.offset);try{b.extend(m.node,m.offset)}catch{}}else{let x=document.createRange();f.anchor>f.head&&([d,m]=[m,d]),x.setEnd(m.node,m.offset),x.setStart(d.node,d.offset),b.removeAllRanges(),b.addRange(x)}o&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(d,m)),this.impreciseAnchor=d.precise?null:new Qi(y.anchorNode,y.anchorOffset),this.impreciseHead=m.precise?null:new Qi(y.focusNode,y.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&_a(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,n=Xa(e.root),{anchorNode:r,anchorOffset:a}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let c=o.posAtStart;if(t.head==c||t.head==c+o.length)return;let f=this.coordsAt(t.head,-1),d=this.coordsAt(t.head,1);if(!f||!d||f.bottom>d.top)return;let m=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(m.node,m.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let y=e.observer.selectionRange;e.docView.posFromDOM(y.anchorNode,y.anchorOffset)!=t.from&&n.collapse(r,a)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let a;if(e==n.dom)a=n.dom.childNodes[t];else{let o=qn(e)==0?0:t==0?-1:1;for(;;){let c=e.parentNode;if(c==n.dom)break;o==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?o=-1:o=1),e=c}o<0?a=e:a=e.nextSibling}if(a==n.dom.firstChild)return r;for(;a&&!bt.get(a);)a=a.nextSibling;if(!a)return r+n.length;for(let o=0,c=r;;o++){let f=n.children[o];if(f.dom==a)return c;c+=f.length+f.breakAfter}}else return n.isText()?e==n.dom?r+t:r+(t?n.length:0):r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,a=!1,o,c=-1,f=!1;return this.tile.blockTiles((d,m)=>{if(d.isWidget()){if(d.flags&32&&m>=e)return!0;d.flags&16&&(a=!0)}else{let y=m+d.length;if(m<=e&&(n=d,r=e-m,a=y<e),y>=e&&!o&&(o=d,c=e-m,f=m>e),m>e&&o)return!0}}),!n&&!o?this.domAtPos(e,t):(a&&o?n=null:f&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(c,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof lp?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(a,o){if(a.isComposite())for(let c of a.children){if(c.length>=o){let f=r(c,o);if(f)return f}if(o-=c.length,o<0)break}else if(a.isText()&&o<a.length){let c=Mt(a.text,o);if(c==o)return null;let f=Ja(a.dom,o,c).getClientRects();for(let d=0;d<f.length;d++){let m=f[d];if(d==f.length-1||m.top<m.bottom&&m.left<m.right)return m}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,a=this.view.contentDOM.clientWidth,o=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,f=this.view.textDirection==Xe.LTR,d=0,m=(y,b,x)=>{for(let w=0;w<y.children.length&&!(b>r);w++){let k=y.children[w],C=b+k.length,M=k.dom.getBoundingClientRect(),{height:R}=M;if(x&&!w&&(d+=M.top-x.top),k instanceof Hn)C>n&&m(k,b,M);else if(b>=n&&(d>0&&t.push(-d),t.push(R+d),d=0,o)){let D=k.dom.lastChild,Q=D?Ha(D):[];if(Q.length){let _=Q[Q.length-1],K=f?_.right-M.left:M.right-_.left;K>c&&(c=K,this.minWidth=a,this.minWidthFrom=b,this.minWidthTo=C)}}x&&w==y.children.length-1&&(d+=x.bottom-M.bottom),b=C+k.breakAfter}};return m(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?Xe.RTL:Xe.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let c=0,f;for(let d of o.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let m=Ha(d.dom);if(m.length!=1)return;c+=m[0].width,f=m[0].height}if(c)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:c/o.length,textHeight:f}}});if(e)return e;let t=document.createElement("div"),n,r,a;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 o=Ha(t.firstChild)[0];n=t.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,a=o&&o.height?o.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:a}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let a=r==t.viewports.length?null:t.viewports[r],o=a?a.from-1:this.view.state.doc.length;if(o>n){let c=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(me.replace({widget:new lp(c),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!a)break;n=a.to+1}return me.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ch).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,r=this.view.state.facet(cg).map((a,o)=>{let c=typeof a=="function";return c&&(n=!0),c?a(this.view):a});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(Ee.join(r))),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(K2).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(Q2))try{if(d(this.view,e.range,e))return!0}catch(m){ni(this.view.state,m,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let a=hg(this.view),o={left:n.left-a.left,top:n.top-a.top,right:n.right+a.right,bottom:n.bottom+a.bottom},{offsetWidth:c,offsetHeight:f}=this.view.scrollDOM;if(nN(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==Xe.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let d=this.view.docView.lineAt(t.head,1);d&&d.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=n=>n.isWidget()||n.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){mm(this.tile)}}function mm(i,e){let t=e?.get(i);if(t!=1){t==null&&i.destroy();for(let n of i.children)mm(n,e)}}function NN(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function X2(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=O2(t.focusNode,t.focusOffset),r=E2(t.focusNode,t.focusOffset),a=n||r;if(r&&n&&r.node!=n.node){let c=bt.get(r.node);if(!c||c.isText()&&c.text!=r.node.nodeValue)a=r;else if(i.docView.lastCompositionAfterCursor){let f=bt.get(n.node);!f||f.isText()&&f.text!=n.node.nodeValue||(a=r)}}if(i.docView.lastCompositionAfterCursor=a!=n,!a)return null;let o=e-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function RN(i,e,t){let n=X2(i,t);if(!n)return null;let{node:r,from:a,to:o}=n,c=r.nodeValue;if(/[\n\r]/.test(c)||i.state.doc.sliceString(n.from,n.to)!=c)return null;let f=e.invertedDesc;return{range:new ji(f.mapPos(a),f.mapPos(o),a,o),text:r}}function DN(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e<i.childNodes.length&&i.childNodes[e].contentEditable=="false"?2:0)}let jN=class{constructor(){this.changes=[]}compareRange(e,t){ll(e,t,this.changes)}comparePoint(e,t){ll(e,t,this.changes)}boundChange(e){ll(e,e,this.changes)}};function BN(i,e,t){let n=new jN;return Ee.compare(i,e,t,n),n.changes}class LN{constructor(){this.changes=[]}compareRange(e,t){ll(e,t,this.changes)}comparePoint(){}boundChange(e){ll(e,e,this.changes)}}function zN(i,e,t){let n=new LN;return Ee.compare(i,e,t,n),n.changes}function HN(i,e){for(let t=i;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function _N(i,e){let t=!1;return e&&i.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(t=!0)}),t}class lp extends mn{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 UN(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),a=e-r.from;if(r.length==0)return W.cursor(e);a==0?t=1:a==r.length&&(t=-1);let o=a,c=a;t<0?o=Mt(r.text,a,!1):c=Mt(r.text,a);let f=n(r.text.slice(o,c));for(;o>0;){let d=Mt(r.text,o,!1);if(n(r.text.slice(d,o))!=f)break;o=d}for(;c<r.length;){let d=Mt(r.text,c);if(n(r.text.slice(c,d))!=f)break;c=d}return W.range(o+r.from,c+r.from)}function qN(i,e,t,n,r){let a=Math.round((n-e.left)*i.defaultCharacterWidth);if(i.lineWrapping&&t.height>i.defaultLineHeight*1.5){let c=i.viewState.heightOracle.textHeight,f=Math.floor((r-t.top-(i.defaultLineHeight-c)*.5)/c);a+=f*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+nm(o,a,i.state.tabSize)}function gm(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let a of n.type){if(a.from>e)break;if(!(a.to<e)){if(a.from<e&&a.to>e)return a;(!r||a.type==Lt.Text&&(r.type!=a.type||(t<0?a.from<e:a.to>e)))&&(r=a)}}return r||n}return n}function PN(i,e,t,n){let r=gm(i,e.head,e.assoc||-1),a=!n||r.type!=Lt.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(a){let o=i.dom.getBoundingClientRect(),c=i.textDirectionAt(r.from),f=i.posAtCoords({x:t==(c==Xe.LTR)?o.right-1:o.left+1,y:(a.top+a.bottom)/2});if(f!=null)return W.cursor(f,t?-1:1)}return W.cursor(t?r.to:r.from,t?-1:1)}function D1(i,e,t,n){let r=i.state.doc.lineAt(e.head),a=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let c=e,f=null;;){let d=mN(r,a,o,c,t),m=B2;if(!d){if(r.number==(t?i.state.doc.lines:1))return c;m=`
|
|
18
|
+
`,r=i.state.doc.line(r.number+(t?1:-1)),a=i.bidiSpans(r),d=i.visualLineSide(r,!t)}if(f){if(!f(m))return c}else{if(!n)return d;f=n(m)}c=d}}function VN(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return a=>{let o=n(a);return r==it.Space&&(r=o),r==o}}function QN(i,e,t,n){let r=e.head,a=t?1:-1;if(r==(t?i.state.doc.length:0))return W.cursor(r,e.assoc);let o=e.goalColumn,c,f=i.contentDOM.getBoundingClientRect(),d=i.coordsAtPos(r,(e.empty?e.assoc:0)||(t?1:-1)),m=i.documentTop;if(d)o==null&&(o=d.left-f.left),c=a<0?d.top:d.bottom;else{let w=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(f.right-f.left,i.defaultCharacterWidth*(r-w.from))),c=(a<0?w.top:w.bottom)+m}let y=f.left+o,b=n??i.viewState.heightOracle.textHeight>>1,x=ym(i,{x:y,y:c+b*a},!1,a);return W.cursor(x.pos,x.assoc,void 0,o)}function Ua(i,e,t){for(;;){let n=0;for(let r of i)r.between(e-1,e+1,(a,o,c)=>{if(e>a&&e<o){let f=n||t||(e-a<o-e?-1:1);e=f<0?a:o,n=f}});if(!n)return e}}function Z2(i,e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],a=null;if(r.empty){let o=Ua(i,r.from,0);o!=r.from&&(a=W.cursor(o,-1))}else{let o=Ua(i,r.from,-1),c=Ua(i,r.to,1);(o!=r.from||c!=r.to)&&(a=W.range(r.from==r.anchor?o:c,r.from==r.head?o:c))}a&&(t||(t=e.ranges.slice()),t[n]=a)}return t?W.create(t,e.mainIndex):e}function ap(i,e,t){let n=Ua(i.state.facet(mo).map(r=>r(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:W.cursor(n,n<t.from?1:-1)}class an{constructor(e,t){this.pos=e,this.assoc=t}}function ym(i,e,t,n){let r=i.contentDOM.getBoundingClientRect(),a=r.top+i.viewState.paddingTop,{x:o,y:c}=e,f=c-a,d;for(;;){if(f<0)return new an(0,1);if(f>i.viewState.docHeight)return new an(i.state.doc.length,-1);if(d=i.elementAtHeight(f),n==null)break;if(d.type==Lt.Text){if(n<0?d.to<i.viewport.from:d.from>i.viewport.to)break;let b=i.docView.coordsAt(n<0?d.from:d.to,n>0?-1:1);if(b&&(n<0?b.top<=f+a:b.bottom>=f+a))break}let y=i.viewState.heightOracle.textHeight/2;f=n>0?d.bottom+y:d.top-y}if(i.viewport.from>=d.to||i.viewport.to<=d.from){if(t)return null;if(d.type==Lt.Text){let y=qN(i,r,d,o,c);return new an(y,y==d.from?1:-1)}}if(d.type!=Lt.Text)return f<(d.top+d.bottom)/2?new an(d.from,1):new an(d.to,-1);let m=i.docView.lineAt(d.from,2);return(!m||m.length!=d.length)&&(m=i.docView.lineAt(d.from,-2)),new GN(i,o,c,i.textDirectionAt(d.from)).scanTile(m,d.from)}class GN{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[on.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[on.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,a=new Set,o=this.bidiIn(e[0],e[r]),c,f,d=-1,m=1e9,y;e:for(;n<r;){let x=r-n,w=n+r>>1;t:if(a.has(w)){let C=n+Math.floor(Math.random()*x);for(let M=0;M<x;M++){if(!a.has(C)){w=C;break t}C++,C==r&&(C=n)}break e}a.add(w);let k=t(w);if(k)for(let C=0;C<k.length;C++){let M=k[C],R=0;if(M.bottom<this.y)(!c||c.bottom<M.bottom)&&(c=M),R=1;else if(M.top>this.y)(!f||f.top>M.top)&&(f=M),R=-1;else{let D=M.left>this.x?this.x-M.left:M.right<this.x?this.x-M.right:0,Q=Math.abs(D);Q<m&&(d=w,m=Q,y=M),D&&(R=D<0==(this.baseDir==Xe.LTR)?-1:1)}R==-1&&(!o||this.baseDirAt(e[w],1))?r=w:R==1&&(!o||this.baseDirAt(e[w+1],-1))&&(n=w+1)}}if(!y){let x=c&&(!f||this.y-c.bottom<f.top-this.y)?c:f;return this.y=(x.top+x.bottom)/2,this.scan(e,t)}let b=(o?this.dirAt(e[d],1):this.baseDir)==Xe.LTR;return{i:d,after:this.x>(y.left+y.right)/2==b}}scanText(e,t){let n=[];for(let a=0;a<e.length;a=Mt(e.text,a))n.push(t+a);n.push(t+e.length);let r=this.scan(n,a=>{let o=n[a]-t,c=n[a+1]-t;return Ja(e.dom,o,c).getClientRects()});return r.after?new an(n[r.i+1],-1):new an(n[r.i],1)}scanTile(e,t){if(!e.length)return new an(t,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,t);if(c.isComposite())return this.scanTile(c,t)}let n=[t];for(let c=0,f=t;c<e.children.length;c++)n.push(f+=e.children[c].length);let r=this.scan(n,c=>{let f=e.children[c];return f.flags&48?null:(f.dom.nodeType==1?f.dom:Ja(f.dom,0,f.length)).getClientRects()}),a=e.children[r.i],o=n[r.i];return a.isText()?this.scanText(a,o):a.isComposite()?this.scanTile(a,o):r.after?new an(n[r.i+1],-1):new an(o,1)}}const Ra="";class FN{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(je.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ra}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let a=this.text.length;this.readNode(r);let o=bt.get(r),c=r.nextSibling;if(c==t){o?.breakAfter&&!c&&n!=this.view.contentDOM&&this.lineBreak();break}let f=bt.get(c);(o&&f?o.breakAfter:(o?o.breakAfter:Bc(r))||Bc(c)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>a)&&!YN(c,t)&&this.lineBreak(),r=c}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,o=1,c;if(this.lineSeparator?(a=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(c=r.exec(t))&&(a=c.index,o=c[0].length),this.append(t.slice(n,a<0?t.length:a)),a<0)break;if(this.lineBreak(),o>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=o-1);n=a+o}}readNode(e){let t=bt.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.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 n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(KN(e,n.node,n.offset)?t:0))}}function KN(i,e,t){for(;;){if(!e||t<qn(e))return!1;if(e==i)return!0;t=Ts(e)+1,e=e.parentNode}}function YN(i,e){let t;for(;!(i==e||!i);i=i.nextSibling){let n=bt.get(i);if(!n?.isWidget())return!1;n&&(t||(t=[])).push(n)}if(t)for(let n of t){let r=n.overrideDOMText;if(r?.length)return!1}return!0}class j1{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class IN{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:a,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=J2(e.docView.tile,t,n,0))){let c=a||o?[]:XN(e),f=new FN(c,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=ZN(c,this.bounds.from)}else{let c=e.observer.selectionRange,f=a&&a.node==c.focusNode&&a.offset==c.focusOffset||!cm(e.contentDOM,c.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!cm(e.contentDOM,c.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),m=e.viewport;if((se.ios||se.chrome)&&e.state.selection.main.empty&&f!=d&&(m.from>0||m.to<e.state.doc.length)){let y=Math.min(f,d),b=Math.max(f,d),x=m.from-y,w=m.to-b;(x==0||x==1||y==0)&&(w==0||w==-1||b==e.state.doc.length)&&(f=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(W.range(d,f)):this.newSel=W.single(d,f)}}}function J2(i,e,t,n){if(i.isComposite()){let r=-1,a=-1,o=-1,c=-1;for(let f=0,d=n,m=n;f<i.children.length;f++){let y=i.children[f],b=d+y.length;if(d<e&&b>t)return J2(y,e,t,d);if(b>=e&&r==-1&&(r=f,a=d),d>t&&y.dom.parentNode==i.dom){o=f,c=m;break}m=b,d=b+y.breakAfter}return{from:a,to:c<0?n+i.length:c,startDOM:(r?i.children[r-1].dom.nextSibling:null)||i.dom.firstChild,endDOM:o<i.children.length&&o>=0?i.children[o].dom:null}}else return i.isText()?{from:n,to:n+i.length,startDOM:i.dom,endDOM:i.dom.nextSibling}:null}function $2(i,e){let t,{newSel:n}=e,r=i.state.selection.main,a=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:c}=e.bounds,f=r.from,d=null;(a===8||se.android&&e.text.length<c-o)&&(f=r.to,d="end");let m=ew(i.state.doc.sliceString(o,c,Ra),e.text,f-o,d);m&&(se.chrome&&a==13&&m.toB==m.from+2&&e.text.slice(m.from,m.toB)==Ra+Ra&&m.toB--,t={from:o+m.from,to:o+m.toA,insert:_e.of(e.text.slice(m.from,m.toB).split(Ra))})}else n&&(!i.hasFocus&&i.state.facet(zn)||_c(n,r))&&(n=null);if(!t&&!n)return!1;if(!t&&e.typeOver&&!r.empty&&n&&n.main.empty?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,r.to)}:(se.mac||se.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=W.single(n.main.anchor-1,n.main.head-1)),t={from:t.from,to:t.to,insert:_e.of([t.insert.toString().replace("."," ")])}):t&&t.from>=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:i.state.doc.lineAt(r.from).to<r.to&&i.docView.lineHasWidget(r.to)&&i.inputState.insertingTextAt>Date.now()-50?t={from:r.from,to:r.to,insert:i.state.toText(i.inputState.insertingText)}:se.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==`
|
|
19
|
+
`&&i.lineWrapping&&(n&&(n=W.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:_e.of([" "])}),t)return fg(i,t,n,a);if(n&&!_c(n,r)){let o=!1,c="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),c=i.inputState.lastSelectionOrigin,c=="select.pointer"&&(n=Z2(i.state.facet(mo).map(f=>f(i)),n))),i.dispatch({selection:n,scrollIntoView:o,userEvent:c}),!0}else return!1}function fg(i,e,t,n=-1){if(se.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(se.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&al(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&al(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&al(i.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,c=()=>o||(o=WN(i,e,t));return i.state.facet(U2).some(f=>f(i,e.from,e.to,a,c))||i.dispatch(c()),!0}function WN(i,e,t){let n,r=i.state,a=r.selection.main,o=-1;if(e.from==e.to&&e.from<a.from||e.from>a.to){let f=e.from<a.from?-1:1,d=f<0?a.from:a.to,m=Ua(r.facet(mo).map(y=>y(i)),d,f);e.from==m&&(o=m)}if(o>-1)n={changes:e,selection:W.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let f=a.from<e.from?r.sliceDoc(a.from,e.from):"",d=a.to>e.to?r.sliceDoc(e.to,a.to):"";n=r.replaceSelection(i.state.toText(f+e.insert.sliceString(0,void 0,i.state.lineBreak)+d))}else{let f=r.changes(e),d=t&&t.main.to<=f.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let m=i.state.sliceDoc(e.from,e.to),y,b=t&&X2(i,t.main.head);if(b){let w=e.insert.length-(e.to-e.from);y={from:b.from,to:b.to-w}}else y=i.state.doc.lineAt(a.head);let x=a.to-e.to;n=r.changeByRange(w=>{if(w.from==a.from&&w.to==a.to)return{changes:f,range:d||w.map(f)};let k=w.to-x,C=k-m.length;if(i.state.sliceDoc(C,k)!=m||k>=y.from&&C<=y.to)return{range:w};let M=r.changes({from:C,to:k,insert:e.insert}),R=w.to-a.to;return{changes:M,range:d?W.range(Math.max(0,d.anchor+R),Math.max(0,d.head+R)):w.map(M)}})}else n={changes:f,selection:d&&r.selection.replaceRange(d)}}let c="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,c+=".compose",i.inputState.compositionFirstChange&&(c+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:c,scrollIntoView:!0})}function ew(i,e,t,n){let r=Math.min(i.length,e.length),a=0;for(;a<r&&i.charCodeAt(a)==e.charCodeAt(a);)a++;if(a==r&&i.length==e.length)return null;let o=i.length,c=e.length;for(;o>0&&c>0&&i.charCodeAt(o-1)==e.charCodeAt(c-1);)o--,c--;if(n=="end"){let f=Math.max(0,a-Math.min(o,c));t-=o+f-a}if(o<a&&i.length<e.length){let f=t<=a&&t>=o?a-t:0;a-=f,c=a+(c-o),o=a}else if(c<a){let f=t<=a&&t>=c?a-t:0;a-=f,o=a+(o-c),c=a}return{from:a,toA:o,toB:c}}function XN(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:a}=i.observer.selectionRange;return t&&(e.push(new j1(t,n)),(r!=t||a!=n)&&e.push(new j1(r,a))),e}function ZN(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?W.single(t+e,n+e):null}function _c(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}class JN{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,se.safari&&e.contentDOM.addEventListener("input",()=>null),se.gecko&&d4(e.contentDOM.ownerDocument)}handleEvent(e){!l4(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 n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=$N(e),n=this.handlers,r=this.view.contentDOM;for(let a in t)if(a!="scroll"){let o=!t[a].handlers.length,c=n[a];c&&o!=!c.handlers.length&&(r.removeEventListener(a,this.handleEvent),c=null),c||r.addEventListener(a,this.handleEvent,{passive:o})}for(let a in n)a!="scroll"&&!t[a]&&r.removeEventListener(a,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&&iw.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),se.android&&se.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return se.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=tw.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||e4.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,al(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:se.safari&&!se.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 B1(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){ni(t.state,r)}}}function $N(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,a=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(a)for(let c in a){let f=a[c];f&&t(c).handlers.push(B1(n.value,f))}if(o)for(let c in o){let f=o[c];f&&t(c).observers.push(B1(n.value,f))}}for(let n in Ki)t(n).handlers.push(Ki[n]);for(let n in Hi)t(n).observers.push(Hi[n]);return e}const tw=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],e4="dthko",iw=[16,17,18,20,91,92,224,225],Fu=6;function Ku(i){return Math.max(0,i)*.7+8}function t4(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class i4{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=sN(e.contentDOM),this.atoms=e.state.facet(mo).map(o=>o(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(je.allowMultipleSelections)&&n4(e,t),this.dragging=r4(e,t)&&rw(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&&t4(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,a=0,o=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:c}=this.scrollParents.y.getBoundingClientRect());let f=hg(this.view);e.clientX-f.left<=r+Fu?t=-Ku(r-e.clientX):e.clientX+f.right>=o-Fu&&(t=Ku(e.clientX-o)),e.clientY-f.top<=a+Fu?n=-Ku(a-e.clientY):e.clientY+f.bottom>=c-Fu&&(n=Ku(e.clientY-c)),this.setScrollSpeed(t,n)}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,n=Z2(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,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 n4(i,e){let t=i.state.facet(L2);return t.length?t[0](e):se.mac?e.metaKey:e.ctrlKey}function s4(i,e){let t=i.state.facet(z2);return t.length?t[0](e):se.mac?!e.altKey:!e.ctrlKey}function r4(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=Xa(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let a=0;a<r.length;a++){let o=r[a];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function l4(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=bt.get(t))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Ki=Object.create(null),Hi=Object.create(null),nw=se.ie&&se.ie_version<15||se.ios&&se.webkit_version<604;function a4(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),sw(i,t.value)},50)}function dh(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function sw(i,e){e=dh(i.state,ag,e);let{state:t}=i,n,r=1,a=t.toText(e),o=a.lines==t.selection.ranges.length;if(bm!=null&&t.selection.ranges.every(f=>f.empty)&&bm==a.toString()){let f=-1;n=t.changeByRange(d=>{let m=t.doc.lineAt(d.from);if(m.from==f)return{range:d};f=m.from;let y=t.toText((o?a.line(r++).text:e)+t.lineBreak);return{changes:{from:m.from,insert:y},range:W.cursor(d.from+y.length)}})}else o?n=t.changeByRange(f=>{let d=a.line(r++);return{changes:{from:f.from,to:f.to,insert:d.text},range:W.cursor(f.from+d.length)}}):n=t.replaceSelection(a);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Hi.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Ki.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Hi.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Hi.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ki.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(H2))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=u4(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new i4(i,e,t,n)),n&&i.observer.ignore(()=>{M2(i.contentDOM);let a=i.root.activeElement;a&&!a.contains(i.contentDOM)&&a.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else i.inputState.setSelectionOrigin("select.pointer");return!1};function L1(i,e,t,n){if(n==1)return W.cursor(e,t);if(n==2)return UN(i.state,e,t);{let r=i.docView.lineAt(e,t),a=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:a.from,c=r?r.posAtEnd:a.to;return c<i.state.doc.length&&c==a.to&&c++,W.range(o,c)}}const o4=se.ie&&se.ie_version<=11;let z1=null,H1=0,_1=0;function rw(i){if(!o4)return i.detail;let e=z1,t=_1;return z1=i,_1=Date.now(),H1=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(H1+1)%3:1}function u4(i,e){let t=i.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=rw(e),r=i.state.selection;return{update(a){a.docChanged&&(t.pos=a.changes.mapPos(t.pos),r=r.map(a.changes))},get(a,o,c){let f=i.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),d,m=L1(i,f.pos,f.assoc,n);if(t.pos!=f.pos&&!o){let y=L1(i,t.pos,t.assoc,n),b=Math.min(y.from,m.from),x=Math.max(y.to,m.to);m=b<m.from?W.range(b,x):W.range(x,b)}return o?r.replaceRange(r.main.extend(m.from,m.to)):c&&n==1&&r.ranges.length>1&&(d=c4(r,f.pos))?d:c?r.addRange(m):W.create([m])}}}function c4(i,e){for(let t=0;t<i.ranges.length;t++){let{from:n,to:r}=i.ranges[t];if(n<=e&&r>=e)return W.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Ki.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.tile.nearest(e.target);if(r&&r.isWidget()){let a=r.posAtStart,o=a+r.length;(a>=t.to||o<=t.from)&&(t=W.range(a,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",dh(i.state,og,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ki.dragend=i=>(i.inputState.draggedContent=null,!1);function U1(i,e,t,n){if(t=dh(i.state,ag,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=i.inputState,o=n&&a&&s4(i,e)?{from:a.from,to:a.to}:null,c={from:r,insert:t},f=i.state.changes(o?[o,c]:c);i.focus(),i.dispatch({changes:f,selection:{anchor:f.mapPos(r,-1),head:f.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ki.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,a=()=>{++r==t.length&&U1(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let c=new FileReader;c.onerror=a,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(n[o]=c.result),a()},c.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return U1(i,e,n,!0),!0}return!1};Ki.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=nw?null:e.clipboardData;return t?(sw(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(a4(i),!1)};function h4(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function f4(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:a}of i.selection.ranges){let o=i.doc.lineAt(a);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:dh(i,og,e.join(i.lineBreak)),ranges:t,linewise:n}}let bm=null;Ki.copy=Ki.cut=(i,e)=>{if(!za(i.contentDOM,i.observer.selectionRange))return!1;let{text:t,ranges:n,linewise:r}=f4(i.state);if(!t&&!r)return!1;bm=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=nw?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",t),!0):(h4(i,t),!1)};const lw=dn.define();function aw(i,e){let t=[];for(let n of i.facet(q2)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:lw.of(!0)}):null}function ow(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=aw(i.state,e);t?i.dispatch(t):i.update([])}},10)}Hi.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),ow(i)};Hi.blur=i=>{i.observer.clearSelectionRange(),ow(i)};Hi.compositionstart=Hi.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Hi.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,se.chrome&&se.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Hi.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ki.beforeinput=(i,e)=>{var t,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&i.observer.editContext){let a=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(a&&o.length){let c=o[0],f=i.posAtDOM(c.startContainer,c.startOffset),d=i.posAtDOM(c.endContainer,c.endOffset);return fg(i,{from:f,to:d,insert:i.state.toText(a)},null),!0}}let r;if(se.chrome&&se.android&&(r=tw.find(a=>a.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let a=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>a+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return se.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),se.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Hi.compositionend(i,e),20),!1};const q1=new Set;function d4(i){q1.has(i)||(q1.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const P1=["pre-wrap","normal","pre-line","break-spaces"];let gl=!1;function V1(){gl=!1}class p4{constructor(e){this.lineWrapping=e,this.doc=_e.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 P1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,a,o){let c=P1.indexOf(e)>-1,f=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=c||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=c,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=a,f){this.heightSamples={};for(let d=0;d<o.length;d++){let m=o[d];m<0?d++:this.heightSamples[Math.floor(m*10)]=!0}}return f}}class m4{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Vi{constructor(e,t,n,r,a){this.from=e,this.length=t,this.top=n,this.height=r,this._content=a}get type(){return typeof this._content=="number"?Lt.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 ur?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 Vi(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Ze=(function(i){return i[i.ByPos=0]="ByPos",i[i.ByHeight=1]="ByHeight",i[i.ByPosNoHeight=2]="ByPosNoHeight",i})(Ze||(Ze={}));const gc=.001;class Kt{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}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)>gc&&(gl=!0),this.height=e)}replace(e,t,n){return Kt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let a=this,o=n.doc;for(let c=r.length-1;c>=0;c--){let{fromA:f,toA:d,fromB:m,toB:y}=r[c],b=a.lineAt(f,Ze.ByPosNoHeight,n.setDoc(t),0,0),x=b.to>=d?b:a.lineAt(d,Ze.ByPosNoHeight,n,0,0);for(y+=x.to-d,d=x.to;c>0&&b.from<=r[c-1].toA;)f=r[c-1].fromA,m=r[c-1].fromB,c--,f<b.from&&(b=a.lineAt(f,Ze.ByPosNoHeight,n,0,0));m+=b.from-f,f=b.from;let w=dg.build(n.setDoc(o),e,m,y);a=Uc(a,a.replace(f,d,w))}return a.updateHeight(n,0)}static empty(){return new bi(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,r=0,a=0;for(;;)if(t==n)if(r>a*2){let c=e[t-1];c.break?e.splice(--t,1,c.left,null,c.right):e.splice(--t,1,c.left,c.right),n+=1+c.break,r-=c.size}else if(a>r*2){let c=e[n];c.break?e.splice(n,1,c.left,null,c.right):e.splice(n,1,c.left,c.right),n+=2+c.break,a-=c.size}else break;else if(r<a){let c=e[t++];c&&(r+=c.size)}else{let c=e[--n];c&&(a+=c.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,n++),new y4(Kt.of(e.slice(0,t)),o,Kt.of(e.slice(n)))}}function Uc(i,e){return i==e?i:(i.constructor!=e.constructor&&(gl=!0),e)}Kt.prototype.size=1;const g4=me.replace({});class uw extends Kt{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Vi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Vi(r,0,n,this.spaceAbove,g4):this.mainBlock(n,r)}lineAt(e,t,n,r,a){let o=this.mainBlock(r,a);return this.spaceAbove?this.blockAt(0,n,r,a).join(o):o}forEachLine(e,t,n,r,a,o){e<=a+this.length&&t>=a&&o(this.lineAt(0,Ze.ByPos,n,r,a))}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,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class bi extends uw{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Vi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof bi||r instanceof jt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof jt?r=new bi(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Kt.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||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 jt extends Kt{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,a=r-n+1,o,c=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*a);o=f/a,this.length>a+1&&(c=(this.height-f)/(this.length-a-1))}else o=this.height/a;return{firstLine:n,lastLine:r,perLine:o,perChar:c}}blockAt(e,t,n,r){let{firstLine:a,lastLine:o,perLine:c,perChar:f}=this.heightMetrics(t,r);if(t.lineWrapping){let d=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),m=t.doc.lineAt(d),y=c+m.length*f,b=Math.max(n,e-y/2);return new Vi(m.from,m.length,b,y,0)}else{let d=Math.max(0,Math.min(o-a,Math.floor((e-n)/c))),{from:m,length:y}=t.doc.line(a+d);return new Vi(m,y,n+c*d,c,0)}}lineAt(e,t,n,r,a){if(t==Ze.ByHeight)return this.blockAt(e,n,r,a);if(t==Ze.ByPosNoHeight){let{from:x,to:w}=n.doc.lineAt(e);return new Vi(x,w-x,0,0,0)}let{firstLine:o,perLine:c,perChar:f}=this.heightMetrics(n,a),d=n.doc.lineAt(e),m=c+d.length*f,y=d.number-o,b=r+c*y+f*(d.from-a-y);return new Vi(d.from,d.length,Math.max(r,Math.min(b,r+this.height-m)),m,0)}forEachLine(e,t,n,r,a,o){e=Math.max(e,a),t=Math.min(t,a+this.length);let{firstLine:c,perLine:f,perChar:d}=this.heightMetrics(n,a);for(let m=e,y=r;m<=t;){let b=n.doc.lineAt(m);if(m==e){let w=b.number-c;y+=f*w+d*(e-a-w)}let x=f+d*b.length;o(new Vi(b.from,b.length,y,x,0)),y+=x,m=b.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let a=n[n.length-1];a instanceof jt?n[n.length-1]=new jt(a.length+r):n.push(null,new jt(r-1))}if(e>0){let a=n[0];a instanceof jt?n[0]=new jt(e+a.length):n.unshift(new jt(e-1),null)}return Kt.of(n)}decomposeLeft(e,t){t.push(new jt(e-1),null)}decomposeRight(e,t){t.push(null,new jt(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let a=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],c=Math.max(t,r.from),f=-1;for(r.from>t&&o.push(new jt(r.from-t-1).updateHeight(e,t));c<=a&&r.more;){let m=e.doc.lineAt(c).length;o.length&&o.push(null);let y=r.heights[r.index++],b=0;y<0&&(b=-y,y=r.heights[r.index++]),f==-1?f=y:Math.abs(y-f)>=gc&&(f=-2);let x=new bi(m,y,b);x.outdated=!1,o.push(x),c+=m+1}c<=a&&o.push(null,new jt(a-c).updateHeight(e,c));let d=Kt.of(o);return(f<0||Math.abs(d.height-this.height)>=gc||Math.abs(f-this.heightMetrics(e,t).perLine)>=gc)&&(gl=!0),Uc(this,d)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class y4 extends Kt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let a=n+this.left.height;return e<a?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,a,r+this.left.length+this.break)}lineAt(e,t,n,r,a){let o=r+this.left.height,c=a+this.left.length+this.break,f=t==Ze.ByHeight?e<o:e<c,d=f?this.left.lineAt(e,t,n,r,a):this.right.lineAt(e,t,n,o,c);if(this.break||(f?d.to<c:d.from>c))return d;let m=t==Ze.ByPosNoHeight?Ze.ByPosNoHeight:Ze.ByPos;return f?d.join(this.right.lineAt(c,m,n,o,c)):this.left.lineAt(c,m,n,r,a).join(d)}forEachLine(e,t,n,r,a,o){let c=r+this.left.height,f=a+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,t,n,r,a,o),t>=f&&this.right.forEachLine(e,t,n,c,f,o);else{let d=this.lineAt(f,Ze.ByPos,n,r,a);e<d.from&&this.left.forEachLine(e,d.from-1,n,r,a,o),d.to>=e&&d.from<=t&&o(d),t>d.to&&this.right.forEachLine(d.to+1,t,n,c,f,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let a=[];e>0&&this.decomposeLeft(e,a);let o=a.length;for(let c of n)a.push(c);if(e>0&&Q1(a,o-1),t<this.length){let c=a.length;this.decomposeRight(t,a),Q1(a,c)}return Kt.of(a)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Kt.of(this.break?[e,null,t]:[e,t]):(this.left=Uc(this.left,e),this.right=Uc(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,n=!1,r){let{left:a,right:o}=this,c=t+a.length+this.break,f=null;return r&&r.from<=t+a.length&&r.more?f=a=a.updateHeight(e,t,n,r):a.updateHeight(e,t,n),r&&r.from<=c+o.length&&r.more?f=o=o.updateHeight(e,c,n,r):o.updateHeight(e,c,n),f?this.balanced(a,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Q1(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof jt&&(n=i[e+1])instanceof jt&&i.splice(e-1,3,new jt(t.length+1+n.length))}const b4=5;class dg{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 n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof bi?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new bi(n-this.pos,-1,0)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,a=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new uw(o,r,n)):(o||a||r>=b4)&&this.addLineDeco(r,a,o)}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 bi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new jt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof bi)return e;let t=new bi(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,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof bi)&&!this.isCovered?this.nodes.push(new bi(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof bi&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,t,n,r){let a=new dg(n,e);return Ee.spans(t,n,r,a,0),a.finish(n)}}function x4(i,e,t){let n=new v4;return Ee.compare(i,e,t,n,0),n.changes}class v4{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&ll(e,t,this.changes,5)}}function S4(i,e){let t=i.getBoundingClientRect(),n=i.ownerDocument,r=n.defaultView||window,a=Math.max(0,t.left),o=Math.min(r.innerWidth,t.right),c=Math.max(0,t.top),f=Math.min(r.innerHeight,t.bottom);for(let d=i.parentNode;d&&d!=n.body;)if(d.nodeType==1){let m=d,y=window.getComputedStyle(m);if((m.scrollHeight>m.clientHeight||m.scrollWidth>m.clientWidth)&&y.overflow!="visible"){let b=m.getBoundingClientRect();a=Math.max(a,b.left),o=Math.min(o,b.right),c=Math.max(c,b.top),f=Math.min(d==i.parentNode?r.innerHeight:f,b.bottom)}d=y.position=="absolute"||y.position=="fixed"?m.offsetParent:m.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:a-t.left,right:Math.max(a,o)-t.left,top:c-(t.top+e),bottom:Math.max(c,f)-(t.top+e)}}function w4(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function k4(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class op{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],a=t[n];if(r.from!=a.from||r.to!=a.to||r.size!=a.size)return!1}return!0}draw(e,t){return me.replace({widget:new C4(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class C4 extends mn{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 G1{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=F1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Xe.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(ug).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new p4(t),this.stateDeco=K1(e),this.heightMap=Kt.empty().applyChanges(this.stateDeco,_e.empty,this.heightOracle.setDoc(e.doc),[new ji(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=me.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:a,to:o})=>r>=a&&r<=o)){let{from:a,to:o}=this.lineBlockAt(r);e.push(new Yu(a,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?F1:new pg(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(Da(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=K1(this.state);let r=e.changedRanges,a=ji.extendWithRanges(r,x4(n,this.stateDeco,e?e.changes:vt.empty(this.state.doc.length))),o=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);V1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=o||gl)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let f=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<f.from||t.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,t));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(V2)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,a=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?Xe.RTL:Xe.LTR;let o=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",c=t.getBoundingClientRect(),f=o||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let d=0,m=0;if(c.width&&c.height){let{scaleX:Q,scaleY:_}=A2(t,c);(Q>.005&&Math.abs(this.scaleX-Q)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=Q,this.scaleY=_,d|=16,o=f=!0)}let y=(parseInt(n.paddingTop)||0)*this.scaleY,b=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=y||this.paddingBottom!=b)&&(this.paddingTop=y,this.paddingBottom=b,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=T2(e.scrollDOM);let w=(this.printing?k4:S4)(t,this.paddingTop),k=w.top-this.pixelViewport.top,C=w.bottom-this.pixelViewport.bottom;this.pixelViewport=w;let M=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(M!=this.inView&&(this.inView=M,M&&(f=!0)),!this.inView&&!this.scrollTarget&&!w4(e.dom))return 0;let R=c.width;if((this.contentDOMWidth!=R||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let Q=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(Q)&&(o=!0),o||r.lineWrapping&&Math.abs(R-this.contentDOMWidth)>r.charWidth){let{lineHeight:_,charWidth:K,textHeight:U}=e.docView.measureTextSize();o=_>0&&r.refresh(a,_,K,U,Math.max(5,R/K),Q),o&&(e.docView.minWidth=0,d|=16)}k>0&&C>0?m=Math.max(k,C):k<0&&C<0&&(m=Math.min(k,C)),V1();for(let _ of this.viewports){let K=_.from==this.viewport.from?Q:e.docView.measureVisibleLineHeights(_);this.heightMap=(o?Kt.empty().applyChanges(this.stateDeco,_e.empty,this.heightOracle,[new ji(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new m4(_.from,K))}gl&&(d|=2)}let D=!this.viewportIsAppropriate(this.viewport,m)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return D&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(m,this.scrollTarget),d|=this.updateForViewport()),(d&2||D)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,a=this.heightOracle,{visibleTop:o,visibleBottom:c}=this,f=new Yu(r.lineAt(o-n*1e3,Ze.ByHeight,a,0,0).from,r.lineAt(c+(1-n)*1e3,Ze.ByHeight,a,0,0).to);if(t){let{head:d}=t.range;if(d<f.from||d>f.to){let m=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),y=r.lineAt(d,Ze.ByPos,a,0,0),b;t.y=="center"?b=(y.top+y.bottom)/2-m/2:t.y=="start"||t.y=="nearest"&&d<f.from?b=y.top:b=y.bottom-m,f=new Yu(r.lineAt(b-1e3/2,Ze.ByHeight,a,0,0).from,r.lineAt(b+m+1e3/2,Ze.ByHeight,a,0,0).to)}}return f}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Yu(this.heightMap.lineAt(n,Ze.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Ze.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Ze.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(t,Ze.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:c}=this;return(e==0||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||a>=c+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&a<c+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new op(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,a=r>>1,o=r<<1;if(this.defaultTextDirection!=Xe.LTR&&!n)return[];let c=[],f=(m,y,b,x)=>{if(y-m<a)return;let w=this.state.selection.main,k=[w.from];w.empty||k.push(w.to);for(let M of k)if(M>m&&M<y){f(m,M-10,b,x),f(M+10,y,b,x);return}let C=M4(e,M=>M.from>=b.from&&M.to<=b.to&&Math.abs(M.from-m)<a&&Math.abs(M.to-y)<a&&!k.some(R=>M.from<R&&M.to>R));if(!C){if(y<b.to&&t&&n&&t.visibleRanges.some(D=>D.from<=y&&D.to>=y)){let D=t.moveToLineBoundary(W.cursor(y),!1,!0).head;D>m&&(y=D)}let M=this.gapSize(b,m,y,x),R=n||M<2e6?M:2e6;C=new op(m,y,M,R)}c.push(C)},d=m=>{if(m.length<o||m.type!=Lt.Text)return;let y=A4(m.from,m.to,this.stateDeco);if(y.total<o)return;let b=this.scrollTarget?this.scrollTarget.range.head:null,x,w;if(n){let k=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,C,M;if(b!=null){let R=Wu(y,b),D=((this.visibleBottom-this.visibleTop)/2+k)/m.height;C=R-D,M=R+D}else C=(this.visibleTop-m.top-k)/m.height,M=(this.visibleBottom-m.top+k)/m.height;x=Iu(y,C),w=Iu(y,M)}else{let k=y.total*this.heightOracle.charWidth,C=r*this.heightOracle.charWidth,M=0;if(k>2e6)for(let K of e)K.from>=m.from&&K.from<m.to&&K.size!=K.displaySize&&K.from*this.heightOracle.charWidth+M<this.pixelViewport.left&&(M=K.size-K.displaySize);let R=this.pixelViewport.left+M,D=this.pixelViewport.right+M,Q,_;if(b!=null){let K=Wu(y,b),U=((D-R)/2+C)/k;Q=K-U,_=K+U}else Q=(R-C)/k,_=(D+C)/k;x=Iu(y,Q),w=Iu(y,_)}x>m.from&&f(m.from,x,m,y),w<m.to&&f(w,m.to,m,y)};for(let m of this.viewportLines)Array.isArray(m.type)?m.type.forEach(d):d(m);return c}gapSize(e,t,n,r){let a=Wu(r,n)-Wu(r,t);return this.heightOracle.lineWrapping?e.height*a:r.total*this.heightOracle.charWidth*a}updateLineGaps(e){op.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=me.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 n=[];Ee.spans(t,this.viewport.from,this.viewport.to,{span(a,o){n.push({from:a,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let a=0;a<n.length&&!(r&8);a++){let o=this.visibleRanges[a],c=n[a];(o.from!=c.from||o.to!=c.to)&&(r|=4,e&&e.mapPos(o.from,-1)==c.from&&e.mapPos(o.to,1)==c.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Da(this.heightMap.lineAt(e,Ze.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)||Da(this.heightMap.lineAt(this.scaler.fromDOM(e),Ze.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 Da(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}}class Yu{constructor(e,t){this.from=e,this.to=t}}function A4(i,e,t){let n=[],r=i,a=0;return Ee.spans(t,i,e,{span(){},point(o,c){o>r&&(n.push({from:r,to:o}),a+=o-r),r=c}},20),r<e&&(n.push({from:r,to:e}),a+=e-r),{total:a,ranges:n}}function Iu({total:i,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:a,to:o}=e[r],c=o-a;if(n<=c)return a+n;n-=c}}function Wu(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function M4(i,e){for(let t of i)if(e(t))return t}const F1={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};function K1(i){let e=i.facet(ch).filter(n=>typeof n!="function"),t=i.facet(cg).filter(n=>typeof n!="function");return t.length&&e.push(Ee.join(t)),e}class pg{constructor(e,t,n){let r=0,a=0,o=0;this.viewports=n.map(({from:c,to:f})=>{let d=t.lineAt(c,Ze.ByPos,e,0,0).top,m=t.lineAt(f,Ze.ByPos,e,0,0).bottom;return r+=m-d,{from:c,to:f,top:d,bottom:m,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let c of this.viewports)c.domTop=o+(c.top-a)*this.scale,o=c.domBottom=c.domTop+(c.bottom-c.top),a=c.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let a=t<this.viewports.length?this.viewports[t]:null;if(!a||e<a.top)return r+(e-n)*this.scale;if(e<=a.bottom)return a.domTop+(e-a.top);n=a.bottom,r=a.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let a=t<this.viewports.length?this.viewports[t]:null;if(!a||e<a.domTop)return n+(e-r)/this.scale;if(e<=a.domBottom)return a.top+(e-a.domTop);n=a.bottom,r=a.domBottom}}eq(e){return e instanceof pg?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function Da(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Vi(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Da(r,e)):i._content)}const Xu=re.define({combine:i=>i.join(" ")}),xm=re.define({combine:i=>i.indexOf(!0)>-1}),vm=As.newName(),cw=As.newName(),hw=As.newName(),fw={"&light":"."+cw,"&dark":"."+hw};function Sm(i,e,t){return new As(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}const T4=Sm("."+vm,{"&":{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"}},fw),O4={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},up=se.ie&&se.ie_version<=11;class E4{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new rN,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 n of t)this.queue.push(n);(se.ie&&se.ie_version<=11||se.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&se.android&&e.constructor.EDIT_CONTEXT!==!1&&!(se.chrome&&se.chrome_version<126)&&(this.editContext=new R4(e),e.state.facet(zn)&&(e.contentDOM.editContext=this.editContext.editContext)),up&&(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,n)=>t!=e[n]))){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:n}=this,r=this.selectionRange;if(n.state.facet(zn)?n.root.activeElement!=this.dom:!za(this.dom,r))return;let a=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(se.ie&&se.ie_version<=11||se.android&&se.chrome)&&!n.state.selection.main.empty&&r.focusNode&&_a(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Xa(e.root);if(!t)return!1;let n=se.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&N4(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=za(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&aN(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(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 n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.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,O4),up&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),up&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let r=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&al(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.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,n=-1,r=!1;for(let a of e){let o=this.readMutation(a);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&za(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new IN(this.view,e,t,n);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}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 n=this.view.state,r=$2(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!_c(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}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 n=Y1(t,e.previousSibling||e.target.previousSibling,-1),r=Y1(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):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(zn)!=e.state.facet(zn)&&(e.view.contentDOM.editContext=e.state.facet(zn)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.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 Y1(i,e,t){for(;e;){let n=bt.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function I1(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,a=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor,1);return _a(o.node,o.offset,r,a)&&([t,n,r,a]=[r,a,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:a}}function N4(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return I1(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?I1(i,t):null}class R4{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=n=>{let r=e.state.selection.main,{anchor:a,head:o}=r,c=this.toEditorPos(n.updateRangeStart),f=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:c,drifted:!1});let d=f-c>n.text.length;c==this.from&&a<this.from?c=a:f==this.to&&a>this.to&&(f=a);let m=ew(e.state.sliceDoc(c,f),n.text,(d?r.from:r.to)-c,d?"end":null);if(!m){let b=W.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));_c(b,r)||e.dispatch({selection:b,userEvent:"select"});return}let y={from:m.from+c,to:m.toA+c,insert:_e.of(n.text.slice(m.from,m.toB).split(`
|
|
20
|
+
`))};if((se.mac||se.android)&&y.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(y={from:c,to:f,insert:_e.of([n.text.replace("."," ")])}),this.pendingContextChange=y,!e.state.readOnly){let b=this.to-this.from+(y.to-y.from+y.insert.length);fg(e,y,W.single(this.toEditorPos(n.selectionStart,b),this.toEditorPos(n.selectionEnd,b)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),y.from<y.to&&!y.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],a=null;for(let o=this.toEditorPos(n.rangeStart),c=this.toEditorPos(n.rangeEnd);o<c;o++){let f=e.coordsForChar(o);a=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||a||new DOMRect,r.push(a)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let a of n.getTextFormats()){let o=a.underlineStyle,c=a.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(c)){let f=this.toEditorPos(a.rangeStart),d=this.toEditorPos(a.rangeEnd);if(f<d){let m=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;r.push(me.mark({attributes:{style:m}}).range(f,d))}}}e.dispatch({effects:G2.of(me.set(r))})},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:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=Xa(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((a,o,c,f,d)=>{if(n)return;let m=d.length-(o-a);if(r&&o>=r.to)if(r.from==a&&r.to==o&&r.insert.eq(d)){r=this.pendingContextChange=null,t+=m,this.to+=m;return}else r=null,this.revertPending(e.state);if(a+=t,o+=t,o<=this.from)this.from+=m,this.to+=m;else if(a<this.to){if(a<this.from||o>this.to||this.to-this.from+d.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(o),d.toString()),this.to+=m}t+=m}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.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,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}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 n=this.composing;return n&&n.drifted?n.editorBase+(e-n.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 ie{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:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(a=>n(a,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||lN(e.parent)||document,this.viewState=new G1(e.state||je.create(e)),e.scrollTo&&e.scrollTo.is(Gu)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(el).map(r=>new np(r));for(let r of this.plugins)r.update(this);this.observer=new E4(this),this.inputState=new JN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new R1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof wt?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,n=!1,r,a=this.state;for(let b of e){if(b.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=b.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,c=0,f=null;e.some(b=>b.annotation(lw))?(this.inputState.notifiedFocused=o,c=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,f=aw(a,o),f||(c=1));let d=this.observer.delayedAndroidKey,m=null;if(d?(this.observer.clearDelayedAndroidKey(),m=this.observer.readChange(),(m&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(m=null)):this.observer.clear(),a.facet(je.phrases)!=this.state.facet(je.phrases))return this.setState(a);r=Lc.create(this,a,e),r.flags|=c;let y=this.viewState.scrollTarget;try{this.updateState=2;for(let b of e){if(y&&(y=y.map(b.changes)),b.scrollIntoView){let{main:x}=b.state.selection;y=new ol(x.empty?x:W.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of b.effects)x.is(Gu)&&(y=x.value.clip(this.state))}this.viewState.update(r,y),this.bidiCache=qc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Na)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(b=>b.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Xu)!=r.state.facet(Xu)&&(this.viewState.mustMeasureContent=!0),(t||n||y||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let b of this.state.facet(pm))try{b(r)}catch(x){ni(this.state,x,"update listener")}(f||m)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),m&&!$2(this,m)&&d.force&&al(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new G1(e),this.plugins=e.facet(el).map(n=>new np(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new R1(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(el),n=e.state.facet(el);if(t!=n){let r=[];for(let a of n){let o=t.indexOf(a);if(o<0)r.push(new np(a));else{let c=this.plugins[o];c.mustUpdate=e,r.push(c)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=n&&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(n){ni(this.state,n,"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,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:a,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(o<0)if(T2(n))a=-1,o=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(r);a=x.from,o=x.top}this.updateState=1;let f=this.viewState.measure(this);if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let m=d.map(x=>{try{return x.read(this)}catch(w){return ni(this.state,w),W1}}),y=Lc.create(this,this.state,[]),b=!1;y.flags|=f,t?t.flags|=f:t=y,this.updateState=2,y.empty||(this.updatePlugins(y),this.inputState.update(y),this.updateAttrs(),b=this.docView.update(y),b&&this.docViewUpdate());for(let x=0;x<d.length;x++)if(m[x]!=W1)try{let w=d[x];w.write&&w.write(m[x],this)}catch(w){ni(this.state,w)}if(b&&this.docView.updateSelection(!0),!y.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let w=(a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)-o;if(w>1||w<-1){r=r+w,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let c of this.state.facet(pm))c(t)}get themeClasses(){return vm+" "+(this.state.facet(xm)?hw:cw)+" "+this.state.facet(Xu)}updateAttrs(){let e=X1(this,F2,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(zn)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),X1(this,ug,t);let n=this.observer.ignore(()=>{let r=A1(this.contentDOM,this.contentAttrs,t),a=A1(this.dom,this.editorAttrs,e);return r||a});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(ie.announce)){t&&(this.announceDOM.textContent=""),t=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Na);let e=this.state.facet(ie.cspNonce);As.mount(this.root,this.styleModules.concat(T4).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(n=>n.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,n){return ap(this,e,D1(this,e,t,n))}moveByGroup(e,t){return ap(this,e,D1(this,e,t,n=>VN(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),a=n[t?n.length-1:0];return W.cursor(a.side(t,r)+e.from,a.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return PN(this,e,t,n)}moveVertically(e,t,n){return ap(this,e,QN(this,e,t,n))}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 n=ym(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),ym(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),a=this.bidiSpans(r),o=a[on.find(a,e-r.from,-1,t)];return Za(n,o.dir==Xe.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(P2)||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>D4)return j2(e.length);let t=this.textDirectionAt(e.from),n;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==t&&(a.fresh||D2(a.isolates,n=O1(this,e))))return a.order;n||(n=O1(this,e));let r=pN(e.text,t,n);return this.bidiCache.push(new qc(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{M2(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 Gu.of(new ol(typeof e=="number"?W.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Gu.of(new ol(W.cursor(n.from),"start","start",n.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 at.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return at.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=As.newName(),r=[Xu.of(n),Na.of(Sm(`.${n}`,e))];return t&&t.dark&&r.push(xm.of(!0)),r}static baseTheme(e){return dr.lowest(Na.of(Sm("."+vm,e,fw)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&bt.get(n)||bt.get(e);return((t=r?.root)===null||t===void 0?void 0:t.view)||null}}ie.styleModule=Na;ie.inputHandler=U2;ie.clipboardInputFilter=ag;ie.clipboardOutputFilter=og;ie.scrollHandler=Q2;ie.focusChangeEffect=q2;ie.perLineTextDirection=P2;ie.exceptionSink=_2;ie.updateListener=pm;ie.editable=zn;ie.mouseSelectionStyle=H2;ie.dragMovesSelection=z2;ie.clickAddsSelectionRange=L2;ie.decorations=ch;ie.blockWrappers=K2;ie.outerDecorations=cg;ie.atomicRanges=mo;ie.bidiIsolatedRanges=Y2;ie.scrollMargins=I2;ie.darkTheme=xm;ie.cspNonce=re.define({combine:i=>i.length?i[0]:""});ie.contentAttributes=ug;ie.editorAttributes=F2;ie.lineWrapping=ie.contentAttributes.of({class:"cm-lineWrapping"});ie.announce=ve.define();const D4=4096,W1={};class qc{constructor(e,t,n,r,a,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=a,this.order=o}static update(e,t){if(t.empty&&!e.some(a=>a.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:Xe.LTR;for(let a=Math.max(0,e.length-10);a<e.length;a++){let o=e[a];o.dir==r&&!t.touchesRange(o.from,o.to)&&n.push(new qc(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function X1(i,e,t){for(let n=i.state.facet(e),r=n.length-1;r>=0;r--){let a=n[r],o=typeof a=="function"?a(i):a;o&&sg(o,t)}return t}const j4=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function B4(i,e){const t=i.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let r,a,o,c;for(let f=0;f<t.length-1;++f){const d=t[f];if(/^(cmd|meta|m)$/i.test(d))c=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))a=!0;else if(/^s(hift)?$/i.test(d))o=!0;else if(/^mod$/i.test(d))e=="mac"?c=!0:a=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(n="Alt-"+n),a&&(n="Ctrl-"+n),c&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Zu(i,e,t){return e.altKey&&(i="Alt-"+i),e.ctrlKey&&(i="Ctrl-"+i),e.metaKey&&(i="Meta-"+i),t!==!1&&e.shiftKey&&(i="Shift-"+i),i}const L4=dr.default(ie.domEventHandlers({keydown(i,e){return pw(dw(e.state),i,e,"editor")}})),ph=re.define({enables:L4}),Z1=new WeakMap;function dw(i){let e=i.facet(ph),t=Z1.get(e);return t||Z1.set(e,t=_4(e.reduce((n,r)=>n.concat(r),[]))),t}function z4(i,e,t){return pw(dw(i.state),e,i,t)}let bs=null;const H4=4e3;function _4(i,e=j4){let t=Object.create(null),n=Object.create(null),r=(o,c)=>{let f=n[o];if(f==null)n[o]=c;else if(f!=c)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},a=(o,c,f,d,m)=>{var y,b;let x=t[o]||(t[o]=Object.create(null)),w=c.split(/ (?!$)/).map(M=>B4(M,e));for(let M=1;M<w.length;M++){let R=w.slice(0,M).join(" ");r(R,!0),x[R]||(x[R]={preventDefault:!0,stopPropagation:!1,run:[D=>{let Q=bs={view:D,prefix:R,scope:o};return setTimeout(()=>{bs==Q&&(bs=null)},H4),!0}]})}let k=w.join(" ");r(k,!1);let C=x[k]||(x[k]={preventDefault:!1,stopPropagation:!1,run:((b=(y=x._any)===null||y===void 0?void 0:y.run)===null||b===void 0?void 0:b.slice())||[]});f&&C.run.push(f),d&&(C.preventDefault=!0),m&&(C.stopPropagation=!0)};for(let o of i){let c=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let d of c){let m=t[d]||(t[d]=Object.create(null));m._any||(m._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:y}=o;for(let b in m)m[b].run.push(x=>y(x,wm))}let f=o[e]||o.key;if(f)for(let d of c)a(d,f,o.run,o.preventDefault,o.stopPropagation),o.shift&&a(d,"Shift-"+f,o.shift,o.preventDefault,o.stopPropagation)}return t}let wm=null;function pw(i,e,t,n){wm=e;let r=ZE(e),a=ei(r,0),o=ln(a)==r.length&&r!=" ",c="",f=!1,d=!1,m=!1;bs&&bs.view==t&&bs.scope==n&&(c=bs.prefix+" ",iw.indexOf(e.keyCode)<0&&(d=!0,bs=null));let y=new Set,b=C=>{if(C){for(let M of C.run)if(!y.has(M)&&(y.add(M),M(t)))return C.stopPropagation&&(m=!0),!0;C.preventDefault&&(C.stopPropagation&&(m=!0),d=!0)}return!1},x=i[n],w,k;return x&&(b(x[c+Zu(r,e,!o)])?f=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&!(se.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(w=Ms[e.keyCode])&&w!=r?(b(x[c+Zu(w,e,!0)])||e.shiftKey&&(k=Ia[e.keyCode])!=r&&k!=w&&b(x[c+Zu(k,e,!1)]))&&(f=!0):o&&e.shiftKey&&b(x[c+Zu(r,e,!0)])&&(f=!0),!f&&b(x._any)&&(f=!0)),d&&(f=!0),f&&m&&e.stopPropagation(),wm=null,f}class go{constructor(e,t,n,r,a){this.className=e,this.left=t,this.top=n,this.width=r,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let a=mw(e);return[new go(t,r.left-a.left,r.top-a.top,null,r.bottom-r.top)]}else return U4(e,t,n)}}function mw(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==Xe.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function J1(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let a=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,c=i.posAtCoords({x:a.left+1,y:o}),f=i.posAtCoords({x:a.right-1,y:o});return c==null||f==null?n:{from:Math.max(n.from,Math.min(c,f)),to:Math.min(n.to,Math.max(c,f))}}function U4(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),a=i.textDirection==Xe.LTR,o=i.contentDOM,c=o.getBoundingClientRect(),f=mw(i),d=o.querySelector(".cm-line"),m=d&&window.getComputedStyle(d),y=c.left+(m?parseInt(m.paddingLeft)+Math.min(0,parseInt(m.textIndent)):0),b=c.right-(m?parseInt(m.paddingRight):0),x=gm(i,n,1),w=gm(i,r,-1),k=x.type==Lt.Text?x:null,C=w.type==Lt.Text?w:null;if(k&&(i.lineWrapping||x.widgetLineBreaks)&&(k=J1(i,n,1,k)),C&&(i.lineWrapping||w.widgetLineBreaks)&&(C=J1(i,r,-1,C)),k&&C&&k.from==C.from&&k.to==C.to)return R(D(t.from,t.to,k));{let _=k?D(t.from,null,k):Q(x,!1),K=C?D(null,t.to,C):Q(w,!0),U=[];return(k||x).to<(C||w).from-(k&&C?1:0)||x.widgetLineBreaks>1&&_.bottom+i.defaultLineHeight/2<K.top?U.push(M(y,_.bottom,b,K.top)):_.bottom<K.top&&i.elementAtHeight((_.bottom+K.top)/2).type==Lt.Text&&(_.bottom=K.top=(_.bottom+K.top)/2),R(_).concat(U).concat(R(K))}function M(_,K,U,J){return new go(e,_-f.left,K-f.top,Math.max(0,U-_),J-K)}function R({top:_,bottom:K,horizontal:U}){let J=[];for(let Z=0;Z<U.length;Z+=2)J.push(M(U[Z],_,U[Z+1],K));return J}function D(_,K,U){let J=1e9,Z=-1e9,ce=[];function ae(fe,de,H,X,le){let ue=i.coordsAtPos(fe,fe==U.to?-2:2),ge=i.coordsAtPos(H,H==U.from?2:-2);!ue||!ge||(J=Math.min(ue.top,ge.top,J),Z=Math.max(ue.bottom,ge.bottom,Z),le==Xe.LTR?ce.push(a&&de?y:ue.left,a&&X?b:ge.right):ce.push(!a&&X?y:ge.left,!a&&de?b:ue.right))}let P=_??U.from,ee=K??U.to;for(let fe of i.visibleRanges)if(fe.to>P&&fe.from<ee)for(let de=Math.max(fe.from,P),H=Math.min(fe.to,ee);;){let X=i.state.doc.lineAt(de);for(let le of i.bidiSpans(X)){let ue=le.from+X.from,ge=le.to+X.from;if(ue>=H)break;ge>de&&ae(Math.max(ue,de),_==null&&ue<=P,Math.min(ge,H),K==null&&ge>=ee,le.dir)}if(de=X.to+1,de>=H)break}return ce.length==0&&ae(P,_==null,ee,K==null,i.textDirection),{top:J,bottom:Z,horizontal:ce}}function Q(_,K){let U=c.top+(K?_.top:_.bottom);return{top:U,bottom:U,horizontal:[]}}}function q4(i,e){return i.constructor==e.constructor&&i.eq(e)}class P4{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(yc)!=e.state.facet(yc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(yc);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,n)=>!q4(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,se.safari&&se.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const yc=re.define();function gw(i){return[at.define(e=>new P4(e,i)),yc.of(i)]}const $a=re.define({combine(i){return pn(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function V4(i={}){return[$a.of(i),Q4,G4,F4,V2.of(!0)]}function yw(i){return i.startState.facet($a)!=i.state.facet($a)}const Q4=gw({above:!0,markers(i){let{state:e}=i,t=e.facet($a),n=[];for(let r of e.selection.ranges){let a=r==e.selection.main;if(r.empty||t.drawRangeCursor){let o=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=r.empty?r:W.cursor(r.head,r.head>r.anchor?-1:1);for(let f of go.forRange(i,o,c))n.push(f)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=yw(i);return t&&$1(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){$1(e.state,i)},class:"cm-cursorLayer"});function $1(i,e){e.style.animationDuration=i.facet($a).cursorBlinkRate+"ms"}const G4=gw({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:go.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||yw(i)},class:"cm-selectionLayer"}),F4=dr.highest(ie.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),bw=ve.define({map(i,e){return i==null?null:e.mapPos(i)}}),ja=Ut.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(bw)?n.value:t,i)}}),K4=at.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(ja);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(ja)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(ja),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(ja)!=i&&this.view.dispatch({effects:bw.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Y4(){return[ja,K4]}function ev(i,e,t,n,r){e.lastIndex=0;for(let a=i.iterRange(t,n),o=t,c;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;c=e.exec(a.value);)r(o+c.index,c)}function I4(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:r,to:a}of t)r=Math.max(i.state.doc.lineAt(r).from,r-e),a=Math.min(i.state.doc.lineAt(a).to,a+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=a:n.push({from:r,to:a});return n}class W4{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:a,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(c,f,d,m)=>r(m,d,d+c[0].length,c,f);else if(typeof n=="function")this.addMatch=(c,f,d,m)=>{let y=n(c,f,d);y&&m(d,d+c[0].length,y)};else if(n)this.addMatch=(c,f,d,m)=>m(d,d+c[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=o}createDeco(e){let t=new Un,n=t.add.bind(t);for(let{from:r,to:a}of I4(e,this.maxLength))ev(e.state.doc,this.regexp,r,a,(o,c)=>this.addMatch(c,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((a,o,c,f)=>{f>=e.view.viewport.from&&c<=e.view.viewport.to&&(n=Math.min(c,n),r=Math.max(f,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let a of e.visibleRanges){let o=Math.max(a.from,n),c=Math.min(a.to,r);if(c>=o){let f=e.state.doc.lineAt(o),d=f.to<c?e.state.doc.lineAt(c):f,m=Math.max(a.from,f.from),y=Math.min(a.to,d.to);if(this.boundary){for(;o>f.from;o--)if(this.boundary.test(f.text[o-1-f.from])){m=o;break}for(;c<d.to;c++)if(this.boundary.test(d.text[c-d.from])){y=c;break}}let b=[],x,w=(k,C,M)=>b.push(M.range(k,C));if(f==d)for(this.regexp.lastIndex=m-f.from;(x=this.regexp.exec(f.text))&&x.index<y-f.from;)this.addMatch(x,e,x.index+f.from,w);else ev(e.state.doc,this.regexp,m,y,(k,C)=>this.addMatch(C,e,k,w));t=t.update({filterFrom:m,filterTo:y,filter:(k,C)=>k<m||C>y,add:b})}}return t}}const km=/x/.unicode!=null?"gu":"g",X4=new RegExp(`[\0-\b
|
|
21
|
+
--\u2028\u2029\uFEFF-]`,km),Z4={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let cp=null;function J4(){var i;if(cp==null&&typeof document<"u"&&document.body){let e=document.body.style;cp=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return cp||!1}const bc=re.define({combine(i){let e=pn(i,{render:null,specialChars:X4,addSpecialChars:null});return(e.replaceTabs=!J4())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,km)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,km)),e}});function $4(i={}){return[bc.of(i),eR()]}let tv=null;function eR(){return tv||(tv=at.fromClass(class{constructor(i){this.view=i,this.decorations=me.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(bc)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new W4({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,a=ei(e[0],0);if(a==9){let o=r.lineAt(n),c=t.state.tabSize,f=Cl(o.text,c,n-o.from);return me.replace({widget:new sR((c-f%c)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=me.replace({widget:new nR(i,a)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(bc);i.startState.facet(bc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}const tR="•";function iR(i){return i>=32?tR:i==10?"":String.fromCharCode(9216+i)}class nR extends mn{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=iR(this.code),n=e.state.phrase("Control character")+" "+(Z4[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let a=document.createElement("span");return a.textContent=t,a.title=n,a.setAttribute("aria-label",n),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class sR extends mn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function rR(){return aR}const lR=me.line({class:"cm-activeLine"}),aR=at.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(lR.range(r.from)),e=r.from)}return me.set(t)}},{decorations:i=>i.decorations});class oR extends mn{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Ha(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=Za(t[0],n.direction!="rtl"),a=parseInt(n.lineHeight);return r.bottom-r.top>a*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+a}:r}ignoreEvent(){return!1}}function uR(i){let e=at.fromClass(class{constructor(t){this.view=t,this.placeholder=i?me.set([me.widget({widget:new oR(i),side:1}).range(0)]):me.none}get decorations(){return this.view.state.doc.length?me.none:this.placeholder}},{decorations:t=>t.decorations});return typeof i=="string"?[e,ie.contentAttributes.of({"aria-placeholder":i})]:e}const Cm=2e3;function cR(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),a=[];if(e.off>Cm||t.off>Cm||e.col<0||t.col<0){let o=Math.min(e.off,t.off),c=Math.max(e.off,t.off);for(let f=n;f<=r;f++){let d=i.doc.line(f);d.length<=c&&a.push(W.range(d.from+o,d.to+c))}}else{let o=Math.min(e.col,t.col),c=Math.max(e.col,t.col);for(let f=n;f<=r;f++){let d=i.doc.line(f),m=nm(d.text,o,i.tabSize,!0);if(m<0)a.push(W.cursor(d.to));else{let y=nm(d.text,c,i.tabSize);a.push(W.range(d.from+m,d.from+y))}}}return a}function hR(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function iv(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,a=r>Cm?-1:r==n.length?hR(i,e.clientX):Cl(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:a,off:r}}function fR(i,e){let t=iv(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let a=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(a);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,a,o){let c=iv(i,r);if(!c)return n;let f=cR(i.state,t,c);return f.length?o?W.create(f.concat(n.ranges)):W.create(f):n}}:null}function dR(i){let e=(t=>t.altKey&&t.button==0);return ie.mouseSelectionStyle.of((t,n)=>e(n)?fR(t,n):null)}const pR={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},mR={style:"cursor: crosshair"};function gR(i={}){let[e,t]=pR[i.key||"Alt"],n=at.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,ie.contentAttributes.of(r=>{var a;return!((a=r.plugin(n))===null||a===void 0)&&a.isDown?mR:null})]}const Ju="-10000px";class xw{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let a=null;this.tooltipViews=this.tooltips.map(o=>a=n(o,a))}update(e,t){var n;let r=e.state.facet(this.facet),a=r.filter(f=>f);if(r===this.input){for(let f of this.tooltipViews)f.update&&f.update(e);return!1}let o=[],c=t?[]:null;for(let f=0;f<a.length;f++){let d=a[f],m=-1;if(d){for(let y=0;y<this.tooltips.length;y++){let b=this.tooltips[y];b&&b.create==d.create&&(m=y)}if(m<0)o[f]=this.createTooltipView(d,f?o[f-1]:null),c&&(c[f]=!!d.above);else{let y=o[f]=this.tooltipViews[m];c&&(c[f]=t[m]),y.update&&y.update(e)}}}for(let f of this.tooltipViews)o.indexOf(f)<0&&(this.removeTooltipView(f),(n=f.destroy)===null||n===void 0||n.call(f));return t&&(c.forEach((f,d)=>t[d]=f),t.length=c.length),this.input=r,this.tooltips=a,this.tooltipViews=o,!0}}function yR(i){let e=i.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const hp=re.define({combine:i=>{var e,t,n;return{position:se.ios?"absolute":((e=i.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||yR}}}),nv=new WeakMap,mg=at.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(hp);this.position=e.position,this.parent=e.parent,this.classes=i.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 xw(i,gg,(t,n)=>this.createTooltip(t,n),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(),i.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 i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(hp);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Ju,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);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 i=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(se.safari){let o=a.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(i=a.width/this.parent.offsetWidth,e=a.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=hg(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,o)=>{let c=this.manager.tooltipViews[o];return c.getCoords?c.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(hp).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:t}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let c of this.manager.tooltipViews)c.dom.style.position="absolute"}let{visible:t,space:n,scaleX:r,scaleY:a}=i,o=[];for(let c=0;c<this.manager.tooltips.length;c++){let f=this.manager.tooltips[c],d=this.manager.tooltipViews[c],{dom:m}=d,y=i.pos[c],b=i.size[c];if(!y||f.clip!==!1&&(y.bottom<=Math.max(t.top,n.top)||y.top>=Math.min(t.bottom,n.bottom)||y.right<Math.max(t.left,n.left)-.1||y.left>Math.min(t.right,n.right)+.1)){m.style.top=Ju;continue}let x=f.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,w=x?7:0,k=b.right-b.left,C=(e=nv.get(d))!==null&&e!==void 0?e:b.bottom-b.top,M=d.offset||xR,R=this.view.textDirection==Xe.LTR,D=b.width>n.right-n.left?R?n.left:n.right-b.width:R?Math.max(n.left,Math.min(y.left-(x?14:0)+M.x,n.right-k)):Math.min(Math.max(n.left,y.left-k+(x?14:0)-M.x),n.right-k),Q=this.above[c];!f.strictSide&&(Q?y.top-C-w-M.y<n.top:y.bottom+C+w+M.y>n.bottom)&&Q==n.bottom-y.bottom>y.top-n.top&&(Q=this.above[c]=!Q);let _=(Q?y.top-n.top:n.bottom-y.bottom)-w;if(_<C&&d.resize!==!1){if(_<this.view.defaultLineHeight){m.style.top=Ju;continue}nv.set(d,C),m.style.height=(C=_)/a+"px"}else m.style.height&&(m.style.height="");let K=Q?y.top-C-w-M.y:y.bottom+w+M.y,U=D+k;if(d.overlap!==!0)for(let J of o)J.left<U&&J.right>D&&J.top<K+C&&J.bottom>K&&(K=Q?J.top-C-2-w:J.bottom+w+2);if(this.position=="absolute"?(m.style.top=(K-i.parent.top)/a+"px",sv(m,(D-i.parent.left)/r)):(m.style.top=K/a+"px",sv(m,D/r)),x){let J=y.left+(R?M.x:-M.x)-(D+14-7);x.style.left=J/r+"px"}d.overlap!==!0&&o.push({left:D,top:K,right:U,bottom:K+C}),m.classList.toggle("cm-tooltip-above",Q),m.classList.toggle("cm-tooltip-below",!Q),d.positioned&&d.positioned(i.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 i of this.manager.tooltipViews)i.dom.style.top=Ju}},{eventObservers:{scroll(){this.maybeMeasure()}}});function sv(i,e){let t=parseInt(i.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(i.style.left=e+"px")}const bR=ie.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"}}}),xR={x:0,y:0},gg=re.define({enables:[mg,bR]}),Pc=re.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])});class mh{static create(e){return new mh(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new xw(e,Pc,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const vR=gg.compute([Pc],i=>{let e=i.facet(Pc);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:mh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class SR{constructor(e,t,n,r,a){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,a=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let c=e.coordsAtPos(r);if(!c||t.y<c.top||t.y>c.bottom||t.x<c.left-e.defaultCharacterWidth||t.x>c.right+e.defaultCharacterWidth)return;let f=e.bidiSpans(e.state.doc.lineAt(r)).find(m=>m.from<=r&&m.to>=r),d=f&&f.dir==Xe.RTL?-1:1;a=t.x<c.left?-d:d}let o=this.source(e,r,a);if(o?.then){let c=this.pending={pos:r};o.then(f=>{this.pending==c&&(this.pending=null,f&&!(Array.isArray(f)&&!f.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(f)?f:[f])}))},f=>ni(e.state,f,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(mg),t=e?e.manager.tooltips.findIndex(n=>n.create==mh.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:a}=this;if(r.length&&a&&!wR(a.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,c=(n=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==c?this.view.posAtCoords(this.lastMove)!=o:!kR(this.view,o,c,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const $u=4;function wR(i,e){let{left:t,right:n,top:r,bottom:a}=i.getBoundingClientRect(),o;if(o=i.querySelector(".cm-tooltip-arrow")){let c=o.getBoundingClientRect();r=Math.min(c.top,r),a=Math.max(c.bottom,a)}return e.clientX>=t-$u&&e.clientX<=n+$u&&e.clientY>=r-$u&&e.clientY<=a+$u}function kR(i,e,t,n,r,a){let o=i.scrollDOM.getBoundingClientRect(),c=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.right<n||o.top>r||Math.min(o.bottom,c)<r)return!1;let f=i.posAtCoords({x:n,y:r},!1);return f>=e&&f<=t}function CR(i,e={}){let t=ve.define(),n=Ut.define({create(){return[]},update(r,a){if(r.length&&(e.hideOnChange&&(a.docChanged||a.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(a,o))),a.docChanged)){let o=[];for(let c of r){let f=a.changes.mapPos(c.pos,-1,Ft.TrackDel);if(f!=null){let d=Object.assign(Object.create(null),c);d.pos=f,d.end!=null&&(d.end=a.changes.mapPos(d.end)),o.push(d)}}r=o}for(let o of a.effects)o.is(t)&&(r=o.value),o.is(AR)&&(r=[]);return r},provide:r=>Pc.from(r)});return{active:n,extension:[n,at.define(r=>new SR(r,i,n,t,e.hoverTime||300)),vR]}}function vw(i,e){let t=i.plugin(mg);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const AR=ve.define(),rv=re.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function yg(i,e){let t=i.plugin(Sw),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const Sw=at.fromClass(class{constructor(i){this.input=i.state.facet(eo),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(rv);this.top=new ec(i,!0,e.topContainer),this.bottom=new ec(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(rv);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ec(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ec(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(eo);if(t!=this.input){let n=t.filter(f=>f),r=[],a=[],o=[],c=[];for(let f of n){let d=this.specs.indexOf(f),m;d<0?(m=f(i.view),c.push(m)):(m=this.panels[d],m.update&&m.update(i)),r.push(m),(m.top?a:o).push(m)}this.specs=n,this.panels=r,this.top.sync(a),this.bottom.sync(o);for(let f of c)f.dom.classList.add("cm-panel"),f.mount&&f.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>ie.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class ec{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=lv(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=lv(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function lv(i){let e=i.nextSibling;return i.remove(),e}const eo=re.define({enables:Sw});function MR(i,e){let t,n=new Promise(o=>t=o),r=o=>TR(o,e,t);i.state.field(fp,!1)?i.dispatch({effects:ww.of(r)}):i.dispatch({effects:ve.appendConfig.of(fp.init(()=>[r]))});let a=kw.of(r);return{close:a,result:n.then(o=>((i.win.queueMicrotask||(f=>i.win.setTimeout(f,10)))(()=>{i.state.field(fp).indexOf(r)>-1&&i.dispatch({effects:a})}),o))}}const fp=Ut.define({create(){return[]},update(i,e){for(let t of e.effects)t.is(ww)?i=[t.value].concat(i):t.is(kw)&&(i=i.filter(n=>n!=t.value));return i},provide:i=>eo.computeN([i],e=>e.field(i))}),ww=ve.define(),kw=ve.define();function TR(i,e,t){let n=e.content?e.content(i,()=>o(null)):null;if(!n){if(n=Ye("form"),e.input){let c=Ye("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),n.appendChild(Ye("label",(e.label||"")+": ",c))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(Ye("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let c=0;c<r.length;c++){let f=r[c];f.addEventListener("keydown",d=>{d.keyCode==27?(d.preventDefault(),o(null)):d.keyCode==13&&(d.preventDefault(),o(f))}),f.addEventListener("submit",d=>{d.preventDefault(),o(f)})}let a=Ye("div",n,Ye("button",{onclick:()=>o(null),"aria-label":i.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(a.className=e.class),a.classList.add("cm-dialog");function o(c){a.contains(a.ownerDocument.activeElement)&&i.focus(),t(c)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=n.querySelector(e.focus):c=n.querySelector("input")||n.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class Pn extends Cs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Pn.prototype.elementClass="";Pn.prototype.toDOM=void 0;Pn.prototype.mapMode=Ft.TrackBefore;Pn.prototype.startSide=Pn.prototype.endSide=-1;Pn.prototype.point=!0;const xc=re.define(),OR=re.define(),ER={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ee.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},qa=re.define();function NR(i){return[Cw(),qa.of({...ER,...i})]}const av=re.define({combine:i=>i.some(e=>e)});function Cw(i){return[RR]}const RR=at.fromClass(class{constructor(i){this.view=i,this.domAfter=null,this.prevViewport=i.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=i.state.facet(qa).map(e=>new uv(i,e)),this.fixed=!i.state.facet(av);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),i.scrollDOM.insertBefore(this.dom,i.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(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}if(i.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(av)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=Ee.iter(this.view.state.facet(xc),this.view.viewport.from),n=[],r=this.gutters.map(a=>new DR(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(a.type)){let o=!0;for(let c of a.type)if(c.type==Lt.Text&&o){Am(t,n,c.from);for(let f of r)f.line(this.view,c,n);o=!1}else if(c.widget)for(let f of r)f.widget(this.view,c)}else if(a.type==Lt.Text){Am(t,n,a.from);for(let o of r)o.line(this.view,a,n)}else if(a.widget)for(let o of r)o.widget(this.view,a);for(let a of r)a.finish();i&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(i){let e=i.startState.facet(qa),t=i.state.facet(qa),n=i.docChanged||i.heightChanged||i.viewportChanged||!Ee.eq(i.startState.facet(xc),i.state.facet(xc),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let a of t){let o=e.indexOf(a);o<0?r.push(new uv(this.view,a)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let a of this.gutters)a.dom.remove(),r.indexOf(a)<0&&a.destroy();for(let a of r)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>ie.scrollMargins.of(e=>{let t=e.plugin(i);if(!t||t.gutters.length==0||!t.fixed)return null;let n=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Xe.LTR?{left:n,right:r}:{right:n,left:r}})});function ov(i){return Array.isArray(i)?i:[i]}function Am(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}class DR{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ee.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,a=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let c=new Aw(e,o,a,n);r.elements.push(c),r.dom.appendChild(c.dom)}else r.elements[this.i].update(e,o,a,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Am(this.cursor,r,t.from),n.length&&(r=r.concat(n));let a=this.gutter.config.lineMarker(e,t,r);a&&r.unshift(a);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let a of e.state.facet(OR)){let o=a(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class uv{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 n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let a=r.target,o;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let f=a.getBoundingClientRect();o=(f.top+f.bottom)/2}else o=r.clientY;let c=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,c,r)&&r.preventDefault()});this.markers=ov(t.markers(e)),t.initialSpacer&&(this.spacer=new Aw(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=ov(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!Ee.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Aw{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),jR(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let a=0,o=0;;){let c=o,f=a<t.length?t[a++]:null,d=!1;if(f){let m=f.elementClass;m&&(n+=" "+m);for(let y=o;y<this.markers.length;y++)if(this.markers[y].compare(f)){c=y,d=!0;break}}else c=this.markers.length;for(;o<c;){let m=this.markers[o++];if(m.toDOM){m.destroy(r);let y=r.nextSibling;r.remove(),r=y}}if(!f)break;f.toDOM&&(d?r=r.nextSibling:this.dom.insertBefore(f.toDOM(e),r)),d&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}function jR(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(!i[t].compare(e[t]))return!1;return!0}const BR=re.define(),LR=re.define(),tl=re.define({combine(i){return pn(i,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let r in t){let a=n[r],o=t[r];n[r]=a?(c,f,d)=>a(c,f,d)||o(c,f,d):o}return n}})}});class dp extends Pn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function pp(i,e){return i.state.facet(tl).formatNumber(e,i.state)}const zR=qa.compute([tl],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(BR)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new dp(pp(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(LR)){let a=r(e,t,n);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(tl)!=e.state.facet(tl),initialSpacer(e){return new dp(pp(e,cv(e.state.doc.lines)))},updateSpacer(e,t){let n=pp(t.view,cv(t.view.state.doc.lines));return n==e.number?e:new dp(n)},domEventHandlers:i.facet(tl).domEventHandlers,side:"before"}));function HR(i={}){return[tl.of(i),Cw(),zR]}function cv(i){let e=9;for(;e<i;)e=e*10+9;return e}const _R=new class extends Pn{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},UR=xc.compute(["selection"],i=>{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(_R.range(r)))}return Ee.of(e)});function qR(){return UR}const Mw=1024;let PR=0;class mp{constructor(e,t){this.from=e,this.to=t}}class Me{constructor(e={}){this.id=PR++,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=ri.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}Me.closedBy=new Me({deserialize:i=>i.split(" ")});Me.openedBy=new Me({deserialize:i=>i.split(" ")});Me.group=new Me({deserialize:i=>i.split(" ")});Me.isolate=new Me({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Me.contextHash=new Me({perNode:!0});Me.lookAhead=new Me({perNode:!0});Me.mounted=new Me({perNode:!0});class Pa{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Me.mounted.id]}}const VR=Object.create(null);class ri{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):VR,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ri(e.name||"",t,e.id,n);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(r)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[a[0].id]=a[1]}}return r}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(Me.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(Me.group),a=-1;a<(r?r.length:0);a++){let o=t[a<0?n.name:r[a]];if(o)return o}}}}ri.none=new ri("",Object.create(null),0,8);class bg{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 n of this.types){let r=null;for(let a of e){let o=a(n);if(o){r||(r=Object.assign({},n.props));let c=o[1],f=o[0];f.combine&&f.id in r&&(c=f.combine(r[f.id],c)),r[f.id]=c}}t.push(r?new ri(n.name,r,n.id,n.flags):n)}return new bg(t)}}const tc=new WeakMap,hv=new WeakMap;var lt;(function(i){i[i.ExcludeBuffers=1]="ExcludeBuffers",i[i.IncludeAnonymous=2]="IncludeAnonymous",i[i.IgnoreMounts=4]="IgnoreMounts",i[i.IgnoreOverlays=8]="IgnoreOverlays",i[i.EnterBracketed=16]="EnterBracketed"})(lt||(lt={}));class ft{constructor(e,t,n,r,a){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,a&&a.length){this.props=Object.create(null);for(let[o,c]of a)this.props[typeof o=="number"?o:o.id]=c}}toString(){let e=Pa.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let r=n.toString();r&&(t&&(t+=","),t+=r)}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 Tm(this.topNode,e)}cursorAt(e,t=0,n=0){let r=tc.get(this)||this.topNode,a=new Tm(r);return a.moveTo(e,t),tc.set(this,a._tree),a}get topNode(){return new zi(this,0,0,null)}resolve(e,t=0){let n=to(tc.get(this)||this.topNode,e,t,!1);return tc.set(this,n),n}resolveInner(e,t=0){let n=to(hv.get(this)||this.topNode,e,t,!0);return hv.set(this,n),n}resolveStack(e,t=0){return FR(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:a=this.length}=e,o=e.mode||0,c=(o<.IncludeAnonymous)>0;for(let f=this.cursor(o|lt.IncludeAnonymous);;){let d=!1;if(f.from<=a&&f.to>=r&&(!c&&f.type.isAnonymous||t(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&n&&(c||!f.type.isAnonymous)&&n(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Sg(ri.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new ft(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new ft(ri.none,t,n,r)))}static build(e){return KR(e)}}ft.empty=new ft(ri.none,[],[],0);class xg{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 xg(this.buffer,this.index)}}class Os{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return ri.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],n=this.buffer[e+3],r=this.set.types[t],a=r.name;if(/\W/.test(a)&&!r.isError&&(a=JSON.stringify(a)),e+=4,n==e)return a;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return a+"("+o.join(",")+")"}findChild(e,t,n,r,a){let{buffer:o}=this,c=-1;for(let f=e;f!=t&&!(Tw(a,r,o[f+1],o[f+2])&&(c=f,n>0));f=o[f+3]);return c}slice(e,t,n){let r=this.buffer,a=new Uint16Array(t-e),o=0;for(let c=e,f=0;c<t;){a[f++]=r[c++],a[f++]=r[c++]-n;let d=a[f++]=r[c++]-n;a[f++]=r[c++]-e,o=Math.max(o,d)}return new Os(a,o,this.set)}}function Tw(i,e,t,n){switch(i){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function to(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to<e);){let o=!n&&i instanceof zi&&i.index<0?null:i.parent;if(!o)return i;i=o}let a=n?0:lt.IgnoreOverlays;if(n)for(let o=i,c=o.parent;c;o=c,c=o.parent)o instanceof zi&&o.index<0&&((r=c.enter(e,t,a))===null||r===void 0?void 0:r.from)!=o.from&&(i=c);for(;;){let o=i.enter(e,t,a);if(!o)return i;i=o}}class Ow{cursor(e=0){return new Tm(this,e)}getChild(e,t=null,n=null){let r=fv(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return fv(this,e,t,n)}resolve(e,t=0){return to(this,e,t,!1)}resolveInner(e,t=0){return to(this,e,t,!0)}matchContext(e){return Mm(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(n=t,t=r.prevSibling):t=r}return n}get node(){return this}get next(){return this.parent}}class zi extends Ow{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,a=0){for(let o=this;;){for(let{children:c,positions:f}=o._tree,d=t>0?c.length:-1;e!=d;e+=t){let m=c[e],y=f[e]+o.from,b;if(!(!(a<.EnterBracketed&&m instanceof ft&&(b=Pa.get(m))&&!b.overlay&&b.bracketed&&n>=y&&n<=y+m.length)&&!Tw(r,n,y,y+m.length))){if(m instanceof Os){if(a<.ExcludeBuffers)continue;let x=m.findChild(0,m.buffer.length,t,n-y,r);if(x>-1)return new vs(new QR(o,m,e,y),null,x)}else if(a<.IncludeAnonymous||!m.type.isAnonymous||vg(m)){let x;if(!(a<.IgnoreMounts)&&(x=Pa.get(m))&&!x.overlay)return new zi(x.tree,y,e,o);let w=new zi(m,y,e,o);return a<.IncludeAnonymous||!w.type.isAnonymous?w:w.nextChild(t<0?m.children.length-1:0,t,n,r,a)}}}if(a<.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,n=0){let r;if(!(n<.IgnoreOverlays)&&(r=Pa.get(this._tree))&&r.overlay){let a=e-this.from,o=n<.EnterBracketed&&r.bracketed;for(let{from:c,to:f}of r.overlay)if((t>0||o?c<=a:c<a)&&(t<0||o?f>=a:f>a))return new zi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 fv(i,e,t,n){let r=i.cursor(),a=[];if(!r.firstChild())return a;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return a}for(;;){if(n!=null&&r.type.is(n))return a;if(r.type.is(e)&&a.push(r.node),!r.nextSibling())return n==null?a:[]}}function Mm(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class QR{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class vs extends Ow{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,a=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return a<0?null:new vs(this.context,this,a)}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,n=0){if(n<.ExcludeBuffers)return null;let{buffer:r}=this.context,a=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return a<0?null:new vs(this.context,this,a)}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 vs(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 vs(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,a=n.buffer[this.index+3];if(a>r){let o=n.buffer[this.index+1];e.push(n.slice(r,a,o)),t.push(0)}return new ft(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ew(i){if(!i.length)return null;let e=0,t=i[0];for(let a=1;a<i.length;a++){let o=i[a];(o.from>t.from||o.to<t.to)&&(t=o,e=a)}let n=t instanceof zi&&t.index<0?null:t.parent,r=i.slice();return n?r[e]=n:r.splice(e,1),new GR(r,t)}class GR{constructor(e,t){this.heads=e,this.node=t}get next(){return Ew(this.heads)}}function FR(i,e,t){let n=i.resolveInner(e,t),r=null;for(let a=n instanceof zi?n:n.context.parent;a;a=a.parent)if(a.index<0){let o=a.parent;(r||(r=[n])).push(o.resolve(e,t)),a=o}else{let o=Pa.get(a.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let c=new zi(o.tree,o.overlay[0].from+a.from,-1,a);(r||(r=[n])).push(to(c,e,t,!1))}}return r?Ew(r):n}class Tm{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&~lt.EnterBracketed,e instanceof zi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof zi?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,a=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}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,n=this.mode){return this.buffer?n<.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode<.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode<.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,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<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,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(r.buffer.buffer[a+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let a=t+e,o=e<0?-1:n._tree.children.length;a!=o;a+=e){let c=n._tree.children[a];if(this.mode<.IncludeAnonymous||c instanceof Os||!c.type.isAnonymous||vg(c))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,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,a=this.stack.length;a>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=a+1;break e}r=this.stack[--a]}for(let r=n;r<this.stack.length;r++)t=new vs(this.buffer,t,this.stack[r]);return this.bufferNode=new vs(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Mm(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,a=this.stack.length-1;r>=0;a--){if(a<0)return Mm(this._tree,e,r);let o=n[t.buffer[this.stack[a]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function vg(i){return i.children.some(e=>e instanceof Os||!e.type.isAnonymous||vg(e))}function KR(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=Mw,reused:a=[],minRepeatType:o=n.types.length}=i,c=Array.isArray(t)?new xg(t,t.length):t,f=n.types,d=0,m=0;function y(_,K,U,J,Z,ce){let{id:ae,start:P,end:ee,size:fe}=c,de=m,H=d;if(fe<0)if(c.next(),fe==-1){let O=a[ae];U.push(O),J.push(P-_);return}else if(fe==-3){d=ae;return}else if(fe==-4){m=ae;return}else throw new RangeError(`Unrecognized record size: ${fe}`);let X=f[ae],le,ue,ge=P-_;if(ee-P<=r&&(ue=C(c.pos-K,Z))){let O=new Uint16Array(ue.size-ue.skip),G=c.pos-ue.size,$=O.length;for(;c.pos>G;)$=M(ue.start,O,$);le=new Os(O,ee-ue.start,n),ge=ue.start-_}else{let O=c.pos-fe;c.next();let G=[],$=[],ne=ae>=o?ae:-1,be=0,Se=ee;for(;c.pos>O;)ne>=0&&c.id==ne&&c.size>=0?(c.end<=Se-r&&(w(G,$,P,be,c.end,Se,ne,de,H),be=G.length,Se=c.end),c.next()):ce>2500?b(P,O,G,$):y(P,O,G,$,ne,ce+1);if(ne>=0&&be>0&&be<G.length&&w(G,$,P,be,P,Se,ne,de,H),G.reverse(),$.reverse(),ne>-1&&be>0){let Le=x(X,H);le=Sg(X,G,$,0,G.length,0,ee-P,Le,Le)}else le=k(X,G,$,ee-P,de-ee,H)}U.push(le),J.push(ge)}function b(_,K,U,J){let Z=[],ce=0,ae=-1;for(;c.pos>K;){let{id:P,start:ee,end:fe,size:de}=c;if(de>4)c.next();else{if(ae>-1&&ee<ae)break;ae<0&&(ae=fe-r),Z.push(P,ee,fe),ce++,c.next()}}if(ce){let P=new Uint16Array(ce*4),ee=Z[Z.length-2];for(let fe=Z.length-3,de=0;fe>=0;fe-=3)P[de++]=Z[fe],P[de++]=Z[fe+1]-ee,P[de++]=Z[fe+2]-ee,P[de++]=de;U.push(new Os(P,Z[2]-ee,n)),J.push(ee-_)}}function x(_,K){return(U,J,Z)=>{let ce=0,ae=U.length-1,P,ee;if(ae>=0&&(P=U[ae])instanceof ft){if(!ae&&P.type==_&&P.length==Z)return P;(ee=P.prop(Me.lookAhead))&&(ce=J[ae]+P.length+ee)}return k(_,U,J,Z,ce,K)}}function w(_,K,U,J,Z,ce,ae,P,ee){let fe=[],de=[];for(;_.length>J;)fe.push(_.pop()),de.push(K.pop()+U-Z);_.push(k(n.types[ae],fe,de,ce-Z,P-ce,ee)),K.push(Z-U)}function k(_,K,U,J,Z,ce,ae){if(ce){let P=[Me.contextHash,ce];ae=ae?[P].concat(ae):[P]}if(Z>25){let P=[Me.lookAhead,Z];ae=ae?[P].concat(ae):[P]}return new ft(_,K,U,J,ae)}function C(_,K){let U=c.fork(),J=0,Z=0,ce=0,ae=U.end-r,P={size:0,start:0,skip:0};e:for(let ee=U.pos-_;U.pos>ee;){let fe=U.size;if(U.id==K&&fe>=0){P.size=J,P.start=Z,P.skip=ce,ce+=4,J+=4,U.next();continue}let de=U.pos-fe;if(fe<0||de<ee||U.start<ae)break;let H=U.id>=o?4:0,X=U.start;for(U.next();U.pos>de;){if(U.size<0)if(U.size==-3||U.size==-4)H+=4;else break e;else U.id>=o&&(H+=4);U.next()}Z=X,J+=fe,ce+=H}return(K<0||J==_)&&(P.size=J,P.start=Z,P.skip=ce),P.size>4?P:void 0}function M(_,K,U){let{id:J,start:Z,end:ce,size:ae}=c;if(c.next(),ae>=0&&J<o){let P=U;if(ae>4){let ee=c.pos-(ae-4);for(;c.pos>ee;)U=M(_,K,U)}K[--U]=P,K[--U]=ce-_,K[--U]=Z-_,K[--U]=J}else ae==-3?d=J:ae==-4&&(m=J);return U}let R=[],D=[];for(;c.pos>0;)y(i.start||0,i.bufferStart||0,R,D,-1,0);let Q=(e=i.length)!==null&&e!==void 0?e:R.length?D[0]+R[0].length:0;return new ft(f[i.topID],R.reverse(),D.reverse(),Q)}const dv=new WeakMap;function vc(i,e){if(!i.isAnonymous||e instanceof Os||e.type!=i)return 1;let t=dv.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof ft)){t=1;break}t+=vc(i,n)}dv.set(e,t)}return t}function Sg(i,e,t,n,r,a,o,c,f){let d=0;for(let w=n;w<r;w++)d+=vc(i,e[w]);let m=Math.ceil(d*1.5/8),y=[],b=[];function x(w,k,C,M,R){for(let D=C;D<M;){let Q=D,_=k[D],K=vc(i,w[D]);for(D++;D<M;D++){let U=vc(i,w[D]);if(K+U>=m)break;K+=U}if(D==Q+1){if(K>m){let U=w[Q];x(U.children,U.positions,0,U.children.length,k[Q]+R);continue}y.push(w[Q])}else{let U=k[D-1]+w[D-1].length-_;y.push(Sg(i,w,k,Q,D,_,U,null,f))}b.push(_+R-a)}}return x(e,t,n,r,0),(c||f)(y,b,o)}class rr{constructor(e,t,n,r,a=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(a?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new rr(0,e.length,e,0,!1,n)];for(let a of t)a.to>e.length&&r.push(a);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],a=1,o=e.length?e[0]:null;for(let c=0,f=0,d=0;;c++){let m=c<t.length?t[c]:null,y=m?m.fromA:1e9;if(y-f>=n)for(;o&&o.from<y;){let b=o;if(f>=b.from||y<=b.to||d){let x=Math.max(b.from,f)-d,w=Math.min(b.to,y)-d;b=x>=w?null:new rr(x,w,b.tree,b.offset+d,c>0,!!m)}if(b&&r.push(b),o.to>y)break;o=a<e.length?e[a++]:null}if(!m)break;f=m.toA,d=m.toA-m.toB}return r}}class Nw{startParse(e,t,n){return typeof e=="string"&&(e=new YR(e)),n=n?n.length?n.map(r=>new mp(r.from,r.to)):[new mp(0,0)]:[new mp(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let a=r.advance();if(a)return a}}}class YR{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)}}new Me({perNode:!0});let IR=0;class Di{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=IR++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Di&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new Di(n,[],null,[]);if(r.set.push(r),t)for(let a of t.set)r.set.push(a);return r}static defineModifier(e){let t=new Vc(e);return n=>n.modified.indexOf(t)>-1?n:Vc.get(n.base||n,n.modified.concat(t).sort((r,a)=>r.id-a.id))}}let WR=0;class Vc{constructor(e){this.name=e,this.instances=[],this.id=WR++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(c=>c.base==e&&XR(t,c.modified));if(n)return n;let r=[],a=new Di(e.name,r,e,t);for(let c of t)c.instances.push(a);let o=ZR(t);for(let c of e.set)if(!c.modified.length)for(let f of o)r.push(Vc.get(c,f));return a}}function XR(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ZR(i){let e=[[]];for(let t=0;t<i.length;t++)for(let n=0,r=e.length;n<r;n++)e.push(e[n].concat(i[t]));return e.sort((t,n)=>n.length-t.length)}function Rw(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let a=[],o=2,c=r;for(let y=0;;){if(c=="..."&&y>0&&y+3==r.length){o=1;break}let b=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!b)throw new RangeError("Invalid path: "+r);if(a.push(b[0]=="*"?"":b[0][0]=='"'?JSON.parse(b[0]):b[0]),y+=b[0].length,y==r.length)break;let x=r[y++];if(y==r.length&&x=="!"){o=0;break}if(x!="/")throw new RangeError("Invalid path: "+r);c=r.slice(y)}let f=a.length-1,d=a[f];if(!d)throw new RangeError("Invalid path: "+r);let m=new io(n,o,f>0?a.slice(0,f):null);e[d]=m.sort(e[d])}}return Dw.add(e)}const Dw=new Me({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let a=new io(r.tags,r.mode,r.context);t?t.next=a:n=a,t=a}return n}});class io{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}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}}io.empty=new io([],2,null);function jw(i,e){let t=Object.create(null);for(let a of i)if(!Array.isArray(a.tag))t[a.tag.id]=a.class;else for(let o of a.tag)t[o.id]=a.class;let{scope:n,all:r=null}=e||{};return{style:a=>{let o=r;for(let c of a)for(let f of c.set){let d=t[f.id];if(d){o=o?o+" "+d:d;break}}return o},scope:n}}function JR(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function $R(i,e,t,n=0,r=i.length){let a=new e5(n,Array.isArray(e)?e:[e],t);a.highlightRange(i.cursor(),n,r,"",a.highlighters),a.flush(r)}class e5{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,r,a){let{type:o,from:c,to:f}=e;if(c>=n||f<=t)return;o.isTop&&(a=this.highlighters.filter(x=>!x.scope||x.scope(o)));let d=r,m=t5(e)||io.empty,y=JR(a,m.tags);if(y&&(d&&(d+=" "),d+=y,m.mode==1&&(r+=(r?" ":"")+y)),this.startSpan(Math.max(t,c),d),m.opaque)return;let b=e.tree&&e.tree.prop(Me.mounted);if(b&&b.overlay){let x=e.node.enter(b.overlay[0].from+c,1),w=this.highlighters.filter(C=>!C.scope||C.scope(b.tree.type)),k=e.firstChild();for(let C=0,M=c;;C++){let R=C<b.overlay.length?b.overlay[C]:null,D=R?R.from+c:f,Q=Math.max(t,M),_=Math.min(n,D);if(Q<_&&k)for(;e.from<_&&(this.highlightRange(e,Q,_,r,a),this.startSpan(Math.min(_,e.to),d),!(e.to>=D||!e.nextSibling())););if(!R||D>n)break;M=R.to+c,M>t&&(this.highlightRange(x.cursor(),Math.max(t,R.from+c),Math.min(n,M),"",w),this.startSpan(Math.min(n,M),d))}k&&e.parent()}else if(e.firstChild()){b&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,a),this.startSpan(Math.min(n,e.to),d)}while(e.nextSibling());e.parent()}}}function t5(i){let e=i.type.prop(Dw);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const te=Di.define,ic=te(),gs=te(),pv=te(gs),mv=te(gs),ys=te(),nc=te(ys),gp=te(ys),sn=te(),Zs=te(sn),tn=te(),nn=te(),Om=te(),Ta=te(Om),sc=te(),V={comment:ic,lineComment:te(ic),blockComment:te(ic),docComment:te(ic),name:gs,variableName:te(gs),typeName:pv,tagName:te(pv),propertyName:mv,attributeName:te(mv),className:te(gs),labelName:te(gs),namespace:te(gs),macroName:te(gs),literal:ys,string:nc,docString:te(nc),character:te(nc),attributeValue:te(nc),number:gp,integer:te(gp),float:te(gp),bool:te(ys),regexp:te(ys),escape:te(ys),color:te(ys),url:te(ys),keyword:tn,self:te(tn),null:te(tn),atom:te(tn),unit:te(tn),modifier:te(tn),operatorKeyword:te(tn),controlKeyword:te(tn),definitionKeyword:te(tn),moduleKeyword:te(tn),operator:nn,derefOperator:te(nn),arithmeticOperator:te(nn),logicOperator:te(nn),bitwiseOperator:te(nn),compareOperator:te(nn),updateOperator:te(nn),definitionOperator:te(nn),typeOperator:te(nn),controlOperator:te(nn),punctuation:Om,separator:te(Om),bracket:Ta,angleBracket:te(Ta),squareBracket:te(Ta),paren:te(Ta),brace:te(Ta),content:sn,heading:Zs,heading1:te(Zs),heading2:te(Zs),heading3:te(Zs),heading4:te(Zs),heading5:te(Zs),heading6:te(Zs),contentSeparator:te(sn),list:te(sn),quote:te(sn),emphasis:te(sn),strong:te(sn),link:te(sn),monospace:te(sn),strikethrough:te(sn),inserted:te(),deleted:te(),changed:te(),invalid:te(),meta:sc,documentMeta:te(sc),annotation:te(sc),processingInstruction:te(sc),definition:Di.defineModifier("definition"),constant:Di.defineModifier("constant"),function:Di.defineModifier("function"),standard:Di.defineModifier("standard"),local:Di.defineModifier("local"),special:Di.defineModifier("special")};for(let i in V){let e=V[i];e instanceof Di&&(e.name=i)}jw([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var yp;const il=new Me;function i5(i){return re.define({combine:i?e=>e.concat(i):void 0})}const n5=new Me;class Gi{constructor(e,t,n=[],r=""){this.data=e,this.name=r,je.prototype.hasOwnProperty("tree")||Object.defineProperty(je.prototype,"tree",{get(){return _t(this)}}),this.parser=t,this.extension=[Es.of(this),je.languageData.of((a,o,c)=>{let f=gv(a,o,c),d=f.type.prop(il);if(!d)return[];let m=a.facet(d),y=f.type.prop(n5);if(y){let b=f.resolve(o-f.from,c);for(let x of y)if(x.test(b,a)){let w=a.facet(x.facet);return x.type=="replace"?w:w.concat(m)}}return m})].concat(n)}isActiveAt(e,t,n=-1){return gv(e,t,n).type.prop(il)==this.data}findRegions(e){let t=e.facet(Es);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(a,o)=>{if(a.prop(il)==this.data){n.push({from:o,to:o+a.length});return}let c=a.prop(Me.mounted);if(c){if(c.tree.prop(il)==this.data){if(c.overlay)for(let f of c.overlay)n.push({from:f.from+o,to:f.to+o});else n.push({from:o,to:o+a.length});return}else if(c.overlay){let f=n.length;if(r(c.tree,c.overlay[0].from+o),n.length>f)return}}for(let f=0;f<a.children.length;f++){let d=a.children[f];d instanceof ft&&r(d,a.positions[f]+o)}};return r(_t(e),0),n}get allowsNesting(){return!0}}Gi.setState=ve.define();function gv(i,e,t){let n=i.facet(Es),r=_t(i).topNode;if(!n||n.allowsNesting)for(let a=r;a;a=a.enter(e,t,lt.ExcludeBuffers|lt.EnterBracketed))a.type.isTop&&(r=a);return r}class Qc extends Gi{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=i5(e.languageData);return new Qc(t,e.parser.configure({props:[il.add(n=>n.isTop?t:void 0)]}),e.name)}configure(e,t){return new Qc(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _t(i){let e=i.field(Gi.state,!1);return e?e.tree:ft.empty}class s5{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 n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Oa=null;class Gc{constructor(e,t,n=[],r,a,o,c,f){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=a,this.viewport=o,this.skipped=c,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Gc(e,t,[],ft.empty,0,n,[],null)}startParse(){return this.parser.startParse(new s5(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ft.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}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 r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(rr.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=r,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(rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Oa;Oa=this;try{return e()}finally{Oa=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=yv(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:a,viewport:o,skipped:c}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,m,y,b)=>f.push({fromA:d,toA:m,fromB:y,toB:b})),n=rr.applyChanges(n,f),r=ft.empty,a=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){c=[];for(let d of this.skipped){let m=e.mapPos(d.from,1),y=e.mapPos(d.to,-1);m<y&&c.push({from:m,to:y})}}}return new Gc(this.parser,t,n,r,a,o,c,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 n=0;n<this.skipped.length;n++){let{from:r,to:a}=this.skipped[n];r<e.to&&a>e.from&&(this.fragments=yv(this.fragments,r,a),this.skipped.splice(n--,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 Nw{createParse(t,n,r){let a=r[0].from,o=r[r.length-1].to;return{parsedPos:a,advance(){let f=Oa;if(f){for(let d of r)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=o,new ft(ri.none,[],[],o-a)},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 Oa}}function yv(i,e,t){return rr.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}class yl{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),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new yl(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Gc.create(e.facet(Es).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new yl(n)}}Gi.state=Ut.define({create:yl.init,update(i,e){for(let t of e.effects)if(t.is(Gi.setState))return t.value;return e.startState.facet(Es)!=e.state.facet(Es)?yl.init(e.state):i.apply(e)}});let Bw=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Bw=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const bp=typeof navigator<"u"&&(!((yp=navigator.scheduling)===null||yp===void 0)&&yp.isInputPending)?()=>navigator.scheduling.isInputPending():null,r5=at.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(Gi.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(Gi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Bw(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:n,viewport:{to:r}}=this.view,a=n.field(Gi.state);if(a.tree==a.context.tree&&a.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!bp?Math.max(25,e.timeRemaining()-5):1e9),c=a.context.treeLen<r&&n.doc.length>r+1e3,f=a.context.work(()=>bp&&bp()||Date.now()>o,r+(c?0:1e5));this.chunkBudget-=Date.now()-t,(f||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:Gi.setState.of(new yl(a.context))})),this.chunkBudget>0&&!(f&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ni(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()}}}),Es=re.define({combine(i){return i.length?i[0]:null},enables:i=>[Gi.state,r5,ie.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]});class l5{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const a5=re.define(),gh=re.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Fc(i){let e=i.facet(gh);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function no(i,e){let t="",n=i.tabSize,r=i.facet(gh)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let a=0;a<e;a++)t+=r;return t}function wg(i,e){i instanceof je&&(i=new yh(i));for(let n of i.state.facet(a5)){let r=n(i,e);if(r!==void 0)return r}let t=_t(i.state);return t.length>=e?o5(i,t,e):null}class yh{constructor(e,t={}){this.state=e,this.options=t,this.unit=Fc(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:a}=this.options;return r!=null&&r>=n.from&&r<=n.to?a&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),a=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(a+=o-this.countColumn(n,n.search(/\S|$/))),a}countColumn(e,t=e.length){return Cl(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),a=this.options.overrideIndentation;if(a){let o=a(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Lw=new Me;function o5(i,e,t){let n=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=n.node){let a=[];for(let o=r;o&&!(o.from<n.node.from||o.to>n.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)a.push(o);for(let o=a.length-1;o>=0;o--)n={node:a[o],next:n}}return zw(n,i,t)}function zw(i,e,t){for(let n=i;n;n=n.next){let r=c5(n.node);if(r)return r(kg.create(e,t,n))}return 0}function u5(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function c5(i){let e=i.type.prop(Lw);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(Me.closedBy))){let r=i.lastChild,a=r&&n.indexOf(r.name)>-1;return o=>p5(o,!0,1,void 0,a&&!u5(o)?r.from:void 0)}return i.parent==null?h5:null}function h5(){return 0}class kg extends yh{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new kg(e,t,n)}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 n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(f5(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return zw(this.context.next,this.base,this.pos)}}function f5(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function d5(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,a=i.state.doc.lineAt(t.from),o=r==null||r<=a.from?a.to:Math.min(a.to,r);for(let c=t.to;;){let f=e.childAfter(c);if(!f||f==n)return null;if(!f.type.isSkipped){if(f.from>=o)return null;let d=/^ */.exec(a.text.slice(t.to-a.from))[0].length;return{from:t.from,to:t.to+d}}c=f.to}}function p5(i,e,t,n,r){let a=i.textAfter,o=a.match(/^\s*/)[0].length,c=n&&a.slice(o,o+n.length)==n||r==i.pos+o,f=d5(i);return f?c?i.column(f.from):i.column(f.to):i.baseIndent+(c?0:i.unit*t)}function bv({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const m5=200;function g5(){return je.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,r=t.lineAt(n);if(n>r.from+m5)return i;let a=t.sliceString(r.from,n);if(!e.some(d=>d.test(a)))return i;let{state:o}=i,c=-1,f=[];for(let{head:d}of o.selection.ranges){let m=o.doc.lineAt(d);if(m.from==c)continue;c=m.from;let y=wg(o,m.from);if(y==null)continue;let b=/^\s*/.exec(m.text)[0],x=no(o,y);b!=x&&f.push({from:m.from,to:m.from+b.length,insert:x})}return f.length?[i,{changes:f,sequential:!0}]:i})}const y5=re.define(),Hw=new Me;function b5(i){let e=i.firstChild,t=i.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?i.to:t.from}:null}function x5(i,e,t){let n=_t(i);if(n.length<t)return null;let r=n.resolveStack(t,1),a=null;for(let o=r;o;o=o.next){let c=o.node;if(c.to<=t||c.from>t)continue;if(a&&c.from<e)break;let f=c.type.prop(Hw);if(f&&(c.to<n.length-50||n.length==i.doc.length||!v5(c))){let d=f(c,i);d&&d.from<=t&&d.from>=e&&d.to>t&&(a=d)}}return a}function v5(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Kc(i,e,t){for(let n of i.facet(y5)){let r=n(i,e,t);if(r)return r}return x5(i,e,t)}function _w(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}const bh=ve.define({map:_w}),yo=ve.define({map:_w});function Uw(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}const fr=Ut.define({create(){return me.none},update(i,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,n)=>i=xv(i,t,n)),i=i.map(e.changes);for(let t of e.effects)if(t.is(bh)&&!S5(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Vw),r=n?me.replace({widget:new O5(n(e.state,t.value))}):vv;i=i.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(yo)&&(i=i.update({filter:(n,r)=>t.value.from!=n||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(i=xv(i,e.selection.main.head)),i},provide:i=>ie.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,r)=>{t.push(n,r)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<i.length;){let n=i[t++],r=i[t++];if(typeof n!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(vv.range(n,r))}return me.set(e,!0)}});function xv(i,e,t=e){let n=!1;return i.between(e,t,(r,a)=>{r<t&&a>e&&(n=!0)}),n?i.update({filterFrom:e,filterTo:t,filter:(r,a)=>r>=t||a<=e}):i}function Yc(i,e,t){var n;let r=null;return(n=i.field(fr,!1))===null||n===void 0||n.between(e,t,(a,o)=>{(!r||r.from>a)&&(r={from:a,to:o})}),r}function S5(i,e,t){let n=!1;return i.between(e,e,(r,a)=>{r==e&&a==t&&(n=!0)}),n}function qw(i,e){return i.field(fr,!1)?e:e.concat(ve.appendConfig.of(Qw()))}const w5=i=>{for(let e of Uw(i)){let t=Kc(i.state,e.from,e.to);if(t)return i.dispatch({effects:qw(i.state,[bh.of(t),Pw(i,t)])}),!0}return!1},k5=i=>{if(!i.state.field(fr,!1))return!1;let e=[];for(let t of Uw(i)){let n=Yc(i.state,t.from,t.to);n&&e.push(yo.of(n),Pw(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function Pw(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,r=i.state.doc.lineAt(e.to).number;return ie.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${r}.`)}const C5=i=>{let{state:e}=i,t=[];for(let n=0;n<e.doc.length;){let r=i.lineBlockAt(n),a=Kc(e,r.from,r.to);a&&t.push(bh.of(a)),n=(a?i.lineBlockAt(a.to):r).to+1}return t.length&&i.dispatch({effects:qw(i.state,t)}),!!t.length},A5=i=>{let e=i.state.field(fr,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,r)=>{t.push(yo.of({from:n,to:r}))}),i.dispatch({effects:t}),!0},M5=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:w5},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:k5},{key:"Ctrl-Alt-[",run:C5},{key:"Ctrl-Alt-]",run:A5}],T5={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Vw=re.define({combine(i){return pn(i,T5)}});function Qw(i){return[fr,R5]}function Gw(i,e){let{state:t}=i,n=t.facet(Vw),r=o=>{let c=i.lineBlockAt(i.posAtDOM(o.target)),f=Yc(i.state,c.from,c.to);f&&i.dispatch({effects:yo.of(f)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,r,e);let a=document.createElement("span");return a.textContent=n.placeholderText,a.setAttribute("aria-label",t.phrase("folded code")),a.title=t.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=r,a}const vv=me.replace({widget:new class extends mn{toDOM(i){return Gw(i,null)}}});class O5 extends mn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Gw(e,this.value)}}const E5={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class xp extends Pn{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function N5(i={}){let e={...E5,...i},t=new xp(e,!0),n=new xp(e,!1),r=at.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Es)!=o.state.facet(Es)||o.startState.field(fr,!1)!=o.state.field(fr,!1)||_t(o.startState)!=_t(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let c=new Un;for(let f of o.viewportLineBlocks){let d=Yc(o.state,f.from,f.to)?n:Kc(o.state,f.from,f.to)?t:null;d&&c.add(f.from,f.from,d)}return c.finish()}}),{domEventHandlers:a}=e;return[r,NR({class:"cm-foldGutter",markers(o){var c;return((c=o.plugin(r))===null||c===void 0?void 0:c.markers)||Ee.empty},initialSpacer(){return new xp(e,!1)},domEventHandlers:{...a,click:(o,c,f)=>{if(a.click&&a.click(o,c,f))return!0;let d=Yc(o.state,c.from,c.to);if(d)return o.dispatch({effects:yo.of(d)}),!0;let m=Kc(o.state,c.from,c.to);return m?(o.dispatch({effects:bh.of(m)}),!0):!1}}}),Qw()]}const R5=ie.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class bo{constructor(e,t){this.specs=e;let n;function r(c){let f=As.newName();return(n||(n=Object.create(null)))["."+f]=c,f}const a=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof Gi?c=>c.prop(il)==o.data:o?c=>c==o:void 0,this.style=jw(e.map(c=>({tag:c.tag,class:c.class||r(Object.assign({},c,{tag:null}))})),{all:a}).style,this.module=n?new As(n):null,this.themeType=t.themeType}static define(e,t){return new bo(e,t||{})}}const Em=re.define(),Fw=re.define({combine(i){return i.length?[i[0]]:null}});function vp(i){let e=i.facet(Em);return e.length?e:i.facet(Fw)}function Kw(i,e){let t=[j5],n;return i instanceof bo&&(i.module&&t.push(ie.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(Fw.of(i)):n?t.push(Em.computeN([ie.darkTheme],r=>r.facet(ie.darkTheme)==(n=="dark")?[i]:[])):t.push(Em.of(i)),t}class D5{constructor(e){this.markCache=Object.create(null),this.tree=_t(e.state),this.decorations=this.buildDeco(e,vp(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=_t(e.state),n=vp(e.state),r=n!=vp(e.startState),{viewport:a}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<a.to&&!r&&t.type==this.tree.type&&o>=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=a.to)}buildDeco(e,t){if(!t||!this.tree.length)return me.none;let n=new Un;for(let{from:r,to:a}of e.visibleRanges)$R(this.tree,t,(o,c,f)=>{n.add(o,c,this.markCache[f]||(this.markCache[f]=me.mark({class:f})))},r,a);return n.finish()}}const j5=dr.high(at.fromClass(D5,{decorations:i=>i.decorations})),B5=bo.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),L5=ie.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Yw=1e4,Iw="()[]{}",Ww=re.define({combine(i){return pn(i,{afterCursor:!0,brackets:Iw,maxScanDistance:Yw,renderMatch:_5})}}),z5=me.mark({class:"cm-matchingBracket"}),H5=me.mark({class:"cm-nonmatchingBracket"});function _5(i){let e=[],t=i.matched?z5:H5;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}function Sv(i){let e=[],t=i.facet(Ww);for(let n of i.selection.ranges){if(!n.empty)continue;let r=un(i,n.head,-1,t)||n.head>0&&un(i,n.head-1,1,t)||t.afterCursor&&(un(i,n.head,1,t)||n.head<i.doc.length&&un(i,n.head+1,-1,t));r&&(e=e.concat(t.renderMatch(r,i)))}return me.set(e,!0)}const U5=at.fromClass(class{constructor(i){this.paused=!1,this.decorations=Sv(i.state)}update(i){(i.docChanged||i.selectionSet||this.paused)&&(i.view.composing?(this.decorations=this.decorations.map(i.changes),this.paused=!0):(this.decorations=Sv(i.state),this.paused=!1))}},{decorations:i=>i.decorations}),q5=[U5,L5];function P5(i={}){return[Ww.of(i),q5]}const V5=new Me;function Nm(i,e,t){let n=i.prop(e<0?Me.openedBy:Me.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Rm(i){let e=i.type.prop(V5);return e?e(i.node):i}function un(i,e,t,n={}){let r=n.maxScanDistance||Yw,a=n.brackets||Iw,o=_t(i),c=o.resolveInner(e,t);for(let f=c;f;f=f.parent){let d=Nm(f.type,t,a);if(d&&f.from<f.to){let m=Rm(f);if(m&&(t>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return Q5(i,e,t,f,m,d,a)}}return G5(i,e,t,o,c.type,r,a)}function Q5(i,e,t,n,r,a,o){let c=n.parent,f={from:r.from,to:r.to},d=0,m=c?.cursor();if(m&&(t<0?m.childBefore(n.from):m.childAfter(n.to)))do if(t<0?m.to<=n.from:m.from>=n.to){if(d==0&&a.indexOf(m.type.name)>-1&&m.from<m.to){let y=Rm(m);return{start:f,end:y?{from:y.from,to:y.to}:void 0,matched:!0}}else if(Nm(m.type,t,o))d++;else if(Nm(m.type,-t,o)){if(d==0){let y=Rm(m);return{start:f,end:y&&y.from<y.to?{from:y.from,to:y.to}:void 0,matched:!1}}d--}}while(t<0?m.prevSibling():m.nextSibling());return{start:f,matched:!1}}function G5(i,e,t,n,r,a,o){let c=t<0?i.sliceDoc(e-1,e):i.sliceDoc(e,e+1),f=o.indexOf(c);if(f<0||f%2==0!=t>0)return null;let d={from:t<0?e-1:e,to:t>0?e+1:e},m=i.doc.iterRange(e,t>0?i.doc.length:0),y=0;for(let b=0;!m.next().done&&b<=a;){let x=m.value;t<0&&(b+=x.length);let w=e+b*t;for(let k=t>0?0:x.length-1,C=t>0?x.length:-1;k!=C;k+=t){let M=o.indexOf(x[k]);if(!(M<0||n.resolveInner(w+k,1).type!=r))if(M%2==0==t>0)y++;else{if(y==1)return{start:d,end:{from:w+k,to:w+k+1},matched:M>>1==f>>1};y--}}t>0&&(b+=x.length)}return m.done?{start:d,matched:!1}:null}const F5=Object.create(null),wv=[ri.none],kv=[],Cv=Object.create(null),K5=Object.create(null);for(let[i,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"]])K5[i]=Y5(F5,e);function Sp(i,e){kv.indexOf(i)>-1||(kv.push(i),console.warn(e))}function Y5(i,e){let t=[];for(let c of e.split(" ")){let f=[];for(let d of c.split(".")){let m=i[d]||V[d];m?typeof m=="function"?f.length?f=f.map(m):Sp(d,`Modifier ${d} used at start of tag`):f.length?Sp(d,`Tag ${d} used as modifier`):f=Array.isArray(m)?m:[m]:Sp(d,`Unknown highlighting tag ${d}`)}for(let d of f)t.push(d)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(c=>c.id),a=Cv[r];if(a)return a.id;let o=Cv[r]=ri.define({id:wv.length,name:n,props:[Rw({[n]:t})]});return wv.push(o),o.id}Xe.RTL,Xe.LTR;const I5=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=Ag(i.state,t.from);return n.line?W5(i):n.block?Z5(i):!1};function Cg(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}const W5=Cg(eD,0),X5=Cg(Xw,0),Z5=Cg((i,e)=>Xw(i,e,$5(e)),0);function Ag(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Ea=50;function J5(i,{open:e,close:t},n,r){let a=i.sliceDoc(n-Ea,n),o=i.sliceDoc(r,r+Ea),c=/\s*$/.exec(a)[0].length,f=/^\s*/.exec(o)[0].length,d=a.length-c;if(a.slice(d-e.length,d)==e&&o.slice(f,f+t.length)==t)return{open:{pos:n-c,margin:c&&1},close:{pos:r+f,margin:f&&1}};let m,y;r-n<=2*Ea?m=y=i.sliceDoc(n,r):(m=i.sliceDoc(n,n+Ea),y=i.sliceDoc(r-Ea,r));let b=/^\s*/.exec(m)[0].length,x=/\s*$/.exec(y)[0].length,w=y.length-x-t.length;return m.slice(b,b+e.length)==e&&y.slice(w,w+t.length)==t?{open:{pos:n+b+e.length,margin:/\s/.test(m.charAt(b+e.length))?1:0},close:{pos:r-x-t.length,margin:/\s/.test(y.charAt(w-1))?1:0}}:null}function $5(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to);r.from>n.from&&r.from==t.to&&(r=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let a=e.length-1;a>=0&&e[a].to>n.from?e[a].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function Xw(i,e,t=e.selection.ranges){let n=t.map(a=>Ag(e,a.from).block);if(!n.every(a=>a))return null;let r=t.map((a,o)=>J5(e,n[o],a.from,a.to));if(i!=2&&!r.every(a=>a))return{changes:e.changes(t.map((a,o)=>r[o]?[]:[{from:a.from,insert:n[o].open+" "},{from:a.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(a=>a)){let a=[];for(let o=0,c;o<r.length;o++)if(c=r[o]){let f=n[o],{open:d,close:m}=c;a.push({from:d.pos-f.open.length,to:d.pos+d.margin},{from:m.pos-m.margin,to:m.pos+f.close.length})}return{changes:a}}return null}function eD(i,e,t=e.selection.ranges){let n=[],r=-1;e:for(let{from:a,to:o}of t){let c=n.length,f=1e9,d;for(let m=a;m<=o;){let y=e.doc.lineAt(m);if(d==null&&(d=Ag(e,y.from).line,!d))continue e;if(y.from>r&&(a==o||o>y.from)){r=y.from;let b=/^\s*/.exec(y.text)[0].length,x=b==y.length,w=y.text.slice(b,b+d.length)==d?b:-1;b<y.text.length&&b<f&&(f=b),n.push({line:y,comment:w,token:d,indent:b,empty:x,single:!1})}m=y.to+1}if(f<1e9)for(let m=c;m<n.length;m++)n[m].indent<n[m].line.text.length&&(n[m].indent=f);n.length==c+1&&(n[c].single=!0)}if(i!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:c,token:f,indent:d,empty:m,single:y}of n)(y||!m)&&a.push({from:c.from+d,insert:f+" "});let o=e.changes(a);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:o,comment:c,token:f}of n)if(c>=0){let d=o.from+c,m=d+f.length;o.text[m-o.from]==" "&&m++,a.push({from:d,to:m})}return{changes:a}}return null}const Dm=dn.define(),tD=dn.define(),iD=re.define(),Zw=re.define({combine(i){return pn(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Jw=Ut.define({create(){return cn.empty},update(i,e){let t=e.state.facet(Zw),n=e.annotation(Dm);if(n){let f=si.fromTransaction(e,n.selection),d=n.side,m=d==0?i.undone:i.done;return f?m=Ic(m,m.length,t.minDepth,f):m=tk(m,e.startState.selection),new cn(d==0?n.rest:m,d==0?m:n.rest)}let r=e.annotation(tD);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(wt.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let a=si.fromTransaction(e),o=e.annotation(wt.time),c=e.annotation(wt.userEvent);return a?i=i.addChanges(a,o,c,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,c,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new cn(i.done.map(si.fromJSON),i.undone.map(si.fromJSON))}});function nD(i={}){return[Jw,Zw.of(i),ie.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?$w:e.inputType=="historyRedo"?jm:null;return n?(e.preventDefault(),n(t)):!1}})]}function xh(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(Jw,!1);if(!r)return!1;let a=r.pop(i,t,e);return a?(n(a),!0):!1}}const $w=xh(0,!1),jm=xh(1,!1),sD=xh(0,!0),rD=xh(1,!0);class si{constructor(e,t,n,r,a){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=a}setSelAfter(e){return new si(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;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:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new si(e.changes&&vt.fromJSON(e.changes),[],e.mapped&&fn.fromJSON(e.mapped),e.startSelection&&W.fromJSON(e.startSelection),e.selectionsAfter.map(W.fromJSON))}static fromTransaction(e,t){let n=Bi;for(let r of e.startState.facet(iD)){let a=r(e);a.length&&(n=n.concat(a))}return!n.length&&e.changes.empty?null:new si(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Bi)}static selection(e){return new si(void 0,Bi,void 0,void 0,e)}}function Ic(i,e,t,n){let r=e+1>t+20?e-t-1:0,a=i.slice(r,e);return a.push(n),a}function lD(i,e){let t=[],n=!1;return i.iterChangedRanges((r,a)=>t.push(r,a)),e.iterChangedRanges((r,a,o,c)=>{for(let f=0;f<t.length;){let d=t[f++],m=t[f++];c>=d&&o<=m&&(n=!0)}}),n}function aD(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function ek(i,e){return i.length?e.length?i.concat(e):i:e}const Bi=[],oD=200;function tk(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-oD));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ic(i,i.length-1,1e9,t.setSelAfter(n)))}else return[si.selection([e])]}function uD(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function wp(i,e){if(!i.length)return i;let t=i.length,n=Bi;for(;t;){let r=cD(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let a=i.slice(0,t);return a[t-1]=r,a}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[si.selection(n)]:Bi}function cD(i,e,t){let n=ek(i.selectionsAfter.length?i.selectionsAfter.map(c=>c.map(e)):Bi,t);if(!i.changes)return si.selection(n);let r=i.changes.map(e),a=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(a):a;return new si(r,ve.mapEffects(i.effects,e),o,i.startSelection.map(a),n)}const hD=/^(input\.type|delete)($|\.)/;class cn{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new cn(this.done,this.undone):this}addChanges(e,t,n,r,a){let o=this.done,c=o[o.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!n||hD.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(a,lD(c.changes,e.changes))||n=="input.type.compose")?o=Ic(o,o.length-1,r.minDepth,new si(e.changes.compose(c.changes),ek(ve.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,Bi)):o=Ic(o,o.length,r.minDepth,e),new cn(o,Bi,t,n)}addSelection(e,t,n,r){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Bi;return a.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&aD(a[a.length-1],e)?this:new cn(tk(this.done,e),this.undone,t,n)}addMapping(e){return new cn(wp(this.done,e),wp(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let a=r[r.length-1],o=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):t.selection);if(n&&a.selectionsAfter.length)return t.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:Dm.of({side:e,rest:uD(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let c=r.length==1?Bi:r.slice(0,r.length-1);return a.mapped&&(c=wp(c,a.mapped)),t.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:Dm.of({side:e,rest:c,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}cn.empty=new cn(Bi,Bi);const fD=[{key:"Mod-z",run:$w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:jm,preventDefault:!0},{linux:"Ctrl-Shift-z",run:jm,preventDefault:!0},{key:"Mod-u",run:sD,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:rD,preventDefault:!0}];function Al(i,e){return W.create(i.ranges.map(e),i.mainIndex)}function Ii(i,e){return i.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Wi({state:i,dispatch:e},t){let n=Al(i.selection,t);return n.eq(i.selection,!0)?!1:(e(Ii(i,n)),!0)}function vh(i,e){return W.cursor(e?i.to:i.from)}function ik(i,e){return Wi(i,t=>t.empty?i.moveByChar(t,e):vh(t,e))}function qt(i){return i.textDirectionAt(i.state.selection.main.head)==Xe.LTR}const nk=i=>ik(i,!qt(i)),sk=i=>ik(i,qt(i));function rk(i,e){return Wi(i,t=>t.empty?i.moveByGroup(t,e):vh(t,e))}const dD=i=>rk(i,!qt(i)),pD=i=>rk(i,qt(i));function mD(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Sh(i,e,t){let n=_t(i).resolveInner(e.head),r=t?Me.closedBy:Me.openedBy;for(let f=e.head;;){let d=t?n.childAfter(f):n.childBefore(f);if(!d)break;mD(i,d,r)?n=d:f=t?d.to:d.from}let a=n.type.prop(r),o,c;return a&&(o=t?un(i,n.from,1):un(i,n.to,-1))&&o.matched?c=t?o.end.to:o.end.from:c=t?n.to:n.from,W.cursor(c,t?-1:1)}const gD=i=>Wi(i,e=>Sh(i.state,e,!qt(i))),yD=i=>Wi(i,e=>Sh(i.state,e,qt(i)));function lk(i,e){return Wi(i,t=>{if(!t.empty)return vh(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}const ak=i=>lk(i,!1),ok=i=>lk(i,!0);function uk(i){let e=i.scrollDOM.clientHeight<i.scrollDOM.scrollHeight-2,t=0,n=0,r;if(e){for(let a of i.state.facet(ie.scrollMargins)){let o=a(i);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(n=Math.max(o?.bottom,n))}r=i.scrollDOM.clientHeight-t-n}else r=(i.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:n,selfScroll:e,height:Math.max(i.defaultLineHeight,r-5)}}function ck(i,e){let t=uk(i),{state:n}=i,r=Al(n.selection,o=>o.empty?i.moveVertically(o,e,t.height):vh(o,e));if(r.eq(n.selection))return!1;let a;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),c=i.scrollDOM.getBoundingClientRect(),f=c.top+t.marginTop,d=c.bottom-t.marginBottom;o&&o.top>f&&o.bottom<d&&(a=ie.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-f}))}return i.dispatch(Ii(n,r),{effects:a}),!0}const Av=i=>ck(i,!1),Bm=i=>ck(i,!0);function Rs(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let a=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&e.head!=n.from+a&&(r=W.cursor(n.from+a))}return r}const bD=i=>Wi(i,e=>Rs(i,e,!0)),xD=i=>Wi(i,e=>Rs(i,e,!1)),vD=i=>Wi(i,e=>Rs(i,e,!qt(i))),SD=i=>Wi(i,e=>Rs(i,e,qt(i))),wD=i=>Wi(i,e=>W.cursor(i.lineBlockAt(e.head).from,1)),kD=i=>Wi(i,e=>W.cursor(i.lineBlockAt(e.head).to,-1));function CD(i,e,t){let n=!1,r=Al(i.selection,a=>{let o=un(i,a.head,-1)||un(i,a.head,1)||a.head>0&&un(i,a.head-1,1)||a.head<i.doc.length&&un(i,a.head+1,-1);if(!o||!o.end)return a;n=!0;let c=o.start.from==a.head?o.end.to:o.end.from;return W.cursor(c)});return n?(e(Ii(i,r)),!0):!1}const AD=({state:i,dispatch:e})=>CD(i,e);function _i(i,e){let t=Al(i.state.selection,n=>{let r=e(n);return W.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(Ii(i.state,t)),!0)}function hk(i,e){return _i(i,t=>i.moveByChar(t,e))}const fk=i=>hk(i,!qt(i)),dk=i=>hk(i,qt(i));function pk(i,e){return _i(i,t=>i.moveByGroup(t,e))}const MD=i=>pk(i,!qt(i)),TD=i=>pk(i,qt(i)),OD=i=>_i(i,e=>Sh(i.state,e,!qt(i))),ED=i=>_i(i,e=>Sh(i.state,e,qt(i)));function mk(i,e){return _i(i,t=>i.moveVertically(t,e))}const gk=i=>mk(i,!1),yk=i=>mk(i,!0);function bk(i,e){return _i(i,t=>i.moveVertically(t,e,uk(i).height))}const Mv=i=>bk(i,!1),Tv=i=>bk(i,!0),ND=i=>_i(i,e=>Rs(i,e,!0)),RD=i=>_i(i,e=>Rs(i,e,!1)),DD=i=>_i(i,e=>Rs(i,e,!qt(i))),jD=i=>_i(i,e=>Rs(i,e,qt(i))),BD=i=>_i(i,e=>W.cursor(i.lineBlockAt(e.head).from)),LD=i=>_i(i,e=>W.cursor(i.lineBlockAt(e.head).to)),Ov=({state:i,dispatch:e})=>(e(Ii(i,{anchor:0})),!0),Ev=({state:i,dispatch:e})=>(e(Ii(i,{anchor:i.doc.length})),!0),Nv=({state:i,dispatch:e})=>(e(Ii(i,{anchor:i.selection.main.anchor,head:0})),!0),Rv=({state:i,dispatch:e})=>(e(Ii(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),zD=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),HD=({state:i,dispatch:e})=>{let t=wh(i).map(({from:n,to:r})=>W.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:W.create(t),userEvent:"select"})),!0},_D=({state:i,dispatch:e})=>{let t=Al(i.selection,n=>{let r=_t(i),a=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=a.node.from&&o.node.to<=a.node.to&&(a=o)}for(let o=a;o;o=o.next){let{node:c}=o;if((c.from<n.from&&c.to>=n.to||c.to>n.to&&c.from<=n.from)&&o.next)return W.range(c.to,c.from)}return n});return t.eq(i.selection)?!1:(e(Ii(i,t)),!0)};function xk(i,e){let{state:t}=i,n=t.selection,r=t.selection.ranges.slice();for(let a of t.selection.ranges){let o=t.doc.lineAt(a.head);if(e?o.to<i.state.doc.length:o.from>0)for(let c=a;;){let f=i.moveVertically(c,e);if(f.head<o.from||f.head>o.to){r.some(d=>d.head==f.head)||r.push(f);break}else{if(f.head==c.head)break;c=f}}}return r.length==n.ranges.length?!1:(i.dispatch(Ii(t,W.create(r,r.length-1))),!0)}const UD=i=>xk(i,!1),qD=i=>xk(i,!0),PD=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=W.create([t.main]):t.main.empty||(n=W.create([W.cursor(t.main.head)])),n?(e(Ii(i,n)),!0):!1};function xo(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(a=>{let{from:o,to:c}=a;if(o==c){let f=e(a);f<o?(t="delete.backward",f=rc(i,f,!1)):f>o&&(t="delete.forward",f=rc(i,f,!0)),o=Math.min(o,f),c=Math.max(c,f)}else o=rc(i,o,!1),c=rc(i,c,!0);return o==c?{range:a}:{changes:{from:o,to:c},range:W.cursor(o,o<a.head?-1:1)}});return r.changes.empty?!1:(i.dispatch(n.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?ie.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function rc(i,e,t){if(i instanceof ie)for(let n of i.state.facet(ie.atomicRanges).map(r=>r(i)))n.between(e,e,(r,a)=>{r<e&&a>e&&(e=t?a:r)});return e}const vk=(i,e,t)=>xo(i,n=>{let r=n.from,{state:a}=i,o=a.doc.lineAt(r),c,f;if(t&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(c=o.text.slice(0,r-o.from))){if(c[c.length-1]==" ")return r-1;let d=Cl(c,a.tabSize),m=d%Fc(a)||Fc(a);for(let y=0;y<m&&c[c.length-1-y]==" ";y++)r--;f=r}else f=Mt(o.text,r-o.from,e,e)+o.from,f==r&&o.number!=(e?a.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(f-o.from,r-o.from))&&(f=Mt(o.text,f-o.from,!1,!1)+o.from);return f}),Lm=i=>vk(i,!1,!0),Sk=i=>vk(i,!0,!1),wk=(i,e)=>xo(i,t=>{let n=t.head,{state:r}=i,a=r.doc.lineAt(n),o=r.charCategorizer(n);for(let c=null;;){if(n==(e?a.to:a.from)){n==t.head&&a.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let f=Mt(a.text,n-a.from,e)+a.from,d=a.text.slice(Math.min(n,f)-a.from,Math.max(n,f)-a.from),m=o(d);if(c!=null&&m!=c)break;(d!=" "||n!=t.head)&&(c=m),n=f}return n}),kk=i=>wk(i,!1),VD=i=>wk(i,!0),QD=i=>xo(i,e=>{let t=i.lineBlockAt(e.head).to;return e.head<t?t:Math.min(i.state.doc.length,e.head+1)}),GD=i=>xo(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),FD=i=>xo(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(i.state.doc.length,e.head+1)}),KD=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:_e.of(["",""])},range:W.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},YD=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,a=i.doc.lineAt(r),o=r==a.from?r-1:Mt(a.text,r-a.from,!1)+a.from,c=r==a.to?r+1:Mt(a.text,r-a.from,!0)+a.from;return{changes:{from:o,to:c,insert:i.doc.slice(r,c).append(i.doc.slice(o,r))},range:W.cursor(c)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function wh(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),a=i.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=a.to,o.ranges.push(n)}else e.push({from:r.from,to:a.to,ranges:[n]});t=a.number+1}return e}function Ck(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let a of wh(i)){if(t?a.to==i.doc.length:a.from==0)continue;let o=i.doc.lineAt(t?a.to+1:a.from-1),c=o.length+1;if(t){n.push({from:a.to,to:o.to},{from:a.from,insert:o.text+i.lineBreak});for(let f of a.ranges)r.push(W.range(Math.min(i.doc.length,f.anchor+c),Math.min(i.doc.length,f.head+c)))}else{n.push({from:o.from,to:a.from},{from:a.to,insert:i.lineBreak+o.text});for(let f of a.ranges)r.push(W.range(f.anchor-c,f.head-c))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:W.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}const ID=({state:i,dispatch:e})=>Ck(i,e,!1),WD=({state:i,dispatch:e})=>Ck(i,e,!0);function Ak(i,e,t){if(i.readOnly)return!1;let n=[];for(let a of wh(i))t?n.push({from:a.from,insert:i.doc.slice(a.from,a.to)+i.lineBreak}):n.push({from:a.to,insert:i.lineBreak+i.doc.slice(a.from,a.to)});let r=i.changes(n);return e(i.update({changes:r,selection:i.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const XD=({state:i,dispatch:e})=>Ak(i,e,!1),ZD=({state:i,dispatch:e})=>Ak(i,e,!0),JD=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(wh(e).map(({from:r,to:a})=>(r>0?r--:a<e.doc.length&&a++,{from:r,to:a}))),n=Al(e.selection,r=>{let a;if(i.lineWrapping){let o=i.lineBlockAt(r.head),c=i.coordsAtPos(r.head,r.assoc||1);c&&(a=o.bottom+i.documentTop-c.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,a)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function $D(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=_t(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),a;return n&&r&&n.to<=e&&r.from>=e&&(a=n.type.prop(Me.closedBy))&&a.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}const Dv=Mk(!1),ej=Mk(!0);function Mk(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:a,to:o}=r,c=e.doc.lineAt(a),f=!i&&a==o&&$D(e,a);i&&(a=o=(o<=c.to?c:e.doc.lineAt(o)).to);let d=new yh(e,{simulateBreak:a,simulateDoubleBreak:!!f}),m=wg(d,a);for(m==null&&(m=Cl(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));o<c.to&&/\s/.test(c.text[o-c.from]);)o++;f?{from:a,to:o}=f:a>c.from&&a<c.from+100&&!/\S/.test(c.text.slice(0,a))&&(a=c.from);let y=["",no(e,m)];return f&&y.push(no(e,d.lineIndent(c.from,-1))),{changes:{from:a,to:o,insert:_e.of(y)},range:W.cursor(a+1+y[1].length)}});return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Mg(i,e){let t=-1;return i.changeByRange(n=>{let r=[];for(let o=n.from;o<=n.to;){let c=i.doc.lineAt(o);c.number>t&&(n.empty||n.to>c.from)&&(e(c,r,n),t=c.number),o=c.to+1}let a=i.changes(r);return{changes:r,range:W.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const tj=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new yh(i,{overrideIndentation:a=>{let o=t[a];return o??-1}}),r=Mg(i,(a,o,c)=>{let f=wg(n,a.from);if(f==null)return;/\S/.test(a.text)||(f=0);let d=/^\s*/.exec(a.text)[0],m=no(i,f);(d!=m||c.from<a.from+d.length)&&(t[a.from]=f,o.push({from:a.from,to:a.from+d.length,insert:m}))});return r.changes.empty||e(i.update(r,{userEvent:"indent"})),!0},Tk=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Mg(i,(t,n)=>{n.push({from:t.from,insert:i.facet(gh)})}),{userEvent:"input.indent"})),!0),Ok=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Mg(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let a=Cl(r,i.tabSize),o=0,c=no(i,Math.max(0,a-Fc(i)));for(;o<r.length&&o<c.length&&r.charCodeAt(o)==c.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:c.slice(o)})}),{userEvent:"delete.dedent"})),!0),ij=i=>(i.setTabFocusMode(),!0),nj=[{key:"Ctrl-b",run:nk,shift:fk,preventDefault:!0},{key:"Ctrl-f",run:sk,shift:dk},{key:"Ctrl-p",run:ak,shift:gk},{key:"Ctrl-n",run:ok,shift:yk},{key:"Ctrl-a",run:wD,shift:BD},{key:"Ctrl-e",run:kD,shift:LD},{key:"Ctrl-d",run:Sk},{key:"Ctrl-h",run:Lm},{key:"Ctrl-k",run:QD},{key:"Ctrl-Alt-h",run:kk},{key:"Ctrl-o",run:KD},{key:"Ctrl-t",run:YD},{key:"Ctrl-v",run:Bm}],sj=[{key:"ArrowLeft",run:nk,shift:fk,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:dD,shift:MD,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:vD,shift:DD,preventDefault:!0},{key:"ArrowRight",run:sk,shift:dk,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:pD,shift:TD,preventDefault:!0},{mac:"Cmd-ArrowRight",run:SD,shift:jD,preventDefault:!0},{key:"ArrowUp",run:ak,shift:gk,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Ov,shift:Nv},{mac:"Ctrl-ArrowUp",run:Av,shift:Mv},{key:"ArrowDown",run:ok,shift:yk,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ev,shift:Rv},{mac:"Ctrl-ArrowDown",run:Bm,shift:Tv},{key:"PageUp",run:Av,shift:Mv},{key:"PageDown",run:Bm,shift:Tv},{key:"Home",run:xD,shift:RD,preventDefault:!0},{key:"Mod-Home",run:Ov,shift:Nv},{key:"End",run:bD,shift:ND,preventDefault:!0},{key:"Mod-End",run:Ev,shift:Rv},{key:"Enter",run:Dv,shift:Dv},{key:"Mod-a",run:zD},{key:"Backspace",run:Lm,shift:Lm,preventDefault:!0},{key:"Delete",run:Sk,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:kk,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:VD,preventDefault:!0},{mac:"Mod-Backspace",run:GD,preventDefault:!0},{mac:"Mod-Delete",run:FD,preventDefault:!0}].concat(nj.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),rj=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:gD,shift:OD},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:yD,shift:ED},{key:"Alt-ArrowUp",run:ID},{key:"Shift-Alt-ArrowUp",run:XD},{key:"Alt-ArrowDown",run:WD},{key:"Shift-Alt-ArrowDown",run:ZD},{key:"Mod-Alt-ArrowUp",run:UD},{key:"Mod-Alt-ArrowDown",run:qD},{key:"Escape",run:PD},{key:"Mod-Enter",run:ej},{key:"Alt-l",mac:"Ctrl-l",run:HD},{key:"Mod-i",run:_D,preventDefault:!0},{key:"Mod-[",run:Ok},{key:"Mod-]",run:Tk},{key:"Mod-Alt-\\",run:tj},{key:"Shift-Mod-k",run:JD},{key:"Shift-Mod-\\",run:AD},{key:"Mod-/",run:I5},{key:"Alt-A",run:X5},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ij}].concat(sj),lj={key:"Tab",run:Tk,shift:Ok},jv=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i;class bl{constructor(e,t,n=0,r=e.length,a,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=a?c=>a(jv(c)):jv,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ei(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=$m(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ln(e);let r=this.normalize(t);if(r.length)for(let a=0,o=n;;a++){let c=r.charCodeAt(a),f=this.match(c,o,this.bufferPos+this.bufferStart);if(a==r.length-1){if(f)return this.value=f,this;break}o==n&&a<t.length&&t.charCodeAt(a)==c&&o++}}}match(e,t,n){let r=null;for(let a=0;a<this.matches.length;a+=2){let o=this.matches[a],c=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[a+1],to:n}:(this.matches[a]++,c=!0)),c||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(bl.prototype[Symbol.iterator]=function(){return this});const Ek={from:-1,to:-1,match:/.*/.exec("")},Tg="gm"+(/x/.unicode==null?"":"u");class Nk{constructor(e,t,n,r=0,a=e.length){if(this.text=e,this.to=a,this.curLine="",this.done=!1,this.value=Ek,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Rk(e,t,n,r,a);this.re=new RegExp(t,Tg+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=Wc(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Wc(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const kp=new WeakMap;class ul{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=kp.get(e);if(!r||r.from>=n||r.to<=t){let c=new ul(t,e.sliceString(t,n));return kp.set(e,c),c}if(r.from==t&&r.to==n)return r;let{text:a,from:o}=r;return o>t&&(a=e.sliceString(t,o)+a,o=t),r.to<n&&(a+=e.sliceString(r.to,n)),kp.set(e,new ul(o,a)),new ul(t,a.slice(t-o,n-o))}}class Rk{constructor(e,t,n,r,a){this.text=e,this.to=a,this.done=!1,this.value=Ek,this.matchPos=Wc(e,r),this.re=new RegExp(t,Tg+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=ul.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=Wc(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ul.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Nk.prototype[Symbol.iterator]=Rk.prototype[Symbol.iterator]=function(){return this});function aj(i){try{return new RegExp(i,Tg),!0}catch{return!1}}function Wc(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e<t.to&&(n=t.text.charCodeAt(e-t.from))>=56320&&n<57344;)e++;return e}const oj=i=>{let{state:e}=i,t=String(e.doc.lineAt(i.state.selection.main.head).number),{close:n,result:r}=MR(i,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return r.then(a=>{let o=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!o){i.dispatch({effects:n});return}let c=e.doc.lineAt(e.selection.main.head),[,f,d,m,y]=o,b=m?+m.slice(1):0,x=d?+d:c.number;if(d&&y){let C=x/100;f&&(C=C*(f=="-"?-1:1)+c.number/e.doc.lines),x=Math.round(e.doc.lines*C)}else d&&f&&(x=x*(f=="-"?-1:1)+c.number);let w=e.doc.line(Math.max(1,Math.min(e.doc.lines,x))),k=W.cursor(w.from+Math.max(0,Math.min(b,w.length)));i.dispatch({effects:[n,ie.scrollIntoView(k.from,{y:"center"})],selection:k})}),!0},uj={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},cj=re.define({combine(i){return pn(i,uj,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function hj(i){return[gj,mj]}const fj=me.mark({class:"cm-selectionMatch"}),dj=me.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Bv(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=it.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=it.Word)}function pj(i,e,t,n){return i(e.sliceDoc(t,t+1))==it.Word&&i(e.sliceDoc(n-1,n))==it.Word}const mj=at.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(cj),{state:t}=i,n=t.selection;if(n.ranges.length>1)return me.none;let r=n.main,a,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return me.none;let f=t.wordAt(r.head);if(!f)return me.none;o=t.charCategorizer(r.head),a=t.sliceDoc(f.from,f.to)}else{let f=r.to-r.from;if(f<e.minSelectionLength||f>200)return me.none;if(e.wholeWords){if(a=t.sliceDoc(r.from,r.to),o=t.charCategorizer(r.head),!(Bv(o,t,r.from,r.to)&&pj(o,t,r.from,r.to)))return me.none}else if(a=t.sliceDoc(r.from,r.to),!a)return me.none}let c=[];for(let f of i.visibleRanges){let d=new bl(t.doc,a,f.from,f.to);for(;!d.next().done;){let{from:m,to:y}=d.value;if((!o||Bv(o,t,m,y))&&(r.empty&&m<=r.from&&y>=r.to?c.push(dj.range(m,y)):(m>=r.to||y<=r.from)&&c.push(fj.range(m,y)),c.length>e.maxMatches))return me.none}}return me.set(c)}},{decorations:i=>i.decorations}),gj=ie.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),yj=({state:i,dispatch:e})=>{let{selection:t}=i,n=W.create(t.ranges.map(r=>i.wordAt(r.head)||W.cursor(r.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function bj(i,e){let{main:t,ranges:n}=i.selection,r=i.wordAt(t.head),a=r&&r.from==t.from&&r.to==t.to;for(let o=!1,c=new bl(i.doc,e,n[n.length-1].to);;)if(c.next(),c.done){if(o)return null;c=new bl(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(f=>f.from==c.value.from))continue;if(a){let f=i.wordAt(c.value.from);if(!f||f.from!=c.value.from||f.to!=c.value.to)continue}return c.value}}const xj=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(a=>a.from===a.to))return yj({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(a=>i.sliceDoc(a.from,a.to)!=n))return!1;let r=bj(i,n);return r?(e(i.update({selection:i.selection.addRange(W.range(r.from,r.to),!1),effects:ie.scrollIntoView(r.to)})),!0):!1},Ml=re.define({combine(i){return pn(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new jj(e),scrollToMatch:e=>ie.scrollIntoView(e)})}});class Dk{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||aj(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
|
|
22
|
+
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Aj(this):new wj(this)}getCursor(e,t=0,n){let r=e.doc?e:je.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?$r(this,r,t,n):Jr(this,r,t,n)}}class jk{constructor(e){this.spec=e}}function vj(i,e,t){return(n,r,a,o)=>{if(t&&!t(n,r,a,o))return!1;let c=n>=o&&r<=o+a.length?a.slice(n-o,r-o):e.doc.sliceString(n,r);return i(c,e,n,r)}}function Jr(i,e,t,n){let r;return i.wholeWord&&(r=Sj(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(r=vj(i.test,e,r)),new bl(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:a=>a.toLowerCase(),r)}function Sj(i,e){return(t,n,r,a)=>((a>t||a+r.length<n)&&(a=Math.max(0,t-2),r=i.sliceString(a,Math.min(i.length,n+2))),(e(Xc(r,t-a))!=it.Word||e(Zc(r,t-a))!=it.Word)&&(e(Zc(r,n-a))!=it.Word||e(Xc(r,n-a))!=it.Word))}class wj extends jk{constructor(e){super(e)}nextMatch(e,t,n){let r=Jr(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let a=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Jr(this.spec,e,0,a).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let a=Math.max(t,r-1e4-this.spec.unquoted.length),o=Jr(this.spec,e,a,r),c=null;for(;!o.nextOverlapping().done;)c=o.value;if(c)return c;if(a==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Jr(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let a=Jr(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!a.next().done;)r(a.value.from,a.value.to)}}function kj(i,e,t){return(n,r,a)=>(!t||t(n,r,a))&&i(a[0],e,n,r)}function $r(i,e,t,n){let r;return i.wholeWord&&(r=Cj(e.charCategorizer(e.selection.main.head))),i.test&&(r=kj(i.test,e,r)),new Nk(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:r},t,n)}function Xc(i,e){return i.slice(Mt(i,e,!1),e)}function Zc(i,e){return i.slice(e,Mt(i,e))}function Cj(i){return(e,t,n)=>!n[0].length||(i(Xc(n.input,n.index))!=it.Word||i(Zc(n.input,n.index))!=it.Word)&&(i(Zc(n.input,n.index+n[0].length))!=it.Word||i(Xc(n.input,n.index+n[0].length))!=it.Word)}class Aj extends jk{nextMatch(e,t,n){let r=$r(this.spec,e,n,e.doc.length).next();return r.done&&(r=$r(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let a=Math.max(t,n-r*1e4),o=$r(this.spec,e,a,n),c=null;for(;!o.next().done;)c=o.value;if(c&&(a==t||c.from>a+10))return c;if(a==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let a=+n.slice(0,r);if(a>0&&a<e.match.length)return e.match[a]+n.slice(r)}return t})}matchAll(e,t){let n=$r(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let a=$r(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!a.next().done;)r(a.value.from,a.value.to)}}const so=ve.define(),Og=ve.define(),ws=Ut.define({create(i){return new Cp(zm(i).create(),null)},update(i,e){for(let t of e.effects)t.is(so)?i=new Cp(t.value.create(),i.panel):t.is(Og)&&(i=new Cp(i.query,t.value?Eg:null));return i},provide:i=>eo.from(i,e=>e.panel)});class Cp{constructor(e,t){this.query=e,this.panel=t}}const Mj=me.mark({class:"cm-searchMatch"}),Tj=me.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Oj=at.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(ws))}update(i){let e=i.state.field(ws);(e!=i.startState.field(ws)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return me.none;let{view:t}=this,n=new Un;for(let r=0,a=t.visibleRanges,o=a.length;r<o;r++){let{from:c,to:f}=a[r];for(;r<o-1&&f>a[r+1].from-500;)f=a[++r].to;i.highlight(t.state,c,f,(d,m)=>{let y=t.state.selection.ranges.some(b=>b.from==d&&b.to==m);n.add(d,m,y?Tj:Mj)})}return n.finish()}},{decorations:i=>i.decorations});function vo(i){return e=>{let t=e.state.field(ws,!1);return t&&t.query.spec.valid?i(e,t):zk(e)}}const Jc=vo((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=W.single(n.from,n.to),a=i.state.facet(Ml);return i.dispatch({selection:r,effects:[Ng(i,n),a.scrollToMatch(r.main,i)],userEvent:"select.search"}),Lk(i),!0}),$c=vo((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let a=W.single(r.from,r.to),o=i.state.facet(Ml);return i.dispatch({selection:a,effects:[Ng(i,r),o.scrollToMatch(a.main,i)],userEvent:"select.search"}),Lk(i),!0}),Ej=vo((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:W.create(t.map(n=>W.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),Nj=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,a=[],o=0;for(let c=new bl(i.doc,i.sliceDoc(n,r));!c.next().done;){if(a.length>1e3)return!1;c.value.from==n&&(o=a.length),a.push(W.range(c.value.from,c.value.to))}return e(i.update({selection:W.create(a,o),userEvent:"select.search.matches"})),!0},Lv=vo((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let a=e.nextMatch(t,n,n);if(!a)return!1;let o=a,c=[],f,d,m=[];o.from==n&&o.to==r&&(d=t.toText(e.getReplacement(o)),c.push({from:o.from,to:o.to,insert:d}),o=e.nextMatch(t,o.from,o.to),m.push(ie.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+".")));let y=i.state.changes(c);return o&&(f=W.single(o.from,o.to).map(y),m.push(Ng(i,o)),m.push(t.facet(Ml).scrollToMatch(f.main,i))),i.dispatch({changes:y,selection:f,effects:m,userEvent:"input.replace"}),!0}),Rj=vo((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(r=>{let{from:a,to:o}=r;return{from:a,to:o,insert:e.getReplacement(r)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:ie.announce.of(n),userEvent:"input.replace.all"}),!0});function Eg(i){return i.state.facet(Ml).createPanel(i)}function zm(i,e){var t,n,r,a,o;let c=i.selection.main,f=c.empty||c.to>c.from+100?"":i.sliceDoc(c.from,c.to);if(e&&!f)return e;let d=i.facet(Ml);return new Dk({search:((t=e?.literal)!==null&&t!==void 0?t:d.literal)?f:f.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:d.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:d.literal,regexp:(a=e?.regexp)!==null&&a!==void 0?a:d.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:d.wholeWord})}function Bk(i){let e=yg(i,Eg);return e&&e.dom.querySelector("[main-field]")}function Lk(i){let e=Bk(i);e&&e==i.root.activeElement&&e.select()}const zk=i=>{let e=i.state.field(ws,!1);if(e&&e.panel){let t=Bk(i);if(t&&t!=i.root.activeElement){let n=zm(i.state,e.query.spec);n.valid&&i.dispatch({effects:so.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[Og.of(!0),e?so.of(zm(i.state,e.query.spec)):ve.appendConfig.of(Lj)]});return!0},Hk=i=>{let e=i.state.field(ws,!1);if(!e||!e.panel)return!1;let t=yg(i,Eg);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:Og.of(!1)}),!0},Dj=[{key:"Mod-f",run:zk,scope:"editor search-panel"},{key:"F3",run:Jc,shift:$c,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Jc,shift:$c,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Hk,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Nj},{key:"Mod-Alt-g",run:oj},{key:"Mod-d",run:xj,preventDefault:!0}];class jj{constructor(e){this.view=e;let t=this.query=e.state.field(ws).query.spec;this.commit=this.commit.bind(this),this.searchField=Ye("input",{value:t.search,placeholder:gi(e,"Find"),"aria-label":gi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ye("input",{value:t.replace,placeholder:gi(e,"Replace"),"aria-label":gi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ye("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ye("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ye("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,a,o){return Ye("button",{class:"cm-button",name:r,onclick:a,type:"button"},o)}this.dom=Ye("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>Jc(e),[gi(e,"next")]),n("prev",()=>$c(e),[gi(e,"previous")]),n("select",()=>Ej(e),[gi(e,"all")]),Ye("label",null,[this.caseField,gi(e,"match case")]),Ye("label",null,[this.reField,gi(e,"regexp")]),Ye("label",null,[this.wordField,gi(e,"by word")]),...e.state.readOnly?[]:[Ye("br"),this.replaceField,n("replace",()=>Lv(e),[gi(e,"replace")]),n("replaceAll",()=>Rj(e),[gi(e,"replace all")])],Ye("button",{name:"close",onclick:()=>Hk(e),"aria-label":gi(e,"close"),type:"button"},["×"])])}commit(){let e=new Dk({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:so.of(e)}))}keydown(e){z4(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$c:Jc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Lv(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(so)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ml).top}}function gi(i,e){return i.state.phrase(e)}const lc=30,ac=/[\s\.,:;?!]/;function Ng(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,a=Math.max(n.from,e-lc),o=Math.min(r,t+lc),c=i.state.sliceDoc(a,o);if(a!=n.from){for(let f=0;f<lc;f++)if(!ac.test(c[f+1])&&ac.test(c[f])){c=c.slice(f);break}}if(o!=r){for(let f=c.length-1;f>c.length-lc;f--)if(!ac.test(c[f-1])&&ac.test(c[f])){c=c.slice(0,f);break}}return ie.announce.of(`${i.state.phrase("current match")}. ${c} ${i.state.phrase("on line")} ${n.number}.`)}const Bj=ie.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Lj=[ws,dr.low(Oj),Bj];class _k{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=_t(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),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),a=r.search(Uk(e,!1));return a<0?null:{from:n+a,to:this.pos,text:r.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function zv(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function zj(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let a=1;a<r.length;a++)t[r[a]]=!0}let n=zv(e)+zv(t)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function Hj(i){let e=i.map(r=>typeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:zj(e);return r=>{let a=r.matchBefore(n);return a||r.explicit?{from:a?a.from:r.pos,options:e,validFor:t}:null}}class Hv{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function lr(i){return i.selection.main.from}function Uk(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",a=n[n.length-1]!="$";return!r&&!a?i:new RegExp(`${r?"^":""}(?:${n})${a?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}const qk=dn.define();function _j(i,e,t,n){let{main:r}=i.selection,a=t-r.from,o=n-r.from;return{...i.changeByRange(c=>{if(c!=r&&t!=n&&i.sliceDoc(c.from+a,c.from+o)!=i.sliceDoc(t,n))return{range:c};let f=i.toText(e);return{changes:{from:c.from+a,to:n==r.from?c.to:c.from+o,insert:f},range:W.cursor(c.from+a+f.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const _v=new WeakMap;function Uj(i){if(!Array.isArray(i))return i;let e=_v.get(i);return e||_v.set(i,e=Hj(i)),e}const eh=ve.define(),ro=ve.define();class qj{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 n=ei(e,t),r=ln(n);this.chars.push(n);let a=e.slice(t,t+r),o=a.toUpperCase();this.folded.push(ei(o==a?a.toLowerCase():o,0)),t+=r}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:n,any:r,precise:a,byWord:o}=this;if(t.length==1){let R=ei(e,0),D=ln(R),Q=D==e.length?0:-100;if(R!=t[0])if(R==n[0])Q+=-200;else return null;return this.ret(Q,[0,D])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let f=t.length,d=0;if(c<0){for(let R=0,D=Math.min(e.length,200);R<D&&d<f;){let Q=ei(e,R);(Q==t[d]||Q==n[d])&&(r[d++]=R),R+=ln(Q)}if(d<f)return null}let m=0,y=0,b=!1,x=0,w=-1,k=-1,C=/[a-z]/.test(e),M=!0;for(let R=0,D=Math.min(e.length,200),Q=0;R<D&&y<f;){let _=ei(e,R);c<0&&(m<f&&_==t[m]&&(a[m++]=R),x<f&&(_==t[x]||_==n[x]?(x==0&&(w=R),k=R+1,x++):x=0));let K,U=_<255?_>=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(K=$m(_))!=K.toLowerCase()?1:K!=K.toUpperCase()?2:0;(!R||U==1&&C||Q==0&&U!=0)&&(t[y]==_||n[y]==_&&(b=!0)?o[y++]=R:o.length&&(M=!1)),Q=U,R+=ln(_)}return y==f&&o[0]==0&&M?this.result(-100+(b?-200:0),o,e):x==f&&w==0?this.ret(-200-e.length+(k==e.length?0:-100),[0,k]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):x==f?this.ret(-900-e.length,[w,k]):y==f?this.result(-100+(b?-200:0)+-700+(M?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],a=0;for(let o of t){let c=o+(this.astral?ln(ei(n,o)):1);a&&r[a-1]==o?r[a-1]=c:(r[a++]=o,r[a++]=c)}return this.ret(e-n.length,r)}}class Pj{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),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const At=re.define({combine(i){return pn(i,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Vj,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)=>n=>Uv(e(n),t(n)),optionClass:(e,t)=>n=>Uv(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Uv(i,e){return i?e?i+" "+e:i:e}function Vj(i,e,t,n,r,a){let o=i.textDirection==Xe.RTL,c=o,f=!1,d="top",m,y,b=e.left-r.left,x=r.right-e.right,w=n.right-n.left,k=n.bottom-n.top;if(c&&b<Math.min(w,x)?c=!1:!c&&x<Math.min(w,b)&&(c=!0),w<=(c?b:x))m=Math.max(r.top,Math.min(t.top,r.bottom-k))-e.top,y=Math.min(400,c?b:x);else{f=!0,y=Math.min(400,(o?e.right:r.right-e.left)-30);let R=r.bottom-e.bottom;R>=k||R>e.top?m=t.bottom-e.top:(d="bottom",m=e.bottom-t.top)}let C=(e.bottom-e.top)/a.offsetHeight,M=(e.right-e.left)/a.offsetWidth;return{style:`${d}: ${m/C}px; max-width: ${y/M}px`,class:"cm-completionInfo-"+(f?o?"left-narrow":"right-narrow":c?"left":"right")}}function Qj(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,r,a){let o=document.createElement("span");o.className="cm-completionLabel";let c=t.displayLabel||t.label,f=0;for(let d=0;d<a.length;){let m=a[d++],y=a[d++];m>f&&o.appendChild(document.createTextNode(c.slice(f,m)));let b=o.appendChild(document.createElement("span"));b.appendChild(document.createTextNode(c.slice(m,y))),b.className="cm-completionMatchedText",f=y}return f<c.length&&o.appendChild(document.createTextNode(c.slice(f))),o},position:50},{render(t){if(!t.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=t.detail,n},position:80}),e.sort((t,n)=>t.position-n.position).map(t=>t.render)}function Ap(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}class Gj{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:f=>this.placeInfo(f),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:a,selected:o}=r.open,c=e.state.facet(At);this.optionContent=Qj(c),this.optionClass=c.optionClass,this.tooltipClass=c.tooltipClass,this.range=Ap(a.length,o,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",f=>{let{options:d}=e.state.field(t).open;for(let m=f.target,y;m&&m!=this.dom;m=m.parentNode)if(m.nodeName=="LI"&&(y=/-(\d+)$/.exec(m.id))&&+y[1]<d.length){this.applyCompletion(e,d[+y[1]]),f.preventDefault();return}}),this.dom.addEventListener("focusout",f=>{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(At).closeOnBlur&&f.relatedTarget!=e.contentDOM&&e.dispatch({effects:ro.of(null)})}),this.showOptions(a,r.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 n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:a,selected:o,disabled:c}=n.open;(!r.open||r.open.options!=a)&&(this.range=Ap(a.length,o,e.state.facet(At).maxRenderedOptions),this.showOptions(a,n.id)),this.updateSel(),c!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!c)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);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=Ap(t.options.length,t.selected,this.view.state.facet(At).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:a}=r;if(!a)return;let o=typeof a=="string"?document.createTextNode(a):a(r);if(!o)return;"then"in o?o.then(c=>{c&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(c,r)}).catch(c=>ni(this.view.state,c,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:a}=e;n.appendChild(r),this.infoDestroy=a||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return t&&Kj(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),a=this.space;if(!a){let o=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(a.bottom,t.bottom)-10||r.bottom<Math.max(a.top,t.top)+10?null:this.view.state.facet(At).positionInfo(this.view,t,r,n,a,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,n){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",o=>{o.target==r&&o.preventDefault()});let a=null;for(let o=n.from;o<n.to;o++){let{completion:c,match:f}=e[o],{section:d}=c;if(d){let b=typeof d=="string"?d:d.name;if(b!=a&&(o>n.from||n.from==0))if(a=b,typeof d!="string"&&d.header)r.appendChild(d.header(d));else{let x=r.appendChild(document.createElement("completion-section"));x.textContent=b}}const m=r.appendChild(document.createElement("li"));m.id=t+"-"+o,m.setAttribute("role","option");let y=this.optionClass(c);y&&(m.className=y);for(let b of this.optionContent){let x=b(c,this.view.state,this.view,f);x&&m.appendChild(x)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Fj(i,e){return t=>new Gj(t,i,e)}function Kj(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.height/i.offsetHeight;n.top<t.top?i.scrollTop-=(t.top-n.top)/r:n.bottom>t.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/r)}function qv(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function Yj(i,e){let t=[],n=null,r=null,a=m=>{t.push(m);let{section:y}=m.completion;if(y){n||(n=[]);let b=typeof y=="string"?y:y.name;n.some(x=>x.name==b)||n.push(typeof y=="string"?{name:b}:y)}},o=e.facet(At);for(let m of i)if(m.hasResult()){let y=m.result.getMatch;if(m.result.filter===!1)for(let b of m.result.options)a(new Hv(b,m.source,y?y(b):[],1e9-t.length));else{let b=e.sliceDoc(m.from,m.to),x,w=o.filterStrict?new Pj(b):new qj(b);for(let k of m.result.options)if(x=w.match(k.label)){let C=k.displayLabel?y?y(k,x.matched):[]:x.matched,M=x.score+(k.boost||0);if(a(new Hv(k,m.source,C,M)),typeof k.section=="object"&&k.section.rank==="dynamic"){let{name:R}=k.section;r||(r=Object.create(null)),r[R]=Math.max(M,r[R]||-1e9)}}}}if(n){let m=Object.create(null),y=0,b=(x,w)=>(x.rank==="dynamic"&&w.rank==="dynamic"?r[w.name]-r[x.name]:0)||(typeof x.rank=="number"?x.rank:1e9)-(typeof w.rank=="number"?w.rank:1e9)||(x.name<w.name?-1:1);for(let x of n.sort(b))y-=1e5,m[x.name]=y;for(let x of t){let{section:w}=x.completion;w&&(x.score+=m[typeof w=="string"?w:w.name])}}let c=[],f=null,d=o.compareCompletions;for(let m of t.sort((y,b)=>b.score-y.score||d(y.completion,b.completion))){let y=m.completion;!f||f.label!=y.label||f.detail!=y.detail||f.type!=null&&y.type!=null&&f.type!=y.type||f.apply!=y.apply||f.boost!=y.boost?c.push(m):qv(m.completion)>qv(f)&&(c[c.length-1]=m),f=m.completion}return c}class nl{constructor(e,t,n,r,a,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=a,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new nl(this.options,Pv(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,a,o){if(r&&!o&&e.some(d=>d.isPending))return r.setDisabled();let c=Yj(e,t);if(!c.length)return r&&e.some(d=>d.isPending)?r.setDisabled():null;let f=t.facet(At).selectOnOpen?0:-1;if(r&&r.selected!=f&&r.selected!=-1){let d=r.options[r.selected].completion;for(let m=0;m<c.length;m++)if(c[m].completion==d){f=m;break}}return new nl(c,Pv(n,f),{pos:e.reduce((d,m)=>m.hasResult()?Math.min(d,m.from):d,1e8),create:$j,above:a.aboveCursor},r?r.timestamp:Date.now(),f,!1)}map(e){return new nl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new nl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class th{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new th(Zj,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(At),a=(n.override||t.languageDataAt("autocomplete",lr(t)).map(Uj)).map(f=>(this.active.find(m=>m.source==f)||new Li(f,this.active.some(m=>m.state!=0)?1:0)).update(e,n));a.length==this.active.length&&a.every((f,d)=>f==this.active[d])&&(a=this.active);let o=this.open,c=e.effects.some(f=>f.is(Rg));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||a.some(f=>f.hasResult()&&e.changes.touchesRange(f.from,f.to))||!Ij(a,this.active)||c?o=nl.build(a,t,this.id,o,n,c):o&&o.disabled&&!a.some(f=>f.isPending)&&(o=null),!o&&a.every(f=>!f.isPending)&&a.some(f=>f.hasResult())&&(a=a.map(f=>f.hasResult()?new Li(f.source,0):f));for(let f of e.effects)f.is(Vk)&&(o=o&&o.setSelected(f.value,this.id));return a==this.active&&o==this.open?this:new th(a,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Wj:Xj}}function Ij(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t<i.length&&!i[t].hasResult();)t++;for(;n<e.length&&!e[n].hasResult();)n++;let r=t==i.length,a=n==e.length;if(r||a)return r==a;if(i[t++].result!=e[n++].result)return!1}}const Wj={"aria-autocomplete":"list"},Xj={};function Pv(i,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":i};return e>-1&&(t["aria-activedescendant"]=i+"-"+e),t}const Zj=[];function Pk(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(qk);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}class Li{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=Pk(e,t),r=this;(n&8||n&16&&this.touches(e))&&(r=new Li(r.source,0)),n&4&&r.state==0&&(r=new Li(this.source,1)),r=r.updateFor(e,n);for(let a of e.effects)if(a.is(eh))r=new Li(r.source,1,a.value);else if(a.is(ro))r=new Li(r.source,0);else if(a.is(Rg))for(let o of a.value)o.source==r.source&&(r=o);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(lr(e.state))}}class cl extends Li{constructor(e,t,n,r,a,o){super(e,3,t),this.limit=n,this.result=r,this.from=a,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let a=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),c=lr(e.state);if(c>o||!r||t&2&&(lr(e.startState)==this.from||c<this.limit))return new Li(this.source,t&4?1:0);let f=e.changes.mapPos(this.limit);return Jj(r.validFor,e.state,a,o)?new cl(this.source,this.explicit,f,r,a,o):r.update&&(r=r.update(r,a,o,new _k(e.state,c,!1)))?new cl(this.source,this.explicit,f,r,r.from,(n=r.to)!==null&&n!==void 0?n:lr(e.state)):new Li(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new cl(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Li(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Jj(i,e,t,n){if(!i)return!1;let r=e.sliceDoc(t,n);return typeof i=="function"?i(r,t,n,e):Uk(i,!0).test(r)}const Rg=ve.define({map(i,e){return i.map(t=>t.map(e))}}),Vk=ve.define(),ti=Ut.define({create(){return th.start()},update(i,e){return i.update(e)},provide:i=>[gg.from(i,e=>e.tooltip),ie.contentAttributes.from(i,e=>e.attrs)]});function Dg(i,e){const t=e.completion.apply||e.completion.label;let n=i.state.field(ti).active.find(r=>r.source==e.source);return n instanceof cl?(typeof t=="string"?i.dispatch({..._j(i.state,t,n.from,n.to),annotations:qk.of(e.completion)}):t(i,e.completion,n.from,n.to),!0):!1}const $j=Fj(ti,Dg);function oc(i,e="option"){return t=>{let n=t.state.field(ti,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<t.state.facet(At).interactionDelay)return!1;let r=1,a;e=="page"&&(a=vw(t,n.open.tooltip))&&(r=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,c=n.open.selected>-1?n.open.selected+r*(i?1:-1):i?0:o-1;return c<0?c=e=="page"?0:o-1:c>=o&&(c=e=="page"?o-1:0),t.dispatch({effects:Vk.of(c)}),!0}}const e6=i=>{let e=i.state.field(ti,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<i.state.facet(At).interactionDelay?!1:Dg(i,e.open.options[e.open.selected])},Mp=i=>i.state.field(ti,!1)?(i.dispatch({effects:eh.of(!0)}),!0):!1,t6=i=>{let e=i.state.field(ti,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:ro.of(null)}),!0)};class i6{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const n6=50,s6=1e3,r6=at.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(ti).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(ti),t=i.state.facet(At);if(!i.selectionSet&&!i.docChanged&&i.startState.field(ti)==e)return;let n=i.transactions.some(a=>{let o=Pk(a,t);return o&8||(a.selection||a.docChanged)&&!(o&3)});for(let a=0;a<this.running.length;a++){let o=this.running[a];if(n||o.context.abortOnDocChange&&i.docChanged||o.updates.length+i.transactions.length>n6&&Date.now()-o.time>s6){for(let c of o.context.abortListeners)try{c()}catch(f){ni(this.view.state,f)}o.context.abortListeners=null,this.running.splice(a--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(a=>a.effects.some(o=>o.is(eh)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(o=>o.active.source==a.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let a of i.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(ti);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(At).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=lr(e),n=new _k(e,t,i.explicit,this.view),r=new i6(i,n);this.running.push(r),Promise.resolve(i.source(n)).then(a=>{r.context.aborted||(r.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:ro.of(null)}),ni(this.view.state,a)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(At).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(At),n=this.view.state.field(ti);for(let r=0;r<this.running.length;r++){let a=this.running[r];if(a.done===void 0)continue;if(this.running.splice(r--,1),a.done){let c=lr(a.updates.length?a.updates[0].startState:this.view.state),f=Math.min(c,a.done.from+(a.active.explicit?0:1)),d=new cl(a.active.source,a.active.explicit,f,a.done,a.done.from,(i=a.done.to)!==null&&i!==void 0?i:c);for(let m of a.updates)d=d.update(m,t);if(d.hasResult()){e.push(d);continue}}let o=n.active.find(c=>c.source==a.active.source);if(o&&o.isPending)if(a.done==null){let c=new Li(a.active.source,0);for(let f of a.updates)c=c.update(f,t);c.isPending||e.push(c)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:Rg.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(ti,!1);if(e&&e.tooltip&&this.view.state.facet(At).closeOnBlur){let t=e.open&&vw(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ro.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:eh.of(!1)}),20),this.composing=0}}}),l6=typeof navigator=="object"&&/Win/.test(navigator.platform),a6=dr.highest(ie.domEventHandlers({keydown(i,e){let t=e.state.field(ti,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(l6&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],r=t.active.find(o=>o.source==n.source),a=n.completion.commitCharacters||r.result.commitCharacters;return a&&a.indexOf(i.key)>-1&&Dg(e,n),!1}})),o6=ie.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"}}}),lo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},sr=ve.define({map(i,e){let t=e.mapPos(i,-1,Ft.TrackAfter);return t??void 0}}),jg=new class extends Cs{};jg.startSide=1;jg.endSide=-1;const Qk=Ut.define({create(){return Ee.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(sr)&&(i=i.update({add:[jg.range(t.value,t.value+1)]}));return i}});function u6(){return[h6,Qk]}const Tp="()[]{}<>«»»«[]{}";function Gk(i){for(let e=0;e<Tp.length;e+=2)if(Tp.charCodeAt(e)==i)return Tp.charAt(e+1);return $m(i<128?i:i+1)}function Fk(i,e){return i.languageDataAt("closeBrackets",e)[0]||lo}const c6=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),h6=ie.inputHandler.of((i,e,t,n)=>{if((c6?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let r=i.state.selection.main;if(n.length>2||n.length==2&&ln(ei(n,0))==1||e!=r.from||t!=r.to)return!1;let a=p6(i.state,n);return a?(i.dispatch(a),!0):!1}),f6=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=Fk(i,i.selection.main.head).brackets||lo.brackets,r=null,a=i.changeByRange(o=>{if(o.empty){let c=m6(i.doc,o.head);for(let f of n)if(f==c&&kh(i.doc,o.head)==Gk(ei(f,0)))return{changes:{from:o.head-f.length,to:o.head+f.length},range:W.cursor(o.head-f.length)}}return{range:r=o}});return r||e(i.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},d6=[{key:"Backspace",run:f6}];function p6(i,e){let t=Fk(i,i.selection.main.head),n=t.brackets||lo.brackets;for(let r of n){let a=Gk(ei(r,0));if(e==r)return a==r?b6(i,r,n.indexOf(r+r+r)>-1,t):g6(i,r,a,t.before||lo.before);if(e==a&&Kk(i,i.selection.main.from))return y6(i,r,a)}return null}function Kk(i,e){let t=!1;return i.field(Qk).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function kh(i,e){let t=i.sliceString(e,e+2);return t.slice(0,ln(ei(t,0)))}function m6(i,e){let t=i.sliceString(e-2,e);return ln(ei(t,0))==t.length?t:t.slice(1)}function g6(i,e,t,n){let r=null,a=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:sr.of(o.to+e.length),range:W.range(o.anchor+e.length,o.head+e.length)};let c=kh(i.doc,o.head);return!c||/\s/.test(c)||n.indexOf(c)>-1?{changes:{insert:e+t,from:o.head},effects:sr.of(o.head+e.length),range:W.cursor(o.head+e.length)}:{range:r=o}});return r?null:i.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function y6(i,e,t){let n=null,r=i.changeByRange(a=>a.empty&&kh(i.doc,a.head)==t?{changes:{from:a.head,to:a.head+t.length,insert:t},range:W.cursor(a.head+t.length)}:n={range:a});return n?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function b6(i,e,t,n){let r=n.stringPrefixes||lo.stringPrefixes,a=null,o=i.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:sr.of(c.to+e.length),range:W.range(c.anchor+e.length,c.head+e.length)};let f=c.head,d=kh(i.doc,f),m;if(d==e){if(Vv(i,f))return{changes:{insert:e+e,from:f},effects:sr.of(f+e.length),range:W.cursor(f+e.length)};if(Kk(i,f)){let b=t&&i.sliceDoc(f,f+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:f,to:f+b.length,insert:b},range:W.cursor(f+b.length)}}}else{if(t&&i.sliceDoc(f-2*e.length,f)==e+e&&(m=Qv(i,f-2*e.length,r))>-1&&Vv(i,m))return{changes:{insert:e+e+e+e,from:f},effects:sr.of(f+e.length),range:W.cursor(f+e.length)};if(i.charCategorizer(f)(d)!=it.Word&&Qv(i,f,r)>-1&&!x6(i,f,e,r))return{changes:{insert:e+e,from:f},effects:sr.of(f+e.length),range:W.cursor(f+e.length)}}return{range:a=c}});return a?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Vv(i,e){let t=_t(i).resolveInner(e+1);return t.parent&&t.from==e}function x6(i,e,t,n){let r=_t(i).resolveInner(e,-1),a=n.reduce((o,c)=>Math.max(o,c.length),0);for(let o=0;o<5;o++){let c=i.sliceDoc(r.from,Math.min(r.to,r.from+t.length+a)),f=c.indexOf(t);if(!f||f>-1&&n.indexOf(c.slice(0,f))>-1){let m=r.firstChild;for(;m&&m.from==r.from&&m.to-m.from>t.length+f;){if(i.sliceDoc(m.to-t.length,m.to)==t)return!1;m=m.firstChild}return!0}let d=r.to==e&&r.parent;if(!d)break;r=d}return!1}function Qv(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=it.Word)return e;for(let r of t){let a=e-r.length;if(i.sliceDoc(a,e)==r&&n(i.sliceDoc(a-1,a))!=it.Word)return a}return-1}function v6(i={}){return[a6,ti,At.of(i),r6,S6,o6]}const Yk=[{key:"Ctrl-Space",run:Mp},{mac:"Alt-`",run:Mp},{mac:"Alt-i",run:Mp},{key:"Escape",run:t6},{key:"ArrowDown",run:oc(!0)},{key:"ArrowUp",run:oc(!1)},{key:"PageDown",run:oc(!0,"page")},{key:"PageUp",run:oc(!1,"page")},{key:"Enter",run:e6}],S6=dr.highest(ph.computeN([At],i=>i.facet(At).defaultKeymap?[Yk]:[]));class Gv{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class er{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(ao).markerFilter;r&&(e=r(e,n));let a=e.slice().sort((x,w)=>x.from-w.from||x.to-w.to),o=new Un,c=[],f=0,d=n.doc.iter(),m=0,y=n.doc.length;for(let x=0;;){let w=x==a.length?null:a[x];if(!w&&!c.length)break;let k,C;if(c.length)k=f,C=c.reduce((D,Q)=>Math.min(D,Q.to),w&&w.from>k?w.from:1e8);else{if(k=w.from,k>y)break;C=w.to,c.push(w),x++}for(;x<a.length;){let D=a[x];if(D.from==k&&(D.to>D.from||D.to==k))c.push(D),x++,C=Math.min(D.to,C);else{C=Math.min(D.from,C);break}}C=Math.min(C,y);let M=!1;if(c.some(D=>D.from==k&&(D.to==C||C==y))&&(M=k==C,!M&&C-k<10)){let D=k-(m+d.value.length);D>0&&(d.next(D),m=k);for(let Q=k;;){if(Q>=C){M=!0;break}if(!d.lineBreak&&m+d.value.length>Q)break;Q=m+d.value.length,m+=d.value.length,d.next()}}let R=B6(c);if(M)o.add(k,k,me.widget({widget:new N6(R),diagnostics:c.slice()}));else{let D=c.reduce((Q,_)=>_.markClass?Q+" "+_.markClass:Q,"");o.add(k,C,me.mark({class:"cm-lintRange cm-lintRange-"+R+D,diagnostics:c.slice(),inclusiveEnd:c.some(Q=>Q.to>C)}))}if(f=C,f==y)break;for(let D=0;D<c.length;D++)c[D].to<=f&&c.splice(D--,1)}let b=o.finish();return new er(b,t,Ns(b))}}function Ns(i,e=null,t=0){let n=null;return i.between(t,1e9,(r,a,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new Gv(r,a,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Gv(n.from,a,n.diagnostic)}}),n}function w6(i,e){let t=e.pos,n=e.end||t,r=i.state.facet(ao).hideOn(i,t,n);if(r!=null)return r;let a=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Ik))||i.changes.touchesRange(a.from,Math.max(a.to,n)))}function k6(i,e){return i.field(xi,!1)?e:e.concat(ve.appendConfig.of(L6))}const Ik=ve.define(),Bg=ve.define(),Wk=ve.define(),xi=Ut.define({create(){return new er(me.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,r=i.panel;if(i.selected){let a=e.changes.mapPos(i.selected.from,1);n=Ns(t,i.selected.diagnostic,a)||Ns(t,null,a)}!t.size&&r&&e.state.facet(ao).autoPanel&&(r=null),i=new er(t,r,n)}for(let t of e.effects)if(t.is(Ik)){let n=e.state.facet(ao).autoPanel?t.value.length?oo.open:null:i.panel;i=er.init(t.value,n,e.state)}else t.is(Bg)?i=new er(i.diagnostics,t.value?oo.open:null,i.selected):t.is(Wk)&&(i=new er(i.diagnostics,i.panel,t.value));return i},provide:i=>[eo.from(i,e=>e.panel),ie.decorations.from(i,e=>e.diagnostics)]}),C6=me.mark({class:"cm-lintRange cm-lintRange-active"});function A6(i,e,t){let{diagnostics:n}=i.state.field(xi),r,a=-1,o=-1;n.between(e-(t<0?1:0),e+(t>0?1:0),(f,d,{spec:m})=>{if(e>=f&&e<=d&&(f==d||(e>f||t>0)&&(e<d||t<0)))return r=m.diagnostics,a=f,o=d,!1});let c=i.state.facet(ao).tooltipFilter;return r&&c&&(r=c(r,i.state)),r?{pos:a,end:o,above:i.state.doc.lineAt(a).to<o,create(){return{dom:M6(i,r)}}}:null}function M6(i,e){return Ye("ul",{class:"cm-tooltip-lint"},e.map(t=>Zk(i,t,!1)))}const T6=i=>{let e=i.state.field(xi,!1);(!e||!e.panel)&&i.dispatch({effects:k6(i.state,[Bg.of(!0)])});let t=yg(i,oo.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Fv=i=>{let e=i.state.field(xi,!1);return!e||!e.panel?!1:(i.dispatch({effects:Bg.of(!1)}),!0)},O6=i=>{let e=i.state.field(xi,!1);if(!e)return!1;let t=i.state.selection.main,n=Ns(e.diagnostics,null,t.to+1);return!n&&(n=Ns(e.diagnostics,null,0),!n||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},E6=[{key:"Mod-Shift-m",run:T6,preventDefault:!0},{key:"F8",run:O6}],ao=re.define({combine(i){return{sources:i.map(e=>e.source).filter(e=>e!=null),...pn(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Kv,tooltipFilter:Kv,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,a)=>e(n,r,a)||t(n,r,a):e:t,autoPanel:(e,t)=>e||t})}}});function Kv(i,e){return i?e?(t,n)=>e(i(t,n),n):i:e}function Xk(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;n<t.length;n++){let r=t[n];if(/[a-zA-Z]/.test(r)&&!e.some(a=>a.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function Zk(i,e,t){var n;let r=t?Xk(e.actions):[];return Ye("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ye("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((a,o)=>{let c=!1,f=x=>{if(x.preventDefault(),c)return;c=!0;let w=Ns(i.state.field(xi).diagnostics,e);w&&a.apply(i,w.from,w.to)},{name:d}=a,m=r[o]?d.indexOf(r[o]):-1,y=m<0?d:[d.slice(0,m),Ye("u",d.slice(m,m+1)),d.slice(m+1)],b=a.markClass?" "+a.markClass:"";return Ye("button",{type:"button",class:"cm-diagnosticAction"+b,onclick:f,onmousedown:f,"aria-label":` Action: ${d}${m<0?"":` (access key "${r[o]})"`}.`},y)}),e.source&&Ye("div",{class:"cm-diagnosticSource"},e.source))}class N6 extends mn{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ye("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Yv{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Zk(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class oo{constructor(e){this.view=e,this.items=[];let t=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Fv(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],o=Xk(a.actions);for(let c=0;c<o.length;c++)if(o[c].toUpperCase().charCodeAt(0)==r.keyCode){let f=Ns(this.view.state.field(xi).diagnostics,a);f&&a.actions[c].apply(e,f.from,f.to)}}else return;r.preventDefault()}},n=r=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(r.target)&&this.moveSelection(a)};this.list=Ye("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=Ye("div",{class:"cm-panel-lint"},this.list,Ye("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Fv(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(xi).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(xi),n=0,r=!1,a=null,o=new Set;for(e.between(0,this.view.state.doc.length,(c,f,{spec:d})=>{for(let m of d.diagnostics){if(o.has(m))continue;o.add(m);let y=-1,b;for(let x=n;x<this.items.length;x++)if(this.items[x].diagnostic==m){y=x;break}y<0?(b=new Yv(this.view,m),this.items.splice(n,0,b),r=!0):(b=this.items[y],y>n&&(this.items.splice(n,y-n),r=!0)),t&&b.diagnostic==t.diagnostic?b.dom.hasAttribute("aria-selected")||(b.dom.setAttribute("aria-selected","true"),a=b):b.dom.hasAttribute("aria-selected")&&b.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Yv(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:c,panel:f})=>{let d=f.height/this.list.offsetHeight;c.top<f.top?this.list.scrollTop-=(f.top-c.top)/d:c.bottom>f.bottom&&(this.list.scrollTop+=(c.bottom-f.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(xi),n=Ns(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Wk.of(n)})}static open(e){return new oo(e)}}function R6(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(i)}</svg>')`}function uc(i){return R6(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${i}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const D6=ie.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:uc("#d11")},".cm-lintRange-warning":{backgroundImage:uc("orange")},".cm-lintRange-info":{backgroundImage:uc("#999")},".cm-lintRange-hint":{backgroundImage:uc("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function j6(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function B6(i){let e="hint",t=1;for(let n of i){let r=j6(n.severity);r>t&&(t=r,e=n.severity)}return e}const L6=[xi,ie.decorations.compute([xi],i=>{let{selected:e,panel:t}=i.field(xi);return!e||!t||e.from==e.to?me.none:me.set([C6.range(e.from,e.to)])}),CR(A6,{hideOn:w6}),D6];var Iv=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(d6)),e.defaultKeymap!==!1&&(n=n.concat(rj)),e.searchKeymap!==!1&&(n=n.concat(Dj)),e.historyKeymap!==!1&&(n=n.concat(fD)),e.foldKeymap!==!1&&(n=n.concat(M5)),e.completionKeymap!==!1&&(n=n.concat(Yk)),e.lintKeymap!==!1&&(n=n.concat(E6));var r=[];return e.lineNumbers!==!1&&r.push(HR()),e.highlightActiveLineGutter!==!1&&r.push(qR()),e.highlightSpecialChars!==!1&&r.push($4()),e.history!==!1&&r.push(nD()),e.foldGutter!==!1&&r.push(N5()),e.drawSelection!==!1&&r.push(V4()),e.dropCursor!==!1&&r.push(Y4()),e.allowMultipleSelections!==!1&&r.push(je.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(g5()),e.syntaxHighlighting!==!1&&r.push(Kw(B5,{fallback:!0})),e.bracketMatching!==!1&&r.push(P5()),e.closeBrackets!==!1&&r.push(u6()),e.autocompletion!==!1&&r.push(v6()),e.rectangularSelection!==!1&&r.push(dR()),t!==!1&&r.push(gR()),e.highlightActiveLine!==!1&&r.push(rR()),e.highlightSelectionMatches!==!1&&r.push(hj()),e.tabSize&&typeof e.tabSize=="number"&&r.push(gh.of(" ".repeat(e.tabSize))),r.concat([ph.of(n.flat())]).filter(Boolean)};const z6="#e5c07b",Wv="#e06c75",H6="#56b6c2",_6="#ffffff",Sc="#abb2bf",Hm="#7d8799",U6="#61afef",q6="#98c379",Xv="#d19a66",P6="#c678dd",V6="#21252b",Zv="#2c313a",Jv="#282c34",Op="#353a42",Q6="#3E4451",$v="#528bff",G6=ie.theme({"&":{color:Sc,backgroundColor:Jv},".cm-content":{caretColor:$v},".cm-cursor, .cm-dropCursor":{borderLeftColor:$v},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Q6},".cm-panels":{backgroundColor:V6,color:Sc},".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:Jv,color:Hm,border:"none"},".cm-activeLineGutter":{backgroundColor:Zv},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Op},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Op,borderBottomColor:Op},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Zv,color:Sc}}},{dark:!0}),F6=bo.define([{tag:V.keyword,color:P6},{tag:[V.name,V.deleted,V.character,V.propertyName,V.macroName],color:Wv},{tag:[V.function(V.variableName),V.labelName],color:U6},{tag:[V.color,V.constant(V.name),V.standard(V.name)],color:Xv},{tag:[V.definition(V.name),V.separator],color:Sc},{tag:[V.typeName,V.className,V.number,V.changed,V.annotation,V.modifier,V.self,V.namespace],color:z6},{tag:[V.operator,V.operatorKeyword,V.url,V.escape,V.regexp,V.link,V.special(V.string)],color:H6},{tag:[V.meta,V.comment],color:Hm},{tag:V.strong,fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.link,color:Hm,textDecoration:"underline"},{tag:V.heading,fontWeight:"bold",color:Wv},{tag:[V.atom,V.bool,V.special(V.variableName)],color:Xv},{tag:[V.processingInstruction,V.string,V.inserted],color:q6},{tag:V.invalid,color:_6}]),K6=[G6,Kw(F6)];var Y6=ie.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),I6=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:a="light",placeholder:o="",basicSetup:c=!0}=e,f=[];switch(t&&f.unshift(ph.of([lj])),c&&(typeof c=="boolean"?f.unshift(Iv()):f.unshift(Iv(c))),o&&f.unshift(uR(o)),a){case"light":f.push(Y6);break;case"dark":f.push(K6);break;case"none":break;default:f.push(a);break}return n===!1&&f.push(ie.editable.of(!1)),r&&f.push(je.readOnly.of(!0)),[...f]},W6=i=>({line:i.state.doc.lineAt(i.state.selection.main.from),lineCount:i.state.doc.lines,lineBreak:i.state.lineBreak,length:i.state.doc.length,readOnly:i.state.readOnly,tabSize:i.state.tabSize,selection:i.state.selection,selectionAsSingle:i.state.selection.asSingle().main,ranges:i.state.selection.ranges,selectionCode:i.state.sliceDoc(i.state.selection.main.from,i.state.selection.main.to),selections:i.state.selection.ranges.map(e=>i.state.sliceDoc(e.from,e.to)),selectedText:i.state.selection.ranges.some(e=>!e.empty)});class X6{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class eS{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Ep=null,Z6=()=>typeof window>"u"?new eS:(Ep||(Ep=new eS),Ep),tS=dn.define(),J6=200,$6=[];function e8(i){var{value:e,selection:t,onChange:n,onStatistics:r,onCreateEditor:a,onUpdate:o,extensions:c=$6,autoFocus:f,theme:d="light",height:m=null,minHeight:y=null,maxHeight:b=null,width:x=null,minWidth:w=null,maxWidth:k=null,placeholder:C="",editable:M=!0,readOnly:R=!1,indentWithTab:D=!0,basicSetup:Q=!0,root:_,initialState:K}=i,[U,J]=E.useState(),[Z,ce]=E.useState(),[ae,P]=E.useState(),ee=E.useState(()=>({current:null}))[0],fe=E.useState(()=>({current:null}))[0],de=ie.theme({"&":{height:m,minHeight:y,maxHeight:b,width:x,minWidth:w,maxWidth:k},"& .cm-scroller":{height:"100% !important"}}),H=ie.updateListener.of(ue=>{if(ue.docChanged&&typeof n=="function"&&!ue.transactions.some(G=>G.annotation(tS))){ee.current?ee.current.reset():(ee.current=new X6(()=>{if(fe.current){var G=fe.current;fe.current=null,G()}ee.current=null},J6),Z6().add(ee.current));var ge=ue.state.doc,O=ge.toString();n(O,ue)}r&&r(W6(ue))}),X=I6({theme:d,editable:M,readOnly:R,placeholder:C,indentWithTab:D,basicSetup:Q}),le=[H,de,...X];return o&&typeof o=="function"&&le.push(ie.updateListener.of(o)),le=le.concat(c),E.useLayoutEffect(()=>{if(U&&!ae){var ue={doc:e,selection:t,extensions:le},ge=K?je.fromJSON(K.json,ue,K.fields):je.create(ue);if(P(ge),!Z){var O=new ie({state:ge,parent:U,root:_});ce(O),a&&a(O,ge)}}return()=>{Z&&(P(void 0),ce(void 0))}},[U,ae]),E.useEffect(()=>{i.container&&J(i.container)},[i.container]),E.useEffect(()=>()=>{Z&&(Z.destroy(),ce(void 0)),ee.current&&(ee.current.cancel(),ee.current=null)},[Z]),E.useEffect(()=>{f&&Z&&Z.focus()},[f,Z]),E.useEffect(()=>{Z&&Z.dispatch({effects:ve.reconfigure.of(le)})},[d,c,m,y,b,x,w,k,C,M,R,D,Q,n,o]),E.useEffect(()=>{if(e!==void 0){var ue=Z?Z.state.doc.toString():"";if(Z&&e!==ue){var ge=ee.current&&!ee.current.isDone,O=()=>{Z&&e!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:e||""},annotations:[tS.of(!0)]})};ge?fe.current=O:O()}}},[e,Z]),{state:ae,setState:P,view:Z,setView:ce,container:U,setContainer:J}}var t8=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Jk=E.forwardRef((i,e)=>{var{className:t,value:n="",selection:r,extensions:a=[],onChange:o,onStatistics:c,onCreateEditor:f,onUpdate:d,autoFocus:m,theme:y="light",height:b,minHeight:x,maxHeight:w,width:k,minWidth:C,maxWidth:M,basicSetup:R,placeholder:D,indentWithTab:Q,editable:_,readOnly:K,root:U,initialState:J}=i,Z=OE(i,t8),ce=E.useRef(null),{state:ae,view:P,container:ee,setContainer:fe}=e8({root:U,value:n,autoFocus:m,theme:y,height:b,minHeight:x,maxHeight:w,width:k,minWidth:C,maxWidth:M,basicSetup:R,placeholder:D,indentWithTab:Q,editable:_,readOnly:K,selection:r,onChange:o,onStatistics:c,onCreateEditor:f,onUpdate:d,extensions:a,initialState:J});E.useImperativeHandle(e,()=>({editor:ce.current,state:ae,view:P}),[ce,ee,ae,P]);var de=E.useCallback(X=>{ce.current=X,fe(X)},[fe]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var H=typeof y=="string"?"cm-theme-"+y:"cm-theme";return S.jsx("div",Gp({ref:de,className:""+H+(t?" "+t:"")},Z))});Jk.displayName="CodeMirror";var iS={};class ih{constructor(e,t,n,r,a,o,c,f,d,m=0,y){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=a,this.score=o,this.buffer=c,this.bufferBase=f,this.curContext=d,this.lookAhead=m,this.parent=y}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new ih(e,[],t,n,n,0,[],0,r?new nS(r,r.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 n=e>>19,r=e&65535,{parser:a}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),c=a.dynamicPrecedence(r);if(c&&(this.score+=c),n==0){this.pushState(a.getGoto(this.state,r,!0),this.reducePos),r<a.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let f=this.stack.length-(n-1)*3-(e&262144?6:0),d=f?this.stack[f-2]:this.p.ranges[0].from,m=this.reducePos-d;m>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=m):this.p.lastBigReductionSize<m&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=m));let y=f?this.stack[f-1]:0,b=this.bufferBase+this.buffer.length-y;if(r<a.minRepeatTerm||e&131072){let x=a.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,d,x,b+4,!0)}if(e&262144)this.state=this.stack[f];else{let x=this.stack[f-3];this.state=a.getGoto(x,r,!0)}for(;this.stack.length>f;)this.stack.pop();this.reduceContext(r,d)}storeNode(e,t,n,r=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,c=this.buffer.length;if(c==0&&o.parent&&(c=o.bufferBase-o.parent.bufferBase,o=o.parent),c>0&&o.buffer[c-4]==0&&o.buffer[c-1]>-1){if(t==n)return;if(o.buffer[c-2]>=t){o.buffer[c-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let c=!1;for(let f=o;f>0&&this.buffer[f-2]>n;f-=4)if(this.buffer[f-1]>=0){c=!0;break}if(c)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let a=e,{parser:o}=this.p;this.pos=r;let c=o.stateFlag(a,1);!c&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(a,c?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,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 n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new ih(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new i8(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if((n&65536)==0)return!0;t.reduce(n)}}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 r=[];for(let a=0,o;a<t.length;a+=2)(o=t[a+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(t[a],o);if(this.stack.length<120)for(let a=0;r.length<8&&a<t.length;a+=2){let o=t[a+1];r.some((c,f)=>f&1&&c==o)||r.push(t[a],o)}t=r}let n=[];for(let r=0;r<t.length&&n.length<4;r+=2){let a=t[r+1];if(a==this.state)continue;let o=this.split();o.pushState(a,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[r],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}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 n=t>>19,r=t&65535,a=this.stack.length-n*3;if(a<0||e.getGoto(this.stack[a],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}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=[],n=(r,a)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let c=(o>>19)-a;if(c>1){let f=o&65535,d=this.stack.length-c*3;if(d>=0&&e.getGoto(this.stack[d],f,!1)>=0)return c<<19|65536|f}}else{let c=n(o,a+1);if(c!=null)return c}})};return n(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 nS(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 nS{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class i8{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class nh{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new nh(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 nh(this.stack,this.pos,this.index)}}function cc(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n<i.length;){let a=0;for(;;){let o=i.charCodeAt(n++),c=!1;if(o==126){a=65535;break}o>=92&&o--,o>=34&&o--;let f=o-32;if(f>=46&&(f-=46,c=!0),a+=f,c)break;a*=46}t?t[r++]=a:t=new e(a)}return t}class wc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const sS=new wc;class n8{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=sS,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 n=this.range,r=this.rangeIndex,a=this.pos+e;for(;a<n.from;){if(!r)return null;let o=this.ranges[--r];a-=n.from-o.to,n=o}for(;t<0?a>n.to:a>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];a+=o.from-n.to,n=o}return a}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,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let a=this.resolveOffset(e,1);if(a==null)return-1;if(n=a,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,c=this.range;for(;c.to<=n;)c=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}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=sS,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 n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class hl{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;s8(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}hl.prototype.contextual=hl.prototype.fallback=hl.prototype.extend=!1;hl.prototype.fallback=hl.prototype.extend=!1;function s8(i,e,t,n,r,a){let o=0,c=1<<n,{dialect:f}=t.p.parser;e:for(;(c&i[o])!=0;){let d=i[o+1];for(let x=o+3;x<d;x+=2)if((i[x+1]&c)>0){let w=i[x];if(f.allows(w)&&(e.token.value==-1||e.token.value==w||r8(w,e.token.value,r,a))){e.acceptToken(w);break}}let m=e.next,y=0,b=i[o+2];if(e.next<0&&b>y&&i[d+b*3-3]==65535){o=i[d+b*3-1];continue e}for(;y<b;){let x=y+b>>1,w=d+x+(x<<1),k=i[w],C=i[w+1]||65536;if(m<k)b=x;else if(m>=C)y=x+1;else{o=i[w+2],e.advance();continue e}}break}}function rS(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function r8(i,e,t,n){let r=rS(t,n,e);return r<0||rS(t,n,i)<r}const yi=typeof process<"u"&&iS&&/\bparse\b/.test(iS.LOG);let Np=null;function lS(i,e,t){let n=i.cursor(lt.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}class l8{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?lS(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?lS(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 n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(a instanceof ft){if(o==e){if(o<this.safeFrom)return null;let c=o+a.length;if(c<=this.safeTo){let f=a.prop(Me.lookAhead);if(!f||c+f<this.fragment.to)return a}}this.index[t]++,o+a.length>=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+a.length}}}class a8{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new wc)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:a}=r,o=r.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,f=0;for(let d=0;d<a.length;d++){if((1<<d&o)==0)continue;let m=a[d],y=this.tokens[d];if(!(n&&!m.fallback)&&((m.contextual||y.start!=e.pos||y.mask!=o||y.context!=c)&&(this.updateCachedToken(y,m,e),y.mask=o,y.context=c),y.lookAhead>y.end+25&&(f=Math.max(y.lookAhead,f)),y.value!=0)){let b=t;if(y.extended>-1&&(t=this.addActions(e,y.extended,y.end,t)),t=this.addActions(e,y.value,y.end,t),!m.extend&&(n=y,t>b))break}}for(;this.actions.length>t;)this.actions.pop();return f&&e.setLookAhead(f),!n&&e.pos==this.stream.end&&(n=new wc,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new wc,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:a}=n.p;for(let o=0;o<a.specialized.length;o++)if(a.specialized[o]==e.value){let c=a.specializers[o](this.stream.read(e.start,e.end),n);if(c>=0&&n.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let a=0;a<r;a+=3)if(this.actions[a]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:a}=e,{parser:o}=e.p,{data:c}=o;for(let f=0;f<2;f++)for(let d=o.stateSlot(a,f?2:1);;d+=3){if(c[d]==65535)if(c[d+1]==1)d=Ln(c,d+2);else{r==0&&c[d+1]==2&&(r=this.putAction(Ln(c,d+2),t,n,r));break}c[d]==t&&(r=this.putAction(Ln(c,d+1),t,n,r))}return r}}class o8{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,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 n8(t,r),this.tokens=new a8(e,this.stream),this.topTerm=e.top[1];let{from:a}=r[0];this.stacks=[ih.start(this,e.top[0],a)],this.fragments=n.length&&this.stream.end-a>e.bufferLength*4?new l8(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,a;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let c=e[o];for(;;){if(this.tokens.mainToken=null,c.pos>t)n.push(c);else{if(this.advanceStack(c,n,e))continue;{r||(r=[],a=[]),r.push(c);let f=this.tokens.getMainToken(c);a.push(f.value,f.end)}}break}}if(!n.length){let o=r&&c8(r);if(o)return yi&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw yi&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,a,n);if(o)return yi&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((c,f)=>f.score-c.score);n.length>o;)n.pop();n.some(c=>c.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let c=n[o];for(let f=o+1;f<n.length;f++){let d=n[f];if(c.sameState(d)||c.buffer.length>500&&d.buffer.length>500)if((c.score-d.score||c.buffer.length-d.buffer.length)>0)n.splice(f--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,c)=>c.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].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,n){let r=e.pos,{parser:a}=this,o=yi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,m=d?e.curContext.hash:0;for(let y=this.fragments.nodeAt(r);y;){let b=this.parser.nodeSet.types[y.type.id]==y.type?a.getGoto(e.state,y.type.id):-1;if(b>-1&&y.length&&(!d||(y.prop(Me.contextHash)||0)==m))return e.useNode(y,b),yi&&console.log(o+this.stackID(e)+` (via reuse of ${a.getName(y.type.id)})`),!0;if(!(y instanceof ft)||y.children.length==0||y.positions[0]>0)break;let x=y.children[0];if(x instanceof ft&&y.positions[0]==0)y=x;else break}}let c=a.stateSlot(e.state,4);if(c>0)return e.reduce(c),yi&&console.log(o+this.stackID(e)+` (via always-reduce ${a.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let f=this.tokens.getActions(e);for(let d=0;d<f.length;){let m=f[d++],y=f[d++],b=f[d++],x=d==f.length||!n,w=x?e:e.split(),k=this.tokens.mainToken;if(w.apply(m,y,k?k.start:w.pos,b),yi&&console.log(o+this.stackID(w)+` (via ${(m&65536)==0?"shift":`reduce of ${a.getName(m&65535)}`} for ${a.getName(y)} @ ${r}${w==e?"":", split"})`),x)return!0;w.pos>r?t.push(w):n.push(w)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return aS(e,t),!0}}runRecovery(e,t,n){let r=null,a=!1;for(let o=0;o<e.length;o++){let c=e[o],f=t[o<<1],d=t[(o<<1)+1],m=yi?this.stackID(c)+" -> ":"";if(c.deadEnd&&(a||(a=!0,c.restart(),yi&&console.log(m+this.stackID(c)+" (restarted)"),this.advanceFully(c,n))))continue;let y=c.split(),b=m;for(let x=0;x<10&&y.forceReduce()&&(yi&&console.log(b+this.stackID(y)+" (via force-reduce)"),!this.advanceFully(y,n));x++)yi&&(b=this.stackID(y)+" -> ");for(let x of c.recoverByInsert(f))yi&&console.log(m+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,n);this.stream.end>c.pos?(d==c.pos&&(d++,f=0),c.recoverByDelete(f,d),yi&&console.log(m+this.stackID(c)+` (via recover-delete ${this.parser.getName(f)})`),aS(c,n)):(!r||r.score<y.score)&&(r=y)}return r}stackToTree(e){return e.close(),ft.build({buffer:nh.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=(Np||(Np=new WeakMap)).get(e);return t||Np.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function aS(i,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==i.pos&&n.sameState(i)){e[t].score<i.score&&(e[t]=i);return}}e.push(i)}class u8{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}class sh extends Nw{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 c=0;c<e.repeatNodeCount;c++)t.push("");let n=Object.keys(e.topRules).map(c=>e.topRules[c][1]),r=[];for(let c=0;c<t.length;c++)r.push([]);function a(c,f,d){r[c].push([f,f.deserialize(String(d))])}if(e.nodeProps)for(let c of e.nodeProps){let f=c[0];typeof f=="string"&&(f=Me[f]);for(let d=1;d<c.length;){let m=c[d++];if(m>=0)a(m,f,c[d++]);else{let y=c[d+-m];for(let b=-m;b>0;b--)a(c[d++],f,y);d++}}}this.nodeSet=new bg(t.map((c,f)=>ri.define({name:f>=this.minRepeatTerm?void 0:c,id:f,props:r[f],top:n.indexOf(f)>-1,error:f==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(f)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Mw;let o=cc(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(oS),this.states=cc(e.states,Uint32Array),this.data=cc(e.stateData),this.goto=cc(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new hl(o,c):c),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,n){let r=new o8(this,e,t,n);for(let a of this.wrappers)r=a(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let a=r[t+1];;){let o=r[a++],c=o&1,f=r[a++];if(c&&n)return f;for(let d=a+(o>>1);a<d;a++)if(r[a]==e)return f;if(c)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let a=this.stateSlot(e,r?2:1),o;;a+=3){if((o=n[a])==65535)if(n[a+1]==1)o=n[a=Ln(n,a+2)];else{if(n[a+1]==2)return Ln(n,a+2);break}if(o==t||o==0)return Ln(n,a+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,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let a=this.stateSlot(e,1);r==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=Ln(this.data,a+2);else break;r=t(Ln(this.data,a+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Ln(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];t.some((a,o)=>o&1&&a==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(sh.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(a=>a.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let a=e.specializers.find(c=>c.from==n.external);if(!a)return n;let o=Object.assign(Object.assign({},n),{external:a.to});return t.specializers[r]=oS(o),o})),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),n=t.map(()=>!1);if(e)for(let a of e.split(" ")){let o=t.indexOf(a);o>=0&&(n[o]=!0)}let r=null;for(let a=0;a<t.length;a++)if(!n[a])for(let o=this.dialects[t[a]],c;(c=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[c]=1;return new u8(e,n,r)}static deserialize(e){return new sh(e)}}function Ln(i,e){return i[e]|i[e+1]<<16}function c8(i){let e=null;for(let t of i){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function oS(i){if(i.external){let e=i.extend?1:0;return(t,n)=>i.external(t,n)<<1|e}return i.get}const h8=Rw({String:V.string,Number:V.number,"True False":V.bool,PropertyName:V.propertyName,Null:V.null,", :":V.separator,"[ ]":V.squareBracket,"{ }":V.brace}),f8=sh.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[h8],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),d8=Qc.define({name:"json",parser:f8.configure({props:[Lw.add({Object:bv({except:/^\s*\}/}),Array:bv({except:/^\s*\]/})}),Hw.add({"Object Array":b5})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function p8(){return new l5(d8)}const Rp=[200,201,204,400,401,403,404,500,502,503];function m8({mock:i,specResponses:e,onChange:t}){const[n,r]=E.useState(i.statusCode),[a,o]=E.useState(i.body),[c,f]=E.useState(Object.entries(i.headers).map(([x,w])=>`${x}: ${w}`).join(`
|
|
23
|
+
`)),[d,m]=E.useState(Rp.includes(i.statusCode)?"preset":"manual");E.useEffect(()=>{r(i.statusCode),o(i.body),f(Object.entries(i.headers).map(([x,w])=>`${x}: ${w}`).join(`
|
|
24
|
+
`)),Rp.includes(i.statusCode)||m("manual")},[i.statusCode,i.body,i.headers]);const y=E.useCallback(()=>{const x={};for(const w of c.split(`
|
|
25
|
+
`)){const k=w.indexOf(":");k>0&&(x[w.slice(0,k).trim()]=w.slice(k+1).trim())}t({statusCode:n,headers:x,body:a})},[n,c,a,t]),b=x=>{r(x.statusCode),m("manual");const w=x.headers||{"content-type":"application/json"};f(Object.entries(w).map(([k,C])=>`${k}: ${C}`).join(`
|
|
26
|
+
`)),o(x.body||""),t({statusCode:x.statusCode,headers:w,body:x.body||""})};return S.jsxs("div",{className:"flex flex-col gap-6 p-2 bg-background",children:[e&&e.length>0&&S.jsxs("div",{className:"space-y-3",children:[S.jsxs("label",{className:"flex items-center gap-2 text-[10px] font-black text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(QS,{className:"w-3.5 h-3.5 text-primary"}),"Spec Defined Responses"]}),S.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:e.map((x,w)=>S.jsxs("button",{onClick:()=>b(x),className:"flex items-start gap-3 p-3 text-left rounded-xl border border-border bg-card hover:border-primary/40 hover:bg-primary/5 transition-all group",children:[S.jsx("span",{className:Be("px-1.5 py-0.5 text-[10px] font-black font-mono rounded border shrink-0",x.statusCode<300?"text-emerald-400 border-emerald-400/30":x.statusCode<500?"text-amber-400 border-amber-400/30":"text-rose-400 border-rose-400/30"),children:x.statusCode}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-[11px] font-bold text-foreground truncate group-hover:text-primary transition-colors",children:x.name}),x.description&&x.description!==x.name&&S.jsx("p",{className:"text-[9px] text-muted-foreground line-clamp-1 mt-0.5",children:x.description})]})]},w))})]}),S.jsxs("div",{className:"space-y-3",children:[S.jsxs("label",{className:"flex items-center gap-2 text-[10px] font-black text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(Oc,{className:"w-3.5 h-3.5"}),"Status Code"]}),S.jsxs("div",{className:"flex flex-wrap gap-2",children:[Rp.map(x=>S.jsx("button",{onClick:()=>{r(x),m("preset");const w={};for(const k of c.split(`
|
|
27
|
+
`)){const C=k.indexOf(":");C>0&&(w[k.slice(0,C).trim()]=k.slice(C+1).trim())}t({statusCode:x,headers:w,body:a})},className:Be("px-2.5 py-1.5 text-xs font-mono font-bold rounded-lg border transition-colors duration-75",d==="preset"&&n===x?"bg-mode-mock/20 border-mode-mock text-mode-mock shadow-sm":"bg-muted border-border text-muted-foreground hover:border-mode-mock/40 hover:text-foreground"),children:x},x)),S.jsx("input",{type:"number",value:n,onChange:x=>{r(Number(x.target.value)),m("manual")},onFocus:()=>m("manual"),onBlur:y,className:Be("w-16 px-2.5 py-1.5 text-xs font-mono font-bold bg-background border rounded-lg focus:ring-1 focus:ring-mode-mock focus:border-mode-mock outline-none transition-colors duration-75",d==="manual"?"bg-mode-mock/20 border-mode-mock text-mode-mock shadow-sm":"border-border text-muted-foreground hover:border-mode-mock/20")})]})]}),S.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[S.jsxs("div",{className:"space-y-3",children:[S.jsxs("label",{className:"flex items-center gap-2 text-[10px] font-black text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(Ec,{className:"w-3.5 h-3.5"}),"Headers"]}),S.jsx("textarea",{value:c,onChange:x=>f(x.target.value),onBlur:y,rows:6,className:"w-full text-[11px] font-mono rounded-xl border border-border bg-background px-4 py-3 focus:outline-none focus:ring-1 focus:ring-mode-mock resize-none shadow-inner leading-relaxed",placeholder:"content-type: application/json"})]}),S.jsxs("div",{className:"space-y-3",children:[S.jsxs("label",{className:"flex items-center gap-2 text-[10px] font-black text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(Mc,{className:"w-3.5 h-3.5"}),"Body"]}),S.jsx("div",{className:"rounded-xl border border-border bg-background overflow-hidden shadow-inner focus-within:ring-1 focus-within:ring-mode-mock",children:S.jsx(Jk,{value:a,onChange:o,onBlur:y,extensions:[p8()],height:"150px",theme:"dark",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0},className:"text-[11px] font-mono"})})]})]})]})}const g8={passthrough:"border-mode-passthrough/20",delay:"border-mode-delay/20",mock:"border-mode-mock/20"},y8={passthrough:"bg-mode-passthrough",delay:"bg-mode-delay",mock:"bg-mode-mock"};function b8({endpoint:i,specName:e,showSpecBadge:t}){const[n,r]=E.useState(!1),a=kE(),o=c=>{const f={mode:c};c==="delay"&&!i.delay&&(f.delay={ms:1e3}),c==="mock"&&!i.mock&&(f.mock={statusCode:200,headers:{"content-type":"application/json"},body:"{}"}),a.mutate({id:i.id,config:f}),c!=="passthrough"&&r(!0)};return S.jsxs("div",{className:Be("group relative border sm:rounded-xl card-slab overflow-hidden mb-1 shadow-sm",g8[i.mode]),children:[S.jsx("div",{className:Be("absolute left-0 top-0 bottom-0 w-[2px] transition-all duration-75",y8[i.mode])}),S.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 cursor-pointer select-none hover:bg-primary/5 transition-colors duration-75",onClick:()=>r(!n),children:[S.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[S.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[S.jsx("button",{className:"text-muted-foreground/40 group-hover:text-primary transition-colors duration-75",children:n?S.jsx(ho,{className:"w-4 h-4"}):S.jsx(US,{className:"w-4 h-4"})}),S.jsx(Jm,{method:i.method})]}),S.jsxs("div",{className:"flex flex-col min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-sm font-black font-mono tracking-tight text-foreground/90 truncate",children:i.path}),t&&e&&S.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-black uppercase tracking-widest rounded-[4px] bg-accent text-accent-foreground border border-border",children:e})]}),i.summary&&S.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-medium truncate mt-0.5",children:i.summary})]})]}),S.jsxs("div",{className:"flex items-center gap-4 shrink-0",onClick:c=>c.stopPropagation(),children:[S.jsxs("div",{className:"flex items-center gap-2",children:[i.mode==="delay"&&i.delay&&S.jsxs("span",{className:"px-2 py-0.5 text-[10px] font-black font-mono rounded bg-mode-delay/10 text-mode-delay border border-mode-delay/20 shadow-sm",children:[i.delay.ms,"ms"]}),i.mode==="mock"&&i.mock&&S.jsx("span",{className:Be("px-2 py-0.5 text-[10px] font-black font-mono rounded border shadow-sm",i.mock.statusCode<300?"bg-emerald-400/10 text-emerald-400 border-emerald-400/20":i.mock.statusCode<500?"bg-amber-400/10 text-amber-400 border-amber-400/20":"bg-rose-400/10 text-rose-400 border-rose-400/20"),children:i.mock.statusCode})]}),S.jsx(ME,{value:i.mode,onChange:o})]})]}),n&&S.jsx("div",{className:Be("px-5 pb-5 pt-0","border-t border-border/20 mx-4"),children:S.jsxs("div",{className:"pt-5 space-y-4",children:[i.mode==="delay"&&S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-bold text-mode-delay uppercase tracking-widest px-1",children:[S.jsx(Oc,{className:"w-3 h-3"}),"Configuration"]}),S.jsx("div",{className:"bg-muted rounded-xl p-4 border border-border",children:S.jsx(TE,{delay:i.delay??{ms:1e3},onChange:c=>a.mutate({id:i.id,config:{delay:c}})})})]}),i.mode==="mock"&&S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-bold text-mode-mock uppercase tracking-widest px-1",children:[S.jsx(Oc,{className:"w-3 h-3"}),"Mock Response"]}),S.jsx("div",{className:"bg-muted rounded-xl border border-border overflow-hidden",children:S.jsx(m8,{mock:i.mock??{statusCode:200,headers:{},body:"{}"},specResponses:i.responses,onChange:c=>a.mutate({id:i.id,config:{mock:c}})})})]}),i.mode==="passthrough"&&S.jsxs("div",{className:"flex flex-col items-center justify-center py-6 text-center space-y-2",children:[S.jsx("div",{className:"w-10 h-10 rounded-full bg-mode-passthrough/5 flex items-center justify-center border border-border",children:S.jsx(Vp,{className:"w-5 h-5 text-mode-passthrough opacity-40"})}),S.jsxs("div",{className:"max-w-[300px]",children:[S.jsx("p",{className:"text-xs font-semibold text-foreground/80",children:"Passthrough Mode Active"}),S.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed mt-1",children:"Requests will be forwarded directly to the upstream server without modification."})]})]})]})})]})}function x8(){const{data:i,isLoading:e}=t2(),{data:t,isLoading:n}=JS(),r=i2(),[a,o]=E.useState(""),[c,f]=E.useState(new Set),d=E.useMemo(()=>{const k=new Map;for(const C of t??[])k.set(C.id,C);return k},[t]),m=E.useMemo(()=>new Set(t?.filter(k=>k.active).map(k=>k.id)??[]),[t]),y=E.useMemo(()=>{if(!i)return new Map;let k=i.filter(M=>m.has(M.specId));if(a){const M=a.toLowerCase();k=k.filter(R=>R.path.toLowerCase().includes(M)||R.method.toLowerCase().includes(M)||R.operationId?.toLowerCase().includes(M)||R.summary?.toLowerCase().includes(M))}const C=new Map;for(const M of k){const R=M.tags[0]??"Untagged";C.has(R)||C.set(R,[]),C.get(R).push(M)}return C},[i,a,m]),b=k=>{f(C=>{const M=new Set(C);return M.has(k)?M.delete(k):M.add(k),M})},x=(k,C)=>{const M={};k.forEach(R=>{const D={mode:C};C==="delay"&&!R.delay&&(D.delay={ms:1e3}),C==="mock"&&!R.mock&&(D.mock={statusCode:200,headers:{"content-type":"application/json"},body:"{}"}),M[R.id]=D}),r.mutate(M)};return e||n?S.jsxs("div",{className:"flex flex-col items-center justify-center h-80 gap-4",children:[S.jsx(Nc,{className:"w-10 h-10 animate-spin text-primary/40"}),S.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground/60",children:"Indexing endpoints..."})]}):!i?.length||m.size===0?S.jsxs("div",{className:"flex flex-col items-center justify-center h-80 text-center space-y-4 px-6",children:[S.jsx("div",{className:"w-16 h-16 rounded-3xl bg-muted border border-border/40 flex items-center justify-center text-muted-foreground opacity-20",children:S.jsx(Oc,{className:"w-8 h-8"})}),S.jsxs("div",{className:"max-w-xs",children:[S.jsx("h3",{className:"text-sm font-black text-foreground uppercase tracking-tight",children:m.size===0?"No Active Specifications":"No endpoints detected"}),S.jsx("p",{className:"text-[11px] text-muted-foreground font-medium mt-1 leading-relaxed",children:m.size===0?"Select or import a specification from the header to begin.":"Import an OpenAPI specification to automatically populate your workspace."})]})]}):S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{className:"relative group",children:[S.jsx(y3,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/40 group-focus-within:text-primary transition-colors"}),S.jsx("input",{type:"text",placeholder:"Search by path, method, or operation...",value:a,onChange:k=>o(k.target.value),className:"w-full pl-10 pr-4 py-2.5 text-sm font-bold rounded-xl border border-border/60 bg-card/30 backdrop-blur-sm placeholder:text-muted-foreground/40 focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary/40 shadow-sm transition-all"})]}),S.jsxs("div",{className:"space-y-8",children:[Array.from(y.entries()).map(([k,C])=>{const M=c.has(k);return S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"flex items-center gap-3 w-full",children:[S.jsxs("button",{onClick:()=>b(k),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-muted/40 border border-border/20 text-muted-foreground hover:text-foreground hover:bg-muted/60 hover:border-border/40 transition-all shrink-0",children:[M?S.jsx(US,{className:"w-3.5 h-3.5"}):S.jsx(ho,{className:"w-3.5 h-3.5"}),S.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:k}),S.jsxs("span",{className:"text-[10px] font-black opacity-40 tabular-nums",children:["(",C.length,")"]})]}),S.jsxs("div",{className:"flex items-center gap-1 bg-muted/20 p-0.5 rounded-lg border border-border/10 shrink-0",children:[S.jsx("button",{onClick:()=>x(C,"passthrough"),className:"px-2 py-1 text-[9px] font-black uppercase tracking-tighter text-muted-foreground/60 hover:text-mode-passthrough hover:bg-mode-passthrough/10 rounded-md transition-all",title:"Pass all in group",children:"Pass"}),S.jsx("button",{onClick:()=>x(C,"delay"),className:"px-2 py-1 text-[9px] font-black uppercase tracking-tighter text-muted-foreground/60 hover:text-mode-delay hover:bg-mode-delay/10 rounded-md transition-all",title:"Delay all in group",children:"Delay"}),S.jsx("button",{onClick:()=>x(C,"mock"),className:"px-2 py-1 text-[9px] font-black uppercase tracking-tighter text-muted-foreground/60 hover:text-mode-mock hover:bg-mode-mock/10 rounded-md transition-all",title:"Mock all in group",children:"Mock"})]}),S.jsx("div",{className:"h-px flex-1 bg-border/20 opacity-40 group-hover:opacity-100 group-hover:bg-primary/20 transition-all"})]}),!M&&S.jsx("div",{className:"grid grid-cols-1 gap-1 px-1",children:C.map(R=>S.jsx(b8,{endpoint:R,specName:d.get(R.specId)?.name,showSpecBadge:m.size>1},R.id))})]},k)}),y.size===0&&a&&S.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center space-y-3",children:[S.jsx(PS,{className:"w-10 h-10 text-muted-foreground opacity-20"}),S.jsxs("div",{className:"max-w-[240px]",children:[S.jsx("p",{className:"text-sm font-bold text-foreground/80",children:"No results found"}),S.jsxs("p",{className:"text-[11px] text-muted-foreground font-medium mt-1 leading-relaxed",children:['The search term "',a,'" did not match any active endpoints.']})]})]})]})]})}function v8(){return ks({queryKey:["presets"],queryFn:Pe.presets.list})}function S8(){const i=dt();return Tt({mutationFn:e=>Pe.presets.create(e),onSuccess:()=>{i.invalidateQueries({queryKey:["presets"]})}})}function w8(){const i=dt();return Tt({mutationFn:Pe.presets.delete,onSuccess:()=>{i.invalidateQueries({queryKey:["presets"]})}})}function k8(){const i=dt();return Tt({mutationFn:Pe.presets.apply,onSuccess:()=>{i.invalidateQueries({queryKey:["endpoints"]})}})}const $k=[{name:"Slow",icon:C3,match:i=>i.length>0&&i.every(e=>e.mode==="delay"&&e.delay?.ms===2e3),apply:i=>{const e={};for(const t of i)e[t.id]={mode:"delay",delay:{ms:2e3}};return e}},{name:"Errors",icon:w3,match:i=>i.length>0&&i.every(e=>e.mode==="mock"&&e.mock?.statusCode===500),apply:i=>{const e={};for(const t of i)e[t.id]={mode:"mock",mock:{statusCode:500,headers:{"content-type":"application/json"},body:'{"error":"Internal Server Error"}'}};return e}},{name:"Pass All",icon:Xm,match:i=>i.length>0&&i.every(e=>e.mode==="passthrough"),apply:i=>{const e={};for(const t of i)e[t.id]={mode:"passthrough"};return e}}];function C8(i,e){for(const[t,n]of Object.entries(e.endpoints)){const r=i.find(a=>a.id===t);if(!r||n.mode!==void 0&&r.mode!==n.mode||n.mode==="delay"&&n.delay&&r.delay?.ms!==n.delay.ms||n.mode==="mock"&&n.mock&&(r.mock?.statusCode!==n.mock.statusCode||r.mock?.body!==n.mock.body))return!1}return!0}function A8(i,e){if(!i?.length)return null;for(const t of $k)if(t.match(i))return`builtin:${t.name}`;if(e){for(const t of e)if(C8(i,t))return`saved:${t.name}`}return null}function M8(){const{data:i}=v8(),{data:e}=t2(),t=S8(),n=w8(),r=k8(),a=i2(),o=E.useMemo(()=>A8(e,i),[e,i]),[c,f]=E.useState(!1),[d,m]=E.useState(!1),[y,b]=E.useState(""),x=E.useRef(null);E.useEffect(()=>{function C(M){x.current&&!x.current.contains(M.target)&&f(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const w=!!e?.length,k=()=>{if(!y.trim()||!e)return;const C={};for(const M of e)C[M.id]={mode:M.mode,delay:M.delay,mock:M.mock};t.mutate({name:y.trim(),endpoints:C},{onSuccess:()=>{b(""),m(!1)}})};return w?S.jsxs("div",{className:"bg-card/30 backdrop-blur-sm border border-border/40 rounded-xl p-1 flex items-center gap-1 shadow-sm",children:[S.jsxs("div",{className:"flex items-center gap-1 bg-muted/40 rounded-lg p-0.5 border border-border/20 shadow-inner",children:[S.jsx("div",{className:"px-2 text-[9px] font-black text-muted-foreground uppercase tracking-widest hidden lg:block",children:"Presets"}),$k.map(({name:C,icon:M,apply:R})=>{const D=o===`builtin:${C}`;return S.jsxs("button",{onClick:()=>{e&&a.mutate(R(e))},className:Be("inline-flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-black uppercase tracking-wider rounded-md border transition-colors duration-75",D?"bg-primary/20 border-primary/30 text-primary shadow-sm":"border-transparent text-muted-foreground hover:text-foreground hover:bg-white/5"),children:[S.jsx(M,{className:Be("w-3.5 h-3.5")}),S.jsx("span",{className:"hidden sm:inline",children:C}),D&&S.jsx(Tc,{className:"w-3 h-3 ml-0.5"})]},C)})]}),S.jsx("div",{className:"h-6 w-px bg-border/40 mx-1 shrink-0"}),i&&i.length>0&&S.jsxs("div",{className:"relative",ref:x,children:[S.jsxs("button",{onClick:()=>f(!c),className:Be("inline-flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-black uppercase tracking-wider rounded-lg border transition-colors duration-75",c||o&&o.startsWith("saved:")?"bg-primary/20 border-primary/30 text-primary shadow-sm":"border-border/40 text-muted-foreground hover:bg-accent/40 hover:text-foreground"),children:[S.jsx(QS,{className:"w-3.5 h-3.5"}),S.jsxs("span",{className:"hidden sm:inline",children:["Saved (",i.length,")"]}),S.jsx(ho,{className:Be("w-3 h-3 text-muted-foreground transition-transform duration-75",c&&"rotate-180")})]}),c&&S.jsxs("div",{className:"absolute right-0 top-full mt-2 z-[100] bg-popover border border-border shadow-2xl rounded-xl py-1.5 min-w-[240px]",children:[S.jsx("div",{className:"px-3 py-1 mb-1 border-b border-border/40",children:S.jsx("span",{className:"text-[9px] font-black text-muted-foreground/60 uppercase tracking-widest",children:"Saved Configurations"})}),S.jsx("div",{className:"max-h-[300px] overflow-y-auto px-1.5 ",children:i.map(C=>{const M=o===`saved:${C.name}`;return S.jsxs("div",{className:Be("group flex items-center gap-3 px-3 py-2 text-xs rounded-lg transition-colors duration-75 mb-0.5 border border-transparent",M?"bg-primary/10 border-primary/20 text-primary font-bold shadow-sm":"hover:bg-accent/50 text-muted-foreground hover:text-foreground"),children:[S.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer py-0.5",onClick:()=>r.mutate(C.name,{onSuccess:()=>f(!1)}),children:[S.jsx("p",{className:"font-bold truncate",children:C.name}),S.jsxs("p",{className:"text-[9px] opacity-60 font-medium",children:[Object.keys(C.endpoints).length," endpoints"]})]}),S.jsx("div",{className:"flex items-center gap-1 shrink-0",children:S.jsx("button",{onClick:R=>{R.stopPropagation(),n.mutate(C.name)},className:"p-1.5 text-muted-foreground hover:text-rose-500 hover:bg-rose-500/10 rounded-md transition-colors duration-75 opacity-0 group-hover:opacity-100",title:"Delete",children:S.jsx(Ga,{className:"w-3.5 h-3.5"})})})]},C.name)})})]})]}),d?S.jsxs("div",{className:"flex items-center gap-1.5 bg-accent/20 rounded-lg p-0.5 border border-primary/20 shadow-inner ml-auto",children:[S.jsx("input",{autoFocus:!0,type:"text",value:y,onChange:C=>b(C.target.value),placeholder:"Name...",onKeyDown:C=>{C.key==="Enter"&&k(),C.key==="Escape"&&(m(!1),b(""))},className:"w-28 sm:w-40 px-3 py-1.5 text-[10px] font-bold rounded-md border border-border/40 bg-background/50 focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary/50 transition-colors duration-75"}),S.jsx("button",{onClick:k,disabled:!y.trim(),className:"px-3 py-1.5 text-[10px] font-black uppercase tracking-wider rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors duration-75 shadow-sm",children:"Save"}),S.jsx("button",{onClick:()=>{m(!1),b("")},className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-white/5 rounded-md transition-colors duration-75",children:S.jsx(Fa,{className:"w-3.5 h-3.5"})})]}):S.jsxs("button",{onClick:()=>m(!0),disabled:o!==null,className:Be("ml-auto inline-flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-black uppercase tracking-wider rounded-lg border border-dashed transition-colors duration-75",o!==null?"border-border/20 text-muted-foreground/20 cursor-not-allowed":"border-border/40 text-muted-foreground hover:border-primary/40 hover:text-primary hover:bg-primary/5 shadow-sm"),children:[S.jsx(g3,{className:"w-3.5 h-3.5"}),S.jsx("span",{className:"hidden sm:inline",children:"Save"})]})]}):null}function T8(){const[i,e]=E.useState([]),[t,n]=E.useState(!1),[r,a]=E.useState(!1),o=E.useRef(null),c=dt();E.useEffect(()=>{Pe.logs.get(500).then(({entries:d})=>{e(m=>{const y=new Set(m.map(x=>x.id)),b=[...m];for(const x of d)y.has(x.id)||b.push(x);return b.slice(0,500)}),a(!0)})},[]),E.useEffect(()=>{const d=new EventSource("/api/logs/stream");return o.current=d,d.addEventListener("connected",()=>n(!0)),d.addEventListener("log",m=>{const y=JSON.parse(m.data);e(b=>[y,...b].slice(0,500))}),d.onerror=()=>n(!1),()=>{d.close(),o.current=null}},[]);const f=E.useCallback(()=>{e([]),Pe.logs.clear().then(()=>{c.invalidateQueries({queryKey:["logs"]})})},[c]);return{entries:i,connected:t,clear:f,loaded:r}}function eC({status:i}){const e=i<300?"text-emerald-400 bg-emerald-400/10 border-emerald-400/20 shadow-[0_0_8px_-2px_rgba(var(--color-success),0.2)]":i<400?"text-blue-400 bg-blue-400/10 border-blue-400/20 shadow-[0_0_8px_-2px_rgba(var(--color-primary),0.2)]":i<500?"text-amber-400 bg-amber-400/10 border-amber-400/20 shadow-[0_0_8px_-2px_rgba(var(--color-warning),0.2)]":"text-rose-400 bg-rose-400/10 border-rose-400/20 shadow-[0_0_8px_-2px_rgba(var(--color-destructive),0.2)]";return S.jsx("span",{className:Be("inline-flex items-center justify-center px-1.5 py-0.5 text-[10px] font-black font-mono rounded border uppercase tracking-wider min-w-[32px] transition-all",e),children:i})}function O8({entry:i,onClose:e}){return S.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[S.jsx("div",{className:"absolute inset-0 bg-background/60",onClick:e}),S.jsxs("div",{className:"relative w-full max-w-xl bg-card border-l border-border shadow-2xl h-full flex flex-col",onClick:t=>t.stopPropagation(),children:[S.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-border bg-muted",children:[S.jsxs("div",{className:"flex flex-col gap-2 min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Jm,{method:i.method}),S.jsx(eC,{status:i.statusCode}),S.jsx("span",{className:"text-[10px] font-black text-muted-foreground uppercase tracking-widest ml-2",children:i.mode})]}),S.jsx("h2",{className:"text-sm font-black font-mono text-foreground truncate break-all",children:i.path})]}),S.jsx("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:S.jsx("button",{onClick:e,className:"p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-colors duration-75",children:S.jsx(Fa,{className:"w-5 h-5"})})})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-8",children:[S.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[S.jsxs("div",{className:"bg-muted rounded-xl p-3 border border-border",children:[S.jsxs("div",{className:"flex items-center gap-1.5 text-[9px] font-black text-muted-foreground uppercase tracking-widest mb-1",children:[S.jsx(fl,{className:"w-3 h-3"})," Latency"]}),S.jsxs("div",{className:"text-sm font-black font-mono text-primary",children:[i.latencyMs,S.jsx("span",{className:"text-[10px] ml-0.5 opacity-60",children:"ms"})]})]}),S.jsxs("div",{className:"bg-muted rounded-xl p-3 border border-border",children:[S.jsxs("div",{className:"flex items-center gap-1.5 text-[9px] font-black text-muted-foreground uppercase tracking-widest mb-1",children:[S.jsx(Xm,{className:"w-3 h-3"})," Status"]}),S.jsx("div",{className:"text-sm font-black font-mono text-foreground",children:i.statusCode})]}),S.jsxs("div",{className:"bg-muted rounded-xl p-3 border border-border",children:[S.jsxs("div",{className:"flex items-center gap-1.5 text-[9px] font-black text-muted-foreground uppercase tracking-widest mb-1",children:[S.jsx(fl,{className:"w-3 h-3"})," Timestamp"]}),S.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:new Date(i.timestamp).toLocaleTimeString()})]})]}),S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Pp,{className:"w-4 h-4 text-primary"}),S.jsx("h3",{className:"text-xs font-black uppercase tracking-widest text-foreground/80",children:"Request Details"})]}),i.requestHeaders&&S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-bold text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(Ec,{className:"w-3 h-3"})," Headers"]}),S.jsx("pre",{className:"text-[11px] font-mono font-medium bg-muted border border-border rounded-xl p-4 overflow-auto max-h-48 shadow-inner leading-relaxed",children:Object.entries(i.requestHeaders).map(([t,n])=>`${t}: ${n}`).join(`
|
|
28
|
+
`)})]})]}),S.jsxs("div",{className:"space-y-4 border-t border-border pt-8",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Pp,{className:"w-4 h-4 text-success rotate-180"}),S.jsx("h3",{className:"text-xs font-black uppercase tracking-widest text-foreground/80",children:"Response Details"})]}),i.responseHeaders&&S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-bold text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(Ec,{className:"w-3 h-3"})," Headers"]}),S.jsx("pre",{className:"text-[11px] font-mono font-medium bg-muted border border-border rounded-xl p-4 overflow-auto max-h-48 shadow-inner leading-relaxed",children:Object.entries(i.responseHeaders).map(([t,n])=>`${t}: ${n}`).join(`
|
|
29
|
+
`)})]}),i.responseBody&&S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-bold text-muted-foreground uppercase tracking-widest px-1",children:[S.jsx(Mc,{className:"w-3 h-3"})," Body"]}),S.jsx("div",{className:"rounded-xl border border-border bg-muted overflow-hidden shadow-inner",children:S.jsx("pre",{className:"text-[11px] font-mono font-medium p-4 overflow-auto max-h-80 leading-relaxed text-foreground/90",children:E8(i.responseBody)})})]})]})]}),S.jsx("div",{className:"p-4 border-t border-border bg-muted flex justify-end gap-3 px-6",children:S.jsx("button",{onClick:e,className:"px-6 py-2 text-xs font-black uppercase tracking-widest bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors duration-75 shadow-sm",children:"Dismiss"})})]})]})}function E8(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function N8({isCompact:i}){const{entries:e,connected:t,clear:n,loaded:r}=T8(),[a,o]=E.useState(null),[c,f]=E.useState(""),[d,m]=E.useState(""),[y,b]=E.useState(""),x=E.useMemo(()=>e.filter(k=>!(c&&k.method!==c||d==="2xx"&&(k.statusCode<200||k.statusCode>=300)||d==="4xx"&&(k.statusCode<400||k.statusCode>=500)||d==="5xx"&&k.statusCode<500||y&&k.mode!==y)),[e,c,d,y]),w={mock:"bg-mode-mock/20 text-mode-mock border-mode-mock/20",delay:"bg-mode-delay/20 text-mode-delay border-mode-delay/20",passthrough:"bg-mode-passthrough/20 text-mode-passthrough border-mode-passthrough/20"};return S.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[!i&&S.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border/40 bg-card",children:[S.jsx("div",{className:"flex items-center gap-6",children:S.jsxs("div",{className:"flex items-center gap-2.5",children:[S.jsx("div",{className:"relative",children:S.jsx(p3,{className:Be("w-4 h-4",t?"text-success":"text-destructive")})}),S.jsxs("div",{className:"flex flex-col",children:[S.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest leading-none mb-0.5",children:"Stream"}),S.jsxs("span",{className:"text-[11px] font-bold text-muted-foreground leading-none",children:[t?"Real-time":"Offline"," · ",e.length," entries"]})]})]})}),S.jsx("button",{onClick:n,className:"p-2 text-muted-foreground/60 hover:text-destructive hover:bg-destructive/10 rounded-lg transition-colors duration-75",title:"Clear logs",children:S.jsx(Ga,{className:"w-4 h-4"})})]}),S.jsxs("div",{className:"px-4 py-2 flex items-center justify-between bg-muted border-b border-border/20",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-lg bg-background border border-border/20",children:[S.jsx(a3,{className:"w-3 h-3 text-muted-foreground/60"}),S.jsxs("select",{value:c,onChange:k=>f(k.target.value),className:"text-[10px] font-black uppercase tracking-wide bg-transparent outline-none cursor-pointer text-muted-foreground hover:text-foreground transition-colors duration-75",children:[S.jsx("option",{value:"",children:"Method"}),["GET","POST","PUT","PATCH","DELETE"].map(k=>S.jsx("option",{value:k,children:k},k))]})]}),S.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-lg bg-background border border-border/20",children:[S.jsx(qp,{className:"w-3 h-3 text-muted-foreground/60"}),S.jsxs("select",{value:d,onChange:k=>m(k.target.value),className:"text-[10px] font-black uppercase tracking-wide bg-transparent outline-none cursor-pointer text-muted-foreground hover:text-foreground transition-colors duration-75",children:[S.jsx("option",{value:"",children:"Status"}),S.jsx("option",{value:"2xx",children:"2xx"}),S.jsx("option",{value:"4xx",children:"4xx"}),S.jsx("option",{value:"5xx",children:"5xx"})]})]}),S.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-lg bg-background border border-border/20",children:[S.jsx(fl,{className:"w-3 h-3 text-muted-foreground/60"}),S.jsxs("select",{value:y,onChange:k=>b(k.target.value),className:"text-[10px] font-black uppercase tracking-wide bg-transparent outline-none cursor-pointer text-muted-foreground hover:text-foreground transition-colors duration-75",children:[S.jsx("option",{value:"",children:"Mode"}),S.jsx("option",{value:"passthrough",children:"Pass"}),S.jsx("option",{value:"delay",children:"Delay"}),S.jsx("option",{value:"mock",children:"Mock"})]})]})]}),i&&S.jsx("button",{onClick:n,className:"p-1.5 text-muted-foreground/40 hover:text-destructive hover:bg-destructive/5 rounded-md transition-colors duration-75",title:"Clear logs",children:S.jsx(Ga,{className:"w-3.5 h-3.5"})})]}),S.jsx("div",{className:"flex-1 overflow-y-auto relative bg-background",children:S.jsxs("div",{className:"min-w-full",children:[!i&&S.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-muted border-b border-border/20 sticky top-0 z-10",children:[S.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-muted-foreground/60 w-20 shrink-0",children:"Time"}),S.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-muted-foreground/60 w-[52px] shrink-0",children:"Method"}),S.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-muted-foreground/60 flex-1",children:"Request Path"}),S.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-muted-foreground/60 w-16 text-center",children:"Status"}),S.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-muted-foreground/60 w-16 text-right",children:"Latency"}),S.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-muted-foreground/60 w-20 text-center",children:"Mode"})]}),S.jsx("div",{className:"divide-y divide-border/20",children:x.length===0?S.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center space-y-3",children:[r?S.jsx(qp,{className:"w-12 h-12 text-muted-foreground/10"}):S.jsx(Nc,{className:"w-8 h-8 animate-spin text-primary opacity-40"}),S.jsx("div",{className:"max-w-[200px]",children:S.jsx("p",{className:"text-sm font-bold text-foreground/80",children:e.length===0?"No Traffic Recorded":"No Matches"})})]}):x.slice(0,200).map(k=>S.jsxs("button",{onClick:()=>o(k),className:Be("flex flex-col gap-2 px-4 py-3 w-full text-left transition-colors duration-75 group border-b border-border/10",a?.id===k.id?"bg-primary/5 shadow-inner":"hover:bg-accent/30"),children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Jm,{method:k.method}),S.jsx("span",{className:"text-[10px] text-muted-foreground/60 font-mono font-bold tabular-nums",children:new Date(k.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("div",{className:"flex items-center gap-1 shrink-0 font-mono text-[9px] font-bold text-muted-foreground opacity-60",children:[S.jsx(fl,{className:"w-2.5 h-2.5 opacity-40"}),S.jsxs("span",{className:"tabular-nums",children:[k.latencyMs,"ms"]})]}),S.jsx(eC,{status:k.statusCode})]})]}),S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("span",{className:"text-xs font-mono font-bold truncate text-foreground/90 group-hover:text-primary transition-colors duration-75 flex-1",children:k.path}),S.jsx("span",{className:Be("text-[8px] font-black uppercase tracking-[0.1em] px-1.5 py-0.5 rounded border leading-none",w[k.mode]),children:k.mode})]})]},k.id))})]})}),a&&S.jsx(O8,{entry:a,onClose:()=>o(null)})]})}function R8(){return S.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[S.jsxs("div",{className:"flex-1 flex flex-col min-w-0 border-r border-border/60 bg-background",children:[S.jsxs("div",{className:"px-6 py-4 flex items-center justify-between border-b border-border/60 bg-muted/30 shrink-0",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center border border-primary/20 text-primary",children:S.jsx(Ec,{className:"w-4 h-4"})}),S.jsx("h2",{className:"text-sm font-black uppercase tracking-widest text-foreground",children:"Endpoints Registry"})]}),S.jsx(M8,{})]}),S.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:S.jsx("div",{className:"max-w-5xl mx-auto space-y-6",children:S.jsx(x8,{})})})]}),S.jsxs("div",{className:"w-[400px] lg:w-[450px] xl:w-[500px] hidden lg:flex flex-col bg-muted/5 shrink-0",children:[S.jsxs("div",{className:"px-5 py-4 flex items-center gap-3 border-b border-border/60 bg-muted/30 shrink-0",children:[S.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center border border-primary/20 text-primary",children:S.jsx(qp,{className:"w-4 h-4"})}),S.jsx("h2",{className:"text-sm font-black uppercase tracking-widest text-foreground",children:"Traffic Monitor"})]}),S.jsx("div",{className:"flex-1 overflow-hidden",children:S.jsx(N8,{isCompact:!0})})]})]})}const D8=new HO({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function j8(){return S.jsx(_O,{client:D8,children:S.jsx(sO,{children:S.jsx(BT,{children:S.jsxs(hc,{element:S.jsx(wE,{}),children:[S.jsx(hc,{path:"/",element:S.jsx(R8,{})}),S.jsx(hc,{path:"*",element:S.jsx(RT,{to:"/",replace:!0})})]})})})})}jM.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(j8,{})}));
|