@hyperframes/studio 0.1.10 → 0.1.12
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/dist/assets/index-BEwJNmPo.js +92 -0
- package/dist/assets/index-BnvciBdD.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +10 -4
- package/src/App.tsx +744 -271
- package/src/components/editor/FileTree.tsx +186 -32
- package/src/components/editor/SourceEditor.tsx +3 -1
- package/src/components/nle/NLELayout.tsx +125 -23
- package/src/components/renders/RenderQueue.tsx +123 -0
- package/src/components/renders/RenderQueueItem.tsx +137 -0
- package/src/components/renders/useRenderQueue.ts +193 -0
- package/src/components/sidebar/AssetsTab.tsx +360 -0
- package/src/components/sidebar/CompositionsTab.tsx +227 -0
- package/src/components/sidebar/LeftSidebar.tsx +102 -0
- package/src/components/ui/ExpandOnHover.tsx +194 -0
- package/src/hooks/useCodeEditor.ts +1 -1
- package/src/hooks/useElementPicker.ts +5 -1
- package/src/index.ts +10 -2
- package/src/player/components/AudioWaveform.tsx +168 -0
- package/src/player/components/CompositionThumbnail.tsx +140 -0
- package/src/player/components/EditModal.tsx +165 -0
- package/src/player/components/Player.tsx +6 -5
- package/src/player/components/PlayerControls.tsx +78 -39
- package/src/player/components/Timeline.test.ts +110 -0
- package/src/player/components/Timeline.tsx +537 -260
- package/src/player/components/TimelineClip.tsx +80 -0
- package/src/player/components/VideoThumbnail.tsx +196 -0
- package/src/player/hooks/useTimelinePlayer.ts +404 -112
- package/src/player/index.ts +3 -3
- package/src/player/lib/time.test.ts +57 -0
- package/src/player/lib/time.ts +1 -0
- package/src/player/store/playerStore.test.ts +265 -0
- package/src/player/store/playerStore.ts +44 -16
- package/src/utils/htmlEditor.ts +164 -0
- package/dist/assets/index-Df6fO-S6.js +0 -78
- package/dist/assets/index-KoBceNoU.css +0 -1
- package/src/player/components/AgentActivityTrack.tsx +0 -93
- package/src/player/lib/useMountEffect.ts +0 -10
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function jQ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jx={exports:{}},wu={},ev={exports:{}},fe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var $l=Symbol.for("react.element"),ZQ=Symbol.for("react.portal"),VQ=Symbol.for("react.fragment"),XQ=Symbol.for("react.strict_mode"),LQ=Symbol.for("react.profiler"),DQ=Symbol.for("react.provider"),_Q=Symbol.for("react.context"),NQ=Symbol.for("react.forward_ref"),zQ=Symbol.for("react.suspense"),WQ=Symbol.for("react.memo"),IQ=Symbol.for("react.lazy"),og=Symbol.iterator;function BQ(t){return t===null||typeof t!="object"?null:(t=og&&t[og]||t["@@iterator"],typeof t=="function"?t:null)}var tv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nv=Object.assign,rv={};function _s(t,e,n){this.props=t,this.context=e,this.refs=rv,this.updater=n||tv}_s.prototype.isReactComponent={};_s.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};_s.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function iv(){}iv.prototype=_s.prototype;function qp(t,e,n){this.props=t,this.context=e,this.refs=rv,this.updater=n||tv}var Up=qp.prototype=new iv;Up.constructor=qp;nv(Up,_s.prototype);Up.isPureReactComponent=!0;var lg=Array.isArray,sv=Object.prototype.hasOwnProperty,Gp={current:null},ov={key:!0,ref:!0,__self:!0,__source:!0};function lv(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)sv.call(e,r)&&!ov.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}if(t&&t.defaultProps)for(r in l=t.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:$l,type:t,key:s,ref:o,props:i,_owner:Gp.current}}function YQ(t,e){return{$$typeof:$l,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Hp(t){return typeof t=="object"&&t!==null&&t.$$typeof===$l}function FQ(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var ag=/\/+/g;function lh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?FQ(""+t.key):e.toString(36)}function Za(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case $l:case ZQ:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+lh(o,0):r,lg(i)?(n="",t!=null&&(n=t.replace(ag,"$&/")+"/"),Za(i,e,n,"",function(c){return c})):i!=null&&(Hp(i)&&(i=YQ(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ag,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",lg(t))for(var l=0;l<t.length;l++){s=t[l];var a=r+lh(s,l);o+=Za(s,e,n,a,i)}else if(a=BQ(t),typeof a=="function")for(t=a.call(t),l=0;!(s=t.next()).done;)s=s.value,a=r+lh(s,l++),o+=Za(s,e,n,a,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Bl(t,e,n){if(t==null)return t;var r=[],i=0;return Za(t,r,"","",function(s){return e.call(n,s,i++)}),r}function qQ(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var $t={current:null},Va={transition:null},UQ={ReactCurrentDispatcher:$t,ReactCurrentBatchConfig:Va,ReactCurrentOwner:Gp};function av(){throw Error("act(...) is not supported in production builds of React.")}fe.Children={map:Bl,forEach:function(t,e,n){Bl(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Bl(t,function(){e++}),e},toArray:function(t){return Bl(t,function(e){return e})||[]},only:function(t){if(!Hp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};fe.Component=_s;fe.Fragment=VQ;fe.Profiler=LQ;fe.PureComponent=qp;fe.StrictMode=XQ;fe.Suspense=zQ;fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UQ;fe.act=av;fe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=nv({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Gp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(a in e)sv.call(e,a)&&!ov.hasOwnProperty(a)&&(r[a]=e[a]===void 0&&l!==void 0?l[a]:e[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:$l,type:t.type,key:i,ref:s,props:r,_owner:o}};fe.createContext=function(t){return t={$$typeof:_Q,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:DQ,_context:t},t.Consumer=t};fe.createElement=lv;fe.createFactory=function(t){var e=lv.bind(null,t);return e.type=t,e};fe.createRef=function(){return{current:null}};fe.forwardRef=function(t){return{$$typeof:NQ,render:t}};fe.isValidElement=Hp;fe.lazy=function(t){return{$$typeof:IQ,_payload:{_status:-1,_result:t},_init:qQ}};fe.memo=function(t,e){return{$$typeof:WQ,type:t,compare:e===void 0?null:e}};fe.startTransition=function(t){var e=Va.transition;Va.transition={};try{t()}finally{Va.transition=e}};fe.unstable_act=av;fe.useCallback=function(t,e){return $t.current.useCallback(t,e)};fe.useContext=function(t){return $t.current.useContext(t)};fe.useDebugValue=function(){};fe.useDeferredValue=function(t){return $t.current.useDeferredValue(t)};fe.useEffect=function(t,e){return $t.current.useEffect(t,e)};fe.useId=function(){return $t.current.useId()};fe.useImperativeHandle=function(t,e,n){return $t.current.useImperativeHandle(t,e,n)};fe.useInsertionEffect=function(t,e){return $t.current.useInsertionEffect(t,e)};fe.useLayoutEffect=function(t,e){return $t.current.useLayoutEffect(t,e)};fe.useMemo=function(t,e){return $t.current.useMemo(t,e)};fe.useReducer=function(t,e,n){return $t.current.useReducer(t,e,n)};fe.useRef=function(t){return $t.current.useRef(t)};fe.useState=function(t){return $t.current.useState(t)};fe.useSyncExternalStore=function(t,e,n){return $t.current.useSyncExternalStore(t,e,n)};fe.useTransition=function(){return $t.current.useTransition()};fe.version="18.3.1";ev.exports=fe;var m=ev.exports;const Yl=jQ(m);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var GQ=m,HQ=Symbol.for("react.element"),KQ=Symbol.for("react.fragment"),JQ=Object.prototype.hasOwnProperty,e$=GQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t$={key:!0,ref:!0,__self:!0,__source:!0};function cv(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)JQ.call(e,r)&&!t$.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:HQ,type:t,key:s,ref:o,props:i,_owner:e$.current}}wu.Fragment=KQ;wu.jsx=cv;wu.jsxs=cv;Jx.exports=wu;var g=Jx.exports,uv={exports:{}},Gt={},hv={exports:{}},fv={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(t){function e(E,D){var L=E.length;E.push(D);e:for(;0<L;){var q=L-1>>>1,G=E[q];if(0<i(G,D))E[q]=D,E[L]=G,L=q;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var D=E[0],L=E.pop();if(L!==D){E[0]=L;e:for(var q=0,G=E.length,re=G>>>1;q<re;){var te=2*(q+1)-1,W=E[te],ie=te+1,ne=E[ie];if(0>i(W,L))ie<G&&0>i(ne,W)?(E[q]=ne,E[ie]=L,q=ie):(E[q]=W,E[te]=L,q=te);else if(ie<G&&0>i(ne,L))E[q]=ne,E[ie]=L,q=ie;else break e}}return D}function i(E,D){var L=E.sortIndex-D.sortIndex;return L!==0?L:E.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var a=[],c=[],u=1,h=null,f=3,d=!1,p=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(E){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=E)r(c),D.sortIndex=D.expirationTime,e(a,D);else break;D=n(c)}}function w(E){if(x=!1,v(E),!p)if(n(a)!==null)p=!0,I(k);else{var D=n(c);D!==null&&J(w,D.startTime-E)}}function k(E,D){p=!1,x&&(x=!1,O(Q),Q=-1),d=!0;var L=f;try{for(v(D),h=n(a);h!==null&&(!(h.expirationTime>D)||E&&!V());){var q=h.callback;if(typeof q=="function"){h.callback=null,f=h.priorityLevel;var G=q(h.expirationTime<=D);D=t.unstable_now(),typeof G=="function"?h.callback=G:h===n(a)&&r(a),v(D)}else r(a);h=n(a)}if(h!==null)var re=!0;else{var te=n(c);te!==null&&J(w,te.startTime-D),re=!1}return re}finally{h=null,f=L,d=!1}}var $=!1,P=null,Q=-1,M=5,T=-1;function V(){return!(t.unstable_now()-T<M)}function C(){if(P!==null){var E=t.unstable_now();T=E;var D=!0;try{D=P(!0,E)}finally{D?j():($=!1,P=null)}}else $=!1}var j;if(typeof y=="function")j=function(){y(C)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,_=N.port2;N.port1.onmessage=C,j=function(){_.postMessage(null)}}else j=function(){S(C,0)};function I(E){P=E,$||($=!0,j())}function J(E,D){Q=S(function(){E(t.unstable_now())},D)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(E){E.callback=null},t.unstable_continueExecution=function(){p||d||(p=!0,I(k))},t.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<E?Math.floor(1e3/E):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(a)},t.unstable_next=function(E){switch(f){case 1:case 2:case 3:var D=3;break;default:D=f}var L=f;f=D;try{return E()}finally{f=L}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(E,D){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var L=f;f=E;try{return D()}finally{f=L}},t.unstable_scheduleCallback=function(E,D,L){var q=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?q+L:q):L=q,E){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=L+G,E={id:u++,callback:D,priorityLevel:E,startTime:L,expirationTime:G,sortIndex:-1},L>q?(E.sortIndex=L,e(c,E),n(a)===null&&E===n(c)&&(x?(O(Q),Q=-1):x=!0,J(w,L-q))):(E.sortIndex=G,e(a,E),p||d||(p=!0,I(k))),E},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(E){var D=f;return function(){var L=f;f=D;try{return E.apply(this,arguments)}finally{f=L}}}})(fv);hv.exports=fv;var n$=hv.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var r$=m,Ut=n$;function X(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var dv=new Set,Yo={};function Ei(t,e){Ss(t,e),Ss(t+"Capture",e)}function Ss(t,e){for(Yo[t]=e,t=0;t<e.length;t++)dv.add(e[t])}var hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vf=Object.prototype.hasOwnProperty,i$=/^[: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]*$/,cg={},ug={};function s$(t){return Vf.call(ug,t)?!0:Vf.call(cg,t)?!1:i$.test(t)?ug[t]=!0:(cg[t]=!0,!1)}function o$(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function l$(t,e,n,r){if(e===null||typeof e>"u"||o$(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Tt(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ct[t]=new Tt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ct[e]=new Tt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ct[t]=new Tt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ct[t]=new Tt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ct[t]=new Tt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ct[t]=new Tt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ct[t]=new Tt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ct[t]=new Tt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ct[t]=new Tt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Kp=/[\-:]([a-z])/g;function Jp(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Kp,Jp);ct[e]=new Tt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Kp,Jp);ct[e]=new Tt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Kp,Jp);ct[e]=new Tt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ct[t]=new Tt(t,1,!1,t.toLowerCase(),null,!1,!1)});ct.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ct[t]=new Tt(t,1,!1,t.toLowerCase(),null,!0,!0)});function em(t,e,n,r){var i=ct.hasOwnProperty(e)?ct[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(l$(e,n,i,r)&&(n=null),r||i===null?s$(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var gr=r$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fl=Symbol.for("react.element"),Ii=Symbol.for("react.portal"),Bi=Symbol.for("react.fragment"),tm=Symbol.for("react.strict_mode"),Xf=Symbol.for("react.profiler"),pv=Symbol.for("react.provider"),mv=Symbol.for("react.context"),nm=Symbol.for("react.forward_ref"),Lf=Symbol.for("react.suspense"),Df=Symbol.for("react.suspense_list"),rm=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),Ov=Symbol.for("react.offscreen"),hg=Symbol.iterator;function to(t){return t===null||typeof t!="object"?null:(t=hg&&t[hg]||t["@@iterator"],typeof t=="function"?t:null)}var Xe=Object.assign,ah;function xo(t){if(ah===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ah=e&&e[1]||""}return`
|
|
34
|
+
`+ah+t}var ch=!1;function uh(t,e){if(!t||ch)return"";ch=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var a=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return t.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",t.displayName)),a}while(1<=o&&0<=l);break}}}finally{ch=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?xo(t):""}function a$(t){switch(t.tag){case 5:return xo(t.type);case 16:return xo("Lazy");case 13:return xo("Suspense");case 19:return xo("SuspenseList");case 0:case 2:case 15:return t=uh(t.type,!1),t;case 11:return t=uh(t.type.render,!1),t;case 1:return t=uh(t.type,!0),t;default:return""}}function _f(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Bi:return"Fragment";case Ii:return"Portal";case Xf:return"Profiler";case tm:return"StrictMode";case Lf:return"Suspense";case Df:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mv:return(t.displayName||"Context")+".Consumer";case pv:return(t._context.displayName||"Context")+".Provider";case nm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case rm:return e=t.displayName||null,e!==null?e:_f(t.type)||"Memo";case wr:e=t._payload,t=t._init;try{return _f(t(e))}catch{}}return null}function c$(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _f(e);case 8:return e===tm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function zr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function gv(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function u$(t){var e=gv(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ql(t){t._valueTracker||(t._valueTracker=u$(t))}function yv(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=gv(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function dc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Nf(t,e){var n=e.checked;return Xe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function fg(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=zr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function xv(t,e){e=e.checked,e!=null&&em(t,"checked",e,!1)}function zf(t,e){xv(t,e);var n=zr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Wf(t,e.type,n):e.hasOwnProperty("defaultValue")&&Wf(t,e.type,zr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function dg(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Wf(t,e,n){(e!=="number"||dc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var vo=Array.isArray;function as(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+zr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function If(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(X(91));return Xe({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function pg(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(X(92));if(vo(n)){if(1<n.length)throw Error(X(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:zr(n)}}function vv(t,e){var n=zr(e.value),r=zr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function mg(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Sv(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Bf(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Sv(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ul,wv=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Ul=Ul||document.createElement("div"),Ul.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Ul.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fo(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var $o={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},h$=["Webkit","ms","Moz","O"];Object.keys($o).forEach(function(t){h$.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),$o[e]=$o[t]})});function kv(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||$o.hasOwnProperty(t)&&$o[t]?(""+e).trim():e+"px"}function bv(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=kv(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var f$=Xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yf(t,e){if(e){if(f$[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(X(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(X(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(X(61))}if(e.style!=null&&typeof e.style!="object")throw Error(X(62))}}function Ff(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 qf=null;function im(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Uf=null,cs=null,us=null;function Og(t){if(t=Al(t)){if(typeof Uf!="function")throw Error(X(280));var e=t.stateNode;e&&(e=$u(e),Uf(t.stateNode,t.type,e))}}function Pv(t){cs?us?us.push(t):us=[t]:cs=t}function Qv(){if(cs){var t=cs,e=us;if(us=cs=null,Og(t),e)for(t=0;t<e.length;t++)Og(e[t])}}function $v(t,e){return t(e)}function Tv(){}var hh=!1;function Cv(t,e,n){if(hh)return t(e,n);hh=!0;try{return $v(t,e,n)}finally{hh=!1,(cs!==null||us!==null)&&(Tv(),Qv())}}function qo(t,e){var n=t.stateNode;if(n===null)return null;var r=$u(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(X(231,e,typeof n));return n}var Gf=!1;if(hr)try{var no={};Object.defineProperty(no,"passive",{get:function(){Gf=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Gf=!1}function d$(t,e,n,r,i,s,o,l,a){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var To=!1,pc=null,mc=!1,Hf=null,p$={onError:function(t){To=!0,pc=t}};function m$(t,e,n,r,i,s,o,l,a){To=!1,pc=null,d$.apply(p$,arguments)}function O$(t,e,n,r,i,s,o,l,a){if(m$.apply(this,arguments),To){if(To){var c=pc;To=!1,pc=null}else throw Error(X(198));mc||(mc=!0,Hf=c)}}function Ri(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Av(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function gg(t){if(Ri(t)!==t)throw Error(X(188))}function g$(t){var e=t.alternate;if(!e){if(e=Ri(t),e===null)throw Error(X(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return gg(i),t;if(s===r)return gg(i),e;s=s.sibling}throw Error(X(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?t:e}function Mv(t){return t=g$(t),t!==null?Ev(t):null}function Ev(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Ev(t);if(e!==null)return e;t=t.sibling}return null}var Rv=Ut.unstable_scheduleCallback,yg=Ut.unstable_cancelCallback,y$=Ut.unstable_shouldYield,x$=Ut.unstable_requestPaint,ze=Ut.unstable_now,v$=Ut.unstable_getCurrentPriorityLevel,sm=Ut.unstable_ImmediatePriority,jv=Ut.unstable_UserBlockingPriority,Oc=Ut.unstable_NormalPriority,S$=Ut.unstable_LowPriority,Zv=Ut.unstable_IdlePriority,ku=null,qn=null;function w$(t){if(qn&&typeof qn.onCommitFiberRoot=="function")try{qn.onCommitFiberRoot(ku,t,void 0,(t.current.flags&128)===128)}catch{}}var bn=Math.clz32?Math.clz32:P$,k$=Math.log,b$=Math.LN2;function P$(t){return t>>>=0,t===0?32:31-(k$(t)/b$|0)|0}var Gl=64,Hl=4194304;function So(t){switch(t&-t){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function gc(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=So(l):(s&=o,s!==0&&(r=So(s)))}else o=n&~i,o!==0?r=So(o):s!==0&&(r=So(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-bn(e),i=1<<n,r|=t[n],e&=~i;return r}function Q$(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $$(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-bn(s),l=1<<o,a=i[o];a===-1?(!(l&n)||l&r)&&(i[o]=Q$(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}}function Kf(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Vv(){var t=Gl;return Gl<<=1,!(Gl&4194240)&&(Gl=64),t}function fh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Tl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-bn(e),t[e]=n}function T$(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-bn(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function om(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-bn(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Se=0;function Xv(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Lv,lm,Dv,_v,Nv,Jf=!1,Kl=[],Rr=null,jr=null,Zr=null,Uo=new Map,Go=new Map,Qr=[],C$="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 submit".split(" ");function xg(t,e){switch(t){case"focusin":case"focusout":Rr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Uo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(e.pointerId)}}function ro(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Al(e),e!==null&&lm(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function A$(t,e,n,r,i){switch(e){case"focusin":return Rr=ro(Rr,t,e,n,r,i),!0;case"dragenter":return jr=ro(jr,t,e,n,r,i),!0;case"mouseover":return Zr=ro(Zr,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Uo.set(s,ro(Uo.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Go.set(s,ro(Go.get(s)||null,t,e,n,r,i)),!0}return!1}function zv(t){var e=hi(t.target);if(e!==null){var n=Ri(e);if(n!==null){if(e=n.tag,e===13){if(e=Av(n),e!==null){t.blockedOn=e,Nv(t.priority,function(){Dv(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xa(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=ed(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);qf=r,n.target.dispatchEvent(r),qf=null}else return e=Al(n),e!==null&&lm(e),t.blockedOn=n,!1;e.shift()}return!0}function vg(t,e,n){Xa(t)&&n.delete(e)}function M$(){Jf=!1,Rr!==null&&Xa(Rr)&&(Rr=null),jr!==null&&Xa(jr)&&(jr=null),Zr!==null&&Xa(Zr)&&(Zr=null),Uo.forEach(vg),Go.forEach(vg)}function io(t,e){t.blockedOn===e&&(t.blockedOn=null,Jf||(Jf=!0,Ut.unstable_scheduleCallback(Ut.unstable_NormalPriority,M$)))}function Ho(t){function e(i){return io(i,t)}if(0<Kl.length){io(Kl[0],t);for(var n=1;n<Kl.length;n++){var r=Kl[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Rr!==null&&io(Rr,t),jr!==null&&io(jr,t),Zr!==null&&io(Zr,t),Uo.forEach(e),Go.forEach(e),n=0;n<Qr.length;n++)r=Qr[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Qr.length&&(n=Qr[0],n.blockedOn===null);)zv(n),n.blockedOn===null&&Qr.shift()}var hs=gr.ReactCurrentBatchConfig,yc=!0;function E$(t,e,n,r){var i=Se,s=hs.transition;hs.transition=null;try{Se=1,am(t,e,n,r)}finally{Se=i,hs.transition=s}}function R$(t,e,n,r){var i=Se,s=hs.transition;hs.transition=null;try{Se=4,am(t,e,n,r)}finally{Se=i,hs.transition=s}}function am(t,e,n,r){if(yc){var i=ed(t,e,n,r);if(i===null)wh(t,e,r,xc,n),xg(t,r);else if(A$(i,t,e,n,r))r.stopPropagation();else if(xg(t,r),e&4&&-1<C$.indexOf(t)){for(;i!==null;){var s=Al(i);if(s!==null&&Lv(s),s=ed(t,e,n,r),s===null&&wh(t,e,r,xc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else wh(t,e,r,null,n)}}var xc=null;function ed(t,e,n,r){if(xc=null,t=im(r),t=hi(t),t!==null)if(e=Ri(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Av(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return xc=t,null}function Wv(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(v$()){case sm:return 1;case jv:return 4;case Oc:case S$:return 16;case Zv:return 536870912;default:return 16}default:return 16}}var Cr=null,cm=null,La=null;function Iv(){if(La)return La;var t,e=cm,n=e.length,r,i="value"in Cr?Cr.value:Cr.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return La=i.slice(t,1<r?1-r:void 0)}function Da(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Jl(){return!0}function Sg(){return!1}function Ht(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Jl:Sg,this.isPropagationStopped=Sg,this}return Xe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Jl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),e}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},um=Ht(Ns),Cl=Xe({},Ns,{view:0,detail:0}),j$=Ht(Cl),dh,ph,so,bu=Xe({},Cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hm,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==so&&(so&&t.type==="mousemove"?(dh=t.screenX-so.screenX,ph=t.screenY-so.screenY):ph=dh=0,so=t),dh)},movementY:function(t){return"movementY"in t?t.movementY:ph}}),wg=Ht(bu),Z$=Xe({},bu,{dataTransfer:0}),V$=Ht(Z$),X$=Xe({},Cl,{relatedTarget:0}),mh=Ht(X$),L$=Xe({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),D$=Ht(L$),_$=Xe({},Ns,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),N$=Ht(_$),z$=Xe({},Ns,{data:0}),kg=Ht(z$),W$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I$={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"},B$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y$(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=B$[t])?!!e[t]:!1}function hm(){return Y$}var F$=Xe({},Cl,{key:function(t){if(t.key){var e=W$[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Da(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?I$[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hm,charCode:function(t){return t.type==="keypress"?Da(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Da(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),q$=Ht(F$),U$=Xe({},bu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bg=Ht(U$),G$=Xe({},Cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hm}),H$=Ht(G$),K$=Xe({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),J$=Ht(K$),eT=Xe({},bu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),tT=Ht(eT),nT=[9,13,27,32],fm=hr&&"CompositionEvent"in window,Co=null;hr&&"documentMode"in document&&(Co=document.documentMode);var rT=hr&&"TextEvent"in window&&!Co,Bv=hr&&(!fm||Co&&8<Co&&11>=Co),Pg=" ",Qg=!1;function Yv(t,e){switch(t){case"keyup":return nT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Yi=!1;function iT(t,e){switch(t){case"compositionend":return Fv(e);case"keypress":return e.which!==32?null:(Qg=!0,Pg);case"textInput":return t=e.data,t===Pg&&Qg?null:t;default:return null}}function sT(t,e){if(Yi)return t==="compositionend"||!fm&&Yv(t,e)?(t=Iv(),La=cm=Cr=null,Yi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Bv&&e.locale!=="ko"?null:e.data;default:return null}}var oT={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 $g(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!oT[t.type]:e==="textarea"}function qv(t,e,n,r){Pv(r),e=vc(e,"onChange"),0<e.length&&(n=new um("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Ao=null,Ko=null;function lT(t){sS(t,0)}function Pu(t){var e=Ui(t);if(yv(e))return t}function aT(t,e){if(t==="change")return e}var Uv=!1;if(hr){var Oh;if(hr){var gh="oninput"in document;if(!gh){var Tg=document.createElement("div");Tg.setAttribute("oninput","return;"),gh=typeof Tg.oninput=="function"}Oh=gh}else Oh=!1;Uv=Oh&&(!document.documentMode||9<document.documentMode)}function Cg(){Ao&&(Ao.detachEvent("onpropertychange",Gv),Ko=Ao=null)}function Gv(t){if(t.propertyName==="value"&&Pu(Ko)){var e=[];qv(e,Ko,t,im(t)),Cv(lT,e)}}function cT(t,e,n){t==="focusin"?(Cg(),Ao=e,Ko=n,Ao.attachEvent("onpropertychange",Gv)):t==="focusout"&&Cg()}function uT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Pu(Ko)}function hT(t,e){if(t==="click")return Pu(e)}function fT(t,e){if(t==="input"||t==="change")return Pu(e)}function dT(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var $n=typeof Object.is=="function"?Object.is:dT;function Jo(t,e){if($n(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Vf.call(e,i)||!$n(t[i],e[i]))return!1}return!0}function Ag(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Mg(t,e){var n=Ag(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ag(n)}}function Hv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Hv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Kv(){for(var t=window,e=dc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=dc(t.document)}return e}function dm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function pT(t){var e=Kv(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Hv(n.ownerDocument.documentElement,n)){if(r!==null&&dm(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=Mg(n,s);var o=Mg(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var mT=hr&&"documentMode"in document&&11>=document.documentMode,Fi=null,td=null,Mo=null,nd=!1;function Eg(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nd||Fi==null||Fi!==dc(r)||(r=Fi,"selectionStart"in r&&dm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mo&&Jo(Mo,r)||(Mo=r,r=vc(td,"onSelect"),0<r.length&&(e=new um("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Fi)))}function ea(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var qi={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionend:ea("Transition","TransitionEnd")},yh={},Jv={};hr&&(Jv=document.createElement("div").style,"AnimationEvent"in window||(delete qi.animationend.animation,delete qi.animationiteration.animation,delete qi.animationstart.animation),"TransitionEvent"in window||delete qi.transitionend.transition);function Qu(t){if(yh[t])return yh[t];if(!qi[t])return t;var e=qi[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Jv)return yh[t]=e[n];return t}var eS=Qu("animationend"),tS=Qu("animationiteration"),nS=Qu("animationstart"),rS=Qu("transitionend"),iS=new Map,Rg="abort auxClick 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(" ");function Kr(t,e){iS.set(t,e),Ei(e,[t])}for(var xh=0;xh<Rg.length;xh++){var vh=Rg[xh],OT=vh.toLowerCase(),gT=vh[0].toUpperCase()+vh.slice(1);Kr(OT,"on"+gT)}Kr(eS,"onAnimationEnd");Kr(tS,"onAnimationIteration");Kr(nS,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(rS,"onTransitionEnd");Ss("onMouseEnter",["mouseout","mouseover"]);Ss("onMouseLeave",["mouseout","mouseover"]);Ss("onPointerEnter",["pointerout","pointerover"]);Ss("onPointerLeave",["pointerout","pointerover"]);Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),yT=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function jg(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,O$(r,e,void 0,t),t.currentTarget=null}function sS(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var l=r[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&i.isPropagationStopped())break e;jg(i,l,c),s=a}else for(o=0;o<r.length;o++){if(l=r[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&i.isPropagationStopped())break e;jg(i,l,c),s=a}}}if(mc)throw t=Hf,mc=!1,Hf=null,t}function Te(t,e){var n=e[ld];n===void 0&&(n=e[ld]=new Set);var r=t+"__bubble";n.has(r)||(oS(e,t,2,!1),n.add(r))}function Sh(t,e,n){var r=0;e&&(r|=4),oS(n,t,r,e)}var ta="_reactListening"+Math.random().toString(36).slice(2);function el(t){if(!t[ta]){t[ta]=!0,dv.forEach(function(n){n!=="selectionchange"&&(yT.has(n)||Sh(n,!1,t),Sh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[ta]||(e[ta]=!0,Sh("selectionchange",!1,e))}}function oS(t,e,n,r){switch(Wv(e)){case 1:var i=E$;break;case 4:i=R$;break;default:i=am}n=i.bind(null,e,n,t),i=void 0,!Gf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function wh(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;l!==null;){if(o=hi(l),o===null)return;if(a=o.tag,a===5||a===6){r=s=o;continue e}l=l.parentNode}}r=r.return}Cv(function(){var c=s,u=im(n),h=[];e:{var f=iS.get(t);if(f!==void 0){var d=um,p=t;switch(t){case"keypress":if(Da(n)===0)break e;case"keydown":case"keyup":d=q$;break;case"focusin":p="focus",d=mh;break;case"focusout":p="blur",d=mh;break;case"beforeblur":case"afterblur":d=mh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=V$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=H$;break;case eS:case tS:case nS:d=D$;break;case rS:d=J$;break;case"scroll":d=j$;break;case"wheel":d=tT;break;case"copy":case"cut":case"paste":d=N$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=bg}var x=(e&4)!==0,S=!x&&t==="scroll",O=x?f!==null?f+"Capture":null:f;x=[];for(var y=c,v;y!==null;){v=y;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,O!==null&&(w=qo(y,O),w!=null&&x.push(tl(y,w,v)))),S)break;y=y.return}0<x.length&&(f=new d(f,p,null,n,u),h.push({event:f,listeners:x}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",f&&n!==qf&&(p=n.relatedTarget||n.fromElement)&&(hi(p)||p[fr]))break e;if((d||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=c,p=p?hi(p):null,p!==null&&(S=Ri(p),p!==S||p.tag!==5&&p.tag!==6)&&(p=null)):(d=null,p=c),d!==p)){if(x=wg,w="onMouseLeave",O="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(x=bg,w="onPointerLeave",O="onPointerEnter",y="pointer"),S=d==null?f:Ui(d),v=p==null?f:Ui(p),f=new x(w,y+"leave",d,n,u),f.target=S,f.relatedTarget=v,w=null,hi(u)===c&&(x=new x(O,y+"enter",p,n,u),x.target=v,x.relatedTarget=S,w=x),S=w,d&&p)t:{for(x=d,O=p,y=0,v=x;v;v=Xi(v))y++;for(v=0,w=O;w;w=Xi(w))v++;for(;0<y-v;)x=Xi(x),y--;for(;0<v-y;)O=Xi(O),v--;for(;y--;){if(x===O||O!==null&&x===O.alternate)break t;x=Xi(x),O=Xi(O)}x=null}else x=null;d!==null&&Zg(h,f,d,x,!1),p!==null&&S!==null&&Zg(h,S,p,x,!0)}}e:{if(f=c?Ui(c):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var k=aT;else if($g(f))if(Uv)k=fT;else{k=uT;var $=cT}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=hT);if(k&&(k=k(t,c))){qv(h,k,n,u);break e}$&&$(t,f,c),t==="focusout"&&($=f._wrapperState)&&$.controlled&&f.type==="number"&&Wf(f,"number",f.value)}switch($=c?Ui(c):window,t){case"focusin":($g($)||$.contentEditable==="true")&&(Fi=$,td=c,Mo=null);break;case"focusout":Mo=td=Fi=null;break;case"mousedown":nd=!0;break;case"contextmenu":case"mouseup":case"dragend":nd=!1,Eg(h,n,u);break;case"selectionchange":if(mT)break;case"keydown":case"keyup":Eg(h,n,u)}var P;if(fm)e:{switch(t){case"compositionstart":var Q="onCompositionStart";break e;case"compositionend":Q="onCompositionEnd";break e;case"compositionupdate":Q="onCompositionUpdate";break e}Q=void 0}else Yi?Yv(t,n)&&(Q="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(Q="onCompositionStart");Q&&(Bv&&n.locale!=="ko"&&(Yi||Q!=="onCompositionStart"?Q==="onCompositionEnd"&&Yi&&(P=Iv()):(Cr=u,cm="value"in Cr?Cr.value:Cr.textContent,Yi=!0)),$=vc(c,Q),0<$.length&&(Q=new kg(Q,t,null,n,u),h.push({event:Q,listeners:$}),P?Q.data=P:(P=Fv(n),P!==null&&(Q.data=P)))),(P=rT?iT(t,n):sT(t,n))&&(c=vc(c,"onBeforeInput"),0<c.length&&(u=new kg("onBeforeInput","beforeinput",null,n,u),h.push({event:u,listeners:c}),u.data=P))}sS(h,e)})}function tl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function vc(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=qo(t,n),s!=null&&r.unshift(tl(t,s,i)),s=qo(t,e),s!=null&&r.push(tl(t,s,i))),t=t.return}return r}function Xi(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Zg(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,i?(a=qo(n,s),a!=null&&o.unshift(tl(n,a,l))):i||(a=qo(n,s),a!=null&&o.push(tl(n,a,l)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var xT=/\r\n?/g,vT=/\u0000|\uFFFD/g;function Vg(t){return(typeof t=="string"?t:""+t).replace(xT,`
|
|
38
|
+
`).replace(vT,"")}function na(t,e,n){if(e=Vg(e),Vg(t)!==e&&n)throw Error(X(425))}function Sc(){}var rd=null,id=null;function sd(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var od=typeof setTimeout=="function"?setTimeout:void 0,ST=typeof clearTimeout=="function"?clearTimeout:void 0,Xg=typeof Promise=="function"?Promise:void 0,wT=typeof queueMicrotask=="function"?queueMicrotask:typeof Xg<"u"?function(t){return Xg.resolve(null).then(t).catch(kT)}:od;function kT(t){setTimeout(function(){throw t})}function kh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ho(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ho(e)}function Vr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Lg(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var zs=Math.random().toString(36).slice(2),_n="__reactFiber$"+zs,nl="__reactProps$"+zs,fr="__reactContainer$"+zs,ld="__reactEvents$"+zs,bT="__reactListeners$"+zs,PT="__reactHandles$"+zs;function hi(t){var e=t[_n];if(e)return e;for(var n=t.parentNode;n;){if(e=n[fr]||n[_n]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Lg(t);t!==null;){if(n=t[_n])return n;t=Lg(t)}return e}t=n,n=t.parentNode}return null}function Al(t){return t=t[_n]||t[fr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ui(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(X(33))}function $u(t){return t[nl]||null}var ad=[],Gi=-1;function Jr(t){return{current:t}}function Ae(t){0>Gi||(t.current=ad[Gi],ad[Gi]=null,Gi--)}function $e(t,e){Gi++,ad[Gi]=t.current,t.current=e}var Wr={},yt=Jr(Wr),jt=Jr(!1),ki=Wr;function ws(t,e){var n=t.type.contextTypes;if(!n)return Wr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Zt(t){return t=t.childContextTypes,t!=null}function wc(){Ae(jt),Ae(yt)}function Dg(t,e,n){if(yt.current!==Wr)throw Error(X(168));$e(yt,e),$e(jt,n)}function lS(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(X(108,c$(t)||"Unknown",i));return Xe({},n,r)}function kc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Wr,ki=yt.current,$e(yt,t),$e(jt,jt.current),!0}function _g(t,e,n){var r=t.stateNode;if(!r)throw Error(X(169));n?(t=lS(t,e,ki),r.__reactInternalMemoizedMergedChildContext=t,Ae(jt),Ae(yt),$e(yt,t)):Ae(jt),$e(jt,n)}var rr=null,Tu=!1,bh=!1;function aS(t){rr===null?rr=[t]:rr.push(t)}function QT(t){Tu=!0,aS(t)}function ei(){if(!bh&&rr!==null){bh=!0;var t=0,e=Se;try{var n=rr;for(Se=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}rr=null,Tu=!1}catch(i){throw rr!==null&&(rr=rr.slice(t+1)),Rv(sm,ei),i}finally{Se=e,bh=!1}}return null}var Hi=[],Ki=0,bc=null,Pc=0,en=[],tn=0,bi=null,or=1,lr="";function oi(t,e){Hi[Ki++]=Pc,Hi[Ki++]=bc,bc=t,Pc=e}function cS(t,e,n){en[tn++]=or,en[tn++]=lr,en[tn++]=bi,bi=t;var r=or;t=lr;var i=32-bn(r)-1;r&=~(1<<i),n+=1;var s=32-bn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,or=1<<32-bn(e)+i|n<<i|r,lr=s+t}else or=1<<s|n<<i|r,lr=t}function pm(t){t.return!==null&&(oi(t,1),cS(t,1,0))}function mm(t){for(;t===bc;)bc=Hi[--Ki],Hi[Ki]=null,Pc=Hi[--Ki],Hi[Ki]=null;for(;t===bi;)bi=en[--tn],en[tn]=null,lr=en[--tn],en[tn]=null,or=en[--tn],en[tn]=null}var Ft=null,Yt=null,Me=!1,vn=null;function uS(t,e){var n=rn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Ng(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Ft=t,Yt=Vr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ft=t,Yt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=bi!==null?{id:or,overflow:lr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=rn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Ft=t,Yt=null,!0):!1;default:return!1}}function cd(t){return(t.mode&1)!==0&&(t.flags&128)===0}function ud(t){if(Me){var e=Yt;if(e){var n=e;if(!Ng(t,e)){if(cd(t))throw Error(X(418));e=Vr(n.nextSibling);var r=Ft;e&&Ng(t,e)?uS(r,n):(t.flags=t.flags&-4097|2,Me=!1,Ft=t)}}else{if(cd(t))throw Error(X(418));t.flags=t.flags&-4097|2,Me=!1,Ft=t}}}function zg(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ft=t}function ra(t){if(t!==Ft)return!1;if(!Me)return zg(t),Me=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!sd(t.type,t.memoizedProps)),e&&(e=Yt)){if(cd(t))throw hS(),Error(X(418));for(;e;)uS(t,e),e=Vr(e.nextSibling)}if(zg(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(X(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Yt=Vr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Yt=null}}else Yt=Ft?Vr(t.stateNode.nextSibling):null;return!0}function hS(){for(var t=Yt;t;)t=Vr(t.nextSibling)}function ks(){Yt=Ft=null,Me=!1}function Om(t){vn===null?vn=[t]:vn.push(t)}var $T=gr.ReactCurrentBatchConfig;function oo(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(X(309));var r=n.stateNode}if(!r)throw Error(X(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(X(284));if(!n._owner)throw Error(X(290,t))}return t}function ia(t,e){throw t=Object.prototype.toString.call(e),Error(X(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Wg(t){var e=t._init;return e(t._payload)}function fS(t){function e(O,y){if(t){var v=O.deletions;v===null?(O.deletions=[y],O.flags|=16):v.push(y)}}function n(O,y){if(!t)return null;for(;y!==null;)e(O,y),y=y.sibling;return null}function r(O,y){for(O=new Map;y!==null;)y.key!==null?O.set(y.key,y):O.set(y.index,y),y=y.sibling;return O}function i(O,y){return O=_r(O,y),O.index=0,O.sibling=null,O}function s(O,y,v){return O.index=v,t?(v=O.alternate,v!==null?(v=v.index,v<y?(O.flags|=2,y):v):(O.flags|=2,y)):(O.flags|=1048576,y)}function o(O){return t&&O.alternate===null&&(O.flags|=2),O}function l(O,y,v,w){return y===null||y.tag!==6?(y=Mh(v,O.mode,w),y.return=O,y):(y=i(y,v),y.return=O,y)}function a(O,y,v,w){var k=v.type;return k===Bi?u(O,y,v.props.children,w,v.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===wr&&Wg(k)===y.type)?(w=i(y,v.props),w.ref=oo(O,y,v),w.return=O,w):(w=Ya(v.type,v.key,v.props,null,O.mode,w),w.ref=oo(O,y,v),w.return=O,w)}function c(O,y,v,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=Eh(v,O.mode,w),y.return=O,y):(y=i(y,v.children||[]),y.return=O,y)}function u(O,y,v,w,k){return y===null||y.tag!==7?(y=vi(v,O.mode,w,k),y.return=O,y):(y=i(y,v),y.return=O,y)}function h(O,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Mh(""+y,O.mode,v),y.return=O,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Fl:return v=Ya(y.type,y.key,y.props,null,O.mode,v),v.ref=oo(O,null,y),v.return=O,v;case Ii:return y=Eh(y,O.mode,v),y.return=O,y;case wr:var w=y._init;return h(O,w(y._payload),v)}if(vo(y)||to(y))return y=vi(y,O.mode,v,null),y.return=O,y;ia(O,y)}return null}function f(O,y,v,w){var k=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return k!==null?null:l(O,y,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Fl:return v.key===k?a(O,y,v,w):null;case Ii:return v.key===k?c(O,y,v,w):null;case wr:return k=v._init,f(O,y,k(v._payload),w)}if(vo(v)||to(v))return k!==null?null:u(O,y,v,w,null);ia(O,v)}return null}function d(O,y,v,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return O=O.get(v)||null,l(y,O,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Fl:return O=O.get(w.key===null?v:w.key)||null,a(y,O,w,k);case Ii:return O=O.get(w.key===null?v:w.key)||null,c(y,O,w,k);case wr:var $=w._init;return d(O,y,v,$(w._payload),k)}if(vo(w)||to(w))return O=O.get(v)||null,u(y,O,w,k,null);ia(y,w)}return null}function p(O,y,v,w){for(var k=null,$=null,P=y,Q=y=0,M=null;P!==null&&Q<v.length;Q++){P.index>Q?(M=P,P=null):M=P.sibling;var T=f(O,P,v[Q],w);if(T===null){P===null&&(P=M);break}t&&P&&T.alternate===null&&e(O,P),y=s(T,y,Q),$===null?k=T:$.sibling=T,$=T,P=M}if(Q===v.length)return n(O,P),Me&&oi(O,Q),k;if(P===null){for(;Q<v.length;Q++)P=h(O,v[Q],w),P!==null&&(y=s(P,y,Q),$===null?k=P:$.sibling=P,$=P);return Me&&oi(O,Q),k}for(P=r(O,P);Q<v.length;Q++)M=d(P,O,Q,v[Q],w),M!==null&&(t&&M.alternate!==null&&P.delete(M.key===null?Q:M.key),y=s(M,y,Q),$===null?k=M:$.sibling=M,$=M);return t&&P.forEach(function(V){return e(O,V)}),Me&&oi(O,Q),k}function x(O,y,v,w){var k=to(v);if(typeof k!="function")throw Error(X(150));if(v=k.call(v),v==null)throw Error(X(151));for(var $=k=null,P=y,Q=y=0,M=null,T=v.next();P!==null&&!T.done;Q++,T=v.next()){P.index>Q?(M=P,P=null):M=P.sibling;var V=f(O,P,T.value,w);if(V===null){P===null&&(P=M);break}t&&P&&V.alternate===null&&e(O,P),y=s(V,y,Q),$===null?k=V:$.sibling=V,$=V,P=M}if(T.done)return n(O,P),Me&&oi(O,Q),k;if(P===null){for(;!T.done;Q++,T=v.next())T=h(O,T.value,w),T!==null&&(y=s(T,y,Q),$===null?k=T:$.sibling=T,$=T);return Me&&oi(O,Q),k}for(P=r(O,P);!T.done;Q++,T=v.next())T=d(P,O,Q,T.value,w),T!==null&&(t&&T.alternate!==null&&P.delete(T.key===null?Q:T.key),y=s(T,y,Q),$===null?k=T:$.sibling=T,$=T);return t&&P.forEach(function(C){return e(O,C)}),Me&&oi(O,Q),k}function S(O,y,v,w){if(typeof v=="object"&&v!==null&&v.type===Bi&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Fl:e:{for(var k=v.key,$=y;$!==null;){if($.key===k){if(k=v.type,k===Bi){if($.tag===7){n(O,$.sibling),y=i($,v.props.children),y.return=O,O=y;break e}}else if($.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===wr&&Wg(k)===$.type){n(O,$.sibling),y=i($,v.props),y.ref=oo(O,$,v),y.return=O,O=y;break e}n(O,$);break}else e(O,$);$=$.sibling}v.type===Bi?(y=vi(v.props.children,O.mode,w,v.key),y.return=O,O=y):(w=Ya(v.type,v.key,v.props,null,O.mode,w),w.ref=oo(O,y,v),w.return=O,O=w)}return o(O);case Ii:e:{for($=v.key;y!==null;){if(y.key===$)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(O,y.sibling),y=i(y,v.children||[]),y.return=O,O=y;break e}else{n(O,y);break}else e(O,y);y=y.sibling}y=Eh(v,O.mode,w),y.return=O,O=y}return o(O);case wr:return $=v._init,S(O,y,$(v._payload),w)}if(vo(v))return p(O,y,v,w);if(to(v))return x(O,y,v,w);ia(O,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(O,y.sibling),y=i(y,v),y.return=O,O=y):(n(O,y),y=Mh(v,O.mode,w),y.return=O,O=y),o(O)):n(O,y)}return S}var bs=fS(!0),dS=fS(!1),Qc=Jr(null),$c=null,Ji=null,gm=null;function ym(){gm=Ji=$c=null}function xm(t){var e=Qc.current;Ae(Qc),t._currentValue=e}function hd(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function fs(t,e){$c=t,gm=Ji=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Et=!0),t.firstContext=null)}function hn(t){var e=t._currentValue;if(gm!==t)if(t={context:t,memoizedValue:e,next:null},Ji===null){if($c===null)throw Error(X(308));Ji=t,$c.dependencies={lanes:0,firstContext:t}}else Ji=Ji.next=t;return e}var fi=null;function vm(t){fi===null?fi=[t]:fi.push(t)}function pS(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,vm(e)):(n.next=i.next,i.next=n),e.interleaved=n,dr(t,r)}function dr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var kr=!1;function Sm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mS(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ar(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Xr(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ye&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,dr(t,n)}return i=r.interleaved,i===null?(e.next=e,vm(r)):(e.next=i.next,i.next=e),r.interleaved=e,dr(t,n)}function _a(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,om(t,n)}}function Ig(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Tc(t,e,n,r){var i=t.updateQueue;kr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var h=i.baseState;o=0,u=c=a=null,l=s;do{var f=l.lane,d=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:d,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var p=t,x=l;switch(f=e,d=n,x.tag){case 1:if(p=x.payload,typeof p=="function"){h=p.call(d,h,f);break e}h=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=x.payload,f=typeof p=="function"?p.call(d,h,f):p,f==null)break e;h=Xe({},h,f);break e;case 2:kr=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else d={eventTime:d,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=d,a=h):u=u.next=d,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(a=h),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Qi|=o,t.lanes=o,t.memoizedState=h}}function Bg(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(X(191,i));i.call(r)}}}var Ml={},Un=Jr(Ml),rl=Jr(Ml),il=Jr(Ml);function di(t){if(t===Ml)throw Error(X(174));return t}function wm(t,e){switch($e(il,e),$e(rl,t),$e(Un,Ml),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Bf(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Bf(e,t)}Ae(Un),$e(Un,e)}function Ps(){Ae(Un),Ae(rl),Ae(il)}function OS(t){di(il.current);var e=di(Un.current),n=Bf(e,t.type);e!==n&&($e(rl,t),$e(Un,n))}function km(t){rl.current===t&&(Ae(Un),Ae(rl))}var Ze=Jr(0);function Cc(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ph=[];function bm(){for(var t=0;t<Ph.length;t++)Ph[t]._workInProgressVersionPrimary=null;Ph.length=0}var Na=gr.ReactCurrentDispatcher,Qh=gr.ReactCurrentBatchConfig,Pi=0,Ve=null,Ue=null,Je=null,Ac=!1,Eo=!1,sl=0,TT=0;function ht(){throw Error(X(321))}function Pm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!$n(t[n],e[n]))return!1;return!0}function Qm(t,e,n,r,i,s){if(Pi=s,Ve=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Na.current=t===null||t.memoizedState===null?ET:RT,t=n(r,i),Eo){s=0;do{if(Eo=!1,sl=0,25<=s)throw Error(X(301));s+=1,Je=Ue=null,e.updateQueue=null,Na.current=jT,t=n(r,i)}while(Eo)}if(Na.current=Mc,e=Ue!==null&&Ue.next!==null,Pi=0,Je=Ue=Ve=null,Ac=!1,e)throw Error(X(300));return t}function $m(){var t=sl!==0;return sl=0,t}function Vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?Ve.memoizedState=Je=t:Je=Je.next=t,Je}function fn(){if(Ue===null){var t=Ve.alternate;t=t!==null?t.memoizedState:null}else t=Ue.next;var e=Je===null?Ve.memoizedState:Je.next;if(e!==null)Je=e,Ue=t;else{if(t===null)throw Error(X(310));Ue=t,t={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},Je===null?Ve.memoizedState=Je=t:Je=Je.next=t}return Je}function ol(t,e){return typeof e=="function"?e(t):e}function $h(t){var e=fn(),n=e.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=t;var r=Ue,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,a=null,c=s;do{var u=c.lane;if((Pi&u)===u)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var h={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=h,o=r):a=a.next=h,Ve.lanes|=u,Qi|=u}c=c.next}while(c!==null&&c!==s);a===null?o=r:a.next=l,$n(r,e.memoizedState)||(Et=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=a,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Ve.lanes|=s,Qi|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Th(t){var e=fn(),n=e.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);$n(s,e.memoizedState)||(Et=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function gS(){}function yS(t,e){var n=Ve,r=fn(),i=e(),s=!$n(r.memoizedState,i);if(s&&(r.memoizedState=i,Et=!0),r=r.queue,Tm(SS.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Je!==null&&Je.memoizedState.tag&1){if(n.flags|=2048,ll(9,vS.bind(null,n,r,i,e),void 0,null),tt===null)throw Error(X(349));Pi&30||xS(n,e,i)}return i}function xS(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ve.updateQueue,e===null?(e={lastEffect:null,stores:null},Ve.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function vS(t,e,n,r){e.value=n,e.getSnapshot=r,wS(e)&&kS(t)}function SS(t,e,n){return n(function(){wS(e)&&kS(t)})}function wS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!$n(t,n)}catch{return!0}}function kS(t){var e=dr(t,1);e!==null&&Pn(e,t,1,-1)}function Yg(t){var e=Vn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:t},e.queue=t,t=t.dispatch=MT.bind(null,Ve,t),[e.memoizedState,t]}function ll(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Ve.updateQueue,e===null?(e={lastEffect:null,stores:null},Ve.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function bS(){return fn().memoizedState}function za(t,e,n,r){var i=Vn();Ve.flags|=t,i.memoizedState=ll(1|e,n,void 0,r===void 0?null:r)}function Cu(t,e,n,r){var i=fn();r=r===void 0?null:r;var s=void 0;if(Ue!==null){var o=Ue.memoizedState;if(s=o.destroy,r!==null&&Pm(r,o.deps)){i.memoizedState=ll(e,n,s,r);return}}Ve.flags|=t,i.memoizedState=ll(1|e,n,s,r)}function Fg(t,e){return za(8390656,8,t,e)}function Tm(t,e){return Cu(2048,8,t,e)}function PS(t,e){return Cu(4,2,t,e)}function QS(t,e){return Cu(4,4,t,e)}function $S(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function TS(t,e,n){return n=n!=null?n.concat([t]):null,Cu(4,4,$S.bind(null,e,t),n)}function Cm(){}function CS(t,e){var n=fn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Pm(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function AS(t,e){var n=fn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Pm(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function MS(t,e,n){return Pi&21?($n(n,e)||(n=Vv(),Ve.lanes|=n,Qi|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Et=!0),t.memoizedState=n)}function CT(t,e){var n=Se;Se=n!==0&&4>n?n:4,t(!0);var r=Qh.transition;Qh.transition={};try{t(!1),e()}finally{Se=n,Qh.transition=r}}function ES(){return fn().memoizedState}function AT(t,e,n){var r=Dr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},RS(t))jS(e,n);else if(n=pS(t,e,n,r),n!==null){var i=bt();Pn(n,t,r,i),ZS(n,e,r)}}function MT(t,e,n){var r=Dr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(RS(t))jS(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,$n(l,o)){var a=e.interleaved;a===null?(i.next=i,vm(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=pS(t,e,i,r),n!==null&&(i=bt(),Pn(n,t,r,i),ZS(n,e,r))}}function RS(t){var e=t.alternate;return t===Ve||e!==null&&e===Ve}function jS(t,e){Eo=Ac=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function ZS(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,om(t,n)}}var Mc={readContext:hn,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useInsertionEffect:ht,useLayoutEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useMutableSource:ht,useSyncExternalStore:ht,useId:ht,unstable_isNewReconciler:!1},ET={readContext:hn,useCallback:function(t,e){return Vn().memoizedState=[t,e===void 0?null:e],t},useContext:hn,useEffect:Fg,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,za(4194308,4,$S.bind(null,e,t),n)},useLayoutEffect:function(t,e){return za(4194308,4,t,e)},useInsertionEffect:function(t,e){return za(4,2,t,e)},useMemo:function(t,e){var n=Vn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Vn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=AT.bind(null,Ve,t),[r.memoizedState,t]},useRef:function(t){var e=Vn();return t={current:t},e.memoizedState=t},useState:Yg,useDebugValue:Cm,useDeferredValue:function(t){return Vn().memoizedState=t},useTransition:function(){var t=Yg(!1),e=t[0];return t=CT.bind(null,t[1]),Vn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ve,i=Vn();if(Me){if(n===void 0)throw Error(X(407));n=n()}else{if(n=e(),tt===null)throw Error(X(349));Pi&30||xS(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Fg(SS.bind(null,r,s,t),[t]),r.flags|=2048,ll(9,vS.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Vn(),e=tt.identifierPrefix;if(Me){var n=lr,r=or;n=(r&~(1<<32-bn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=sl++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=TT++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},RT={readContext:hn,useCallback:CS,useContext:hn,useEffect:Tm,useImperativeHandle:TS,useInsertionEffect:PS,useLayoutEffect:QS,useMemo:AS,useReducer:$h,useRef:bS,useState:function(){return $h(ol)},useDebugValue:Cm,useDeferredValue:function(t){var e=fn();return MS(e,Ue.memoizedState,t)},useTransition:function(){var t=$h(ol)[0],e=fn().memoizedState;return[t,e]},useMutableSource:gS,useSyncExternalStore:yS,useId:ES,unstable_isNewReconciler:!1},jT={readContext:hn,useCallback:CS,useContext:hn,useEffect:Tm,useImperativeHandle:TS,useInsertionEffect:PS,useLayoutEffect:QS,useMemo:AS,useReducer:Th,useRef:bS,useState:function(){return Th(ol)},useDebugValue:Cm,useDeferredValue:function(t){var e=fn();return Ue===null?e.memoizedState=t:MS(e,Ue.memoizedState,t)},useTransition:function(){var t=Th(ol)[0],e=fn().memoizedState;return[t,e]},useMutableSource:gS,useSyncExternalStore:yS,useId:ES,unstable_isNewReconciler:!1};function yn(t,e){if(t&&t.defaultProps){e=Xe({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function fd(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Xe({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Au={isMounted:function(t){return(t=t._reactInternals)?Ri(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=bt(),i=Dr(t),s=ar(r,i);s.payload=e,n!=null&&(s.callback=n),e=Xr(t,s,i),e!==null&&(Pn(e,t,i,r),_a(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=bt(),i=Dr(t),s=ar(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Xr(t,s,i),e!==null&&(Pn(e,t,i,r),_a(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=bt(),r=Dr(t),i=ar(n,r);i.tag=2,e!=null&&(i.callback=e),e=Xr(t,i,r),e!==null&&(Pn(e,t,r,n),_a(e,t,r))}};function qg(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Jo(n,r)||!Jo(i,s):!0}function VS(t,e,n){var r=!1,i=Wr,s=e.contextType;return typeof s=="object"&&s!==null?s=hn(s):(i=Zt(e)?ki:yt.current,r=e.contextTypes,s=(r=r!=null)?ws(t,i):Wr),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Au,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function Ug(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Au.enqueueReplaceState(e,e.state,null)}function dd(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},Sm(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=hn(s):(s=Zt(e)?ki:yt.current,i.context=ws(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(fd(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Au.enqueueReplaceState(i,i.state,null),Tc(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Qs(t,e){try{var n="",r=e;do n+=a$(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Ch(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function pd(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var ZT=typeof WeakMap=="function"?WeakMap:Map;function XS(t,e,n){n=ar(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Rc||(Rc=!0,bd=r),pd(t,e)},n}function LS(t,e,n){n=ar(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){pd(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){pd(t,e),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Gg(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new ZT;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=UT.bind(null,t,e,n),e.then(t,t))}function Hg(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Kg(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ar(-1,1),e.tag=2,Xr(n,e,1))),n.lanes|=1),t)}var VT=gr.ReactCurrentOwner,Et=!1;function vt(t,e,n,r){e.child=t===null?dS(e,null,n,r):bs(e,t.child,n,r)}function Jg(t,e,n,r,i){n=n.render;var s=e.ref;return fs(e,i),r=Qm(t,e,n,r,s,i),n=$m(),t!==null&&!Et?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,pr(t,e,i)):(Me&&n&&pm(e),e.flags|=1,vt(t,e,r,i),e.child)}function e0(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!Xm(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,DS(t,e,s,r,i)):(t=Ya(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Jo,n(o,r)&&t.ref===e.ref)return pr(t,e,i)}return e.flags|=1,t=_r(s,r),t.ref=e.ref,t.return=e,e.child=t}function DS(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Jo(s,r)&&t.ref===e.ref)if(Et=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(Et=!0);else return e.lanes=t.lanes,pr(t,e,i)}return md(t,e,n,r,i)}function _S(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(ts,It),It|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,$e(ts,It),It|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,$e(ts,It),It|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,$e(ts,It),It|=r;return vt(t,e,i,n),e.child}function NS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function md(t,e,n,r,i){var s=Zt(n)?ki:yt.current;return s=ws(e,s),fs(e,i),n=Qm(t,e,n,r,s,i),r=$m(),t!==null&&!Et?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,pr(t,e,i)):(Me&&r&&pm(e),e.flags|=1,vt(t,e,n,i),e.child)}function t0(t,e,n,r,i){if(Zt(n)){var s=!0;kc(e)}else s=!1;if(fs(e,i),e.stateNode===null)Wa(t,e),VS(e,n,r),dd(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var a=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=hn(c):(c=Zt(n)?ki:yt.current,c=ws(e,c));var u=n.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||a!==c)&&Ug(e,o,r,c),kr=!1;var f=e.memoizedState;o.state=f,Tc(e,r,o,i),a=e.memoizedState,l!==r||f!==a||jt.current||kr?(typeof u=="function"&&(fd(e,n,u,r),a=e.memoizedState),(l=kr||qg(e,n,l,r,f,a,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=a),o.props=r,o.state=a,o.context=c,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,mS(t,e),l=e.memoizedProps,c=e.type===e.elementType?l:yn(e.type,l),o.props=c,h=e.pendingProps,f=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=hn(a):(a=Zt(n)?ki:yt.current,a=ws(e,a));var d=n.getDerivedStateFromProps;(u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||f!==a)&&Ug(e,o,r,a),kr=!1,f=e.memoizedState,o.state=f,Tc(e,r,o,i);var p=e.memoizedState;l!==h||f!==p||jt.current||kr?(typeof d=="function"&&(fd(e,n,d,r),p=e.memoizedState),(c=kr||qg(e,n,c,r,f,p,a)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,a)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),o.props=r,o.state=p,o.context=a,r=c):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return Od(t,e,n,r,s,i)}function Od(t,e,n,r,i,s){NS(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&_g(e,n,!1),pr(t,e,s);r=e.stateNode,VT.current=e;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=bs(e,t.child,null,s),e.child=bs(e,null,l,s)):vt(t,e,l,s),e.memoizedState=r.state,i&&_g(e,n,!0),e.child}function zS(t){var e=t.stateNode;e.pendingContext?Dg(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Dg(t,e.context,!1),wm(t,e.containerInfo)}function n0(t,e,n,r,i){return ks(),Om(i),e.flags|=256,vt(t,e,n,r),e.child}var gd={dehydrated:null,treeContext:null,retryLane:0};function yd(t){return{baseLanes:t,cachePool:null,transitions:null}}function WS(t,e,n){var r=e.pendingProps,i=Ze.current,s=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),$e(Ze,i&1),t===null)return ud(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Ru(o,r,0,null),t=vi(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=yd(n),e.memoizedState=gd,t):Am(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return XT(t,e,o,r,l,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=a,e.deletions=null):(r=_r(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=_r(l,s):(s=vi(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?yd(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=gd,r}return s=t.child,t=s.sibling,r=_r(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Am(t,e){return e=Ru({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function sa(t,e,n,r){return r!==null&&Om(r),bs(e,t.child,null,n),t=Am(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function XT(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=Ch(Error(X(422))),sa(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Ru({mode:"visible",children:r.children},i,0,null),s=vi(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&bs(e,t.child,null,o),e.child.memoizedState=yd(o),e.memoizedState=gd,s);if(!(e.mode&1))return sa(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(X(419)),r=Ch(s,r,void 0),sa(t,e,o,r)}if(l=(o&t.childLanes)!==0,Et||l){if(r=tt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,dr(t,i),Pn(r,t,i,-1))}return Vm(),r=Ch(Error(X(421))),sa(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=GT.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Yt=Vr(i.nextSibling),Ft=e,Me=!0,vn=null,t!==null&&(en[tn++]=or,en[tn++]=lr,en[tn++]=bi,or=t.id,lr=t.overflow,bi=e),e=Am(e,r.children),e.flags|=4096,e)}function r0(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),hd(t.return,e,n)}function Ah(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function IS(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(vt(t,e,r.children,n),r=Ze.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&r0(t,n,e);else if(t.tag===19)r0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if($e(Ze,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Cc(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ah(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Cc(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ah(e,!0,n,null,s);break;case"together":Ah(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Wa(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function pr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Qi|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(X(153));if(e.child!==null){for(t=e.child,n=_r(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=_r(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function LT(t,e,n){switch(e.tag){case 3:zS(e),ks();break;case 5:OS(e);break;case 1:Zt(e.type)&&kc(e);break;case 4:wm(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;$e(Qc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?($e(Ze,Ze.current&1),e.flags|=128,null):n&e.child.childLanes?WS(t,e,n):($e(Ze,Ze.current&1),t=pr(t,e,n),t!==null?t.sibling:null);$e(Ze,Ze.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return IS(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Ze,Ze.current),r)break;return null;case 22:case 23:return e.lanes=0,_S(t,e,n)}return pr(t,e,n)}var BS,xd,YS,FS;BS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};xd=function(){};YS=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,di(Un.current);var s=null;switch(n){case"input":i=Nf(t,i),r=Nf(t,r),s=[];break;case"select":i=Xe({},i,{value:void 0}),r=Xe({},r,{value:void 0}),s=[];break;case"textarea":i=If(t,i),r=If(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Sc)}Yf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Yo.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var a=r[c];if(l=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(s||(s=[]),s.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Yo.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&Te("scroll",t),s||l===a||(s=[])):(s=s||[]).push(c,a))}n&&(s=s||[]).push("style",n);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};FS=function(t,e,n,r){n!==r&&(e.flags|=4)};function lo(t,e){if(!Me)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ft(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function DT(t,e,n){var r=e.pendingProps;switch(mm(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(e),null;case 1:return Zt(e.type)&&wc(),ft(e),null;case 3:return r=e.stateNode,Ps(),Ae(jt),Ae(yt),bm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(ra(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,vn!==null&&($d(vn),vn=null))),xd(t,e),ft(e),null;case 5:km(e);var i=di(il.current);if(n=e.type,t!==null&&e.stateNode!=null)YS(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(X(166));return ft(e),null}if(t=di(Un.current),ra(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[_n]=e,r[nl]=s,t=(e.mode&1)!==0,n){case"dialog":Te("cancel",r),Te("close",r);break;case"iframe":case"object":case"embed":Te("load",r);break;case"video":case"audio":for(i=0;i<wo.length;i++)Te(wo[i],r);break;case"source":Te("error",r);break;case"img":case"image":case"link":Te("error",r),Te("load",r);break;case"details":Te("toggle",r);break;case"input":fg(r,s),Te("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Te("invalid",r);break;case"textarea":pg(r,s),Te("invalid",r)}Yf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&na(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&na(r.textContent,l,t),i=["children",""+l]):Yo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Te("scroll",r)}switch(n){case"input":ql(r),dg(r,s,!0);break;case"textarea":ql(r),mg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Sc)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Sv(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[_n]=e,t[nl]=r,BS(t,e,!1,!1),e.stateNode=t;e:{switch(o=Ff(n,r),n){case"dialog":Te("cancel",t),Te("close",t),i=r;break;case"iframe":case"object":case"embed":Te("load",t),i=r;break;case"video":case"audio":for(i=0;i<wo.length;i++)Te(wo[i],t);i=r;break;case"source":Te("error",t),i=r;break;case"img":case"image":case"link":Te("error",t),Te("load",t),i=r;break;case"details":Te("toggle",t),i=r;break;case"input":fg(t,r),i=Nf(t,r),Te("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Xe({},r,{value:void 0}),Te("invalid",t);break;case"textarea":pg(t,r),i=If(t,r),Te("invalid",t);break;default:i=r}Yf(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?bv(t,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&wv(t,a)):s==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Fo(t,a):typeof a=="number"&&Fo(t,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Yo.hasOwnProperty(s)?a!=null&&s==="onScroll"&&Te("scroll",t):a!=null&&em(t,s,a,o))}switch(n){case"input":ql(t),dg(t,r,!1);break;case"textarea":ql(t),mg(t);break;case"option":r.value!=null&&t.setAttribute("value",""+zr(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?as(t,!!r.multiple,s,!1):r.defaultValue!=null&&as(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Sc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ft(e),null;case 6:if(t&&e.stateNode!=null)FS(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(X(166));if(n=di(il.current),di(Un.current),ra(e)){if(r=e.stateNode,n=e.memoizedProps,r[_n]=e,(s=r.nodeValue!==n)&&(t=Ft,t!==null))switch(t.tag){case 3:na(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&na(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[_n]=e,e.stateNode=r}return ft(e),null;case 13:if(Ae(Ze),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Me&&Yt!==null&&e.mode&1&&!(e.flags&128))hS(),ks(),e.flags|=98560,s=!1;else if(s=ra(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(X(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(X(317));s[_n]=e}else ks(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ft(e),s=!1}else vn!==null&&($d(vn),vn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Ze.current&1?He===0&&(He=3):Vm())),e.updateQueue!==null&&(e.flags|=4),ft(e),null);case 4:return Ps(),xd(t,e),t===null&&el(e.stateNode.containerInfo),ft(e),null;case 10:return xm(e.type._context),ft(e),null;case 17:return Zt(e.type)&&wc(),ft(e),null;case 19:if(Ae(Ze),s=e.memoizedState,s===null)return ft(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)lo(s,!1);else{if(He!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Cc(t),o!==null){for(e.flags|=128,lo(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return $e(Ze,Ze.current&1|2),e.child}t=t.sibling}s.tail!==null&&ze()>$s&&(e.flags|=128,r=!0,lo(s,!1),e.lanes=4194304)}else{if(!r)if(t=Cc(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),lo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Me)return ft(e),null}else 2*ze()-s.renderingStartTime>$s&&n!==1073741824&&(e.flags|=128,r=!0,lo(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ze(),e.sibling=null,n=Ze.current,$e(Ze,r?n&1|2:n&1),e):(ft(e),null);case 22:case 23:return Zm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?It&1073741824&&(ft(e),e.subtreeFlags&6&&(e.flags|=8192)):ft(e),null;case 24:return null;case 25:return null}throw Error(X(156,e.tag))}function _T(t,e){switch(mm(e),e.tag){case 1:return Zt(e.type)&&wc(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ps(),Ae(jt),Ae(yt),bm(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return km(e),null;case 13:if(Ae(Ze),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));ks()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ae(Ze),null;case 4:return Ps(),null;case 10:return xm(e.type._context),null;case 22:case 23:return Zm(),null;case 24:return null;default:return null}}var oa=!1,pt=!1,NT=typeof WeakSet=="function"?WeakSet:Set,Y=null;function es(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(t,e,r)}else n.current=null}function vd(t,e,n){try{n()}catch(r){De(t,e,r)}}var i0=!1;function zT(t,e){if(rd=yc,t=Kv(),dm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,h=t,f=null;t:for(;;){for(var d;h!==n||i!==0&&h.nodeType!==3||(l=o+i),h!==s||r!==0&&h.nodeType!==3||(a=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===t)break t;if(f===n&&++c===i&&(l=o),f===s&&++u===r&&(a=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(id={focusedElem:t,selectionRange:n},yc=!1,Y=e;Y!==null;)if(e=Y,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Y=t;else for(;Y!==null;){e=Y;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var x=p.memoizedProps,S=p.memoizedState,O=e.stateNode,y=O.getSnapshotBeforeUpdate(e.elementType===e.type?x:yn(e.type,x),S);O.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(w){De(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,Y=t;break}Y=e.return}return p=i0,i0=!1,p}function Ro(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&vd(e,n,s)}i=i.next}while(i!==r)}}function Mu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Sd(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function qS(t){var e=t.alternate;e!==null&&(t.alternate=null,qS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[_n],delete e[nl],delete e[ld],delete e[bT],delete e[PT])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function US(t){return t.tag===5||t.tag===3||t.tag===4}function s0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||US(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function wd(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Sc));else if(r!==4&&(t=t.child,t!==null))for(wd(t,e,n),t=t.sibling;t!==null;)wd(t,e,n),t=t.sibling}function kd(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(kd(t,e,n),t=t.sibling;t!==null;)kd(t,e,n),t=t.sibling}var rt=null,xn=!1;function xr(t,e,n){for(n=n.child;n!==null;)GS(t,e,n),n=n.sibling}function GS(t,e,n){if(qn&&typeof qn.onCommitFiberUnmount=="function")try{qn.onCommitFiberUnmount(ku,n)}catch{}switch(n.tag){case 5:pt||es(n,e);case 6:var r=rt,i=xn;rt=null,xr(t,e,n),rt=r,xn=i,rt!==null&&(xn?(t=rt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):rt.removeChild(n.stateNode));break;case 18:rt!==null&&(xn?(t=rt,n=n.stateNode,t.nodeType===8?kh(t.parentNode,n):t.nodeType===1&&kh(t,n),Ho(t)):kh(rt,n.stateNode));break;case 4:r=rt,i=xn,rt=n.stateNode.containerInfo,xn=!0,xr(t,e,n),rt=r,xn=i;break;case 0:case 11:case 14:case 15:if(!pt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&vd(n,e,o),i=i.next}while(i!==r)}xr(t,e,n);break;case 1:if(!pt&&(es(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){De(n,e,l)}xr(t,e,n);break;case 21:xr(t,e,n);break;case 22:n.mode&1?(pt=(r=pt)||n.memoizedState!==null,xr(t,e,n),pt=r):xr(t,e,n);break;default:xr(t,e,n)}}function o0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new NT),e.forEach(function(r){var i=HT.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function mn(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:rt=l.stateNode,xn=!1;break e;case 3:rt=l.stateNode.containerInfo,xn=!0;break e;case 4:rt=l.stateNode.containerInfo,xn=!0;break e}l=l.return}if(rt===null)throw Error(X(160));GS(s,o,i),rt=null,xn=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(c){De(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)HS(e,t),e=e.sibling}function HS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(mn(e,t),Mn(t),r&4){try{Ro(3,t,t.return),Mu(3,t)}catch(x){De(t,t.return,x)}try{Ro(5,t,t.return)}catch(x){De(t,t.return,x)}}break;case 1:mn(e,t),Mn(t),r&512&&n!==null&&es(n,n.return);break;case 5:if(mn(e,t),Mn(t),r&512&&n!==null&&es(n,n.return),t.flags&32){var i=t.stateNode;try{Fo(i,"")}catch(x){De(t,t.return,x)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,l=t.type,a=t.updateQueue;if(t.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&xv(i,s),Ff(l,o);var c=Ff(l,s);for(o=0;o<a.length;o+=2){var u=a[o],h=a[o+1];u==="style"?bv(i,h):u==="dangerouslySetInnerHTML"?wv(i,h):u==="children"?Fo(i,h):em(i,u,h,c)}switch(l){case"input":zf(i,s);break;case"textarea":vv(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var d=s.value;d!=null?as(i,!!s.multiple,d,!1):f!==!!s.multiple&&(s.defaultValue!=null?as(i,!!s.multiple,s.defaultValue,!0):as(i,!!s.multiple,s.multiple?[]:"",!1))}i[nl]=s}catch(x){De(t,t.return,x)}}break;case 6:if(mn(e,t),Mn(t),r&4){if(t.stateNode===null)throw Error(X(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(x){De(t,t.return,x)}}break;case 3:if(mn(e,t),Mn(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ho(e.containerInfo)}catch(x){De(t,t.return,x)}break;case 4:mn(e,t),Mn(t);break;case 13:mn(e,t),Mn(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Rm=ze())),r&4&&o0(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(pt=(c=pt)||u,mn(e,t),pt=c):mn(e,t),Mn(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&t.mode&1)for(Y=t,u=t.child;u!==null;){for(h=Y=u;Y!==null;){switch(f=Y,d=f.child,f.tag){case 0:case 11:case 14:case 15:Ro(4,f,f.return);break;case 1:es(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(x){De(r,n,x)}}break;case 5:es(f,f.return);break;case 22:if(f.memoizedState!==null){a0(h);continue}}d!==null?(d.return=f,Y=d):a0(h)}u=u.sibling}e:for(u=null,h=t;;){if(h.tag===5){if(u===null){u=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=h.stateNode,a=h.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=kv("display",o))}catch(x){De(t,t.return,x)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(x){De(t,t.return,x)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:mn(e,t),Mn(t),r&4&&o0(t);break;case 21:break;default:mn(e,t),Mn(t)}}function Mn(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(US(n)){var r=n;break e}n=n.return}throw Error(X(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Fo(i,""),r.flags&=-33);var s=s0(t);kd(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=s0(t);wd(t,l,o);break;default:throw Error(X(161))}}catch(a){De(t,t.return,a)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function WT(t,e,n){Y=t,KS(t)}function KS(t,e,n){for(var r=(t.mode&1)!==0;Y!==null;){var i=Y,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||oa;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||pt;l=oa;var c=pt;if(oa=o,(pt=a)&&!c)for(Y=i;Y!==null;)o=Y,a=o.child,o.tag===22&&o.memoizedState!==null?c0(i):a!==null?(a.return=o,Y=a):c0(i);for(;s!==null;)Y=s,KS(s),s=s.sibling;Y=i,oa=l,pt=c}l0(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Y=s):l0(t)}}function l0(t){for(;Y!==null;){var e=Y;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:pt||Mu(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!pt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:yn(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Bg(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Bg(e,o,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var a=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&Ho(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}pt||e.flags&512&&Sd(e)}catch(f){De(e,e.return,f)}}if(e===t){Y=null;break}if(n=e.sibling,n!==null){n.return=e.return,Y=n;break}Y=e.return}}function a0(t){for(;Y!==null;){var e=Y;if(e===t){Y=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Y=n;break}Y=e.return}}function c0(t){for(;Y!==null;){var e=Y;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Mu(4,e)}catch(a){De(e,n,a)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(a){De(e,i,a)}}var s=e.return;try{Sd(e)}catch(a){De(e,s,a)}break;case 5:var o=e.return;try{Sd(e)}catch(a){De(e,o,a)}}}catch(a){De(e,e.return,a)}if(e===t){Y=null;break}var l=e.sibling;if(l!==null){l.return=e.return,Y=l;break}Y=e.return}}var IT=Math.ceil,Ec=gr.ReactCurrentDispatcher,Mm=gr.ReactCurrentOwner,cn=gr.ReactCurrentBatchConfig,ye=0,tt=null,Ye=null,at=0,It=0,ts=Jr(0),He=0,al=null,Qi=0,Eu=0,Em=0,jo=null,At=null,Rm=0,$s=1/0,nr=null,Rc=!1,bd=null,Lr=null,la=!1,Ar=null,jc=0,Zo=0,Pd=null,Ia=-1,Ba=0;function bt(){return ye&6?ze():Ia!==-1?Ia:Ia=ze()}function Dr(t){return t.mode&1?ye&2&&at!==0?at&-at:$T.transition!==null?(Ba===0&&(Ba=Vv()),Ba):(t=Se,t!==0||(t=window.event,t=t===void 0?16:Wv(t.type)),t):1}function Pn(t,e,n,r){if(50<Zo)throw Zo=0,Pd=null,Error(X(185));Tl(t,n,r),(!(ye&2)||t!==tt)&&(t===tt&&(!(ye&2)&&(Eu|=n),He===4&&$r(t,at)),Vt(t,r),n===1&&ye===0&&!(e.mode&1)&&($s=ze()+500,Tu&&ei()))}function Vt(t,e){var n=t.callbackNode;$$(t,e);var r=gc(t,t===tt?at:0);if(r===0)n!==null&&yg(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&yg(n),e===1)t.tag===0?QT(u0.bind(null,t)):aS(u0.bind(null,t)),wT(function(){!(ye&6)&&ei()}),n=null;else{switch(Xv(r)){case 1:n=sm;break;case 4:n=jv;break;case 16:n=Oc;break;case 536870912:n=Zv;break;default:n=Oc}n=ow(n,JS.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function JS(t,e){if(Ia=-1,Ba=0,ye&6)throw Error(X(327));var n=t.callbackNode;if(ds()&&t.callbackNode!==n)return null;var r=gc(t,t===tt?at:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Zc(t,r);else{e=r;var i=ye;ye|=2;var s=tw();(tt!==t||at!==e)&&(nr=null,$s=ze()+500,xi(t,e));do try{FT();break}catch(l){ew(t,l)}while(!0);ym(),Ec.current=s,ye=i,Ye!==null?e=0:(tt=null,at=0,e=He)}if(e!==0){if(e===2&&(i=Kf(t),i!==0&&(r=i,e=Qd(t,i))),e===1)throw n=al,xi(t,0),$r(t,r),Vt(t,ze()),n;if(e===6)$r(t,r);else{if(i=t.current.alternate,!(r&30)&&!BT(i)&&(e=Zc(t,r),e===2&&(s=Kf(t),s!==0&&(r=s,e=Qd(t,s))),e===1))throw n=al,xi(t,0),$r(t,r),Vt(t,ze()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(X(345));case 2:li(t,At,nr);break;case 3:if($r(t,r),(r&130023424)===r&&(e=Rm+500-ze(),10<e)){if(gc(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){bt(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=od(li.bind(null,t,At,nr),e);break}li(t,At,nr);break;case 4:if($r(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-bn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*IT(r/1960))-r,10<r){t.timeoutHandle=od(li.bind(null,t,At,nr),r);break}li(t,At,nr);break;case 5:li(t,At,nr);break;default:throw Error(X(329))}}}return Vt(t,ze()),t.callbackNode===n?JS.bind(null,t):null}function Qd(t,e){var n=jo;return t.current.memoizedState.isDehydrated&&(xi(t,e).flags|=256),t=Zc(t,e),t!==2&&(e=At,At=n,e!==null&&$d(e)),t}function $d(t){At===null?At=t:At.push.apply(At,t)}function BT(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!$n(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function $r(t,e){for(e&=~Em,e&=~Eu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-bn(e),r=1<<n;t[n]=-1,e&=~r}}function u0(t){if(ye&6)throw Error(X(327));ds();var e=gc(t,0);if(!(e&1))return Vt(t,ze()),null;var n=Zc(t,e);if(t.tag!==0&&n===2){var r=Kf(t);r!==0&&(e=r,n=Qd(t,r))}if(n===1)throw n=al,xi(t,0),$r(t,e),Vt(t,ze()),n;if(n===6)throw Error(X(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,li(t,At,nr),Vt(t,ze()),null}function jm(t,e){var n=ye;ye|=1;try{return t(e)}finally{ye=n,ye===0&&($s=ze()+500,Tu&&ei())}}function $i(t){Ar!==null&&Ar.tag===0&&!(ye&6)&&ds();var e=ye;ye|=1;var n=cn.transition,r=Se;try{if(cn.transition=null,Se=1,t)return t()}finally{Se=r,cn.transition=n,ye=e,!(ye&6)&&ei()}}function Zm(){It=ts.current,Ae(ts)}function xi(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,ST(n)),Ye!==null)for(n=Ye.return;n!==null;){var r=n;switch(mm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wc();break;case 3:Ps(),Ae(jt),Ae(yt),bm();break;case 5:km(r);break;case 4:Ps();break;case 13:Ae(Ze);break;case 19:Ae(Ze);break;case 10:xm(r.type._context);break;case 22:case 23:Zm()}n=n.return}if(tt=t,Ye=t=_r(t.current,null),at=It=e,He=0,al=null,Em=Eu=Qi=0,At=jo=null,fi!==null){for(e=0;e<fi.length;e++)if(n=fi[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}fi=null}return t}function ew(t,e){do{var n=Ye;try{if(ym(),Na.current=Mc,Ac){for(var r=Ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ac=!1}if(Pi=0,Je=Ue=Ve=null,Eo=!1,sl=0,Mm.current=null,n===null||n.return===null){He=1,al=e,Ye=null;break}e:{var s=t,o=n.return,l=n,a=e;if(e=at,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var d=Hg(o);if(d!==null){d.flags&=-257,Kg(d,o,l,s,e),d.mode&1&&Gg(s,c,e),e=d,a=c;var p=e.updateQueue;if(p===null){var x=new Set;x.add(a),e.updateQueue=x}else p.add(a);break e}else{if(!(e&1)){Gg(s,c,e),Vm();break e}a=Error(X(426))}}else if(Me&&l.mode&1){var S=Hg(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Kg(S,o,l,s,e),Om(Qs(a,l));break e}}s=a=Qs(a,l),He!==4&&(He=2),jo===null?jo=[s]:jo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var O=XS(s,a,e);Ig(s,O);break e;case 1:l=a;var y=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Lr===null||!Lr.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=LS(s,l,e);Ig(s,w);break e}}s=s.return}while(s!==null)}rw(n)}catch(k){e=k,Ye===n&&n!==null&&(Ye=n=n.return);continue}break}while(!0)}function tw(){var t=Ec.current;return Ec.current=Mc,t===null?Mc:t}function Vm(){(He===0||He===3||He===2)&&(He=4),tt===null||!(Qi&268435455)&&!(Eu&268435455)||$r(tt,at)}function Zc(t,e){var n=ye;ye|=2;var r=tw();(tt!==t||at!==e)&&(nr=null,xi(t,e));do try{YT();break}catch(i){ew(t,i)}while(!0);if(ym(),ye=n,Ec.current=r,Ye!==null)throw Error(X(261));return tt=null,at=0,He}function YT(){for(;Ye!==null;)nw(Ye)}function FT(){for(;Ye!==null&&!y$();)nw(Ye)}function nw(t){var e=sw(t.alternate,t,It);t.memoizedProps=t.pendingProps,e===null?rw(t):Ye=e,Mm.current=null}function rw(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=_T(n,e),n!==null){n.flags&=32767,Ye=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{He=6,Ye=null;return}}else if(n=DT(n,e,It),n!==null){Ye=n;return}if(e=e.sibling,e!==null){Ye=e;return}Ye=e=t}while(e!==null);He===0&&(He=5)}function li(t,e,n){var r=Se,i=cn.transition;try{cn.transition=null,Se=1,qT(t,e,n,r)}finally{cn.transition=i,Se=r}return null}function qT(t,e,n,r){do ds();while(Ar!==null);if(ye&6)throw Error(X(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(X(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(T$(t,s),t===tt&&(Ye=tt=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||la||(la=!0,ow(Oc,function(){return ds(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=cn.transition,cn.transition=null;var o=Se;Se=1;var l=ye;ye|=4,Mm.current=null,zT(t,n),HS(n,t),pT(id),yc=!!rd,id=rd=null,t.current=n,WT(n),x$(),ye=l,Se=o,cn.transition=s}else t.current=n;if(la&&(la=!1,Ar=t,jc=i),s=t.pendingLanes,s===0&&(Lr=null),w$(n.stateNode),Vt(t,ze()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Rc)throw Rc=!1,t=bd,bd=null,t;return jc&1&&t.tag!==0&&ds(),s=t.pendingLanes,s&1?t===Pd?Zo++:(Zo=0,Pd=t):Zo=0,ei(),null}function ds(){if(Ar!==null){var t=Xv(jc),e=cn.transition,n=Se;try{if(cn.transition=null,Se=16>t?16:t,Ar===null)var r=!1;else{if(t=Ar,Ar=null,jc=0,ye&6)throw Error(X(331));var i=ye;for(ye|=4,Y=t.current;Y!==null;){var s=Y,o=s.child;if(Y.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(Y=c;Y!==null;){var u=Y;switch(u.tag){case 0:case 11:case 15:Ro(8,u,s)}var h=u.child;if(h!==null)h.return=u,Y=h;else for(;Y!==null;){u=Y;var f=u.sibling,d=u.return;if(qS(u),u===c){Y=null;break}if(f!==null){f.return=d,Y=f;break}Y=d}}}var p=s.alternate;if(p!==null){var x=p.child;if(x!==null){p.child=null;do{var S=x.sibling;x.sibling=null,x=S}while(x!==null)}}Y=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,Y=o;else e:for(;Y!==null;){if(s=Y,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ro(9,s,s.return)}var O=s.sibling;if(O!==null){O.return=s.return,Y=O;break e}Y=s.return}}var y=t.current;for(Y=y;Y!==null;){o=Y;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,Y=v;else e:for(o=y;Y!==null;){if(l=Y,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Mu(9,l)}}catch(k){De(l,l.return,k)}if(l===o){Y=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,Y=w;break e}Y=l.return}}if(ye=i,ei(),qn&&typeof qn.onPostCommitFiberRoot=="function")try{qn.onPostCommitFiberRoot(ku,t)}catch{}r=!0}return r}finally{Se=n,cn.transition=e}}return!1}function h0(t,e,n){e=Qs(n,e),e=XS(t,e,1),t=Xr(t,e,1),e=bt(),t!==null&&(Tl(t,1,e),Vt(t,e))}function De(t,e,n){if(t.tag===3)h0(t,t,n);else for(;e!==null;){if(e.tag===3){h0(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Lr===null||!Lr.has(r))){t=Qs(n,t),t=LS(e,t,1),e=Xr(e,t,1),t=bt(),e!==null&&(Tl(e,1,t),Vt(e,t));break}}e=e.return}}function UT(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=bt(),t.pingedLanes|=t.suspendedLanes&n,tt===t&&(at&n)===n&&(He===4||He===3&&(at&130023424)===at&&500>ze()-Rm?xi(t,0):Em|=n),Vt(t,e)}function iw(t,e){e===0&&(t.mode&1?(e=Hl,Hl<<=1,!(Hl&130023424)&&(Hl=4194304)):e=1);var n=bt();t=dr(t,e),t!==null&&(Tl(t,e,n),Vt(t,n))}function GT(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),iw(t,n)}function HT(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(e),iw(t,n)}var sw;sw=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||jt.current)Et=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Et=!1,LT(t,e,n);Et=!!(t.flags&131072)}else Et=!1,Me&&e.flags&1048576&&cS(e,Pc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Wa(t,e),t=e.pendingProps;var i=ws(e,yt.current);fs(e,n),i=Qm(null,e,r,t,i,n);var s=$m();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zt(r)?(s=!0,kc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Sm(e),i.updater=Au,e.stateNode=i,i._reactInternals=e,dd(e,r,t,n),e=Od(null,e,r,!0,s,n)):(e.tag=0,Me&&s&&pm(e),vt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Wa(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=JT(r),t=yn(r,t),i){case 0:e=md(null,e,r,t,n);break e;case 1:e=t0(null,e,r,t,n);break e;case 11:e=Jg(null,e,r,t,n);break e;case 14:e=e0(null,e,r,yn(r.type,t),n);break e}throw Error(X(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yn(r,i),md(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yn(r,i),t0(t,e,r,i,n);case 3:e:{if(zS(e),t===null)throw Error(X(387));r=e.pendingProps,s=e.memoizedState,i=s.element,mS(t,e),Tc(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Qs(Error(X(423)),e),e=n0(t,e,r,n,i);break e}else if(r!==i){i=Qs(Error(X(424)),e),e=n0(t,e,r,n,i);break e}else for(Yt=Vr(e.stateNode.containerInfo.firstChild),Ft=e,Me=!0,vn=null,n=dS(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ks(),r===i){e=pr(t,e,n);break e}vt(t,e,r,n)}e=e.child}return e;case 5:return OS(e),t===null&&ud(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,sd(r,i)?o=null:s!==null&&sd(r,s)&&(e.flags|=32),NS(t,e),vt(t,e,o,n),e.child;case 6:return t===null&&ud(e),null;case 13:return WS(t,e,n);case 4:return wm(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=bs(e,null,r,n):vt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yn(r,i),Jg(t,e,r,i,n);case 7:return vt(t,e,e.pendingProps,n),e.child;case 8:return vt(t,e,e.pendingProps.children,n),e.child;case 12:return vt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,$e(Qc,r._currentValue),r._currentValue=o,s!==null)if($n(s.value,o)){if(s.children===i.children&&!jt.current){e=pr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=ar(-1,n&-n),a.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),hd(s.return,n,e),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(X(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),hd(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}vt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,fs(e,n),i=hn(i),r=r(i),e.flags|=1,vt(t,e,r,n),e.child;case 14:return r=e.type,i=yn(r,e.pendingProps),i=yn(r.type,i),e0(t,e,r,i,n);case 15:return DS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yn(r,i),Wa(t,e),e.tag=1,Zt(r)?(t=!0,kc(e)):t=!1,fs(e,n),VS(e,r,i),dd(e,r,i,n),Od(null,e,r,!0,t,n);case 19:return IS(t,e,n);case 22:return _S(t,e,n)}throw Error(X(156,e.tag))};function ow(t,e){return Rv(t,e)}function KT(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(t,e,n,r){return new KT(t,e,n,r)}function Xm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function JT(t){if(typeof t=="function")return Xm(t)?1:0;if(t!=null){if(t=t.$$typeof,t===nm)return 11;if(t===rm)return 14}return 2}function _r(t,e){var n=t.alternate;return n===null?(n=rn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ya(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")Xm(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Bi:return vi(n.children,i,s,e);case tm:o=8,i|=8;break;case Xf:return t=rn(12,n,e,i|2),t.elementType=Xf,t.lanes=s,t;case Lf:return t=rn(13,n,e,i),t.elementType=Lf,t.lanes=s,t;case Df:return t=rn(19,n,e,i),t.elementType=Df,t.lanes=s,t;case Ov:return Ru(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case pv:o=10;break e;case mv:o=9;break e;case nm:o=11;break e;case rm:o=14;break e;case wr:o=16,r=null;break e}throw Error(X(130,t==null?t:typeof t,""))}return e=rn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function vi(t,e,n,r){return t=rn(7,t,r,e),t.lanes=n,t}function Ru(t,e,n,r){return t=rn(22,t,r,e),t.elementType=Ov,t.lanes=n,t.stateNode={isHidden:!1},t}function Mh(t,e,n){return t=rn(6,t,null,e),t.lanes=n,t}function Eh(t,e,n){return e=rn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function e5(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fh(0),this.expirationTimes=fh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Lm(t,e,n,r,i,s,o,l,a){return t=new e5(t,e,n,l,a),e===1?(e=1,s===!0&&(e|=8)):e=0,s=rn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sm(s),t}function t5(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ii,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function lw(t){if(!t)return Wr;t=t._reactInternals;e:{if(Ri(t)!==t||t.tag!==1)throw Error(X(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Zt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(X(171))}if(t.tag===1){var n=t.type;if(Zt(n))return lS(t,n,e)}return e}function aw(t,e,n,r,i,s,o,l,a){return t=Lm(n,r,!0,t,i,s,o,l,a),t.context=lw(null),n=t.current,r=bt(),i=Dr(n),s=ar(r,i),s.callback=e??null,Xr(n,s,i),t.current.lanes=i,Tl(t,i,r),Vt(t,r),t}function ju(t,e,n,r){var i=e.current,s=bt(),o=Dr(i);return n=lw(n),e.context===null?e.context=n:e.pendingContext=n,e=ar(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Xr(i,e,o),t!==null&&(Pn(t,i,o,s),_a(t,i,o)),o}function Vc(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function f0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Dm(t,e){f0(t,e),(t=t.alternate)&&f0(t,e)}function n5(){return null}var cw=typeof reportError=="function"?reportError:function(t){console.error(t)};function _m(t){this._internalRoot=t}Zu.prototype.render=_m.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(X(409));ju(t,e,null,null)};Zu.prototype.unmount=_m.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;$i(function(){ju(null,t,null,null)}),e[fr]=null}};function Zu(t){this._internalRoot=t}Zu.prototype.unstable_scheduleHydration=function(t){if(t){var e=_v();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Qr.length&&e!==0&&e<Qr[n].priority;n++);Qr.splice(n,0,t),n===0&&zv(t)}};function Nm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Vu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function d0(){}function r5(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Vc(o);s.call(c)}}var o=aw(e,r,t,0,null,!1,!1,"",d0);return t._reactRootContainer=o,t[fr]=o.current,el(t.nodeType===8?t.parentNode:t),$i(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var c=Vc(a);l.call(c)}}var a=Lm(t,0,!1,null,null,!1,!1,"",d0);return t._reactRootContainer=a,t[fr]=a.current,el(t.nodeType===8?t.parentNode:t),$i(function(){ju(e,a,n,r)}),a}function Xu(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var a=Vc(o);l.call(a)}}ju(e,o,t,i)}else o=r5(n,e,t,i,r);return Vc(o)}Lv=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=So(e.pendingLanes);n!==0&&(om(e,n|1),Vt(e,ze()),!(ye&6)&&($s=ze()+500,ei()))}break;case 13:$i(function(){var r=dr(t,1);if(r!==null){var i=bt();Pn(r,t,1,i)}}),Dm(t,1)}};lm=function(t){if(t.tag===13){var e=dr(t,134217728);if(e!==null){var n=bt();Pn(e,t,134217728,n)}Dm(t,134217728)}};Dv=function(t){if(t.tag===13){var e=Dr(t),n=dr(t,e);if(n!==null){var r=bt();Pn(n,t,e,r)}Dm(t,e)}};_v=function(){return Se};Nv=function(t,e){var n=Se;try{return Se=t,e()}finally{Se=n}};Uf=function(t,e,n){switch(e){case"input":if(zf(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=$u(r);if(!i)throw Error(X(90));yv(r),zf(r,i)}}}break;case"textarea":vv(t,n);break;case"select":e=n.value,e!=null&&as(t,!!n.multiple,e,!1)}};$v=jm;Tv=$i;var i5={usingClientEntryPoint:!1,Events:[Al,Ui,$u,Pv,Qv,jm]},ao={findFiberByHostInstance:hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},s5={bundleType:ao.bundleType,version:ao.version,rendererPackageName:ao.rendererPackageName,rendererConfig:ao.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:gr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Mv(t),t===null?null:t.stateNode},findFiberByHostInstance:ao.findFiberByHostInstance||n5,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var aa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!aa.isDisabled&&aa.supportsFiber)try{ku=aa.inject(s5),qn=aa}catch{}}Gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i5;Gt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nm(e))throw Error(X(200));return t5(t,e,null,n)};Gt.createRoot=function(t,e){if(!Nm(t))throw Error(X(299));var n=!1,r="",i=cw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Lm(t,1,!1,null,null,n,!1,r,i),t[fr]=e.current,el(t.nodeType===8?t.parentNode:t),new _m(e)};Gt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(X(188)):(t=Object.keys(t).join(","),Error(X(268,t)));return t=Mv(e),t=t===null?null:t.stateNode,t};Gt.flushSync=function(t){return $i(t)};Gt.hydrate=function(t,e,n){if(!Vu(e))throw Error(X(200));return Xu(null,t,e,!0,n)};Gt.hydrateRoot=function(t,e,n){if(!Nm(t))throw Error(X(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=cw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=aw(e,null,t,1,n??null,i,!1,s,o),t[fr]=e.current,el(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Zu(e)};Gt.render=function(t,e,n){if(!Vu(e))throw Error(X(200));return Xu(null,t,e,!1,n)};Gt.unmountComponentAtNode=function(t){if(!Vu(t))throw Error(X(40));return t._reactRootContainer?($i(function(){Xu(null,null,t,!1,function(){t._reactRootContainer=null,t[fr]=null})}),!0):!1};Gt.unstable_batchedUpdates=jm;Gt.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Vu(n))throw Error(X(200));if(t==null||t._reactInternals===void 0)throw Error(X(38));return Xu(t,e,n,!1,r)};Gt.version="18.3.1-next-f1338f8080-20240426";function uw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uw)}catch(t){console.error(t)}}uw(),uv.exports=Gt;var o5=uv.exports,hw,p0=o5;hw=p0.createRoot,p0.hydrateRoot;function Ot(t){m.useEffect(t,[])}const m0=1920,O0=1080,fw=m.forwardRef(({projectId:t,directUrl:e,onLoad:n,portrait:r},i)=>{const s=m.useRef(null),[o,l]=m.useState(1),a=m.useRef({w:r?O0:m0,h:r?m0:O0}),[c,u]=m.useState(a.current),h=m.useRef(0),f=m.useCallback(()=>{const p=s.current;if(!p)return;const x=p.getBoundingClientRect(),S=a.current;l(Math.min(x.width/S.w,x.height/S.h))},[]);Ot(()=>{f();const p=new ResizeObserver(f);s.current&&p.observe(s.current);const x=S=>{const O=S.data;(O==null?void 0:O.source)==="hf-preview"&&(O==null?void 0:O.type)==="stage-size"&&O.width>0&&O.height>0&&(a.current.w!==O.width||a.current.h!==O.height)&&(a.current={w:O.width,h:O.height},u(a.current),f())};return window.addEventListener("message",x),()=>{p.disconnect(),window.removeEventListener("message",x)}});const d=m.useCallback(()=>{h.current++;try{const p=typeof i=="function"?null:i==null?void 0:i.current,x=p==null?void 0:p.contentDocument;if(x){const S=x.querySelector("[data-composition-id]");if(S){const O=parseInt(S.getAttribute("data-width")||"0",10),y=parseInt(S.getAttribute("data-height")||"0",10);if(O>0&&y>0&&(O!==a.current.w||y!==a.current.h)){a.current={w:O,h:y},u(a.current);const v=s.current;if(v){const w=v.getBoundingClientRect();l(Math.min(w.width/O,w.height/y))}}}}}catch(p){console.warn("[Player] Could not read iframe dimensions (cross-origin)",p)}if(h.current>1){const p=s.current;if(p){p.classList.remove("preview-revealing"),p.offsetWidth,p.classList.add("preview-revealing");const x=()=>p.classList.remove("preview-revealing");p.addEventListener("animationend",x,{once:!0})}}n()},[n,i]);return g.jsx("div",{ref:s,className:"w-full h-full max-w-full max-h-full overflow-hidden bg-black flex items-center justify-center",children:g.jsx("iframe",{ref:i,src:e||`/api/projects/${t}/preview`,onLoad:d,sandbox:"allow-scripts allow-same-origin",allow:"autoplay; fullscreen",referrerPolicy:"no-referrer",title:"Project Preview",style:{width:c.w,height:c.h,border:"none",outline:"1px solid black",transform:`scale(${o})`,transformOrigin:"center center",flexShrink:0}})})});fw.displayName="Player";function Ln(t){if(!Number.isFinite(t)||t<0)return"0:00";const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n.toString().padStart(2,"0")}`}const g0=t=>{let e;const n=new Set,r=(c,u)=>{const h=typeof c=="function"?c(e):c;if(!Object.is(h,e)){const f=e;e=u??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(d=>d(e,f))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>a,subscribe:c=>(n.add(c),()=>n.delete(c))},a=e=t(r,i,l);return l},l5=t=>t?g0(t):g0,a5=t=>t;function c5(t,e=a5){const n=Yl.useSyncExternalStore(t.subscribe,Yl.useCallback(()=>e(t.getState()),[t,e]),Yl.useCallback(()=>e(t.getInitialState()),[t,e]));return Yl.useDebugValue(n),n}const y0=t=>{const e=l5(t),n=r=>c5(e,r);return Object.assign(n,e),n},u5=t=>t?y0(t):y0,Rh=new Set,cl={notify:t=>Rh.forEach(e=>e(t)),subscribe:t=>(Rh.add(t),()=>Rh.delete(t))},le=u5(t=>({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,elements:[],selectedElementId:null,playbackRate:1,zoomMode:"fit",pixelsPerSecond:100,editRangeStart:null,editRangeEnd:null,editMode:!1,setIsPlaying:e=>t({isPlaying:e}),setPlaybackRate:e=>t({playbackRate:e}),setZoomMode:e=>t({zoomMode:e}),setPixelsPerSecond:e=>t({pixelsPerSecond:Math.max(10,e)}),setCurrentTime:e=>t({currentTime:Number.isFinite(e)?e:0}),setDuration:e=>t({duration:Number.isFinite(e)?e:0}),setTimelineReady:e=>t({timelineReady:e}),setElements:e=>t({elements:e}),setSelectedElementId:e=>t({selectedElementId:e}),setEditRange:(e,n)=>t({editRangeStart:e,editRangeEnd:n}),setEditMode:e=>t({editMode:e,editRangeStart:null,editRangeEnd:null}),updateElementStart:(e,n)=>t(r=>({elements:r.elements.map(i=>i.id===e?{...i,start:n}:i)})),updateElementDuration:(e,n)=>t(r=>({elements:r.elements.map(i=>i.id===e?{...i,duration:n}:i)})),updateElementTrack:(e,n)=>t(r=>({elements:r.elements.map(i=>i.id===e?{...i,track:n}:i)})),updateElement:(e,n)=>t(r=>({elements:r.elements.map(i=>i.id===e?{...i,...n}:i)})),reset:()=>t({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,elements:[],selectedElementId:null})})),h5=[.25,.5,1,1.5,2],f5=m.memo(function({onTogglePlay:e,onSeek:n}){const r=le(w=>w.isPlaying),i=le(w=>w.duration),s=le(w=>w.timelineReady),o=le(w=>w.playbackRate),l=le.getState().setPlaybackRate,[a,c]=m.useState(!1),u=m.useRef(null),h=m.useRef(null),f=m.useRef(null),d=m.useRef(null),p=m.useRef(!1),x=m.useRef(0),S=m.useRef(i);S.current=i,Ot(()=>{const w=P=>{x.current=P;const Q=S.current,M=Q>0?Math.min(100,P/Q*100):0;u.current&&(u.current.style.width=`${M}%`),h.current&&(h.current.style.left=`${M}%`),f.current&&(f.current.textContent=Ln(P))},k=cl.subscribe(w);w(le.getState().currentTime);const $=setInterval(()=>{const P=le.getState().currentTime,Q=le.getState().duration;if(Q>0&&P>0){const M=Math.min(100,P/Q*100);u.current&&(u.current.style.width=`${M}%`),h.current&&(h.current.style.left=`${M}%`)}},500);return()=>{k(),clearInterval($)}});const O=m.useCallback(w=>{const k=d.current;if(!k||i<=0)return;const $=k.getBoundingClientRect(),P=Math.max(0,Math.min(1,(w-$.left)/$.width)),Q=P*100;u.current&&(u.current.style.width=`${Q}%`),h.current&&(h.current.style.left=`${Q}%`),n(P*i)},[i,n]),y=m.useCallback(w=>{w.preventDefault(),p.current=!0,O(w.clientX);const k=P=>{p.current&&O(P.clientX)},$=()=>{p.current=!1,window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",$)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",$)},[O]),v=m.useCallback(w=>{if(!s||i<=0)return;const k=w.shiftKey?5:1;w.key==="ArrowLeft"?(w.preventDefault(),n(Math.max(0,x.current-k))):w.key==="ArrowRight"&&(w.preventDefault(),n(Math.min(i,x.current+k)))},[s,i,n]);return g.jsxs("div",{className:"px-4 py-2 flex items-center gap-3",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[g.jsx("button",{type:"button","aria-label":r?"Pause":"Play",onClick:e,disabled:!s,className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg disabled:opacity-30 disabled:pointer-events-none transition-colors",style:{background:"rgba(255,255,255,0.06)"},children:r?g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#FAFAFA","aria-hidden":"true",children:[g.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),g.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]}):g.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#FAFAFA","aria-hidden":"true",children:g.jsx("polygon",{points:"6,3 20,12 6,21"})})}),g.jsxs("span",{className:"font-mono text-[11px] tabular-nums flex-shrink-0 min-w-[72px]",style:{color:"#A1A1AA"},children:[g.jsx("span",{ref:f,children:Ln(0)}),g.jsx("span",{style:{color:"#3F3F46",margin:"0 2px"},children:"/"}),g.jsx("span",{style:{color:"#52525B"},children:Ln(i)})]}),g.jsx("div",{ref:d,role:"slider",tabIndex:0,"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.round(i),"aria-valuenow":0,className:"flex-1 h-6 flex items-center cursor-pointer group",style:{touchAction:"manipulation"},onMouseDown:y,onKeyDown:v,children:g.jsxs("div",{className:"w-full rounded-full relative",style:{background:"rgba(255,255,255,0.15)",height:"3px"},children:[g.jsx("div",{ref:u,className:"absolute top-0 bottom-0 left-0 z-[1] rounded-full",style:{background:"linear-gradient(90deg, var(--hf-accent, #3CE6AC), #2BBFA0)"}}),g.jsx("div",{ref:h,className:"absolute top-1/2 z-[2] w-3 h-3 rounded-full -translate-y-1/2 -translate-x-1/2 transition-transform group-hover:scale-125",style:{background:"var(--hf-accent, #3CE6AC)",boxShadow:"0 0 6px rgba(60,230,172,0.4), 0 1px 4px rgba(0,0,0,0.4)"}})]})}),g.jsxs("div",{className:"relative flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:()=>c(w=>!w),className:"px-2 py-1 rounded-md text-[10px] font-mono tabular-nums transition-colors",style:{color:"#71717A",background:"rgba(255,255,255,0.04)"},children:o===1?"1x":`${o}x`}),a&&g.jsx("div",{className:"absolute bottom-full right-0 mb-1.5 rounded-lg shadow-xl z-50 min-w-[56px] overflow-hidden",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)"},children:h5.map(w=>g.jsxs("button",{onClick:()=>{l(w),c(!1)},className:"block w-full px-3 py-1.5 text-[11px] text-left font-mono tabular-nums transition-colors",style:{color:w===o?"#FAFAFA":"#71717A",background:w===o?"rgba(255,255,255,0.06)":"transparent"},onMouseEnter:k=>{w!==o&&(k.currentTarget.style.background="rgba(255,255,255,0.04)")},onMouseLeave:k=>{w!==o&&(k.currentTarget.style.background="transparent")},children:[w,"x"]},w))})]})]})}),d5=m.memo(function({el:e,pps:n,clipY:r,isSelected:i,isHovered:s,hasCustomContent:o,style:l,isComposition:a,onHoverStart:c,onHoverEnd:u,onClick:h,onDoubleClick:f,children:d}){const p=e.start*n,x=Math.max(e.duration*n,4);return g.jsx("div",{"data-clip":"true",className:o?"absolute":"absolute flex items-center",style:{left:p,width:x,top:r,bottom:r,borderRadius:5,backgroundColor:o&&a?"#111":l.clip,backgroundImage:a&&!o?"repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(255,255,255,0.08) 3px, rgba(255,255,255,0.08) 6px)":void 0,border:i?"2px solid rgba(255,255,255,0.9)":`1px solid rgba(255,255,255,${s?.3:.15})`,boxShadow:i?`0 0 0 1px ${l.clip}, 0 2px 8px rgba(0,0,0,0.4)`:s?"0 1px 4px rgba(0,0,0,0.3)":"none",transition:"border-color 120ms, box-shadow 120ms",zIndex:i?10:s?5:1},title:a?`${e.compositionSrc} • Double-click to open`:`${e.id||e.tag} • ${e.start.toFixed(1)}s – ${(e.start+e.duration).toFixed(1)}s`,onPointerEnter:c,onPointerLeave:u,onClick:h,onDoubleClick:f,children:d})});function p5({rangeStart:t,rangeEnd:e,anchorX:n,anchorY:r,onClose:i}){const s=le(y=>y.elements),[o,l]=m.useState(""),[a,c]=m.useState(!1),u=m.useRef(null),h=m.useRef(null),f=Math.min(t,e),d=Math.max(t,e),p=m.useMemo(()=>s.filter(y=>{const v=y.start+y.duration;return y.start<d&&v>f}),[s,f,d]);Ot(()=>{setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.focus()},50)}),Ot(()=>{const y=v=>{v.key==="Escape"&&i()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)}),Ot(()=>{const y=v=>{u.current&&!u.current.contains(v.target)&&i()};return setTimeout(()=>window.addEventListener("mousedown",y),100),()=>window.removeEventListener("mousedown",y)});const x=m.useCallback(()=>{const y=p.map(v=>`- #${v.id} (${v.tag}) — ${Ln(v.start)} to ${Ln(v.start+v.duration)}, track ${v.track}`).join(`
|
|
41
|
+
`);return`Edit the following HyperFrames composition:
|
|
42
|
+
|
|
43
|
+
Time range: ${Ln(f)} — ${Ln(d)}
|
|
44
|
+
|
|
45
|
+
Elements in range:
|
|
46
|
+
${y||"(none)"}
|
|
47
|
+
|
|
48
|
+
User request:
|
|
49
|
+
${o.trim()||"(no prompt provided)"}
|
|
50
|
+
|
|
51
|
+
Instructions:
|
|
52
|
+
Modify only the elements listed above within the specified time range.
|
|
53
|
+
The composition uses HyperFrames data attributes (data-start, data-duration, data-track-index) and GSAP for animations.
|
|
54
|
+
Preserve all other elements and timing outside this range.`},[f,d,p,o]),S=m.useCallback(async()=>{try{await navigator.clipboard.writeText(x())}catch{const y=document.createElement("textarea");y.value=x(),document.body.appendChild(y),y.select(),document.execCommand("copy"),document.body.removeChild(y)}c(!0),setTimeout(()=>{c(!1),i()},800)},[x,i]),O={position:"fixed",left:Math.max(8,Math.min(n-160,window.innerWidth-336)),top:Math.max(8,r-280),zIndex:200};return g.jsx("div",{ref:u,style:O,children:g.jsxs("div",{className:"w-80 bg-neutral-900 border border-neutral-700/60 rounded-xl shadow-2xl shadow-black/40 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-neutral-800/60",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-blue-400"}),g.jsxs("span",{className:"text-[11px] font-medium text-neutral-300",children:[Ln(f)," — ",Ln(d)]})]}),g.jsxs("span",{className:"text-[10px] text-neutral-600",children:[p.length," element",p.length!==1?"s":""]})]}),p.length>0&&g.jsx("div",{className:"px-4 py-2 border-b border-neutral-800/40 max-h-24 overflow-y-auto",children:p.map(y=>g.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[g.jsxs("span",{className:"text-[10px] font-mono text-blue-400/80",children:["#",y.id]}),g.jsx("span",{className:"text-[10px] text-neutral-600",children:y.tag})]},y.id))}),g.jsx("div",{className:"p-3",children:g.jsx("textarea",{ref:h,value:o,onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),S())},placeholder:"What should change?",rows:2,className:"w-full px-3 py-2 text-xs bg-neutral-800/60 border border-neutral-700/40 rounded-lg text-neutral-200 placeholder:text-neutral-600 resize-none focus:outline-none focus:border-blue-500/40 transition-colors"})}),g.jsx("div",{className:"px-3 pb-3",children:g.jsxs("button",{onClick:S,className:`w-full py-1.5 text-[11px] font-medium rounded-lg transition-all ${a?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-blue-500/15 text-blue-400 border border-blue-500/25 hover:bg-blue-500/25"}`,children:[a?"Copied!":"Copy to Agent",!a&&g.jsx("span",{className:"text-[9px] text-blue-400/50 ml-1.5",children:"Cmd+Enter"})]})})]})})}const nt=32,jh=72,co=24,m5=3,Ws="/icons/timeline";function Is({src:t}){return g.jsx("img",{src:t,alt:"",width:12,height:12,style:{filter:"brightness(0) invert(1)"},draggable:!1})}const O5=g.jsx(Is,{src:`${Ws}/captions.svg`}),x0=g.jsx(Is,{src:`${Ws}/image.svg`}),g5=g.jsx(Is,{src:`${Ws}/music.svg`}),v0=g.jsx(Is,{src:`${Ws}/text.svg`}),Td=g.jsx(Is,{src:`${Ws}/composition.svg`}),y5=g.jsx(Is,{src:`${Ws}/audio.svg`}),S0={video:{clip:"#1F6AFF",label:"#DBEAFE",row:"rgba(31,106,255,0.04)",gutter:"#1F6AFF",icon:x0},audio:{clip:"#00C4FF",label:"#013A4B",row:"rgba(0,196,255,0.04)",gutter:"#00C4FF",icon:g5},img:{clip:"#8B5CF6",label:"#EDE9FE",row:"rgba(139,92,246,0.04)",gutter:"#8B5CF6",icon:x0},div:{clip:"#68B200",label:"#1A2B03",row:"rgba(104,178,0,0.04)",gutter:"#68B200",icon:Td},span:{clip:"#F3A6FF",label:"#8D00A3",row:"rgba(243,166,255,0.04)",gutter:"#F3A6FF",icon:O5},p:{clip:"#35C838",label:"#024A03",row:"rgba(53,200,56,0.04)",gutter:"#35C838",icon:v0},h1:{clip:"#35C838",label:"#024A03",row:"rgba(53,200,56,0.04)",gutter:"#35C838",icon:v0},section:{clip:"#68B200",label:"#1A2B03",row:"rgba(104,178,0,0.04)",gutter:"#68B200",icon:Td},sfx:{clip:"#FF8C42",label:"#512000",row:"rgba(255,140,66,0.04)",gutter:"#FF8C42",icon:y5}},dw={clip:"#6B7280",label:"#F3F4F6",row:"rgba(107,114,128,0.03)",gutter:"#6B7280",icon:Td};function w0(t){const e=t.toLowerCase();return e.startsWith("h")&&e.length===2&&"123456".includes(e[1])?S0.h1:S0[e]??dw}function x5(t){if(t<=0||!Number.isFinite(t)||t>7200)return{major:[],minor:[]};const e=[.5,1,2,5,10,15,30,60],n=t/6,r=e.find(a=>a>=n)??60,i=Math.max(.25,r/2),s=[],o=[],l=500;for(let a=0;a<=t+.001&&s.length+o.length<l;a+=i){const c=Math.round(a*100)/100;Math.abs(c%r)<.01||Math.abs(c%r-r)<.01?s.push(c):o.push(c)}return{major:s,minor:o}}const v5=m.memo(function({onSeek:e,onDrillDown:n,renderClipContent:r,renderClipOverlay:i,onFileDrop:s}={}){const o=le(Z=>Z.elements),l=le(Z=>Z.duration),a=le(Z=>Z.timelineReady),c=le(Z=>Z.selectedElementId),u=le(Z=>Z.setSelectedElementId),h=le(Z=>Z.zoomMode),f=le(Z=>Z.pixelsPerSecond),d=m.useRef(null),p=m.useRef(null),x=m.useRef(null),[S,O]=m.useState(null),y=m.useRef(!1),[v,w]=m.useState(!1);Ot(()=>{const Z=oe=>oe.key==="Shift"&&w(!0),ue=oe=>oe.key==="Shift"&&w(!1),pe=()=>w(!1);return window.addEventListener("keydown",Z),window.addEventListener("keyup",ue),window.addEventListener("blur",pe),()=>{window.removeEventListener("keydown",Z),window.removeEventListener("keyup",ue),window.removeEventListener("blur",pe)}});const k=m.useRef(!1),$=m.useRef(0),[P,Q]=m.useState(null),[M,T]=m.useState(!1),[V,C]=m.useState(0),j=m.useRef(null),N=m.useCallback(Z=>{j.current&&(j.current.disconnect(),j.current=null),p.current=Z,Z&&(C(Z.clientWidth),j.current=new ResizeObserver(([ue])=>{C(ue.contentRect.width)}),j.current.observe(Z))},[]);Ot(()=>()=>{var Z;(Z=j.current)==null||Z.disconnect()});const _=m.useMemo(()=>{const Z=Number.isFinite(l)?l:0;if(o.length===0)return Z;const ue=Math.max(...o.map(oe=>oe.start+oe.duration)),pe=Math.max(Z,ue);return Number.isFinite(pe)?pe:Z},[o,l]),I=V>nt&&_>0?(V-nt-2)/_:100,J=h==="fit"?I:f,E=Math.max(0,_*J),D=m.useRef(_);D.current=_;const L=m.useRef(J);L.current=J,Ot(()=>cl.subscribe(ue=>{const pe=D.current;if(!d.current||pe<=0)return;const oe=ue*L.current;d.current.style.left=`${nt+oe}px`;const je=x.current;if(je&&!y.current){const Pe=nt+oe,ut=je.scrollLeft+je.clientWidth,ri=je.scrollLeft,_t=je.clientWidth*.12;Pe>ut-_t?je.scrollLeft=Pe-je.clientWidth*.15:Pe<ri+nt&&(je.scrollLeft=Math.max(0,Pe-nt))}}));const q=m.useRef(0),G=m.useCallback(Z=>{const ue=x.current;if(!ue||_<=0)return;const pe=ue.getBoundingClientRect(),oe=ue.scrollLeft,je=Z-pe.left+oe-nt;if(je<0)return;const Pe=Math.max(0,Math.min(_,je/J));cl.notify(Pe),e==null||e(Pe)},[_,e,J]),re=m.useCallback(Z=>{cancelAnimationFrame(q.current);const ue=x.current;if(!ue||!y.current)return;const pe=ue.getBoundingClientRect(),oe=40,je=12;let Pe=0;if(Z<pe.left+oe){const ut=Math.max(0,1-(Z-pe.left)/oe);Pe=-je*ut}else if(Z>pe.right-oe){const ut=Math.max(0,1-(pe.right-Z)/oe);Pe=je*ut}Pe!==0&&(ue.scrollLeft+=Pe,G(Z),q.current=requestAnimationFrame(()=>re(Z)))},[G]),te=m.useCallback(Z=>{var ue,pe;if(!Z.target.closest("[data-clip]")&&Z.button===0){if(Z.currentTarget.setPointerCapture(Z.pointerId),Z.shiftKey){k.current=!0,T(!1);const oe=(ue=x.current)==null?void 0:ue.getBoundingClientRect();if(oe){const je=Z.clientX-oe.left+(((pe=x.current)==null?void 0:pe.scrollLeft)??0)-nt,Pe=Math.max(0,je/J);$.current=Pe,Q({start:Pe,end:Pe,anchorX:Z.clientX,anchorY:Z.clientY})}return}y.current=!0,Q(null),T(!1),G(Z.clientX)}},[G,J]),W=m.useCallback(Z=>{var ue,pe;if(k.current){const oe=(ue=x.current)==null?void 0:ue.getBoundingClientRect();if(oe){const je=Z.clientX-oe.left+(((pe=x.current)==null?void 0:pe.scrollLeft)??0)-nt,Pe=Math.max(0,je/J);Q(ut=>ut?{...ut,end:Pe,anchorX:Z.clientX,anchorY:Z.clientY}:null)}return}y.current&&(G(Z.clientX),re(Z.clientX))},[G,re,J]),ie=m.useCallback(()=>{if(k.current){k.current=!1,Q(Z=>Z&&Math.abs(Z.end-Z.start)>.2?(T(!0),Z):null);return}y.current=!1,cancelAnimationFrame(q.current)},[]),ne=m.useMemo(()=>{const Z=new Map;for(const ue of o){const pe=Z.get(ue.track)??[];pe.push(ue),Z.set(ue.track,pe)}return Array.from(Z.entries()).sort(([ue],[pe])=>ue-pe)},[o]),Oe=m.useMemo(()=>{var ue;const Z=new Map;for(const[pe,oe]of ne)Z.set(pe,w0(((ue=oe[0])==null?void 0:ue.tag)??""));return Z},[ne]),{major:A,minor:B}=m.useMemo(()=>x5(_),[_]),[ae,de]=m.useState(!1);if(!a||o.length===0)return g.jsxs("div",{className:`h-full border-t bg-[#0a0a0b] flex flex-col select-none transition-colors duration-150 ${ae?"border-blue-500/50 bg-blue-500/[0.03]":"border-neutral-800/50"}`,onDragOver:Z=>{Z.preventDefault(),de(!0)},onDragLeave:()=>de(!1),onDrop:Z=>{Z.preventDefault(),de(!1),s&&Z.dataTransfer.files.length>0&&s(Array.from(Z.dataTransfer.files))},children:[g.jsx("div",{className:"flex-shrink-0 border-b border-neutral-800/40 flex items-end relative",style:{height:co,paddingLeft:nt},children:[0,10,20,30,40,50].map(Z=>g.jsxs("div",{className:"flex flex-col items-center",style:{position:"absolute",left:nt+Z*14},children:[g.jsx("span",{className:"text-[9px] text-neutral-600 font-mono tabular-nums leading-none mb-0.5",children:`${Math.floor(Z/60)}:${(Z%60).toString().padStart(2,"0")}`}),g.jsx("div",{className:"w-px h-[5px] bg-neutral-700/40"})]},Z))}),g.jsx("div",{className:"flex-1 flex items-center justify-center",children:g.jsx("div",{className:`flex items-center gap-3 px-6 py-3 border border-dashed rounded-lg transition-colors duration-150 ${ae?"border-blue-400/60 bg-blue-500/[0.06]":"border-neutral-700/50"}`,children:ae?g.jsxs(g.Fragment,{children:[g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-blue-400 flex-shrink-0",children:[g.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),g.jsx("polyline",{points:"7 10 12 15 17 10"}),g.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),g.jsx("span",{className:"text-[13px] text-blue-400",children:"Drop media files to import"})]}):g.jsxs(g.Fragment,{children:[g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-600 flex-shrink-0",children:[g.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2"}),g.jsx("path",{d:"M7 2v20"}),g.jsx("path",{d:"M17 2v20"}),g.jsx("path",{d:"M2 7h20"}),g.jsx("path",{d:"M2 17h20"})]}),g.jsx("span",{className:"text-[13px] text-neutral-500",children:s?"Drop media here or describe your video to start":"Describe your video to start creating"})]})})})]});const be=co+ne.length*jh;return g.jsxs("div",{ref:N,"aria-label":"Timeline",className:`border-t border-neutral-800/50 bg-[#0a0a0b] select-none h-full overflow-hidden ${v?"cursor-crosshair":"cursor-default"}`,style:{touchAction:"pan-x pan-y"},children:[g.jsx("div",{ref:x,className:`${h==="fit"?"overflow-x-hidden":"overflow-x-auto"} overflow-y-auto h-full`,onPointerDown:te,onPointerMove:W,onPointerUp:ie,onLostPointerCapture:ie,children:g.jsxs("div",{className:"relative",style:{height:be,width:nt+E},children:[g.jsx("svg",{className:"absolute pointer-events-none",style:{left:nt,width:E},height:be,children:A.map(Z=>{const ue=Z*J;return g.jsx("line",{x1:ue,y1:co,x2:ue,y2:be,stroke:"rgba(255,255,255,0.035)",strokeWidth:"1"},`g-${Z}`)})}),g.jsxs("div",{className:"relative border-b border-neutral-800/40 overflow-hidden",style:{height:co,marginLeft:nt,width:E},children:[v&&!P&&g.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none z-10",children:g.jsx("span",{className:"text-[9px] text-blue-400/60 font-medium",children:"Drag to select range"})}),B.map(Z=>g.jsx("div",{className:"absolute bottom-0",style:{left:Z*J},children:g.jsx("div",{className:"w-px h-[3px] bg-neutral-700/40"})},`m-${Z}`)),A.map(Z=>g.jsxs("div",{className:"absolute bottom-0 flex flex-col items-center",style:{left:Z*J},children:[g.jsx("span",{className:"text-[9px] text-neutral-500 font-mono tabular-nums leading-none mb-0.5",children:Ln(Z)}),g.jsx("div",{className:"w-px h-[5px] bg-neutral-600/60"})]},`M-${Z}`))]}),ne.map(([Z,ue])=>{const pe=Oe.get(Z)??dw;return g.jsxs("div",{className:"relative flex",style:{height:jh,backgroundColor:pe.row},children:[g.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{width:nt},children:g.jsx("div",{className:"flex items-center justify-center",style:{width:20,height:20,borderRadius:6,backgroundColor:pe.gutter,border:"1px solid rgba(255,255,255,0.35)",color:"#fff"},children:pe.icon})}),g.jsx("div",{style:{width:E},className:"relative",children:ue.map((oe,je)=>{const Pe=w0(oe.tag),ut=c===oe.id,ri=!!oe.compositionSrc,_t=`${oe.id}-${je}`,Ks=S===_t,Js=!!r,Il=Math.max(oe.duration*J,4);return g.jsxs(d5,{el:oe,pps:J,trackH:jh,clipY:m5,isSelected:ut,isHovered:Ks,hasCustomContent:Js,style:Pe,isComposition:ri,onHoverStart:()=>O(_t),onHoverEnd:()=>O(null),onClick:eo=>{eo.stopPropagation(),u(ut?null:oe.id)},onDoubleClick:eo=>{eo.stopPropagation(),ri&&n&&n(oe)},children:[i==null?void 0:i(oe),g.jsx("div",{className:r?"absolute inset-0 overflow-hidden rounded-[4px]":"flex items-center overflow-hidden flex-1 min-w-0",children:(r==null?void 0:r(oe,Pe))??g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[10px] font-semibold truncate px-1.5 leading-none",style:{color:Pe.label},children:oe.id||oe.tag}),Il>60&&g.jsxs("span",{className:"text-[9px] font-mono tabular-nums pr-1.5 ml-auto flex-shrink-0 leading-none opacity-70",style:{color:Pe.label},children:[oe.duration.toFixed(1),"s"]})]})})]},_t)})})]},Z)}),P&&g.jsx("div",{className:"absolute pointer-events-none",style:{left:nt+Math.min(P.start,P.end)*J,width:Math.abs(P.end-P.start)*J,top:co,bottom:0,backgroundColor:"rgba(59, 130, 246, 0.12)",borderLeft:"1px solid rgba(59, 130, 246, 0.4)",borderRight:"1px solid rgba(59, 130, 246, 0.4)",zIndex:50}}),g.jsxs("div",{ref:d,className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${nt}px`,zIndex:100},children:[g.jsx("div",{className:"absolute top-0 bottom-0",style:{left:"50%",width:2,marginLeft:-1,background:"var(--hf-accent, #3CE6AC)",boxShadow:"0 0 8px rgba(60,230,172,0.5)"}}),g.jsx("div",{className:"absolute",style:{left:"50%",top:0,transform:"translateX(-50%)"},children:g.jsx("div",{style:{width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"8px solid var(--hf-accent, #3CE6AC)",filter:"drop-shadow(0 1px 3px rgba(0,0,0,0.6))"}})})]})]})}),!M&&!P&&g.jsx("div",{className:"absolute bottom-2 right-3 pointer-events-none",children:g.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-neutral-800/50 border border-neutral-700/20",children:[g.jsx("kbd",{className:"text-[9px] font-mono text-neutral-500 bg-neutral-700/40 px-1 py-0.5 rounded",children:"Shift"}),g.jsx("span",{className:"text-[9px] text-neutral-600",children:"+ drag to edit range"})]})}),M&&P&&g.jsx(p5,{rangeStart:P.start,rangeEnd:P.end,anchorX:P.anchorX,anchorY:P.anchorY,onClose:()=>{T(!1),Q(null)}})]})}),k0=66,b0=6,S5=m.memo(function({videoSrc:e,label:n,labelColor:r,duration:i=5}){const[s,o]=m.useState(0),[l,a]=m.useState(!1),[c,u]=m.useState([]),[h,f]=m.useState(16/9),d=m.useRef(null),p=m.useRef(null),x=m.useRef(!1),S=m.useCallback(v=>{var $,P,Q;if(($=d.current)==null||$.disconnect(),(P=p.current)==null||P.disconnect(),!v)return;const w=((Q=v.parentElement)==null?void 0:Q.clientWidth)||v.clientWidth;o(w),d.current=new IntersectionObserver(([M])=>{var T;M.isIntersecting&&(a(!0),(T=d.current)==null||T.disconnect())},{rootMargin:"200px"}),d.current.observe(v);const k=v.parentElement||v;p.current=new ResizeObserver(([M])=>{o(M.contentRect.width)}),p.current.observe(k)},[]);Ot(()=>()=>{var v,w;(v=d.current)==null||v.disconnect(),(w=p.current)==null||w.disconnect()}),m.useEffect(()=>{if(!l||x.current)return;x.current=!0;const v=document.createElement("video");v.crossOrigin="anonymous",v.muted=!0,v.preload="auto";const w=document.createElement("canvas"),k=w.getContext("2d");if(!k){x.current=!1;return}const $=[],P=Math.min(.4,i*.05);for(let V=0;V<b0;V++){const C=V/(b0-1)*i;$.push(Math.max(C,P))}let Q=0,M=!1;const T=()=>{if(M||Q>=$.length){M||(v.src="",v.load());return}v.currentTime=$[Q]};return v.addEventListener("loadedmetadata",()=>{if(v.videoWidth>0&&v.videoHeight>0){f(v.videoWidth/v.videoHeight);const V=k0*2,C=Math.round(V*(v.videoWidth/v.videoHeight));w.width=C,w.height=V}T()}),v.addEventListener("seeked",()=>{if(M)return;k.drawImage(v,0,0,w.width,w.height);const V=w.toDataURL("image/jpeg",.6);u(C=>[...C,V]),Q++,T()}),v.addEventListener("error",()=>{}),v.src=e,v.load(),()=>{M=!0,x.current=!1,u([]),v.src="",v.load()}},[l,e,i]);const O=Math.round(k0*h),y=s>0?Math.max(1,Math.ceil(s/O)):1;return g.jsxs("div",{ref:S,className:"absolute inset-0 overflow-hidden",children:[l&&c.length>0&&g.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:y}).map((v,w)=>{const k=c[w%c.length];return g.jsx("div",{className:"flex-shrink-0 h-full relative overflow-hidden bg-neutral-900",style:{width:O},children:g.jsx("img",{src:k,alt:"",draggable:!1,className:"absolute inset-0 w-full h-full object-cover"})},w)})}),l&&c.length===0&&g.jsx("div",{className:"absolute inset-0 animate-pulse",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)"}}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-1.5 pb-0.5 pt-3",style:{background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)"},children:g.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:r,textShadow:"0 1px 2px rgba(0,0,0,0.9)"},children:n})})]})}),w5=66,k5=6,Zh=m.memo(function({previewUrl:e,label:n,labelColor:r,seekTime:i=.4,duration:s=5,width:o=1920,height:l=1080}){const[a,c]=m.useState(0),u=m.useRef(null),h=m.useCallback(v=>{var P;if((P=u.current)==null||P.disconnect(),!v)return;let w=v,k=v.parentElement,$=0;for(;k&&!k.hasAttribute("data-clip")&&$<5;)k=k.parentElement,$++;k!=null&&k.hasAttribute("data-clip")&&(w=k),requestAnimationFrame(()=>{const Q=w.clientWidth||w.getBoundingClientRect().width;Q>0&&c(Q)}),u.current=new ResizeObserver(([Q])=>c(Q.contentRect.width)),u.current.observe(w)},[]);Ot(()=>()=>{var v;(v=u.current)==null||v.disconnect()});const f=e.replace("/preview/comp/","/thumbnail/").replace(/\/preview$/,"/thumbnail/index.html"),d=o/l,p=Math.round(w5*d),x=a>0?Math.max(1,Math.ceil(a/p)):1,S=Math.min(x,k5),O=[],y=Math.min(.5,s*.05);for(let v=0;v<S;v++){const w=S===1?.5:v/(S-1),k=i+w*s;O.push(i+Math.max(y,Math.min(s-y,k-i)))}return g.jsxs("div",{ref:h,className:"absolute inset-0 overflow-hidden bg-neutral-950",children:[g.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:x}).map((v,w)=>{const k=x===1?.5:w/(x-1),$=i+k*s,P=Math.min(Math.round(k*(S-1)),S-1),Q=O[P],M=`${f}?t=${(Q??$).toFixed(2)}`;return g.jsx("div",{className:"flex-shrink-0 h-full relative overflow-hidden bg-neutral-900",style:{width:p},children:g.jsx("img",{src:M,alt:"",draggable:!1,loading:"lazy",onLoad:T=>{T.target.style.opacity="1"},className:"absolute inset-0 w-full h-full object-cover",style:{opacity:0,transition:"opacity 200ms ease-out"}})},w)})}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-1.5 pb-0.5 pt-3",style:{background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)"},children:g.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:r,textShadow:"0 1px 2px rgba(0,0,0,0.9)"},children:n})})]})});function P0(t){return{play:()=>t.play(),pause:()=>t.pause(),seek:e=>{t.pause(),t.seek(e)},getTime:()=>t.time(),getDuration:()=>t.duration(),isPlaying:()=>t.isActive()}}function Q0(t,e){const n=t.querySelector("[data-composition-id]"),r=t.querySelectorAll("[data-start]"),i=[];let s=0;return r.forEach(o=>{var y;if(o===n)return;const l=o,a=l.getAttribute("data-start");if(a==null)return;const c=parseFloat(a);if(isNaN(c))return;const u=l.tagName.toLowerCase();let h=0;const f=l.getAttribute("data-duration");f!=null&&(h=parseFloat(f)),(isNaN(h)||h<=0)&&(h=Math.max(0,e-c));const d=l.getAttribute("data-track-index"),p=d!=null?parseInt(d,10):s++,x={id:l.id||((y=l.className)==null?void 0:y.split(" ")[0])||u,tag:u,start:c,duration:h,track:isNaN(p)?0:p};if(u==="video"||u==="audio"||u==="img"){const v=l.getAttribute("src");v&&(x.src=v);const w=l.getAttribute("data-media-start");w&&(x.playbackStart=parseFloat(w));const k=l.getAttribute("data-volume");k&&(x.volume=parseFloat(k))}const S=l.getAttribute("data-composition-src")||l.getAttribute("data-composition-file"),O=l.getAttribute("data-composition-id");if(S)x.compositionSrc=S;else if(O&&O!==(n==null?void 0:n.getAttribute("data-composition-id"))){const v=l.querySelector("video[src]");v&&(x.src=v.getAttribute("src")||void 0,x.tag="video")}i.push(x)}),i}function b5(t,e){t.documentElement&&(t.documentElement.style.overflow="hidden",t.documentElement.style.margin="0"),t.body&&(t.body.style.overflow="hidden",t.body.style.margin="0"),e.scrollTo({top:0,left:0,behavior:"auto"})}function P5(t){const e=/data-composition-id=["']([^"']+)["']/gi,n=new Set,r=Array.from(t.querySelectorAll("style, script"));for(const o of r){const l=o.textContent||"";if(!l)continue;let a;for(;(a=e.exec(l))!==null;){const c=(a[1]||"").trim();c&&n.add(c)}}if(n.size===0)return;const i=new Set,s=Array.from(t.querySelectorAll("[data-composition-id]"));for(const o of s){const l=o.getAttribute("data-composition-id");l&&i.add(l)}for(const o of n){if(o==="root"||i.has(o))continue;const l=t.getElementById(`${o}-layer`)||t.getElementById(`${o}-comp`)||t.getElementById(o);l&&(l.getAttribute("data-composition-id")||l.setAttribute("data-composition-id",o))}}function $0(t){var e;if(t)try{(e=t.contentWindow)==null||e.postMessage({source:"hf-parent",type:"control",action:"set-muted",muted:!1},"*")}catch(n){console.warn("[useTimelinePlayer] Failed to unmute preview media",n)}}function Q5(){const t=m.useRef(null),e=m.useRef(0),n=m.useRef(void 0),r=m.useRef(null),i=m.useRef(!1),{setIsPlaying:s,setCurrentTime:o,setDuration:l,setTimelineReady:a,setElements:c}=le.getState(),u=m.useCallback(()=>{var C;try{const j=(C=t.current)==null?void 0:C.contentWindow;if(!j)return null;if(j.__player&&typeof j.__player.play=="function")return j.__player;if(j.__timeline)return P0(j.__timeline);if(j.__timelines){const N=Object.keys(j.__timelines);if(N.length>0)return P0(j.__timelines[N[N.length-1]])}return null}catch(j){return console.warn("[useTimelinePlayer] Could not get playback adapter (cross-origin)",j),null}},[]),h=m.useCallback(()=>{const C=()=>{const j=u();if(j){const N=j.getTime(),_=j.getDuration();if(cl.notify(N),N>=_&&!j.isPlaying()){o(N),s(!1),cancelAnimationFrame(e.current);return}}e.current=requestAnimationFrame(C)};e.current=requestAnimationFrame(C)},[u,o,s]),f=m.useCallback(()=>{cancelAnimationFrame(e.current)},[]),d=m.useCallback(C=>{var N;const j=t.current;if(j){(N=j.contentWindow)==null||N.postMessage({source:"hf-parent",type:"control",action:"set-playback-rate",playbackRate:C},"*");try{const _=j.contentWindow;if(_!=null&&_.__timelines)for(const I of Object.values(_.__timelines))I&&typeof I.timeScale=="function"&&I.timeScale(C)}catch(_){console.warn("[useTimelinePlayer] Could not set playback rate (cross-origin)",_)}}},[]),p=m.useCallback(()=>{const C=u();C&&(C.getTime()>=C.getDuration()&&C.seek(0),$0(t.current),d(le.getState().playbackRate),C.play(),s(!0),h())},[u,s,h,d]),x=m.useCallback(()=>{const C=u();C&&(C.pause(),o(C.getTime()),s(!1),f())},[u,o,s,f]),S=m.useCallback(()=>{le.getState().isPlaying?x():p()},[p,x]),O=m.useCallback(C=>{const j=u();j&&(j.seek(C),cl.notify(C),o(C),f(),le.getState().isPlaying&&s(!1))},[u,o,s,f]),y=m.useCallback(C=>{if(!C.clips||C.clips.length===0)return;const j=new Set(C.clips.map(L=>L.compositionId).filter(Boolean)),_=C.clips.filter(L=>!L.parentCompositionId||!j.has(L.parentCompositionId)).map(L=>{var G;const q={id:L.id||L.label||L.tagName||"element",tag:L.tagName||L.kind,start:L.start,duration:L.duration,track:L.track};if(L.assetUrl&&(q.src=L.assetUrl),L.kind==="composition"&&L.compositionId){let re=L.compositionSrc,te=null;if(!re)try{const W=(G=t.current)==null?void 0:G.contentDocument;te=(W==null?void 0:W.querySelector(`[data-composition-id="${L.compositionId}"]`))??null,re=(te==null?void 0:te.getAttribute("data-composition-src"))??(te==null?void 0:te.getAttribute("data-composition-file"))??null}catch{}if(re)q.compositionSrc=re;else if(te){const W=te.querySelector("video[src]");W&&(q.src=W.getAttribute("src")||void 0,q.tag="video")}}return q}),I=le.getState().elements,J=le.getState().duration,E=C.durationInFrames/30,D=Number.isFinite(E)&&E<7200?E:0;if(!(I.length>_.length&&D<=J)){if(c(_),_.length>0){const L=Math.max(..._.map(G=>G.start+G.duration)),q=Math.max(D,L);Number.isFinite(q)&&q>J&&l(q)}_.length>0&&a(!0)}},[c,a,l]),v=m.useCallback(()=>{try{const C=t.current,j=C==null?void 0:C.contentDocument,N=C==null?void 0:C.contentWindow;if(!j||!N)return;const _=le.getState().elements,I=new Set(_.map(re=>re.id)),J=j.querySelector("[data-composition-id]"),E=J==null?void 0:J.getAttribute("data-composition-id"),D=j.querySelectorAll("[data-composition-id][data-start]"),L=[];D.forEach(re=>{var be,Z,ue,pe,oe,je,Pe,ut,ri;const te=re,W=te.getAttribute("data-composition-id");if(!W||W===E||I.has(te.id)||I.has(W))return;const ie=te.getAttribute("data-start")??"0";let ne=parseFloat(ie);if(isNaN(ne)){const _t=j.getElementById(ie)||j.querySelector(`[data-composition-id="${ie}"]`);if(_t){const Ks=_t.getAttribute("data-start")??"0";let Js=parseFloat(Ks);if(isNaN(Js)){const er=j.getElementById(Ks)||j.querySelector(`[data-composition-id="${Ks}"]`),EQ=parseFloat((er==null?void 0:er.getAttribute("data-start"))??"0")||0,sg=er==null?void 0:er.getAttribute("data-composition-id"),RQ=parseFloat((er==null?void 0:er.getAttribute("data-duration"))??"")||(sg?((ue=(Z=(be=N.__timelines)==null?void 0:be[sg])==null?void 0:Z.duration)==null?void 0:ue.call(Z))??0:0);Js=EQ+RQ}const Il=_t.getAttribute("data-composition-id"),eo=parseFloat(_t.getAttribute("data-duration")??"")||(Il?((je=(oe=(pe=N.__timelines)==null?void 0:pe[Il])==null?void 0:oe.duration)==null?void 0:je.call(oe))??0:0);ne=Js+eo}else ne=0}let Oe=parseFloat(te.getAttribute("data-duration")??"");if((isNaN(Oe)||Oe<=0)&&(Oe=((ri=(ut=(Pe=N.__timelines)==null?void 0:Pe[W])==null?void 0:ut.duration)==null?void 0:ri.call(ut))??0),!Number.isFinite(Oe)||Oe<=0)return;Number.isFinite(ne)||(ne=0);const A=te.getAttribute("data-track-index"),B=A!=null?parseInt(A,10):0,ae=te.getAttribute("data-composition-src")||te.getAttribute("data-composition-file"),de={id:te.id||W,tag:te.tagName.toLowerCase(),start:ne,duration:Oe,track:isNaN(B)?0:B};if(ae)de.compositionSrc=ae;else{const _t=te.querySelector("video[src]");_t&&(de.src=_t.getAttribute("src")||void 0,de.tag="video")}L.push(de)});let q=!1;const G=_.map(re=>{if(re.compositionSrc)return re;const te=j.getElementById(re.id)??j.querySelector(`[data-composition-id="${re.id}"]`);if(!te)return re;const W=te.getAttribute("data-composition-src")||te.getAttribute("data-composition-file");return W?(q=!0,{...re,compositionSrc:W}):re});if(L.length>0||q){const re=new Set(G.map(W=>W.id)),te=L.filter(W=>!re.has(W.id));c([...G,...te]),a(!0)}}catch(C){console.warn("[useTimelinePlayer] enrichMissingCompositions failed",C)}},[c,a]),w=m.useCallback(()=>{$0(t.current);let C=0;const j=25;n.current&&clearInterval(n.current),n.current=setInterval(()=>{var _,I,J,E;C++;const N=u();if(N&&N.getDuration()>0){clearInterval(n.current),N.pause();const D=r.current;r.current=null;const L=D!=null?Math.min(D,N.getDuration()):0;N.seek(L);const q=N.getDuration();Number.isFinite(q)&&q>0&&q<7200&&l(q),o(L),i.current||a(!0),i.current=!1,s(!1);try{const G=(_=t.current)==null?void 0:_.contentDocument,re=(I=t.current)==null?void 0:I.contentWindow;G&&re&&(b5(G,re),P5(G));const te=re==null?void 0:re.__clipManifest;if(te&&te.clips.length>0&&y(te),v(),le.getState().elements.length===0&&G){const W=Q0(G,N.getDuration());W.length>0&&(c(W),a(!0))}if(le.getState().elements.length===0&&G){const W=G.querySelector("[data-composition-id]"),ie=N.getDuration();if(W&&ie>0){const ne=W.getAttribute("data-composition-id")||"composition",A=(((J=t.current)==null?void 0:J.src)||"").match(/\/preview\/comp\/(.+?)(?:\?|$)/),B=A?decodeURIComponent(A[1]):void 0;c([{id:ne,tag:((E=W.tagName)==null?void 0:E.toLowerCase())||"div",start:0,duration:ie,track:0,compositionSrc:B}]),a(!0)}}}catch(G){console.warn("[useTimelinePlayer] Could not read timeline elements from iframe",G)}return}C>=j&&(clearInterval(n.current),console.warn("Could not find __player, __timeline, or __timelines on iframe after 5s"))},200)},[u,l,o,a,s,y,v]),k=m.useCallback(()=>{const C=u();r.current=C?C.getTime():le.getState().currentTime??0,i.current=!0,f(),s(!1)},[u,f,s]),$=m.useCallback(()=>{const C=t.current;if(!C)return;k();const j=C.src,N=new URL(j,window.location.origin);N.searchParams.set("_t",String(Date.now())),C.src=N.toString()},[k]),P=m.useRef(S);P.current=S;const Q=m.useRef(u);Q.current=u;const M=m.useRef(y);M.current=y;const T=m.useRef(v);T.current=v,Ot(()=>{const C=_=>{_.code==="Space"&&_.target===document.body&&(_.preventDefault(),P.current())},j=_=>{const I=_.data;if(!(_.source&&t.current&&_.source!==t.current.contentWindow)){if((I==null?void 0:I.source)==="hf-preview"&&(I==null?void 0:I.type)==="state")try{if(le.getState().elements.length===0){const J=t.current,E=J==null?void 0:J.contentWindow,D=E==null?void 0:E.__clipManifest;D&&D.clips.length>0&&M.current(D)}T.current()}catch(J){console.warn("[useTimelinePlayer] Could not read clip manifest from iframe",J)}if((I==null?void 0:I.source)==="hf-preview"&&(I==null?void 0:I.type)==="timeline"&&Array.isArray(I.clips)){if(M.current(I),T.current(),I.durationInFrames>0&&Number.isFinite(I.durationInFrames)){const E=I.durationInFrames/30,D=le.getState().duration;E>D&&le.getState().setDuration(E)}if(le.getState().elements.length===0)try{const J=t.current,E=J==null?void 0:J.contentDocument,D=u();if(E&&D){const L=Q0(E,D.getDuration());L.length>0&&(c(L),a(!0))}}catch(J){console.warn("[useTimelinePlayer] Could not read timeline elements on navigate (cross-origin)",J)}}}},N=()=>{var _;if(document.hidden&&le.getState().isPlaying){const I=(_=Q.current)==null?void 0:_.call(Q);I&&(I.pause(),s(!1),f())}};return window.addEventListener("keydown",C),window.addEventListener("message",j),document.addEventListener("visibilitychange",N),()=>{window.removeEventListener("keydown",C),window.removeEventListener("message",j),document.removeEventListener("visibilitychange",N),f(),n.current&&clearInterval(n.current)}});const V=m.useCallback(()=>{f(),n.current&&clearInterval(n.current),le.getState().reset()},[f]);return{iframeRef:t,play:p,pause:x,togglePlay:S,seek:O,onIframeLoad:w,refreshPlayer:$,saveSeekPosition:k,resetPlayer:V}}const $5=m.memo(function({projectId:e,iframeRef:n,onIframeLoad:r,portrait:i,directUrl:s,refreshKey:o}){const l=`${s??e}_${o??0}`;return g.jsx("div",{className:"flex flex-col h-full min-h-0",children:g.jsx("div",{className:"flex-1 flex items-center justify-center p-2 overflow-hidden min-h-0",children:g.jsx(fw,{ref:n,projectId:s?void 0:e,directUrl:s,onLoad:r,portrait:i},l)})})}),T5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),m.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),C5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),A5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),m.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),M5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),E5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),m.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Z"}))]]),R5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M180.49,143.51a12,12,0,0,1,0,17l-24,24a12,12,0,0,1-17-17L155,152l-15.52-15.51a12,12,0,1,1,17-17Zm-64-24a12,12,0,0,0-17,0l-24,24a12,12,0,0,0,0,17l24,24a12,12,0,0,0,17-17L101,152l15.52-15.51A12,12,0,0,0,116.49,119.51ZM220,88V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88ZM160,57V80h23Zm36,155V104H148a12,12,0,0,1-12-12V44H60V212Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),m.createElement("path",{d:"M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34Zm-104,88a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L91.31,152Zm72-12.68-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32l24,24A8,8,0,0,1,181.66,157.66ZM152,88V44l44,44Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M180.24,147.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L167.51,152l-19.75-19.76a6,6,0,1,1,8.48-8.48Zm-72-24a6,6,0,0,0-8.48,0l-24,24a6,6,0,0,0,0,8.48l24,24a6,6,0,1,0,8.48-8.48L88.49,152l19.75-19.76A6,6,0,0,0,108.24,123.76ZM214,88V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.52L158,46.48Zm44,134V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200A2,2,0,0,0,202,216Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M178.83,149.17a4,4,0,0,1,0,5.66l-24,24a4,4,0,0,1-5.66-5.66L170.34,152l-21.17-21.17a4,4,0,1,1,5.66-5.66Zm-72-24a4,4,0,0,0-5.66,0l-24,24a4,4,0,0,0,0,5.66l24,24a4,4,0,1,0,5.66-5.66L85.66,152l21.17-21.17A4,4,0,0,0,106.83,125.17ZM212,88V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.65Zm48,132V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200A4,4,0,0,0,204,216Z"}))]]),j5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,100h72v56H44Zm96-24V60h24V76Zm-24,0H92V60h24Zm0,104v16H92V180Zm24,0h24v16H140Zm0-24V100h72v56Zm72-80H188V60h24ZM68,60V76H44V60ZM44,180H68v16H44Zm144,16V180h24v16Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M32,176H224v24a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8ZM216,48H40a8,8,0,0,0-8,8V80H224V56A8,8,0,0,0,216,48Z",opacity:"0.2"}),m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,88h80v80H40Zm96-16V56h32V72Zm-16,0H88V56h32Zm0,112v16H88V184Zm16,0h32v16H136Zm0-16V88h80v80Zm80-96H184V56h32ZM72,56V72H40V56ZM40,184H72v16H40Zm176,16H184V184h32v16Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM184,56h32V72H184ZM72,200H40V184H72ZM72,72H40V56H72Zm48,128H88V184h32Zm0-128H88V56h32Zm48,128H136V184h32Zm0-128H136V56h32Zm48,128H184V184h32v16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,86h84v84H38Zm96-12V54h36V74Zm-12,0H86V54h36Zm0,108v20H86V182Zm12,0h36v20H134Zm0-12V86h84v84ZM218,56V74H182V54h34A2,2,0,0,1,218,56ZM40,54H74V74H38V56A2,2,0,0,1,40,54ZM38,200V182H74v20H40A2,2,0,0,1,38,200Zm178,2H182V182h36v18A2,2,0,0,1,216,202Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,88h80v80H40Zm96-16V56h32V72Zm-16,0H88V56h32Zm0,112v16H88V184Zm16,0h32v16H136Zm0-16V88h80v80Zm80-96H184V56h32ZM72,56V72H40V56ZM40,184H72v16H40Zm176,16H184V184h32v16Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,84h88v88H36Zm96-8V52h40V76Zm-8,0H84V52h40Zm0,104v24H84V180Zm8,0h40v24H132Zm0-8V84h88v88ZM220,56V76H180V52h36A4,4,0,0,1,220,56ZM40,52H76V76H36V56A4,4,0,0,1,40,52ZM36,200V180H76v24H40A4,4,0,0,1,36,200Zm180,4H180V180h40v20A4,4,0,0,1,216,204Z"}))]]),Z5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),V5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M211.45,52.51l-80-24A12,12,0,0,0,116,40V140.22A52,52,0,1,0,140,184V104.13l64.55,19.36A12,12,0,0,0,220,112V64A12,12,0,0,0,211.45,52.51ZM88,212a28,28,0,1,1,28-28A28,28,0,0,1,88,212ZM196,95.87l-56-16.8V56.13l56,16.8Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,184a40,40,0,1,1-40-40A40,40,0,0,1,128,184Z",opacity:"0.2"}),m.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34ZM88,216a32,32,0,1,1,32-32A32,32,0,0,1,88,216ZM200,101.25l-64-19.2V50.75L200,70Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M209.72,58.25l-80-24A6,6,0,0,0,122,40V153.05A46,46,0,1,0,134,184V96.06l72.28,21.69A6,6,0,0,0,214,112V64A6,6,0,0,0,209.72,58.25ZM88,218a34,34,0,1,1,34-34A34,34,0,0,1,88,218ZM202,103.94l-68-20.4V48.06l68,20.4Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34ZM88,216a32,32,0,1,1,32-32A32,32,0,0,1,88,216ZM200,101.25l-64-19.2V50.75L200,70Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M209.15,60.17l-80-24A4,4,0,0,0,124,40V158.75A44,44,0,1,0,132,184V93.38l74.85,22.45A4,4,0,0,0,212,112V64A4,4,0,0,0,209.15,60.17ZM88,220a36,36,0,1,1,36-36A36,36,0,0,1,88,220ZM204,106.62,132,85V45.38L204,67Z"}))]]),X5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),m.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),L5=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),D5=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),dn=m.forwardRef((t,e)=>{const{alt:n,color:r,size:i,weight:s,mirrored:o,children:l,weights:a,...c}=t,{color:u="currentColor",size:h,weight:f="regular",mirrored:d=!1,...p}=m.useContext(D5);return m.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:i??h,height:i??h,fill:r??u,viewBox:"0 0 256 256",transform:o||d?"scale(-1, 1)":void 0,...p,...c},!!n&&m.createElement("title",null,n),l,a.get(s??f))});dn.displayName="IconBase";const pw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:T5}));pw.displayName="ArrowLeftIcon";const _5=pw,mw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:C5}));mw.displayName="CaretDownIcon";const N5=mw,Xc=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:A5}));Xc.displayName="CaretRightIcon";const Ow=Xc,gw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:M5}));gw.displayName="CheckCircleIcon";const yw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:E5}));yw.displayName="FileIcon";const z5=yw,xw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:R5}));xw.displayName="FileCodeIcon";const W5=xw,vw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:j5}));vw.displayName="FilmStripIcon";const I5=vw,Sw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:Z5}));Sw.displayName="ImageIcon";const B5=Sw,ww=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:V5}));ww.displayName="MusicNoteIcon";const Y5=ww,Fa=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:X5}));Fa.displayName="WarningIcon";const kw=m.forwardRef((t,e)=>m.createElement(dn,{ref:e,...t,weights:L5}));kw.displayName="XIcon";function F5({stack:t,onNavigate:e}){return t.length<=1?null:g.jsxs("nav",{"aria-label":"Composition navigation",className:"flex items-center gap-1 px-2 h-8 border-b border-neutral-800/50 bg-neutral-900/50 flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:()=>e(t.length-2),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors",title:"Back (Esc)",children:g.jsx(_5,{size:12,weight:"bold"})}),t.map((n,r)=>{const i=r===t.length-1;return g.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&g.jsx(Ow,{size:10,className:"text-neutral-600 flex-shrink-0"}),i?g.jsx("span",{className:"text-xs text-neutral-200 font-medium",children:n.label}):g.jsx("button",{type:"button",onClick:()=>e(r),className:"text-xs text-neutral-500 hover:text-neutral-200 transition-colors",children:n.label})]},n.id)})]})}const q5=100,U5=220,G5=120,H5=m.memo(function({projectId:e,portrait:n,previewOverlay:r,timelineToolbar:i,timelineFooter:s,refreshKey:o,activeCompositionPath:l,onIframeRef:a,onCompositionChange:c,renderClipContent:u,onCompIdToSrcChange:h}){const{iframeRef:f,togglePlay:d,seek:p,onIframeLoad:x,saveSeekPosition:S}=Q5(),O=m.useRef(e);O.current!==e&&(O.current=e,le.getState().reset());const y=m.useRef(o);o!==y.current&&(y.current=o,S());const v=m.useCallback(()=>{x(),a==null||a(f.current)},[x,f,a]),[w,k]=m.useState(new Map);Ot(()=>{fetch(`/api/projects/${e}/files/index.html`).then(W=>W.json()).then(W=>{const ie=W.content||"",ne=new Map,Oe=/data-composition-id=["']([^"']+)["'][^>]*data-composition-src=["']([^"']+)["']|data-composition-src=["']([^"']+)["'][^>]*data-composition-id=["']([^"']+)["']/g;let A;for(;(A=Oe.exec(ie))!==null;){const B=A[1]||A[4],ae=A[2]||A[3];B&&ae&&ne.set(B,ae)}k(ne),h==null||h(ne)}).catch(()=>{})});const $=m.useRef(w);$.current=w,m.useEffect(()=>{if(w.size===0)return;const W=Oe=>{const A=$.current;if(A.size===0)return null;let B=!1;const ae=Oe.map(de=>{if(de.compositionSrc)return de;const be=A.get(de.id)??A.get(de.id.replace(/-(host|comp|layer)$/,""));return be?(B=!0,{...de,compositionSrc:be}):de});return B?ae:null},ie=W(le.getState().elements);ie&&le.getState().setElements(ie);let ne=!1;return le.subscribe((Oe,A)=>{if(ne||Oe.elements===A.elements||Oe.elements.length===0||Oe.elements.every(ae=>ae.compositionSrc))return;ne=!0;const B=W(Oe.elements);B&&Oe.setElements(B),ne=!1})},[w]);const[P,Q]=m.useState([{id:"master",label:"Master",previewUrl:`/api/projects/${e}/preview`}]),M=m.useRef(c);M.current=c;const T=m.useCallback(W=>{Q(ie=>{var A;const ne=typeof W=="function"?W(ie):W,Oe=(A=ne[ne.length-1])==null?void 0:A.id;return queueMicrotask(()=>{var B;return(B=M.current)==null?void 0:B.call(M,Oe==="master"?null:Oe)}),ne})},[]),[V,C]=m.useState(U5),j=m.useRef(!1),N=m.useRef(null),_=P[P.length-1],I=P.length>1?_.previewUrl:void 0,J=m.useRef(0),E=f,D=m.useCallback(W=>{var Oe;if(!W.compositionSrc)return;J.current=le.getState().currentTime,S();const ie=W.id;let ne=w.get(ie);if(!ne)try{const A=(Oe=E.current)==null?void 0:Oe.contentDocument;if(A){const B=A.querySelector(`[data-composition-id="${ie}"][data-composition-src]`);B&&(ne=B.getAttribute("data-composition-src")||void 0)}}catch{}if(!ne){const A=W.compositionSrc,B=A.match(/compositions\/.*\.html/);ne=B?B[0]:A}le.getState().setElements([]),T(A=>{var be;if(A[A.length-1].id===ne&&A.length>1)return A.slice(0,-1);const ae=((be=ne.split("/").pop())==null?void 0:be.replace(/\.html$/,""))||ne,de=`/api/projects/${e}/preview/comp/${ne}`;return[...A,{id:ne,label:ae,previewUrl:de}]})},[e,w]),L=m.useCallback(W=>{W===0&&J.current>0&&le.getState().setCurrentTime(J.current),S(),le.getState().setElements([]),T(ie=>ie.slice(0,W+1))},[]);m.useEffect(()=>{if(l==="index.html")le.getState().setElements([]),T(W=>W.length>1?[W[0]]:W);else if(l&&l.startsWith("compositions/")){const W=l.replace(/^compositions\//,"").replace(/\.html$/,""),ie=`/api/projects/${e}/preview/comp/${l}`;le.getState().setElements([]),T(ne=>{var Oe;return((Oe=ne[ne.length-1])==null?void 0:Oe.id)===l?ne:[{id:"master",label:"Master",previewUrl:`/api/projects/${e}/preview`},{id:l,label:W,previewUrl:ie}]})}else l||le.getState().setElements([])},[l,e,T]);const q=m.useCallback(W=>{W.preventDefault(),j.current=!0,W.target.setPointerCapture(W.pointerId)},[]),G=m.useCallback(W=>{if(!j.current||!N.current)return;const ie=N.current.getBoundingClientRect(),ne=W.clientY-ie.top,Oe=ie.height,A=Math.max(q5,Math.min(Oe-G5,Oe-ne));C(A)},[]),re=m.useCallback(()=>{j.current=!1},[]),te=m.useCallback(W=>{W.key==="Escape"&&P.length>1&&T(ie=>ie.slice(0,-1))},[P.length]);return g.jsxs("div",{ref:N,className:"flex flex-col h-full min-h-0 bg-neutral-950",onKeyDown:te,tabIndex:-1,children:[g.jsxs("div",{className:"flex-1 min-h-0 relative",children:[g.jsx($5,{projectId:e,iframeRef:f,onIframeLoad:v,portrait:n,directUrl:I,refreshKey:o}),r]}),g.jsx("div",{className:"h-1 flex-shrink-0 bg-neutral-800 hover:bg-blue-500 cursor-row-resize transition-colors active:bg-blue-400 z-10",style:{touchAction:"none"},onPointerDown:q,onPointerMove:G,onPointerUp:re}),g.jsxs("div",{className:"flex flex-col flex-shrink-0",style:{height:V},children:[g.jsxs("div",{className:"bg-neutral-950 border-t border-neutral-800/50 flex-shrink-0",children:[P.length>1&&g.jsx(F5,{stack:P,onNavigate:L}),g.jsx(f5,{onTogglePlay:d,onSeek:p})]}),g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto bg-neutral-950",onDoubleClick:W=>{W.target.closest("[data-clip]")||P.length>1&&T(ie=>ie.slice(0,-1))},children:[i,g.jsx(v5,{onSeek:p,onDrillDown:D,renderClipContent:u}),s]})]})]})});let Cd=[],bw=[];(()=>{let t="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,,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,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?bw:Cd).push(n=n+t[e])})();function K5(t){if(t<768)return!1;for(let e=0,n=Cd.length;;){let r=e+n>>1;if(t<Cd[r])n=r;else if(t>=bw[r])e=r+1;else return!0;if(e==n)return!1}}function T0(t){return t>=127462&&t<=127487}const C0=8205;function J5(t,e,n=!0,r=!0){return(n?Pw:eC)(t,e,r)}function Pw(t,e,n){if(e==t.length)return e;e&&Qw(t.charCodeAt(e))&&$w(t.charCodeAt(e-1))&&e--;let r=Vh(t,e);for(e+=A0(r);e<t.length;){let i=Vh(t,e);if(r==C0||i==C0||n&&K5(i))e+=A0(i),r=i;else if(T0(i)){let s=0,o=e-2;for(;o>=0&&T0(Vh(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function eC(t,e,n){for(;e>0;){let r=Pw(t,e-2,n);if(r<e)return r;e--}return 0}function Vh(t,e){let n=t.charCodeAt(e);if(!$w(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Qw(r)?(n-55296<<10)+(r-56320)+65536:n}function Qw(t){return t>=56320&&t<57344}function $w(t){return t>=55296&&t<56320}function A0(t){return t<65536?1:2}class me{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,n,r){[e,n]=Ts(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Nn.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ts(this,e,n);let r=[];return this.decompose(e,n,r,0),Nn.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Vo(this),s=new Vo(e);for(let o=n,l=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new Vo(this,e)}iterRange(e,n=this.length){return new Tw(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Cw(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?me.empty:e.length<=32?new Ne(e):Nn.from(Ne.split(e,[]))}}class Ne extends me{constructor(e,n=tC(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],l=i+o.length;if((n?r:l)>=e)return new nC(i,l,r,o);i=l+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new Ne(M0(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),l=qa(s.text,o.text.slice(),0,s.length);if(l.length<=32)r.push(new Ne(l,o.length+s.length));else{let a=l.length>>1;r.push(new Ne(l.slice(0,a)),new Ne(l.slice(a)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof Ne))return super.replace(e,n,r);[e,n]=Ts(this,e,n);let i=qa(this.text,qa(r.text,M0(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new Ne(i,s):Nn.from(Ne.split(i,[]),s)}sliceString(e,n=this.length,r=`
|
|
55
|
+
`){[e,n]=Ts(this,e,n);let i="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(i+=r),e<a&&n>s&&(i+=l.slice(Math.max(0,e-s),n-s)),s=a+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new Ne(r,i)),r=[],i=-1);return i>-1&&n.push(new Ne(r,i)),n}}class Nn extends me{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.children[s],l=i+o.length,a=r+o.lines-1;if((n?a:l)>=e)return o.lineInner(e,n,r,i);i=l+1,r=a+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&n>=o){let c=i&((o<=e?1:0)|(a>=n?2:0));o>=e&&a<=n&&!c?r.push(l):l.decompose(e-o,n-o,r,c)}o=a+1}}replace(e,n,r){if([e,n]=Ts(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],l=s+o.length;if(e>=s&&n<=l){let a=o.replace(e-s,n-s,r),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[i]=a,new Nn(u,this.length-(n-e)+r.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
56
|
+
`){[e,n]=Ts(this,e,n);let i="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(i+=r),e<a&&n>o&&(i+=l.sliceString(e-o,n-o,r)),o=a+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Nn))return 0;let r=0,[i,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==l)return r;let a=this.children[i],c=e.children[s];if(a!=c)return r+a.scanIdentical(c,n);r+=a.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let p of e)p.flatten(d);return new Ne(d,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,l=[],a=0,c=-1,u=[];function h(d){let p;if(d.lines>s&&d instanceof Nn)for(let x of d.children)h(x);else d.lines>o&&(a>o||!a)?(f(),l.push(d)):d instanceof Ne&&a&&(p=u[u.length-1])instanceof Ne&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new Ne(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&f(),a+=d.lines,c+=d.length+1,u.push(d))}function f(){a!=0&&(l.push(u.length==1?u[0]:Nn.from(u,c)),c=-1,a=u.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new Nn(l,n)}}me.empty=new Ne([""],0);function tC(t){let e=-1;for(let n of t)e+=n.length+1;return e}function qa(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s<t.length&&i<=r;s++){let l=t[s],a=i+l.length;a>=n&&(a>r&&(l=l.slice(0,r-i)),i<n&&(l=l.slice(n-i)),o?(e[e.length-1]+=l,o=!1):e.push(l)),i=a+1}return e}function M0(t,e,n){return qa(t,[""],e,n)}class Vo{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Ne?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,l=i instanceof Ne?i.text.length:i.children.length;if(o==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
57
|
+
`,this;e--}else if(i instanceof Ne){let a=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof Ne?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Tw{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Vo(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Cw{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(me.prototype[Symbol.iterator]=function(){return this.iter()},Vo.prototype[Symbol.iterator]=Tw.prototype[Symbol.iterator]=Cw.prototype[Symbol.iterator]=function(){return this});class nC{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Ts(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function et(t,e,n=!0,r=!0){return J5(t,e,n,r)}function rC(t){return t>=56320&&t<57344}function iC(t){return t>=55296&&t<56320}function ji(t,e){let n=t.charCodeAt(e);if(!iC(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return rC(r)?(n-55296<<10)+(r-56320)+65536:n}function Aw(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function El(t){return t<65536?1:2}const Ad=/\r\n?|\n/;var mt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(mt||(mt={}));class Gn{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,n=!1){Md(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Gn(e)}composeDesc(e){return this.empty?e:e.empty?this:Mw(this,e)}mapDesc(e,n=!1){return e.empty?this:Ed(this,e,n)}mapPos(e,n=-1,r=mt.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=i+l;if(a<0){if(c>e)return s+(e-i);s+=l}else{if(r!=mt.Simple&&c>=e&&(r==mt.TrackDel&&i<e&&c>e||r==mt.TrackBefore&&i<e||r==mt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==i||n<0?s:s+a;s+=a}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],o=this.sections[r++],l=i+s;if(o>=0&&i<=n&&l>=e)return i<e&&l>n?"cover":!0;i=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Gn(e)}static create(e){return new Gn(e)}}class Ge extends Gn{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Md(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return Ed(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let o=n[i],l=n[i+1];if(l>=0){n[i]=l,n[i+1]=o;let a=i>>1;for(;r.length<a;)r.push(me.empty);r.push(o?e.slice(s,s+o):me.empty)}s+=o}return new Ge(n,r)}compose(e){return this.empty?e:e.empty?this:Mw(this,e,!0)}map(e,n=!1){return e.empty?this:Ed(this,e,n,!0)}iterChanges(e,n=!1){Md(this,e,n)}get desc(){return Gn.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new ul(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);dt(i,u,-1);let h=s.ins==-1?-1:s.off==0?s.ins:0;dt(n,u,h),h>0&&Mr(r,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);dt(n,u,-1),dt(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new Ge(n,r),filtered:Gn.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!i.length)return;o<n&&dt(i,n-o,-1);let h=new Ge(i,s);l=l?l.compose(h.map(l)):h,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let h of u)c(h);else if(u instanceof Ge){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:h,to:f=h,insert:d}=u;if(h>f||h<0||f>n)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${n})`);let p=d?typeof d=="string"?me.of(d.split(r||Ad)):d:me.empty,x=p.length;if(h==f&&x==0)return;h<o&&a(),h>o&&dt(i,h-o,-1),dt(i,f-h,x),Mr(s,i,p),o=f}}return c(e),a(!l),l}static empty(e){return new Ge(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(me.empty);r[i]=me.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new Ge(n,r)}static createSet(e,n){return new Ge(e,n)}}function dt(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Mr(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(me.empty);t.push(n)}}function Md(t,e,n){let r=t.inserted;for(let i=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)i+=l,s+=l;else{let c=i,u=s,h=me.empty;for(;c+=l,u+=a,a&&r&&(h=h.append(r[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(i,c,s,u,h),i=c,s=u}}}function Ed(t,e,n,r=!1){let i=[],s=r?[]:null,o=new ul(t),l=new ul(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);dt(i,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(dt(i,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(dt(i,0,o.ins),s&&Mr(s,i,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let h=Math.min(u,l.len);c+=h,u-=h,l.forward(h)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;dt(i,c,a<o.i?o.ins:0),s&&a<o.i&&Mr(s,i,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?Ge.createSet(i,s):Gn.create(i);throw new Error("Mismatched change set lengths")}}}function Mw(t,e,n=!1){let r=[],i=n?[]:null,s=new ul(t),o=new ul(e);for(let l=!1;;){if(s.done&&o.done)return i?Ge.createSet(r,i):Gn.create(r);if(s.ins==0)dt(r,s.len,0,l),s.next();else if(o.len==0&&!o.done)dt(r,0,o.ins,l),i&&Mr(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;dt(r,a,u,l),i&&u&&Mr(i,r,o.text)}else o.ins==-1?(dt(r,s.off?0:s.len,a,l),i&&Mr(i,r,s.textBit(a))):(dt(r,s.off?0:s.len,o.off?0:o.ins,l),i&&!o.off&&Mr(i,r,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||r.length>c),s.forward2(a),o.forward(a)}}}}class ul{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,n=this.i-2>>1;return n>=e.length?me.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?me.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class pi{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new pi(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return R.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return R.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!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 R.range(e.anchor,e.head)}static create(e,n,r){return new pi(e,n,r)}}class R{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:R.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new R([this.main],0)}addRange(e,n=!0){return R.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,R.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new R(e.ranges.map(n=>pi.fromJSON(n)),e.main)}static single(e,n=e){return new R([R.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return R.normalized(e.slice(),n);r=s.to}return new R(e,n)}static cursor(e,n=0,r,i){return pi.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?pi.create(n,e,48|o):pi.create(e,n,(s?s<0?8:16:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?R.range(a,l):R.range(l,a))}}return new R(e,n)}}function Ew(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let zm=0;class K{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=zm++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new K(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Wm),!!e.static,e.enables)}of(e){return new Ua([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ua(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ua(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Wm(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ua{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=zm++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?a=!0:h=="selection"?c=!0:((n=e[h.id])!==null&&n!==void 0?n:1)&1||u.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,f){if(a&&f.docChanged||c&&(f.docChanged||f.selection)||Rd(h,u)){let d=r(h);if(l?!E0(d,h.values[o],i):!i(d,h.values[o]))return h.values[o]=d,1}return 0},reconfigure:(h,f)=>{let d,p=f.config.address[s];if(p!=null){let x=Dc(f,p);if(this.dependencies.every(S=>S instanceof K?f.facet(S)===h.facet(S):S instanceof Kt?f.field(S,!1)==h.field(S,!1):!0)||(l?E0(d=r(h),x,i):i(d=r(h),x)))return h.values[o]=x,0}else d=r(h);return h.values[o]=d,1}}}}function E0(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Rd(t,e){let n=!1;for(let r of e)Xo(t,r)&1&&(n=!0);return n}function sC(t,e,n){let r=n.map(a=>t[a.id]),i=n.map(a=>a.type),s=r.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<r.length;u++){let h=Dc(a,r[u]);if(i[u]==2)for(let f of h)c.push(f);else c.push(h)}return e.combine(c)}return{create(a){for(let c of r)Xo(a,c);return a.values[o]=l(a),1},update(a,c){if(!Rd(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=Rd(a,r),h=c.config.facets[e.id],f=c.facet(e);if(h&&!u&&Wm(n,h))return a.values[o]=f,0;let d=l(a);return e.compare(d,f)?(a.values[o]=f,0):(a.values[o]=d,1)}}}const ca=K.define({static:!0});class Kt{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new Kt(zm++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(ca).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(ca),o=i.facet(ca),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(r.values[n]=l.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,ca.of({field:this,create:e})]}get extension(){return this}}const ui={lowest:4,low:3,default:2,high:1,highest:0};function uo(t){return e=>new Rw(e,t)}const Rl={highest:uo(ui.highest),high:uo(ui.high),default:uo(ui.default),low:uo(ui.low),lowest:uo(ui.lowest)};class Rw{constructor(e,n){this.inner=e,this.prec=n}}class Lu{of(e){return new jd(this,e)}reconfigure(e){return Lu.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class jd{constructor(e,n){this.compartment=e,this.inner=n}}class Lc{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let f of oC(e,n,o))f instanceof Kt?i.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],c=[];for(let f of i)l[f.id]=c.length<<1,c.push(d=>f.slot(d));let u=r==null?void 0:r.config.facets;for(let f in s){let d=s[f],p=d[0].facet,x=u&&u[f]||[];if(d.every(S=>S.type==0))if(l[p.id]=a.length<<1|1,Wm(x,d))a.push(r.facet(p));else{let S=p.combine(d.map(O=>O.value));a.push(r&&p.compare(S,r.facet(p))?r.facet(p):S)}else{for(let S of d)S.type==0?(l[S.id]=a.length<<1|1,a.push(S.value)):(l[S.id]=c.length<<1,c.push(O=>S.dynamicSlot(O)));l[p.id]=c.length<<1,c.push(S=>sC(S,p,d))}}let h=c.map(f=>f(l));return new Lc(e,o,h,l,a,s)}}function oC(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,l){let a=i.get(o);if(a!=null){if(a<=l)return;let c=r[a].indexOf(o);c>-1&&r[a].splice(c,1),o instanceof jd&&n.delete(o.compartment)}if(i.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof jd){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof Rw)s(o.inner,o.prec);else if(o instanceof Kt)r[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Ua)r[l].push(o),o.facet.extensions&&s(o.facet.extensions,ui.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,ui.default),r.reduce((o,l)=>o.concat(l))}function Xo(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Dc(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const jw=K.define(),Zd=K.define({combine:t=>t.some(e=>e),static:!0}),Zw=K.define({combine:t=>t.length?t[0]:void 0,static:!0}),Vw=K.define(),Xw=K.define(),Lw=K.define(),Dw=K.define({combine:t=>t.length?t[0]:!1});class yr{constructor(e,n){this.type=e,this.value=n}static define(){return new lC}}class lC{of(e){return new yr(this,e)}}class aC{constructor(e){this.map=e}of(e){return new xe(this,e)}}class xe{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new xe(this.type,n)}is(e){return this.type==e}static define(e={}){return new aC(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}xe.reconfigure=xe.define();xe.appendConfig=xe.define();class Fe{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Ew(r,n.newLength),s.some(l=>l.type==Fe.time)||(this.annotations=s.concat(Fe.time.of(Date.now())))}static create(e,n,r,i,s,o){return new Fe(e,n,r,i,s,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 n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Fe.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Fe.time=yr.define();Fe.userEvent=yr.define();Fe.addToHistory=yr.define();Fe.remote=yr.define();function cC(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],o=t[r++];else if(i<e.length)s=e[i++],o=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function _w(t,e,n){var r;let i,s,o;return n?(i=e.changes,s=Ge.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:xe.mapEffects(t.effects,i).concat(xe.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Vd(t,e,n){let r=e.selection,i=ps(e.annotations);return e.userEvent&&(i=i.concat(Fe.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ge?e.changes:Ge.of(e.changes||[],n,t.facet(Zw)),selection:r&&(r instanceof R?r:R.single(r.anchor,r.head)),effects:ps(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function Nw(t,e,n){let r=Vd(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;r=_w(r,Vd(t,e[s],o?r.changes.newLength:t.doc.length),o)}let i=Fe.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return hC(n?uC(i):i)}function uC(t){let e=t.startState,n=!0;for(let i of e.facet(Vw)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:cC(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=Ge.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=Fe.create(e,i,t.selection&&t.selection.map(s),xe.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(Xw);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof Fe?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Fe?t=s[0]:t=Nw(e,ps(s),!1)}return t}function hC(t){let e=t.startState,n=e.facet(Lw),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=_w(r,Vd(e,s,t.changes.newLength),!0))}return r==t?t:Fe.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const fC=[];function ps(t){return t==null?fC:Array.isArray(t)?t:[t]}var Ee=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Ee||(Ee={}));const dC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Xd;try{Xd=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function pC(t){if(Xd)return Xd.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||dC.test(n)))return!0}return!1}function mC(t){return e=>{if(!/\S/.test(e))return Ee.Space;if(pC(e))return Ee.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Ee.Word;return Ee.Other}}class ge{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Xo(this,l<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Xo(this,r),Dc(this,r)}update(...e){return Nw(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let l of e.effects)l.is(Lu.reconfigure)?(n&&(i=new Map,n.compartments.forEach((a,c)=>i.set(c,a)),n=null),i.set(l.value.compartment,l.value.extension)):l.is(xe.reconfigure)?(n=null,r=l.value):l.is(xe.appendConfig)&&(n=null,r=ps(r).concat(l.value));let s;n?s=e.startState.values.slice():(n=Lc.resolve(r,i,this),s=new ge(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Zd)?e.newSelection:e.newSelection.asSingle();new ge(n,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:R.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=ps(r.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(i);for(let f=0;f<l;f++)s[f]=s[f].map(u);let h=i.mapDesc(c,!0);s.push(a.range.map(h)),i=i.compose(u),o=xe.mapEffects(o,u).concat(xe.mapEffects(ps(a.effects),h))}return{changes:i,selection:R.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Ge?e:Ge.of(e,this.doc.length,this.facet(ge.lineSeparator))}toText(e){return me.of(e.split(this.facet(ge.lineSeparator)||Ad))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Xo(this,n),Dc(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Kt&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],l=e[s];i.push(o.init(a=>o.spec.fromJSON(l,a)))}}return ge.create({doc:e.doc,selection:R.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Lc.resolve(e.extensions||[],new Map),r=e.doc instanceof me?e.doc:me.of((e.doc||"").split(n.staticFacet(ge.lineSeparator)||Ad)),i=e.selection?e.selection instanceof R?e.selection:R.single(e.selection.anchor,e.selection.head):R.single(0);return Ew(i,r.length),n.staticFacet(Zd)||(i=i.asSingle()),new ge(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(ge.tabSize)}get lineBreak(){return this.facet(ge.lineSeparator)||`
|
|
58
|
+
`}get readOnly(){return this.facet(Dw)}phrase(e,...n){for(let r of this.facet(ge.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(jw))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return mC(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,l=e-r;for(;o>0;){let a=et(n,o,!1);if(s(n.slice(a,o))!=Ee.Word)break;o=a}for(;l<i;){let a=et(n,l);if(s(n.slice(l,a))!=Ee.Word)break;l=a}return o==l?null:R.range(o+r,l+r)}}ge.allowMultipleSelections=Zd;ge.tabSize=K.define({combine:t=>t.length?t[0]:4});ge.lineSeparator=Zw;ge.readOnly=Dw;ge.phrases=K.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});ge.languageData=jw;ge.changeFilter=Vw;ge.transactionFilter=Xw;ge.transactionExtender=Lw;Lu.reconfigure=xe.define();function Bs(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],l=r[s];if(l===void 0)r[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Ir{eq(e){return this==e}range(e,n=e){return Ld.create(e,n,this)}}Ir.prototype.startSide=Ir.prototype.endSide=0;Ir.prototype.point=!1;Ir.prototype.mapMode=mt.TrackDel;function Im(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Ld=class zw{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new zw(e,n,r)}};function Dd(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Bm{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(r?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,h=this.to[a]+e,f,d;if(u==h){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(f=d=p,c.startSide!=c.endSide&&(d=n.mapPos(u,c.endSide),d<f)))continue}else if(f=n.mapPos(u,c.startSide),d=n.mapPos(h,c.endSide),f>d||f==d&&c.startSide>0&&c.endSide<=0)continue;(d-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,d-f)),r.push(c),i.push(f-o),s.push(d-o))}return{mapped:r.length?new Bm(i,s,r,l):null,pos:o}}}class he{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new he(e,n,r,i)}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 n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(Dd)),this.isEmpty)return n.length?he.of(n):this;let l=new Ww(this,null,-1).goto(0),a=0,c=[],u=new Ti;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let h=n[a++];u.addInner(h.from,h.to,h.value)||c.push(h)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||i>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||i>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(Ld.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?he.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)i=Math.max(i,a.maxPoint),n.push(a),r.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:h}=a.map(l,e);u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(h))}}let s=this.nextLayer.map(e);return n.length==0?s:new he(r,n,s||he.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return hl.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return hl.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=n.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=R0(o,l,r),c=new ho(o,a,s),u=new ho(l,a,s);r.iterGaps((h,f,d)=>j0(c,h,u,f,d,i)),r.empty&&r.length==0&&j0(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=R0(s,o),a=new ho(s,l,0).goto(r),c=new ho(o,l,0).goto(r);for(;;){if(a.to!=c.to||!_d(a.active,c.active)||a.point&&(!c.point||!Im(a.point,c.point)))return!1;if(a.to>i)return!0;a.next(),c.next()}}static spans(e,n,r,i,s=-1){let o=new ho(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let u=o.activeForPoint(o.to),h=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);i.point(l,c,o.point,u,h,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(i.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>r)return a+(o.point&&o.to>r?1:0);l=o.to,o.next()}}static of(e,n=!1){let r=new Ti;for(let i of e instanceof Ld?[e]:n?OC(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return he.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=he.empty;i=i.nextLayer)n=new he(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}he.empty=new he([],[],null,-1);function OC(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(Dd(e,r)>0)return t.slice().sort(Dd);e=r}return t}he.empty.nextLayer=he.empty;class Ti{finishChunk(e){this.chunks.push(new Bm(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,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Ti)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(he.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=he.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function R0(t,e,n){let r=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=r.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!(n!=null&&n.touchesRange(l,l+s.chunk[o].length))&&i.add(s.chunk[o])}return i}class Ww{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!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],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.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 hl{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new Ww(o,n,r,s));return i.length==1?i[0]:new hl(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Xh(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Xh(this.heap,r);(this.to-e||this.value.endSide-n)<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(),Xh(this.heap,0)}}}function Xh(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class ho{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=hl.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){ua(this.active,e),ua(this.activeTo,e),ua(this.activeRank,e),this.minActive=Z0(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;ha(this.active,n,r),ha(this.activeTo,n,i),ha(this.activeRank,n,s),e&&ha(e,n,this.cursor.from),this.minActive=Z0(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&ua(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function j0(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,l=r,a=r-e,c=!!s.boundChange;for(let u=!1;;){let h=t.to+a-n.to,f=h||t.endSide-n.endSide,d=f<0?t.to+a:n.to,p=Math.min(d,o);if(t.point||n.point?(t.point&&n.point&&Im(t.point,n.point)&&_d(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,p,t.point,n.point),u=!1):(u&&s.boundChange(l),p>l&&!_d(t.active,n.active)&&s.compareRange(l,p,t.active,n.active),c&&p<o&&(h||t.openEnd(d)!=n.openEnd(d))&&(u=!0)),d>o)break;l=d,f<=0&&t.next(),f>=0&&n.next()}}function _d(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Im(t[n],e[n]))return!1;return!0}function ua(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function ha(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function Z0(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Du(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=et(t,i));return r}function gC(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=et(t,i)}return t.length}const Nd="ͼ",V0=typeof Symbol>"u"?"__"+Nd:Symbol.for(Nd),zd=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),X0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Br{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(x=>o.map(S=>x.replace(/&/,S))).reduce((x,S)=>x.concat(S)),p,a);else if(p&&typeof p=="object"){if(!h)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(i(d),p,u,f)}else p!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+p+";")}(u.length||f)&&a.push((r&&!h&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
59
|
+
`)}static newName(){let e=X0[V0]||1;return X0[V0]=e+1,Nd+e.toString(36)}static mount(e,n,r){let i=e[zd],s=r&&r.nonce;i?s&&i.setNonce(s):i=new yC(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let L0=new Map;class yC{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=L0.get(r);if(s)return e[zd]=s;this.sheet=new i.CSSStyleSheet,L0.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[zd]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),r)for(let c=0;c<l.rules.length;c++)r.insertRule(l.rules[c],i++)}else{for(;s<a;)i+=this.modules[s++].rules.length;i+=l.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
60
|
+
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Yr={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:"'"},fl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xC=typeof navigator<"u"&&/Mac/.test(navigator.platform),vC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ot=0;ot<10;ot++)Yr[48+ot]=Yr[96+ot]=String(ot);for(var ot=1;ot<=24;ot++)Yr[ot+111]="F"+ot;for(var ot=65;ot<=90;ot++)Yr[ot]=String.fromCharCode(ot+32),fl[ot]=String.fromCharCode(ot);for(var Lh in Yr)fl.hasOwnProperty(Lh)||(fl[Lh]=Yr[Lh]);function SC(t){var e=xC&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||vC&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?fl:Yr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Ke(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)Iw(t,arguments[e]);return t}function Iw(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)Iw(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let St=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Wd=typeof document<"u"?document:{documentElement:{style:{}}};const Id=/Edge\/(\d+)/.exec(St.userAgent),Bw=/MSIE \d/.test(St.userAgent),Bd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(St.userAgent),_u=!!(Bw||Bd||Id),D0=!_u&&/gecko\/(\d+)/i.test(St.userAgent),Dh=!_u&&/Chrome\/(\d+)/.exec(St.userAgent),wC="webkitFontSmoothing"in Wd.documentElement.style,Yd=!_u&&/Apple Computer/.test(St.vendor),_0=Yd&&(/Mobile\/\w+/.test(St.userAgent)||St.maxTouchPoints>2);var F={mac:_0||/Mac/.test(St.platform),windows:/Win/.test(St.platform),linux:/Linux|X11/.test(St.platform),ie:_u,ie_version:Bw?Wd.documentMode||6:Bd?+Bd[1]:Id?+Id[1]:0,gecko:D0,gecko_version:D0?+(/Firefox\/(\d+)/.exec(St.userAgent)||[0,0])[1]:0,chrome:!!Dh,chrome_version:Dh?+Dh[1]:0,ios:_0,android:/Android\b/.test(St.userAgent),webkit_version:wC?+(/\bAppleWebKit\/(\d+)/.exec(St.userAgent)||[0,0])[1]:0,safari:Yd,safari_version:Yd?+(/\bVersion\/(\d+(\.\d+)?)/.exec(St.userAgent)||[0,0])[1]:0,tabSize:Wd.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Ym(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const _c=Object.create(null);function Fm(t,e,n){if(t==e)return!0;t||(t=_c),e||(e=_c);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function kC(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function N0(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function bC(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Zi{eq(e){return!1}updateDOM(e,n,r){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,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Xt=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(Xt||(Xt={}));class se extends Ir{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new jl(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Ci(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=Yw(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new Ci(e,r,i,n,e.widget||null,!0)}static line(e){return new Zl(e)}static set(e,n=!1){return he.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}se.none=he.empty;class jl extends se{constructor(e){let{start:n,end:r}=Yw(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Ym(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||_c}eq(e){return this==e||e instanceof jl&&this.tagName==e.tagName&&Fm(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}jl.prototype.point=!1;class Zl extends se{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Zl&&this.spec.class==e.spec.class&&Fm(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Zl.prototype.mapMode=mt.TrackBefore;Zl.prototype.point=!0;class Ci extends se{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?mt.TrackBefore:mt.TrackAfter:mt.TrackDel}get type(){return this.startSide!=this.endSide?Xt.WidgetRange:this.startSide<=0?Xt.WidgetBefore:Xt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Ci&&PC(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Ci.prototype.point=!0;function Yw(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function PC(t,e){return t==e||!!(t&&e&&t.compare(e))}function ms(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class dl extends Ir{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof dl&&this.tagName==e.tagName&&Fm(this.attributes,e.attributes)}static create(e){return new dl(e.tagName,e.attributes||_c)}static set(e,n=!1){return he.of(e,n)}}dl.prototype.startSide=dl.prototype.endSide=-1;function pl(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Fd(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Lo(t,e){if(!e.anchorNode)return!1;try{return Fd(t,e.anchorNode)}catch{return!1}}function Ga(t){return t.nodeType==3?ml(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Do(t,e,n,r){return n?z0(t,e,n,r,-1)||z0(t,e,n,r,1):!1}function Fr(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Nc(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function z0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:mr(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Fr(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?mr(t):0}else return!1}}function mr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zc(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function QC(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Fw(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function $C(t,e,n,r,i,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,h=!1;u&&!h;)if(u.nodeType==1){let f,d=u==a.body,p=1,x=1;if(d)f=QC(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:x}=Fw(u,y)),f={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*x}}let S=0,O=0;if(i=="nearest")e.top<f.top?(O=e.top-(f.top+o),n>0&&e.bottom>f.bottom+O&&(O=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(O=e.bottom-f.bottom+o,n<0&&e.top-O<f.top&&(O=e.top-(f.top+o)));else{let y=e.bottom-e.top,v=f.bottom-f.top;O=(i=="center"&&y<=v?e.top+y/2-v/2:i=="start"||i=="center"&&n<0?e.top-o:e.bottom-v+o)-f.top}if(r=="nearest"?e.left<f.left?(S=e.left-(f.left+s),n>0&&e.right>f.right+S&&(S=e.right-f.right+s)):e.right>f.right&&(S=e.right-f.right+s,n<0&&e.left<f.left+S&&(S=e.left-(f.left+s))):S=(r=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:r=="start"==l?e.left-s:e.right-(f.right-f.left)+s)-f.left,S||O)if(d)c.scrollBy(S,O);else{let y=0,v=0;if(O){let w=u.scrollTop;u.scrollTop+=O/x,v=(u.scrollTop-w)*x}if(S){let w=u.scrollLeft;u.scrollLeft+=S/p,y=(u.scrollLeft-w)*p}e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v},y&&Math.abs(y-S)<1&&(r="nearest"),v&&Math.abs(v-O)<1&&(i="nearest")}if(d)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function qw(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class TC{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:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?mr(n):0),r,Math.min(e.focusOffset,r?mr(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let ai=null;F.safari&&F.safari_version>=26&&(ai=!1);function Uw(t){if(t.setActive)return t.setActive();if(ai)return t.focus(ai);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ai==null?{get preventScroll(){return ai={preventScroll:!0},!0}}:void 0),!ai){ai=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let W0;function ml(t,e,n=e){let r=W0||(W0=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Os(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function CC(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function AC(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,mr(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=mr(n))}else{if(n==t)return!0;r=Fr(n),n=n.parentNode}}function Gw(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Hw(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=mr(n)}else if(n.parentNode&&!Nc(n))r=Fr(n),n=n.parentNode;else return null}}function Kw(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Nc(n))r=Fr(n)+1,n=n.parentNode;else return null}}class wn{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new wn(e.parentNode,Fr(e),n)}static after(e,n){return new wn(e.parentNode,Fr(e)+1,n)}}var We=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(We||(We={}));const Ai=We.LTR,qm=We.RTL;function Jw(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const MC=Jw("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),EC=Jw("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),qd=Object.create(null),En=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);qd[e]=n,qd[n]=-e}function e2(t){return t<=247?MC[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?EC[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const RC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Wn{get dir(){return this.level%2?qm:Ai}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==r)return o;(s<0||(i!=0?i<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function t2(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!t2(r.inner,i.inner))return!1}return!0}const we=[];function jC(t,e,n,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,l=s<r.length?r[s].from:n,a=s?256:i;for(let c=o,u=a,h=a;c<l;c++){let f=e2(t.charCodeAt(c));f==512?f=u:f==8&&h==4&&(f=16),we[c]=f==4?2:f,f&7&&(h=f),u=f}for(let c=o,u=a,h=a;c<l;c++){let f=we[c];if(f==128)c<l-1&&u==we[c+1]&&u&24?f=we[c]=u:we[c]=256;else if(f==64){let d=c+1;for(;d<l&&we[d]==64;)d++;let p=c&&u==8||d<n&&we[d]==8?h==1?1:8:256;for(let x=c;x<d;x++)we[x]=p;c=d-1}else f==8&&h==1&&(we[c]=1);u=f,f&7&&(h=f)}}}function ZC(t,e,n,r,i){let s=i==1?2:1;for(let o=0,l=0,a=0;o<=r.length;o++){let c=o?r[o-1].to:e,u=o<r.length?r[o].from:n;for(let h=c,f,d,p;h<u;h++)if(d=qd[f=t.charCodeAt(h)])if(d<0){for(let x=l-3;x>=0;x-=3)if(En[x+1]==-d){let S=En[x+2],O=S&2?i:S&4?S&1?s:i:0;O&&(we[h]=we[En[x]]=O),l=x;break}}else{if(En.length==189)break;En[l++]=h,En[l++]=f,En[l++]=a}else if((p=we[h])==2||p==1){let x=p==i;a=x?0:1;for(let S=l-3;S>=0;S-=3){let O=En[S+2];if(O&2)break;if(x)En[S+2]|=2;else{if(O&4)break;En[S+2]|=4}}}}}function VC(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,l=i<n.length?n[i].from:e;for(let a=o;a<l;){let c=we[a];if(c==256){let u=a+1;for(;;)if(u==l){if(i==n.length)break;u=n[i++].to,l=i<n.length?n[i].from:e}else if(we[u]==256)u++;else break;let h=s==1,f=(u<e?we[u]:r)==1,d=h==f?h?1:2:r;for(let p=u,x=i,S=x?n[x-1].to:t;p>a;)p==S&&(p=n[--x].from,S=x?n[x-1].to:t),we[--p]=d;a=u}else s=c,a++}}}function Ud(t,e,n,r,i,s,o){let l=r%2?2:1;if(r%2==i%2)for(let a=e,c=0;a<n;){let u=!0,h=!1;if(c==s.length||a<s[c].from){let x=we[a];x!=l&&(u=!1,h=x==16)}let f=!u&&l==1?[]:null,d=u?r:r+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(h)break e;let x=s[c];if(!u)for(let S=x.to,O=c+1;;){if(S==n)break e;if(O<s.length&&s[O].from==S)S=s[O++].to;else{if(we[S]==l)break e;break}}if(c++,f)f.push(x);else{x.from>a&&o.push(new Wn(a,x.from,d));let S=x.direction==Ai!=!(d%2);Gd(t,S?r+1:r,i,x.inner,x.from,x.to,o),a=x.to}p=x.to}else{if(p==n||(u?we[p]!=l:we[p]==l))break;p++}f?Ud(t,a,p,r+1,i,f,o):a<p&&o.push(new Wn(a,p,d)),a=p}else for(let a=n,c=s.length;a>e;){let u=!0,h=!1;if(!c||a>s[c-1].to){let x=we[a-1];x!=l&&(u=!1,h=x==16)}let f=!u&&l==1?[]:null,d=u?r:r+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(h)break e;let x=s[--c];if(!u)for(let S=x.from,O=c;;){if(S==e)break e;if(O&&s[O-1].to==S)S=s[--O].from;else{if(we[S-1]==l)break e;break}}if(f)f.push(x);else{x.to<a&&o.push(new Wn(x.to,a,d));let S=x.direction==Ai!=!(d%2);Gd(t,S?r+1:r,i,x.inner,x.from,x.to,o),a=x.from}p=x.from}else{if(p==e||(u?we[p-1]!=l:we[p-1]==l))break;p--}f?Ud(t,p,a,r+1,i,f,o):p<a&&o.push(new Wn(p,a,d)),a=p}}function Gd(t,e,n,r,i,s,o){let l=e%2?2:1;jC(t,i,s,r,l),ZC(t,i,s,r,l),VC(i,s,r,l),Ud(t,i,s,e,n,r,o)}function XC(t,e,n){if(!t)return[new Wn(0,0,e==qm?1:0)];if(e==Ai&&!n.length&&!RC.test(t))return n2(t.length);if(n.length)for(;t.length>we.length;)we[we.length]=256;let r=[],i=e==Ai?0:1;return Gd(t,i,i,n,0,t.length,r),r}function n2(t){return[new Wn(0,t,0)]}let r2="";function LC(t,e,n,r,i){var s;let o=r.head-t.from,l=Wn.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),a=e[l],c=a.side(i,n);if(o==c){let f=l+=i?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!i,n),c=a.side(i,n)}let u=et(t.text,o,a.forward(i,n));(u<a.from||u>a.to)&&(u=c),r2=t.text.slice(Math.min(o,u),Math.max(o,u));let h=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return h&&u==c&&h.level+(i?0:1)<a.level?R.cursor(h.side(!i,n)+t.from,h.forward(i,n)?1:-1,h.level):R.cursor(u+t.from,a.forward(i,n)?-1:1,a.level)}function DC(t,e,n){for(let r=e;r<n;r++){let i=e2(t.charCodeAt(r));if(i==1)return Ai;if(i==2||i==4)return qm}return Ai}const i2=K.define(),s2=K.define(),o2=K.define(),l2=K.define(),Hd=K.define(),a2=K.define(),c2=K.define(),Um=K.define(),Gm=K.define(),u2=K.define({combine:t=>t.some(e=>e)}),_C=K.define({combine:t=>t.some(e=>e)}),h2=K.define();class gs{constructor(e,n="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new gs(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 gs(R.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const fa=xe.define({map:(t,e)=>t.map(e)}),f2=xe.define();function In(t,e,n){let r=t.facet(l2);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const sr=K.define({combine:t=>t.length?t[0]:!0});let NC=0;const ns=K.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Lt{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(ns.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ns.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=n||{};return new Lt(NC++,e,r,i,l=>{let a=[];return o&&a.push(Nu.of(c=>{let u=c.plugin(l);return u?o(u):se.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return Lt.define((r,i)=>new e(r,i),n)}}class _h{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 n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(In(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){In(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){In(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const d2=K.define(),Hm=K.define(),Nu=K.define(),p2=K.define(),Km=K.define(),Vl=K.define(),m2=K.define();function I0(t,e){let n=t.state.facet(m2);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return he.spans(r,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,h=i;for(let f=l.length-1;f>=0;f--,a--){let d=l[f].spec.bidiIsolate,p;if(d==null&&(d=DC(e.text,c,u)),a>0&&h.length&&(p=h[h.length-1]).to==c&&p.direction==d)p.to=u,h=p.inner;else{let x={from:c,to:u,direction:d,inner:[]};h.push(x),h=x.inner}}}}),i}const O2=K.define();function g2(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(O2)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const ko=K.define();class sn{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new sn(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 n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,o=0;;){let l=i<e.length?e[i].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,h=c,f=u;for(;;)if(s<n.length&&n[s]<=h){let d=n[s+1];s+=2,h=Math.max(h,d);for(let p=i;p<e.length&&e[p].fromB<=h;p++)o=e[p].toA-e[p].toB;f=Math.max(f,d+o)}else if(i<e.length&&e[i].fromB<=h){let d=e[i++];h=Math.max(h,d.toB),f=Math.max(f,d.toA),o=d.toA-d.toB}else break;r.push(new sn(u,f,c,h))}return r}}class Wc{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Ge.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,l,a)=>i.push(new sn(s,o,l,a))),this.changedRanges=i}static create(e,n,r){return new Wc(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const zC=[];class _e{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return zC}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 n=this.domAttrs;n&&kC(this.dom,n)}}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,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=Fr(this.dom),i=this.length?e>0:n>0;return new wn(this.parent.dom,r+(i?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 Wu)return e;return null}static get(e){return e.cmTile}}class zu extends _e{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 n=this.dom,r=null,i,s=(e==null?void 0:e.node)==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;i&&i!=l.dom;)i=B0(i);else n.insertBefore(l.dom,i);r=l.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=B0(i);this.length=o}}function B0(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Wu extends zu{constructor(e,n){super(n),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 n=_e.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let o=r.children[i++];if(o instanceof cr)n.push(i),r=o,i=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(r=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,i=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class cr extends zu{constructor(e,n){super(e),this.wrapper=n}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,n){let r=new cr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Cs extends zu{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Cs(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,o=null,l=-1;function a(u,h){for(let f=0,d=0;f<u.children.length&&d<=h;f++){let p=u.children[f],x=d+p.length;x>=h&&(p.isComposite()?a(p,h-d):(!o||o.isHidden&&(n>0||r&&IC(o,p)))&&(x>h||p.flags&32)?(o=p,l=h-d):(d<h||p.flags&16&&!p.isHidden)&&(i=p,s=h-d)),d=x}}a(this,e);let c=(n<0?i:o)||i||o;return c?{tile:c,offset:c==i?s:l}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):WC(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new wn(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let o=r.tile.parent,l=!1;for(let a of o.children){if(l)return new wn(a.dom,0);a==r.tile&&(l=!0)}}return new wn(this.dom,0)}}function WC(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Ga(e);return n[n.length-1]||null}function IC(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Mt extends zu{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Mt(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class mi extends _e{constructor(e,n){super(e,n.length),this.text=n}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,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?F.chrome||F.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):n<0?i--:s<r&&s++;let l=ml(this.dom,i,s).getClientRects();if(!l.length)return null;let a=l[(o?o<0:n>=0)?0:l.length-1];return F.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?zc(a,o<0):a||null}static of(e,n){let r=new mi(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Mi extends _e{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return zc(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return zc(o,!l)}}get overrideDOMText(){if(!this.length)return me.empty;let{root:e}=this;if(!e)return me.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new Mi(s,r,e,i)}}class Ic extends _e{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return me.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class BC{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(i.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==i.children.length){if(!e&&!l.length)break;r&&r.leave(i),o=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++}else{let a=i.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!r||r.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:i,index:s}),i=a,s=0,r&&a.isComposite()&&r.enter(a))}else if(s==i.length)o=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,i.length-s);r&&r.skip(i,s,s+a),e-=a,s+=a}else break;return this.tile=i,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class YC{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class FC{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let o=this.ensureMarks(n,r),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new mi(l.dom,l.text+e);a.parent=o}else o.append(i||mi.of(e,(s=this.cache.find(mi))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Nh(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=i.lastChild;if(c instanceof Mt&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(Nh(a.dom)),i=c;else{if(this.cache.reused.get(a)){let h=_e.get(a.dom);h&&h.setDOM(Nh(a.dom))}let u=Mt.of(a.mark,a.dom);i.append(u),i=u}this.cache.reused.set(a,2)}let s=_e.get(e.text);s&&this.cache.reused.set(s,2);let o=new mi(e.text,e.text.nodeValue);o.flags|=8,i.append(o)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=y2);let i=Cs.start(e,n||((r=this.cache.find(Cs))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}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,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=i.lastChild)&&l instanceof Mt&&l.mark.eq(o))i=l,n--;else{let a=Mt.of(o,(r=this.cache.find(Mt,c=>c.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(a),i=a,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Y0(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(F.ios&&Y0(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(zh,0,32)||new Mi(zh.toDOM(),0,zh,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 n=new YC(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof cr&&i.wrapper.eq(r.wrapper))n=i;else{let s=cr.of(r.wrapper,(e=this.cache.find(cr,o=>o.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(Ic,void 0,1);return r&&(r.flags=n),r||new Ic(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class qC{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:i,lineBreak:s,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=i;let l=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const Bc=[Mi,Cs,mi,Mt,Ic,cr,Wu];for(let t=0;t<Bc.length;t++)Bc[t].bucket=t;class UC{constructor(e){this.view=e,this.buckets=Bc.map(()=>[]),this.index=Bc.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],o=this.index[i];for(let l=s.length-1;l>=0;l--){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,o=0;;s++){if(s==i.length){if(o)return null;o=1,s=0}let l=i[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==r?(this.reused.set(l,1),l):(this.reused.set(l,2),new Mi(l.dom,n,e,l.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class GC{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new UC(e),this.text=new qC(e.state.doc),this.builder=new FC(this.cache,new Wu(e,e.contentDOM),he.iter(r)),this.cache.reused.set(n,2),this.old=new BC(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>i){let c=a-i;this.preserve(c,!o,!l),i=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,i=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=JC(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?Mi.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,i,s),s=i.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),i,s)),s=i.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Ic)this.cache.add(o);else if(o instanceof Mt)this.builder.ensureLine(null),this.builder.addMark(o,i,s),this.cache.reused.set(o,1),s=i.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 Mt&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof Mt&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,o=he.spans(this.decorations,e,n,{point:(l,a,c,u,h,f)=>{if(c instanceof Ci){if(this.disallowBlockEffectsFor[f]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,h>u.length)i.continueWidget(a-l);else{let d=c.widget||(c.block?As.block:As.inline),p=HC(c),x=this.cache.findWidget(d,a-l,p)||Mi.of(d,this.view,a-l,p);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,u,h))}r=null}else r=KC(r,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let h=l;h<a;){let f=this.text.next(Math.min(512,a-h));f==null?(i.addLineStartIfNotCovered(r),i.addBreak(),h++):(i.ensureLine(r),i.addText(f,c,h==l?u:c.length),h+=f.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=o>s,this.openMarks=o}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=_e.get(i);if(i==this.view.contentDOM)break;s instanceof Mt?n.push(s):s!=null&&s.isLine()?r=s:s instanceof cr||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Cs(i,y2):r||n.push(Mt.of(new jl({tagName:i.nodeName.toLowerCase(),attributes:bC(i)}),i)))}return{line:r,marks:n}}}function Y0(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function HC(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const y2={class:"cm-line"};function KC(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&Ym(n,t),r&&(t.class+=" "+r)),t}function JC(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof Mt&&e.push(r.mark)}return e}function Nh(t){let e=_e.get(t);return e&&e.setDOM(t.cloneNode()),t}class As extends Zi{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}}As.inline=new As("span");As.block=new As("div");const zh=new class extends Zi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class F0{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=se.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 Wu(e,e.contentDOM),this.updateInner([new sn(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:h})=>h<this.minWidthFrom||u>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 i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!a4(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?t4(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:h}=this.hasComposition;r=new sn(u,h,e.changes.mapPos(u,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(F.ie||F.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=i4(o,this.decorations,e.changes);a.length&&(r=sn.extendWithRanges(r,a));let c=o4(l,this.blockWrappers,e.changes);return c.length&&(r=sn.extendWithRanges(r,c)),s&&!r.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let o=this.tile,l=new GC(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&_e.get(n.text)&&l.cache.reused.set(_e.get(n.text),2),this.tile=l.run(e,n),Kd(o,l.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 s=F.chrome||F.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Wh&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(f2)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,o=!s&&!(this.view.state.facet(sr)||r.tabIndex>-1)&&Lo(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),F.gecko&&a.empty&&!this.hasComposition&&e4(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new wn(f,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||(!Do(c.node,c.offset,h.anchorNode,h.anchorOffset)||!Do(u.node,u.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,a))&&(this.view.observer.ignore(()=>{F.android&&F.chrome&&r.contains(h.focusNode)&&l4(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let f=pl(this.view.root);if(f)if(a.empty){if(F.gecko){let d=n4(c.node,c.offset);if(d&&d!=3){let p=(d==1?Hw:Kw)(c.node,c.offset);p&&(c=new wn(p.node,p.offset))}}f.collapse(c.node,c.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),d.setEnd(u.node,u.offset),d.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new wn(h.anchorNode,h.anchorOffset),this.impreciseHead=u.precise?null:new wn(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Do(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=pl(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let o=mr(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==r.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!_e.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,l=i;;o++){let a=r.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let h=u+c.length;if(u<=e&&(r=c,i=e-u,s=h<e),h>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!r&&!o?this.domAtPos(e,n):(s&&o?r=null:a&&r&&(o=null),r&&n<0||!o?r.domIn(i,n):o.domIn(l,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Wh?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=i(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=et(s.text,o);if(l==o)return null;let a=ml(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==We.LTR,c=0,u=(h,f,d)=>{for(let p=0;p<h.children.length&&!(f>i);p++){let x=h.children[p],S=f+x.length,O=x.dom.getBoundingClientRect(),{height:y}=O;if(d&&!p&&(c+=O.top-d.top),x instanceof cr)S>r&&u(x,f,O);else if(f>=r&&(c>0&&n.push(-c),n.push(y+c),c=0,o)){let v=x.dom.lastChild,w=v?Ga(v):[];if(w.length){let k=w[w.length-1],$=a?k.right-O.left:O.right-k.left;$>l&&(l=$,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=S)}}d&&p==h.children.length-1&&(c+=d.bottom-O.bottom),f=S+x.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?We.RTL:We.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Ga(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=Ga(n.firstChild)[0];r=n.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.view.state.doc.length;if(o>r){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(se.replace({widget:new Wh(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return se.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Nu).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(Km).map((s,o)=>{let l=typeof s=="function";return l&&(r=!0),l?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(he.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(p2).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(h2))try{if(u(this.view,e.range,e))return!0}catch(h){In(this.view.state,h,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=g2(this.view),l={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:a,offsetHeight:c}=this.view.scrollDOM;if($C(this.view.scrollDOM,l,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==We.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let u=this.view.docView.lineAt(r.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Kd(this.tile)}}function Kd(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)Kd(r,e)}}function e4(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function x2(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=Hw(n.focusNode,n.focusOffset),i=Kw(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let l=_e.get(i.node);if(!l||l.isText()&&l.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let a=_e.get(r.node);!a||a.isText()&&a.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function t4(t,e,n){let r=x2(t,n);if(!r)return null;let{node:i,from:s,to:o}=r,l=i.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let a=e.invertedDesc;return{range:new sn(a.mapPos(s),a.mapPos(o),s,o),text:i}}function n4(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let r4=class{constructor(){this.changes=[]}compareRange(e,n){ms(e,n,this.changes)}comparePoint(e,n){ms(e,n,this.changes)}boundChange(e){ms(e,e,this.changes)}};function i4(t,e,n){let r=new r4;return he.compare(t,e,n,r),r.changes}class s4{constructor(){this.changes=[]}compareRange(e,n){ms(e,n,this.changes)}comparePoint(){}boundChange(e){ms(e,e,this.changes)}}function o4(t,e,n){let r=new s4;return he.compare(t,e,n,r),r.changes}function l4(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function a4(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class Wh extends Zi{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 c4(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return R.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,l=s;n<0?o=et(i.text,s,!1):l=et(i.text,s);let a=r(i.text.slice(o,l));for(;o>0;){let c=et(i.text,o,!1);if(r(i.text.slice(c,o))!=a)break;o=c}for(;l<i.length;){let c=et(i.text,l);if(r(i.text.slice(l,c))!=a)break;l=c}return R.range(o+i.from,l+i.from)}function u4(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((i-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+gC(o,s,t.state.tabSize)}function h4(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==Xt.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function f4(t,e,n,r){let i=h4(t,e.head,e.assoc||-1),s=!r||i.type!=Xt.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(i.from),a=t.posAtCoords({x:n==(l==We.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return R.cursor(a,n?-1:1)}return R.cursor(n?i.to:i.from,n?-1:1)}function q0(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let l=e,a=null;;){let c=LC(i,s,o,l,n),u=r2;if(!c){if(i.number==(n?t.state.doc.lines:1))return l;u=`
|
|
61
|
+
`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(a){if(!a(u))return l}else{if(!r)return c;a=r(u)}l=c}}function d4(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==Ee.Space&&(i=o),i==o}}function p4(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return R.cursor(i,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(i-p.from))),l=(s<0?p.top:p.bottom)+u}let h=a.left+o,f=t.viewState.heightOracle.textHeight>>1,d=r??f;for(let p=0;;p+=f){let x=l+(d+p)*s,S=Jd(t,{x:h,y:x},!1,s);if(n?x>a.bottom:x<a.top)return R.cursor(S.pos,S.assoc);let O=t.coordsAtPos(S.pos,S.assoc),y=O?(O.top+O.bottom)/2:0;if(!O||(n?y>l:y<l))return R.cursor(S.pos,S.assoc,void 0,o)}}function _o(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=r||n||(e-s<o-e?-1:1);e=a<0?s:o,r=a}});if(!r)return e}}function v2(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=_o(t,i.from,0);o!=i.from&&(s=R.cursor(o,-1))}else{let o=_o(t,i.from,-1),l=_o(t,i.to,1);(o!=i.from||l!=i.to)&&(s=R.range(i.from==i.anchor?o:l,i.from==i.head?o:l))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?R.create(n,e.mainIndex):e}function Ih(t,e,n){let r=_o(t.state.facet(Vl).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:R.cursor(r,r<n.from?1:-1)}class zn{constructor(e,n){this.pos=e,this.assoc=n}}function Jd(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new zn(0,1);if(a>t.viewState.docHeight)return new zn(t.state.doc.length,-1);if(c=t.elementAtHeight(a),r==null)break;if(c.type==Xt.Text){if(r<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let f=t.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(f&&(r<0?f.top<=a+s:f.bottom>=a+s))break}let h=t.viewState.heightOracle.textHeight/2;a=r>0?c.bottom+h:c.top-h}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==Xt.Text){let h=u4(t,i,c,o,l);return new zn(h,h==c.from?1:-1)}}if(c.type!=Xt.Text)return a<(c.top+c.bottom)/2?new zn(c.from,1):new zn(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new m4(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}class m4{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,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,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Wn.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Wn.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,o=this.bidiIn(e[0],e[i]),l,a,c=-1,u=1e9,h;e:for(;r<i;){let d=i-r,p=r+i>>1;t:if(s.has(p)){let S=r+Math.floor(Math.random()*d);for(let O=0;O<d;O++){if(!s.has(S)){p=S;break t}S++,S==i&&(S=r)}break e}s.add(p);let x=n(p);if(x)for(let S=0;S<x.length;S++){let O=x[S],y=0;if(!(O.width==0&&x.length>1)){if(O.bottom<this.y)(!l||l.bottom<O.bottom)&&(l=O),y=1;else if(O.top>this.y)(!a||a.top>O.top)&&(a=O),y=-1;else{let v=O.left>this.x?this.x-O.left:O.right<this.x?this.x-O.right:0,w=Math.abs(v);w<u&&(c=p,u=w,h=O),v&&(y=v<0==(this.baseDir==We.LTR)?-1:1)}y==-1&&(!o||this.baseDirAt(e[p],1))?i=p:y==1&&(!o||this.baseDirAt(e[p+1],-1))&&(r=p+1)}}}if(!h){let d=l&&(!a||this.y-l.bottom<a.top-this.y)?l:a;return this.y=(d.top+d.bottom)/2,this.scan(e,n)}let f=(o?this.dirAt(e[c],1):this.baseDir)==We.LTR;return{i:c,after:this.x>(h.left+h.right)/2==f}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=et(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let o=r[s]-n,l=r[s+1]-n;return ml(e.dom,o,l).getClientRects()});return i.after?new zn(r[i.i+1],-1):new zn(r[i.i],1)}scanTile(e,n){if(!e.length)return new zn(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let r=[n];for(let l=0,a=n;l<e.children.length;l++)r.push(a+=e.children[l].length);let i=this.scan(r,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:ml(a.dom,0,a.length)).getClientRects()}),s=e.children[i.i],o=r[i.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):i.after?new zn(r[i.i+1],-1):new zn(o,1)}}const Di="";class O4{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(ge.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Di}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=_e.get(i),l=i.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&r!=this.view.contentDOM&&this.lineBreak();break}let a=_e.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:Nc(i))||Nc(l)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!y4(l,n)&&this.lineBreak(),i=l}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(l=i.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);r=s+o}}readNode(e){let n=_e.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.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,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(g4(e,r.node,r.offset)?n:0))}}function g4(t,e,n){for(;;){if(!e||n<mr(e))return!1;if(e==t)return!0;n=Fr(e)+1,e=e.parentNode}}function y4(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=_e.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class U0{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class x4{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=S2(e.docView.tile,n,r,0))){let a=s||o?[]:S4(e),c=new O4(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=w4(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Fd(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Fd(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),h=e.viewport;if((F.ios||F.chrome)&&l.main.empty&&c!=u&&(h.from>0||h.to<e.state.doc.length)){let f=Math.min(c,u),d=Math.max(c,u),p=h.from-f,x=h.to-d;(p==0||p==1||f==0)&&(x==0||x==-1||d==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(R.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(c,-1),d=0;f&&(d=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=R.create([R.cursor(c,d)])}else this.newSel=R.single(u,c)}}}function S2(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,o=-1,l=-1;for(let a=0,c=r,u=r;a<t.children.length;a++){let h=t.children[a],f=c+h.length;if(c<e&&f>n)return S2(h,e,n,c);if(f>=e&&i==-1&&(i=a,s=c),c>n&&h.dom.parentNode==t.dom){o=a,l=u;break}u=f,c=f+h.breakAfter}return{from:s,to:l<0?r+t.length:l,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function w2(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||F.android&&e.text.length<a-l)&&(c=s.to,u="end");let h=i.doc.sliceString(l,a,Di),f,d;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||h!=e.text)&&h.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&h.slice(s.to-l)==e.text.slice(f=e.text.length-(h.length-(s.to-l)))?n={from:s.from,to:s.to,insert:me.of(e.text.slice(s.from-l,f).split(Di))}:(d=k2(h,e.text,c-l,u))&&(F.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Di+Di&&d.toB--,n={from:l+d.from,to:l+d.toA,insert:me.of(e.text.slice(d.from,d.toB).split(Di))})}else r&&(!t.hasFocus&&i.facet(sr)||Yc(r,s))&&(r=null);if(!n&&!r)return!1;if((F.mac||F.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=R.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:me.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:F.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
62
|
+
`&&t.lineWrapping&&(r&&(r=R.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:me.of([" "])}),n)return Jm(t,n,r,o);if(r&&!Yc(r,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=v2(i.facet(Vl).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:l,userEvent:a}),!0}else return!1}function Jm(t,e,n,r=-1){if(F.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(F.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Os(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Os(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Os(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=v4(t,e,n));return t.state.facet(a2).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function v4(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=_o(i.facet(Vl).map(h=>h(t)),c,a);e.from==u&&(o=u)}if(o>-1)r={changes:e,selection:R.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?i.sliceDoc(s.from,e.from):"",c=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=i.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),h,f=n&&x2(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-p}}else h=t.state.doc.lineAt(s.head);let d=s.to-e.to;r=i.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:c||p.map(a)};let x=p.to-d,S=x-u.length;if(t.state.sliceDoc(S,x)!=u||x>=h.from&&S<=h.to)return{range:p};let O=i.changes({from:S,to:x,insert:e.insert}),y=p.to-s.to;return{changes:O,range:c?R.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):p.map(O)}})}else r={changes:a,selection:c&&i.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:l,scrollIntoView:!0})}function k2(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(r=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function S4(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new U0(n,r)),(i!=n||s!=r)&&e.push(new U0(i,s))),e}function w4(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?R.single(n+e,r+e):null}function Yc(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class k4{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=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,F.safari&&e.contentDOM.addEventListener("input",()=>null),F.gecko&&L4(e.contentDOM.ownerDocument)}handleEvent(e){!M4(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,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=b4(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=r[s];l&&o!=!l.handlers.length&&(i.removeEventListener(s,this.handleEvent),l=null),l||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}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&&P2.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),F.android&&F.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return F.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=b2.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||P4.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Os(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:F.safari&&!F.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 G0(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){In(n.state,i)}}}function b4(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(G0(r.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(G0(r.value,a))}}for(let r in Tn)n(r).handlers.push(Tn[r]);for(let r in Dt)n(r).observers.push(Dt[r]);return e}const b2=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],P4="dthko",P2=[16,17,18,20,91,92,224,225],da=6;function pa(t){return Math.max(0,t)*.7+8}function Q4(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class $4{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=qw(e.contentDOM),this.atoms=e.state.facet(Vl).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(ge.allowMultipleSelections)&&T4(e,n),this.dragging=A4(e,n)&&T2(n)==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&&Q4(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=g2(this.view);e.clientX-a.left<=i+da?n=-pa(i-e.clientX):e.clientX+a.right>=o-da&&(n=pa(e.clientX-o)),e.clientY-a.top<=s+da?r=-pa(s-e.clientY):e.clientY+a.bottom>=l-da&&(r=pa(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=v2(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function T4(t,e){let n=t.state.facet(i2);return n.length?n[0](e):F.mac?e.metaKey:e.ctrlKey}function C4(t,e){let n=t.state.facet(s2);return n.length?n[0](e):F.mac?!e.altKey:!e.ctrlKey}function A4(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=pl(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function M4(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=_e.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Tn=Object.create(null),Dt=Object.create(null),Q2=F.ie&&F.ie_version<15||F.ios&&F.webkit_version<604;function E4(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),$2(t,n.value)},50)}function Iu(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function $2(t,e){e=Iu(t.state,Um,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(ep!=null&&n.selection.ranges.every(a=>a.empty)&&ep==s.toString()){let a=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let h=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:h},range:R.cursor(c.from+h.length)}})}else o?r=n.changeByRange(a=>{let c=s.line(i++);return{changes:{from:a.from,to:a.to,insert:c.text},range:R.cursor(a.from+c.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Dt.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Dt.wheel=Dt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Tn.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Dt.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Dt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Tn.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(o2))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=j4(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new $4(t,e,n,r)),r&&t.observer.ignore(()=>{Uw(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function H0(t,e,n,r){if(r==1)return R.cursor(e,n);if(r==2)return c4(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,l=i?i.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,R.range(o,l)}}const R4=F.ie&&F.ie_version<=11;let K0=null,J0=0,e1=0;function T2(t){if(!R4)return t.detail;let e=K0,n=e1;return K0=t,e1=Date.now(),J0=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(J0+1)%3:1}function j4(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=T2(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=H0(t,a.pos,a.assoc,r);if(n.pos!=a.pos&&!o){let h=H0(t,n.pos,n.assoc,r),f=Math.min(h.from,u.from),d=Math.max(h.to,u.to);u=f<u.from?R.range(f,d,u.assoc):R.range(d,f,u.assoc)}return o?i.replaceRange(i.main.extend(u.from,u.to,u.assoc)):l&&r==1&&i.ranges.length>1&&(c=Z4(i,a.pos))?c:l?i.addRange(u):R.create([u])}}}function Z4(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return R.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Tn.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=R.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Iu(t.state,Gm,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Tn.dragend=t=>(t.inputState.draggedContent=null,!1);function t1(t,e,n,r){if(n=Iu(t.state,Um,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&C4(t,e)?{from:s.from,to:s.to}:null,l={from:i,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Tn.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&t1(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return t1(t,e,r,!0),!0}return!1};Tn.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Q2?null:e.clipboardData;return n?($2(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(E4(t),!1)};function V4(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function X4(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:Iu(t,Gm,e.join(t.lineBreak)),ranges:n,linewise:r}}let ep=null;Tn.copy=Tn.cut=(t,e)=>{if(!Lo(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=X4(t.state);if(!n&&!i)return!1;ep=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=Q2?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(V4(t,n),!1)};const C2=yr.define();function A2(t,e){let n=[];for(let r of t.facet(c2)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:C2.of(!0)}):null}function M2(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=A2(t.state,e);n?t.dispatch(n):t.update([])}},10)}Dt.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),M2(t)};Dt.blur=t=>{t.observer.clearSelectionRange(),M2(t)};Dt.compositionstart=Dt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Dt.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,F.chrome&&F.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Dt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Tn.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return Jm(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let i;if(F.chrome&&F.android&&(i=b2.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return F.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),F.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Dt.compositionend(t,e),20),!1};const n1=new Set;function L4(t){n1.has(t)||(n1.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const r1=["pre-wrap","normal","pre-line","break-spaces"];let Ms=!1;function i1(){Ms=!1}class D4{constructor(e){this.lineWrapping=e,this.doc=me.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return r1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,o){let l=r1.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}}class _4{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Sn{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Xt.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 Ci?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Sn(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Qe=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(Qe||(Qe={}));const Ha=.001;class Pt{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ha&&(Ms=!0),this.height=e)}replace(e,n,r){return Pt.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:h}=i[l],f=s.lineAt(a,Qe.ByPosNoHeight,r.setDoc(n),0,0),d=f.to>=c?f:s.lineAt(c,Qe.ByPosNoHeight,r,0,0);for(h+=d.to-c,c=d.to;l>0&&f.from<=i[l-1].toA;)a=i[l-1].fromA,u=i[l-1].fromB,l--,a<f.from&&(f=s.lineAt(a,Qe.ByPosNoHeight,r,0,0));u+=f.from-a,a=f.from;let p=eO.build(r.setDoc(o),e,u,h);s=Fc(s,s.replace(a,c,p))}return s.updateHeight(r,0)}static empty(){return new Bt(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(s>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,s-=l.size}else break;else if(i<s){let l=e[n++];l&&(i+=l.size)}else{let l=e[--r];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,r++),new z4(Pt.of(e.slice(0,n)),o,Pt.of(e.slice(r)))}}function Fc(t,e){return t==e?t:(t.constructor!=e.constructor&&(Ms=!0),e)}Pt.prototype.size=1;const N4=se.replace({});class E2 extends Pt{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Sn(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Sn(i,0,r,this.spaceAbove,N4):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let o=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(o):o}forEachLine(e,n,r,i,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Qe.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Bt extends E2{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Sn(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Bt||i instanceof st&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof st?i=new Bt(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Pt.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class st extends Pt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:l}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=n.doc.lineAt(c),h=l+u.length*a,f=Math.max(r,e-h/2);return new Sn(u.from,u.length,f,h,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-r)/l))),{from:u,length:h}=n.doc.line(s+c);return new Sn(u,h,r+l*c,l,0)}}lineAt(e,n,r,i,s){if(n==Qe.ByHeight)return this.blockAt(e,r,i,s);if(n==Qe.ByPosNoHeight){let{from:d,to:p}=r.doc.lineAt(e);return new Sn(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(r,s),c=r.doc.lineAt(e),u=l+c.length*a,h=c.number-o,f=i+l*h+a*(c.from-s-h);return new Sn(c.from,c.length,Math.max(i,Math.min(f,i+this.height-u)),u,0)}forEachLine(e,n,r,i,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(r,s);for(let u=e,h=i;u<=n;){let f=r.doc.lineAt(u);if(u==e){let p=f.number-l;h+=a*p+c*(e-s-p)}let d=a+c*f.length;o(new Sn(f.from,f.length,h,d,0)),h+=d,u=f.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof st?r[r.length-1]=new st(s.length+i):r.push(null,new st(i-1))}if(e>0){let s=r[0];s instanceof st?r[0]=new st(e+s.length):r.unshift(new st(e-1),null)}return Pt.of(r)}decomposeLeft(e,n){n.push(new st(e-1),null)}decomposeRight(e,n){n.push(null,new st(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],l=Math.max(n,i.from),a=-1;for(i.from>n&&o.push(new st(i.from-n-1).updateHeight(e,n));l<=s&&i.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let h=i.heights[i.index++],f=0;h<0&&(f=-h,h=i.heights[i.index++]),a==-1?a=h:Math.abs(h-a)>=Ha&&(a=-2);let d=new Bt(u,h,f);d.outdated=!1,o.push(d),l+=u+1}l<=s&&o.push(null,new st(s-l).updateHeight(e,l));let c=Pt.of(o);return(a<0||Math.abs(c.height-this.height)>=Ha||Math.abs(a-this.heightMetrics(e,n).perLine)>=Ha)&&(Ms=!0),Fc(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class z4 extends Pt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let o=i+this.left.height,l=s+this.left.length+this.break,a=n==Qe.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==Qe.ByPosNoHeight?Qe.ByPosNoHeight:Qe.ByPos;return a?c.join(this.right.lineAt(l,u,r,o,l)):this.left.lineAt(l,u,r,i,s).join(c)}forEachLine(e,n,r,i,s,o){let l=i+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,r,i,s,o),n>=a&&this.right.forEachLine(e,n,r,l,a,o);else{let c=this.lineAt(a,Qe.ByPos,r,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,l,a,o)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of r)s.push(l);if(e>0&&s1(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),s1(s,l)}return Pt.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Pt.of(this.break?[e,null,n]:[e,n]):(this.left=Fc(this.left,e),this.right=Fc(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return i&&i.from<=n+s.length&&i.more?a=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=l+o.length&&i.more?a=o=o.updateHeight(e,l,r,i):o.updateHeight(e,l,r),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function s1(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof st&&(r=t[e+1])instanceof st&&t.splice(e-1,3,new st(n.length+1+r.length))}const W4=5;class eO{constructor(e,n){this.pos=e,this.oracle=n,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,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Bt?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Bt(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=n-e;r.block?this.addBlock(new E2(o,i,r)):(o||s||i>=W4)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,n);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:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,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 Bt(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new st(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Bt)return e;let n=new Bt(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Bt)&&!this.isCovered?this.nodes.push(new Bt(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Bt&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new eO(r,e);return he.spans(n,r,i,s,0),s.finish(r)}}function I4(t,e,n){let r=new B4;return he.compare(t,e,n,r,0),r.changes}class B4{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&ms(e,n,this.changes,5)}}function Y4(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,h=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&h.overflow!="visible"){let f=u.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(c==t.parentNode?i.innerHeight:a,f.bottom)}c=h.position=="absolute"||h.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function F4(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function q4(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Bh{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return se.replace({widget:new U4(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class U4 extends Zi{constructor(e,n){super(),this.size=e,this.vertical=n}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 o1{constructor(e,n){this.view=e,this.state=n,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.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=l1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=We.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(Hm).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new D4(r),this.stateDeco=a1(n),this.heightMap=Pt.empty().applyChanges(this.stateDeco,me.empty,this.heightOracle.setDoc(n.doc),[new sn(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=se.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new ma(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?l1:new tO(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(bo(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=a1(this.state);let i=e.changedRanges,s=sn.extendWithRanges(i,I4(r,this.stateDeco,e?e.changes:Ge.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);i1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Ms)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(_C)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?We.RTL:We.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:k,scaleY:$}=Fw(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||$>.005&&Math.abs(this.scaleY-$)>.005)&&(this.scaleX=k,this.scaleY=$,c|=16,o=a=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=qw(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Gw(this.scrollParent||e.win);let x=(this.printing?q4:Y4)(n,this.paddingTop),S=x.top-this.pixelViewport.top,O=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!F4(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(o=!0),o||i.lineWrapping&&Math.abs(v-this.contentDOMWidth)>i.charWidth){let{lineHeight:$,charWidth:P,textHeight:Q}=e.docView.measureTextSize();o=$>0&&i.refresh(s,$,P,Q,Math.max(5,v/P),k),o&&(e.docView.minWidth=0,c|=16)}S>0&&O>0?u=Math.max(S,O):S<0&&O<0&&(u=Math.min(S,O)),i1();for(let $ of this.viewports){let P=$.from==this.viewport.from?k:e.docView.measureVisibleLineHeights($);this.heightMap=(o?Pt.empty().applyChanges(this.stateDeco,me.empty,this.heightOracle,[new sn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new _4($.from,P))}Ms&&(c|=2)}let w=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return w&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ma(i.lineAt(o-r*1e3,Qe.ByHeight,s,0,0).from,i.lineAt(l+(1-r)*1e3,Qe.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,Qe.ByPos,s,0,0),f;n.y=="center"?f=(h.top+h.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?f=h.top:f=h.bottom-u,a=new ma(i.lineAt(f-1e3/2,Qe.ByHeight,s,0,0).from,i.lineAt(f+u+1e3/2,Qe.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new ma(this.heightMap.lineAt(r,Qe.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Qe.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Qe.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Qe.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new Bh(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=We.LTR&&!r)return[];let l=[],a=(u,h,f,d)=>{if(h-u<s)return;let p=this.state.selection.main,x=[p.from];p.empty||x.push(p.to);for(let O of x)if(O>u&&O<h){a(u,O-10,f,d),a(O+10,h,f,d);return}let S=H4(e,O=>O.from>=f.from&&O.to<=f.to&&Math.abs(O.from-u)<s&&Math.abs(O.to-h)<s&&!x.some(y=>O.from<y&&O.to>y));if(!S){if(h<f.to&&n&&r&&n.visibleRanges.some(v=>v.from<=h&&v.to>=h)){let v=n.moveToLineBoundary(R.cursor(h),!1,!0).head;v>u&&(h=v)}let O=this.gapSize(f,u,h,d),y=r||O<2e6?O:2e6;S=new Bh(u,h,O,y)}l.push(S)},c=u=>{if(u.length<o||u.type!=Xt.Text)return;let h=G4(u.from,u.to,this.stateDeco);if(h.total<o)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,S,O;if(f!=null){let y=ga(h,f),v=((this.visibleBottom-this.visibleTop)/2+x)/u.height;S=y-v,O=y+v}else S=(this.visibleTop-u.top-x)/u.height,O=(this.visibleBottom-u.top+x)/u.height;d=Oa(h,S),p=Oa(h,O)}else{let x=h.total*this.heightOracle.charWidth,S=i*this.heightOracle.charWidth,O=0;if(x>2e6)for(let $ of e)$.from>=u.from&&$.from<u.to&&$.size!=$.displaySize&&$.from*this.heightOracle.charWidth+O<this.pixelViewport.left&&(O=$.size-$.displaySize);let y=this.pixelViewport.left+O,v=this.pixelViewport.right+O,w,k;if(f!=null){let $=ga(h,f),P=((v-y)/2+S)/x;w=$-P,k=$+P}else w=(y-S)/x,k=(v+S)/x;d=Oa(h,w),p=Oa(h,k)}d>u.from&&a(u.from,d,u,h),p<u.to&&a(p,u.to,u,h)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,r,i){let s=ga(i,r)-ga(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Bh.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=se.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];he.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],l=r[s];(o.from!=l.from||o.to!=l.to)&&(i|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||bo(this.heightMap.lineAt(e,Qe.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(n=>n.top<=e&&n.bottom>=e)||bo(this.heightMap.lineAt(this.scaler.fromDOM(e),Qe.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return bo(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 ma{constructor(e,n){this.from=e,this.to=n}}function G4(t,e,n){let r=[],i=t,s=0;return he.spans(n,t,e,{span(){},point(o,l){o>i&&(r.push({from:i,to:o}),s+=o-i),i=l}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Oa({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],l=o-s;if(r<=l)return s+r;r-=l}}function ga(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function H4(t,e){for(let n of t)if(e(n))return n}const l1={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function a1(t){let e=t.facet(Nu).filter(r=>typeof r!="function"),n=t.facet(Km).filter(r=>typeof r!="function");return n.length&&e.push(he.join(n)),e}class tO{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:l,to:a})=>{let c=n.lineAt(l,Qe.ByPos,e,0,0).top,u=n.lineAt(a,Qe.ByPos,e,0,0).bottom;return i+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof tO?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function bo(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Sn(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>bo(i,e)):t._content)}const ya=K.define({combine:t=>t.join(" ")}),tp=K.define({combine:t=>t.indexOf(!0)>-1}),np=Br.newName(),R2=Br.newName(),j2=Br.newName(),Z2={"&light":"."+R2,"&dark":"."+j2};function rp(t,e,n){return new Br(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const K4=rp("."+np,{"&":{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-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".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"}},Z2),J4={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Yh=F.ie&&F.ie_version<=11;class e6{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new TC,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(n=>{for(let r of n)this.queue.push(r);(F.ie&&F.ie_version<=11||F.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&F.android&&e.constructor.EDIT_CONTEXT!==!1&&!(F.chrome&&F.chrome_version<126)&&(this.editContext=new n6(e),e.state.facet(sr)&&(e.contentDOM.editContext=this.editContext.editContext)),Yh&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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 n;((n=this.view.docView)===null||n===void 0?void 0:n.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(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.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(n=>{n.length>0&&n[n.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((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(sr)?r.root.activeElement!=this.dom:!Lo(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(F.ie&&F.ie_version<=11||F.android&&F.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Do(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=pl(e.root);if(!n)return!1;let r=F.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&t6(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Lo(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&AC(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,J4),Yh&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Yh&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Os(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Lo(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new x4(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=w2(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!Yc(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=c1(n,e.previousSibling||e.target.previousSibling,-1),i=c1(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.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(sr)!=e.state.facet(sr)&&(e.view.contentDOM.editContext=e.state.facet(sr)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.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 c1(t,e,n){for(;e;){let r=_e.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function u1(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Do(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function t6(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return u1(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?u1(t,n):null}class n6{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,l=this.toEditorPos(r.updateRangeStart),a=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>r.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=k2(e.state.sliceDoc(l,a),r.text,(c?i.from:i.to)-l,c?"end":null);if(!u){let f=R.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Yc(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:u.from+l,to:u.toA+l,insert:me.of(r.text.slice(u.from,u.toB).split(`
|
|
63
|
+
`))};if((F.mac||F.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:l,to:a,insert:me.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Jm(e,h,R.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;i.push(se.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:f2.of(se.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=pl(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.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||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+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 n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class H{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 n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||CC(e.parent)||document,this.viewState=new o1(this,e.state||ge.create(e)),e.scrollTo&&e.scrollTo.is(fa)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ns).map(i=>new _h(i));for(let i of this.plugins)i.update(this);this.observer=new e6(this),this.inputState=new k4(this),this.inputState.ensureHandlers(this.plugins),this.docView=new F0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Fe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(C2))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=A2(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(ge.phrases)!=this.state.facet(ge.phrases))return this.setState(s);i=Wc.create(this,s,e),i.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new gs(d.empty?d:R.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(fa)&&(h=d.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=qc.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(ko)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(ya)!=i.state.facet(ya)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(Hd))try{f(i)}catch(d){In(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!w2(this,u)&&c.force&&Os(this.contentDOM,c.key,c.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 n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new o1(this,e),this.plugins=e.facet(ns).map(r=>new _h(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new F0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(ns),r=e.state.facet(ns);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new _h(s));else{let l=this.plugins[o];l.mustUpdate=e,i.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){In(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Gw(r||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(p){return In(this.state,p),h1}}),h=Wc.create(this,this.state,[]),f=!1;h.flags|=a,n?n.flags|=a:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=h1)try{let p=c[d];p.write&&p.write(u[d],this)}catch(p){In(this.state,p)}if(f&&this.docView.updateSelection(!0),!h.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 p=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((p>1||p<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Hd))l(n)}get themeClasses(){return np+" "+(this.state.facet(tp)?j2:R2)+" "+this.state.facet(ya)}updateAttrs(){let e=f1(this,d2,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(sr)?"true":"false",class:"cm-content",style:`${F.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),f1(this,Hm,n);let r=this.observer.ignore(()=>{let i=N0(this.contentDOM,this.contentAttrs,n),s=N0(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(H.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(ko);let e=this.state.facet(H.cspNonce);Br.mount(this.root,this.styleModules.concat(K4).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 n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.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,n,r){return Ih(this,e,q0(this,e,n,r))}moveByGroup(e,n){return Ih(this,e,q0(this,e,n,r=>d4(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return R.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return f4(this,e,n,r)}moveVertically(e,n,r){return Ih(this,e,p4(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=Jd(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Jd(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Wn.find(s,e-i.from,-1,n)];return zc(r,o.dir==We.LTR==n>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(u2)||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>r6)return n2(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||t2(s.isolates,r=I0(this,e))))return s.order;r||(r=I0(this,e));let i=XC(e.text,n,r);return this.bidiCache.push(new qc(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||F.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Uw(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,n={}){return fa.of(new gs(typeof e=="number"?R.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return fa.of(new gs(R.cursor(r.from),"start","start",r.top-e,n,!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 Lt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Lt.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Br.newName(),i=[ya.of(r),ko.of(rp(`.${r}`,e))];return n&&n.dark&&i.push(tp.of(!0)),i}static baseTheme(e){return Rl.lowest(ko.of(rp("."+np,e,Z2)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&_e.get(r)||_e.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}H.styleModule=ko;H.inputHandler=a2;H.clipboardInputFilter=Um;H.clipboardOutputFilter=Gm;H.scrollHandler=h2;H.focusChangeEffect=c2;H.perLineTextDirection=u2;H.exceptionSink=l2;H.updateListener=Hd;H.editable=sr;H.mouseSelectionStyle=o2;H.dragMovesSelection=s2;H.clickAddsSelectionRange=i2;H.decorations=Nu;H.blockWrappers=p2;H.outerDecorations=Km;H.atomicRanges=Vl;H.bidiIsolatedRanges=m2;H.scrollMargins=O2;H.darkTheme=tp;H.cspNonce=K.define({combine:t=>t.length?t[0]:""});H.contentAttributes=Hm;H.editorAttributes=d2;H.lineWrapping=H.contentAttributes.of({class:"cm-lineWrapping"});H.announce=xe.define();const r6=4096,h1={};class qc{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:We.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new qc(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function f1(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&Ym(o,n)}return n}const i6=F.mac?"mac":F.windows?"win":F.linux?"linux":"key";function s6(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,l;for(let a=0;a<n.length-1;++a){const c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),l&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function xa(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const o6=Rl.default(H.domEventHandlers({keydown(t,e){return X2(V2(e.state),t,e,"editor")}})),nO=K.define({enables:o6}),d1=new WeakMap;function V2(t){let e=t.facet(nO),n=d1.get(e);return n||d1.set(e,n=c6(e.reduce((r,i)=>r.concat(i),[]))),n}function l6(t,e,n){return X2(V2(t.state),e,t,n)}let Tr=null;const a6=4e3;function c6(t,e=i6){let n=Object.create(null),r=Object.create(null),i=(o,l)=>{let a=r[o];if(a==null)r[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var h,f;let d=n[o]||(n[o]=Object.create(null)),p=l.split(/ (?!$)/).map(O=>s6(O,e));for(let O=1;O<p.length;O++){let y=p.slice(0,O).join(" ");i(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[v=>{let w=Tr={view:v,prefix:y,scope:o};return setTimeout(()=>{Tr==w&&(Tr=null)},a6),!0}]})}let x=p.join(" ");i(x,!1);let S=d[x]||(d[x]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&S.run.push(a),c&&(S.preventDefault=!0),u&&(S.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in u)u[f].run.push(d=>h(d,ip))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}let ip=null;function X2(t,e,n,r){ip=e;let i=SC(e),s=ji(i,0),o=El(s)==i.length&&i!=" ",l="",a=!1,c=!1,u=!1;Tr&&Tr.view==n&&Tr.scope==r&&(l=Tr.prefix+" ",P2.indexOf(e.keyCode)<0&&(c=!0,Tr=null));let h=new Set,f=S=>{if(S){for(let O of S.run)if(!h.has(O)&&(h.add(O),O(n)))return S.stopPropagation&&(u=!0),!0;S.preventDefault&&(S.stopPropagation&&(u=!0),c=!0)}return!1},d=t[r],p,x;return d&&(f(d[l+xa(i,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(F.windows&&e.ctrlKey&&e.altKey)&&!(F.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Yr[e.keyCode])&&p!=i?(f(d[l+xa(p,e,!0)])||e.shiftKey&&(x=fl[e.keyCode])!=i&&x!=p&&f(d[l+xa(x,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(d[l+xa(i,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),ip=null,a}function u6(){return f6}const h6=se.line({class:"cm-activeLine"}),f6=Lt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(h6.range(i.from)),e=i.from)}return se.set(n)}},{decorations:t=>t.decorations}),p1=K.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function L2(t,e){let n=t.plugin(D2),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const D2=Lt.fromClass(class{constructor(t){this.input=t.state.facet(Uc),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(p1);this.top=new va(t,!0,e.topContainer),this.bottom=new va(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(p1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new va(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new va(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Uc);if(n!=this.input){let r=n.filter(a=>a),i=[],s=[],o=[],l=[];for(let a of r){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?s:o).push(u)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>H.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class va{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.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 n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=m1(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=m1(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 m1(t){let e=t.nextSibling;return t.remove(),e}const Uc=K.define({enables:D2});function d6(t,e){let n,r=new Promise(o=>n=o),i=o=>p6(o,e,n);t.state.field(Fh,!1)?t.dispatch({effects:_2.of(i)}):t.dispatch({effects:xe.appendConfig.of(Fh.init(()=>[i]))});let s=N2.of(i);return{close:s,result:r.then(o=>((t.win.queueMicrotask||(a=>t.win.setTimeout(a,10)))(()=>{t.state.field(Fh).indexOf(i)>-1&&t.dispatch({effects:s})}),o))}}const Fh=Kt.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(_2)?t=[n.value].concat(t):n.is(N2)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>Uc.computeN([t],e=>e.field(t))}),_2=xe.define(),N2=xe.define();function p6(t,e,n){let r=e.content?e.content(t,()=>o(null)):null;if(!r){if(r=Ke("form"),e.input){let l=Ke("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),r.appendChild(Ke("label",(e.label||"")+": ",l))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Ke("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let l=0;l<i.length;l++){let a=i[l];a.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(a))}),a.addEventListener("submit",c=>{c.preventDefault(),o(a)})}let s=Ke("div",r,Ke("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&t.focus(),n(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=r.querySelector(e.focus):l=r.querySelector("input")||r.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Or extends Ir{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Or.prototype.elementClass="";Or.prototype.toDOM=void 0;Or.prototype.mapMode=mt.TrackBefore;Or.prototype.startSide=Or.prototype.endSide=-1;Or.prototype.point=!0;const Ka=K.define(),m6=K.define(),O6={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>he.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},No=K.define();function g6(t){return[z2(),No.of({...O6,...t})]}const O1=K.define({combine:t=>t.some(e=>e)});function z2(t){return[y6]}const y6=Lt.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.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=t.state.facet(No).map(e=>new y1(t,e)),this.fixed=!t.state.facet(O1);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),t.scrollDOM.insertBefore(this.dom,t.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(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.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(O1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=he.iter(this.view.state.facet(Ka),this.view.viewport.from),r=[],i=this.gutters.map(s=>new x6(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==Xt.Text&&o){sp(n,r,l.from);for(let a of i)a.line(this.view,l,r);o=!1}else if(l.widget)for(let a of i)a.widget(this.view,l)}else if(s.type==Xt.Text){sp(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(No),n=t.state.facet(No),r=t.docChanged||t.heightChanged||t.viewportChanged||!he.eq(t.startState.facet(Ka),t.state.facet(Ka),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new y1(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>H.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==We.LTR?{left:r,right:i}:{right:r,left:i}})});function g1(t){return Array.isArray(t)?t:[t]}function sp(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class x6{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=he.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let l=new W2(e,o,s,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];sp(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(m6)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class y1{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=i.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=g1(n.markers(e)),n.initialSpacer&&(this.spacer=new W2(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=g1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!he.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class W2{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),v6(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(r+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(a)){l=h,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let h=i.nextSibling;i.remove(),i=h}}if(!a)break;a.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(a.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function v6(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const S6=K.define(),w6=K.define(),rs=K.define({combine(t){return Bs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let s=r[i],o=n[i];r[i]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return r}})}});class qh extends Or{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Uh(t,e){return t.state.facet(rs).formatNumber(e,t.state)}const k6=No.compute([rs],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(S6)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new qh(Uh(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(w6)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(rs)!=e.state.facet(rs),initialSpacer(e){return new qh(Uh(e,x1(e.state.doc.lines)))},updateSpacer(e,n){let r=Uh(n.view,x1(n.view.state.doc.lines));return r==e.number?e:new qh(r)},domEventHandlers:t.facet(rs).domEventHandlers,side:"before"}));function b6(t={}){return[rs.of(t),z2(),k6]}function x1(t){let e=9;for(;e<t;)e=e*10+9;return e}const P6=new class extends Or{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Q6=Ka.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(P6.range(i)))}return he.of(e)});function $6(){return Q6}const I2=1024;let T6=0;class on{constructor(e,n){this.from=e,this.to=n}}class ce{constructor(e={}){this.id=T6++,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=Qt.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}ce.closedBy=new ce({deserialize:t=>t.split(" ")});ce.openedBy=new ce({deserialize:t=>t.split(" ")});ce.group=new ce({deserialize:t=>t.split(" ")});ce.isolate=new ce({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});ce.contextHash=new ce({perNode:!0});ce.lookAhead=new ce({perNode:!0});ce.mounted=new ce({perNode:!0});class ys{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[ce.mounted.id]}}const C6=Object.create(null);class Qt{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):C6,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Qt(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}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 n=this.prop(ce.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(ce.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}Qt.none=new Qt("",Object.create(null),0,8);class rO{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let l=o[1],a=o[0];a.combine&&a.id in i&&(l=a.combine(i[a.id],l)),i[a.id]=l}}n.push(i?new Qt(r.name,i,r.id,r.flags):r)}return new rO(n)}}const Sa=new WeakMap,v1=new WeakMap;var ve;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(ve||(ve={}));class Re{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=ys.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Gc(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Sa.get(this)||this.topNode,s=new Gc(i);return s.moveTo(e,n),Sa.set(this,s._tree),s}get topNode(){return new gt(this,0,0,null)}resolve(e,n=0){let r=Ol(Sa.get(this)||this.topNode,e,n,!1);return Sa.set(this,r),r}resolveInner(e,n=0){let r=Ol(v1.get(this)||this.topNode,e,n,!0);return v1.set(this,r),r}resolveStack(e,n=0){return E6(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,l=(o&ve.IncludeAnonymous)>0;for(let a=this.cursor(o|ve.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=i&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&r&&(l||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;c=!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 n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:oO(Qt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Re(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Re(Qt.none,n,r,i)))}static build(e){return R6(e)}}Re.empty=new Re(Qt.none,[],[],0);class iO{constructor(e,n){this.buffer=e,this.index=n}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 iO(this.buffer,this.index)}}class qr{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Qt.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,r,i,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(B2(s,i,o[a+1],o[a+2])&&(l=a,r>0));a=o[a+3]);return l}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=i[l++],s[a++]=i[l++]-r;let c=s[a++]=i[l++]-r;s[a++]=i[l++]-e,o=Math.max(o,c)}return new qr(s,o,this.set)}}function B2(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Ol(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!r&&t instanceof gt&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=r?0:ve.IgnoreOverlays;if(r)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof gt&&o.index<0&&((i=l.enter(e,n,s))===null||i===void 0?void 0:i.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}class Y2{cursor(e=0){return new Gc(this,e)}getChild(e,n=null,r=null){let i=S1(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return S1(this,e,n,r)}resolve(e,n=0){return Ol(this,e,n,!1)}resolveInner(e,n=0){return Ol(this,e,n,!0)}matchContext(e){return op(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class gt extends Y2{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],h=a[e]+o.from,f;if(!(!(s&ve.EnterBracketed&&u instanceof Re&&(f=ys.get(u))&&!f.overlay&&f.bracketed&&r>=h&&r<=h+u.length)&&!B2(i,r,h,h+u.length))){if(u instanceof qr){if(s&ve.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-h,i);if(d>-1)return new Bn(new A6(o,u,e,h),null,d)}else if(s&ve.IncludeAnonymous||!u.type.isAnonymous||sO(u)){let d;if(!(s&ve.IgnoreMounts)&&(d=ys.get(u))&&!d.overlay)return new gt(d.tree,h,e,o);let p=new gt(u,h,e,o);return s&ve.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i,s)}}}if(s&ve.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<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,n,r=0){let i;if(!(r&ve.IgnoreOverlays)&&(i=ys.get(this._tree))&&i.overlay){let s=e-this.from,o=r&ve.EnterBracketed&&i.bracketed;for(let{from:l,to:a}of i.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new gt(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function S1(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function op(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class A6{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Bn extends Y2{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,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new Bn(this.context,this,s)}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,n,r=0){if(r&ve.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new Bn(this.context,this,s)}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,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Bn(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Bn(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new Re(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function F2(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let r=n instanceof gt&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new M6(i,n)}class M6{constructor(e,n){this.heads=e,this.node=n}get next(){return F2(this.heads)}}function E6(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof gt?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,n)),s=o}else{let o=ys.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new gt(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Ol(l,e,n,!1))}}return i?F2(i):r}class Gc{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~ve.EnterBracketed,e instanceof gt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof gt?(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,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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,n,r=this.mode){return this.buffer?r&ve.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ve.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ve.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:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let l=r._tree.children[s];if(this.mode&ve.IncludeAnonymous||l instanceof qr||!l.type.isAnonymous||sO(l))return!1}return!0}move(e,n){if(n&&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,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new Bn(this.buffer,n,this.stack[i]);return this.bufferNode=new Bn(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return op(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return op(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function sO(t){return t.children.some(e=>e instanceof qr||!e.type.isAnonymous||sO(e))}function R6(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=I2,reused:s=[],minRepeatType:o=r.types.length}=t,l=Array.isArray(n)?new iO(n,n.length):n,a=r.types,c=0,u=0;function h(k,$,P,Q,M,T){let{id:V,start:C,end:j,size:N}=l,_=u,I=c;if(N<0)if(l.next(),N==-1){let q=s[V];P.push(q),Q.push(C-k);return}else if(N==-3){c=V;return}else if(N==-4){u=V;return}else throw new RangeError(`Unrecognized record size: ${N}`);let J=a[V],E,D,L=C-k;if(j-C<=i&&(D=S(l.pos-$,M))){let q=new Uint16Array(D.size-D.skip),G=l.pos-D.size,re=q.length;for(;l.pos>G;)re=O(D.start,q,re);E=new qr(q,j-D.start,r),L=D.start-k}else{let q=l.pos-N;l.next();let G=[],re=[],te=V>=o?V:-1,W=0,ie=j;for(;l.pos>q;)te>=0&&l.id==te&&l.size>=0?(l.end<=ie-i&&(p(G,re,C,W,l.end,ie,te,_,I),W=G.length,ie=l.end),l.next()):T>2500?f(C,q,G,re):h(C,q,G,re,te,T+1);if(te>=0&&W>0&&W<G.length&&p(G,re,C,W,C,ie,te,_,I),G.reverse(),re.reverse(),te>-1&&W>0){let ne=d(J,I);E=oO(J,G,re,0,G.length,0,j-C,ne,ne)}else E=x(J,G,re,j-C,_-j,I)}P.push(E),Q.push(L)}function f(k,$,P,Q){let M=[],T=0,V=-1;for(;l.pos>$;){let{id:C,start:j,end:N,size:_}=l;if(_>4)l.next();else{if(V>-1&&j<V)break;V<0&&(V=N-i),M.push(C,j,N),T++,l.next()}}if(T){let C=new Uint16Array(T*4),j=M[M.length-2];for(let N=M.length-3,_=0;N>=0;N-=3)C[_++]=M[N],C[_++]=M[N+1]-j,C[_++]=M[N+2]-j,C[_++]=_;P.push(new qr(C,M[2]-j,r)),Q.push(j-k)}}function d(k,$){return(P,Q,M)=>{let T=0,V=P.length-1,C,j;if(V>=0&&(C=P[V])instanceof Re){if(!V&&C.type==k&&C.length==M)return C;(j=C.prop(ce.lookAhead))&&(T=Q[V]+C.length+j)}return x(k,P,Q,M,T,$)}}function p(k,$,P,Q,M,T,V,C,j){let N=[],_=[];for(;k.length>Q;)N.push(k.pop()),_.push($.pop()+P-M);k.push(x(r.types[V],N,_,T-M,C-T,j)),$.push(M-P)}function x(k,$,P,Q,M,T,V){if(T){let C=[ce.contextHash,T];V=V?[C].concat(V):[C]}if(M>25){let C=[ce.lookAhead,M];V=V?[C].concat(V):[C]}return new Re(k,$,P,Q,V)}function S(k,$){let P=l.fork(),Q=0,M=0,T=0,V=P.end-i,C={size:0,start:0,skip:0};e:for(let j=P.pos-k;P.pos>j;){let N=P.size;if(P.id==$&&N>=0){C.size=Q,C.start=M,C.skip=T,T+=4,Q+=4,P.next();continue}let _=P.pos-N;if(N<0||_<j||P.start<V)break;let I=P.id>=o?4:0,J=P.start;for(P.next();P.pos>_;){if(P.size<0)if(P.size==-3||P.size==-4)I+=4;else break e;else P.id>=o&&(I+=4);P.next()}M=J,Q+=N,T+=I}return($<0||Q==k)&&(C.size=Q,C.start=M,C.skip=T),C.size>4?C:void 0}function O(k,$,P){let{id:Q,start:M,end:T,size:V}=l;if(l.next(),V>=0&&Q<o){let C=P;if(V>4){let j=l.pos-(V-4);for(;l.pos>j;)P=O(k,$,P)}$[--P]=C,$[--P]=T-k,$[--P]=M-k,$[--P]=Q}else V==-3?c=Q:V==-4&&(u=Q);return P}let y=[],v=[];for(;l.pos>0;)h(t.start||0,t.bufferStart||0,y,v,-1,0);let w=(e=t.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new Re(a[t.topID],y.reverse(),v.reverse(),w)}const w1=new WeakMap;function Ja(t,e){if(!t.isAnonymous||e instanceof qr||e.type!=t)return 1;let n=w1.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Re)){n=1;break}n+=Ja(t,r)}w1.set(e,n)}return n}function oO(t,e,n,r,i,s,o,l,a){let c=0;for(let p=r;p<i;p++)c+=Ja(t,e[p]);let u=Math.ceil(c*1.5/8),h=[],f=[];function d(p,x,S,O,y){for(let v=S;v<O;){let w=v,k=x[v],$=Ja(t,p[v]);for(v++;v<O;v++){let P=Ja(t,p[v]);if($+P>=u)break;$+=P}if(v==w+1){if($>u){let P=p[w];d(P.children,P.positions,0,P.children.length,x[w]+y);continue}h.push(p[w])}else{let P=x[v-1]+p[v-1].length-k;h.push(oO(t,p,x,w,v,k,P,null,a))}f.push(k+y-s)}}return d(e,n,r,i,0),(l||a)(h,f,o)}class q2{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Bn?this.setBuffer(e.context.buffer,e.index,n):e instanceof gt&&this.map.set(e.tree,n)}get(e){return e instanceof Bn?this.getBuffer(e.context.buffer,e.index):e instanceof gt?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class ur{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new ur(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,h=u?u.fromA:1e9;if(h-a>=r)for(;o&&o.from<h;){let f=o;if(a>=f.from||h<=f.to||c){let d=Math.max(f.from,a)-c,p=Math.min(f.to,h)-c;f=d>=p?null:new ur(d,p,f.tree,f.offset+c,l>0,!!u)}if(f&&i.push(f),o.to>h)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return i}}class U2{startParse(e,n,r){return typeof e=="string"&&(e=new j6(e)),r=r?r.length?r.map(i=>new on(i.from,i.to)):[new on(0,0)]:[new on(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class j6{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function Z6(t){return(e,n,r,i)=>new X6(e,t,n,r,i)}class k1{constructor(e,n,r,i,s,o){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=s,this.from=o}}function b1(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class V6{constructor(e,n,r,i,s,o,l,a){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const lp=new ce({perNode:!0});class X6{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Re(r.type,r.children,r.positions,r.length,r.propValues.concat([[lp,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[ce.mounted.id]=new ys(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new _6(this.fragments),n=null,r=null,i=new Gc(new gt(this.baseTree,this.ranges[0].from,0,null),ve.IncludeAnonymous|ve.IgnoreMounts);e:for(let s,o;;){let l=!0,a;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)l=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,f=u.to+c.pos;h>=i.from&&f<=i.to&&!n.ranges.some(d=>d.from<f&&d.to>h)&&n.ranges.push({from:h,to:f})}}l=!1}else if(r&&(o=L6(r.ranges,i.from,i.to)))l=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(D6(i),n&&n.depth++,r&&r.depth++);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")n=new V6(s.parser,s.overlay,c,this.inner.length,i.from,!!s.bracketed,i.tree,n);else{let u=$1(this.ranges,s.overlay||(i.from<i.to?[new on(i.from,i.to)]:[]));u.length&&b1(u),(u.length||!s.overlay)&&this.inner.push(new k1(s.parser,u.length?s.parser.startParse(this.input,T1(c,u),u):s.parser.startParse(""),s.overlay?s.overlay.map(h=>new on(h.from-i.from,h.to-i.from)):null,!!s.bracketed,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):l=!1}}else if(n&&(a=n.predicate(i))&&(a===!0&&(a=new on(i.from,i.to)),a.from<a.to)){let c=n.ranges.length-1;c>=0&&n.ranges[c].to==a.from?n.ranges[c]={from:n.ranges[c].from,to:a.to}:n.ranges.push(a)}if(l&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=$1(this.ranges,n.ranges);c.length&&(b1(c),this.inner.splice(n.index,0,new k1(n.parser,n.parser.startParse(this.input,T1(n.mounts,c),c),n.ranges.map(u=>new on(u.from-n.start,u.to-n.start)),n.bracketed,n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function L6(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function P1(t,e,n,r,i,s){if(e<n){let o=t.buffer[e+1];r.push(t.slice(e,n,o)),i.push(o-s)}}function D6(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(r),o=i.children[s],l=o.buffer,a=[s];function c(u,h,f,d,p,x){let S=n[x],O=[],y=[];P1(o,u,S,O,y,d);let v=l[S+1],w=l[S+2];a.push(O.length);let k=x?c(S+4,l[S+3],o.set.types[l[S]],v,w-v,x-1):e.toTree();return O.push(k),y.push(v-d),P1(o,l[S+3],h,O,y,d),new Re(f,O,y,p)}i.children[s]=c(0,l.length,Qt.none,0,o.length,n.length-1);for(let u of a){let h=t.tree.children[u],f=t.tree.positions[u];t.yield(new gt(h,f+t.from,u,t._tree))}}class Q1{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(ve.IncludeAnonymous|ve.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,ve.IgnoreOverlays|ve.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Re)n=n.children[0];else break}return!1}}let _6=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(lp))!==null&&n!==void 0?n:r.to,this.inner=new Q1(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(lp))!==null&&e!==void 0?e:n.to,this.inner=new Q1(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(ce.mounted);if(o&&o.parser==n)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=s.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:s.from-a.offset,mount:o})}}}return i}};function $1(t,e){let n=null,r=e;for(let i=1,s=0;i<t.length;i++){let o=t[i-1].to,l=t[i].from;for(;s<r.length;s++){let a=r[s];if(a.from>=l)break;a.to<=o||(n||(r=n=e.slice()),a.from<o?(n[s]=new on(a.from,o),a.to>l&&n.splice(s+1,0,new on(l,a.to))):a.to>l?n[s--]=new on(l,a.to):n.splice(s--,1))}}return r}function N6(t,e,n,r){let i=0,s=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let u=i==t.length?1e9:o?t[i].to:t[i].from,h=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,n),d=Math.min(u,h,r);f<d&&c.push(new on(f,d))}if(a=Math.min(u,h),a==1e9)break;u==a&&(o?(o=!1,i++):o=!0),h==a&&(l?(l=!1,s++):l=!0)}return c}function T1(t,e){let n=[];for(let{pos:r,mount:i,frag:s}of t){let o=r+(i.overlay?i.overlay[0].from:0),l=o+i.tree.length,a=Math.max(s.from,o),c=Math.min(s.to,l);if(i.overlay){let u=i.overlay.map(f=>new on(f.from+r,f.to+r)),h=N6(e,u,a,c);for(let f=0,d=a;;f++){let p=f==h.length,x=p?c:h[f].from;if(x>d&&n.push(new ur(d,x,i.tree,-o,s.from>=d||s.openStart,s.to<=x||s.openEnd)),p)break;d=h[f].to}}else n.push(new ur(a,c,i.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let z6=0;class nn{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=z6++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof nn&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new nn(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new Hc(e);return r=>r.modified.indexOf(n)>-1?r:Hc.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let W6=0;class Hc{constructor(e){this.name=e,this.instances=[],this.id=W6++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&I6(n,l.modified));if(r)return r;let i=[],s=new nn(e.name,i,e,n);for(let l of n)l.instances.push(s);let o=B6(n);for(let l of e.set)if(!l.modified.length)for(let a of o)i.push(Hc.get(l,a));return s}}function I6(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function B6(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Bu(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,l=i;for(let h=0;;){if(l=="..."&&h>0&&h+3==i.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+i);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==i.length)break;let d=i[h++];if(h==i.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);l=i.slice(h)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+i);let u=new gl(r,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return G2.add(e)}const G2=new ce({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new gl(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class gl{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}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}}gl.empty=new gl([],2,null);function H2(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function Y6(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function F6(t,e,n,r=0,i=t.length){let s=new q6(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class q6{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:l,to:a}=e;if(l>=r||a<=n)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=i,u=U6(e)||gl.empty,h=Y6(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(n,l),c),u.opaque)return;let f=e.tree&&e.tree.prop(ce.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(S=>!S.scope||S.scope(f.tree.type)),x=e.firstChild();for(let S=0,O=l;;S++){let y=S<f.overlay.length?f.overlay[S]:null,v=y?y.from+l:a,w=Math.max(n,O),k=Math.min(r,v);if(w<k&&x)for(;e.from<k&&(this.highlightRange(e,w,k,i,s),this.startSpan(Math.min(k,e.to),c),!(e.to>=v||!e.nextSibling())););if(!y||v>r)break;O=y.to+l,O>n&&(this.highlightRange(d.cursor(),Math.max(n,y.from+l),Math.min(r,O),"",p),this.startSpan(Math.min(r,O),c))}x&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function U6(t){let e=t.type.prop(G2);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const z=nn.define,wa=z(),br=z(),C1=z(br),A1=z(br),Pr=z(),ka=z(Pr),Gh=z(Pr),Zn=z(),ii=z(Zn),Rn=z(),jn=z(),ap=z(),fo=z(ap),ba=z(),b={comment:wa,lineComment:z(wa),blockComment:z(wa),docComment:z(wa),name:br,variableName:z(br),typeName:C1,tagName:z(C1),propertyName:A1,attributeName:z(A1),className:z(br),labelName:z(br),namespace:z(br),macroName:z(br),literal:Pr,string:ka,docString:z(ka),character:z(ka),attributeValue:z(ka),number:Gh,integer:z(Gh),float:z(Gh),bool:z(Pr),regexp:z(Pr),escape:z(Pr),color:z(Pr),url:z(Pr),keyword:Rn,self:z(Rn),null:z(Rn),atom:z(Rn),unit:z(Rn),modifier:z(Rn),operatorKeyword:z(Rn),controlKeyword:z(Rn),definitionKeyword:z(Rn),moduleKeyword:z(Rn),operator:jn,derefOperator:z(jn),arithmeticOperator:z(jn),logicOperator:z(jn),bitwiseOperator:z(jn),compareOperator:z(jn),updateOperator:z(jn),definitionOperator:z(jn),typeOperator:z(jn),controlOperator:z(jn),punctuation:ap,separator:z(ap),bracket:fo,angleBracket:z(fo),squareBracket:z(fo),paren:z(fo),brace:z(fo),content:Zn,heading:ii,heading1:z(ii),heading2:z(ii),heading3:z(ii),heading4:z(ii),heading5:z(ii),heading6:z(ii),contentSeparator:z(Zn),list:z(Zn),quote:z(Zn),emphasis:z(Zn),strong:z(Zn),link:z(Zn),monospace:z(Zn),strikethrough:z(Zn),inserted:z(),deleted:z(),changed:z(),invalid:z(),meta:ba,documentMeta:z(ba),annotation:z(ba),processingInstruction:z(ba),definition:nn.defineModifier("definition"),constant:nn.defineModifier("constant"),function:nn.defineModifier("function"),standard:nn.defineModifier("standard"),local:nn.defineModifier("local"),special:nn.defineModifier("special")};for(let t in b){let e=b[t];e instanceof nn&&(e.name=t)}H2([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var Hh;const is=new ce;function K2(t){return K.define({combine:t?e=>e.concat(t):void 0})}const lO=new ce;class kn{constructor(e,n,r=[],i=""){this.data=e,this.name=i,ge.prototype.hasOwnProperty("tree")||Object.defineProperty(ge.prototype,"tree",{get(){return Ie(this)}}),this.parser=n,this.extension=[Ur.of(this),ge.languageData.of((s,o,l)=>{let a=M1(s,o,l),c=a.type.prop(is);if(!c)return[];let u=s.facet(c),h=a.type.prop(lO);if(h){let f=a.resolve(o-a.from,l);for(let d of h)if(d.test(f,s)){let p=s.facet(d.facet);return d.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return M1(e,n,r).type.prop(is)==this.data}findRegions(e){let n=e.facet(Ur);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(is)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(ce.mounted);if(l){if(l.tree.prop(is)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof Re&&i(c,s.positions[a]+o)}};return i(Ie(e),0),r}get allowsNesting(){return!0}}kn.setState=xe.define();function M1(t,e,n){let r=t.facet(Ur),i=Ie(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,ve.ExcludeBuffers|ve.EnterBracketed))s.type.isTop&&(i=s);return i}class Es extends kn{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=K2(e.languageData);return new Es(n,e.parser.configure({props:[is.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new Es(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ie(t){let e=t.field(kn.state,!1);return e?e.tree:Re.empty}class G6{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,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let po=null;class Kc{constructor(e,n,r=[],i,s,o,l,a){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Kc(e,n,[],Re.empty,0,r,[],null)}startParse(){return this.parser.startParse(new G6(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Re.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(ur.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(ur.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=po;po=this;try{return e()}finally{po=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=E1(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,h,f)=>a.push({fromA:c,toA:u,fromB:h,toB:f})),r=ur.applyChanges(r,a),i=Re.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);u<h&&l.push({from:u,to:h})}}}return new Kc(this.parser,n,r,i,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=E1(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends U2{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=po;if(a){for(let c of i)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Re(Qt.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return po}}function E1(t,e,n){return ur.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Rs{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Rs(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Kc.create(e.facet(Ur).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Rs(r)}}kn.state=Kt.define({create:Rs.init,update(t,e){for(let n of e.effects)if(n.is(kn.setState))return n.value;return e.startState.facet(Ur)!=e.state.facet(Ur)?Rs.init(e.state):t.apply(e)}});let J2=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(J2=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Kh=typeof navigator<"u"&&(!((Hh=navigator.scheduling)===null||Hh===void 0)&&Hh.isInputPending)?()=>navigator.scheduling.isInputPending():null,H6=Lt.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 n=this.view.state.field(kn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(kn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=J2(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(kn.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Kh?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,a=s.context.work(()=>Kh&&Kh()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:kn.setState.of(new Rs(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>In(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ur=K.define({combine(t){return t.length?t[0]:null},enables:t=>[kn.state,H6,H.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class aO{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const K6=K.define(),Yu=K.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Jc(t){let e=t.facet(Yu);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function yl(t,e){let n="",r=t.tabSize,i=t.facet(Yu)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function cO(t,e){t instanceof ge&&(t=new Fu(t));for(let r of t.state.facet(K6)){let i=r(t,e);if(i!==void 0)return i}let n=Ie(t.state);return n.length>=e?J6(t,n,e):null}class Fu{constructor(e,n={}){this.state=e,this.options=n,this.unit=Jc(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Du(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const qu=new ce;function J6(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return ek(r,t,n)}function ek(t,e,n){for(let r=t;r;r=r.next){let i=tA(r.node);if(i)return i(uO.create(e,n,r))}return 0}function eA(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function tA(t){let e=t.type.prop(qu);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(ce.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>tk(o,!0,1,void 0,s&&!eA(o)?i.from:void 0)}return t.parent==null?nA:null}function nA(){return 0}class uO extends Fu{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new uO(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(rA(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return ek(this.context.next,this.base,this.pos)}}function rA(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function iA(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function sA({closing:t,align:e=!0,units:n=1}){return r=>tk(r,e,n,t)}function tk(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==t.pos+o,a=e?iA(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}const oA=t=>t.baseIndent;function ec({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const lA=200;function aA(){return ge.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+lA)return t;let s=n.sliceString(i.from,r);if(!e.some(c=>c.test(s)))return t;let{state:o}=t,l=-1,a=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==l)continue;l=u.from;let h=cO(o,u.from);if(h==null)continue;let f=/^\s*/.exec(u.text)[0],d=yl(o,h);f!=d&&a.push({from:u.from,to:u.from+f.length,insert:d})}return a.length?[t,{changes:a,sequential:!0}]:t})}const cA=K.define(),Uu=new ce;function nk(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function uA(t,e,n){let r=Ie(t);if(r.length<n)return null;let i=r.resolveStack(n,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=n||l.from>n)continue;if(s&&l.from<e)break;let a=l.type.prop(Uu);if(a&&(l.to<r.length-50||r.length==t.doc.length||!hA(l))){let c=a(l,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(s=c)}}return s}function hA(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function R1(t,e,n){for(let r of t.facet(cA)){let i=r(t,e,n);if(i)return i}return uA(t,e,n)}function rk(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const ik=xe.define({map:rk}),hO=xe.define({map:rk}),eu=Kt.define({create(){return se.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=j1(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(ik)&&!fA(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(sk),i=r?se.replace({widget:new mA(r(e.state,n.value))}):Z1;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(hO)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=j1(t,e.selection.main.head)),t},provide:t=>H.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(Z1.range(r,i))}return se.set(e,!0)}});function j1(t,e,n=e){let r=!1;return t.between(e,n,(i,s)=>{i<n&&s>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,s)=>i>=n||s<=e}):t}function cp(t,e,n){var r;let i=null;return(r=t.field(eu,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function fA(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}const dA={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},sk=K.define({combine(t){return Bs(t,dA)}});function pA(t){return[eu,yA]}function ok(t,e){let{state:n}=t,r=n.facet(sk),i=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),a=cp(t.state,l.from,l.to);a&&t.dispatch({effects:hO.of(a)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const Z1=se.replace({widget:new class extends Zi{toDOM(t){return ok(t,null)}}});class mA extends Zi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ok(e,this.value)}}const OA={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Jh extends Or{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function gA(t={}){let e={...OA,...t},n=new Jh(e,!0),r=new Jh(e,!1),i=Lt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ur)!=o.state.facet(Ur)||o.startState.field(eu,!1)!=o.state.field(eu,!1)||Ie(o.startState)!=Ie(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new Ti;for(let a of o.viewportLineBlocks){let c=cp(o.state,a.from,a.to)?r:R1(o.state,a.from,a.to)?n:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:s}=e;return[i,g6({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||he.empty},initialSpacer(){return new Jh(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let c=cp(o.state,l.from,l.to);if(c)return o.dispatch({effects:hO.of(c)}),!0;let u=R1(o.state,l.from,l.to);return u?(o.dispatch({effects:ik.of(u)}),!0):!1}}}),pA()]}const yA=H.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 Gu{constructor(e,n){this.specs=e;let r;function i(l){let a=Br.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof kn?l=>l.prop(is)==o.data:o?l=>l==o:void 0,this.style=H2(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new Br(r):null,this.themeType=n.themeType}static define(e,n){return new Gu(e,n||{})}}const up=K.define(),xA=K.define({combine(t){return t.length?[t[0]]:null}});function ef(t){let e=t.facet(up);return e.length?e:t.facet(xA)}function vA(t,e){let n=[wA],r;return t instanceof Gu&&(t.module&&n.push(H.styleModule.of(t.module)),r=t.themeType),r?n.push(up.computeN([H.darkTheme],i=>i.facet(H.darkTheme)==(r=="dark")?[t]:[])):n.push(up.of(t)),n}class SA{constructor(e){this.markCache=Object.create(null),this.tree=Ie(e.state),this.decorations=this.buildDeco(e,ef(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ie(e.state),r=ef(e.state),i=r!=ef(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return se.none;let r=new Ti;for(let{from:i,to:s}of e.visibleRanges)F6(this.tree,n,(o,l,a)=>{r.add(o,l,this.markCache[a]||(this.markCache[a]=se.mark({class:a})))},i,s);return r.finish()}}const wA=Rl.high(Lt.fromClass(SA,{decorations:t=>t.decorations})),kA=H.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),lk=1e4,ak="()[]{}",ck=K.define({combine(t){return Bs(t,{afterCursor:!0,brackets:ak,maxScanDistance:lk,renderMatch:QA})}}),bA=se.mark({class:"cm-matchingBracket"}),PA=se.mark({class:"cm-nonmatchingBracket"});function QA(t){let e=[],n=t.matched?bA:PA;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function V1(t){let e=[],n=t.facet(ck);for(let r of t.selection.ranges){if(!r.empty)continue;let i=Yn(t,r.head,-1,n)||r.head>0&&Yn(t,r.head-1,1,n)||n.afterCursor&&(Yn(t,r.head,1,n)||r.head<t.doc.length&&Yn(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return se.set(e,!0)}const $A=Lt.fromClass(class{constructor(t){this.paused=!1,this.decorations=V1(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=V1(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),TA=[$A,kA];function CA(t={}){return[ck.of(t),TA]}const uk=new ce;function hp(t,e,n){let r=t.prop(e<0?ce.openedBy:ce.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function fp(t){let e=t.type.prop(uk);return e?e(t.node):t}function Yn(t,e,n,r={}){let i=r.maxScanDistance||lk,s=r.brackets||ak,o=Ie(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=hp(a.type,n,s);if(c&&a.from<a.to){let u=fp(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return AA(t,e,n,a,u,c,s)}}return MA(t,e,n,o,l.type,i,s)}function AA(t,e,n,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},c=0,u=l==null?void 0:l.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let h=fp(u);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(hp(u.type,n,o))c++;else if(hp(u.type,-n,o)){if(c==0){let h=fp(u);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function MA(t,e,n,r,i,s,o){let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let f=0;!u.next().done&&f<=s;){let d=u.value;n<0&&(f+=d.length);let p=e+f*n;for(let x=n>0?0:d.length-1,S=n>0?d.length:-1;x!=S;x+=n){let O=o.indexOf(d[x]);if(!(O<0||r.resolveInner(p+x,1).type!=i))if(O%2==0==n>0)h++;else{if(h==1)return{start:c,end:{from:p+x,to:p+x+1},matched:O>>1==a>>1};h--}}n>0&&(f+=d.length)}return u.done?{start:c,matched:!1}:null}const EA=Object.create(null),X1=[Qt.none],L1=[],D1=Object.create(null),RA=Object.create(null);for(let[t,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"]])RA[t]=jA(EA,e);function tf(t,e){L1.indexOf(t)>-1||(L1.push(t),console.warn(e))}function jA(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||b[c];u?typeof u=="function"?a.length?a=a.map(u):tf(c,`Modifier ${c} used at start of tag`):a.length?tf(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:tf(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(l=>l.id),s=D1[i];if(s)return s.id;let o=D1[i]=Qt.define({id:X1.length,name:r,props:[Bu({[r]:n})]});return X1.push(o),o.id}We.RTL,We.LTR;const ZA=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=dO(t.state,n.from);return r.line?VA(t):r.block?LA(t):!1};function fO(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const VA=fO(NA,0),XA=fO(hk,0),LA=fO((t,e)=>hk(t,e,_A(e)),0);function dO(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const mo=50;function DA(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-mo,r),o=t.sliceDoc(i,i+mo),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:i+a,margin:a&&1}};let u,h;i-r<=2*mo?u=h=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+mo),h=t.sliceDoc(i-mo,i));let f=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(h)[0].length,p=h.length-d-n.length;return u.slice(f,f+e.length)==e&&h.slice(p,p+n.length)==n?{open:{pos:r+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function _A(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function hk(t,e,n=e.selection.ranges){let r=n.map(s=>dO(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>DA(e,r[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,l;o<i.length;o++)if(l=i[o]){let a=r[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function NA(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:o}of n){let l=r.length,a=1e9,c;for(let u=s;u<=o;){let h=e.doc.lineAt(u);if(c==null&&(c=dO(e,h.from).line,!c))continue e;if(h.from>i&&(s==o||o>h.from)){i=h.from;let f=/^\s*/.exec(h.text)[0].length,d=f==h.length,p=h.text.slice(f,f+c.length)==c?f:-1;f<h.text.length&&f<a&&(a=f),r.push({line:h,comment:p,token:c,indent:f,empty:d,single:!1})}u=h.to+1}if(a<1e9)for(let u=l;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=a);r.length==l+1&&(r[l].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:h}of r)(h||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of r)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const dp=yr.define(),zA=yr.define(),WA=K.define(),fk=K.define({combine(t){return Bs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),dk=Kt.define({create(){return Fn.empty},update(t,e){let n=e.state.facet(fk),r=e.annotation(dp);if(r){let a=Rt.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return a?u=tu(u,u.length,n.minDepth,a):u=Ok(u,e.startState.selection),new Fn(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(zA);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Fe.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Rt.fromTransaction(e),o=e.annotation(Fe.time),l=e.annotation(Fe.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Fn(t.done.map(Rt.fromJSON),t.undone.map(Rt.fromJSON))}});function IA(t={}){return[dk,fk.of(t),H.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?pk:e.inputType=="historyRedo"?pp:null;return r?(e.preventDefault(),r(n)):!1}})]}function Hu(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(dk,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const pk=Hu(0,!1),pp=Hu(1,!1),BA=Hu(0,!0),YA=Hu(1,!0);class Rt{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Rt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Rt(e.changes&&Ge.fromJSON(e.changes),[],e.mapped&&Gn.fromJSON(e.mapped),e.startSelection&&R.fromJSON(e.startSelection),e.selectionsAfter.map(R.fromJSON))}static fromTransaction(e,n){let r=ln;for(let i of e.startState.facet(WA)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new Rt(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ln)}static selection(e){return new Rt(void 0,ln,void 0,void 0,e)}}function tu(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function FA(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(r=!0)}}),r}function qA(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function mk(t,e){return t.length?e.length?t.concat(e):t:e}const ln=[],UA=200;function Ok(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-UA));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),tu(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Rt.selection([e])]}function GA(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function nf(t,e){if(!t.length)return t;let n=t.length,r=ln;for(;n;){let i=HA(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Rt.selection(r)]:ln}function HA(t,e,n){let r=mk(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ln,n);if(!t.changes)return Rt.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new Rt(i,xe.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const KA=/^(input\.type|delete)($|\.)/;class Fn{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Fn(this.done,this.undone):this}addChanges(e,n,r,i,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||KA.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,FA(l.changes,e.changes))||r=="input.type.compose")?o=tu(o,o.length-1,i.minDepth,new Rt(e.changes.compose(l.changes),mk(xe.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,ln)):o=tu(o,o.length,i.minDepth,e),new Fn(o,ln,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ln;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&qA(s[s.length-1],e)?this:new Fn(Ok(this.done,e),this.undone,n,r)}addMapping(e){return new Fn(nf(this.done,e),nf(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:dp.of({side:e,rest:GA(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=i.length==1?ln:i.slice(0,i.length-1);return s.mapped&&(l=nf(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:dp.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Fn.empty=new Fn(ln,ln);const JA=[{key:"Mod-z",run:pk,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:pp,preventDefault:!0},{linux:"Ctrl-Shift-z",run:pp,preventDefault:!0},{key:"Mod-u",run:BA,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:YA,preventDefault:!0}];function Ys(t,e){return R.create(t.ranges.map(e),t.mainIndex)}function Cn(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function An({state:t,dispatch:e},n){let r=Ys(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Cn(t,r)),!0)}function Ku(t,e){return R.cursor(e?t.to:t.from)}function gk(t,e){return An(t,n=>n.empty?t.moveByChar(n,e):Ku(n,e))}function xt(t){return t.textDirectionAt(t.state.selection.main.head)==We.LTR}const yk=t=>gk(t,!xt(t)),xk=t=>gk(t,xt(t));function vk(t,e){return An(t,n=>n.empty?t.moveByGroup(n,e):Ku(n,e))}const e8=t=>vk(t,!xt(t)),t8=t=>vk(t,xt(t));function n8(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Ju(t,e,n){let r=Ie(t).resolveInner(e.head),i=n?ce.closedBy:ce.openedBy;for(let a=e.head;;){let c=n?r.childAfter(a):r.childBefore(a);if(!c)break;n8(t,c,i)?r=c:a=n?c.to:c.from}let s=r.type.prop(i),o,l;return s&&(o=n?Yn(t,r.from,1):Yn(t,r.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?r.to:r.from,R.cursor(l,n?-1:1)}const r8=t=>An(t,e=>Ju(t.state,e,!xt(t))),i8=t=>An(t,e=>Ju(t.state,e,xt(t)));function Sk(t,e){return An(t,n=>{if(!n.empty)return Ku(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const wk=t=>Sk(t,!1),kk=t=>Sk(t,!0);function bk(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(H.scrollMargins)){let o=s(t);o!=null&&o.top&&(n=Math.max(o==null?void 0:o.top,n)),o!=null&&o.bottom&&(r=Math.max(o==null?void 0:o.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Pk(t,e){let n=bk(t),{state:r}=t,i=Ys(r.selection,o=>o.empty?t.moveVertically(o,e,n.height):Ku(o,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=H.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(Cn(r,i),{effects:s}),!0}const _1=t=>Pk(t,!1),mp=t=>Pk(t,!0);function ti(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=R.cursor(r.from+s))}return i}const s8=t=>An(t,e=>ti(t,e,!0)),o8=t=>An(t,e=>ti(t,e,!1)),l8=t=>An(t,e=>ti(t,e,!xt(t))),a8=t=>An(t,e=>ti(t,e,xt(t))),c8=t=>An(t,e=>R.cursor(t.lineBlockAt(e.head).from,1)),u8=t=>An(t,e=>R.cursor(t.lineBlockAt(e.head).to,-1));function h8(t,e,n){let r=!1,i=Ys(t.selection,s=>{let o=Yn(t,s.head,-1)||Yn(t,s.head,1)||s.head>0&&Yn(t,s.head-1,1)||s.head<t.doc.length&&Yn(t,s.head+1,-1);if(!o||!o.end)return s;r=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return R.cursor(l)});return r?(e(Cn(t,i)),!0):!1}const f8=({state:t,dispatch:e})=>h8(t,e);function pn(t,e){let n=Ys(t.state.selection,r=>{let i=e(r);return R.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Cn(t.state,n)),!0)}function Qk(t,e){return pn(t,n=>t.moveByChar(n,e))}const $k=t=>Qk(t,!xt(t)),Tk=t=>Qk(t,xt(t));function Ck(t,e){return pn(t,n=>t.moveByGroup(n,e))}const d8=t=>Ck(t,!xt(t)),p8=t=>Ck(t,xt(t)),m8=t=>pn(t,e=>Ju(t.state,e,!xt(t))),O8=t=>pn(t,e=>Ju(t.state,e,xt(t)));function Ak(t,e){return pn(t,n=>t.moveVertically(n,e))}const Mk=t=>Ak(t,!1),Ek=t=>Ak(t,!0);function Rk(t,e){return pn(t,n=>t.moveVertically(n,e,bk(t).height))}const N1=t=>Rk(t,!1),z1=t=>Rk(t,!0),g8=t=>pn(t,e=>ti(t,e,!0)),y8=t=>pn(t,e=>ti(t,e,!1)),x8=t=>pn(t,e=>ti(t,e,!xt(t))),v8=t=>pn(t,e=>ti(t,e,xt(t))),S8=t=>pn(t,e=>R.cursor(t.lineBlockAt(e.head).from)),w8=t=>pn(t,e=>R.cursor(t.lineBlockAt(e.head).to)),W1=({state:t,dispatch:e})=>(e(Cn(t,{anchor:0})),!0),I1=({state:t,dispatch:e})=>(e(Cn(t,{anchor:t.doc.length})),!0),B1=({state:t,dispatch:e})=>(e(Cn(t,{anchor:t.selection.main.anchor,head:0})),!0),Y1=({state:t,dispatch:e})=>(e(Cn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),k8=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),b8=({state:t,dispatch:e})=>{let n=eh(t).map(({from:r,to:i})=>R.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:R.create(n),userEvent:"select"})),!0},P8=({state:t,dispatch:e})=>{let n=Ys(t.selection,r=>{let i=Ie(t),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&o.next)return R.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(Cn(t,n)),!0)};function jk(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){i.some(c=>c.head==a.head)||i.push(a);break}else{if(a.head==l.head)break;l=a}}}return i.length==r.ranges.length?!1:(t.dispatch(Cn(n,R.create(i,i.length-1))),!0)}const Q8=t=>jk(t,!1),$8=t=>jk(t,!0),T8=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=R.create([n.main]):n.main.empty||(r=R.create([R.cursor(n.main.head)])),r?(e(Cn(t,r)),!0):!1};function Xl(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=Pa(t,a,!1)):a>o&&(n="delete.forward",a=Pa(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Pa(t,o,!1),l=Pa(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:R.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?H.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Pa(t,e,n){if(t instanceof H)for(let r of t.state.facet(H.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const Zk=(t,e,n)=>Xl(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),l,a;if(n&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,i-o.from))){if(l[l.length-1]==" ")return i-1;let c=Du(l,s.tabSize),u=c%Jc(s)||Jc(s);for(let h=0;h<u&&l[l.length-1-h]==" ";h++)i--;a=i}else a=et(o.text,i-o.from,e,e)+o.from,a==i&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,i-o.from))&&(a=et(o.text,a-o.from,!1,!1)+o.from);return a}),Op=t=>Zk(t,!1,!0),Vk=t=>Zk(t,!0,!1),Xk=(t,e)=>Xl(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let l=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let a=et(s.text,r-s.from,e)+s.from,c=s.text.slice(Math.min(r,a)-s.from,Math.max(r,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||r!=n.head)&&(l=u),r=a}return r}),Lk=t=>Xk(t,!1),C8=t=>Xk(t,!0),A8=t=>Xl(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),M8=t=>Xl(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),E8=t=>Xl(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),R8=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:me.of(["",""])},range:R.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},j8=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),o=i==s.from?i-1:et(s.text,i-s.from,!1)+s.from,l=i==s.to?i+1:et(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(i,l).append(t.doc.slice(o,i))},range:R.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function eh(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function Dk(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of eh(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)i.push(R.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)i.push(R.range(a.anchor-l,a.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:R.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Z8=({state:t,dispatch:e})=>Dk(t,e,!1),V8=({state:t,dispatch:e})=>Dk(t,e,!0);function _k(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of eh(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const X8=({state:t,dispatch:e})=>_k(t,e,!1),L8=({state:t,dispatch:e})=>_k(t,e,!0),D8=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(eh(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Ys(e.selection,i=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),l=t.coordsAtPos(i.head,i.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function _8(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ie(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(ce.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const F1=Nk(!1),N8=Nk(!0);function Nk(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,l=e.doc.lineAt(s),a=!t&&s==o&&_8(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new Fu(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=cO(c,s);for(u==null&&(u=Du(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let h=["",yl(e,u)];return a&&h.push(yl(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:me.of(h)},range:R.cursor(s+1+h[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function pO(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let l=t.doc.lineAt(o);l.number>n&&(r.empty||r.to>l.from)&&(e(l,i,r),n=l.number),o=l.to+1}let s=t.changes(i);return{changes:i,range:R.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const z8=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Fu(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=pO(t,(s,o,l)=>{let a=cO(r,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=yl(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},W8=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(pO(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Yu)})}),{userEvent:"input.indent"})),!0),I8=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(pO(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Du(i,t.tabSize),o=0,l=yl(t,Math.max(0,s-Jc(t)));for(;o<i.length&&o<l.length&&i.charCodeAt(o)==l.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+i.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),B8=t=>(t.setTabFocusMode(),!0),Y8=[{key:"Ctrl-b",run:yk,shift:$k,preventDefault:!0},{key:"Ctrl-f",run:xk,shift:Tk},{key:"Ctrl-p",run:wk,shift:Mk},{key:"Ctrl-n",run:kk,shift:Ek},{key:"Ctrl-a",run:c8,shift:S8},{key:"Ctrl-e",run:u8,shift:w8},{key:"Ctrl-d",run:Vk},{key:"Ctrl-h",run:Op},{key:"Ctrl-k",run:A8},{key:"Ctrl-Alt-h",run:Lk},{key:"Ctrl-o",run:R8},{key:"Ctrl-t",run:j8},{key:"Ctrl-v",run:mp}],F8=[{key:"ArrowLeft",run:yk,shift:$k,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e8,shift:d8,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:l8,shift:x8,preventDefault:!0},{key:"ArrowRight",run:xk,shift:Tk,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t8,shift:p8,preventDefault:!0},{mac:"Cmd-ArrowRight",run:a8,shift:v8,preventDefault:!0},{key:"ArrowUp",run:wk,shift:Mk,preventDefault:!0},{mac:"Cmd-ArrowUp",run:W1,shift:B1},{mac:"Ctrl-ArrowUp",run:_1,shift:N1},{key:"ArrowDown",run:kk,shift:Ek,preventDefault:!0},{mac:"Cmd-ArrowDown",run:I1,shift:Y1},{mac:"Ctrl-ArrowDown",run:mp,shift:z1},{key:"PageUp",run:_1,shift:N1},{key:"PageDown",run:mp,shift:z1},{key:"Home",run:o8,shift:y8,preventDefault:!0},{key:"Mod-Home",run:W1,shift:B1},{key:"End",run:s8,shift:g8,preventDefault:!0},{key:"Mod-End",run:I1,shift:Y1},{key:"Enter",run:F1,shift:F1},{key:"Mod-a",run:k8},{key:"Backspace",run:Op,shift:Op,preventDefault:!0},{key:"Delete",run:Vk,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Lk,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:C8,preventDefault:!0},{mac:"Mod-Backspace",run:M8,preventDefault:!0},{mac:"Mod-Delete",run:E8,preventDefault:!0}].concat(Y8.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),q8=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:r8,shift:m8},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:i8,shift:O8},{key:"Alt-ArrowUp",run:Z8},{key:"Shift-Alt-ArrowUp",run:X8},{key:"Alt-ArrowDown",run:V8},{key:"Shift-Alt-ArrowDown",run:L8},{key:"Mod-Alt-ArrowUp",run:Q8},{key:"Mod-Alt-ArrowDown",run:$8},{key:"Escape",run:T8},{key:"Mod-Enter",run:N8},{key:"Alt-l",mac:"Ctrl-l",run:b8},{key:"Mod-i",run:P8,preventDefault:!0},{key:"Mod-[",run:I8},{key:"Mod-]",run:W8},{key:"Mod-Alt-\\",run:z8},{key:"Shift-Mod-k",run:D8},{key:"Shift-Mod-\\",run:f8},{key:"Mod-/",run:ZA},{key:"Alt-A",run:XA},{key:"Ctrl-m",mac:"Shift-Alt-m",run:B8}].concat(F8);function q1(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function U8(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=q1(e)+q1(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function G8(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:U8(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function H8(t,e){return n=>{for(let r=Ie(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}const K8=yr.define(),J8=H.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class eM{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class mO{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,mt.TrackDel),r=e.mapPos(this.to,1,mt.TrackDel);return n==null||r==null?null:new mO(this.field,n,r)}}class OO{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(r.length){let c=o,u=/^\t*/.exec(a)[0].length;for(let h=0;h<u;h++)c+=e.facet(Yu);i.push(n+c.length-u),a=c+a.slice(u)}r.push(a),n+=a.length+1}let l=this.fieldPositions.map(a=>new mO(a.field,i[a.line]+a.from,i[a.line]+a.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||"",c=-1,u=a.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h<n.length;h++)(l!=null?n[h].seq==l:u&&n[h].name==u)&&(c=h);if(c<0){let h=0;for(;h<n.length&&(l==null||n[h].seq!=null&&n[h].seq<l);)h++;n.splice(h,0,{seq:l,name:u}),c=h;for(let f of i)f.field>=c&&f.field++}for(let h of i)if(h.line==r.length&&h.from>s.index){let f=s[2]?3+(s[1]||"").length:2;h.from-=f,h.to-=f}i.push(new eM(c,r.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return a}),r.push(o)}return new OO(r,i)}}let tM=se.widget({widget:new class extends Zi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),nM=se.mark({class:"cm-snippetField"});class Fs{constructor(e,n){this.ranges=e,this.active=n,this.deco=se.set(e.map(r=>(r.from==r.to?tM:nM).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Fs(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Ll=xe.define({map(t,e){return t&&t.map(e)}}),rM=xe.define(),xl=Kt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Ll))return n.value;if(n.is(rM)&&t)return new Fs(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>H.decorations.from(t,e=>e?e.deco:se.none)});function gO(t,e){return R.create(t.filter(n=>n.field==e).map(n=>R.range(n.from,n.to)))}function iM(t){let e=OO.parse(t);return(n,r,i,s)=>{let{text:o,ranges:l}=e.instantiate(n.state,i),{main:a}=n.state.selection,c={changes:{from:i,to:s==a.from?a.to:s,insert:me.of(o)},scrollIntoView:!0,annotations:r?[K8.of(r),Fe.userEvent.of("input.complete")]:void 0};if(l.length&&(c.selection=gO(l,0)),l.some(u=>u.field>0)){let u=new Fs(l,0),h=c.effects=[Ll.of(u)];n.state.field(xl,!1)===void 0&&h.push(xe.appendConfig.of([xl,cM,uM,J8]))}n.dispatch(n.state.update(c))}}function zk(t){return({state:e,dispatch:n})=>{let r=e.field(xl,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:gO(r.ranges,i),effects:Ll.of(s?null:new Fs(r.ranges,i)),scrollIntoView:!0})),!0}}const sM=({state:t,dispatch:e})=>t.field(xl,!1)?(e(t.update({effects:Ll.of(null)})),!0):!1,oM=zk(1),lM=zk(-1),aM=[{key:"Tab",run:oM,shift:lM},{key:"Escape",run:sM}],U1=K.define({combine(t){return t.length?t[0]:aM}}),cM=Rl.highest(nO.compute([U1],t=>t.facet(U1)));function Ct(t,e){return{...e,apply:iM(t)}}const uM=H.domEventHandlers({mousedown(t,e){let n=e.state.field(xl,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:gO(n.ranges,i.field),effects:Ll.of(n.ranges.some(s=>s.field>i.field)?new Fs(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),vl={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Oi=xe.define({map(t,e){let n=e.mapPos(t,-1,mt.TrackAfter);return n??void 0}}),yO=new class extends Ir{};yO.startSide=1;yO.endSide=-1;const Wk=Kt.define({create(){return he.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Oi)&&(t=t.update({add:[yO.range(n.value,n.value+1)]}));return t}});function hM(){return[dM,Wk]}const rf="()[]{}<>«»»«[]{}";function Ik(t){for(let e=0;e<rf.length;e+=2)if(rf.charCodeAt(e)==t)return rf.charAt(e+1);return Aw(t<128?t:t+1)}function Bk(t,e){return t.languageDataAt("closeBrackets",e)[0]||vl}const fM=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),dM=H.inputHandler.of((t,e,n,r)=>{if((fM?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&El(ji(r,0))==1||e!=i.from||n!=i.to)return!1;let s=OM(t.state,r);return s?(t.dispatch(s),!0):!1}),pM=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Bk(t,t.selection.main.head).brackets||vl.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let l=gM(t.doc,o.head);for(let a of r)if(a==l&&th(t.doc,o.head)==Ik(ji(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:R.cursor(o.head-a.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},mM=[{key:"Backspace",run:pM}];function OM(t,e){let n=Bk(t,t.selection.main.head),r=n.brackets||vl.brackets;for(let i of r){let s=Ik(ji(i,0));if(e==i)return s==i?vM(t,i,r.indexOf(i+i+i)>-1,n):yM(t,i,s,n.before||vl.before);if(e==s&&Yk(t,t.selection.main.from))return xM(t,i,s)}return null}function Yk(t,e){let n=!1;return t.field(Wk).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function th(t,e){let n=t.sliceString(e,e+2);return n.slice(0,El(ji(n,0)))}function gM(t,e){let n=t.sliceString(e-2,e);return El(ji(n,0))==n.length?n:n.slice(1)}function yM(t,e,n,r){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:Oi.of(o.to+e.length),range:R.range(o.anchor+e.length,o.head+e.length)};let l=th(t.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:o.head},effects:Oi.of(o.head+e.length),range:R.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function xM(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&th(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:R.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function vM(t,e,n,r){let i=r.stringPrefixes||vl.stringPrefixes,s=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Oi.of(l.to+e.length),range:R.range(l.anchor+e.length,l.head+e.length)};let a=l.head,c=th(t.doc,a),u;if(c==e){if(G1(t,a))return{changes:{insert:e+e,from:a},effects:Oi.of(a+e.length),range:R.cursor(a+e.length)};if(Yk(t,a)){let f=n&&t.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:R.cursor(a+f.length)}}}else{if(n&&t.sliceDoc(a-2*e.length,a)==e+e&&(u=H1(t,a-2*e.length,i))>-1&&G1(t,u))return{changes:{insert:e+e+e+e,from:a},effects:Oi.of(a+e.length),range:R.cursor(a+e.length)};if(t.charCategorizer(a)(c)!=Ee.Word&&H1(t,a,i)>-1&&!SM(t,a,e,i))return{changes:{insert:e+e,from:a},effects:Oi.of(a+e.length),range:R.cursor(a+e.length)}}return{range:s=l}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function G1(t,e){let n=Ie(t).resolveInner(e+1);return n.parent&&n.from==e}function SM(t,e,n,r){let i=Ie(t).resolveInner(e,-1),s=r.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),a=l.indexOf(n);if(!a||a>-1&&r.indexOf(l.slice(0,a))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+a;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function H1(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Ee.Word)return e;for(let i of n){let s=e-i.length;if(t.sliceDoc(s,e)==i&&r(t.sliceDoc(s-1,s))!=Ee.Word)return s}return-1}const K1=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class js{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(K1(l)):K1,this.query=this.normalize(n)}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 ji(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 n=Aw(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=El(e);let i=this.normalize(n);if(i.length)for(let s=0,o=r;;s++){let l=i.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(a)return this.value=a,this;break}o==r&&s<n.length&&n.charCodeAt(s)==l&&o++}}}match(e,n,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(js.prototype[Symbol.iterator]=function(){return this});const Fk={from:-1,to:-1,match:/.*/.exec("")},xO="gm"+(/x/.unicode==null?"":"u");class qk{constructor(e,n,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=Fk,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Uk(e,n,r,i,s);this.re=new RegExp(n,xO+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=nu(e,i),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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=nu(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},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 sf=new WeakMap;class xs{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=sf.get(e);if(!i||i.from>=r||i.to<=n){let l=new xs(n,e.sliceString(n,r));return sf.set(e,l),l}if(i.from==n&&i.to==r)return i;let{text:s,from:o}=i;return o>n&&(s=e.sliceString(n,o)+s,o=n),i.to<r&&(s+=e.sliceString(i.to,r)),sf.set(e,new xs(o,s)),new xs(n,s.slice(n-o,r-o))}}class Uk{constructor(e,n,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=Fk,this.matchPos=nu(e,i),this.re=new RegExp(n,xO+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=xs.get(e,i,this.chunkEnd(i+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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=nu(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xs.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(qk.prototype[Symbol.iterator]=Uk.prototype[Symbol.iterator]=function(){return this});function wM(t){try{return new RegExp(t,xO),!0}catch{return!1}}function nu(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}const kM=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:r,result:i}=d6(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){t.dispatch({effects:r});return}let l=e.doc.lineAt(e.selection.main.head),[,a,c,u,h]=o,f=u?+u.slice(1):0,d=c?+c:l.number;if(c&&h){let S=d/100;a&&(S=S*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*S)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),x=R.cursor(p.from+Math.max(0,Math.min(f,p.length)));t.dispatch({effects:[r,H.scrollIntoView(x.from,{y:"center"})],selection:x})}),!0},bM={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},PM=K.define({combine(t){return Bs(t,bM,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function QM(t){return[MM,AM]}const $M=se.mark({class:"cm-selectionMatch"}),TM=se.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function J1(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Ee.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Ee.Word)}function CM(t,e,n,r){return t(e.sliceDoc(n,n+1))==Ee.Word&&t(e.sliceDoc(r-1,r))==Ee.Word}const AM=Lt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(PM),{state:n}=t,r=n.selection;if(r.ranges.length>1)return se.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return se.none;let a=n.wordAt(i.head);if(!a)return se.none;o=n.charCategorizer(i.head),s=n.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a<e.minSelectionLength||a>200)return se.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(J1(o,n,i.from,i.to)&&CM(o,n,i.from,i.to)))return se.none}else if(s=n.sliceDoc(i.from,i.to),!s)return se.none}let l=[];for(let a of t.visibleRanges){let c=new js(n.doc,s,a.from,a.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||J1(o,n,u,h))&&(i.empty&&u<=i.from&&h>=i.to?l.push(TM.range(u,h)):(u>=i.to||h<=i.from)&&l.push($M.range(u,h)),l.length>e.maxMatches))return se.none}}return se.set(l)}},{decorations:t=>t.decorations}),MM=H.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),EM=({state:t,dispatch:e})=>{let{selection:n}=t,r=R.create(n.ranges.map(i=>t.wordAt(i.head)||R.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function RM(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let o=!1,l=new js(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new js(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(a=>a.from==l.value.from))continue;if(s){let a=t.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const jM=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return EM({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=r))return!1;let i=RM(t,r);return i?(e(t.update({selection:t.selection.addRange(R.range(i.from,i.to),!1),effects:H.scrollIntoView(i.to)})),!0):!1},qs=K.define({combine(t){return Bs(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new qM(e),scrollToMatch:e=>H.scrollIntoView(e)})}});class Gk{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||wM(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,(n,r)=>r=="n"?`
|
|
64
|
+
`:r=="r"?"\r":r=="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 _M(this):new XM(this)}getCursor(e,n=0,r){let i=e.doc?e:ge.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Ni(this,i,n,r):_i(this,i,n,r)}}class Hk{constructor(e){this.spec=e}}function ZM(t,e,n){return(r,i,s,o)=>{if(n&&!n(r,i,s,o))return!1;let l=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return t(l,e,r,i)}}function _i(t,e,n,r){let i;return t.wholeWord&&(i=VM(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=ZM(t.test,e,i)),new js(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),i)}function VM(t,e){return(n,r,i,s)=>((s>n||s+i.length<r)&&(s=Math.max(0,n-2),i=t.sliceString(s,Math.min(t.length,r+2))),(e(ru(i,n-s))!=Ee.Word||e(iu(i,n-s))!=Ee.Word)&&(e(iu(i,r-s))!=Ee.Word||e(ru(i,r-s))!=Ee.Word))}class XM extends Hk{constructor(e){super(e)}nextMatch(e,n,r){let i=_i(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,n+this.spec.unquoted.length);i=_i(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let s=Math.max(n,i-1e4-this.spec.unquoted.length),o=_i(this.spec,e,s,i),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=_i(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=_i(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function LM(t,e,n){return(r,i,s)=>(!n||n(r,i,s))&&t(s[0],e,r,i)}function Ni(t,e,n,r){let i;return t.wholeWord&&(i=DM(e.charCategorizer(e.selection.main.head))),t.test&&(i=LM(t.test,e,i)),new qk(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function ru(t,e){return t.slice(et(t,e,!1),e)}function iu(t,e){return t.slice(e,et(t,e))}function DM(t){return(e,n,r)=>!r[0].length||(t(ru(r.input,r.index))!=Ee.Word||t(iu(r.input,r.index))!=Ee.Word)&&(t(iu(r.input,r.index+r[0].length))!=Ee.Word||t(ru(r.input,r.index+r[0].length))!=Ee.Word)}class _M extends Hk{nextMatch(e,n,r){let i=Ni(this.spec,e,r,e.doc.length).next();return i.done&&(i=Ni(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let s=Math.max(n,r-i*1e4),o=Ni(this.spec,e,s,r),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return n})}matchAll(e,n){let r=Ni(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Ni(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Sl=xe.define(),vO=xe.define(),Nr=Kt.define({create(t){return new of(gp(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Sl)?t=new of(n.value.create(),t.panel):n.is(vO)&&(t=new of(t.query,n.value?SO:null));return t},provide:t=>Uc.from(t,e=>e.panel)});class of{constructor(e,n){this.query=e,this.panel=n}}const NM=se.mark({class:"cm-searchMatch"}),zM=se.mark({class:"cm-searchMatch cm-searchMatch-selected"}),WM=Lt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Nr))}update(t){let e=t.state.field(Nr);(e!=t.startState.field(Nr)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return se.none;let{view:n}=this,r=new Ti;for(let i=0,s=n.visibleRanges,o=s.length;i<o;i++){let{from:l,to:a}=s[i];for(;i<o-1&&a>s[i+1].from-2*250;)a=s[++i].to;t.highlight(n.state,l,a,(c,u)=>{let h=n.state.selection.ranges.some(f=>f.from==c&&f.to==u);r.add(c,u,h?zM:NM)})}return r.finish()}},{decorations:t=>t.decorations});function Dl(t){return e=>{let n=e.state.field(Nr,!1);return n&&n.query.spec.valid?t(e,n):eb(e)}}const su=Dl((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=R.single(r.from,r.to),s=t.state.facet(qs);return t.dispatch({selection:i,effects:[wO(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),Jk(t),!0}),ou=Dl((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=R.single(i.from,i.to),o=t.state.facet(qs);return t.dispatch({selection:s,effects:[wO(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),Jk(t),!0}),IM=Dl((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:R.create(n.map(r=>R.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),BM=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,s=[],o=0;for(let l=new js(t.doc,t.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push(R.range(l.value.from,l.value.to))}return e(t.update({selection:R.create(s,o),userEvent:"select.search.matches"})),!0},ey=Dl((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,r,r);if(!s)return!1;let o=s,l=[],a,c,u=[];o.from==r&&o.to==i&&(c=n.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(n,o.from,o.to),u.push(H.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let h=t.state.changes(l);return o&&(a=R.single(o.from,o.to).map(h),u.push(wO(t,o)),u.push(n.facet(qs).scrollToMatch(a.main,t))),t.dispatch({changes:h,selection:a,effects:u,userEvent:"input.replace"}),!0}),YM=Dl((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:H.announce.of(r),userEvent:"input.replace.all"}),!0});function SO(t){return t.state.facet(qs).createPanel(t)}function gp(t,e){var n,r,i,s,o;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=t.facet(qs);return new Gk({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function Kk(t){let e=L2(t,SO);return e&&e.dom.querySelector("[main-field]")}function Jk(t){let e=Kk(t);e&&e==t.root.activeElement&&e.select()}const eb=t=>{let e=t.state.field(Nr,!1);if(e&&e.panel){let n=Kk(t);if(n&&n!=t.root.activeElement){let r=gp(t.state,e.query.spec);r.valid&&t.dispatch({effects:Sl.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[vO.of(!0),e?Sl.of(gp(t.state,e.query.spec)):xe.appendConfig.of(GM)]});return!0},tb=t=>{let e=t.state.field(Nr,!1);if(!e||!e.panel)return!1;let n=L2(t,SO);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:vO.of(!1)}),!0},FM=[{key:"Mod-f",run:eb,scope:"editor search-panel"},{key:"F3",run:su,shift:ou,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:su,shift:ou,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tb,scope:"editor search-panel"},{key:"Mod-Shift-l",run:BM},{key:"Mod-Alt-g",run:kM},{key:"Mod-d",run:jM,preventDefault:!0}];class qM{constructor(e){this.view=e;let n=this.query=e.state.field(Nr).query.spec;this.commit=this.commit.bind(this),this.searchField=Ke("input",{value:n.search,placeholder:Nt(e,"Find"),"aria-label":Nt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ke("input",{value:n.replace,placeholder:Nt(e,"Replace"),"aria-label":Nt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ke("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ke("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ke("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return Ke("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=Ke("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>su(e),[Nt(e,"next")]),r("prev",()=>ou(e),[Nt(e,"previous")]),r("select",()=>IM(e),[Nt(e,"all")]),Ke("label",null,[this.caseField,Nt(e,"match case")]),Ke("label",null,[this.reField,Nt(e,"regexp")]),Ke("label",null,[this.wordField,Nt(e,"by word")]),...e.state.readOnly?[]:[Ke("br"),this.replaceField,r("replace",()=>ey(e),[Nt(e,"replace")]),r("replaceAll",()=>YM(e),[Nt(e,"replace all")])],Ke("button",{name:"close",onclick:()=>tb(e),"aria-label":Nt(e,"close"),type:"button"},["×"])])}commit(){let e=new Gk({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:Sl.of(e)}))}keydown(e){l6(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ou:su)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ey(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Sl)&&!r.value.eq(this.query)&&this.setQuery(r.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(qs).top}}function Nt(t,e){return t.state.phrase(e)}const Qa=30,$a=/[\s\.,:;?!]/;function wO(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,s=Math.max(r.from,e-Qa),o=Math.min(i,n+Qa),l=t.state.sliceDoc(s,o);if(s!=r.from){for(let a=0;a<Qa;a++)if(!$a.test(l[a+1])&&$a.test(l[a])){l=l.slice(a);break}}if(o!=i){for(let a=l.length-1;a>l.length-Qa;a--)if(!$a.test(l[a-1])&&$a.test(l[a])){l=l.slice(0,a);break}}return H.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const UM=H.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"}}),GM=[Nr,Rl.low(WM),UM],HM="#e5c07b",ty="#e06c75",KM="#56b6c2",JM="#ffffff",tc="#abb2bf",yp="#7d8799",e3="#61afef",t3="#98c379",ny="#d19a66",n3="#c678dd",r3="#21252b",ry="#2c313a",iy="#282c34",lf="#353a42",i3="#3E4451",sy="#528bff",s3=H.theme({"&":{color:tc,backgroundColor:iy},".cm-content":{caretColor:sy},".cm-cursor, .cm-dropCursor":{borderLeftColor:sy},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:i3},".cm-panels":{backgroundColor:r3,color:tc},".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:iy,color:yp,border:"none"},".cm-activeLineGutter":{backgroundColor:ry},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:lf},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:lf,borderBottomColor:lf},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ry,color:tc}}},{dark:!0}),o3=Gu.define([{tag:b.keyword,color:n3},{tag:[b.name,b.deleted,b.character,b.propertyName,b.macroName],color:ty},{tag:[b.function(b.variableName),b.labelName],color:e3},{tag:[b.color,b.constant(b.name),b.standard(b.name)],color:ny},{tag:[b.definition(b.name),b.separator],color:tc},{tag:[b.typeName,b.className,b.number,b.changed,b.annotation,b.modifier,b.self,b.namespace],color:HM},{tag:[b.operator,b.operatorKeyword,b.url,b.escape,b.regexp,b.link,b.special(b.string)],color:KM},{tag:[b.meta,b.comment],color:yp},{tag:b.strong,fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.link,color:yp,textDecoration:"underline"},{tag:b.heading,fontWeight:"bold",color:ty},{tag:[b.atom,b.bool,b.special(b.variableName)],color:ny},{tag:[b.processingInstruction,b.string,b.inserted],color:t3},{tag:b.invalid,color:JM}]),l3=[s3,vA(o3)];var oy={};class lu{constructor(e,n,r,i,s,o,l,a,c,u=0,h){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=h}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new lu(e,[],n,r,r,0,[],0,i?new ly(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(i);if(l&&(this.score+=l),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let a=this.stack.length-(r-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let h=a?this.stack[a-1]:0,f=this.bufferBase+this.buffer.length-h;if(i<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,d,f+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(n==r)return;if(o.buffer[l-2]>=n){o.buffer[l-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>r;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>r;)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,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let s=e,{parser:o}=this.p;this.pos=i;let l=o.stateFlag(s,1);!l&&(i>r||n<=o.maxNode)&&(this.reducePos=i),this.pushState(s,l?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=o.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,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,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new lu(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new a3(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(n[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let o=n[s+1];i.some((l,a)=>a&1&&l==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=r(o,s+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}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 n=new ly(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}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 ly{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class a3{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class au{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new au(e,n,n-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 au(this.stack,this.pos,this.index)}}function Po(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let o=t.charCodeAt(r++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class nc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const ay=new nc;class c3{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=ay,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=r;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>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,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=ay,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,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class vs{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;nb(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}vs.prototype.contextual=vs.prototype.fallback=vs.prototype.extend=!1;class cu{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Po(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(nb(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}cu.prototype.contextual=vs.prototype.fallback=vs.prototype.extend=!1;class Jt{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function nb(t,e,n,r,i,s){let o=0,l=1<<r,{dialect:a}=n.p.parser;e:for(;l&t[o];){let c=t[o+1];for(let d=o+3;d<c;d+=2)if((t[d+1]&l)>0){let p=t[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||u3(p,e.token.value,i,s))){e.acceptToken(p);break}}let u=e.next,h=0,f=t[o+2];if(e.next<0&&f>h&&t[c+f*3-3]==65535){o=t[c+f*3-1];continue e}for(;h<f;){let d=h+f>>1,p=c+d+(d<<1),x=t[p],S=t[p+1]||65536;if(u<x)f=d;else if(u>=S)h=d+1;else{o=t[p+2],e.advance();continue e}}break}}function cy(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function u3(t,e,n,r){let i=cy(n,r,e);return i<0||cy(n,r,t)<i}const zt=typeof process<"u"&&oy&&/\bparse\b/.test(oy.LOG);let af=null;function uy(t,e,n){let r=t.cursor(ve.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class h3{constructor(e,n){this.fragments=e,this.nodeSet=n,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?uy(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?uy(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 n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],o=this.start[n]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof Re){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(ce.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class f3{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new nc)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if(!(1<<c&o))continue;let u=s[c],h=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||h.start!=e.pos||h.mask!=o||h.context!=l)&&(this.updateCachedToken(h,u,e),h.mask=o,h.context=l),h.lookAhead>h.end+25&&(a=Math.max(h.lookAhead,a)),h.value!=0)){let f=n;if(h.extended>-1&&(n=this.addActions(e,h.extended,h.end,n)),n=this.addActions(e,h.value,h.end,n),!u.extend&&(r=h,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!r&&e.pos==this.stream.end&&(r=new nc,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new nc,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),r);if(l>=0&&r.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=ir(l,c+2);else{i==0&&l[c+1]==2&&(i=this.putAction(ir(l,c+2),n,r,i));break}l[c]==n&&(i=this.putAction(ir(l,c+1),n,r,i))}return i}}class d3{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,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 c3(n,i),this.tokens=new f3(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[lu.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new h3(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;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 l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)r.push(l);else{if(this.advanceStack(l,r,e))continue;{i||(i=[],s=[]),i.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!r.length){let o=i&&m3(i);if(o)return zt&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw zt&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return zt&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((l,a)=>a.score-l.score);r.length>o;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let l=r[o];for(let a=o+1;a<r.length;a++){let c=r[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)r.splice(a--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,l)=>l.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[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,n,r){let i=e.pos,{parser:s}=this,o=zt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!c||(h.prop(ce.contextHash)||0)==u))return e.useNode(h,f),zt&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof Re)||h.children.length==0||h.positions[0]>0)break;let d=h.children[0];if(d instanceof Re&&h.positions[0]==0)h=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),zt&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],h=a[c++],f=a[c++],d=c==a.length||!r,p=d?e:e.split(),x=this.tokens.mainToken;if(p.apply(u,h,x?x.start:p.pos,f),zt&&console.log(o+this.stackID(p)+` (via ${u&65536?`reduce of ${s.getName(u&65535)}`:"shift"} for ${s.getName(h)} @ ${i}${p==e?"":", split"})`),d)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return hy(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=zt?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),zt&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let h=l.split(),f=u;for(let d=0;d<10&&h.forceReduce()&&(zt&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));d++)zt&&(f=this.stackID(h)+" -> ");for(let d of l.recoverByInsert(a))zt&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,r);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),zt&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),hy(l,r)):(!i||i.score<h.score)&&(i=h)}return i}stackToTree(e){return e.close(),Re.build({buffer:au.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 n=(af||(af=new WeakMap)).get(e);return n||af.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function hy(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class p3{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const cf=t=>t;class rb{constructor(e){this.start=e.start,this.shift=e.shift||cf,this.reduce=e.reduce||cf,this.reuse=e.reuse||cf,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Zs extends U2{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let r=Object.keys(e.topRules).map(l=>e.topRules[l][1]),i=[];for(let l=0;l<n.length;l++)i.push([]);function s(l,a,c){i[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=ce[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let h=l[c+-u];for(let f=-u;f>0;f--)s(l[c++],a,h);c++}}}this.nodeSet=new rO(n.map((l,a)=>Qt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:i[a],top:r.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=I2;let o=Po(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(fy),this.states=Po(e.states,Uint32Array),this.data=Po(e.stateData),this.goto=Po(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new vs(o,l):l),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,n,r){let i=new d3(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],l=o&1,a=i[s++];if(l&&r)return a;for(let c=s+(o>>1);s<c;s++)if(i[s]==e)return a;if(l)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=ir(r,s+2)];else{if(r[s+1]==2)return ir(r,s+2);break}if(o==n||o==0)return ir(r,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ir(this.data,s+2);else break;i=n(ir(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ir(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Zs.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(l=>l.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=fy(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}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 n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[l]=1;return new p3(e,r,i)}static deserialize(e){return new Zs(e)}}function ir(t,e){return t[e]|t[e+1]<<16}function m3(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function fy(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const O3=55,g3=1,y3=56,x3=2,v3=57,S3=3,dy=4,w3=5,kO=6,ib=7,sb=8,ob=9,lb=10,k3=11,b3=12,P3=13,uf=58,Q3=14,$3=15,py=59,ab=21,T3=23,cb=24,C3=25,xp=27,ub=28,A3=29,M3=32,E3=35,R3=37,j3=38,Z3=0,V3=1,X3={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},L3={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},my={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function D3(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let Oy=null,gy=null,yy=0;function vp(t,e){let n=t.pos+e;if(yy==n&&gy==t)return Oy;let r=t.peek(e),i="";for(;D3(r);)i+=String.fromCharCode(r),r=t.peek(++e);return gy=t,yy=n,Oy=i?i.toLowerCase():r==_3||r==N3?void 0:null}const hb=60,uu=62,bO=47,_3=63,N3=33,z3=45;function xy(t,e){this.name=t,this.parent=e}const W3=[kO,lb,ib,sb,ob],I3=new rb({start:null,shift(t,e,n,r){return W3.indexOf(e)>-1?new xy(vp(r,1)||"",t):t},reduce(t,e){return e==ab&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==kO||i==R3?new xy(vp(r,1)||"",t):t},strict:!1}),B3=new Jt((t,e)=>{if(t.next!=hb){t.next<0&&e.context&&t.acceptToken(uf);return}t.advance();let n=t.next==bO;n&&t.advance();let r=vp(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?$3:Q3);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(k3);if(i&&L3[i])return t.acceptToken(uf,-2);if(e.dialectEnabled(Z3))return t.acceptToken(b3);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(P3)}else{if(r=="script")return t.acceptToken(ib);if(r=="style")return t.acceptToken(sb);if(r=="textarea")return t.acceptToken(ob);if(X3.hasOwnProperty(r))return t.acceptToken(lb);i&&my[i]&&my[i][r]?t.acceptToken(uf,-1):t.acceptToken(kO)}},{contextual:!0}),Y3=new Jt(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(py);break}if(t.next==z3)e++;else if(t.next==uu&&e>=2){n>=3&&t.acceptToken(py,-2);break}else e=0;t.advance()}});function F3(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const q3=new Jt((t,e)=>{if(t.next==bO&&t.peek(1)==uu){let n=e.dialectEnabled(V3)||F3(e.context);t.acceptToken(n?w3:dy,2)}else t.next==uu&&t.acceptToken(dy,1)});function PO(t,e,n){let r=2+t.length;return new Jt(i=>{for(let s=0,o=0,l=0;;l++){if(i.next<0){l&&i.acceptToken(e);break}if(s==0&&i.next==hb||s==1&&i.next==bO||s>=2&&s<r&&i.next==t.charCodeAt(s-2))s++,o++;else if(s==r&&i.next==uu){l>o?i.acceptToken(e,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&l){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const U3=PO("script",O3,g3),G3=PO("style",y3,x3),H3=PO("textarea",v3,S3),K3=Bu({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),J3=Zs.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G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!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:I3,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[K3],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^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});function fb(t,e){let n=Object.create(null);for(let r of t.getChildren(cb)){let i=r.getChild(C3),s=r.getChild(xp)||r.getChild(ub);i&&(n[e.read(i.from,i.to)]=s?s.type.id==xp?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function vy(t,e){let n=t.getChild(T3);return n?e.read(n.from,n.to):" "}function hf(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=fb(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function db(t=[],e=[]){let n=[],r=[],i=[],s=[];for(let l of t)(l.tag=="script"?n:l.tag=="style"?r:l.tag=="textarea"?i:s).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return Z6((l,a)=>{let c=l.type.id;if(c==A3)return hf(l,a,n);if(c==M3)return hf(l,a,r);if(c==E3)return hf(l,a,i);if(c==ab&&s.length){let u=l.node,h=u.firstChild,f=h&&vy(h,a),d;if(f){for(let p of s)if(p.tag==f&&(!p.attrs||p.attrs(d||(d=fb(h,a))))){let x=u.lastChild,S=x.type.id==j3?x.from:u.to;if(S>h.to)return{parser:p.parser,overlay:[{from:h.to,to:S}]}}}}if(o&&c==cb){let u=l.node,h;if(h=u.firstChild){let f=o[a.read(h.from,h.to)];if(f)for(let d of f){if(d.tagName&&d.tagName!=vy(u.parent,a))continue;let p=u.lastChild;if(p.type.id==xp){let x=p.from+1,S=p.lastChild,O=p.to-(S&&S.isError?0:1);if(O>x)return{parser:d.parser,overlay:[{from:x,to:O}],bracketed:!0}}else if(p.type.id==ub)return{parser:d.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const eE=132,Sy=1,tE=133,nE=134,pb=2,rE=135,iE=3,sE=4,mb=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],oE=58,lE=40,Ob=95,aE=91,rc=45,cE=46,uE=35,hE=37,fE=38,dE=92,pE=10,mE=42;function wl(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function QO(t){return t>=48&&t<=57}function wy(t){return QO(t)||t>=97&&t<=102||t>=65&&t<=70}const gb=(t,e,n)=>(r,i)=>{for(let s=!1,o=0,l=0;;l++){let{next:a}=r;if(wl(a)||a==rc||a==Ob||s&&QO(a))!s&&(a!=rc||l>0)&&(s=!0),o===l&&a==rc&&o++,r.advance();else if(a==dE&&r.peek(1)!=pE){if(r.advance(),wy(r.next)){do r.advance();while(wy(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(o==2&&i.canShift(pb)?e:a==lE?n:t);break}}},OE=new Jt(gb(tE,pb,nE),{contextual:!0}),gE=new Jt(gb(rE,iE,sE),{contextual:!0}),yE=new Jt(t=>{if(mb.includes(t.peek(-1))){let{next:e}=t;(wl(e)||e==Ob||e==uE||e==cE||e==mE||e==aE||e==oE&&wl(t.peek(1))||e==rc||e==fE)&&t.acceptToken(eE)}}),xE=new Jt(t=>{if(!mb.includes(t.peek(-1))){let{next:e}=t;if(e==hE&&(t.advance(),t.acceptToken(Sy)),wl(e)){do t.advance();while(wl(t.next)||QO(t.next));t.acceptToken(Sy)}}}),vE=Bu({"AtKeyword import charset namespace keyframes media supports font-feature-values":b.definitionKeyword,"from to selector scope MatchFlag":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName FontName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,"MatchOp CompareOp":b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; , |":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),SE={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},wE={__proto__:null,or:104,and:104,not:112,only:112,layer:180},kE={__proto__:null,selector:118,layer:176},bE={__proto__:null,"@import":172,"@media":184,"@charset":188,"@namespace":192,"@keyframes":198,"@supports":210,"@scope":214,"@font-feature-values":220},PE={__proto__:null,to:217},QE=Zs.deserialize({version:14,states:"HhQYQdOOO#wQdOOP$OO`OOO$xQaO'#CfOOQP'#Ce'#CeO%PQ`O'#CgO%UQdO'#CkO%uQaO'#CcO&PQdO'#CnO&[QdO'#DtO&aQdO'#DvO&fQdO'#DzO&fQdO'#D}OOQP'#Fa'#FaO'rQhO'#EpOOQS'#F`'#F`OOQS'#Es'#EsQYQdOOO'yQdO'#ETO)VQhO'#EZO'yQdO'#E]O)^QdO'#E_O)iQdO'#EbO(nQhO'#EhO)qQdO'#EjO)|QdO'#EmO*RQaO'#CfO*YQ`O'#EQO*_Q`O'#FkO*jQdO'#FkQOQ`OOP*tO&jO'#CaPOOO)CAO)CAOO+PQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO%UQdO,59VO+UQdO,59YO&[QdO,5:`O&aQdO,5:bO&fQdO,5:fO&fQdO,5:hO&fQdO,5:iO&fQdO'#EzO+aQ`O,58}O+iQdO'#EPOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO+pQ`O,59YO+uQ`O,59YOOQP'#Du'#DuOOQP,5:`,5:`OOQO'#Dw'#DwO+zQpO,5:bO,eQaO,5:fO,{QaO,5:iOOQW'#D^'#D^O-wQhO'#DgO.[QhO,5;[O(nQhO'#DeO.iQ`O'#DkO.nQhO'#DnOOQW'#Fg'#FgOOQS,5;[,5;[O.sQ`O'#DhOO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comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:156,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[vE],skippedNodes:[0,5,114],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$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T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$`Q!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$UQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!rQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[yE,xE,OE,gE,1,2,3,4,new cu("m~RRYZ[z{a~~g~aO$Q~~dP!P!Qg~lO$R~~",28,139)],topRules:{StyleSheet:[0,6],Styles:[1,113]},dynamicPrecedences:{81:1},specialized:[{term:134,get:t=>SE[t]||-1},{term:135,get:t=>wE[t]||-1},{term:4,get:t=>kE[t]||-1},{term:28,get:t=>bE[t]||-1},{term:133,get:t=>PE[t]||-1}],tokenPrec:2182});let ff=null;function df(){if(!ff&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));ff=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return ff||[]}const ky=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),by=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),$E=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),TE=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),tr=/^(\w[\w-]*|-\w[\w-]*|)$/,CE=/^-(-[\w-]*)?$/;function AE(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const Py=new q2,ME=["Declaration"];function EE(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function yb(t,e,n){if(e.to-e.from>4096){let r=Py.get(e);if(r)return r;let i=[],s=new Set,o=e.cursor(ve.IncludeAnonymous);if(o.firstChild())do for(let l of yb(t,o.node,n))s.has(l.label)||(s.add(l.label),i.push(l));while(o.nextSibling());return Py.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(ME)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(s.from,s.to);i.has(l)||(i.add(l),r.push({label:l,type:"variable"}))}}),r}}const RE=t=>e=>{let{state:n,pos:r}=e,i=Ie(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:df(),validFor:tr};if(i.name=="ValueName")return{from:i.from,options:by,validFor:tr};if(i.name=="PseudoClassName")return{from:i.from,options:ky,validFor:tr};if(t(i)||(e.explicit||s)&&AE(i,n.doc))return{from:t(i)||s?i.from:r,options:yb(n.doc,EE(i),t),validFor:CE};if(i.name=="TagName"){for(let{parent:a}=i;a;a=a.parent)if(a.name=="Block")return{from:i.from,options:df(),validFor:tr};return{from:i.from,options:$E,validFor:tr}}if(i.name=="AtKeyword")return{from:i.from,options:TE,validFor:tr};if(!e.explicit)return null;let o=i.resolve(r),l=o.childBefore(r);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:ky,validFor:tr}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:by,validFor:tr}:o.name=="Block"||o.name=="Styles"?{from:r,options:df(),validFor:tr}:null},jE=RE(t=>t.name=="VariableName"),hu=Es.define({name:"css",parser:QE.configure({props:[qu.add({Declaration:ec()}),Uu.add({"Block KeyframeList":nk})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function xb(){return new aO(hu,hu.data.of({autocomplete:jE}))}const ZE=316,VE=317,Qy=1,XE=2,LE=3,DE=4,_E=318,NE=320,zE=321,WE=5,IE=6,BE=0,Sp=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],vb=125,YE=59,wp=47,FE=42,qE=43,UE=45,GE=60,HE=44,KE=63,JE=46,eR=91,tR=new rb({start:!1,shift(t,e){return e==WE||e==IE||e==NE?t:e==zE},strict:!1}),nR=new Jt((t,e)=>{let{next:n}=t;(n==vb||n==-1||e.context)&&t.acceptToken(_E)},{contextual:!0,fallback:!0}),rR=new Jt((t,e)=>{let{next:n}=t,r;Sp.indexOf(n)>-1||n==wp&&((r=t.peek(1))==wp||r==FE)||n!=vb&&n!=YE&&n!=-1&&!e.context&&t.acceptToken(ZE)},{contextual:!0}),iR=new Jt((t,e)=>{t.next==eR&&!e.context&&t.acceptToken(VE)},{contextual:!0}),sR=new Jt((t,e)=>{let{next:n}=t;if(n==qE||n==UE){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(Qy);t.acceptToken(r?Qy:XE)}}else n==KE&&t.peek(1)==JE&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(LE))},{contextual:!0});function pf(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const oR=new Jt((t,e)=>{if(t.next!=GE||!e.dialectEnabled(BE)||(t.advance(),t.next==wp))return;let n=0;for(;Sp.indexOf(t.next)>-1;)t.advance(),n++;if(pf(t.next,!0)){for(t.advance(),n++;pf(t.next,!1);)t.advance(),n++;for(;Sp.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==HE)return;for(let r=0;;r++){if(r==7){if(!pf(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(DE,-n)}),lR=Bu({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case defer":b.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),"NewExpression/VariableName":b.className,PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer asserts":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),aR={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},cR={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},uR={__proto__:null,"<":193},hR=Zs.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O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U3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:tR,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,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!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new cu("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>aR[t]||-1},{term:343,get:t=>cR[t]||-1},{term:95,get:t=>uR[t]||-1}],tokenPrec:15201}),Sb=[Ct("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ct("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ct("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ct("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ct("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ct(`try {
|
|
65
|
+
\${}
|
|
66
|
+
} catch (\${error}) {
|
|
67
|
+
\${}
|
|
68
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Ct("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Ct(`if (\${}) {
|
|
69
|
+
\${}
|
|
70
|
+
} else {
|
|
71
|
+
\${}
|
|
72
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Ct(`class \${name} {
|
|
73
|
+
constructor(\${params}) {
|
|
74
|
+
\${}
|
|
75
|
+
}
|
|
76
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Ct('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ct('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],fR=Sb.concat([Ct("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ct("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ct("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$y=new q2,wb=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Oo(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const dR=["FunctionDeclaration"],pR={FunctionDeclaration:Oo("function"),ClassDeclaration:Oo("class"),ClassExpression:()=>!0,EnumDeclaration:Oo("constant"),TypeAliasDeclaration:Oo("type"),NamespaceDeclaration:Oo("namespace"),VariableDefinition(t,e){t.matchContext(dR)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function kb(t,e){let n=$y.get(e);if(n)return n;let r=[],i=!0;function s(o,l){let a=t.sliceString(o.from,o.to);r.push({label:a,type:l})}return e.cursor(ve.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let l=pR[o.name];if(l&&l(o,s)||wb.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of kb(t,o.node))r.push(l);return!1}}),$y.set(e,r),r}const Ty=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,bb=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function mR(t){let e=Ie(t.state).resolveInner(t.pos,-1);if(bb.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Ty.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)wb.has(i.name)&&(r=r.concat(kb(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:Ty}}const Hn=Es.define({name:"javascript",parser:hR.configure({props:[qu.add({IfStatement:ec({except:/^\s*({|else\b)/}),TryStatement:ec({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:oA,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:sA({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":ec({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Uu.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":nk,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Pb={test:t=>/^JSX/.test(t.name),facet:K2({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Qb=Hn.configure({dialect:"ts"},"typescript"),$b=Hn.configure({dialect:"jsx",props:[lO.add(t=>t.isTop?[Pb]:void 0)]}),Tb=Hn.configure({dialect:"jsx ts",props:[lO.add(t=>t.isTop?[Pb]:void 0)]},"typescript");let Cb=t=>({label:t,type:"keyword"});const Ab="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Cb),OR=Ab.concat(["declare","implements","private","protected","public"].map(Cb));function Mb(t={}){let e=t.jsx?t.typescript?Tb:$b:t.typescript?Qb:Hn,n=t.typescript?fR.concat(OR):Sb.concat(Ab);return new aO(e,[Hn.data.of({autocomplete:H8(bb,G8(n))}),Hn.data.of({autocomplete:mR}),t.jsx?xR:[]])}function gR(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function Cy(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const yR=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),xR=H.inputHandler.of((t,e,n,r,i)=>{if((yR?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Hn.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,l=o.changeByRange(a=>{var c;let{head:u}=a,h=Ie(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=r||h.name=="JSXAttributeValue"&&h.to>u)){if(r==">"&&h.name=="JSXFragmentTag")return{range:a,changes:{from:u,insert:"</>"}};if(r=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,p=d.parent;if(p&&d.from==u-2&&((f=Cy(o.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let x=`${f}>`;return{range:R.cursor(u+x.length,-1),changes:{from:u,insert:x}}}}else if(r==">"){let d=gR(h);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=Cy(o.doc,d,u)))return{range:a,changes:{from:u,insert:`</${f}>`}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),go=["_blank","_self","_top","_parent"],mf=["ascii","utf-8","utf-16","latin1","latin1"],Of=["get","post","put","delete"],gf=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Wt=["true","false"],ee={},vR={a:{attrs:{href:null,ping:null,type:null,media:null,target:go,hreflang:null}},abbr:ee,address:ee,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:ee,aside:ee,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:ee,base:{attrs:{href:null,target:go}},bdi:ee,bdo:ee,blockquote:{attrs:{cite:null}},body:ee,br:ee,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:gf,formmethod:Of,formnovalidate:["novalidate"],formtarget:go,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:ee,center:ee,cite:ee,code:ee,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:ee,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:ee,div:ee,dl:ee,dt:ee,em:ee,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:ee,figure:ee,footer:ee,form:{attrs:{action:null,name:null,"accept-charset":mf,autocomplete:["on","off"],enctype:gf,method:Of,novalidate:["novalidate"],target:go}},h1:ee,h2:ee,h3:ee,h4:ee,h5:ee,h6:ee,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:ee,hgroup:ee,hr:ee,html:{attrs:{manifest:null}},i:ee,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:gf,formmethod:Of,formnovalidate:["novalidate"],formtarget:go,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:ee,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:ee,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:ee,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mf,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:ee,noscript:ee,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:ee,param:{attrs:{name:null,value:null}},pre:ee,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:ee,rt:ee,ruby:ee,samp:ee,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mf}},section:ee,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:ee,source:{attrs:{src:null,type:null,media:null}},span:ee,strong:ee,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:ee,summary:ee,sup:ee,table:ee,tbody:ee,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:ee,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:ee,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:ee,time:{attrs:{datetime:null}},title:ee,tr:ee,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:ee,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:ee},Eb={accesskey:null,class:null,contenteditable:Wt,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Wt,autocorrect:Wt,autocapitalize:Wt,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Wt,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Wt,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Wt,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Wt,"aria-hidden":Wt,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Wt,"aria-multiselectable":Wt,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Wt,"aria-relevant":null,"aria-required":Wt,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Rb="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of Rb)Eb[t]=null;class fu{constructor(e,n){this.tags={...vR,...e},this.globalAttrs={...Eb,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}fu.default=new fu;function Vs(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Xs(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function jb(t,e,n){let r=n.tags[Vs(t,Xs(e))];return(r==null?void 0:r.children)||n.allTags}function $O(t,e){let n=[];for(let r=Xs(e);r&&!r.type.isTop;r=Xs(r.parent)){let i=Vs(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const Zb=/^[:\-\.\w\u00b7-\uffff]*$/;function Ay(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=Xs(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:jb(t.doc,o,e).map(l=>({label:l,type:"type"})).concat($O(t.doc,n).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function My(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:$O(t.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:Zb}}function SR(t,e,n,r){let i=[],s=0;for(let o of jb(t.doc,n,e))i.push({label:"<"+o,type:"type"});for(let o of $O(t.doc,n))i.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function wR(t,e,n,r,i){let s=Xs(n),o=s?e.tags[Vs(t.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:a.map(c=>({label:c,type:"property"})),validFor:Zb}}function kR(t,e,n,r,i){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let c=t.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=Xs(n),f=h?e.tags[Vs(t.doc,h)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[c]}if(u){let h=t.sliceDoc(r,i).toLowerCase(),f='"',d='"';/^['"]/.test(h)?(a=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=t.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),r++):a=/^[^\s<>='"]*$/;for(let p of u)l.push({label:p,apply:f+p+d,type:"constant"})}}return{from:r,to:i,options:l,validFor:a}}function bR(t,e){let{state:n,pos:r}=e,i=Ie(n).resolveInner(r,-1),s=i.resolve(r);for(let o=r,l;s==i&&(l=i.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.from<a.to)break;s=i=l,o=a.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?My(n,i,i.from,r):Ay(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?Ay(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?My(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?wR(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?kR(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?SR(n,t,i,r):null}function PR(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new fu(e,n):fu.default;return i=>bR(r,i)}const QR=Hn.parser.configure({top:"SingleExpression"}),Vb=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:Qb.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:$b.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:Tb.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:QR},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:Hn.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:hu.parser}],Xb=[{name:"style",parser:hu.parser.configure({top:"Styles"})}].concat(Rb.map(t=>({name:t,parser:Hn.parser}))),Lb=Es.define({name:"html",parser:J3.configure({props:[qu.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),Uu.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),uk.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),ic=Lb.configure({wrap:db(Vb,Xb)});function Ey(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=db((t.nestedLanguages||[]).concat(Vb),(t.nestedAttributes||[]).concat(Xb)));let r=n?Lb.configure({wrap:n,dialect:e}):e?ic.configure({dialect:e}):ic;return new aO(r,[ic.data.of({autocomplete:PR(t)}),t.autoCloseTags!==!1?$R:[],Mb().support,xb().support])}const Ry=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),$R=H.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!ic.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,l=o.changeByRange(a=>{var c,u,h;let f=o.doc.sliceString(a.from-1,a.to)==r,{head:d}=a,p=Ie(o).resolveInner(d,-1),x;if(f&&r==">"&&p.name=="EndTag"){let S=p.parent;if(((u=(c=S.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(x=Vs(o.doc,S.parent,d))&&!Ry.has(x)){let O=d+(o.doc.sliceString(d,d+1)===">"?1:0),y=`</${x}>`;return{range:a,changes:{from:d,to:O,insert:y}}}}else if(f&&r=="/"&&p.name=="IncompleteCloseTag"){let S=p.parent;if(p.from==d-2&&((h=S.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(x=Vs(o.doc,S,d))&&!Ry.has(x)){let O=d+(o.doc.sliceString(d,d+1)===">"?1:0),y=`${x}>`;return{range:R.cursor(d+y.length,-1),changes:{from:d,to:O,insert:y}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function TR(t){switch(t){case"html":return Ey();case"css":return xb();case"javascript":case"js":case"typescript":case"ts":return Mb({typescript:t==="typescript"||t==="ts"});default:return Ey()}}function CR(t){var r;const e=((r=t.split(".").pop())==null?void 0:r.toLowerCase())??"";return{html:"html",htm:"html",css:"css",js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",json:"javascript"}[e]??"html"}const AR=m.memo(function({content:e,filePath:n,language:r,onChange:i,readOnly:s=!1}){const o=m.useRef(null),l=m.useRef(null),a=m.useRef(i);a.current=i;const c=m.useCallback(u=>{if(o.current&&(o.current.destroy(),o.current=null),!u)return;l.current=u;const h=r??(n?CR(n):"html"),f=H.updateListener.of(p=>{p.docChanged&&a.current&&a.current(p.state.doc.toString())}),d=ge.create({doc:e,extensions:[b6(),u6(),$6(),IA(),gA(),aA(),CA(),hM(),QM(),nO.of([...mM,...q8,...FM,...JA]),TR(h),l3,f,ge.readOnly.of(s),H.theme({"&":{height:"100%"},".cm-scroller":{overflow:"auto"}})]});o.current=new H({state:d,parent:u})},[e,n,r,s]);return g.jsx("div",{ref:c,className:"h-full w-full overflow-hidden"})}),Vi=t=>({title:n,...r})=>g.jsx(t,{alt:n,"aria-label":n,"aria-hidden":n?void 0:!0,...r}),zi=Vi(z5),Ta=Vi(W5),yf=Vi(I5),Li=Vi(B5),Ca=Vi(Y5),MR=Vi(N5),ER=Vi(Ow),RR={html:{icon:Ta,color:"#3B82F6"},css:{icon:Ta,color:"#A855F7"},js:{icon:Ta,color:"#F59E0B"},ts:{icon:Ta,color:"#3B82F6"},json:{icon:zi,color:"#22C55E"},md:{icon:zi,color:"#737373"},png:{icon:Li,color:"#22C55E"},jpg:{icon:Li,color:"#22C55E"},jpeg:{icon:Li,color:"#22C55E"},webp:{icon:Li,color:"#22C55E"},gif:{icon:Li,color:"#22C55E"},svg:{icon:Li,color:"#F97316"},mp4:{icon:yf,color:"#A855F7"},webm:{icon:yf,color:"#A855F7"},mov:{icon:yf,color:"#A855F7"},mp3:{icon:Ca,color:"#F59E0B"},wav:{icon:Ca,color:"#F59E0B"},ogg:{icon:Ca,color:"#F59E0B"},m4a:{icon:Ca,color:"#F59E0B"},woff:{icon:zi,color:"#525252"},woff2:{icon:zi,color:"#525252"},ttf:{icon:zi,color:"#525252"}};function jR(t){var n;const e=((n=t.split(".").pop())==null?void 0:n.toLowerCase())??"";return RR[e]??{icon:zi,color:"#737373"}}function ZR(t){const e={name:"",fullPath:"",children:new Map,isFile:!1};for(const n of t){const r=n.split("/");let i=e;for(let s=0;s<r.length;s++){const o=r[s],l=s===r.length-1,a=r.slice(0,s+1).join("/");i.children.has(o)||i.children.set(o,{name:o,fullPath:a,children:new Map,isFile:l}),i=i.children.get(o),l&&(i.isFile=!0)}}return e}function Db(t){return Array.from(t.values()).sort((e,n)=>e.name==="index.html"?-1:n.name==="index.html"?1:!e.isFile&&n.isFile?-1:e.isFile&&!n.isFile?1:e.name.localeCompare(n.name))}function _b({node:t,depth:e,activeFile:n,onSelectFile:r,defaultOpen:i}){const[s,o]=m.useState(i),l=m.useCallback(()=>o(u=>!u),[]),a=Db(t.children),c=s?MR:ER;return g.jsxs(g.Fragment,{children:[g.jsxs("button",{onClick:l,className:"w-full flex items-center gap-1.5 px-2.5 py-1 min-h-7 text-left text-xs text-neutral-400 hover:bg-neutral-800/30 hover:text-neutral-300 transition-colors",style:{paddingLeft:`${8+e*12}px`},children:[g.jsx(c,{size:10,className:"flex-shrink-0 text-neutral-600"}),g.jsx("span",{className:"truncate font-medium",children:t.name})]}),s&&a.map(u=>u.isFile&&u.children.size===0?g.jsx(kp,{node:u,depth:e+1,activeFile:n,onSelectFile:r},u.fullPath):u.children.size>0?g.jsx(_b,{node:u,depth:e+1,activeFile:n,onSelectFile:r,defaultOpen:TO(u,n)},u.fullPath):g.jsx(kp,{node:u,depth:e+1,activeFile:n,onSelectFile:r},u.fullPath))]})}function kp({node:t,depth:e,activeFile:n,onSelectFile:r}){const{icon:i,color:s}=jR(t.name),o=t.fullPath===n;return g.jsxs("button",{onClick:()=>r(t.fullPath),className:`w-full flex items-center gap-2 py-1 min-h-7 text-left transition-all text-xs ${o?"bg-neutral-800/60 text-neutral-200":"text-neutral-500 hover:bg-neutral-800/30 hover:text-neutral-300"}`,style:{paddingLeft:`${8+e*12+14}px`},children:[g.jsx(i,{size:12,style:{color:s},className:"flex-shrink-0"}),g.jsx("span",{className:"truncate",children:t.name})]})}function TO(t,e){if(!e)return!1;if(t.fullPath===e)return!0;for(const n of t.children.values())if(TO(n,e))return!0;return!1}const VR=m.memo(function({files:e,activeFile:n,onSelectFile:r}){const i=ZR(e),s=Db(i.children);return g.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[g.jsx("div",{className:"px-2.5 py-1.5 border-b border-neutral-800 flex-shrink-0",children:g.jsx("span",{className:"text-2xs font-medium text-neutral-500 uppercase tracking-caps",children:"Files"})}),g.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:s.map(o=>o.isFile&&o.children.size===0?g.jsx(kp,{node:o,depth:0,activeFile:n,onSelectFile:r},o.fullPath):g.jsx(_b,{node:o,depth:0,activeFile:n,onSelectFile:r,defaultOpen:TO(o,n)},o.fullPath))})]})}),CO=m.createContext({});function AO(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const XR=typeof window<"u",Nb=XR?m.useLayoutEffect:m.useEffect,nh=m.createContext(null);function MO(t,e){t.indexOf(e)===-1&&t.push(e)}function du(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Jn=(t,e,n)=>n>e?e:n<t?t:n;let EO=()=>{};const Gr={},zb=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Wb(t){return typeof t=="object"&&t!==null}const Ib=t=>/^0[^.\s]+$/u.test(t);function Bb(t){let e;return()=>(e===void 0&&(e=t()),e)}const un=t=>t,LR=(t,e)=>n=>e(t(n)),_l=(...t)=>t.reduce(LR),kl=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class RO{constructor(){this.subscriptions=[]}add(e){return MO(this.subscriptions,e),()=>du(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qt=t=>t*1e3,an=t=>t/1e3;function Yb(t,e){return e?t*(1e3/e):0}const Fb=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,DR=1e-7,_R=12;function NR(t,e,n,r,i){let s,o,l=0;do o=e+(n-e)/2,s=Fb(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>DR&&++l<_R);return o}function Nl(t,e,n,r){if(t===e&&n===r)return un;const i=s=>NR(s,0,1,t,n);return s=>s===0||s===1?s:Fb(i(s),e,r)}const qb=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ub=t=>e=>1-t(1-e),Gb=Nl(.33,1.53,.69,.99),jO=Ub(Gb),Hb=qb(jO),Kb=t=>t>=1?1:(t*=2)<1?.5*jO(t):.5*(2-Math.pow(2,-10*(t-1))),ZO=t=>1-Math.sin(Math.acos(t)),Jb=Ub(ZO),eP=qb(ZO),zR=Nl(.42,0,1,1),WR=Nl(0,0,.58,1),tP=Nl(.42,0,.58,1),IR=t=>Array.isArray(t)&&typeof t[0]!="number",nP=t=>Array.isArray(t)&&typeof t[0]=="number",BR={linear:un,easeIn:zR,easeInOut:tP,easeOut:WR,circIn:ZO,circInOut:eP,circOut:Jb,backIn:jO,backInOut:Hb,backOut:Gb,anticipate:Kb},YR=t=>typeof t=="string",jy=t=>{if(nP(t)){EO(t.length===4);const[e,n,r,i]=t;return Nl(e,n,r,i)}else if(YR(t))return BR[t];return t},Aa=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function FR(t,e){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function a(u){o.has(u)&&(c.schedule(u),t()),u(l)}const c={schedule:(u,h=!1,f=!1)=>{const p=f&&i?n:r;return h&&o.add(u),p.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(l=u,i){s=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(a),n.clear(),i=!1,s&&(s=!1,c.process(u))}};return c}const qR=40;function rP(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Aa.reduce((v,w)=>(v[w]=FR(s),v),{}),{setup:l,read:a,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:p}=o,x=()=>{const v=Gr.useManualTiming,w=v?i.timestamp:performance.now();n=!1,v||(i.delta=r?1e3/60:Math.max(Math.min(w-i.timestamp,qR),1)),i.timestamp=w,i.isProcessing=!0,l.process(i),a.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(x))},S=()=>{n=!0,r=!0,i.isProcessing||t(x)};return{schedule:Aa.reduce((v,w)=>{const k=o[w];return v[w]=($,P=!1,Q=!1)=>(n||S(),k.schedule($,P,Q)),v},{}),cancel:v=>{for(let w=0;w<Aa.length;w++)o[Aa[w]].cancel(v)},state:i,steps:o}}const{schedule:ke,cancel:Hr,state:it,steps:xf}=rP(typeof requestAnimationFrame<"u"?requestAnimationFrame:un,!0);let sc;function UR(){sc=void 0}const wt={now:()=>(sc===void 0&&wt.set(it.isProcessing||Gr.useManualTiming?it.timestamp:performance.now()),sc),set:t=>{sc=t,queueMicrotask(UR)}},iP=t=>e=>typeof e=="string"&&e.startsWith(t),sP=iP("--"),GR=iP("var(--"),VO=t=>GR(t)?HR.test(t.split("/*")[0].trim()):!1,HR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Zy(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Us={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},bl={...Us,transform:t=>Jn(0,1,t)},Ma={...Us,default:1},zo=t=>Math.round(t*1e5)/1e5,XO=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function KR(t){return t==null}const JR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,LO=(t,e)=>n=>!!(typeof n=="string"&&JR.test(n)&&n.startsWith(t)||e&&!KR(n)&&Object.prototype.hasOwnProperty.call(n,e)),oP=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,l]=r.match(XO);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},ej=t=>Jn(0,255,t),vf={...Us,transform:t=>Math.round(ej(t))},gi={test:LO("rgb","red"),parse:oP("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+vf.transform(t)+", "+vf.transform(e)+", "+vf.transform(n)+", "+zo(bl.transform(r))+")"};function tj(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const bp={test:LO("#"),parse:tj,transform:gi.transform},zl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),vr=zl("deg"),Kn=zl("%"),U=zl("px"),nj=zl("vh"),rj=zl("vw"),Vy={...Kn,parse:t=>Kn.parse(t)/100,transform:t=>Kn.transform(t*100)},ss={test:LO("hsl","hue"),parse:oP("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Kn.transform(zo(e))+", "+Kn.transform(zo(n))+", "+zo(bl.transform(r))+")"},Be={test:t=>gi.test(t)||bp.test(t)||ss.test(t),parse:t=>gi.test(t)?gi.parse(t):ss.test(t)?ss.parse(t):bp.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?gi.transform(t):ss.transform(t),getAnimatableNone:t=>{const e=Be.parse(t);return e.alpha=0,Be.transform(e)}},ij=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sj(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(XO))==null?void 0:e.length)||0)+(((n=t.match(ij))==null?void 0:n.length)||0)>0}const lP="number",aP="color",oj="var",lj="var(",Xy="${}",aj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ls(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const l=e.replace(aj,a=>(Be.test(a)?(r.color.push(s),i.push(aP),n.push(Be.parse(a))):a.startsWith(lj)?(r.var.push(s),i.push(oj),n.push(a)):(r.number.push(s),i.push(lP),n.push(parseFloat(a))),++s,Xy)).split(Xy);return{values:n,split:l,indexes:r,types:i}}function cj(t){return Ls(t).values}function cP({split:t,types:e}){const n=t.length;return r=>{let i="";for(let s=0;s<n;s++)if(i+=t[s],r[s]!==void 0){const o=e[s];o===lP?i+=zo(r[s]):o===aP?i+=Be.transform(r[s]):i+=r[s]}return i}}function uj(t){return cP(Ls(t))}const hj=t=>typeof t=="number"?0:Be.test(t)?Be.getAnimatableNone(t):t,fj=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:hj(t);function dj(t){const e=Ls(t);return cP(e)(e.values.map((r,i)=>fj(r,e.split[i])))}const Qn={test:sj,parse:cj,createTransformer:uj,getAnimatableNone:dj};function Sf(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function pj({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,a=2*n-l;i=Sf(a,l,t+1/3),s=Sf(a,l,t),o=Sf(a,l,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function pu(t,e){return n=>n>0?e:t}const Ce=(t,e,n)=>t+(e-t)*n,wf=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},mj=[bp,gi,ss],Oj=t=>mj.find(e=>e.test(t));function Ly(t){const e=Oj(t);if(!e)return!1;let n=e.parse(t);return e===ss&&(n=pj(n)),n}const Dy=(t,e)=>{const n=Ly(t),r=Ly(e);if(!n||!r)return pu(t,e);const i={...n};return s=>(i.red=wf(n.red,r.red,s),i.green=wf(n.green,r.green,s),i.blue=wf(n.blue,r.blue,s),i.alpha=Ce(n.alpha,r.alpha,s),gi.transform(i))},Pp=new Set(["none","hidden"]);function gj(t,e){return Pp.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function yj(t,e){return n=>Ce(t,e,n)}function DO(t){return typeof t=="number"?yj:typeof t=="string"?VO(t)?pu:Be.test(t)?Dy:Sj:Array.isArray(t)?uP:typeof t=="object"?Be.test(t)?Dy:xj:pu}function uP(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>DO(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function xj(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=DO(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function vj(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],o=t.indexes[s][r[s]],l=t.values[o]??0;n[i]=l,r[s]++}return n}const Sj=(t,e)=>{const n=Qn.createTransformer(e),r=Ls(t),i=Ls(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Pp.has(t)&&!i.values.length||Pp.has(e)&&!r.values.length?gj(t,e):_l(uP(vj(r,i),i.values),n):pu(t,e)};function hP(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Ce(t,e,n):DO(t)(t,e)}const wj=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ke.update(e,n),stop:()=>Hr(e),now:()=>it.isProcessing?it.timestamp:wt.now()}},fP=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},mu=2e4;function _O(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<mu;)e+=n,r=t.next(e);return e>=mu?1/0:e}function kj(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(_O(r),mu);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:an(i)}}const Le={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Qp(t,e){return t*Math.sqrt(1-e*e)}const bj=12;function Pj(t,e,n){let r=n;for(let i=1;i<bj;i++)r=r-t(r)/e(r);return r}const kf=.001;function Qj({duration:t=Le.duration,bounce:e=Le.bounce,velocity:n=Le.velocity,mass:r=Le.mass}){let i,s,o=1-e;o=Jn(Le.minDamping,Le.maxDamping,o),t=Jn(Le.minDuration,Le.maxDuration,an(t)),o<1?(i=c=>{const u=c*o,h=u*t,f=u-n,d=Qp(c,o),p=Math.exp(-h);return kf-f/d*p},s=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),x=Qp(Math.pow(c,2),o);return(-i(c)+kf>0?-1:1)*((f-d)*p)/x}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-kf+u*h},s=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const l=5/t,a=Pj(i,s,l);if(t=qt(t),isNaN(a))return{stiffness:Le.stiffness,damping:Le.damping,duration:t};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:t}}}const $j=["duration","bounce"],Tj=["stiffness","damping","mass"];function _y(t,e){return e.some(n=>t[n]!==void 0)}function Cj(t){let e={velocity:Le.velocity,stiffness:Le.stiffness,damping:Le.damping,mass:Le.mass,isResolvedFromDuration:!1,...t};if(!_y(t,Tj)&&_y(t,$j))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Jn(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Le.mass,stiffness:i,damping:s}}else{const n=Qj({...t,velocity:0});e={...e,...n,mass:Le.mass},e.isResolvedFromDuration=!0}return e}function Ou(t=Le.visualDuration,e=Le.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:a,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=Cj({...n,velocity:-an(n.velocity||0)}),p=f||0,x=c/(2*Math.sqrt(a*u)),S=o-s,O=an(Math.sqrt(a/u)),y=Math.abs(S)<5;r||(r=y?Le.restSpeed.granular:Le.restSpeed.default),i||(i=y?Le.restDelta.granular:Le.restDelta.default);let v,w,k,$,P,Q;if(x<1)k=Qp(O,x),$=(p+x*O*S)/k,v=T=>{const V=Math.exp(-x*O*T);return o-V*($*Math.sin(k*T)+S*Math.cos(k*T))},P=x*O*$+S*k,Q=x*O*S-$*k,w=T=>Math.exp(-x*O*T)*(P*Math.sin(k*T)+Q*Math.cos(k*T));else if(x===1){v=V=>o-Math.exp(-O*V)*(S+(p+O*S)*V);const T=p+O*S;w=V=>Math.exp(-O*V)*(O*T*V-p)}else{const T=O*Math.sqrt(x*x-1);v=N=>{const _=Math.exp(-x*O*N),I=Math.min(T*N,300);return o-_*((p+x*O*S)*Math.sinh(I)+T*S*Math.cosh(I))/T};const V=(p+x*O*S)/T,C=x*O*V-S*T,j=x*O*S-V*T;w=N=>{const _=Math.exp(-x*O*N),I=Math.min(T*N,300);return _*(C*Math.sinh(I)+j*Math.cosh(I))}}const M={calculatedDuration:d&&h||null,velocity:T=>qt(w(T)),next:T=>{if(!d&&x<1){const C=Math.exp(-x*O*T),j=Math.sin(k*T),N=Math.cos(k*T),_=o-C*($*j+S*N),I=qt(C*(P*j+Q*N));return l.done=Math.abs(I)<=r&&Math.abs(o-_)<=i,l.value=l.done?o:_,l}const V=v(T);if(d)l.done=T>=h;else{const C=qt(w(T));l.done=Math.abs(C)<=r&&Math.abs(o-V)<=i}return l.value=l.done?o:V,l},toString:()=>{const T=Math.min(_O(M),mu),V=fP(C=>M.next(T*C).value,T,30);return T+"ms "+V},toTransition:()=>{}};return M}Ou.applyToOptions=t=>{const e=kj(t,100,Ou);return t.ease=e.ease,t.duration=qt(e.duration),t.type="keyframes",t};const Aj=5;function dP(t,e,n){const r=Math.max(e-Aj,0);return Yb(n-t(r),e-r)}function $p({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=Q=>l!==void 0&&Q<l||a!==void 0&&Q>a,p=Q=>l===void 0?a:a===void 0||Math.abs(l-Q)<Math.abs(a-Q)?l:a;let x=n*e;const S=h+x,O=o===void 0?S:o(S);O!==S&&(x=O-h);const y=Q=>-x*Math.exp(-Q/r),v=Q=>O+y(Q),w=Q=>{const M=y(Q),T=v(Q);f.done=Math.abs(M)<=c,f.value=f.done?O:T};let k,$;const P=Q=>{d(f.value)&&(k=Q,$=Ou({keyframes:[f.value,p(f.value)],velocity:dP(v,Q,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return P(0),{calculatedDuration:null,next:Q=>{let M=!1;return!$&&k===void 0&&(M=!0,w(Q),P(Q)),k!==void 0&&Q>=k?$.next(Q-k):(!M&&w(Q),f)}}}function Mj(t,e,n){const r=[],i=n||Gr.mix||hP,s=t.length-1;for(let o=0;o<s;o++){let l=i(t[o],t[o+1]);if(e){const a=Array.isArray(e)?e[o]||un:e;l=_l(a,l)}r.push(l)}return r}function Ej(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(EO(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=Mj(e,r,i),a=l.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(a>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=kl(t[h],t[h+1],u);return l[h](f)};return n?u=>c(Jn(t[0],t[s-1],u)):c}function Rj(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=kl(0,e,r);t.push(Ce(n,1,i))}}function jj(t){const e=[0];return Rj(e,t.length-1),e}function Zj(t,e){return t.map(n=>n*e)}function Vj(t,e){return t.map(()=>e||tP).splice(0,t.length-1)}function Wo({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=IR(r)?r.map(jy):jy(r),s={done:!1,value:e[0]},o=Zj(n&&n.length===e.length?n:jj(e),t),l=Ej(o,e,{ease:Array.isArray(i)?i:Vj(e,i)});return{calculatedDuration:t,next:a=>(s.value=l(a),s.done=a>=t,s)}}const Xj=t=>t!==null;function rh(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(Xj),l=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!l||r===void 0?s[l]:r}const Lj={decay:$p,inertia:$p,tween:Wo,keyframes:Wo,spring:Ou};function pP(t){typeof t.type=="string"&&(t.type=Lj[t.type])}class NO{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Dj=t=>t/100;class gu extends NO{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==wt.now()&&this.tick(wt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;pP(e);const{type:n=Wo,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=e;let{keyframes:l}=e;const a=n||Wo;a!==Wo&&typeof l[0]!="number"&&(this.mixKeyframes=_l(Dj,hP(l[0],l[1])),l=[0,100]);const c=a({...e,keyframes:l});s==="mirror"&&(this.mirroredGenerator=a({...e,keyframes:[...l].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=_O(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:a}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:x,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const O=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?O<0:O>i;this.currentTime=Math.max(O,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=r;if(h){const Q=Math.min(this.currentTime,i)/l;let M=Math.floor(Q),T=Q%1;!T&&Q>=1&&(T=1),T===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(f==="reverse"?(T=1-T,d&&(T-=d/l)):f==="mirror"&&(w=o)),v=Jn(0,1,T)*l}let k;y?(this.delayState.value=u[0],k=this.delayState):k=w.next(v),s&&!y&&(k.value=s(k.value));let{done:$}=k;!y&&a!==null&&($=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return P&&p!==$p&&(k.value=rh(u,this.options,S,this.speed)),x&&x(k.value),P&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return an(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+an(e)}get time(){return an(this.currentTime)}set time(e){e=qt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return dP(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(wt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=an(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=wj,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(wt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function _j(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const yi=t=>t*180/Math.PI,Tp=t=>{const e=yi(Math.atan2(t[1],t[0]));return Cp(e)},Nj={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Tp,rotateZ:Tp,skewX:t=>yi(Math.atan(t[1])),skewY:t=>yi(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Cp=t=>(t=t%360,t<0&&(t+=360),t),Ny=Tp,zy=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Wy=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),zj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:zy,scaleY:Wy,scale:t=>(zy(t)+Wy(t))/2,rotateX:t=>Cp(yi(Math.atan2(t[6],t[5]))),rotateY:t=>Cp(yi(Math.atan2(-t[2],t[0]))),rotateZ:Ny,rotate:Ny,skewX:t=>yi(Math.atan(t[4])),skewY:t=>yi(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ap(t){return t.includes("scale")?1:0}function Mp(t,e){if(!t||t==="none")return Ap(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=zj,i=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Nj,i=l}if(!i)return Ap(e);const s=r[e],o=i[1].split(",").map(Ij);return typeof s=="function"?s(o):o[s]}const Wj=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Mp(n,e)};function Ij(t){return parseFloat(t.trim())}const Gs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Hs=new Set(Gs),Iy=t=>t===Us||t===U,Bj=new Set(["x","y","z"]),Yj=Gs.filter(t=>!Bj.has(t));function Fj(t){const e=[];return Yj.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Er={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const i=t.max-t.min;return r==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const i=t.max-t.min;return r==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Mp(e,"x"),y:(t,{transform:e})=>Mp(e,"y")};Er.translateX=Er.x;Er.translateY=Er.y;const Si=new Set;let Ep=!1,Rp=!1,jp=!1;function mP(){if(Rp){const t=Array.from(Si).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Fj(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var l;(l=r.getValue(s))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Rp=!1,Ep=!1,Si.forEach(t=>t.complete(jp)),Si.clear()}function OP(){Si.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Rp=!0)})}function qj(){jp=!0,OP(),mP(),jp=!1}class zO{constructor(e,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Si.add(this),Ep||(Ep=!0,ke.read(OP),ke.resolveKeyframes(mP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),i&&s===void 0&&i.set(e[0])}_j(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Si.delete(this)}cancel(){this.state==="scheduled"&&(Si.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Uj=t=>t.startsWith("--");function gP(t,e,n){Uj(e)?t.style.setProperty(e,n):t.style[e]=n}const Gj={};function yP(t,e){const n=Bb(t);return()=>Gj[e]??n()}const Hj=yP(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xP=yP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Qo=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,By={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qo([0,.65,.55,1]),circOut:Qo([.55,0,1,.45]),backIn:Qo([.31,.01,.66,-.59]),backOut:Qo([.33,1.53,.69,.99])};function vP(t,e){if(t)return typeof t=="function"?xP()?fP(t,e):"ease-out":nP(t)?Qo(t):Array.isArray(t)?t.map(n=>vP(n,e)||By.easeOut):By[t]}function Kj(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:l="easeOut",times:a}={},c=void 0){const u={[e]:n};a&&(u.offset=a);const h=vP(l,i);Array.isArray(h)&&(u.easing=h);const f={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function SP(t){return typeof t=="function"&&"applyToOptions"in t}function Jj({type:t,...e}){return SP(t)&&xP()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class wP extends NO{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:l,onComplete:a}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,EO(typeof e.type!="string");const c=Jj(e);this.animation=Kj(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=rh(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(u),gP(n,r,u),this.animation.cancel()}a==null||a(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return an(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+an(e)}get time(){return an(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qt(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Hj()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),un):i(this)}}const kP={anticipate:Kb,backInOut:Hb,circInOut:eP};function eZ(t){return t in kP}function tZ(t){typeof t.ease=="string"&&eZ(t.ease)&&(t.ease=kP[t.ease])}const bf=10;class nZ extends wP{constructor(e){tZ(e),pP(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new gu({...o,autoplay:!1}),a=Math.max(bf,wt.now()-this.startTime),c=Jn(0,bf,a-bf),u=l.sample(a).value,{name:h}=this.options;s&&h&&gP(s,h,u),n.setWithVelocity(l.sample(Math.max(0,a-c)).value,u,c),l.stop()}}const Yy=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Qn.test(t)||t==="0")&&!t.startsWith("url("));function rZ(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function iZ(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=Yy(i,e),l=Yy(s,e);return!o||!l?!1:rZ(t)||(n==="spring"||SP(n))&&r}function Zp(t){t.duration=0,t.type="keyframes"}const bP=new Set(["opacity","clipPath","filter","transform"]),sZ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function oZ(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&sZ.test(t[e]))return!0;return!1}const lZ=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),aZ=Bb(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cZ(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:o,keyframes:l}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return aZ()&&n&&(bP.has(n)||lZ.has(n)&&oZ(l))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const uZ=40;class hZ extends NO{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:l,name:a,motionValue:c,element:u,...h}){var p;super(),this.stop=()=>{var x,S;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(S=this.keyframeResolver)==null||S.cancel()},this.createdAt=wt.now();const f={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||zO;this.keyframeResolver=new d(l,(x,S,O)=>this.onKeyframesResolved(x,S,f,!O),a,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,r,i){var O,y;this.keyframeResolver=void 0;const{name:s,type:o,velocity:l,delay:a,isHandoff:c,onUpdate:u}=r;this.resolvedAt=wt.now();let h=!0;iZ(e,s,o,l)||(h=!1,(Gr.instantAnimations||!a)&&(u==null||u(rh(e,r,n))),e[0]=e[e.length-1],Zp(r),r.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>uZ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},p=h&&!c&&cZ(d),x=(y=(O=d.motionValue)==null?void 0:O.owner)==null?void 0:y.current;let S;if(p)try{S=new nZ({...d,element:x})}catch{S=new gu(d)}else S=new gu(d);S.finished.then(()=>{this.notifyFinished()}).catch(un),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),qj()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function PP(t,e,n,r=0,i=1){const s=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:l-s*r}const fZ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dZ(t){const e=fZ.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function QP(t,e,n=1){const[r,i]=dZ(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return zb(o)?parseFloat(o):o}return VO(i)?QP(i,e,n+1):i}const pZ={type:"spring",stiffness:500,damping:25,restSpeed:10},mZ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),OZ={type:"keyframes",duration:.8},gZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yZ=(t,{keyframes:e})=>e.length>2?OZ:Hs.has(t)?t.startsWith("scale")?mZ(e[1]):pZ:gZ;function $P(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function WO(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?$P(n,t):n}const xZ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function vZ(t){for(const e in t)if(!xZ.has(e))return!0;return!1}const IO=(t,e,n,r={},i,s)=>o=>{const l=WO(r,t)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-qt(a);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:f=>{e.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:s?void 0:i};vZ(l)||Object.assign(u,yZ(t,u)),u.duration&&(u.duration=qt(u.duration)),u.repeatDelay&&(u.repeatDelay=qt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Zp(u),u.delay===0&&(h=!0)),(Gr.instantAnimations||Gr.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,Zp(u),u.delay=0),u.allowFlatten=!l.type&&!l.ease,h&&!s&&e.get()!==void 0){const f=rh(u.keyframes,l);if(f!==void 0){ke.update(()=>{u.onUpdate(f),u.onComplete()});return}}return l.isSync?new gu(u):new hZ(u)};function Fy(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function BO(t,e,n,r){if(typeof e=="function"){const[i,s]=Fy(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Fy(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function wi(t,e,n){const r=t.getProps();return BO(r,e,n!==void 0?n:r.custom,t)}const TP=new Set(["width","height","top","left","right","bottom",...Gs]),qy=30,SZ=t=>!isNaN(parseFloat(t));class wZ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=wt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=wt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=SZ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new RO);const r=this.events[e].add(n);return e==="change"?()=>{r(),ke.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=wt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>qy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,qy);return Yb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ds(t,e){return new wZ(t,e)}const Vp=t=>Array.isArray(t);function kZ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ds(n))}function bZ(t){return Vp(t)?t[t.length-1]||0:t}function PZ(t,e){const n=wi(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const l=bZ(s[o]);kZ(t,o,l)}}const lt=t=>!!(t&&t.getVelocity);function QZ(t){return!!(lt(t)&&t.add)}function Xp(t,e){const n=t.getValue("willChange");if(QZ(n))return n.add(e);if(!n&&Gr.WillChange){const r=new Gr.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function YO(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const $Z="framerAppearId",CP="data-"+YO($Z);function AP(t){return t.props[CP]}function TZ({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function MP(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:o,...l}=e;const a=t.getDefaultTransition();s=s?$P(s,a):a;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const u=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in l){const d=t.getValue(f,t.latestValues[f]??null),p=l[f];if(p===void 0||h&&TZ(h,f))continue;const x={delay:n,...WO(s||{},f)},S=d.get();if(S!==void 0&&!d.isAnimating()&&!Array.isArray(p)&&p===S&&!x.velocity){ke.update(()=>d.set(p));continue}let O=!1;if(window.MotionHandoffAnimation){const w=AP(t);if(w){const k=window.MotionHandoffAnimation(w,f,ke);k!==null&&(x.startTime=k,O=!0)}}Xp(t,f);const y=c??t.shouldReduceMotion;d.start(IO(f,d,p,y&&TP.has(f)?{type:!1}:x,t,O));const v=d.animation;v&&u.push(v)}if(o){const f=()=>ke.update(()=>{o&&PZ(t,o)});u.length?Promise.all(u).then(f):f()}return u}function Lp(t,e,n={}){var a;const r=wi(t,e,n.type==="exit"?(a=t.presenceContext)==null?void 0:a.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(MP(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=i;return CZ(t,e,c,u,h,f,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[s,o]:[o,s];return c().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function CZ(t,e,n=0,r=0,i=0,s=1,o){const l=[];for(const a of t.variantChildren)a.notify("AnimationStart",e),l.push(Lp(a,e,{...o,delay:n+(typeof r=="function"?0:r)+PP(t.variantChildren,a,r,i,s)}).then(()=>a.notify("AnimationComplete",e)));return Promise.all(l)}function AZ(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>Lp(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=Lp(t,e,n);else{const i=typeof e=="function"?wi(t,e,n.custom):e;r=Promise.all(MP(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const MZ={test:t=>t==="auto",parse:t=>t},EP=t=>e=>e.test(t),RP=[Us,U,Kn,vr,rj,nj,MZ],Uy=t=>RP.find(EP(t));function EZ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ib(t):!0}const RZ=new Set(["brightness","contrast","saturate","opacity"]);function jZ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(XO)||[];if(!r)return t;const i=n.replace(r,"");let s=RZ.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const ZZ=/\b([a-z-]*)\(.*?\)/gu,Dp={...Qn,getAnimatableNone:t=>{const e=t.match(ZZ);return e?e.map(jZ).join(" "):t}},_p={...Qn,getAnimatableNone:t=>{const e=Qn.parse(t);return Qn.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Gy={...Us,transform:Math.round},VZ={rotate:vr,rotateX:vr,rotateY:vr,rotateZ:vr,scale:Ma,scaleX:Ma,scaleY:Ma,scaleZ:Ma,skew:vr,skewX:vr,skewY:vr,distance:U,translateX:U,translateY:U,translateZ:U,x:U,y:U,z:U,perspective:U,transformPerspective:U,opacity:bl,originX:Vy,originY:Vy,originZ:U},FO={borderWidth:U,borderTopWidth:U,borderRightWidth:U,borderBottomWidth:U,borderLeftWidth:U,borderRadius:U,borderTopLeftRadius:U,borderTopRightRadius:U,borderBottomRightRadius:U,borderBottomLeftRadius:U,width:U,maxWidth:U,height:U,maxHeight:U,top:U,right:U,bottom:U,left:U,inset:U,insetBlock:U,insetBlockStart:U,insetBlockEnd:U,insetInline:U,insetInlineStart:U,insetInlineEnd:U,padding:U,paddingTop:U,paddingRight:U,paddingBottom:U,paddingLeft:U,paddingBlock:U,paddingBlockStart:U,paddingBlockEnd:U,paddingInline:U,paddingInlineStart:U,paddingInlineEnd:U,margin:U,marginTop:U,marginRight:U,marginBottom:U,marginLeft:U,marginBlock:U,marginBlockStart:U,marginBlockEnd:U,marginInline:U,marginInlineStart:U,marginInlineEnd:U,fontSize:U,backgroundPositionX:U,backgroundPositionY:U,...VZ,zIndex:Gy,fillOpacity:bl,strokeOpacity:bl,numOctaves:Gy},XZ={...FO,color:Be,backgroundColor:Be,outlineColor:Be,fill:Be,stroke:Be,borderColor:Be,borderTopColor:Be,borderRightColor:Be,borderBottomColor:Be,borderLeftColor:Be,filter:Dp,WebkitFilter:Dp,mask:_p,WebkitMask:_p},jP=t=>XZ[t],LZ=new Set([Dp,_p]);function ZP(t,e){let n=jP(t);return LZ.has(n)||(n=Qn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const DZ=new Set(["auto","none","0"]);function _Z(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!DZ.has(s)&&Ls(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=ZP(n,i)}class NZ extends zO{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),VO(h))){const f=QP(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!TP.has(r)||e.length!==2)return;const[i,s]=e,o=Uy(i),l=Uy(s),a=Zy(i),c=Zy(s);if(a!==c&&Er[r]){this.needsMeasurement=!0;return}if(o!==l)if(Iy(o)&&Iy(l))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else Er[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||EZ(e[i]))&&r.push(i);r.length&&_Z(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Er[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=Er[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function VP(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const i=(n==null?void 0:n[t])??r.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(r=>r!=null)}const XP=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function oc(t){return Wb(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:qO}=rP(queueMicrotask,!1),gn={x:!1,y:!1};function LP(){return gn.x||gn.y}function zZ(t){return t==="x"||t==="y"?gn[t]?null:(gn[t]=!0,()=>{gn[t]=!1}):gn.x||gn.y?null:(gn.x=gn.y=!0,()=>{gn.x=gn.y=!1})}function DP(t,e){const n=VP(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function WZ(t){return!(t.pointerType==="touch"||LP())}function IZ(t,e,n={}){const[r,i,s]=DP(t,n);return r.forEach(o=>{let l=!1,a=!1,c;const u=()=>{o.removeEventListener("pointerleave",p)},h=S=>{c&&(c(S),c=void 0),u()},f=S=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),a&&(a=!1,h(S))},d=()=>{l=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=S=>{if(S.pointerType!=="touch"){if(l){a=!0;return}h(S)}},x=S=>{if(!WZ(S))return;a=!1;const O=e(o,S);typeof O=="function"&&(c=O,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",x,i),o.addEventListener("pointerdown",d,i)}),s}const _P=(t,e)=>e?t===e?!0:_P(t,e.parentElement):!1,UO=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,BZ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YZ(t){return BZ.has(t.tagName)||t.isContentEditable===!0}const FZ=new Set(["INPUT","SELECT","TEXTAREA"]);function qZ(t){return FZ.has(t.tagName)||t.isContentEditable===!0}const lc=new WeakSet;function Hy(t){return e=>{e.key==="Enter"&&t(e)}}function Pf(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const UZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Hy(()=>{if(lc.has(n))return;Pf(n,"down");const i=Hy(()=>{Pf(n,"up")}),s=()=>Pf(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Ky(t){return UO(t)&&!LP()}const Jy=new WeakSet;function GZ(t,e,n={}){const[r,i,s]=DP(t,n),o=l=>{const a=l.currentTarget;if(!Ky(l)||Jy.has(l))return;lc.add(a),n.stopPropagation&&Jy.add(l);const c=e(a,l),u=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),lc.has(a)&&lc.delete(a),Ky(d)&&typeof c=="function"&&c(d,{success:p})},h=d=>{u(d,a===window||a===document||n.useGlobalTarget||_P(a,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),oc(l)&&(l.addEventListener("focus",c=>UZ(c,i)),!YZ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),s}function GO(t){return Wb(t)&&"ownerSVGElement"in t}const ac=new WeakMap;let Sr;const NP=(t,e,n)=>(r,i)=>i&&i[0]?i[0][t+"Size"]:GO(r)&&"getBBox"in r?r.getBBox()[e]:r[n],HZ=NP("inline","width","offsetWidth"),KZ=NP("block","height","offsetHeight");function JZ({target:t,borderBoxSize:e}){var n;(n=ac.get(t))==null||n.forEach(r=>{r(t,{get width(){return HZ(t,e)},get height(){return KZ(t,e)}})})}function eV(t){t.forEach(JZ)}function tV(){typeof ResizeObserver>"u"||(Sr=new ResizeObserver(eV))}function nV(t,e){Sr||tV();const n=VP(t);return n.forEach(r=>{let i=ac.get(r);i||(i=new Set,ac.set(r,i)),i.add(e),Sr==null||Sr.observe(r)}),()=>{n.forEach(r=>{const i=ac.get(r);i==null||i.delete(e),i!=null&&i.size||Sr==null||Sr.unobserve(r)})}}const cc=new Set;let os;function rV(){os=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};cc.forEach(e=>e(t))},window.addEventListener("resize",os)}function iV(t){return cc.add(t),os||rV(),()=>{cc.delete(t),!cc.size&&typeof os=="function"&&(window.removeEventListener("resize",os),os=void 0)}}function ex(t,e){return typeof t=="function"?iV(t):nV(t,e)}function sV(t){return GO(t)&&t.tagName==="svg"}const oV=[...RP,Be,Qn],lV=t=>oV.find(EP(t)),tx=()=>({translate:0,scale:1,origin:0,originPoint:0}),ls=()=>({x:tx(),y:tx()}),nx=()=>({min:0,max:0}),qe=()=>({x:nx(),y:nx()}),aV=new WeakMap;function ih(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Pl(t){return typeof t=="string"||Array.isArray(t)}const HO=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],KO=["initial",...HO];function sh(t){return ih(t.animate)||KO.some(e=>Pl(t[e]))}function zP(t){return!!(sh(t)||t.variants)}function cV(t,e,n){for(const r in e){const i=e[r],s=n[r];if(lt(i))t.addValue(r,i);else if(lt(s))t.addValue(r,Ds(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,Ds(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Np={current:null},WP={current:!1},uV=typeof window<"u";function hV(){if(WP.current=!0,!!uV)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Np.current=t.matches;t.addEventListener("change",e),e()}else Np.current=!1}const rx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let yu={};function IP(t){yu=t}function fV(){return yu}class dV{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:l},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=zO,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=wt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,ke.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=l;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=sh(n),this.isVariantNode=zP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];c[d]!==void 0&<(p)&&p.set(c[d])}}mount(e){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,aV.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(WP.current||hV(),this.shouldReduceMotion=Np.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Hr(this.notifyUpdate),Hr(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&bP.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:a,ease:c,duration:u}=n.accelerate,h=new wP({element:this.current,name:e,keyframes:l,times:a,ease:c,duration:qt(u)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const r=Hs.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ke.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in yu){const n=yu[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qe()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<rx.length;r++){const i=rx[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=cV(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Ds(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(zb(r)||Ib(r))?r=parseFloat(r):!lV(r)&&Qn.test(n)&&(r=ZP(e,n)),this.setBaseTarget(e,lt(r)?r.get():r)),lt(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=BO(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!lt(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new RO),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){qO.render(this.render)}}class BP extends dV{constructor(){super(...arguments),this.KeyframeResolver=NZ}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;lt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ni{constructor(e){this.isMounted=!1,this.node=e}update(){}}function YP({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function pV({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function mV(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Qf(t){return t===void 0||t===1}function zp({scale:t,scaleX:e,scaleY:n}){return!Qf(t)||!Qf(e)||!Qf(n)}function ci(t){return zp(t)||FP(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function FP(t){return ix(t.x)||ix(t.y)}function ix(t){return t&&t!=="0%"}function xu(t,e,n){const r=t-n,i=e*r;return n+i}function sx(t,e,n,r,i){return i!==void 0&&(t=xu(t,i,r)),xu(t,n,r)+e}function Wp(t,e=0,n=1,r,i){t.min=sx(t.min,e,n,r,i),t.max=sx(t.max,e,n,r,i)}function qP(t,{x:e,y:n}){Wp(t.x,e.translate,e.scale,e.originPoint),Wp(t.y,n.translate,n.scale,n.originPoint)}const ox=.999999999999,lx=1.0000000000001;function OV(t,e,n,r=!1){var l;const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Dn(t.x,-s.scroll.offset.x),Dn(t.y,-s.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,qP(t,o)),r&&ci(s.latestValues)&&uc(t,s.latestValues,(l=s.layout)==null?void 0:l.layoutBox))}e.x<lx&&e.x>ox&&(e.x=1),e.y<lx&&e.y>ox&&(e.y=1)}function Dn(t,e){t.min+=e,t.max+=e}function ax(t,e,n,r,i=.5){const s=Ce(t.min,t.max,i);Wp(t,e,n,s,r)}function cx(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function uc(t,e,n){const r=n??t;ax(t.x,cx(e.x,r.x),e.scaleX,e.scale,e.originX),ax(t.y,cx(e.y,r.y),e.scaleY,e.scale,e.originY)}function UP(t,e){return YP(mV(t.getBoundingClientRect(),e))}function gV(t,e,n){const r=UP(t,n),{scroll:i}=e;return i&&(Dn(r.x,i.offset.x),Dn(r.y,i.offset.y)),r}const yV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xV=Gs.length;function vV(t,e,n){let r="",i=!0;for(let s=0;s<xV;s++){const o=Gs[s],l=t[o];if(l===void 0)continue;let a=!0;if(typeof l=="number")a=l===(o.startsWith("scale")?1:0);else{const c=parseFloat(l);a=o.startsWith("scale")?c===1:c===0}if(!a||n){const c=XP(l,FO[o]);if(!a){i=!1;const u=yV[o]||o;r+=`${u}(${c}) `}n&&(e[o]=c)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function JO(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,l=!1;for(const a in e){const c=e[a];if(Hs.has(a)){o=!0;continue}else if(sP(a)){i[a]=c;continue}else{const u=XP(c,FO[a]);a.startsWith("origin")?(l=!0,s[a]=u):r[a]=u}}if(e.transform||(o||n?r.transform=vV(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${a} ${c} ${u}`}}function GP(t,{style:e,vars:n},r,i){const s=t.style;let o;for(o in e)s[o]=e[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function ux(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const yo={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(U.test(t))t=parseFloat(t);else return t;const n=ux(t,e.target.x),r=ux(t,e.target.y);return`${n}% ${r}%`}},SV={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Qn.parse(t);if(i.length>5)return r;const s=Qn.createTransformer(t),o=typeof i[0]!="number"?1:0,l=n.x.scale*e.x,a=n.y.scale*e.y;i[0+o]/=l,i[1+o]/=a;const c=Ce(l,a,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}},Ip={borderRadius:{...yo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:yo,borderTopRightRadius:yo,borderBottomLeftRadius:yo,borderBottomRightRadius:yo,boxShadow:SV};function HP(t,{layout:e,layoutId:n}){return Hs.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ip[t]||t==="opacity")}function eg(t,e,n){var o;const r=t.style,i=e==null?void 0:e.style,s={};if(!r)return s;for(const l in r)(lt(r[l])||i&<(i[l])||HP(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(s[l]=r[l]);return s}function wV(t){return window.getComputedStyle(t)}class kV extends BP{constructor(){super(...arguments),this.type="html",this.renderInstance=GP}readValueFromInstance(e,n){var r;if(Hs.has(n))return(r=this.projection)!=null&&r.isProjecting?Ap(n):Wj(e,n);{const i=wV(e),s=(sP(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return UP(e,n)}build(e,n,r){JO(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return eg(e,n,r)}}const bV={offset:"stroke-dashoffset",array:"stroke-dasharray"},PV={offset:"strokeDashoffset",array:"strokeDasharray"};function QV(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?bV:PV;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const $V=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function KP(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...l},a,c,u){if(JO(t,l,c),a){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const d of $V)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&QV(h,i,s,o,!1)}const JP=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),eQ=t=>typeof t=="string"&&t.toLowerCase()==="svg";function TV(t,e,n,r){GP(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(JP.has(i)?i:YO(i),e.attrs[i])}function tQ(t,e,n){const r=eg(t,e,n);for(const i in t)if(lt(t[i])||lt(e[i])){const s=Gs.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}class CV extends BP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qe}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Hs.has(n)){const r=jP(n);return r&&r.default||0}return n=JP.has(n)?n:YO(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return tQ(e,n,r)}build(e,n,r){KP(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){TV(e,n,r,i)}mount(e){this.isSVGTag=eQ(e.tagName),super.mount(e)}}const AV=KO.length;function nQ(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?nQ(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<AV;n++){const r=KO[n],i=t.props[r];(Pl(i)||i===!1)&&(e[r]=i)}return e}function rQ(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const MV=[...HO].reverse(),EV=HO.length;function RV(t){return e=>Promise.all(e.map(({animation:n,options:r})=>AZ(t,n,r)))}function jV(t){let e=RV(t),n=hx(),r=!0,i=!1;const s=c=>(u,h)=>{var d;const f=wi(t,h,c==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:x,...S}=f;u={...u,...S,...x}}return u};function o(c){e=c(t)}function l(c){const{props:u}=t,h=nQ(t.parent)||{},f=[],d=new Set;let p={},x=1/0;for(let O=0;O<EV;O++){const y=MV[O],v=n[y],w=u[y]!==void 0?u[y]:h[y],k=Pl(w),$=y===c?v.isActive:null;$===!1&&(x=O);let P=w===h[y]&&w!==u[y]&&k;if(P&&(r||i)&&t.manuallyAnimateOnMount&&(P=!1),v.protectedKeys={...p},!v.isActive&&$===null||!w&&!v.prevProp||ih(w)||typeof w=="boolean")continue;if(y==="exit"&&v.isActive&&$!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const Q=ZV(v.prevProp,w);let M=Q||y===c&&v.isActive&&!P&&k||O>x&&k,T=!1;const V=Array.isArray(w)?w:[w];let C=V.reduce(s(y),{});$===!1&&(C={});const{prevResolvedValues:j={}}=v,N={...j,...C},_=E=>{M=!0,d.has(E)&&(T=!0,d.delete(E)),v.needsAnimating[E]=!0;const D=t.getValue(E);D&&(D.liveStyle=!1)};for(const E in N){const D=C[E],L=j[E];if(p.hasOwnProperty(E))continue;let q=!1;Vp(D)&&Vp(L)?q=!rQ(D,L):q=D!==L,q?D!=null?_(E):d.add(E):D!==void 0&&d.has(E)?_(E):v.protectedKeys[E]=!0}v.prevProp=w,v.prevResolvedValues=C,v.isActive&&(p={...p,...C}),(r||i)&&t.blockInitialAnimation&&(M=!1);const I=P&&Q;M&&(!I||T)&&f.push(...V.map(E=>{const D={type:y};if(typeof E=="string"&&(r||i)&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:L}=t,q=wi(L,E);if(L.enteringChildren&&q){const{delayChildren:G}=q.transition||{};D.delay=PP(L.enteringChildren,t,G)}}return{animation:E,options:D}}))}if(d.size){const O={};if(typeof u.initial!="boolean"){const y=wi(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(O.transition=y.transition)}d.forEach(y=>{const v=t.getBaseTarget(y),w=t.getValue(y);w&&(w.liveStyle=!0),O[y]=v??null}),f.push({animation:O})}let S=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(S=!1),r=!1,i=!1,S?e(f):Promise.resolve()}function a(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(c,u)}),n[c].isActive=u;const h=l(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:l,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=hx(),i=!0}}}function ZV(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!rQ(e,t):!1}function si(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hx(){return{animate:si(!0),whileInView:si(),whileHover:si(),whileTap:si(),whileDrag:si(),whileFocus:si(),exit:si()}}function Bp(t,e){t.min=e.min,t.max=e.max}function On(t,e){Bp(t.x,e.x),Bp(t.y,e.y)}function fx(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const iQ=1e-4,VV=1-iQ,XV=1+iQ,sQ=.01,LV=0-sQ,DV=0+sQ;function kt(t){return t.max-t.min}function _V(t,e,n){return Math.abs(t-e)<=n}function dx(t,e,n,r=.5){t.origin=r,t.originPoint=Ce(e.min,e.max,t.origin),t.scale=kt(n)/kt(e),t.translate=Ce(n.min,n.max,t.origin)-t.originPoint,(t.scale>=VV&&t.scale<=XV||isNaN(t.scale))&&(t.scale=1),(t.translate>=LV&&t.translate<=DV||isNaN(t.translate))&&(t.translate=0)}function Io(t,e,n,r){dx(t.x,e.x,n.x,r?r.originX:void 0),dx(t.y,e.y,n.y,r?r.originY:void 0)}function px(t,e,n,r=0){const i=r?Ce(n.min,n.max,r):n.min;t.min=i+e.min,t.max=t.min+kt(e)}function NV(t,e,n,r){px(t.x,e.x,n.x,r==null?void 0:r.x),px(t.y,e.y,n.y,r==null?void 0:r.y)}function mx(t,e,n,r=0){const i=r?Ce(n.min,n.max,r):n.min;t.min=e.min-i,t.max=t.min+kt(e)}function vu(t,e,n,r){mx(t.x,e.x,n.x,r==null?void 0:r.x),mx(t.y,e.y,n.y,r==null?void 0:r.y)}function Ox(t,e,n,r,i){return t-=e,t=xu(t,1/n,r),i!==void 0&&(t=xu(t,1/i,r)),t}function zV(t,e=0,n=1,r=.5,i,s=t,o=t){if(Kn.test(e)&&(e=parseFloat(e),e=Ce(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Ce(s.min,s.max,r);t===s&&(l-=e),t.min=Ox(t.min,e,n,l,i),t.max=Ox(t.max,e,n,l,i)}function gx(t,e,[n,r,i],s,o){zV(t,e[n],e[r],e[i],e.scale,s,o)}const WV=["x","scaleX","originX"],IV=["y","scaleY","originY"];function yx(t,e,n,r){gx(t.x,e,WV,n?n.x:void 0,r?r.x:void 0),gx(t.y,e,IV,n?n.y:void 0,r?r.y:void 0)}function xx(t){return t.translate===0&&t.scale===1}function oQ(t){return xx(t.x)&&xx(t.y)}function vx(t,e){return t.min===e.min&&t.max===e.max}function BV(t,e){return vx(t.x,e.x)&&vx(t.y,e.y)}function Sx(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function lQ(t,e){return Sx(t.x,e.x)&&Sx(t.y,e.y)}function wx(t){return kt(t.x)/kt(t.y)}function kx(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Xn(t){return[t("x"),t("y")]}function YV(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),d&&(r+=`skewX(${d}deg) `),p&&(r+=`skewY(${p}deg) `)}const l=t.x.scale*e.x,a=t.y.scale*e.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const aQ=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],FV=aQ.length,bx=t=>typeof t=="string"?parseFloat(t):t,Px=t=>typeof t=="number"||U.test(t);function qV(t,e,n,r,i,s){i?(t.opacity=Ce(0,n.opacity??1,UV(r)),t.opacityExit=Ce(e.opacity??1,0,GV(r))):s&&(t.opacity=Ce(e.opacity??1,n.opacity??1,r));for(let o=0;o<FV;o++){const l=aQ[o];let a=Qx(e,l),c=Qx(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Px(a)===Px(c)?(t[l]=Math.max(Ce(bx(a),bx(c),r),0),(Kn.test(c)||Kn.test(a))&&(t[l]+="%")):t[l]=c}(e.rotate||n.rotate)&&(t.rotate=Ce(e.rotate||0,n.rotate||0,r))}function Qx(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const UV=cQ(0,.5,Jb),GV=cQ(.5,.95,un);function cQ(t,e,n){return r=>r<t?0:r>e?1:n(kl(t,e,r))}function HV(t,e,n){const r=lt(t)?t:Ds(t);return r.start(IO("",r,e,n)),r.animation}function Ql(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const KV=(t,e)=>t.depth-e.depth;class JV{constructor(){this.children=[],this.isDirty=!1}add(e){MO(this.children,e),this.isDirty=!0}remove(e){du(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(KV),this.isDirty=!1,this.children.forEach(e)}}function eX(t,e){const n=wt.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Hr(r),t(s-e))};return ke.setup(r,!0),()=>Hr(r)}function hc(t){return lt(t)?t.get():t}class tX{constructor(){this.members=[]}add(e){MO(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(du(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(du(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:o}=e.options;(s===void 0||s!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,i,s,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(i=e.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||o.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const fc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$f=["","X","Y","Z"],nX=1e3;let rX=0;function Tf(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function uQ(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=AP(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ke,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&uQ(r)}function hQ({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},l=e==null?void 0:e()){this.id=rX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(oX),this.nodes.forEach(fX),this.nodes.forEach(dX),this.nodes.forEach(lX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new JV)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new RO),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=GO(o)&&!sV(o),this.instance=o;const{layoutId:l,layout:a,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(a||l)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;ke.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=eX(f,250),fc.hasAnimatedSinceResize&&(fc.hasAnimatedSinceResize=!1,this.nodes.forEach(Cx)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||a)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||yX,{onLayoutAnimationStart:x,onLayoutAnimationComplete:S}=c.getProps(),O=!this.targetLayout||!lQ(this.targetLayout,d),y=!h&&f;if(this.options.layoutRoot||this.resumeFrom||y||h&&(O||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...WO(p,"layout"),onPlay:x,onComplete:S};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else h||Cx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Hr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(pX),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&uQ(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:a}=this.options;if(l===void 0&&!a)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const a=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),a&&this.nodes.forEach(cX),this.nodes.forEach($x);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Tx);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(uX),this.nodes.forEach(hX),this.nodes.forEach(iX),this.nodes.forEach(sX)):this.nodes.forEach(Tx),this.clearAllSnapshots();const l=wt.now();it.delta=Jn(0,1e3/60,l-it.timestamp),it.timestamp=l,it.isProcessing=!0,xf.update.process(it),xf.preRender.process(it),xf.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qO.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(aX),this.sharedNodes.forEach(mX)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ke.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ke.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!kt(this.snapshot.measuredBox.x)&&!kt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=qe()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oQ(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(l||ci(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),xX(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return qe();const l=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(vX))){const{scroll:u}=this.root;u&&(Dn(l.x,u.offset.x),Dn(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=qe();if(On(l,o),(a=this.scroll)!=null&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&On(l,o),Dn(l.x,h.offset.x),Dn(l.y,h.offset.y))}return l}applyTransform(o,l=!1,a){var u,h;const c=a||qe();On(c,o);for(let f=0;f<this.path.length;f++){const d=this.path[f];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(Dn(c.x,-d.scroll.offset.x),Dn(c.y,-d.scroll.offset.y)),ci(d.latestValues)&&uc(c,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return ci(this.latestValues)&&uc(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(o){var a;const l=qe();On(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ci(u.latestValues))continue;let h;u.instance&&(zp(u.latestValues)&&u.updateSnapshot(),h=qe(),On(h,u.measurePageBox())),yx(l,u.latestValues,(a=u.snapshot)==null?void 0:a.layoutBox,h)}return ci(this.latestValues)&&yx(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==it.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const a=!!this.resumingFrom||this!==l;if(!(o||a&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=it.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=qe(),this.targetWithTransforms=qe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),NV(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):On(this.target,this.layout.layoutBox),qP(this.target,this.targetDelta)):On(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||zp(this.parent.latestValues)||FP(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,a){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qe(),this.relativeTargetOrigin=qe(),vu(this.relativeTargetOrigin,l,a,this.options.layoutAnchor||void 0),On(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let a=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(a=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(a=!1),this.resolvedRelativeTargetAt===it.timestamp&&(a=!1),a)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;On(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;OV(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=qe());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fx(this.prevProjectionDelta.x,this.projectionDelta.x),fx(this.prevProjectionDelta.y,this.projectionDelta.y)),Io(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!kx(this.projectionDelta.x,this.prevProjectionDelta.x)||!kx(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ls(),this.projectionDelta=ls(),this.projectionDeltaWithTransform=ls()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},h=ls();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=qe(),d=a?a.source:void 0,p=this.layout?this.layout.source:void 0,x=d!==p,S=this.getStack(),O=!S||S.members.length<=1,y=!!(x&&!O&&this.options.crossfade===!0&&!this.path.some(gX));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const k=w/1e3;Ax(h.x,o.x,k),Ax(h.y,o.y,k),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vu(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),OX(this.relativeTarget,this.relativeTargetOrigin,f,k),v&&BV(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=qe()),On(v,this.relativeTarget)),x&&(this.animationValues=u,qV(u,c,this.latestValues,k,y,O)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,a,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(a=this.resumingFrom)==null?void 0:a.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Hr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ke.update(()=>{fc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ds(0)),this.motionValue.jump(0,!1),this.currentAnimation=HV(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nX),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&fQ(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||qe();const h=kt(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+h;const f=kt(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+f}On(l,a),uc(l,u),Io(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new tX),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&Tf("z",o,c,this.animationValues);for(let u=0;u<$f.length;u++)Tf(`rotate${$f[u]}`,o,c,this.animationValues),Tf(`skew${$f[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const a=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=hc(l==null?void 0:l.pointerEvents)||"",o.transform=a?a(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=hc(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!ci(this.latestValues)&&(o.transform=a?a({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=YV(this.projectionDeltaWithTransform,this.treeScale,u);a&&(h=a(u,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in Ip){if(u[p]===void 0)continue;const{correct:x,applyTo:S,isCSSVariable:O}=Ip[p],y=h==="none"?u[p]:x(u[p],c);if(S){const v=S.length;for(let w=0;w<v;w++)o[S[w]]=y}else O?this.options.visualElement.renderState.vars[p]=y:o[p]=y}this.options.layoutId&&(o.pointerEvents=c===this?hc(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach($x),this.root.sharedNodes.clear()}}}function iX(t){t.updateLayout()}function sX(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if(s==="size")Xn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=kt(f);f.min=r[h].min,f.max=f.min+d});else if(s==="x"||s==="y"){const h=s==="x"?"y":"x";Bp(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else fQ(s,e.layoutBox,r)&&Xn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=kt(r[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const l=ls();Io(l,r,e.layoutBox);const a=ls();o?Io(a,t.applyTransform(i,!0),e.measuredBox):Io(a,r,e.layoutBox);const c=!oQ(l);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=t.options.layoutAnchor||void 0,x=qe();vu(x,e.layoutBox,f.layoutBox,p);const S=qe();vu(S,r,d.layoutBox,p),lQ(x,S)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=S,t.relativeTargetOrigin=x,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function oX(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function lX(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function aX(t){t.clearSnapshot()}function $x(t){t.clearMeasurements()}function cX(t){t.isLayoutDirty=!0,t.updateLayout()}function Tx(t){t.isLayoutDirty=!1}function uX(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function hX(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Cx(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function fX(t){t.resolveTargetDelta()}function dX(t){t.calcProjection()}function pX(t){t.resetSkewAndRotation()}function mX(t){t.removeLeadSnapshot()}function Ax(t,e,n){t.translate=Ce(e.translate,0,n),t.scale=Ce(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Mx(t,e,n,r){t.min=Ce(e.min,n.min,r),t.max=Ce(e.max,n.max,r)}function OX(t,e,n,r){Mx(t.x,e.x,n.x,r),Mx(t.y,e.y,n.y,r)}function gX(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const yX={duration:.45,ease:[.4,0,.1,1]},Ex=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Rx=Ex("applewebkit/")&&!Ex("chrome/")?Math.round:un;function jx(t){t.min=Rx(t.min),t.max=Rx(t.max)}function xX(t){jx(t.x),jx(t.y)}function fQ(t,e,n){return t==="position"||t==="preserve-aspect"&&!_V(wx(e),wx(n),.2)}function vX(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const SX=hQ({attachResizeListener:(t,e)=>Ql(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Cf={current:void 0},dQ=hQ({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cf.current){const t=new SX({});t.mount(window),t.setOptions({layoutScroll:!0}),Cf.current=t}return Cf.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),tg=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Zx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function wX(...t){return e=>{let n=!1;const r=t.map(i=>{const s=Zx(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Zx(t[i],null)}}}}function kX(...t){return m.useCallback(wX(...t),t)}class bX extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(oc(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=oc(r)&&r.offsetWidth||0,s=oc(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=i-l.width-l.left,l.bottom=s-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function PX({children:t,isPresent:e,anchorX:n,anchorY:r,root:i,pop:s}){var f;const o=m.useId(),l=m.useRef(null),a=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=m.useContext(tg),u=((f=t.props)==null?void 0:f.ref)??(t==null?void 0:t.ref),h=kX(l,u);return m.useInsertionEffect(()=>{const{width:d,height:p,top:x,left:S,right:O,bottom:y}=a.current;if(e||s===!1||!l.current||!d||!p)return;const v=n==="left"?`left: ${S}`:`right: ${O}`,w=r==="bottom"?`bottom: ${y}`:`top: ${x}`;l.current.dataset.motionPopId=o;const k=document.createElement("style");c&&(k.nonce=c);const $=i??document.head;return $.appendChild(k),k.sheet&&k.sheet.insertRule(`
|
|
77
|
+
[data-motion-pop-id="${o}"] {
|
|
78
|
+
position: absolute !important;
|
|
79
|
+
width: ${d}px !important;
|
|
80
|
+
height: ${p}px !important;
|
|
81
|
+
${v}px !important;
|
|
82
|
+
${w}px !important;
|
|
83
|
+
}
|
|
84
|
+
`),()=>{var P;(P=l.current)==null||P.removeAttribute("data-motion-pop-id"),$.contains(k)&&$.removeChild(k)}},[e]),g.jsx(bX,{isPresent:e,childRef:l,sizeRef:a,pop:s,children:s===!1?t:m.cloneElement(t,{ref:h})})}const QX=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:l,anchorY:a,root:c})=>{const u=AO($X),h=m.useId();let f=!0,d=m.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{u.set(p,!0);for(const x of u.values())if(!x)return;r&&r()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[n,u,r]);return s&&f&&(d={...d}),m.useMemo(()=>{u.forEach((p,x)=>u.set(x,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),t=g.jsx(PX,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:a,root:c,children:t}),g.jsx(nh.Provider,{value:d,children:t})};function $X(){return new Map}function pQ(t=!0){const e=m.useContext(nh);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=m.useId();m.useEffect(()=>{if(t)return i(s)},[t]);const o=m.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const Ea=t=>t.key||"";function Vx(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const TX=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:l="left",anchorY:a="top",root:c})=>{const[u,h]=pQ(o),f=m.useMemo(()=>Vx(t),[t]),d=o&&!u?[]:f.map(Ea),p=m.useRef(!0),x=m.useRef(f),S=AO(()=>new Map),O=m.useRef(new Set),[y,v]=m.useState(f),[w,k]=m.useState(f);Nb(()=>{p.current=!1,x.current=f;for(let Q=0;Q<w.length;Q++){const M=Ea(w[Q]);d.includes(M)?(S.delete(M),O.current.delete(M)):S.get(M)!==!0&&S.set(M,!1)}},[w,d.length,d.join("-")]);const $=[];if(f!==y){let Q=[...f];for(let M=0;M<w.length;M++){const T=w[M],V=Ea(T);d.includes(V)||(Q.splice(M,0,T),$.push(T))}return s==="wait"&&$.length&&(Q=$),k(Vx(Q)),v(f),null}const{forceRender:P}=m.useContext(CO);return g.jsx(g.Fragment,{children:w.map(Q=>{const M=Ea(Q),T=o&&!u?!1:f===w||d.includes(M),V=()=>{if(O.current.has(M))return;if(S.has(M))O.current.add(M),S.set(M,!0);else return;let C=!0;S.forEach(j=>{j||(C=!1)}),C&&(P==null||P(),k(x.current),o&&(h==null||h()),r&&r())};return g.jsx(QX,{isPresent:T,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:T?void 0:V,anchorX:l,anchorY:a,children:Q},M)})})},mQ=m.createContext({strict:!1}),Xx={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Lx=!1;function CX(){if(Lx)return;const t={};for(const e in Xx)t[e]={isEnabled:n=>Xx[e].some(r=>!!n[r])};IP(t),Lx=!0}function OQ(){return CX(),fV()}function AX(t){const e=OQ();for(const n in t)e[n]={...e[n],...t[n]};IP(e)}const MX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Su(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||MX.has(t)}let gQ=t=>!Su(t);function EX(t){typeof t=="function"&&(gQ=e=>e.startsWith("on")?!Su(e):t(e))}try{EX(require("@emotion/is-prop-valid").default)}catch{}function RX(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||lt(t[i])||(gQ(i)||n===!0&&Su(i)||!e&&!Su(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const oh=m.createContext({});function jX(t,e){if(sh(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Pl(n)?n:void 0,animate:Pl(r)?r:void 0}}return t.inherit!==!1?e:{}}function ZX(t){const{initial:e,animate:n}=jX(t,m.useContext(oh));return m.useMemo(()=>({initial:e,animate:n}),[Dx(e),Dx(n)])}function Dx(t){return Array.isArray(t)?t.join(" "):t}const ng=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function yQ(t,e,n){for(const r in e)!lt(e[r])&&!HP(r,n)&&(t[r]=e[r])}function VX({transformTemplate:t},e){return m.useMemo(()=>{const n=ng();return JO(n,e,t),Object.assign({},n.vars,n.style)},[e])}function XX(t,e){const n=t.style||{},r={};return yQ(r,n,t),Object.assign(r,VX(t,e)),r}function LX(t,e){const n={},r=XX(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const xQ=()=>({...ng(),attrs:{}});function DX(t,e,n,r){const i=m.useMemo(()=>{const s=xQ();return KP(s,e,eQ(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};yQ(s,t.style,t),i.style={...s,...i.style}}return i}const _X=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rg(t){return typeof t!="string"||t.includes("-")?!1:!!(_X.indexOf(t)>-1||/[A-Z]/u.test(t))}function NX(t,e,n,{latestValues:r},i,s=!1,o){const a=(o??rg(t)?DX:LX)(e,r,i,t),c=RX(e,typeof t=="string",s),u=t!==m.Fragment?{...c,...a,ref:n}:{},{children:h}=e,f=m.useMemo(()=>lt(h)?h.get():h,[h]);return m.createElement(t,{...u,children:f})}function zX({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:WX(n,r,i,t),renderState:e()}}function WX(t,e,n,r){const i={},s=r(t,{});for(const f in s)i[f]=hc(s[f]);let{initial:o,animate:l}=t;const a=sh(t),c=zP(t);e&&c&&!a&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?l:o;if(h&&typeof h!="boolean"&&!ih(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=BO(t,f[d]);if(p){const{transitionEnd:x,transition:S,...O}=p;for(const y in O){let v=O[y];if(Array.isArray(v)){const w=u?v.length-1:0;v=v[w]}v!==null&&(i[y]=v)}for(const y in x)i[y]=x[y]}}}return i}const vQ=t=>(e,n)=>{const r=m.useContext(oh),i=m.useContext(nh),s=()=>zX(t,e,r,i);return n?s():AO(s)},IX=vQ({scrapeMotionValuesFromProps:eg,createRenderState:ng}),BX=vQ({scrapeMotionValuesFromProps:tQ,createRenderState:xQ}),YX=Symbol.for("motionComponentSymbol");function FX(t,e,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const i=m.useRef(null);return m.useCallback(s=>{var l;s&&((l=t.onMount)==null||l.call(t,s));const o=r.current;if(typeof o=="function")if(s){const a=o(s);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(s);else o&&(o.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const SQ=m.createContext({});function Wi(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qX(t,e,n,r,i,s){var v,w;const{visualElement:o}=m.useContext(oh),l=m.useContext(mQ),a=m.useContext(nh),c=m.useContext(tg),u=c.reducedMotion,h=c.skipAnimations,f=m.useRef(null),d=m.useRef(!1);r=r||l.renderer,!f.current&&r&&(f.current=r(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:s}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,x=m.useContext(SQ);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&UX(f.current,n,i,x);const S=m.useRef(!1);m.useInsertionEffect(()=>{p&&S.current&&p.update(n,a)});const O=n[CP],y=m.useRef(!!O&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,O))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,O)));return Nb(()=>{d.current=!0,p&&(S.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),y.current&&p.animationState&&p.animationState.animateChanges())}),m.useEffect(()=>{p&&(!y.current&&p.animationState&&p.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,O)}),y.current=!1),p.enteringChildren=void 0)}),p}function UX(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:wQ(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||l&&Wi(l),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:a,layoutRoot:c,layoutAnchor:u})}function wQ(t){if(t)return t.options.allowProjection!==!1?t.projection:wQ(t.parent)}function Af(t,{forwardMotionProps:e=!1,type:n}={},r,i){r&&AX(r);const s=n?n==="svg":rg(t),o=s?BX:IX;function l(c,u){let h;const f={...m.useContext(tg),...c,layoutId:GX(c)},{isStatic:d}=f,p=ZX(c),x=o(c,d);if(!d&&typeof window<"u"){HX();const S=KX(f);h=S.MeasureLayout,p.visualElement=qX(t,x,f,i,S.ProjectionNode,s)}return g.jsxs(oh.Provider,{value:p,children:[h&&p.visualElement?g.jsx(h,{visualElement:p.visualElement,...f}):null,NX(t,c,FX(x,p.visualElement,u),x,d,e,s)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const a=m.forwardRef(l);return a[YX]=t,a}function GX({layoutId:t}){const e=m.useContext(CO).id;return e&&t!==void 0?e+"-"+t:t}function HX(t,e){m.useContext(mQ).strict}function KX(t){const e=OQ(),{drag:n,layout:r}=e;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function JX(t,e){if(typeof Proxy>"u")return Af;const n=new Map,r=(s,o)=>Af(s,o,t,e),i=(s,o)=>r(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,Af(o,void 0,t,e)),n.get(o))})}const eL=(t,e)=>e.isSVG??rg(t)?new CV(e):new kV(e,{allowProjection:t!==m.Fragment});class tL extends ni{constructor(e){super(e),e.animationState||(e.animationState=jV(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ih(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let nL=0;class rL extends ni{constructor(){super(...arguments),this.id=nL++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"){const a=wi(this.node,o,l);if(a){const{transition:c,transitionEnd:u,...h}=a;for(const f in h)(s=this.node.getValue(f))==null||s.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const iL={animation:{Feature:tL},exit:{Feature:rL}};function Wl(t){return{point:{x:t.pageX,y:t.pageY}}}const sL=t=>e=>UO(e)&&t(e,Wl(e));function Bo(t,e,n,r){return Ql(t,e,sL(n),r)}const kQ=({current:t})=>t?t.ownerDocument.defaultView:null,_x=(t,e)=>Math.abs(t-e);function oL(t,e){const n=_x(t.x,e.x),r=_x(t.y,e.y);return Math.sqrt(n**2+r**2)}const Nx=new Set(["auto","scroll"]);class bQ{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ra(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Mf(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,x=oL(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!x)return;const{point:S}=d,{timestamp:O}=it;this.history.push({...S,timestamp:O});const{onStart:y,onMove:v}=this.handlers;p||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Ra(p,this.transformPagePoint),ke.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:x,onSessionEnd:S,resumeAnimation:O}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&O&&O(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Mf(d.type==="pointercancel"?this.lastMoveEventInfo:Ra(p,this.transformPagePoint),this.history);this.startEvent&&x&&x(d,y),S&&S(d,y)},!UO(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=Wl(e),c=Ra(a,this.transformPagePoint),{point:u}=c,{timestamp:h}=it;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Mf(c,this.history)),this.removeListeners=_l(Bo(this.contextWindow,"pointermove",this.handlePointerMove),Bo(this.contextWindow,"pointerup",this.handlePointerUp),Bo(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Nx.has(r.overflowX)||Nx.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,i),ke.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Hr(this.updatePoint)}}function Ra(t,e){return e?{point:e(t.point)}:t}function zx(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Mf({point:t},e){return{point:t,delta:zx(t,PQ(e)),offset:zx(t,lL(e)),velocity:aL(e,.1)}}function lL(t){return t[0]}function PQ(t){return t[t.length-1]}function aL(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=PQ(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>qt(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&i.timestamp-r.timestamp>qt(e)*2&&(r=t[1]);const s=an(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cL(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Ce(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Ce(n,t,r.max):Math.min(t,n)),t}function Wx(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function uL(t,{top:e,left:n,bottom:r,right:i}){return{x:Wx(t.x,n,i),y:Wx(t.y,e,r)}}function Ix(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function hL(t,e){return{x:Ix(t.x,e.x),y:Ix(t.y,e.y)}}function fL(t,e){let n=.5;const r=kt(t),i=kt(e);return i>r?n=kl(e.min,e.max-r,t.min):r>i&&(n=kl(t.min,t.max-i,e.min)),Jn(0,1,n)}function dL(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Yp=.35;function pL(t=Yp){return t===!1?t=0:t===!0&&(t=Yp),{x:Bx(t,"left","right"),y:Bx(t,"top","bottom")}}function Bx(t,e,n){return{min:Yx(t,e),max:Yx(t,n)}}function Yx(t,e){return typeof t=="number"?t:t[e]||0}const mL=new WeakMap;class OL{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=qe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(Wl(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:x}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zZ(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xn(O=>{let y=this.getAxisMotionValue(O).get()||0;if(Kn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[O];w&&(y=kt(w)*(parseFloat(y)/100))}}this.originPoint[O]=y}),x&&ke.update(()=>x(h,f),!1,!0),Xp(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:x,onDrag:S}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:O}=f;if(p&&this.currentDirection===null){this.currentDirection=yL(O),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,O),this.updateAxis("y",f.point,O),this.visualElement.render(),S&&ke.update(()=>S(h,f),!1,!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new bQ(e,{onSessionStart:s,onStart:o,onMove:l,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:kQ(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&ke.postRender(()=>l(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!ja(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=cL(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;e&&Wi(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=uL(r.layoutBox,e):this.constraints=!1,this.elastic=pL(n),i!==this.constraints&&!Wi(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Xn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=dL(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Wi(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=gV(r,i.root,this.visualElement.getTransformPagePoint());let o=hL(i.layout.layoutBox,s);if(n){const l=n(pV(o));this.hasMutatedConstraints=!!l,l&&(o=YP(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=Xn(u=>{if(!ja(u,n,this.currentDirection))return;let h=a&&a[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:r?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Xp(this.visualElement,e),r.start(IO(e,r,0,n,this.visualElement,!1))}stopAnimation(){Xn(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Xn(n=>{const{drag:r}=this.getProps();if(!ja(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n],a=s.get()||0;s.set(e[n]-Ce(o,l,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Wi(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Xn(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();i[o]=fL({min:a,max:a},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Xn(o=>{if(!ja(o,e,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(Ce(a,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;mL.set(this.visualElement,this);const e=this.visualElement.current,n=Bo(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&qZ(f);u&&h&&!d&&this.start(c)});let r;const i=()=>{const{dragConstraints:c}=this.getProps();Wi(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=gL(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ke.read(i);const l=Ql(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xn(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())});return()=>{l(),n(),o(),a&&a(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Yp,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function Fx(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function gL(t,e,n){const r=ex(t,Fx(n)),i=ex(e,Fx(n));return()=>{r(),i()}}function ja(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function yL(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class xL extends ni{constructor(e){super(e),this.removeGroupControls=un,this.removeListeners=un,this.controls=new OL(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||un}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ef=t=>(e,n)=>{t&&ke.update(()=>t(e,n),!1,!0)};class vL extends ni{constructor(){super(...arguments),this.removePointerDownListener=un}onPointerDown(e){this.session=new bQ(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kQ(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ef(e),onStart:Ef(n),onMove:Ef(r),onEnd:(s,o)=>{delete this.session,i&&ke.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Bo(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Rf=!1;class SL extends m.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),Rf&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Rf=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||ke.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),qO.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;Rf=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function QQ(t){const[e,n]=pQ(),r=m.useContext(CO);return g.jsx(SL,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(SQ),isPresent:e,safeToRemove:n})}const wL={pan:{Feature:vL},drag:{Feature:xL,ProjectionNode:dQ,MeasureLayout:QQ}};function qx(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&ke.postRender(()=>s(e,Wl(e)))}class kL extends ni{mount(){const{current:e}=this.node;e&&(this.unmount=IZ(e,(n,r)=>(qx(this.node,r,"Start"),i=>qx(this.node,i,"End"))))}unmount(){}}class bL extends ni{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_l(Ql(this.node.current,"focus",()=>this.onFocus()),Ql(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ux(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&ke.postRender(()=>s(e,Wl(e)))}class PL extends ni{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=GZ(e,(i,s)=>(Ux(this.node,s,"Start"),(o,{success:l})=>Ux(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Fp=new WeakMap,jf=new WeakMap,QL=t=>{const e=Fp.get(t.target);e&&e(t)},$L=t=>{t.forEach(QL)};function TL({root:t,...e}){const n=t||document;jf.has(n)||jf.set(n,{});const r=jf.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver($L,{root:t,...e})),r[i]}function CL(t,e,n){const r=TL(e);return Fp.set(t,n),r.observe(t),()=>{Fp.delete(t),r.unobserve(t)}}const AL={some:0,all:1};class ML extends ni{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var a;(a=this.stopObserver)==null||a.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:AL[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=CL(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(EL(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function EL({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const RL={inView:{Feature:ML},tap:{Feature:PL},focus:{Feature:bL},hover:{Feature:kL}},jL={layout:{ProjectionNode:dQ,MeasureLayout:QQ}},ZL={...iL,...RL,...wL,...jL},Gx=JX(ZL,eL);function ig({children:t,expandedContent:e,expandScale:n=.75,delay:r=300,className:i="",onClick:s}){const[o,l]=m.useState(!1),[a,c]=m.useState({x:0,y:0,w:0,h:0}),u=m.useRef(null),h=m.useRef(null),f=m.useRef(null),d=m.useRef(null),p=m.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),d.current&&(clearTimeout(d.current),d.current=null),l(!1)},[]),x=m.useCallback(()=>{if(!u.current)return;const Q=u.current.getBoundingClientRect();c({x:Q.left,y:Q.top,w:Q.width,h:Q.height}),l(!0)},[]),S=m.useCallback(()=>{o||(f.current&&clearTimeout(f.current),f.current=setTimeout(x,r))},[r,x,o]),O=m.useCallback(()=>{o||f.current&&(clearTimeout(f.current),f.current=null)},[o]);m.useEffect(()=>{if(!o)return;const Q=600,M=400;let T=!1;const V=setTimeout(()=>{T=!0},M),C=j=>{if(!T)return;const N=h.current;if(!N)return;const _=N.getBoundingClientRect(),I=20;j.clientX>=_.left-I&&j.clientX<=_.right+I&&j.clientY>=_.top-I&&j.clientY<=_.bottom+I?d.current&&(clearTimeout(d.current),d.current=null):d.current||(d.current=setTimeout(()=>{l(!1)},Q))};return window.addEventListener("mousemove",C),()=>{clearTimeout(V),d.current&&(clearTimeout(d.current),d.current=null),window.removeEventListener("mousemove",C)}},[o]);const y=typeof window<"u"?window.innerWidth:1440,v=typeof window<"u"?window.innerHeight:900,w=y*n,k=v*n,$=(y-w)/2,P=(v-k)/2;return g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:u,className:i,onMouseEnter:S,onMouseLeave:O,onClick:s,style:{opacity:o?0:1,transition:"opacity 100ms ease-out"},children:t}),g.jsx(TX,{children:o&&g.jsxs(g.Fragment,{children:[g.jsx(Gx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm",onClick:p}),g.jsx(Gx.div,{ref:h,initial:{left:a.x,top:a.y,width:a.w,height:a.h},animate:{left:$,top:P,width:w,height:k},exit:{left:a.x,top:a.y,width:a.w,height:a.h},transition:{type:"spring",stiffness:280,damping:28,mass:.8},className:"fixed z-50 overflow-hidden rounded-[16px] shadow-dialog",onClick:Q=>{Q.stopPropagation(),p(),s==null||s()},children:typeof e=="function"?e(p):e??t})]})})]})}function VL({previewUrl:t,name:e,comp:n,onSelect:r}){const i=m.useRef(null),s=m.useRef(null),[o,l]=m.useState({w:1920,h:1080}),[a,c]=m.useState(1),u=m.useCallback(()=>{const p=i.current;if(!p)return;const x=Math.min(p.clientWidth/o.w,p.clientHeight/o.h);c(x)},[o]);m.useEffect(()=>{u();const p=i.current;if(!p)return;const x=new ResizeObserver(u);return x.observe(p),()=>x.disconnect()},[u]);const h=m.useCallback(()=>{const p=s.current;if(!p)return;try{const O=p.contentDocument;if(O){const y=O.querySelector("[data-composition-id]");if(y){const v=parseInt(y.getAttribute("data-width")??"0",10),w=parseInt(y.getAttribute("data-height")??"0",10);v>0&&w>0&&l({w:v,h:w})}}}catch{}let x=0;const S=setInterval(()=>{try{const O=p.contentWindow;if(O!=null&&O.__player){O.__player.seek(.5),O.__player.play(),clearInterval(S);return}if(O!=null&&O.__timelines){const y=Object.keys(O.__timelines),v=y.length>0?O.__timelines[y[y.length-1]]:null;v&&(v.seek(.5),v.play(),clearInterval(S))}}catch{}++x>15&&clearInterval(S)},200)},[]),f=i.current?(i.current.clientWidth-o.w*a)/2:0,d=i.current?(i.current.clientHeight-o.h*a)/2:0;return g.jsxs("div",{className:"w-full h-full bg-neutral-950 rounded-[16px] overflow-hidden flex flex-col",children:[g.jsx("div",{ref:i,className:"flex-1 min-h-0 relative overflow-hidden bg-black",children:g.jsx("iframe",{ref:s,src:t,sandbox:"allow-scripts allow-same-origin",onLoad:h,className:"absolute border-none",style:{left:Math.max(0,f),top:Math.max(0,d),width:o.w,height:o.h,transformOrigin:"0 0",transform:`scale(${a})`},tabIndex:-1})}),g.jsxs("div",{className:"px-5 py-3 bg-neutral-900 border-t border-neutral-800/50 flex items-center justify-between flex-shrink-0",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-neutral-200",children:e}),g.jsx("div",{className:"text-[10px] text-neutral-600 font-mono mt-0.5",children:n})]}),g.jsx("button",{onClick:p=>{p.stopPropagation(),r()},className:"px-4 py-1.5 text-xs font-semibold text-[#09090B] bg-[#3CE6AC] rounded-lg hover:brightness-110 transition-colors",children:"Open"})]})]})}function XL({projectId:t,comp:e,isActive:n,onSelect:r}){const i=e.replace(/^compositions\//,"").replace(/\.html$/,""),s=`/api/projects/${t}/thumbnail/${e}?t=0.5`,o=`/api/projects/${t}/preview/comp/${e}`,l=g.jsxs("div",{className:`w-full text-left px-2 py-1.5 flex items-center gap-2.5 transition-colors cursor-pointer ${n?"bg-[#3CE6AC]/10 border-l-2 border-[#3CE6AC]":"border-l-2 border-transparent hover:bg-neutral-800/50"}`,children:[g.jsx("div",{className:"w-20 h-[45px] rounded overflow-hidden bg-neutral-900 flex-shrink-0",children:g.jsx("img",{src:s,alt:i,loading:"lazy",className:"w-full h-full object-cover",onError:a=>{a.target.style.display="none"}})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate block",children:i}),g.jsx("span",{className:"text-[9px] text-neutral-600 truncate block",children:e})]})]});return g.jsx(ig,{expandedContent:a=>g.jsx(VL,{previewUrl:o,name:i,comp:e,onSelect:()=>{a(),r()}}),onClick:r,expandScale:.5,delay:500,children:l})}const LL=m.memo(function({projectId:e,compositions:n,activeComposition:r,onSelect:i}){return n.length===0?g.jsx("div",{className:"flex-1 flex items-center justify-center px-4",children:g.jsx("p",{className:"text-xs text-neutral-600 text-center",children:"No compositions found"})}):g.jsx("div",{className:"flex-1 overflow-y-auto",children:n.map(s=>g.jsx(XL,{projectId:e,comp:s,isActive:r===s,onSelect:()=>i(s)},s))})}),DL=/\.(mp4|webm|mov|mp3|wav|ogg|m4a|jpg|jpeg|png|gif|webp|svg)$/i,_L=/\.(jpg|jpeg|png|gif|webp|svg)$/i,NL=/\.(mp4|webm|mov)$/i,zL=/\.(mp3|wav|ogg|m4a)$/i;function WL({serveUrl:t,name:e,isImage:n,isVideo:r,isAudio:i}){return g.jsxs("div",{className:"w-16 h-10 rounded overflow-hidden bg-neutral-900 flex-shrink-0 relative",children:[n&&g.jsx("img",{src:t,alt:e,loading:"lazy",className:"w-full h-full object-cover",onError:s=>{s.target.style.display="none"}}),r&&g.jsxs(g.Fragment,{children:[g.jsx("video",{src:t,muted:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"}),g.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"white",className:"opacity-80",children:g.jsx("polygon",{points:"6,3 20,12 6,21"})})})]}),i&&g.jsx("div",{className:"w-full h-full flex items-center justify-center bg-neutral-900",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-purple-400",children:[g.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("circle",{cx:"6",cy:"18",r:"3"}),g.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}),!n&&!r&&!i&&g.jsx("div",{className:"w-full h-full flex items-center justify-center bg-neutral-900",children:g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[g.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function IL({serveUrl:t,name:e,asset:n,isImage:r,isVideo:i,isAudio:s,onCopy:o}){return g.jsxs("div",{className:"w-full h-full bg-neutral-950 rounded-[16px] overflow-hidden flex flex-col",children:[g.jsxs("div",{className:"flex-1 min-h-0 flex items-center justify-center bg-black p-4",children:[r&&g.jsx("img",{src:t,alt:e,className:"max-w-full max-h-full object-contain rounded"}),i&&g.jsx("video",{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"max-w-full max-h-full object-contain rounded"}),s&&g.jsxs("div",{className:"flex flex-col items-center gap-4",children:[g.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-purple-400",children:[g.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("circle",{cx:"6",cy:"18",r:"3"}),g.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),g.jsx("audio",{src:t,controls:!0,autoPlay:!0,className:"w-64"})]})]}),g.jsxs("div",{className:"px-5 py-3 bg-neutral-900 border-t border-neutral-800/50 flex items-center justify-between flex-shrink-0",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-neutral-200",children:e}),g.jsx("div",{className:"text-[10px] text-neutral-600 font-mono mt-0.5",children:n})]}),g.jsx("button",{onClick:l=>{l.stopPropagation(),o()},className:"px-4 py-1.5 text-xs font-semibold text-[#09090B] bg-[#3CE6AC] rounded-lg hover:brightness-110 transition-colors",children:"Copy Path"})]})]})}function BL({projectId:t,asset:e,onCopy:n,isCopied:r}){const i=e.split("/").pop()??e,s=`/api/projects/${t}/preview/${e}`,o=_L.test(e),l=NL.test(e),a=zL.test(e),c=o||l||a,u=g.jsxs("div",{className:`w-full text-left px-2 py-1.5 flex items-center gap-2.5 transition-colors cursor-pointer ${r?"bg-[#3CE6AC]/10 border-l-2 border-[#3CE6AC]":"border-l-2 border-transparent hover:bg-neutral-800/50"}`,children:[g.jsx(WL,{serveUrl:s,name:i,isImage:o,isVideo:l,isAudio:a}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate block",children:i}),r?g.jsx("span",{className:"text-[9px] text-[#3CE6AC]",children:"Copied!"}):g.jsx("span",{className:"text-[9px] text-neutral-600 truncate block",children:e})]})]});return c?g.jsx(ig,{expandedContent:h=>g.jsx(IL,{serveUrl:s,name:i,asset:e,isImage:o,isVideo:l,isAudio:a,onCopy:()=>{h(),n(e)}}),onClick:()=>n(e),expandScale:.45,delay:500,children:u}):g.jsx("button",{type:"button",onClick:()=>n(e),title:"Click to copy path",className:"w-full",children:u})}const YL=m.memo(function({projectId:e,assets:n,onImport:r}){const i=m.useRef(null),[s,o]=m.useState(!1),[l,a]=m.useState(null),c=m.useCallback(f=>{f.preventDefault(),o(!1),f.dataTransfer.files.length&&(r==null||r(f.dataTransfer.files))},[r]),u=m.useCallback(async f=>{try{await navigator.clipboard.writeText(f),a(f),setTimeout(()=>a(null),1500)}catch{}},[]),h=n.filter(f=>DL.test(f));return g.jsxs("div",{className:`flex-1 flex flex-col min-h-0 transition-colors ${s?"bg-blue-950/20":""}`,onDragOver:f=>{f.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:c,children:[r&&g.jsxs("div",{className:"px-3 py-2 border-b border-neutral-800/40 flex-shrink-0",children:[g.jsxs("button",{onClick:()=>{var f;return(f=i.current)==null?void 0:f.click()},className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-[11px] rounded-lg border border-dashed border-neutral-700/50 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600 transition-colors",children:[g.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:g.jsx("path",{d:"M12 5v14M5 12h14"})}),"Import media"]}),g.jsx("input",{ref:i,type:"file",accept:"video/*,image/*,audio/*",multiple:!0,className:"hidden",onChange:f=>{var d;(d=f.target.files)!=null&&d.length&&(r(f.target.files),f.target.value="")}})]}),g.jsx("div",{className:"flex-1 overflow-y-auto",children:h.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 gap-2",children:[g.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-700",children:[g.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("polyline",{points:"17 8 12 3 7 8",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15",strokeLinecap:"round"})]}),g.jsx("p",{className:"text-[10px] text-neutral-600 text-center",children:"Drop media files here"})]}):h.map(f=>g.jsx(BL,{projectId:e,asset:f,onCopy:u,isCopied:l===f},f))})]})}),$Q="hf-studio-sidebar-tab";function FL(){return localStorage.getItem($Q)==="assets"?"assets":"compositions"}const qL=m.memo(function({width:e=240,projectId:n,compositions:r,assets:i,activeComposition:s,onSelectComposition:o,onImportFiles:l}){const[a,c]=m.useState(FL),u=m.useCallback(h=>{c(h),localStorage.setItem($Q,h)},[]);return Ot(()=>{const h=f=>{!f.metaKey&&!f.ctrlKey||(f.key==="1"&&(f.preventDefault(),u("compositions")),f.key==="2"&&(f.preventDefault(),u("assets")))};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)}),g.jsxs("div",{className:"flex flex-col h-full bg-neutral-950 border-r border-neutral-800/50",style:{width:e},children:[g.jsxs("div",{className:"flex border-b border-neutral-800/50 flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:()=>u("compositions"),className:`flex-1 py-2 text-[11px] font-medium transition-colors ${a==="compositions"?"text-neutral-200 border-b-2 border-blue-500":"text-neutral-500 hover:text-neutral-400"}`,children:"Compositions"}),g.jsx("button",{type:"button",onClick:()=>u("assets"),className:`flex-1 py-2 text-[11px] font-medium transition-colors ${a==="assets"?"text-neutral-200 border-b-2 border-blue-500":"text-neutral-500 hover:text-neutral-400"}`,children:"Assets"})]}),a==="compositions"?g.jsx(LL,{projectId:n,compositions:r,activeComposition:s,onSelect:o}):g.jsx(YL,{projectId:n,assets:i,onImport:l})]})});function UL(t){if(t<1e3)return`${t}ms`;const e=Math.round(t/1e3);return e<60?`${e}s`:`${Math.floor(e/60)}m ${e%60}s`}function GL(t){const e=Date.now()-t;return e<6e4?"just now":e<36e5?`${Math.floor(e/6e4)}m ago`:`${Math.floor(e/36e5)}h ago`}const HL=m.memo(function({job:e,onDelete:n}){const[r,i]=m.useState(!1),s=m.useCallback(()=>{const o=document.createElement("a");o.href=`/api/render/${e.id}/download`,o.download=e.filename,o.click()},[e.id,e.filename]);return g.jsx("div",{onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1),className:"px-3 py-2.5 border-b border-neutral-800/30 last:border-0",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"flex-shrink-0",children:[e.status==="rendering"&&g.jsx("div",{className:"w-2 h-2 rounded-full bg-[#3CE6AC] animate-pulse"}),e.status==="complete"&&g.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400"}),e.status==="failed"&&g.jsx("div",{className:"w-2 h-2 rounded-full bg-red-400"}),e.status==="cancelled"&&g.jsx("div",{className:"w-2 h-2 rounded-full bg-neutral-600"})]}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate",children:e.filename}),e.durationMs&&g.jsx("span",{className:"text-[9px] text-neutral-600 flex-shrink-0",children:UL(e.durationMs)})]}),e.status==="rendering"&&g.jsxs("div",{className:"mt-1",children:[g.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[g.jsx("span",{className:"text-[9px] text-neutral-500",children:e.stage||"Rendering"}),g.jsxs("span",{className:"text-[9px] font-mono text-[#3CE6AC]",children:[e.progress,"%"]})]}),g.jsx("div",{className:"w-full h-1 bg-neutral-800 rounded-full overflow-hidden",children:g.jsx("div",{className:"h-full bg-[#3CE6AC] rounded-full transition-all duration-300",style:{width:`${e.progress}%`}})})]}),e.status==="failed"&&e.error&&g.jsx("span",{className:"text-[9px] text-red-400 mt-0.5 block",children:e.error}),e.status!=="rendering"&&g.jsx("span",{className:"text-[9px] text-neutral-600",children:GL(e.createdAt)})]}),r&&g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.status==="complete"&&g.jsx("button",{onClick:s,className:"p-1 rounded text-neutral-500 hover:text-green-400 transition-colors",title:"Download",children:g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),g.jsx("polyline",{points:"7 10 12 15 17 10"}),g.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),g.jsx("button",{onClick:n,className:"p-1 rounded text-neutral-500 hover:text-red-400 transition-colors",title:"Remove",children:g.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:g.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]})})});function KL({onStartRender:t,isRendering:e}){const[n,r]=m.useState("mp4");return g.jsxs("div",{className:"flex items-center gap-0.5",children:[g.jsxs("select",{value:n,onChange:i=>r(i.target.value),disabled:e,className:"h-5 px-1 text-[10px] rounded-l bg-neutral-800 border border-neutral-700 text-neutral-300 outline-none disabled:opacity-50",children:[g.jsx("option",{value:"mp4",children:"MP4"}),g.jsx("option",{value:"webm",children:"WebM"})]}),g.jsx("button",{onClick:()=>t(n),disabled:e,className:"flex items-center gap-1 px-2 py-0.5 text-[10px] font-semibold rounded-r bg-[#3CE6AC] text-[#09090B] hover:brightness-110 transition-colors disabled:opacity-50",children:e?"Rendering...":"Export"})]})}const JL=m.memo(function({jobs:e,onDelete:n,onClearCompleted:r,onStartRender:i,isRendering:s}){const o=m.useRef(null),l=m.useRef(e.length);e.length>l.current&&o.current&&queueMicrotask(()=>{var c;(c=o.current)==null||c.scrollTo({top:o.current.scrollHeight,behavior:"smooth"})}),l.current=e.length;const a=e.filter(c=>c.status!=="rendering").length;return g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-800/50 flex-shrink-0",children:[g.jsxs("span",{className:"text-[11px] font-medium text-neutral-500 uppercase tracking-wider",children:["Renders (",e.length,")"]}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&g.jsx("button",{onClick:r,className:"text-[10px] text-neutral-600 hover:text-neutral-400 transition-colors",children:"Clear"}),g.jsx(KL,{onStartRender:i,isRendering:s})]})]}),g.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",children:e.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 gap-2",children:[g.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-700",children:[g.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M7 2v20M17 2v20M2 12h20M2 7h5M2 17h5M17 17h5M17 7h5",strokeLinecap:"round",strokeLinejoin:"round"})]}),g.jsx("p",{className:"text-[10px] text-neutral-600 text-center",children:"No renders yet"})]}):e.map(c=>g.jsx(HL,{job:c,onDelete:()=>n(c.id)},c.id))})]})});function eD(t){const[e,n]=m.useState([]),r=m.useRef(null),i=m.useRef(null),s=m.useCallback(async()=>{if(t)try{const c=await fetch(`/api/projects/${t}/renders`);if(!c.ok)return;const u=await c.json();Array.isArray(u.renders)&&n(h=>{const f=new Set(h.map(p=>p.id)),d=u.renders.filter(p=>!f.has(p.id)).map(p=>({id:p.id,status:p.status==="failed"?"failed":"complete",progress:100,filename:p.filename,createdAt:p.createdAt,durationMs:p.durationMs}));return[...h,...d]})}catch{}},[t]);m.useEffect(()=>{s()},[s]);const o=m.useCallback(async(c=30,u="standard",h="mp4")=>{if(!t)return;const f=Date.now();let d;try{d=await fetch(`/api/projects/${t}/render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fps:c,quality:u,format:h})})}catch{const y={id:crypto.randomUUID(),status:"failed",progress:0,error:"Could not reach render server. Use `hyperframes render` from the CLI instead.",filename:"Export failed",createdAt:f};n(v=>[...v,y]);return}if(!d.ok){const y={id:crypto.randomUUID(),status:"failed",progress:0,error:`Server error (${d.status}). Check the terminal for details.`,filename:"Export failed",createdAt:f};n(v=>[...v,y]);return}const{jobId:p}=await d.json(),S={id:p,status:"rendering",progress:0,filename:`${p}${h==="webm"?".webm":".mp4"}`,createdAt:f};n(y=>[...y,S]),i.current=p;const O=new EventSource(`/api/render/${p}/progress`);return r.current=O,O.addEventListener("progress",y=>{try{const v=JSON.parse(y.data);n(w=>w.map(k=>k.id===p?{...k,progress:v.progress??k.progress,stage:v.stage??v.message??k.stage,status:v.status==="complete"?"complete":v.status==="failed"?"failed":k.status,durationMs:v.status==="complete"?Date.now()-f:void 0}:k)),(v.status==="complete"||v.status==="failed")&&(O.close(),i.current=null)}catch{}}),O.onerror=()=>{O.close(),n(y=>y.map(v=>v.id===p&&v.status==="rendering"?{...v,status:"failed",error:"Connection lost. Is the render server running?"}:v)),i.current=null},p},[t]),l=m.useCallback(async c=>{try{await fetch(`/api/render/${c}`,{method:"DELETE"})}catch{}n(u=>u.filter(h=>h.id!==c))},[]),a=m.useCallback(()=>{n(c=>c.filter(u=>u.status==="rendering"))},[]);return m.useEffect(()=>()=>{var c;(c=r.current)==null||c.close(),r.current=null},[t]),{jobs:e,startRender:o,deleteRender:l,clearCompleted:a,isRendering:e.some(c=>c.status==="rendering")}}const TQ=2,tD=1,Hx=TQ+tD;function nD(t,e){const n=[],r=Math.floor(t.length/e);if(r===0)return Array(e).fill(0);for(let s=0;s<e;s++){let o=0;const l=s*r,a=Math.min(l+r,t.length);for(let c=l;c<a;c++){const u=Math.abs(t[c]??0);u>o&&(o=u)}n.push(o)}const i=Math.max(...n,.001);return n.map(s=>s/i)}function rD(t,e){let n=0;for(let s=0;s<t.length;s++)n=(n<<5)-n+t.charCodeAt(s)|0;n=Math.abs(n)||42;const r=()=>(n=n*16807%2147483647,(n&2147483647)/2147483647),i=[];for(let s=0;s<e;s++){const o=s/e,l=.3+.3*Math.sin(o*Math.PI*3.2)+.2*Math.sin(o*Math.PI*7.1);i.push(Math.max(.05,Math.min(1,l*(.4+.6*r()))))}return i}const Zf=new Map,iD=m.memo(function({audioUrl:e,label:n,labelColor:r}){const i=m.useRef(null),s=m.useRef(null),o=m.useRef(null),[l,a]=m.useState(Zf.get(e)??null);m.useEffect(()=>{if(l||!e)return;const h=new AbortController;return fetch(e,{signal:h.signal}).then(f=>f.arrayBuffer()).then(f=>{const d=new AudioContext;return d.decodeAudioData(f).finally(()=>d.close())}).then(f=>{if(h.signal.aborted)return;const d=f.getChannelData(0),p=nD(d,4e3);Zf.set(e,p),a(p)}).catch(()=>{if(h.signal.aborted)return;const f=rD(e,4e3);Zf.set(e,f),a(f)}),()=>h.abort()},[e,l]);const c=m.useCallback(()=>{const h=i.current,f=s.current;if(!h||!f||!l)return;const d=h.clientWidth||400,p=Math.min(Math.floor(d/Hx),l.length);let x="";for(let S=0;S<p;S++){const O=Math.floor(S/p*l.length),y=l[O]??0,v=Math.max(3,Math.round(y*100)),w=(.45+y*.4).toFixed(2);x+=`<div style="position:absolute;bottom:0;left:${S*Hx}px;width:${TQ}px;height:${v}%;background:rgba(75,163,210,${w})"></div>`}f.innerHTML=x},[l]),u=m.useCallback(h=>{var f;(f=o.current)==null||f.disconnect(),i.current=h,h&&(c(),o.current=new ResizeObserver(()=>c()),o.current.observe(h))},[c]);return m.useEffect(()=>{c()},[c]),m.useEffect(()=>()=>{var h;(h=o.current)==null||h.disconnect()},[]),g.jsxs("div",{ref:u,className:"absolute inset-0 overflow-hidden",children:[g.jsx("div",{ref:s,className:"absolute left-0 right-0 bottom-0",style:{top:16}}),!l&&g.jsx("div",{className:"absolute left-0 right-0 bottom-0 animate-pulse",style:{top:16,background:"linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)"}}),g.jsx("div",{className:"absolute top-0 left-0 right-0 px-1.5 py-0.5 z-10",children:g.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:r,textShadow:"0 1px 3px rgba(0,0,0,0.9)"},children:n})})]})}),CQ=/\.(jpg|jpeg|png|gif|webp|svg|ico)$/i,AQ=/\.(mp4|webm|mov)$/i,MQ=/\.(mp3|wav|ogg|m4a|aac)$/i,sD=/\.(woff|woff2|ttf|otf|eot)$/i;function Kx(t){return CQ.test(t)||AQ.test(t)||MQ.test(t)||sD.test(t)}function oD({projectId:t,filePath:e}){const n=`/api/projects/${t}/preview/${e}`,r=e.split("/").pop()??e;return CQ.test(e)?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[g.jsx("img",{src:n,alt:r,className:"max-w-full max-h-[70%] object-contain rounded border border-neutral-800"}),g.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):AQ.test(e)?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[g.jsx("video",{src:n,controls:!0,className:"max-w-full max-h-[70%] rounded border border-neutral-800"}),g.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):MQ.test(e)?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-3",children:[g.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[g.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("circle",{cx:"6",cy:"18",r:"3"}),g.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),g.jsx("audio",{src:n,controls:!0,className:"w-full max-w-[280px]"}),g.jsx("span",{className:"text-[11px] text-neutral-500 font-mono",children:e})]}):g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[g.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[g.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]}),g.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:r}),g.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),g.jsx("span",{className:"text-[10px] text-neutral-600",children:"Binary file — preview not available"})]})}function lD({src:t}){const e=m.useRef(null),n=m.useRef(null),[r,i]=m.useState({w:1920,h:1080}),[s,o]=m.useState(1);m.useEffect(()=>{const u=e.current;if(!u)return;const h=()=>{const d=u.clientWidth,p=u.clientHeight,x=Math.min(d/r.w,p/r.h);o(x)};h();const f=new ResizeObserver(h);return f.observe(u),()=>f.disconnect()},[r]);const l=m.useCallback(()=>{const u=n.current;if(!u)return;let h=0;const f=setInterval(()=>{try{const d=u.contentDocument;if(d){const x=d.querySelector("[data-composition-id]");if(x){const S=parseInt(x.getAttribute("data-width")??"0",10),O=parseInt(x.getAttribute("data-height")??"0",10);S>0&&O>0&&i({w:S,h:O})}}const p=u.contentWindow;p!=null&&p.__player&&(p.__player.seek(2),p.__player.play(),clearInterval(f))}catch{}++h>25&&clearInterval(f)},200)},[]),a=e.current?(e.current.clientWidth-r.w*s)/2:0,c=e.current?(e.current.clientHeight-r.h*s)/2:0;return g.jsx("div",{ref:e,className:"w-full h-full relative overflow-hidden bg-black",children:g.jsx("iframe",{ref:n,src:t,sandbox:"allow-scripts allow-same-origin",onLoad:l,className:"absolute border-none",style:{left:Math.max(0,a),top:Math.max(0,c),width:r.w,height:r.h,transformOrigin:"0 0",transform:`scale(${s})`}})})}function aD({project:t,onSelect:e}){const n=`/api/projects/${t.id}/thumbnail/index.html?t=0.5`,r=`/api/projects/${t.id}/preview`,i=g.jsxs("div",{className:"rounded-xl overflow-hidden bg-neutral-900 border border-neutral-800/60 hover:border-[#3CE6AC]/30 hover:shadow-lg hover:shadow-[#3CE6AC]/5 transition-all duration-200 cursor-pointer",children:[g.jsx("div",{className:"aspect-video bg-neutral-950 relative overflow-hidden flex items-center justify-center",children:g.jsx("img",{src:n,alt:t.title??t.id,loading:"lazy",className:"max-w-full max-h-full object-contain",onError:s=>{s.target.style.display="none"}})}),g.jsxs("div",{className:"px-3.5 py-3",children:[g.jsx("div",{className:"text-sm font-medium text-neutral-200 truncate",children:t.title??t.id}),g.jsx("div",{className:"text-[10px] text-neutral-600 font-mono truncate mt-0.5",children:t.id})]})]});return g.jsx(ig,{expandedContent:s=>g.jsxs("div",{className:"w-full h-full bg-neutral-950 rounded-[16px] overflow-hidden flex flex-col",children:[g.jsx("div",{className:"flex-1 min-h-0",children:g.jsx(lD,{src:r})}),g.jsxs("div",{className:"px-5 py-3 bg-neutral-900 border-t border-neutral-800/50 flex items-center justify-between flex-shrink-0",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-neutral-200",children:t.title??t.id}),g.jsx("div",{className:"text-[10px] text-neutral-600 font-mono mt-0.5",children:t.id})]}),g.jsx("button",{onClick:o=>{o.stopPropagation(),s(),e()},className:"px-4 py-1.5 text-xs font-semibold text-[#09090B] bg-[#3CE6AC] rounded-lg hover:brightness-110 transition-colors",children:"Open"})]})]}),onClick:e,expandScale:.6,delay:400,children:i})}function cD({onSelect:t}){const[e,n]=m.useState([]),[r,i]=m.useState(!0);return Ot(()=>{fetch("/api/projects").then(s=>s.json()).then(s=>{n(s.projects??[]),i(!1)}).catch(()=>i(!1))}),g.jsxs("div",{className:"h-screen w-screen bg-neutral-950 overflow-y-auto",children:[g.jsxs("div",{className:"max-w-4xl mx-auto px-6 pt-16 pb-8",children:[g.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[g.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 512 512",className:"flex-shrink-0",children:[g.jsx("rect",{width:"512",height:"512",rx:"115",fill:"#1A1913"}),g.jsxs("g",{strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("polyline",{points:"156,176 76,256 156,336",fill:"none",stroke:"#7B7568",strokeWidth:"32"}),g.jsx("line",{x1:"206",y1:"346",x2:"286",y2:"166",stroke:"#D8D3C5",strokeWidth:"32"}),g.jsx("polygon",{points:"336,176 436,256 336,336",fill:"#3CE6AC",stroke:"#3CE6AC",strokeWidth:"32"})]})]}),g.jsx("h1",{className:"text-2xl font-bold text-neutral-100 tracking-tight",children:"HyperFrames Studio"})]}),g.jsx("p",{className:"text-sm text-neutral-500 ml-11",children:"Your projects"})]}),g.jsx("div",{className:"max-w-4xl mx-auto px-6 pb-16",children:r?g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:[1,2,3].map(s=>g.jsx("div",{className:"aspect-video rounded-xl bg-neutral-900 animate-pulse"},s))}):e.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-4",children:[g.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 512 512",className:"opacity-20",children:[g.jsx("rect",{width:"512",height:"512",rx:"115",fill:"#1A1913"}),g.jsxs("g",{strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("polyline",{points:"156,176 76,256 156,336",fill:"none",stroke:"#7B7568",strokeWidth:"32"}),g.jsx("line",{x1:"206",y1:"346",x2:"286",y2:"166",stroke:"#D8D3C5",strokeWidth:"32"}),g.jsx("polygon",{points:"336,176 436,256 336,336",fill:"#3CE6AC",stroke:"#3CE6AC",strokeWidth:"32"})]})]}),g.jsxs("div",{className:"text-center",children:[g.jsx("p",{className:"text-sm text-neutral-400 font-medium",children:"No projects yet"}),g.jsxs("p",{className:"text-xs text-neutral-600 mt-1",children:["Run"," ",g.jsx("code",{className:"px-1.5 py-0.5 rounded bg-neutral-800 text-[#3CE6AC] text-[11px]",children:"hyperframes init"})," ","to create one"]})]})]}):g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:e.map(s=>g.jsx(aD,{project:s,onSelect:()=>t(s.id)},s.id))})})]})}function uD({findings:t,projectId:e,onClose:n}){const r=t.filter(c=>c.severity==="error"),i=t.filter(c=>c.severity==="warning"),s=t.length>0,[o,l]=m.useState(!1),a=async()=>{const c=t.map(h=>{let f=`[${h.severity}] ${h.message}`;return h.file&&(f+=`
|
|
85
|
+
File: ${h.file}`),h.fixHint&&(f+=`
|
|
86
|
+
Fix: ${h.fixHint}`),f}),u=`Fix these HyperFrames lint issues for project "${e}":
|
|
87
|
+
|
|
88
|
+
Project path: ${window.location.href}
|
|
89
|
+
|
|
90
|
+
${c.join(`
|
|
91
|
+
|
|
92
|
+
`)}`;try{await navigator.clipboard.writeText(u),l(!0),setTimeout(()=>l(!1),2e3)}catch{}};return g.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:n,children:g.jsxs("div",{className:"bg-neutral-950 border border-neutral-800 rounded-xl shadow-2xl w-full max-w-xl max-h-[80vh] flex flex-col overflow-hidden",onClick:c=>c.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[s?g.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500/10 flex items-center justify-center",children:g.jsx(Fa,{size:18,className:"text-red-400",weight:"fill"})}):g.jsx("div",{className:"w-8 h-8 rounded-full bg-[#3CE6AC]/10 flex items-center justify-center",children:g.jsx(gw,{size:18,className:"text-[#3CE6AC]",weight:"fill"})}),g.jsxs("div",{children:[g.jsx("h2",{className:"text-sm font-semibold text-neutral-200",children:s?`${r.length} error${r.length!==1?"s":""}, ${i.length} warning${i.length!==1?"s":""}`:"All checks passed"}),g.jsx("p",{className:"text-xs text-neutral-500",children:"HyperFrame Lint Results"})]})]}),g.jsx("button",{onClick:n,className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800 transition-colors",children:g.jsx(kw,{size:16})})]}),s&&g.jsx("div",{className:"flex items-center justify-end px-5 py-2 border-b border-neutral-800/50",children:g.jsx("button",{onClick:a,className:`px-3 py-1 text-xs font-medium rounded-lg transition-colors ${o?"bg-green-600 text-white":"bg-[#3CE6AC] hover:bg-[#3CE6AC]/80 text-white"}`,children:o?"Copied!":"Copy to Agent"})}),g.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-3",children:[!s&&g.jsx("div",{className:"py-8 text-center text-neutral-500 text-sm",children:"No errors or warnings found. Your composition looks good!"}),r.map((c,u)=>g.jsx("div",{className:"py-3 border-b border-neutral-800/50 last:border-0",children:g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx(Fa,{size:14,className:"text-red-400 flex-shrink-0 mt-0.5",weight:"fill"}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"text-sm text-neutral-200",children:c.message}),c.file&&g.jsx("p",{className:"text-xs text-neutral-600 font-mono mt-0.5",children:c.file}),c.fixHint&&g.jsxs("div",{className:"flex items-start gap-1 mt-1.5",children:[g.jsx(Xc,{size:10,className:"text-[#3CE6AC] flex-shrink-0 mt-0.5"}),g.jsx("p",{className:"text-xs text-[#3CE6AC]",children:c.fixHint})]})]})]})},`e-${u}`)),i.map((c,u)=>g.jsx("div",{className:"py-3 border-b border-neutral-800/50 last:border-0",children:g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx(Fa,{size:14,className:"text-amber-400 flex-shrink-0 mt-0.5"}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"text-sm text-neutral-300",children:c.message}),c.file&&g.jsx("p",{className:"text-xs text-neutral-600 font-mono mt-0.5",children:c.file}),c.fixHint&&g.jsxs("div",{className:"flex items-start gap-1 mt-1.5",children:[g.jsx(Xc,{size:10,className:"text-[#3CE6AC] flex-shrink-0 mt-0.5"}),g.jsx("p",{className:"text-xs text-[#3CE6AC]",children:c.fixHint})]})]})]})},`w-${u}`))]})]})})}function hD(){const[t,e]=m.useState(null),[n,r]=m.useState(!0);Ot(()=>{const A=window.location.hash,B=A.match(/project\/([^/]+)/),ae=A.match(/session\/([^/]+)/);B?(e(B[1]),r(!1)):ae?fetch(`/api/resolve-session/${ae[1]}`).then(de=>de.json()).then(de=>{de.projectId&&(window.location.hash=`#project/${de.projectId}`,e(de.projectId)),r(!1)}).catch(()=>r(!1)):r(!1)});const[i,s]=m.useState(null),[o,l]=m.useState("code"),[a,c]=m.useState(null),[u,h]=m.useState([]),[f,d]=m.useState(new Map),p=eD(t),[x,S]=m.useState(240),[O,y]=m.useState(400),[v,w]=m.useState(!1),[k,$]=m.useState(!1),P=m.useRef(null),Q=a?`/api/projects/${t}/preview/comp/${a}`:null,M=m.useCallback((A,B)=>{const ae=J.current;if(!ae)return null;let de=A.compositionSrc;if(de&&f.size>0){const be=f.get(A.id)||f.get(de.replace(/^compositions\//,"").replace(/\.html$/,""));be&&(de=be)}if(de)return g.jsx(Zh,{previewUrl:`/api/projects/${ae}/preview/comp/${de}`,label:A.id||A.tag,labelColor:B.label,seekTime:0,duration:A.duration});if(Q&&A.duration>0)return g.jsx(Zh,{previewUrl:Q,label:A.id||A.tag,labelColor:B.label,seekTime:A.start,duration:A.duration});if(A.tag==="audio"){const be=A.src?A.src.startsWith("http")?A.src:`/api/projects/${ae}/preview/${A.src}`:"";return g.jsx(iD,{audioUrl:be,label:A.id||A.tag,labelColor:B.label})}if((A.tag==="video"||A.tag==="img")&&A.src){const be=A.src.startsWith("http")?A.src:`/api/projects/${ae}/preview/${A.src}`;return g.jsx(S5,{videoSrc:be,label:A.id||A.tag,labelColor:B.label,duration:A.duration})}if(A.tag==="div"&&A.duration>0){const be=`/api/projects/${ae}/preview`;return g.jsx(Zh,{previewUrl:be,label:A.id||A.tag,labelColor:B.label,seekTime:A.start,duration:A.duration})}return null},[f,Q]),[T,V]=m.useState(null),[C,j]=m.useState(!1),[N,_]=m.useState(0),I=m.useRef(null),J=m.useRef(t),E=m.useRef(null);Ot(()=>{const A=()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>_(ae=>ae+1),400)},B=new EventSource("/api/events");return B.addEventListener("file-change",A),()=>B.close()}),J.current=t,m.useEffect(()=>{if(!t)return;let A=!1;return fetch(`/api/projects/${t}`).then(B=>B.json()).then(B=>{!A&&B.files&&h(B.files)}).catch(()=>{}),()=>{A=!0}},[t]);const D=m.useCallback(A=>{window.location.hash=`#project/${A}`,e(A),c(null),s(null),d(new Map),h([])},[]),L=m.useCallback(A=>{const B=J.current;if(B){if(Kx(A)){s({path:A,content:null});return}fetch(`/api/projects/${B}/files/${encodeURIComponent(A)}`).then(ae=>ae.json()).then(ae=>{ae.content!=null&&s({path:A,content:ae.content})}).catch(()=>{})}},[]),q=m.useRef(i==null?void 0:i.path);q.current=i==null?void 0:i.path;const G=m.useCallback(A=>{const B=J.current,ae=q.current;!B||!ae||fetch(`/api/projects/${B}/files/${encodeURIComponent(ae)}`,{method:"PUT",headers:{"Content-Type":"text/plain"},body:A}).then(()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>_(de=>de+1),600)}).catch(()=>{})},[]),re=m.useCallback(async()=>{const A=J.current;if(A){j(!0);try{const de=((await(await fetch(`/api/projects/${A}/lint`)).json()).findings??[]).map(be=>({severity:be.severity==="error"?"error":"warning",message:be.message??"",file:be.file,fixHint:be.fixHint}));V(de)}catch(B){const ae=B instanceof Error?B.message:String(B);V([{severity:"error",message:`Failed to run lint: ${ae}`}])}finally{j(!1)}}},[]),te=m.useCallback((A,B)=>{B.preventDefault(),B.target.setPointerCapture(B.pointerId),P.current={side:A,startX:B.clientX,startW:A==="left"?x:O}},[x,O]),W=m.useCallback(A=>{const B=P.current;if(!B)return;const ae=A.clientX-B.startX,de=Math.max(160,Math.min(600,B.startW+(B.side==="left"?ae:-ae)));B.side==="left"?S(de):y(de)},[]),ie=m.useCallback(()=>{P.current=null},[]);if(n)return g.jsx("div",{className:"h-screen w-screen bg-neutral-950 flex items-center justify-center",children:g.jsx("div",{className:"text-sm text-neutral-500",children:"Loading..."})});if(!t)return g.jsx(cD,{onSelect:D});const ne=u.filter(A=>A==="index.html"||A.startsWith("compositions/")),Oe=u.filter(A=>!A.endsWith(".html")&&!A.endsWith(".md")&&!A.endsWith(".json"));return g.jsxs("div",{className:"flex flex-col h-screen w-screen bg-neutral-950",children:[g.jsxs("div",{className:"flex items-center justify-between h-10 px-3 bg-neutral-900 border-b border-neutral-800 flex-shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("button",{onClick:()=>{window.location.hash="",e(null)},className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800 transition-colors",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("polyline",{points:"15 18 9 12 15 6"})}),g.jsx("span",{className:"text-xs",children:"Projects"})]}),g.jsx("span",{className:"text-[11px] text-neutral-600",children:"/"}),g.jsx("span",{className:"text-[11px] font-medium text-neutral-300",children:t})]}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("button",{onClick:()=>w(A=>!A),className:`h-7 w-7 flex items-center justify-center rounded-md border transition-colors ${v?"bg-neutral-800 border-neutral-700 text-neutral-300":"bg-transparent border-transparent text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800"}`,title:v?"Show sidebar":"Hide sidebar",children:g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),g.jsx("path",{d:"M9 3v18"})]})}),g.jsx("button",{onClick:re,disabled:C,className:"h-7 px-2.5 rounded-md text-[11px] font-medium text-neutral-500 hover:text-amber-300 hover:bg-neutral-800 transition-colors disabled:opacity-40",children:C?"Linting...":"Lint"}),g.jsx("button",{onClick:()=>$(A=>!A),className:`h-7 w-7 flex items-center justify-center rounded-md border transition-colors ${k?"bg-neutral-800 border-neutral-700 text-neutral-300":"bg-transparent border-transparent text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800"}`,title:k?"Show code panel":"Hide code panel",children:g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),g.jsx("path",{d:"M15 3v18"})]})})]})]}),g.jsxs("div",{className:"flex flex-1 min-h-0",children:[!v&&g.jsx(qL,{width:x,projectId:t,compositions:ne,assets:Oe,activeComposition:(i==null?void 0:i.path)??null,onSelectComposition:A=>{c(A==="index.html"||A.startsWith("compositions/")?A:null),s({path:A,content:null}),fetch(`/api/projects/${t}/files/${A}`).then(B=>B.json()).then(B=>s({path:A,content:B.content})).catch(()=>{})}}),!v&&g.jsx("div",{className:"w-1 flex-shrink-0 bg-neutral-800 hover:bg-blue-500 cursor-col-resize transition-colors active:bg-blue-400",style:{touchAction:"none"},onPointerDown:A=>te("left",A),onPointerMove:W,onPointerUp:ie}),g.jsx("div",{className:"flex-1 relative min-w-0",children:g.jsx(H5,{projectId:t,refreshKey:N,activeCompositionPath:a,renderClipContent:M,onCompIdToSrcChange:d,onCompositionChange:A=>{c(A)},onIframeRef:A=>{E.current=A}})}),!k&&g.jsx("div",{className:"w-1 flex-shrink-0 bg-neutral-800 hover:bg-blue-500 cursor-col-resize transition-colors active:bg-blue-400",style:{touchAction:"none"},onPointerDown:A=>te("right",A),onPointerMove:W,onPointerUp:ie}),!k&&g.jsxs("div",{className:"flex flex-col border-l border-neutral-800 bg-neutral-900 flex-shrink-0",style:{width:O},children:[g.jsxs("div",{className:"flex items-center border-b border-neutral-800 flex-shrink-0",children:[g.jsx("button",{onClick:()=>l("code"),className:`flex-1 py-2 text-[11px] font-medium transition-colors ${o==="code"?"text-neutral-200 border-b-2 border-[#3CE6AC]":"text-neutral-500 hover:text-neutral-400"}`,children:"Code"}),g.jsxs("button",{onClick:()=>l("renders"),className:`flex-1 py-2 text-[11px] font-medium transition-colors ${o==="renders"?"text-neutral-200 border-b-2 border-[#3CE6AC]":"text-neutral-500 hover:text-neutral-400"}`,children:["Renders",p.jobs.length>0?` (${p.jobs.length})`:""]})]}),o==="code"?g.jsxs("div",{className:"flex flex-1 min-h-0",children:[u.length>0&&g.jsx("div",{className:"w-[140px] flex-shrink-0 border-r border-neutral-800 overflow-y-auto",children:g.jsx(VR,{files:u,activeFile:(i==null?void 0:i.path)??null,onSelectFile:L})}),g.jsx("div",{className:"flex-1 overflow-hidden min-w-0",children:i?Kx(i.path)?g.jsx(oD,{projectId:t,filePath:i.path}):g.jsx(AR,{content:i.content??"",filePath:i.path,onChange:G}):g.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to edit"})})]}):g.jsx(JL,{jobs:p.jobs,onDelete:p.deleteRender,onClearCompleted:p.clearCompleted,onStartRender:A=>p.startRender(30,"standard",A),isRendering:p.isRendering})]})]}),T!==null&&g.jsx(uD,{findings:T,projectId:t,onClose:()=>V(null)})]})}hw(document.getElementById("root")).render(g.jsx(m.StrictMode,{children:g.jsx(hD,{})}));
|