@adhdev/daemon-standalone 0.9.82-rc.8 → 0.9.82-rc.82
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/index.js +25049 -21178
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/index-Bso1b8Lh.css +1 -0
- package/public/assets/index-DW3PmABW.js +99 -0
- package/public/assets/{terminal-DCVDkSIp.js → terminal-D46M5EWH.js} +4 -4
- package/public/assets/{vendor-piMzuE8Y.js → vendor-CgiI0UIA.js} +29 -29
- package/public/index.html +3 -3
- package/vendor/mcp-server/index.js +725 -74
- package/vendor/mcp-server/index.js.map +1 -1
- package/public/assets/index-UQ7bnB6f.css +0 -1
- package/public/assets/index-rt5QK8HH.js +0 -98
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function F1(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Ua=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var
|
|
1
|
+
function F1(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Ua=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wv={exports:{}},Vl={},jv={exports:{}},be={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ function F1(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Es=Symbol.for("react.element"),H1=Symbol.for("react.portal"),G1=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),$1=Symbol.for("react.profiler"),W1=Symbol.for("react.provider"),j1=Symbol.for("react.context"),U1=Symbol.for("react.forward_ref"),Y1=Symbol.for("react.suspense"),X1=Symbol.for("react.memo"),Z1=Symbol.for("react.lazy"),
|
|
9
|
+
*/var Es=Symbol.for("react.element"),H1=Symbol.for("react.portal"),G1=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),$1=Symbol.for("react.profiler"),W1=Symbol.for("react.provider"),j1=Symbol.for("react.context"),U1=Symbol.for("react.forward_ref"),Y1=Symbol.for("react.suspense"),X1=Symbol.for("react.memo"),Z1=Symbol.for("react.lazy"),rf=Symbol.iterator;function q1(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var Uv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yv=Object.assign,Xv={};function ro(e,t,n){this.props=e,this.context=t,this.refs=Xv,this.updater=n||Uv}ro.prototype.isReactComponent={};ro.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ro.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zv(){}Zv.prototype=ro.prototype;function ah(e,t,n){this.props=e,this.context=t,this.refs=Xv,this.updater=n||Uv}var lh=ah.prototype=new Zv;lh.constructor=ah;Yv(lh,ro.prototype);lh.isPureReactComponent=!0;var of=Array.isArray,qv=Object.prototype.hasOwnProperty,uh={current:null},Qv={key:!0,ref:!0,__self:!0,__source:!0};function Kv(e,t,n){var i,r={},o=null,s=null;if(t!=null)for(i in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)qv.call(t,i)&&!Qv.hasOwnProperty(i)&&(r[i]=t[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(e&&e.defaultProps)for(i in a=e.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:Es,type:e,key:o,ref:s,props:r,_owner:uh.current}}function Q1(e,t){return{$$typeof:Es,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ch(e){return typeof e=="object"&&e!==null&&e.$$typeof===Es}function K1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var sf=/\/+/g;function zu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?K1(""+e.key):t.toString(36)}function Da(e,t,n,i,r){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Es:case H1:s=!0}}if(s)return s=e,r=r(s),e=i===""?"."+zu(s,0):i,of(r)?(n="",e!=null&&(n=e.replace(sf,"$&/")+"/"),Da(r,t,n,"",function(u){return u})):r!=null&&(ch(r)&&(r=Q1(r,n+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(sf,"$&/")+"/")+e)),t.push(r)),1;if(s=0,i=i===""?".":i+":",of(e))for(var a=0;a<e.length;a++){o=e[a];var l=i+zu(o,a);s+=Da(o,t,n,l,r)}else if(l=q1(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=i+zu(o,a++),s+=Da(o,t,n,l,r);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function $s(e,t,n){if(e==null)return e;var i=[],r=0;return Da(e,i,"","",function(o){return t.call(n,o,r++)}),i}function J1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var vt={current:null},za={transition:null},ek={ReactCurrentDispatcher:vt,ReactCurrentBatchConfig:za,ReactCurrentOwner:uh};function Jv(){throw Error("act(...) is not supported in production builds of React.")}be.Children={map:$s,forEach:function(e,t,n){$s(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $s(e,function(){t++}),t},toArray:function(e){return $s(e,function(t){return t})||[]},only:function(e){if(!ch(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};be.Component=ro;be.Fragment=G1;be.Profiler=$1;be.PureComponent=ah;be.StrictMode=B1;be.Suspense=Y1;be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ek;be.act=Jv;be.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=Yv({},e.props),r=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=uh.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)qv.call(t,l)&&!Qv.hasOwnProperty(l)&&(i[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}return{$$typeof:Es,type:e.type,key:r,ref:o,props:i,_owner:s}};be.createContext=function(e){return e={$$typeof:j1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:W1,_context:e},e.Consumer=e};be.createElement=Kv;be.createFactory=function(e){var t=Kv.bind(null,e);return t.type=e,t};be.createRef=function(){return{current:null}};be.forwardRef=function(e){return{$$typeof:U1,render:e}};be.isValidElement=ch;be.lazy=function(e){return{$$typeof:Z1,_payload:{_status:-1,_result:e},_init:J1}};be.memo=function(e,t){return{$$typeof:X1,type:e,compare:t===void 0?null:t}};be.startTransition=function(e){var t=za.transition;za.transition={};try{e()}finally{za.transition=t}};be.unstable_act=Jv;be.useCallback=function(e,t){return vt.current.useCallback(e,t)};be.useContext=function(e){return vt.current.useContext(e)};be.useDebugValue=function(){};be.useDeferredValue=function(e){return vt.current.useDeferredValue(e)};be.useEffect=function(e,t){return vt.current.useEffect(e,t)};be.useId=function(){return vt.current.useId()};be.useImperativeHandle=function(e,t,n){return vt.current.useImperativeHandle(e,t,n)};be.useInsertionEffect=function(e,t){return vt.current.useInsertionEffect(e,t)};be.useLayoutEffect=function(e,t){return vt.current.useLayoutEffect(e,t)};be.useMemo=function(e,t){return vt.current.useMemo(e,t)};be.useReducer=function(e,t,n){return vt.current.useReducer(e,t,n)};be.useRef=function(e){return vt.current.useRef(e)};be.useState=function(e){return vt.current.useState(e)};be.useSyncExternalStore=function(e,t,n){return vt.current.useSyncExternalStore(e,t,n)};be.useTransition=function(){return vt.current.useTransition()};be.version="18.3.1";jv.exports=be;var R=jv.exports;const ie=Cs(R),tk=F1({__proto__:null,default:ie},[R]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ function F1(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nk=R,ik=Symbol.for("react.element"),rk=Symbol.for("react.fragment"),ok=Object.prototype.hasOwnProperty,sk=nk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ak={key:!0,ref:!0,__self:!0,__source:!0};function
|
|
17
|
+
*/var nk=R,ik=Symbol.for("react.element"),rk=Symbol.for("react.fragment"),ok=Object.prototype.hasOwnProperty,sk=nk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ak={key:!0,ref:!0,__self:!0,__source:!0};function ew(e,t,n){var i,r={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(i in t)ok.call(t,i)&&!ak.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)r[i]===void 0&&(r[i]=t[i]);return{$$typeof:ik,type:e,key:o,ref:s,props:r,_owner:sk.current}}Vl.Fragment=rk;Vl.jsx=ew;Vl.jsxs=ew;Wv.exports=Vl;var G=Wv.exports,tw={exports:{}},Ot={},nw={exports:{}},iw={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ function F1(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(N,M){var x=N.length;N.push(M);e:for(;0<x;){var F=x-1>>>1,H=N[F];if(0<r(H,M))N[F]=M,N[x]=H,x=F;else break e}}function n(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var M=N[0],x=N.pop();if(x!==M){N[0]=x;e:for(var F=0,H=N.length,z=H>>>1;F<z;){var X=2*(F+1)-1,q=N[X],U=X+1,K=N[U];if(0>r(q,x))U<H&&0>r(K,q)?(N[F]=K,N[U]=x,F=U):(N[F]=q,N[X]=x,F=X);else if(U<H&&0>r(K,x))N[F]=K,N[U]=x,F=U;else break e}}return M}function r(N,M){var x=N.sortIndex-M.sortIndex;return x!==0?x:N.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,h=3,p=!1,f=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(N){for(var M=n(u);M!==null;){if(M.callback===null)i(u);else if(M.startTime<=N)i(u),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(u)}}function y(N){if(v=!1,g(N),!f)if(n(l)!==null)f=!0,A(k);else{var M=n(u);M!==null&&O(y,M.startTime-N)}}function k(N,M){f=!1,v&&(v=!1,m(S),S=-1),p=!0;var x=h;try{for(g(M),c=n(l);c!==null&&(!(c.expirationTime>M)||N&&!I());){var F=c.callback;if(typeof F=="function"){c.callback=null,h=c.priorityLevel;var H=F(c.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?c.callback=H:c===n(l)&&i(l),g(M)}else i(l);c=n(l)}if(c!==null)var z=!0;else{var X=n(u);X!==null&&O(y,X.startTime-M),z=!1}return z}finally{c=null,h=x,p=!1}}var _=!1,E=null,S=-1,T=5,C=-1;function I(){return!(e.unstable_now()-C<T)}function L(){if(E!==null){var N=e.unstable_now();C=N;var M=!0;try{M=E(!0,N)}finally{M?V():(_=!1,E=null)}}else _=!1}var V;if(typeof w=="function")V=function(){w(L)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,P=D.port2;D.port1.onmessage=L,V=function(){P.postMessage(null)}}else V=function(){b(L,0)};function A(N){E=N,_||(_=!0,V())}function O(N,M){S=b(function(){N(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){f||p||(f=!0,A(k))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(N){switch(h){case 1:case 2:case 3:var M=3;break;default:M=h}var x=h;h=M;try{return N()}finally{h=x}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,M){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var x=h;h=N;try{return M()}finally{h=x}},e.unstable_scheduleCallback=function(N,M,x){var F=e.unstable_now();switch(typeof x=="object"&&x!==null?(x=x.delay,x=typeof x=="number"&&0<x?F+x:F):x=F,N){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=x+H,N={id:d++,callback:M,priorityLevel:N,startTime:x,expirationTime:H,sortIndex:-1},x>F?(N.sortIndex=x,t(u,N),n(l)===null&&N===n(u)&&(v?(m(S),S=-1):v=!0,O(y,x-F))):(N.sortIndex=H,t(l,N),f||p||(f=!0,A(k))),N},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(N){var M=h;return function(){var x=h;h=M;try{return N.apply(this,arguments)}finally{h=x}}}})(
|
|
25
|
+
*/(function(e){function t(N,M){var x=N.length;N.push(M);e:for(;0<x;){var F=x-1>>>1,H=N[F];if(0<r(H,M))N[F]=M,N[x]=H,x=F;else break e}}function n(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var M=N[0],x=N.pop();if(x!==M){N[0]=x;e:for(var F=0,H=N.length,z=H>>>1;F<z;){var X=2*(F+1)-1,q=N[X],U=X+1,K=N[U];if(0>r(q,x))U<H&&0>r(K,q)?(N[F]=K,N[U]=x,F=U):(N[F]=q,N[X]=x,F=X);else if(U<H&&0>r(K,x))N[F]=K,N[U]=x,F=U;else break e}}return M}function r(N,M){var x=N.sortIndex-M.sortIndex;return x!==0?x:N.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,h=3,p=!1,f=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(N){for(var M=n(u);M!==null;){if(M.callback===null)i(u);else if(M.startTime<=N)i(u),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(u)}}function y(N){if(v=!1,g(N),!f)if(n(l)!==null)f=!0,A(k);else{var M=n(u);M!==null&&O(y,M.startTime-N)}}function k(N,M){f=!1,v&&(v=!1,m(S),S=-1),p=!0;var x=h;try{for(g(M),c=n(l);c!==null&&(!(c.expirationTime>M)||N&&!I());){var F=c.callback;if(typeof F=="function"){c.callback=null,h=c.priorityLevel;var H=F(c.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?c.callback=H:c===n(l)&&i(l),g(M)}else i(l);c=n(l)}if(c!==null)var z=!0;else{var X=n(u);X!==null&&O(y,X.startTime-M),z=!1}return z}finally{c=null,h=x,p=!1}}var _=!1,E=null,S=-1,T=5,C=-1;function I(){return!(e.unstable_now()-C<T)}function L(){if(E!==null){var N=e.unstable_now();C=N;var M=!0;try{M=E(!0,N)}finally{M?V():(_=!1,E=null)}}else _=!1}var V;if(typeof w=="function")V=function(){w(L)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,P=D.port2;D.port1.onmessage=L,V=function(){P.postMessage(null)}}else V=function(){b(L,0)};function A(N){E=N,_||(_=!0,V())}function O(N,M){S=b(function(){N(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){f||p||(f=!0,A(k))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(N){switch(h){case 1:case 2:case 3:var M=3;break;default:M=h}var x=h;h=M;try{return N()}finally{h=x}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,M){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var x=h;h=N;try{return M()}finally{h=x}},e.unstable_scheduleCallback=function(N,M,x){var F=e.unstable_now();switch(typeof x=="object"&&x!==null?(x=x.delay,x=typeof x=="number"&&0<x?F+x:F):x=F,N){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=x+H,N={id:d++,callback:M,priorityLevel:N,startTime:x,expirationTime:H,sortIndex:-1},x>F?(N.sortIndex=x,t(u,N),n(l)===null&&N===n(u)&&(v?(m(S),S=-1):v=!0,O(y,x-F))):(N.sortIndex=H,t(l,N),f||p||(f=!0,A(k))),N},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(N){var M=h;return function(){var x=h;h=M;try{return N.apply(this,arguments)}finally{h=x}}}})(iw);nw.exports=iw;var lk=nw.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,44 +30,44 @@ function F1(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var uk=R,Mt=lk;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var
|
|
33
|
+
*/var uk=R,Mt=lk;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rw=new Set,Yo={};function ar(e,t){Br(e,t),Br(e+"Capture",t)}function Br(e,t){for(Yo[e]=t,e=0;e<t.length;e++)rw.add(t[e])}var Gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pc=Object.prototype.hasOwnProperty,ck=/^[: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]*$/,af={},lf={};function dk(e){return Pc.call(lf,e)?!0:Pc.call(af,e)?!1:ck.test(e)?lf[e]=!0:(af[e]=!0,!1)}function hk(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function pk(e,t,n,i){if(t===null||typeof t>"u"||hk(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function wt(e,t,n,i,r,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var st={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){st[e]=new wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];st[t]=new wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){st[e]=new wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){st[e]=new wt(e,2,!1,e,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(e){st[e]=new wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){st[e]=new wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){st[e]=new wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){st[e]=new wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){st[e]=new wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var dh=/[\-:]([a-z])/g;function hh(e){return e[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(e){var t=e.replace(dh,hh);st[t]=new wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(dh,hh);st[t]=new wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(dh,hh);st[t]=new wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){st[e]=new wt(e,1,!1,e.toLowerCase(),null,!1,!1)});st.xlinkHref=new wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){st[e]=new wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ph(e,t,n,i){var r=st.hasOwnProperty(t)?st[t]:null;(r!==null?r.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(pk(t,n,r,i)&&(n=null),i||r===null?dk(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,i=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}var Un=uk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ws=Symbol.for("react.element"),br=Symbol.for("react.portal"),yr=Symbol.for("react.fragment"),fh=Symbol.for("react.strict_mode"),Ac=Symbol.for("react.profiler"),ow=Symbol.for("react.provider"),sw=Symbol.for("react.context"),mh=Symbol.for("react.forward_ref"),Ic=Symbol.for("react.suspense"),Nc=Symbol.for("react.suspense_list"),gh=Symbol.for("react.memo"),ii=Symbol.for("react.lazy"),aw=Symbol.for("react.offscreen"),uf=Symbol.iterator;function ho(e){return e===null||typeof e!="object"?null:(e=uf&&e[uf]||e["@@iterator"],typeof e=="function"?e:null)}var Fe=Object.assign,Pu;function Eo(e){if(Pu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Pu=t&&t[1]||""}return`
|
|
34
34
|
`+Pu+e}var Au=!1;function Iu(e,t){if(!e||Au)return"";Au=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var i=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){i=u}e.call(t.prototype)}else{try{throw Error()}catch(u){i=u}e()}}catch(u){if(u&&i&&typeof u.stack=="string"){for(var r=u.stack.split(`
|
|
35
35
|
`),o=i.stack.split(`
|
|
36
36
|
`),s=r.length-1,a=o.length-1;1<=s&&0<=a&&r[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||r[s]!==o[a]){var l=`
|
|
37
|
-
`+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Au=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Eo(e):""}function fk(e){switch(e.tag){case 5:return Eo(e.type);case 16:return Eo("Lazy");case 13:return Eo("Suspense");case 19:return Eo("SuspenseList");case 0:case 2:case 15:return e=Iu(e.type,!1),e;case 11:return e=Iu(e.type.render,!1),e;case 1:return e=Iu(e.type,!0),e;default:return""}}function Tc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yr:return"Fragment";case br:return"Portal";case Ac:return"Profiler";case fh:return"StrictMode";case Ic:return"Suspense";case Nc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ow:return(e.displayName||"Context")+".Consumer";case rw:return(e._context.displayName||"Context")+".Provider";case mh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gh:return t=e.displayName||null,t!==null?t:Tc(e.type)||"Memo";case ii:t=e._payload,e=e._init;try{return Tc(e(t))}catch{}}return null}function mk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tc(t);case 8:return t===fh?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function aw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gk(e){var t=aw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function js(e){e._valueTracker||(e._valueTracker=gk(e))}function lw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=aw(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Ya(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Mc(e,t){var n=t.checked;return Fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uf(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=xi(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uw(e,t){t=t.checked,t!=null&&ph(e,"checked",t,!1)}function Lc(e,t){uw(e,t);var n=xi(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oc(e,t.type,xi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Oc(e,t,n){(t!=="number"||Ya(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Do=Array.isArray;function Tr(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+xi(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,i&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Rc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return Fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function df(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Do(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xi(n)}}function cw(e,t){var n=xi(t.value),i=xi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),i!=null&&(e.defaultValue=""+i)}function hf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function dw(e){switch(e){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 Vc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?dw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Us,hw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,i,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,i,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Us=Us||document.createElement("div"),Us.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Us.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var No={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},vk=["Webkit","ms","Moz","O"];Object.keys(No).forEach(function(e){vk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),No[t]=No[e]})});function pw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||No.hasOwnProperty(e)&&No[e]?(""+t).trim():t+"px"}function fw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=pw(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}var wk=Fe({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 Fc(e,t){if(t){if(wk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Hc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gc=null;function vh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bc=null,Mr=null,Lr=null;function pf(e){if(e=Ps(e)){if(typeof Bc!="function")throw Error(W(280));var t=e.stateNode;t&&(t=$l(t),Bc(e.stateNode,e.type,t))}}function mw(e){Mr?Lr?Lr.push(e):Lr=[e]:Mr=e}function gw(){if(Mr){var e=Mr,t=Lr;if(Lr=Mr=null,pf(e),t)for(e=0;e<t.length;e++)pf(t[e])}}function vw(e,t){return e(t)}function ww(){}var Nu=!1;function bw(e,t,n){if(Nu)return e(t,n);Nu=!0;try{return vw(e,t,n)}finally{Nu=!1,(Mr!==null||Lr!==null)&&(ww(),gw())}}function Zo(e,t){var n=e.stateNode;if(n===null)return null;var i=$l(n);if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var $c=!1;if(Gn)try{var po={};Object.defineProperty(po,"passive",{get:function(){$c=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{$c=!1}function bk(e,t,n,i,r,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var To=!1,Xa=null,Za=!1,Wc=null,yk={onError:function(e){To=!0,Xa=e}};function xk(e,t,n,i,r,o,s,a,l){To=!1,Xa=null,bk.apply(yk,arguments)}function _k(e,t,n,i,r,o,s,a,l){if(xk.apply(this,arguments),To){if(To){var u=Xa;To=!1,Xa=null}else throw Error(W(198));Za||(Za=!0,Wc=u)}}function lr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function yw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ff(e){if(lr(e)!==e)throw Error(W(188))}function kk(e){var t=e.alternate;if(!t){if(t=lr(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return ff(r),e;if(o===i)return ff(r),t;o=o.sibling}throw Error(W(188))}if(n.return!==i.return)n=r,i=o;else{for(var s=!1,a=r.child;a;){if(a===n){s=!0,n=r,i=o;break}if(a===i){s=!0,i=r,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,i=r;break}if(a===i){s=!0,i=o,n=r;break}a=a.sibling}if(!s)throw Error(W(189))}}if(n.alternate!==i)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function xw(e){return e=kk(e),e!==null?_w(e):null}function _w(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_w(e);if(t!==null)return t;e=e.sibling}return null}var kw=Mt.unstable_scheduleCallback,mf=Mt.unstable_cancelCallback,Sk=Mt.unstable_shouldYield,Ck=Mt.unstable_requestPaint,Be=Mt.unstable_now,Ek=Mt.unstable_getCurrentPriorityLevel,wh=Mt.unstable_ImmediatePriority,Sw=Mt.unstable_UserBlockingPriority,qa=Mt.unstable_NormalPriority,Dk=Mt.unstable_LowPriority,Cw=Mt.unstable_IdlePriority,Fl=null,Sn=null;function zk(e){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(Fl,e,void 0,(e.current.flags&128)===128)}catch{}}var an=Math.clz32?Math.clz32:Ik,Pk=Math.log,Ak=Math.LN2;function Ik(e){return e>>>=0,e===0?32:31-(Pk(e)/Ak|0)|0}var Ys=64,Xs=4194304;function zo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Qa(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~r;a!==0?i=zo(a):(o&=s,o!==0&&(i=zo(o)))}else s=n&~r,s!==0?i=zo(s):o!==0&&(i=zo(o));if(i===0)return 0;if(t!==0&&t!==i&&!(t&r)&&(r=i&-i,o=t&-t,r>=o||r===16&&(o&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)n=31-an(t),r=1<<n,i|=e[n],t&=~r;return i}function Nk(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Tk(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-an(o),a=1<<s,l=r[s];l===-1?(!(a&n)||a&i)&&(r[s]=Nk(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function jc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ew(){var e=Ys;return Ys<<=1,!(Ys&4194240)&&(Ys=64),e}function Tu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ds(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-an(t),e[t]=n}function Mk(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-an(n),o=1<<r;t[r]=0,i[r]=-1,e[r]=-1,n&=~o}}function bh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-an(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}var Ce=0;function Dw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zw,yh,Pw,Aw,Iw,Uc=!1,Zs=[],di=null,hi=null,pi=null,qo=new Map,Qo=new Map,oi=[],Lk="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 gf(e,t){switch(e){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(t.pointerId)}}function fo(e,t,n,i,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Ps(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Ok(e,t,n,i,r){switch(t){case"focusin":return di=fo(di,e,t,n,i,r),!0;case"dragenter":return hi=fo(hi,e,t,n,i,r),!0;case"mouseover":return pi=fo(pi,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return qo.set(o,fo(qo.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Qo.set(o,fo(Qo.get(o)||null,e,t,n,i,r)),!0}return!1}function Nw(e){var t=Gi(e.target);if(t!==null){var n=lr(t);if(n!==null){if(t=n.tag,t===13){if(t=yw(n),t!==null){e.blockedOn=t,Iw(e.priority,function(){Pw(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Gc=i,n.target.dispatchEvent(i),Gc=null}else return t=Ps(n),t!==null&&yh(t),e.blockedOn=n,!1;t.shift()}return!0}function vf(e,t,n){Pa(e)&&n.delete(t)}function Rk(){Uc=!1,di!==null&&Pa(di)&&(di=null),hi!==null&&Pa(hi)&&(hi=null),pi!==null&&Pa(pi)&&(pi=null),qo.forEach(vf),Qo.forEach(vf)}function mo(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,Mt.unstable_scheduleCallback(Mt.unstable_NormalPriority,Rk)))}function Ko(e){function t(r){return mo(r,e)}if(0<Zs.length){mo(Zs[0],e);for(var n=1;n<Zs.length;n++){var i=Zs[n];i.blockedOn===e&&(i.blockedOn=null)}}for(di!==null&&mo(di,e),hi!==null&&mo(hi,e),pi!==null&&mo(pi,e),qo.forEach(t),Qo.forEach(t),n=0;n<oi.length;n++)i=oi[n],i.blockedOn===e&&(i.blockedOn=null);for(;0<oi.length&&(n=oi[0],n.blockedOn===null);)Nw(n),n.blockedOn===null&&oi.shift()}var Or=Un.ReactCurrentBatchConfig,Ka=!0;function Vk(e,t,n,i){var r=Ce,o=Or.transition;Or.transition=null;try{Ce=1,xh(e,t,n,i)}finally{Ce=r,Or.transition=o}}function Fk(e,t,n,i){var r=Ce,o=Or.transition;Or.transition=null;try{Ce=4,xh(e,t,n,i)}finally{Ce=r,Or.transition=o}}function xh(e,t,n,i){if(Ka){var r=Yc(e,t,n,i);if(r===null)$u(e,t,i,Ja,n),gf(e,i);else if(Ok(r,e,t,n,i))i.stopPropagation();else if(gf(e,i),t&4&&-1<Lk.indexOf(e)){for(;r!==null;){var o=Ps(r);if(o!==null&&zw(o),o=Yc(e,t,n,i),o===null&&$u(e,t,i,Ja,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else $u(e,t,i,null,n)}}var Ja=null;function Yc(e,t,n,i){if(Ja=null,e=vh(i),e=Gi(e),e!==null)if(t=lr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=yw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ja=e,null}function Tw(e){switch(e){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(Ek()){case wh:return 1;case Sw:return 4;case qa:case Dk:return 16;case Cw:return 536870912;default:return 16}default:return 16}}var li=null,_h=null,Aa=null;function Mw(){if(Aa)return Aa;var e,t=_h,n=t.length,i,r="value"in li?li.value:li.textContent,o=r.length;for(e=0;e<n&&t[e]===r[e];e++);var s=n-e;for(i=1;i<=s&&t[n-i]===r[o-i];i++);return Aa=r.slice(e,1<i?1-i:void 0)}function Ia(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function qs(){return!0}function wf(){return!1}function Rt(e){function t(n,i,r,o,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?qs:wf,this.isPropagationStopped=wf,this}return Fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=qs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=qs)},persist:function(){},isPersistent:qs}),t}var oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kh=Rt(oo),zs=Fe({},oo,{view:0,detail:0}),Hk=Rt(zs),Mu,Lu,go,Hl=Fe({},zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==go&&(go&&e.type==="mousemove"?(Mu=e.screenX-go.screenX,Lu=e.screenY-go.screenY):Lu=Mu=0,go=e),Mu)},movementY:function(e){return"movementY"in e?e.movementY:Lu}}),bf=Rt(Hl),Gk=Fe({},Hl,{dataTransfer:0}),Bk=Rt(Gk),$k=Fe({},zs,{relatedTarget:0}),Ou=Rt($k),Wk=Fe({},oo,{animationName:0,elapsedTime:0,pseudoElement:0}),jk=Rt(Wk),Uk=Fe({},oo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yk=Rt(Uk),Xk=Fe({},oo,{data:0}),yf=Rt(Xk),Zk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qk={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"},Qk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qk[e])?!!t[e]:!1}function Sh(){return Kk}var Jk=Fe({},zs,{key:function(e){if(e.key){var t=Zk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ia(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sh,charCode:function(e){return e.type==="keypress"?Ia(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ia(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eS=Rt(Jk),tS=Fe({},Hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xf=Rt(tS),nS=Fe({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sh}),iS=Rt(nS),rS=Fe({},oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),oS=Rt(rS),sS=Fe({},Hl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),aS=Rt(sS),lS=[9,13,27,32],Ch=Gn&&"CompositionEvent"in window,Mo=null;Gn&&"documentMode"in document&&(Mo=document.documentMode);var uS=Gn&&"TextEvent"in window&&!Mo,Lw=Gn&&(!Ch||Mo&&8<Mo&&11>=Mo),_f=" ",kf=!1;function Ow(e,t){switch(e){case"keyup":return lS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xr=!1;function cS(e,t){switch(e){case"compositionend":return Rw(t);case"keypress":return t.which!==32?null:(kf=!0,_f);case"textInput":return e=t.data,e===_f&&kf?null:e;default:return null}}function dS(e,t){if(xr)return e==="compositionend"||!Ch&&Ow(e,t)?(e=Mw(),Aa=_h=li=null,xr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Lw&&t.locale!=="ko"?null:t.data;default:return null}}var hS={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 Sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hS[e.type]:t==="textarea"}function Vw(e,t,n,i){mw(i),t=el(t,"onChange"),0<t.length&&(n=new kh("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Lo=null,Jo=null;function pS(e){Zw(e,0)}function Gl(e){var t=Sr(e);if(lw(t))return e}function fS(e,t){if(e==="change")return t}var Fw=!1;if(Gn){var Ru;if(Gn){var Vu="oninput"in document;if(!Vu){var Cf=document.createElement("div");Cf.setAttribute("oninput","return;"),Vu=typeof Cf.oninput=="function"}Ru=Vu}else Ru=!1;Fw=Ru&&(!document.documentMode||9<document.documentMode)}function Ef(){Lo&&(Lo.detachEvent("onpropertychange",Hw),Jo=Lo=null)}function Hw(e){if(e.propertyName==="value"&&Gl(Jo)){var t=[];Vw(t,Jo,e,vh(e)),bw(pS,t)}}function mS(e,t,n){e==="focusin"?(Ef(),Lo=t,Jo=n,Lo.attachEvent("onpropertychange",Hw)):e==="focusout"&&Ef()}function gS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gl(Jo)}function vS(e,t){if(e==="click")return Gl(t)}function wS(e,t){if(e==="input"||e==="change")return Gl(t)}function bS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:bS;function es(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Pc.call(t,r)||!cn(e[r],t[r]))return!1}return!0}function Df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zf(e,t){var n=Df(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Df(n)}}function Gw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bw(){for(var e=window,t=Ya();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ya(e.document)}return t}function Eh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yS(e){var t=Bw(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gw(n.ownerDocument.documentElement,n)){if(i!==null&&Eh(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,o=Math.min(i.start,r);i=i.end===void 0?o:Math.min(i.end,r),!e.extend&&o>i&&(r=i,i=o,o=r),r=zf(n,o);var s=zf(n,i);r&&s&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),o>i?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xS=Gn&&"documentMode"in document&&11>=document.documentMode,_r=null,Xc=null,Oo=null,Zc=!1;function Pf(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zc||_r==null||_r!==Ya(i)||(i=_r,"selectionStart"in i&&Eh(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Oo&&es(Oo,i)||(Oo=i,i=el(Xc,"onSelect"),0<i.length&&(t=new kh("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=_r)))}function Qs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:Qs("Animation","AnimationEnd"),animationiteration:Qs("Animation","AnimationIteration"),animationstart:Qs("Animation","AnimationStart"),transitionend:Qs("Transition","TransitionEnd")},Fu={},$w={};Gn&&($w=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Bl(e){if(Fu[e])return Fu[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $w)return Fu[e]=t[n];return e}var Ww=Bl("animationend"),jw=Bl("animationiteration"),Uw=Bl("animationstart"),Yw=Bl("transitionend"),Xw=new Map,Af="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 ki(e,t){Xw.set(e,t),ar(t,[e])}for(var Hu=0;Hu<Af.length;Hu++){var Gu=Af[Hu],_S=Gu.toLowerCase(),kS=Gu[0].toUpperCase()+Gu.slice(1);ki(_S,"on"+kS)}ki(Ww,"onAnimationEnd");ki(jw,"onAnimationIteration");ki(Uw,"onAnimationStart");ki("dblclick","onDoubleClick");ki("focusin","onFocus");ki("focusout","onBlur");ki(Yw,"onTransitionEnd");Br("onMouseEnter",["mouseout","mouseover"]);Br("onMouseLeave",["mouseout","mouseover"]);Br("onPointerEnter",["pointerout","pointerover"]);Br("onPointerLeave",["pointerout","pointerover"]);ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ar("onBeforeInput",["compositionend","keypress","textInput","paste"]);ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Po="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(" "),SS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Po));function If(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,_k(i,t,void 0,e),e.currentTarget=null}function Zw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var s=i.length-1;0<=s;s--){var a=i[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&r.isPropagationStopped())break e;If(r,a,u),o=l}else for(s=0;s<i.length;s++){if(a=i[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&r.isPropagationStopped())break e;If(r,a,u),o=l}}}if(Za)throw e=Wc,Za=!1,Wc=null,e}function Ae(e,t){var n=t[ed];n===void 0&&(n=t[ed]=new Set);var i=e+"__bubble";n.has(i)||(qw(t,e,2,!1),n.add(i))}function Bu(e,t,n){var i=0;t&&(i|=4),qw(n,e,i,t)}var Ks="_reactListening"+Math.random().toString(36).slice(2);function ts(e){if(!e[Ks]){e[Ks]=!0,iw.forEach(function(n){n!=="selectionchange"&&(SS.has(n)||Bu(n,!1,e),Bu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ks]||(t[Ks]=!0,Bu("selectionchange",!1,t))}}function qw(e,t,n,i){switch(Tw(t)){case 1:var r=Vk;break;case 4:r=Fk;break;default:r=xh}n=r.bind(null,t,n,e),r=void 0,!$c||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),i?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function $u(e,t,n,i,r){var o=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=Gi(a),s===null)return;if(l=s.tag,l===5||l===6){i=o=s;continue e}a=a.parentNode}}i=i.return}bw(function(){var u=o,d=vh(n),c=[];e:{var h=Xw.get(e);if(h!==void 0){var p=kh,f=e;switch(e){case"keypress":if(Ia(n)===0)break e;case"keydown":case"keyup":p=eS;break;case"focusin":f="focus",p=Ou;break;case"focusout":f="blur",p=Ou;break;case"beforeblur":case"afterblur":p=Ou;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":p=bf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Bk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=iS;break;case Ww:case jw:case Uw:p=jk;break;case Yw:p=oS;break;case"scroll":p=Hk;break;case"wheel":p=aS;break;case"copy":case"cut":case"paste":p=Yk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=xf}var v=(t&4)!==0,b=!v&&e==="scroll",m=v?h!==null?h+"Capture":null:h;v=[];for(var w=u,g;w!==null;){g=w;var y=g.stateNode;if(g.tag===5&&y!==null&&(g=y,m!==null&&(y=Zo(w,m),y!=null&&v.push(ns(w,y,g)))),b)break;w=w.return}0<v.length&&(h=new p(h,f,null,n,d),c.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Gc&&(f=n.relatedTarget||n.fromElement)&&(Gi(f)||f[Bn]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(f=n.relatedTarget||n.toElement,p=u,f=f?Gi(f):null,f!==null&&(b=lr(f),f!==b||f.tag!==5&&f.tag!==6)&&(f=null)):(p=null,f=u),p!==f)){if(v=bf,y="onMouseLeave",m="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=xf,y="onPointerLeave",m="onPointerEnter",w="pointer"),b=p==null?h:Sr(p),g=f==null?h:Sr(f),h=new v(y,w+"leave",p,n,d),h.target=b,h.relatedTarget=g,y=null,Gi(d)===u&&(v=new v(m,w+"enter",f,n,d),v.target=g,v.relatedTarget=b,y=v),b=y,p&&f)t:{for(v=p,m=f,w=0,g=v;g;g=pr(g))w++;for(g=0,y=m;y;y=pr(y))g++;for(;0<w-g;)v=pr(v),w--;for(;0<g-w;)m=pr(m),g--;for(;w--;){if(v===m||m!==null&&v===m.alternate)break t;v=pr(v),m=pr(m)}v=null}else v=null;p!==null&&Nf(c,h,p,v,!1),f!==null&&b!==null&&Nf(c,b,f,v,!0)}}e:{if(h=u?Sr(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var k=fS;else if(Sf(h))if(Fw)k=wS;else{k=gS;var _=mS}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=vS);if(k&&(k=k(e,u))){Vw(c,k,n,d);break e}_&&_(e,h,u),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&Oc(h,"number",h.value)}switch(_=u?Sr(u):window,e){case"focusin":(Sf(_)||_.contentEditable==="true")&&(_r=_,Xc=u,Oo=null);break;case"focusout":Oo=Xc=_r=null;break;case"mousedown":Zc=!0;break;case"contextmenu":case"mouseup":case"dragend":Zc=!1,Pf(c,n,d);break;case"selectionchange":if(xS)break;case"keydown":case"keyup":Pf(c,n,d)}var E;if(Ch)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else xr?Ow(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(Lw&&n.locale!=="ko"&&(xr||S!=="onCompositionStart"?S==="onCompositionEnd"&&xr&&(E=Mw()):(li=d,_h="value"in li?li.value:li.textContent,xr=!0)),_=el(u,S),0<_.length&&(S=new yf(S,e,null,n,d),c.push({event:S,listeners:_}),E?S.data=E:(E=Rw(n),E!==null&&(S.data=E)))),(E=uS?cS(e,n):dS(e,n))&&(u=el(u,"onBeforeInput"),0<u.length&&(d=new yf("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=E))}Zw(c,t)})}function ns(e,t,n){return{instance:e,listener:t,currentTarget:n}}function el(e,t){for(var n=t+"Capture",i=[];e!==null;){var r=e,o=r.stateNode;r.tag===5&&o!==null&&(r=o,o=Zo(e,n),o!=null&&i.unshift(ns(e,o,r)),o=Zo(e,t),o!=null&&i.push(ns(e,o,r))),e=e.return}return i}function pr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Nf(e,t,n,i,r){for(var o=t._reactName,s=[];n!==null&&n!==i;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&u!==null&&(a=u,r?(l=Zo(n,o),l!=null&&s.unshift(ns(n,l,a))):r||(l=Zo(n,o),l!=null&&s.push(ns(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var CS=/\r\n?/g,ES=/\u0000|\uFFFD/g;function Tf(e){return(typeof e=="string"?e:""+e).replace(CS,`
|
|
38
|
-
`).replace(ES,"")}function Js(e,t,n){if(t=Tf(t),Tf(e)!==t&&n)throw Error(W(425))}function tl(){}var qc=null,Qc=null;function Kc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jc=typeof setTimeout=="function"?setTimeout:void 0,DS=typeof clearTimeout=="function"?clearTimeout:void 0,Mf=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof Mf<"u"?function(e){return Mf.resolve(null).then(e).catch(PS)}:Jc;function PS(e){setTimeout(function(){throw e})}function Wu(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(i===0){e.removeChild(r),Ko(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=r}while(n);Ko(t)}function fi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Lf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var so=Math.random().toString(36).slice(2),_n="__reactFiber$"+so,is="__reactProps$"+so,Bn="__reactContainer$"+so,ed="__reactEvents$"+so,AS="__reactListeners$"+so,IS="__reactHandles$"+so;function Gi(e){var t=e[_n];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bn]||n[_n]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Lf(e);e!==null;){if(n=e[_n])return n;e=Lf(e)}return t}e=n,n=e.parentNode}return null}function Ps(e){return e=e[_n]||e[Bn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Sr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function $l(e){return e[is]||null}var td=[],Cr=-1;function Si(e){return{current:e}}function Ne(e){0>Cr||(e.current=td[Cr],td[Cr]=null,Cr--)}function Pe(e,t){Cr++,td[Cr]=e.current,e.current=t}var _i={},dt=Si(_i),kt=Si(!1),Qi=_i;function $r(e,t){var n=e.type.contextTypes;if(!n)return _i;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in n)r[o]=t[o];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function St(e){return e=e.childContextTypes,e!=null}function nl(){Ne(kt),Ne(dt)}function Of(e,t,n){if(dt.current!==_i)throw Error(W(168));Pe(dt,t),Pe(kt,n)}function Qw(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in t))throw Error(W(108,mk(e)||"Unknown",r));return Fe({},n,i)}function il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_i,Qi=dt.current,Pe(dt,e),Pe(kt,kt.current),!0}function Rf(e,t,n){var i=e.stateNode;if(!i)throw Error(W(169));n?(e=Qw(e,t,Qi),i.__reactInternalMemoizedMergedChildContext=e,Ne(kt),Ne(dt),Pe(dt,e)):Ne(kt),Pe(kt,n)}var Ln=null,Wl=!1,ju=!1;function Kw(e){Ln===null?Ln=[e]:Ln.push(e)}function NS(e){Wl=!0,Kw(e)}function Ci(){if(!ju&&Ln!==null){ju=!0;var e=0,t=Ce;try{var n=Ln;for(Ce=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Ln=null,Wl=!1}catch(r){throw Ln!==null&&(Ln=Ln.slice(e+1)),kw(wh,Ci),r}finally{Ce=t,ju=!1}}return null}var Er=[],Dr=0,rl=null,ol=0,Ht=[],Gt=0,Ki=null,On=1,Rn="";function Ri(e,t){Er[Dr++]=ol,Er[Dr++]=rl,rl=e,ol=t}function Jw(e,t,n){Ht[Gt++]=On,Ht[Gt++]=Rn,Ht[Gt++]=Ki,Ki=e;var i=On;e=Rn;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(t)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,On=1<<32-an(t)+r|n<<r|i,Rn=o+e}else On=1<<o|n<<r|i,Rn=e}function Dh(e){e.return!==null&&(Ri(e,1),Jw(e,1,0))}function zh(e){for(;e===rl;)rl=Er[--Dr],Er[Dr]=null,ol=Er[--Dr],Er[Dr]=null;for(;e===Ki;)Ki=Ht[--Gt],Ht[Gt]=null,Rn=Ht[--Gt],Ht[Gt]=null,On=Ht[--Gt],Ht[Gt]=null}var Nt=null,It=null,Te=!1,tn=null;function e0(e,t){var n=$t(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Vf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Nt=e,It=fi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Nt=e,It=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ki!==null?{id:On,overflow:Rn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=$t(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Nt=e,It=null,!0):!1;default:return!1}}function nd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function id(e){if(Te){var t=It;if(t){var n=t;if(!Vf(e,t)){if(nd(e))throw Error(W(418));t=fi(n.nextSibling);var i=Nt;t&&Vf(e,t)?e0(i,n):(e.flags=e.flags&-4097|2,Te=!1,Nt=e)}}else{if(nd(e))throw Error(W(418));e.flags=e.flags&-4097|2,Te=!1,Nt=e}}}function Ff(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Nt=e}function ea(e){if(e!==Nt)return!1;if(!Te)return Ff(e),Te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kc(e.type,e.memoizedProps)),t&&(t=It)){if(nd(e))throw t0(),Error(W(418));for(;t;)e0(e,t),t=fi(t.nextSibling)}if(Ff(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){It=fi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}It=null}}else It=Nt?fi(e.stateNode.nextSibling):null;return!0}function t0(){for(var e=It;e;)e=fi(e.nextSibling)}function Wr(){It=Nt=null,Te=!1}function Ph(e){tn===null?tn=[e]:tn.push(e)}var TS=Un.ReactCurrentBatchConfig;function vo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var i=n.stateNode}if(!i)throw Error(W(147,e));var r=i,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=r.refs;s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,e))}return e}function ta(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Hf(e){var t=e._init;return t(e._payload)}function n0(e){function t(m,w){if(e){var g=m.deletions;g===null?(m.deletions=[w],m.flags|=16):g.push(w)}}function n(m,w){if(!e)return null;for(;w!==null;)t(m,w),w=w.sibling;return null}function i(m,w){for(m=new Map;w!==null;)w.key!==null?m.set(w.key,w):m.set(w.index,w),w=w.sibling;return m}function r(m,w){return m=wi(m,w),m.index=0,m.sibling=null,m}function o(m,w,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<w?(m.flags|=2,w):g):(m.flags|=2,w)):(m.flags|=1048576,w)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,w,g,y){return w===null||w.tag!==6?(w=Ku(g,m.mode,y),w.return=m,w):(w=r(w,g),w.return=m,w)}function l(m,w,g,y){var k=g.type;return k===yr?d(m,w,g.props.children,y,g.key):w!==null&&(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ii&&Hf(k)===w.type)?(y=r(w,g.props),y.ref=vo(m,w,g),y.return=m,y):(y=Va(g.type,g.key,g.props,null,m.mode,y),y.ref=vo(m,w,g),y.return=m,y)}function u(m,w,g,y){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Ju(g,m.mode,y),w.return=m,w):(w=r(w,g.children||[]),w.return=m,w)}function d(m,w,g,y,k){return w===null||w.tag!==7?(w=Ui(g,m.mode,y,k),w.return=m,w):(w=r(w,g),w.return=m,w)}function c(m,w,g){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Ku(""+w,m.mode,g),w.return=m,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ws:return g=Va(w.type,w.key,w.props,null,m.mode,g),g.ref=vo(m,null,w),g.return=m,g;case br:return w=Ju(w,m.mode,g),w.return=m,w;case ii:var y=w._init;return c(m,y(w._payload),g)}if(Do(w)||ho(w))return w=Ui(w,m.mode,g,null),w.return=m,w;ta(m,w)}return null}function h(m,w,g,y){var k=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:a(m,w,""+g,y);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ws:return g.key===k?l(m,w,g,y):null;case br:return g.key===k?u(m,w,g,y):null;case ii:return k=g._init,h(m,w,k(g._payload),y)}if(Do(g)||ho(g))return k!==null?null:d(m,w,g,y,null);ta(m,g)}return null}function p(m,w,g,y,k){if(typeof y=="string"&&y!==""||typeof y=="number")return m=m.get(g)||null,a(w,m,""+y,k);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ws:return m=m.get(y.key===null?g:y.key)||null,l(w,m,y,k);case br:return m=m.get(y.key===null?g:y.key)||null,u(w,m,y,k);case ii:var _=y._init;return p(m,w,g,_(y._payload),k)}if(Do(y)||ho(y))return m=m.get(g)||null,d(w,m,y,k,null);ta(w,y)}return null}function f(m,w,g,y){for(var k=null,_=null,E=w,S=w=0,T=null;E!==null&&S<g.length;S++){E.index>S?(T=E,E=null):T=E.sibling;var C=h(m,E,g[S],y);if(C===null){E===null&&(E=T);break}e&&E&&C.alternate===null&&t(m,E),w=o(C,w,S),_===null?k=C:_.sibling=C,_=C,E=T}if(S===g.length)return n(m,E),Te&&Ri(m,S),k;if(E===null){for(;S<g.length;S++)E=c(m,g[S],y),E!==null&&(w=o(E,w,S),_===null?k=E:_.sibling=E,_=E);return Te&&Ri(m,S),k}for(E=i(m,E);S<g.length;S++)T=p(E,m,S,g[S],y),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?S:T.key),w=o(T,w,S),_===null?k=T:_.sibling=T,_=T);return e&&E.forEach(function(I){return t(m,I)}),Te&&Ri(m,S),k}function v(m,w,g,y){var k=ho(g);if(typeof k!="function")throw Error(W(150));if(g=k.call(g),g==null)throw Error(W(151));for(var _=k=null,E=w,S=w=0,T=null,C=g.next();E!==null&&!C.done;S++,C=g.next()){E.index>S?(T=E,E=null):T=E.sibling;var I=h(m,E,C.value,y);if(I===null){E===null&&(E=T);break}e&&E&&I.alternate===null&&t(m,E),w=o(I,w,S),_===null?k=I:_.sibling=I,_=I,E=T}if(C.done)return n(m,E),Te&&Ri(m,S),k;if(E===null){for(;!C.done;S++,C=g.next())C=c(m,C.value,y),C!==null&&(w=o(C,w,S),_===null?k=C:_.sibling=C,_=C);return Te&&Ri(m,S),k}for(E=i(m,E);!C.done;S++,C=g.next())C=p(E,m,S,C.value,y),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?S:C.key),w=o(C,w,S),_===null?k=C:_.sibling=C,_=C);return e&&E.forEach(function(L){return t(m,L)}),Te&&Ri(m,S),k}function b(m,w,g,y){if(typeof g=="object"&&g!==null&&g.type===yr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ws:e:{for(var k=g.key,_=w;_!==null;){if(_.key===k){if(k=g.type,k===yr){if(_.tag===7){n(m,_.sibling),w=r(_,g.props.children),w.return=m,m=w;break e}}else if(_.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ii&&Hf(k)===_.type){n(m,_.sibling),w=r(_,g.props),w.ref=vo(m,_,g),w.return=m,m=w;break e}n(m,_);break}else t(m,_);_=_.sibling}g.type===yr?(w=Ui(g.props.children,m.mode,y,g.key),w.return=m,m=w):(y=Va(g.type,g.key,g.props,null,m.mode,y),y.ref=vo(m,w,g),y.return=m,m=y)}return s(m);case br:e:{for(_=g.key;w!==null;){if(w.key===_)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){n(m,w.sibling),w=r(w,g.children||[]),w.return=m,m=w;break e}else{n(m,w);break}else t(m,w);w=w.sibling}w=Ju(g,m.mode,y),w.return=m,m=w}return s(m);case ii:return _=g._init,b(m,w,_(g._payload),y)}if(Do(g))return f(m,w,g,y);if(ho(g))return v(m,w,g,y);ta(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,w!==null&&w.tag===6?(n(m,w.sibling),w=r(w,g),w.return=m,m=w):(n(m,w),w=Ku(g,m.mode,y),w.return=m,m=w),s(m)):n(m,w)}return b}var jr=n0(!0),i0=n0(!1),sl=Si(null),al=null,zr=null,Ah=null;function Ih(){Ah=zr=al=null}function Nh(e){var t=sl.current;Ne(sl),e._currentValue=t}function rd(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Rr(e,t){al=e,Ah=zr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xt=!0),e.firstContext=null)}function Ut(e){var t=e._currentValue;if(Ah!==e)if(e={context:e,memoizedValue:t,next:null},zr===null){if(al===null)throw Error(W(308));zr=e,al.dependencies={lanes:0,firstContext:e}}else zr=zr.next=e;return t}var Bi=null;function Th(e){Bi===null?Bi=[e]:Bi.push(e)}function r0(e,t,n,i){var r=t.interleaved;return r===null?(n.next=n,Th(t)):(n.next=r.next,r.next=n),t.interleaved=n,$n(e,i)}function $n(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ri=!1;function Mh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function o0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mi(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ke&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,$n(e,n)}return r=i.interleaved,r===null?(t.next=t,Th(i)):(t.next=r.next,r.next=t),i.interleaved=t,$n(e,n)}function Na(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,bh(e,n)}}function Gf(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?r=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?r=o=t:o=o.next=t}else r=o=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ll(e,t,n,i){var r=e.updateQueue;ri=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(o!==null){var c=r.baseState;s=0,d=u=l=null,a=o;do{var h=a.lane,p=a.eventTime;if((i&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,v=a;switch(h=t,p=n,v.tag){case 1:if(f=v.payload,typeof f=="function"){c=f.call(p,c,h);break e}c=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=v.payload,h=typeof f=="function"?f.call(p,c,h):f,h==null)break e;c=Fe({},c,h);break e;case 2:ri=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=c):d=d.next=p,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(d===null&&(l=c),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=d,t=r.shared.interleaved,t!==null){r=t;do s|=r.lane,r=r.next;while(r!==t)}else o===null&&(r.shared.lanes=0);er|=s,e.lanes=s,e.memoizedState=c}}function Bf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(r!==null){if(i.callback=null,i=n,typeof r!="function")throw Error(W(191,r));r.call(i)}}}var As={},Cn=Si(As),rs=Si(As),os=Si(As);function $i(e){if(e===As)throw Error(W(174));return e}function Lh(e,t){switch(Pe(os,t),Pe(rs,e),Pe(Cn,As),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vc(t,e)}Ne(Cn),Pe(Cn,t)}function Ur(){Ne(Cn),Ne(rs),Ne(os)}function s0(e){$i(os.current);var t=$i(Cn.current),n=Vc(t,e.type);t!==n&&(Pe(rs,e),Pe(Cn,n))}function Oh(e){rs.current===e&&(Ne(Cn),Ne(rs))}var Re=Si(0);function ul(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uu=[];function Rh(){for(var e=0;e<Uu.length;e++)Uu[e]._workInProgressVersionPrimary=null;Uu.length=0}var Ta=Un.ReactCurrentDispatcher,Yu=Un.ReactCurrentBatchConfig,Ji=0,Ve=null,Qe=null,tt=null,cl=!1,Ro=!1,ss=0,MS=0;function at(){throw Error(W(321))}function Vh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cn(e[n],t[n]))return!1;return!0}function Fh(e,t,n,i,r,o){if(Ji=o,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ta.current=e===null||e.memoizedState===null?VS:FS,e=n(i,r),Ro){o=0;do{if(Ro=!1,ss=0,25<=o)throw Error(W(301));o+=1,tt=Qe=null,t.updateQueue=null,Ta.current=HS,e=n(i,r)}while(Ro)}if(Ta.current=dl,t=Qe!==null&&Qe.next!==null,Ji=0,tt=Qe=Ve=null,cl=!1,t)throw Error(W(300));return e}function Hh(){var e=ss!==0;return ss=0,e}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?Ve.memoizedState=tt=e:tt=tt.next=e,tt}function Yt(){if(Qe===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=tt===null?Ve.memoizedState:tt.next;if(t!==null)tt=t,Qe=e;else{if(e===null)throw Error(W(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},tt===null?Ve.memoizedState=tt=e:tt=tt.next=e}return tt}function as(e,t){return typeof t=="function"?t(e):t}function Xu(e){var t=Yt(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var i=Qe,r=i.baseQueue,o=n.pending;if(o!==null){if(r!==null){var s=r.next;r.next=o.next,o.next=s}i.baseQueue=r=o,n.pending=null}if(r!==null){o=r.next,i=i.baseState;var a=s=null,l=null,u=o;do{var d=u.lane;if((Ji&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,s=i):l=l.next=c,Ve.lanes|=d,er|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=a,cn(i,t.memoizedState)||(xt=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){r=e;do o=r.lane,Ve.lanes|=o,er|=o,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Zu(e){var t=Yt(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,o=t.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do o=e(o,s.action),s=s.next;while(s!==r);cn(o,t.memoizedState)||(xt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function a0(){}function l0(e,t){var n=Ve,i=Yt(),r=t(),o=!cn(i.memoizedState,r);if(o&&(i.memoizedState=r,xt=!0),i=i.queue,Gh(d0.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||tt!==null&&tt.memoizedState.tag&1){if(n.flags|=2048,ls(9,c0.bind(null,n,i,r,t),void 0,null),nt===null)throw Error(W(349));Ji&30||u0(n,t,r)}return r}function u0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function c0(e,t,n,i){t.value=n,t.getSnapshot=i,h0(t)&&p0(e)}function d0(e,t,n){return n(function(){h0(t)&&p0(e)})}function h0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cn(e,n)}catch{return!0}}function p0(e){var t=$n(e,1);t!==null&&ln(t,e,1,-1)}function $f(e){var t=vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t.queue=e,e=e.dispatch=RS.bind(null,Ve,e),[t.memoizedState,e]}function ls(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e)),e}function f0(){return Yt().memoizedState}function Ma(e,t,n,i){var r=vn();Ve.flags|=e,r.memoizedState=ls(1|t,n,void 0,i===void 0?null:i)}function jl(e,t,n,i){var r=Yt();i=i===void 0?null:i;var o=void 0;if(Qe!==null){var s=Qe.memoizedState;if(o=s.destroy,i!==null&&Vh(i,s.deps)){r.memoizedState=ls(t,n,o,i);return}}Ve.flags|=e,r.memoizedState=ls(1|t,n,o,i)}function Wf(e,t){return Ma(8390656,8,e,t)}function Gh(e,t){return jl(2048,8,e,t)}function m0(e,t){return jl(4,2,e,t)}function g0(e,t){return jl(4,4,e,t)}function v0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function w0(e,t,n){return n=n!=null?n.concat([e]):null,jl(4,4,v0.bind(null,t,e),n)}function Bh(){}function b0(e,t){var n=Yt();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&Vh(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function y0(e,t){var n=Yt();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&Vh(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function x0(e,t,n){return Ji&21?(cn(n,t)||(n=Ew(),Ve.lanes|=n,er|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xt=!0),e.memoizedState=n)}function LS(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var i=Yu.transition;Yu.transition={};try{e(!1),t()}finally{Ce=n,Yu.transition=i}}function _0(){return Yt().memoizedState}function OS(e,t,n){var i=vi(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},k0(e))S0(t,n);else if(n=r0(e,t,n,i),n!==null){var r=gt();ln(n,e,i,r),C0(n,t,i)}}function RS(e,t,n){var i=vi(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(k0(e))S0(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(r.hasEagerState=!0,r.eagerState=a,cn(a,s)){var l=t.interleaved;l===null?(r.next=r,Th(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=r0(e,t,r,i),n!==null&&(r=gt(),ln(n,e,i,r),C0(n,t,i))}}function k0(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function S0(e,t){Ro=cl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function C0(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,bh(e,n)}}var dl={readContext:Ut,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useInsertionEffect:at,useLayoutEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useMutableSource:at,useSyncExternalStore:at,useId:at,unstable_isNewReconciler:!1},VS={readContext:Ut,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:Wf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ma(4194308,4,v0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ma(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ma(4,2,e,t)},useMemo:function(e,t){var n=vn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=vn();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=OS.bind(null,Ve,e),[i.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:$f,useDebugValue:Bh,useDeferredValue:function(e){return vn().memoizedState=e},useTransition:function(){var e=$f(!1),t=e[0];return e=LS.bind(null,e[1]),vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Ve,r=vn();if(Te){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),nt===null)throw Error(W(349));Ji&30||u0(i,t,n)}r.memoizedState=n;var o={value:n,getSnapshot:t};return r.queue=o,Wf(d0.bind(null,i,o,e),[e]),i.flags|=2048,ls(9,c0.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=vn(),t=nt.identifierPrefix;if(Te){var n=Rn,i=On;n=(i&~(1<<32-an(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=ss++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=MS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},FS={readContext:Ut,useCallback:b0,useContext:Ut,useEffect:Gh,useImperativeHandle:w0,useInsertionEffect:m0,useLayoutEffect:g0,useMemo:y0,useReducer:Xu,useRef:f0,useState:function(){return Xu(as)},useDebugValue:Bh,useDeferredValue:function(e){var t=Yt();return x0(t,Qe.memoizedState,e)},useTransition:function(){var e=Xu(as)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:a0,useSyncExternalStore:l0,useId:_0,unstable_isNewReconciler:!1},HS={readContext:Ut,useCallback:b0,useContext:Ut,useEffect:Gh,useImperativeHandle:w0,useInsertionEffect:m0,useLayoutEffect:g0,useMemo:y0,useReducer:Zu,useRef:f0,useState:function(){return Zu(as)},useDebugValue:Bh,useDeferredValue:function(e){var t=Yt();return Qe===null?t.memoizedState=e:x0(t,Qe.memoizedState,e)},useTransition:function(){var e=Zu(as)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:a0,useSyncExternalStore:l0,useId:_0,unstable_isNewReconciler:!1};function Kt(e,t){if(e&&e.defaultProps){t=Fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function od(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:Fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ul={isMounted:function(e){return(e=e._reactInternals)?lr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=gt(),r=vi(e),o=Hn(i,r);o.payload=t,n!=null&&(o.callback=n),t=mi(e,o,r),t!==null&&(ln(t,e,r,i),Na(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=gt(),r=vi(e),o=Hn(i,r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=mi(e,o,r),t!==null&&(ln(t,e,r,i),Na(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gt(),i=vi(e),r=Hn(n,i);r.tag=2,t!=null&&(r.callback=t),t=mi(e,r,i),t!==null&&(ln(t,e,i,n),Na(t,e,i))}};function jf(e,t,n,i,r,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,o,s):t.prototype&&t.prototype.isPureReactComponent?!es(n,i)||!es(r,o):!0}function E0(e,t,n){var i=!1,r=_i,o=t.contextType;return typeof o=="object"&&o!==null?o=Ut(o):(r=St(t)?Qi:dt.current,i=t.contextTypes,o=(i=i!=null)?$r(e,r):_i),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ul,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),t}function Uf(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Ul.enqueueReplaceState(t,t.state,null)}function sd(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Mh(e);var o=t.contextType;typeof o=="object"&&o!==null?r.context=Ut(o):(o=St(t)?Qi:dt.current,r.context=$r(e,o)),r.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(od(e,t,o,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Ul.enqueueReplaceState(r,r.state,null),ll(e,n,r,i),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function Yr(e,t){try{var n="",i=t;do n+=fk(i),i=i.return;while(i);var r=n}catch(o){r=`
|
|
37
|
+
`+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Au=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Eo(e):""}function fk(e){switch(e.tag){case 5:return Eo(e.type);case 16:return Eo("Lazy");case 13:return Eo("Suspense");case 19:return Eo("SuspenseList");case 0:case 2:case 15:return e=Iu(e.type,!1),e;case 11:return e=Iu(e.type.render,!1),e;case 1:return e=Iu(e.type,!0),e;default:return""}}function Tc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yr:return"Fragment";case br:return"Portal";case Ac:return"Profiler";case fh:return"StrictMode";case Ic:return"Suspense";case Nc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sw:return(e.displayName||"Context")+".Consumer";case ow:return(e._context.displayName||"Context")+".Provider";case mh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gh:return t=e.displayName||null,t!==null?t:Tc(e.type)||"Memo";case ii:t=e._payload,e=e._init;try{return Tc(e(t))}catch{}}return null}function mk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tc(t);case 8:return t===fh?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gk(e){var t=lw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function js(e){e._valueTracker||(e._valueTracker=gk(e))}function uw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=lw(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Ya(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Mc(e,t){var n=t.checked;return Fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function cf(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=xi(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function cw(e,t){t=t.checked,t!=null&&ph(e,"checked",t,!1)}function Lc(e,t){cw(e,t);var n=xi(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oc(e,t.type,xi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function df(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Oc(e,t,n){(t!=="number"||Ya(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Do=Array.isArray;function Tr(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+xi(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,i&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Rc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return Fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Do(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xi(n)}}function dw(e,t){var n=xi(t.value),i=xi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),i!=null&&(e.defaultValue=""+i)}function pf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hw(e){switch(e){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 Vc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Us,pw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,i,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,i,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Us=Us||document.createElement("div"),Us.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Us.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var No={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},vk=["Webkit","ms","Moz","O"];Object.keys(No).forEach(function(e){vk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),No[t]=No[e]})});function fw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||No.hasOwnProperty(e)&&No[e]?(""+t).trim():t+"px"}function mw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=fw(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}var wk=Fe({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 Fc(e,t){if(t){if(wk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Hc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gc=null;function vh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bc=null,Mr=null,Lr=null;function ff(e){if(e=Ps(e)){if(typeof Bc!="function")throw Error(W(280));var t=e.stateNode;t&&(t=$l(t),Bc(e.stateNode,e.type,t))}}function gw(e){Mr?Lr?Lr.push(e):Lr=[e]:Mr=e}function vw(){if(Mr){var e=Mr,t=Lr;if(Lr=Mr=null,ff(e),t)for(e=0;e<t.length;e++)ff(t[e])}}function ww(e,t){return e(t)}function bw(){}var Nu=!1;function yw(e,t,n){if(Nu)return e(t,n);Nu=!0;try{return ww(e,t,n)}finally{Nu=!1,(Mr!==null||Lr!==null)&&(bw(),vw())}}function Zo(e,t){var n=e.stateNode;if(n===null)return null;var i=$l(n);if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var $c=!1;if(Gn)try{var po={};Object.defineProperty(po,"passive",{get:function(){$c=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{$c=!1}function bk(e,t,n,i,r,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var To=!1,Xa=null,Za=!1,Wc=null,yk={onError:function(e){To=!0,Xa=e}};function xk(e,t,n,i,r,o,s,a,l){To=!1,Xa=null,bk.apply(yk,arguments)}function _k(e,t,n,i,r,o,s,a,l){if(xk.apply(this,arguments),To){if(To){var u=Xa;To=!1,Xa=null}else throw Error(W(198));Za||(Za=!0,Wc=u)}}function lr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function xw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function mf(e){if(lr(e)!==e)throw Error(W(188))}function kk(e){var t=e.alternate;if(!t){if(t=lr(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return mf(r),e;if(o===i)return mf(r),t;o=o.sibling}throw Error(W(188))}if(n.return!==i.return)n=r,i=o;else{for(var s=!1,a=r.child;a;){if(a===n){s=!0,n=r,i=o;break}if(a===i){s=!0,i=r,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,i=r;break}if(a===i){s=!0,i=o,n=r;break}a=a.sibling}if(!s)throw Error(W(189))}}if(n.alternate!==i)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function _w(e){return e=kk(e),e!==null?kw(e):null}function kw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=kw(e);if(t!==null)return t;e=e.sibling}return null}var Sw=Mt.unstable_scheduleCallback,gf=Mt.unstable_cancelCallback,Sk=Mt.unstable_shouldYield,Ck=Mt.unstable_requestPaint,Be=Mt.unstable_now,Ek=Mt.unstable_getCurrentPriorityLevel,wh=Mt.unstable_ImmediatePriority,Cw=Mt.unstable_UserBlockingPriority,qa=Mt.unstable_NormalPriority,Dk=Mt.unstable_LowPriority,Ew=Mt.unstable_IdlePriority,Fl=null,Sn=null;function zk(e){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(Fl,e,void 0,(e.current.flags&128)===128)}catch{}}var an=Math.clz32?Math.clz32:Ik,Pk=Math.log,Ak=Math.LN2;function Ik(e){return e>>>=0,e===0?32:31-(Pk(e)/Ak|0)|0}var Ys=64,Xs=4194304;function zo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Qa(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~r;a!==0?i=zo(a):(o&=s,o!==0&&(i=zo(o)))}else s=n&~r,s!==0?i=zo(s):o!==0&&(i=zo(o));if(i===0)return 0;if(t!==0&&t!==i&&!(t&r)&&(r=i&-i,o=t&-t,r>=o||r===16&&(o&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)n=31-an(t),r=1<<n,i|=e[n],t&=~r;return i}function Nk(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Tk(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-an(o),a=1<<s,l=r[s];l===-1?(!(a&n)||a&i)&&(r[s]=Nk(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function jc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Dw(){var e=Ys;return Ys<<=1,!(Ys&4194240)&&(Ys=64),e}function Tu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ds(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-an(t),e[t]=n}function Mk(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-an(n),o=1<<r;t[r]=0,i[r]=-1,e[r]=-1,n&=~o}}function bh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-an(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}var Ce=0;function zw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Pw,yh,Aw,Iw,Nw,Uc=!1,Zs=[],di=null,hi=null,pi=null,qo=new Map,Qo=new Map,oi=[],Lk="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 vf(e,t){switch(e){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(t.pointerId)}}function fo(e,t,n,i,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Ps(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Ok(e,t,n,i,r){switch(t){case"focusin":return di=fo(di,e,t,n,i,r),!0;case"dragenter":return hi=fo(hi,e,t,n,i,r),!0;case"mouseover":return pi=fo(pi,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return qo.set(o,fo(qo.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Qo.set(o,fo(Qo.get(o)||null,e,t,n,i,r)),!0}return!1}function Tw(e){var t=Gi(e.target);if(t!==null){var n=lr(t);if(n!==null){if(t=n.tag,t===13){if(t=xw(n),t!==null){e.blockedOn=t,Nw(e.priority,function(){Aw(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Gc=i,n.target.dispatchEvent(i),Gc=null}else return t=Ps(n),t!==null&&yh(t),e.blockedOn=n,!1;t.shift()}return!0}function wf(e,t,n){Pa(e)&&n.delete(t)}function Rk(){Uc=!1,di!==null&&Pa(di)&&(di=null),hi!==null&&Pa(hi)&&(hi=null),pi!==null&&Pa(pi)&&(pi=null),qo.forEach(wf),Qo.forEach(wf)}function mo(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,Mt.unstable_scheduleCallback(Mt.unstable_NormalPriority,Rk)))}function Ko(e){function t(r){return mo(r,e)}if(0<Zs.length){mo(Zs[0],e);for(var n=1;n<Zs.length;n++){var i=Zs[n];i.blockedOn===e&&(i.blockedOn=null)}}for(di!==null&&mo(di,e),hi!==null&&mo(hi,e),pi!==null&&mo(pi,e),qo.forEach(t),Qo.forEach(t),n=0;n<oi.length;n++)i=oi[n],i.blockedOn===e&&(i.blockedOn=null);for(;0<oi.length&&(n=oi[0],n.blockedOn===null);)Tw(n),n.blockedOn===null&&oi.shift()}var Or=Un.ReactCurrentBatchConfig,Ka=!0;function Vk(e,t,n,i){var r=Ce,o=Or.transition;Or.transition=null;try{Ce=1,xh(e,t,n,i)}finally{Ce=r,Or.transition=o}}function Fk(e,t,n,i){var r=Ce,o=Or.transition;Or.transition=null;try{Ce=4,xh(e,t,n,i)}finally{Ce=r,Or.transition=o}}function xh(e,t,n,i){if(Ka){var r=Yc(e,t,n,i);if(r===null)$u(e,t,i,Ja,n),vf(e,i);else if(Ok(r,e,t,n,i))i.stopPropagation();else if(vf(e,i),t&4&&-1<Lk.indexOf(e)){for(;r!==null;){var o=Ps(r);if(o!==null&&Pw(o),o=Yc(e,t,n,i),o===null&&$u(e,t,i,Ja,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else $u(e,t,i,null,n)}}var Ja=null;function Yc(e,t,n,i){if(Ja=null,e=vh(i),e=Gi(e),e!==null)if(t=lr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=xw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ja=e,null}function Mw(e){switch(e){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(Ek()){case wh:return 1;case Cw:return 4;case qa:case Dk:return 16;case Ew:return 536870912;default:return 16}default:return 16}}var li=null,_h=null,Aa=null;function Lw(){if(Aa)return Aa;var e,t=_h,n=t.length,i,r="value"in li?li.value:li.textContent,o=r.length;for(e=0;e<n&&t[e]===r[e];e++);var s=n-e;for(i=1;i<=s&&t[n-i]===r[o-i];i++);return Aa=r.slice(e,1<i?1-i:void 0)}function Ia(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function qs(){return!0}function bf(){return!1}function Rt(e){function t(n,i,r,o,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?qs:bf,this.isPropagationStopped=bf,this}return Fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=qs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=qs)},persist:function(){},isPersistent:qs}),t}var oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kh=Rt(oo),zs=Fe({},oo,{view:0,detail:0}),Hk=Rt(zs),Mu,Lu,go,Hl=Fe({},zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==go&&(go&&e.type==="mousemove"?(Mu=e.screenX-go.screenX,Lu=e.screenY-go.screenY):Lu=Mu=0,go=e),Mu)},movementY:function(e){return"movementY"in e?e.movementY:Lu}}),yf=Rt(Hl),Gk=Fe({},Hl,{dataTransfer:0}),Bk=Rt(Gk),$k=Fe({},zs,{relatedTarget:0}),Ou=Rt($k),Wk=Fe({},oo,{animationName:0,elapsedTime:0,pseudoElement:0}),jk=Rt(Wk),Uk=Fe({},oo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yk=Rt(Uk),Xk=Fe({},oo,{data:0}),xf=Rt(Xk),Zk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qk={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"},Qk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qk[e])?!!t[e]:!1}function Sh(){return Kk}var Jk=Fe({},zs,{key:function(e){if(e.key){var t=Zk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ia(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sh,charCode:function(e){return e.type==="keypress"?Ia(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ia(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eS=Rt(Jk),tS=Fe({},Hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_f=Rt(tS),nS=Fe({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sh}),iS=Rt(nS),rS=Fe({},oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),oS=Rt(rS),sS=Fe({},Hl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),aS=Rt(sS),lS=[9,13,27,32],Ch=Gn&&"CompositionEvent"in window,Mo=null;Gn&&"documentMode"in document&&(Mo=document.documentMode);var uS=Gn&&"TextEvent"in window&&!Mo,Ow=Gn&&(!Ch||Mo&&8<Mo&&11>=Mo),kf=" ",Sf=!1;function Rw(e,t){switch(e){case"keyup":return lS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xr=!1;function cS(e,t){switch(e){case"compositionend":return Vw(t);case"keypress":return t.which!==32?null:(Sf=!0,kf);case"textInput":return e=t.data,e===kf&&Sf?null:e;default:return null}}function dS(e,t){if(xr)return e==="compositionend"||!Ch&&Rw(e,t)?(e=Lw(),Aa=_h=li=null,xr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ow&&t.locale!=="ko"?null:t.data;default:return null}}var hS={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 Cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hS[e.type]:t==="textarea"}function Fw(e,t,n,i){gw(i),t=el(t,"onChange"),0<t.length&&(n=new kh("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Lo=null,Jo=null;function pS(e){qw(e,0)}function Gl(e){var t=Sr(e);if(uw(t))return e}function fS(e,t){if(e==="change")return t}var Hw=!1;if(Gn){var Ru;if(Gn){var Vu="oninput"in document;if(!Vu){var Ef=document.createElement("div");Ef.setAttribute("oninput","return;"),Vu=typeof Ef.oninput=="function"}Ru=Vu}else Ru=!1;Hw=Ru&&(!document.documentMode||9<document.documentMode)}function Df(){Lo&&(Lo.detachEvent("onpropertychange",Gw),Jo=Lo=null)}function Gw(e){if(e.propertyName==="value"&&Gl(Jo)){var t=[];Fw(t,Jo,e,vh(e)),yw(pS,t)}}function mS(e,t,n){e==="focusin"?(Df(),Lo=t,Jo=n,Lo.attachEvent("onpropertychange",Gw)):e==="focusout"&&Df()}function gS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gl(Jo)}function vS(e,t){if(e==="click")return Gl(t)}function wS(e,t){if(e==="input"||e==="change")return Gl(t)}function bS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:bS;function es(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Pc.call(t,r)||!cn(e[r],t[r]))return!1}return!0}function zf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pf(e,t){var n=zf(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zf(n)}}function Bw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $w(){for(var e=window,t=Ya();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ya(e.document)}return t}function Eh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yS(e){var t=$w(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bw(n.ownerDocument.documentElement,n)){if(i!==null&&Eh(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,o=Math.min(i.start,r);i=i.end===void 0?o:Math.min(i.end,r),!e.extend&&o>i&&(r=i,i=o,o=r),r=Pf(n,o);var s=Pf(n,i);r&&s&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),o>i?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xS=Gn&&"documentMode"in document&&11>=document.documentMode,_r=null,Xc=null,Oo=null,Zc=!1;function Af(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zc||_r==null||_r!==Ya(i)||(i=_r,"selectionStart"in i&&Eh(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Oo&&es(Oo,i)||(Oo=i,i=el(Xc,"onSelect"),0<i.length&&(t=new kh("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=_r)))}function Qs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:Qs("Animation","AnimationEnd"),animationiteration:Qs("Animation","AnimationIteration"),animationstart:Qs("Animation","AnimationStart"),transitionend:Qs("Transition","TransitionEnd")},Fu={},Ww={};Gn&&(Ww=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Bl(e){if(Fu[e])return Fu[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ww)return Fu[e]=t[n];return e}var jw=Bl("animationend"),Uw=Bl("animationiteration"),Yw=Bl("animationstart"),Xw=Bl("transitionend"),Zw=new Map,If="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 ki(e,t){Zw.set(e,t),ar(t,[e])}for(var Hu=0;Hu<If.length;Hu++){var Gu=If[Hu],_S=Gu.toLowerCase(),kS=Gu[0].toUpperCase()+Gu.slice(1);ki(_S,"on"+kS)}ki(jw,"onAnimationEnd");ki(Uw,"onAnimationIteration");ki(Yw,"onAnimationStart");ki("dblclick","onDoubleClick");ki("focusin","onFocus");ki("focusout","onBlur");ki(Xw,"onTransitionEnd");Br("onMouseEnter",["mouseout","mouseover"]);Br("onMouseLeave",["mouseout","mouseover"]);Br("onPointerEnter",["pointerout","pointerover"]);Br("onPointerLeave",["pointerout","pointerover"]);ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ar("onBeforeInput",["compositionend","keypress","textInput","paste"]);ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Po="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(" "),SS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Po));function Nf(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,_k(i,t,void 0,e),e.currentTarget=null}function qw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var s=i.length-1;0<=s;s--){var a=i[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&r.isPropagationStopped())break e;Nf(r,a,u),o=l}else for(s=0;s<i.length;s++){if(a=i[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&r.isPropagationStopped())break e;Nf(r,a,u),o=l}}}if(Za)throw e=Wc,Za=!1,Wc=null,e}function Ae(e,t){var n=t[ed];n===void 0&&(n=t[ed]=new Set);var i=e+"__bubble";n.has(i)||(Qw(t,e,2,!1),n.add(i))}function Bu(e,t,n){var i=0;t&&(i|=4),Qw(n,e,i,t)}var Ks="_reactListening"+Math.random().toString(36).slice(2);function ts(e){if(!e[Ks]){e[Ks]=!0,rw.forEach(function(n){n!=="selectionchange"&&(SS.has(n)||Bu(n,!1,e),Bu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ks]||(t[Ks]=!0,Bu("selectionchange",!1,t))}}function Qw(e,t,n,i){switch(Mw(t)){case 1:var r=Vk;break;case 4:r=Fk;break;default:r=xh}n=r.bind(null,t,n,e),r=void 0,!$c||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),i?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function $u(e,t,n,i,r){var o=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=Gi(a),s===null)return;if(l=s.tag,l===5||l===6){i=o=s;continue e}a=a.parentNode}}i=i.return}yw(function(){var u=o,d=vh(n),c=[];e:{var h=Zw.get(e);if(h!==void 0){var p=kh,f=e;switch(e){case"keypress":if(Ia(n)===0)break e;case"keydown":case"keyup":p=eS;break;case"focusin":f="focus",p=Ou;break;case"focusout":f="blur",p=Ou;break;case"beforeblur":case"afterblur":p=Ou;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":p=yf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Bk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=iS;break;case jw:case Uw:case Yw:p=jk;break;case Xw:p=oS;break;case"scroll":p=Hk;break;case"wheel":p=aS;break;case"copy":case"cut":case"paste":p=Yk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=_f}var v=(t&4)!==0,b=!v&&e==="scroll",m=v?h!==null?h+"Capture":null:h;v=[];for(var w=u,g;w!==null;){g=w;var y=g.stateNode;if(g.tag===5&&y!==null&&(g=y,m!==null&&(y=Zo(w,m),y!=null&&v.push(ns(w,y,g)))),b)break;w=w.return}0<v.length&&(h=new p(h,f,null,n,d),c.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Gc&&(f=n.relatedTarget||n.fromElement)&&(Gi(f)||f[Bn]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(f=n.relatedTarget||n.toElement,p=u,f=f?Gi(f):null,f!==null&&(b=lr(f),f!==b||f.tag!==5&&f.tag!==6)&&(f=null)):(p=null,f=u),p!==f)){if(v=yf,y="onMouseLeave",m="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=_f,y="onPointerLeave",m="onPointerEnter",w="pointer"),b=p==null?h:Sr(p),g=f==null?h:Sr(f),h=new v(y,w+"leave",p,n,d),h.target=b,h.relatedTarget=g,y=null,Gi(d)===u&&(v=new v(m,w+"enter",f,n,d),v.target=g,v.relatedTarget=b,y=v),b=y,p&&f)t:{for(v=p,m=f,w=0,g=v;g;g=pr(g))w++;for(g=0,y=m;y;y=pr(y))g++;for(;0<w-g;)v=pr(v),w--;for(;0<g-w;)m=pr(m),g--;for(;w--;){if(v===m||m!==null&&v===m.alternate)break t;v=pr(v),m=pr(m)}v=null}else v=null;p!==null&&Tf(c,h,p,v,!1),f!==null&&b!==null&&Tf(c,b,f,v,!0)}}e:{if(h=u?Sr(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var k=fS;else if(Cf(h))if(Hw)k=wS;else{k=gS;var _=mS}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=vS);if(k&&(k=k(e,u))){Fw(c,k,n,d);break e}_&&_(e,h,u),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&Oc(h,"number",h.value)}switch(_=u?Sr(u):window,e){case"focusin":(Cf(_)||_.contentEditable==="true")&&(_r=_,Xc=u,Oo=null);break;case"focusout":Oo=Xc=_r=null;break;case"mousedown":Zc=!0;break;case"contextmenu":case"mouseup":case"dragend":Zc=!1,Af(c,n,d);break;case"selectionchange":if(xS)break;case"keydown":case"keyup":Af(c,n,d)}var E;if(Ch)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else xr?Rw(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(Ow&&n.locale!=="ko"&&(xr||S!=="onCompositionStart"?S==="onCompositionEnd"&&xr&&(E=Lw()):(li=d,_h="value"in li?li.value:li.textContent,xr=!0)),_=el(u,S),0<_.length&&(S=new xf(S,e,null,n,d),c.push({event:S,listeners:_}),E?S.data=E:(E=Vw(n),E!==null&&(S.data=E)))),(E=uS?cS(e,n):dS(e,n))&&(u=el(u,"onBeforeInput"),0<u.length&&(d=new xf("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=E))}qw(c,t)})}function ns(e,t,n){return{instance:e,listener:t,currentTarget:n}}function el(e,t){for(var n=t+"Capture",i=[];e!==null;){var r=e,o=r.stateNode;r.tag===5&&o!==null&&(r=o,o=Zo(e,n),o!=null&&i.unshift(ns(e,o,r)),o=Zo(e,t),o!=null&&i.push(ns(e,o,r))),e=e.return}return i}function pr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Tf(e,t,n,i,r){for(var o=t._reactName,s=[];n!==null&&n!==i;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&u!==null&&(a=u,r?(l=Zo(n,o),l!=null&&s.unshift(ns(n,l,a))):r||(l=Zo(n,o),l!=null&&s.push(ns(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var CS=/\r\n?/g,ES=/\u0000|\uFFFD/g;function Mf(e){return(typeof e=="string"?e:""+e).replace(CS,`
|
|
38
|
+
`).replace(ES,"")}function Js(e,t,n){if(t=Mf(t),Mf(e)!==t&&n)throw Error(W(425))}function tl(){}var qc=null,Qc=null;function Kc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jc=typeof setTimeout=="function"?setTimeout:void 0,DS=typeof clearTimeout=="function"?clearTimeout:void 0,Lf=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof Lf<"u"?function(e){return Lf.resolve(null).then(e).catch(PS)}:Jc;function PS(e){setTimeout(function(){throw e})}function Wu(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(i===0){e.removeChild(r),Ko(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=r}while(n);Ko(t)}function fi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Of(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var so=Math.random().toString(36).slice(2),_n="__reactFiber$"+so,is="__reactProps$"+so,Bn="__reactContainer$"+so,ed="__reactEvents$"+so,AS="__reactListeners$"+so,IS="__reactHandles$"+so;function Gi(e){var t=e[_n];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bn]||n[_n]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Of(e);e!==null;){if(n=e[_n])return n;e=Of(e)}return t}e=n,n=e.parentNode}return null}function Ps(e){return e=e[_n]||e[Bn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Sr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function $l(e){return e[is]||null}var td=[],Cr=-1;function Si(e){return{current:e}}function Ne(e){0>Cr||(e.current=td[Cr],td[Cr]=null,Cr--)}function Pe(e,t){Cr++,td[Cr]=e.current,e.current=t}var _i={},dt=Si(_i),kt=Si(!1),Qi=_i;function $r(e,t){var n=e.type.contextTypes;if(!n)return _i;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in n)r[o]=t[o];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function St(e){return e=e.childContextTypes,e!=null}function nl(){Ne(kt),Ne(dt)}function Rf(e,t,n){if(dt.current!==_i)throw Error(W(168));Pe(dt,t),Pe(kt,n)}function Kw(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in t))throw Error(W(108,mk(e)||"Unknown",r));return Fe({},n,i)}function il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_i,Qi=dt.current,Pe(dt,e),Pe(kt,kt.current),!0}function Vf(e,t,n){var i=e.stateNode;if(!i)throw Error(W(169));n?(e=Kw(e,t,Qi),i.__reactInternalMemoizedMergedChildContext=e,Ne(kt),Ne(dt),Pe(dt,e)):Ne(kt),Pe(kt,n)}var Ln=null,Wl=!1,ju=!1;function Jw(e){Ln===null?Ln=[e]:Ln.push(e)}function NS(e){Wl=!0,Jw(e)}function Ci(){if(!ju&&Ln!==null){ju=!0;var e=0,t=Ce;try{var n=Ln;for(Ce=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Ln=null,Wl=!1}catch(r){throw Ln!==null&&(Ln=Ln.slice(e+1)),Sw(wh,Ci),r}finally{Ce=t,ju=!1}}return null}var Er=[],Dr=0,rl=null,ol=0,Ht=[],Gt=0,Ki=null,On=1,Rn="";function Ri(e,t){Er[Dr++]=ol,Er[Dr++]=rl,rl=e,ol=t}function e0(e,t,n){Ht[Gt++]=On,Ht[Gt++]=Rn,Ht[Gt++]=Ki,Ki=e;var i=On;e=Rn;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(t)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,On=1<<32-an(t)+r|n<<r|i,Rn=o+e}else On=1<<o|n<<r|i,Rn=e}function Dh(e){e.return!==null&&(Ri(e,1),e0(e,1,0))}function zh(e){for(;e===rl;)rl=Er[--Dr],Er[Dr]=null,ol=Er[--Dr],Er[Dr]=null;for(;e===Ki;)Ki=Ht[--Gt],Ht[Gt]=null,Rn=Ht[--Gt],Ht[Gt]=null,On=Ht[--Gt],Ht[Gt]=null}var Nt=null,It=null,Te=!1,tn=null;function t0(e,t){var n=$t(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ff(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Nt=e,It=fi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Nt=e,It=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ki!==null?{id:On,overflow:Rn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=$t(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Nt=e,It=null,!0):!1;default:return!1}}function nd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function id(e){if(Te){var t=It;if(t){var n=t;if(!Ff(e,t)){if(nd(e))throw Error(W(418));t=fi(n.nextSibling);var i=Nt;t&&Ff(e,t)?t0(i,n):(e.flags=e.flags&-4097|2,Te=!1,Nt=e)}}else{if(nd(e))throw Error(W(418));e.flags=e.flags&-4097|2,Te=!1,Nt=e}}}function Hf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Nt=e}function ea(e){if(e!==Nt)return!1;if(!Te)return Hf(e),Te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kc(e.type,e.memoizedProps)),t&&(t=It)){if(nd(e))throw n0(),Error(W(418));for(;t;)t0(e,t),t=fi(t.nextSibling)}if(Hf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){It=fi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}It=null}}else It=Nt?fi(e.stateNode.nextSibling):null;return!0}function n0(){for(var e=It;e;)e=fi(e.nextSibling)}function Wr(){It=Nt=null,Te=!1}function Ph(e){tn===null?tn=[e]:tn.push(e)}var TS=Un.ReactCurrentBatchConfig;function vo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var i=n.stateNode}if(!i)throw Error(W(147,e));var r=i,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=r.refs;s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,e))}return e}function ta(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Gf(e){var t=e._init;return t(e._payload)}function i0(e){function t(m,w){if(e){var g=m.deletions;g===null?(m.deletions=[w],m.flags|=16):g.push(w)}}function n(m,w){if(!e)return null;for(;w!==null;)t(m,w),w=w.sibling;return null}function i(m,w){for(m=new Map;w!==null;)w.key!==null?m.set(w.key,w):m.set(w.index,w),w=w.sibling;return m}function r(m,w){return m=wi(m,w),m.index=0,m.sibling=null,m}function o(m,w,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<w?(m.flags|=2,w):g):(m.flags|=2,w)):(m.flags|=1048576,w)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,w,g,y){return w===null||w.tag!==6?(w=Ku(g,m.mode,y),w.return=m,w):(w=r(w,g),w.return=m,w)}function l(m,w,g,y){var k=g.type;return k===yr?d(m,w,g.props.children,y,g.key):w!==null&&(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ii&&Gf(k)===w.type)?(y=r(w,g.props),y.ref=vo(m,w,g),y.return=m,y):(y=Va(g.type,g.key,g.props,null,m.mode,y),y.ref=vo(m,w,g),y.return=m,y)}function u(m,w,g,y){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Ju(g,m.mode,y),w.return=m,w):(w=r(w,g.children||[]),w.return=m,w)}function d(m,w,g,y,k){return w===null||w.tag!==7?(w=Ui(g,m.mode,y,k),w.return=m,w):(w=r(w,g),w.return=m,w)}function c(m,w,g){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Ku(""+w,m.mode,g),w.return=m,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ws:return g=Va(w.type,w.key,w.props,null,m.mode,g),g.ref=vo(m,null,w),g.return=m,g;case br:return w=Ju(w,m.mode,g),w.return=m,w;case ii:var y=w._init;return c(m,y(w._payload),g)}if(Do(w)||ho(w))return w=Ui(w,m.mode,g,null),w.return=m,w;ta(m,w)}return null}function h(m,w,g,y){var k=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:a(m,w,""+g,y);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ws:return g.key===k?l(m,w,g,y):null;case br:return g.key===k?u(m,w,g,y):null;case ii:return k=g._init,h(m,w,k(g._payload),y)}if(Do(g)||ho(g))return k!==null?null:d(m,w,g,y,null);ta(m,g)}return null}function p(m,w,g,y,k){if(typeof y=="string"&&y!==""||typeof y=="number")return m=m.get(g)||null,a(w,m,""+y,k);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ws:return m=m.get(y.key===null?g:y.key)||null,l(w,m,y,k);case br:return m=m.get(y.key===null?g:y.key)||null,u(w,m,y,k);case ii:var _=y._init;return p(m,w,g,_(y._payload),k)}if(Do(y)||ho(y))return m=m.get(g)||null,d(w,m,y,k,null);ta(w,y)}return null}function f(m,w,g,y){for(var k=null,_=null,E=w,S=w=0,T=null;E!==null&&S<g.length;S++){E.index>S?(T=E,E=null):T=E.sibling;var C=h(m,E,g[S],y);if(C===null){E===null&&(E=T);break}e&&E&&C.alternate===null&&t(m,E),w=o(C,w,S),_===null?k=C:_.sibling=C,_=C,E=T}if(S===g.length)return n(m,E),Te&&Ri(m,S),k;if(E===null){for(;S<g.length;S++)E=c(m,g[S],y),E!==null&&(w=o(E,w,S),_===null?k=E:_.sibling=E,_=E);return Te&&Ri(m,S),k}for(E=i(m,E);S<g.length;S++)T=p(E,m,S,g[S],y),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?S:T.key),w=o(T,w,S),_===null?k=T:_.sibling=T,_=T);return e&&E.forEach(function(I){return t(m,I)}),Te&&Ri(m,S),k}function v(m,w,g,y){var k=ho(g);if(typeof k!="function")throw Error(W(150));if(g=k.call(g),g==null)throw Error(W(151));for(var _=k=null,E=w,S=w=0,T=null,C=g.next();E!==null&&!C.done;S++,C=g.next()){E.index>S?(T=E,E=null):T=E.sibling;var I=h(m,E,C.value,y);if(I===null){E===null&&(E=T);break}e&&E&&I.alternate===null&&t(m,E),w=o(I,w,S),_===null?k=I:_.sibling=I,_=I,E=T}if(C.done)return n(m,E),Te&&Ri(m,S),k;if(E===null){for(;!C.done;S++,C=g.next())C=c(m,C.value,y),C!==null&&(w=o(C,w,S),_===null?k=C:_.sibling=C,_=C);return Te&&Ri(m,S),k}for(E=i(m,E);!C.done;S++,C=g.next())C=p(E,m,S,C.value,y),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?S:C.key),w=o(C,w,S),_===null?k=C:_.sibling=C,_=C);return e&&E.forEach(function(L){return t(m,L)}),Te&&Ri(m,S),k}function b(m,w,g,y){if(typeof g=="object"&&g!==null&&g.type===yr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ws:e:{for(var k=g.key,_=w;_!==null;){if(_.key===k){if(k=g.type,k===yr){if(_.tag===7){n(m,_.sibling),w=r(_,g.props.children),w.return=m,m=w;break e}}else if(_.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ii&&Gf(k)===_.type){n(m,_.sibling),w=r(_,g.props),w.ref=vo(m,_,g),w.return=m,m=w;break e}n(m,_);break}else t(m,_);_=_.sibling}g.type===yr?(w=Ui(g.props.children,m.mode,y,g.key),w.return=m,m=w):(y=Va(g.type,g.key,g.props,null,m.mode,y),y.ref=vo(m,w,g),y.return=m,m=y)}return s(m);case br:e:{for(_=g.key;w!==null;){if(w.key===_)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){n(m,w.sibling),w=r(w,g.children||[]),w.return=m,m=w;break e}else{n(m,w);break}else t(m,w);w=w.sibling}w=Ju(g,m.mode,y),w.return=m,m=w}return s(m);case ii:return _=g._init,b(m,w,_(g._payload),y)}if(Do(g))return f(m,w,g,y);if(ho(g))return v(m,w,g,y);ta(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,w!==null&&w.tag===6?(n(m,w.sibling),w=r(w,g),w.return=m,m=w):(n(m,w),w=Ku(g,m.mode,y),w.return=m,m=w),s(m)):n(m,w)}return b}var jr=i0(!0),r0=i0(!1),sl=Si(null),al=null,zr=null,Ah=null;function Ih(){Ah=zr=al=null}function Nh(e){var t=sl.current;Ne(sl),e._currentValue=t}function rd(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Rr(e,t){al=e,Ah=zr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xt=!0),e.firstContext=null)}function Ut(e){var t=e._currentValue;if(Ah!==e)if(e={context:e,memoizedValue:t,next:null},zr===null){if(al===null)throw Error(W(308));zr=e,al.dependencies={lanes:0,firstContext:e}}else zr=zr.next=e;return t}var Bi=null;function Th(e){Bi===null?Bi=[e]:Bi.push(e)}function o0(e,t,n,i){var r=t.interleaved;return r===null?(n.next=n,Th(t)):(n.next=r.next,r.next=n),t.interleaved=n,$n(e,i)}function $n(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ri=!1;function Mh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mi(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ke&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,$n(e,n)}return r=i.interleaved,r===null?(t.next=t,Th(i)):(t.next=r.next,r.next=t),i.interleaved=t,$n(e,n)}function Na(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,bh(e,n)}}function Bf(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?r=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?r=o=t:o=o.next=t}else r=o=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ll(e,t,n,i){var r=e.updateQueue;ri=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(o!==null){var c=r.baseState;s=0,d=u=l=null,a=o;do{var h=a.lane,p=a.eventTime;if((i&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,v=a;switch(h=t,p=n,v.tag){case 1:if(f=v.payload,typeof f=="function"){c=f.call(p,c,h);break e}c=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=v.payload,h=typeof f=="function"?f.call(p,c,h):f,h==null)break e;c=Fe({},c,h);break e;case 2:ri=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=c):d=d.next=p,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(d===null&&(l=c),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=d,t=r.shared.interleaved,t!==null){r=t;do s|=r.lane,r=r.next;while(r!==t)}else o===null&&(r.shared.lanes=0);er|=s,e.lanes=s,e.memoizedState=c}}function $f(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(r!==null){if(i.callback=null,i=n,typeof r!="function")throw Error(W(191,r));r.call(i)}}}var As={},Cn=Si(As),rs=Si(As),os=Si(As);function $i(e){if(e===As)throw Error(W(174));return e}function Lh(e,t){switch(Pe(os,t),Pe(rs,e),Pe(Cn,As),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vc(t,e)}Ne(Cn),Pe(Cn,t)}function Ur(){Ne(Cn),Ne(rs),Ne(os)}function a0(e){$i(os.current);var t=$i(Cn.current),n=Vc(t,e.type);t!==n&&(Pe(rs,e),Pe(Cn,n))}function Oh(e){rs.current===e&&(Ne(Cn),Ne(rs))}var Re=Si(0);function ul(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uu=[];function Rh(){for(var e=0;e<Uu.length;e++)Uu[e]._workInProgressVersionPrimary=null;Uu.length=0}var Ta=Un.ReactCurrentDispatcher,Yu=Un.ReactCurrentBatchConfig,Ji=0,Ve=null,Qe=null,tt=null,cl=!1,Ro=!1,ss=0,MS=0;function at(){throw Error(W(321))}function Vh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cn(e[n],t[n]))return!1;return!0}function Fh(e,t,n,i,r,o){if(Ji=o,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ta.current=e===null||e.memoizedState===null?VS:FS,e=n(i,r),Ro){o=0;do{if(Ro=!1,ss=0,25<=o)throw Error(W(301));o+=1,tt=Qe=null,t.updateQueue=null,Ta.current=HS,e=n(i,r)}while(Ro)}if(Ta.current=dl,t=Qe!==null&&Qe.next!==null,Ji=0,tt=Qe=Ve=null,cl=!1,t)throw Error(W(300));return e}function Hh(){var e=ss!==0;return ss=0,e}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?Ve.memoizedState=tt=e:tt=tt.next=e,tt}function Yt(){if(Qe===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=tt===null?Ve.memoizedState:tt.next;if(t!==null)tt=t,Qe=e;else{if(e===null)throw Error(W(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},tt===null?Ve.memoizedState=tt=e:tt=tt.next=e}return tt}function as(e,t){return typeof t=="function"?t(e):t}function Xu(e){var t=Yt(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var i=Qe,r=i.baseQueue,o=n.pending;if(o!==null){if(r!==null){var s=r.next;r.next=o.next,o.next=s}i.baseQueue=r=o,n.pending=null}if(r!==null){o=r.next,i=i.baseState;var a=s=null,l=null,u=o;do{var d=u.lane;if((Ji&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,s=i):l=l.next=c,Ve.lanes|=d,er|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=a,cn(i,t.memoizedState)||(xt=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){r=e;do o=r.lane,Ve.lanes|=o,er|=o,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Zu(e){var t=Yt(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,o=t.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do o=e(o,s.action),s=s.next;while(s!==r);cn(o,t.memoizedState)||(xt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function l0(){}function u0(e,t){var n=Ve,i=Yt(),r=t(),o=!cn(i.memoizedState,r);if(o&&(i.memoizedState=r,xt=!0),i=i.queue,Gh(h0.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||tt!==null&&tt.memoizedState.tag&1){if(n.flags|=2048,ls(9,d0.bind(null,n,i,r,t),void 0,null),nt===null)throw Error(W(349));Ji&30||c0(n,t,r)}return r}function c0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function d0(e,t,n,i){t.value=n,t.getSnapshot=i,p0(t)&&f0(e)}function h0(e,t,n){return n(function(){p0(t)&&f0(e)})}function p0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cn(e,n)}catch{return!0}}function f0(e){var t=$n(e,1);t!==null&&ln(t,e,1,-1)}function Wf(e){var t=vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t.queue=e,e=e.dispatch=RS.bind(null,Ve,e),[t.memoizedState,e]}function ls(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e)),e}function m0(){return Yt().memoizedState}function Ma(e,t,n,i){var r=vn();Ve.flags|=e,r.memoizedState=ls(1|t,n,void 0,i===void 0?null:i)}function jl(e,t,n,i){var r=Yt();i=i===void 0?null:i;var o=void 0;if(Qe!==null){var s=Qe.memoizedState;if(o=s.destroy,i!==null&&Vh(i,s.deps)){r.memoizedState=ls(t,n,o,i);return}}Ve.flags|=e,r.memoizedState=ls(1|t,n,o,i)}function jf(e,t){return Ma(8390656,8,e,t)}function Gh(e,t){return jl(2048,8,e,t)}function g0(e,t){return jl(4,2,e,t)}function v0(e,t){return jl(4,4,e,t)}function w0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function b0(e,t,n){return n=n!=null?n.concat([e]):null,jl(4,4,w0.bind(null,t,e),n)}function Bh(){}function y0(e,t){var n=Yt();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&Vh(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function x0(e,t){var n=Yt();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&Vh(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function _0(e,t,n){return Ji&21?(cn(n,t)||(n=Dw(),Ve.lanes|=n,er|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xt=!0),e.memoizedState=n)}function LS(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var i=Yu.transition;Yu.transition={};try{e(!1),t()}finally{Ce=n,Yu.transition=i}}function k0(){return Yt().memoizedState}function OS(e,t,n){var i=vi(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},S0(e))C0(t,n);else if(n=o0(e,t,n,i),n!==null){var r=gt();ln(n,e,i,r),E0(n,t,i)}}function RS(e,t,n){var i=vi(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(S0(e))C0(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(r.hasEagerState=!0,r.eagerState=a,cn(a,s)){var l=t.interleaved;l===null?(r.next=r,Th(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=o0(e,t,r,i),n!==null&&(r=gt(),ln(n,e,i,r),E0(n,t,i))}}function S0(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function C0(e,t){Ro=cl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function E0(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,bh(e,n)}}var dl={readContext:Ut,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useInsertionEffect:at,useLayoutEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useMutableSource:at,useSyncExternalStore:at,useId:at,unstable_isNewReconciler:!1},VS={readContext:Ut,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:jf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ma(4194308,4,w0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ma(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ma(4,2,e,t)},useMemo:function(e,t){var n=vn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=vn();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=OS.bind(null,Ve,e),[i.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:Wf,useDebugValue:Bh,useDeferredValue:function(e){return vn().memoizedState=e},useTransition:function(){var e=Wf(!1),t=e[0];return e=LS.bind(null,e[1]),vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Ve,r=vn();if(Te){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),nt===null)throw Error(W(349));Ji&30||c0(i,t,n)}r.memoizedState=n;var o={value:n,getSnapshot:t};return r.queue=o,jf(h0.bind(null,i,o,e),[e]),i.flags|=2048,ls(9,d0.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=vn(),t=nt.identifierPrefix;if(Te){var n=Rn,i=On;n=(i&~(1<<32-an(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=ss++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=MS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},FS={readContext:Ut,useCallback:y0,useContext:Ut,useEffect:Gh,useImperativeHandle:b0,useInsertionEffect:g0,useLayoutEffect:v0,useMemo:x0,useReducer:Xu,useRef:m0,useState:function(){return Xu(as)},useDebugValue:Bh,useDeferredValue:function(e){var t=Yt();return _0(t,Qe.memoizedState,e)},useTransition:function(){var e=Xu(as)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:l0,useSyncExternalStore:u0,useId:k0,unstable_isNewReconciler:!1},HS={readContext:Ut,useCallback:y0,useContext:Ut,useEffect:Gh,useImperativeHandle:b0,useInsertionEffect:g0,useLayoutEffect:v0,useMemo:x0,useReducer:Zu,useRef:m0,useState:function(){return Zu(as)},useDebugValue:Bh,useDeferredValue:function(e){var t=Yt();return Qe===null?t.memoizedState=e:_0(t,Qe.memoizedState,e)},useTransition:function(){var e=Zu(as)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:l0,useSyncExternalStore:u0,useId:k0,unstable_isNewReconciler:!1};function Kt(e,t){if(e&&e.defaultProps){t=Fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function od(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:Fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ul={isMounted:function(e){return(e=e._reactInternals)?lr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=gt(),r=vi(e),o=Hn(i,r);o.payload=t,n!=null&&(o.callback=n),t=mi(e,o,r),t!==null&&(ln(t,e,r,i),Na(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=gt(),r=vi(e),o=Hn(i,r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=mi(e,o,r),t!==null&&(ln(t,e,r,i),Na(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gt(),i=vi(e),r=Hn(n,i);r.tag=2,t!=null&&(r.callback=t),t=mi(e,r,i),t!==null&&(ln(t,e,i,n),Na(t,e,i))}};function Uf(e,t,n,i,r,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,o,s):t.prototype&&t.prototype.isPureReactComponent?!es(n,i)||!es(r,o):!0}function D0(e,t,n){var i=!1,r=_i,o=t.contextType;return typeof o=="object"&&o!==null?o=Ut(o):(r=St(t)?Qi:dt.current,i=t.contextTypes,o=(i=i!=null)?$r(e,r):_i),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ul,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),t}function Yf(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Ul.enqueueReplaceState(t,t.state,null)}function sd(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Mh(e);var o=t.contextType;typeof o=="object"&&o!==null?r.context=Ut(o):(o=St(t)?Qi:dt.current,r.context=$r(e,o)),r.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(od(e,t,o,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Ul.enqueueReplaceState(r,r.state,null),ll(e,n,r,i),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function Yr(e,t){try{var n="",i=t;do n+=fk(i),i=i.return;while(i);var r=n}catch(o){r=`
|
|
39
39
|
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:r,digest:null}}function qu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ad(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var GS=typeof WeakMap=="function"?WeakMap:Map;function D0(e,t,n){n=Hn(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){pl||(pl=!0,vd=i),ad(e,t)},n}function z0(e,t,n){n=Hn(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var r=t.value;n.payload=function(){return i(r)},n.callback=function(){ad(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ad(e,t),typeof i!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Yf(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new GS;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(r.add(n),e=tC.bind(null,e,t,n),t.then(e,e))}function Xf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zf(e,t,n,i,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Hn(-1,1),t.tag=2,mi(n,t,1))),n.lanes|=1),e)}var BS=Un.ReactCurrentOwner,xt=!1;function ft(e,t,n,i){t.child=e===null?i0(t,null,n,i):jr(t,e.child,n,i)}function qf(e,t,n,i,r){n=n.render;var o=t.ref;return Rr(t,r),i=Fh(e,t,n,i,o,r),n=Hh(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wn(e,t,r)):(Te&&n&&Dh(t),t.flags|=1,ft(e,t,i,r),t.child)}function Qf(e,t,n,i,r){if(e===null){var o=n.type;return typeof o=="function"&&!qh(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,P0(e,t,o,i,r)):(e=Va(n.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&r)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:es,n(s,i)&&e.ref===t.ref)return Wn(e,t,r)}return t.flags|=1,e=wi(o,i),e.ref=t.ref,e.return=t,t.child=e}function P0(e,t,n,i,r){if(e!==null){var o=e.memoizedProps;if(es(o,i)&&e.ref===t.ref)if(xt=!1,t.pendingProps=i=o,(e.lanes&r)!==0)e.flags&131072&&(xt=!0);else return t.lanes=e.lanes,Wn(e,t,r)}return ld(e,t,n,i,r)}function A0(e,t,n){var i=t.pendingProps,r=i.children,o=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(Ar,Pt),Pt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(Ar,Pt),Pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:n,Pe(Ar,Pt),Pt|=i}else o!==null?(i=o.baseLanes|n,t.memoizedState=null):i=n,Pe(Ar,Pt),Pt|=i;return ft(e,t,r,n),t.child}function I0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ld(e,t,n,i,r){var o=St(n)?Qi:dt.current;return o=$r(t,o),Rr(t,r),n=Fh(e,t,n,i,o,r),i=Hh(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wn(e,t,r)):(Te&&i&&Dh(t),t.flags|=1,ft(e,t,n,r),t.child)}function Kf(e,t,n,i,r){if(St(n)){var o=!0;il(t)}else o=!1;if(Rr(t,r),t.stateNode===null)La(e,t),E0(t,n,i),sd(t,n,i,r),i=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ut(u):(u=St(n)?Qi:dt.current,u=$r(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==i||l!==u)&&Uf(t,s,i,u),ri=!1;var h=t.memoizedState;s.state=h,ll(t,i,s,r),l=t.memoizedState,a!==i||h!==l||kt.current||ri?(typeof d=="function"&&(od(t,n,d,i),l=t.memoizedState),(a=ri||jf(t,n,a,i,h,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),s.props=i,s.state=l,s.context=u,i=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{s=t.stateNode,o0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Kt(t.type,a),s.props=u,c=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ut(l):(l=St(n)?Qi:dt.current,l=$r(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==c||h!==l)&&Uf(t,s,i,l),ri=!1,h=t.memoizedState,s.state=h,ll(t,i,s,r);var f=t.memoizedState;a!==c||h!==f||kt.current||ri?(typeof p=="function"&&(od(t,n,p,i),f=t.memoizedState),(u=ri||jf(t,n,u,i,h,f,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,f,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,f,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),s.props=i,s.state=f,s.context=l,i=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return ud(e,t,n,i,o,r)}function ud(e,t,n,i,r,o){I0(e,t);var s=(t.flags&128)!==0;if(!i&&!s)return r&&Rf(t,n,!1),Wn(e,t,o);i=t.stateNode,BS.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&s?(t.child=jr(t,e.child,null,o),t.child=jr(t,null,a,o)):ft(e,t,a,o),t.memoizedState=i.state,r&&Rf(t,n,!0),t.child}function N0(e){var t=e.stateNode;t.pendingContext?Of(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Of(e,t.context,!1),Lh(e,t.containerInfo)}function Jf(e,t,n,i,r){return Wr(),Ph(r),t.flags|=256,ft(e,t,n,i),t.child}var cd={dehydrated:null,treeContext:null,retryLane:0};function dd(e){return{baseLanes:e,cachePool:null,transitions:null}}function T0(e,t,n){var i=t.pendingProps,r=Re.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Pe(Re,r&1),e===null)return id(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=i.children,e=i.fallback,o?(i=t.mode,o=t.child,s={mode:"hidden",children:s},!(i&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Zl(s,i,0,null),e=Ui(e,i,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=dd(n),t.memoizedState=cd,e):$h(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return $S(e,t,s,i,a,r,n);if(o){o=i.fallback,s=t.mode,r=e.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(s&1)&&t.child!==r?(i=t.child,i.childLanes=0,i.pendingProps=l,t.deletions=null):(i=wi(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=wi(a,o):(o=Ui(o,s,n,null),o.flags|=2),o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,s=e.child.memoizedState,s=s===null?dd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=cd,i}return o=e.child,e=o.sibling,i=wi(o,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function $h(e,t){return t=Zl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function na(e,t,n,i){return i!==null&&Ph(i),jr(t,e.child,null,n),e=$h(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $S(e,t,n,i,r,o,s){if(n)return t.flags&256?(t.flags&=-257,i=qu(Error(W(422))),na(e,t,s,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=i.fallback,r=t.mode,i=Zl({mode:"visible",children:i.children},r,0,null),o=Ui(o,r,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&jr(t,e.child,null,s),t.child.memoizedState=dd(s),t.memoizedState=cd,o);if(!(t.mode&1))return na(e,t,s,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error(W(419)),i=qu(o,i,void 0),na(e,t,s,i)}if(a=(s&e.childLanes)!==0,xt||a){if(i=nt,i!==null){switch(s&-s){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|s)?0:r,r!==0&&r!==o.retryLane&&(o.retryLane=r,$n(e,r),ln(i,e,r,-1))}return Zh(),i=qu(Error(W(421))),na(e,t,s,i)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=nC.bind(null,e),r._reactRetry=t,null):(e=o.treeContext,It=fi(r.nextSibling),Nt=t,Te=!0,tn=null,e!==null&&(Ht[Gt++]=On,Ht[Gt++]=Rn,Ht[Gt++]=Ki,On=e.id,Rn=e.overflow,Ki=t),t=$h(t,i.children),t.flags|=4096,t)}function em(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),rd(e.return,t,n)}function Qu(e,t,n,i,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r)}function M0(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;if(ft(e,t,i.children,n),i=Re.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&em(e,n,t);else if(e.tag===19)em(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Pe(Re,i),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ul(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Qu(t,!1,r,n,o);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ul(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Qu(t,!0,n,null,o);break;case"together":Qu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function La(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),er|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function WS(e,t,n){switch(t.tag){case 3:N0(t),Wr();break;case 5:s0(t);break;case 1:St(t.type)&&il(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,r=t.memoizedProps.value;Pe(sl,i._currentValue),i._currentValue=r;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Pe(Re,Re.current&1),t.flags|=128,null):n&t.child.childLanes?T0(e,t,n):(Pe(Re,Re.current&1),e=Wn(e,t,n),e!==null?e.sibling:null);Pe(Re,Re.current&1);break;case 19:if(i=(n&t.childLanes)!==0,e.flags&128){if(i)return M0(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Pe(Re,Re.current),i)break;return null;case 22:case 23:return t.lanes=0,A0(e,t,n)}return Wn(e,t,n)}var L0,hd,O0,R0;L0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};hd=function(){};O0=function(e,t,n,i){var r=e.memoizedProps;if(r!==i){e=t.stateNode,$i(Cn.current);var o=null;switch(n){case"input":r=Mc(e,r),i=Mc(e,i),o=[];break;case"select":r=Fe({},r,{value:void 0}),i=Fe({},i,{value:void 0}),o=[];break;case"textarea":r=Rc(e,r),i=Rc(e,i),o=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=tl)}Fc(n,i);var s;n=null;for(u in r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yo.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in i){var l=i[u];if(a=r!=null?r[u]:void 0,i.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ae("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};R0=function(e,t,n,i){n!==i&&(t.flags|=4)};function wo(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function jS(e,t,n){var i=t.pendingProps;switch(zh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return St(t.type)&&nl(),lt(t),null;case 3:return i=t.stateNode,Ur(),Ne(kt),Ne(dt),Rh(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ea(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,tn!==null&&(yd(tn),tn=null))),hd(e,t),lt(t),null;case 5:Oh(t);var r=$i(os.current);if(n=t.type,e!==null&&t.stateNode!=null)O0(e,t,n,i,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(W(166));return lt(t),null}if(e=$i(Cn.current),ea(t)){i=t.stateNode,n=t.type;var o=t.memoizedProps;switch(i[_n]=t,i[is]=o,e=(t.mode&1)!==0,n){case"dialog":Ae("cancel",i),Ae("close",i);break;case"iframe":case"object":case"embed":Ae("load",i);break;case"video":case"audio":for(r=0;r<Po.length;r++)Ae(Po[r],i);break;case"source":Ae("error",i);break;case"img":case"image":case"link":Ae("error",i),Ae("load",i);break;case"details":Ae("toggle",i);break;case"input":uf(i,o),Ae("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!o.multiple},Ae("invalid",i);break;case"textarea":df(i,o),Ae("invalid",i)}Fc(n,o),r=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?i.textContent!==a&&(o.suppressHydrationWarning!==!0&&Js(i.textContent,a,e),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Js(i.textContent,a,e),r=["children",""+a]):Yo.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ae("scroll",i)}switch(n){case"input":js(i),cf(i,o,!0);break;case"textarea":js(i),hf(i);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(i.onclick=tl)}i=r,t.updateQueue=i,i!==null&&(t.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=dw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=s.createElement(n,{is:i.is}):(e=s.createElement(n),n==="select"&&(s=e,i.multiple?s.multiple=!0:i.size&&(s.size=i.size))):e=s.createElementNS(e,n),e[_n]=t,e[is]=i,L0(e,t,!1,!1),t.stateNode=e;e:{switch(s=Hc(n,i),n){case"dialog":Ae("cancel",e),Ae("close",e),r=i;break;case"iframe":case"object":case"embed":Ae("load",e),r=i;break;case"video":case"audio":for(r=0;r<Po.length;r++)Ae(Po[r],e);r=i;break;case"source":Ae("error",e),r=i;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),r=i;break;case"details":Ae("toggle",e),r=i;break;case"input":uf(e,i),r=Mc(e,i),Ae("invalid",e);break;case"option":r=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},r=Fe({},i,{value:void 0}),Ae("invalid",e);break;case"textarea":df(e,i),r=Rc(e,i),Ae("invalid",e);break;default:r=i}Fc(n,r),a=r;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?fw(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&hw(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Xo(e,l):typeof l=="number"&&Xo(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Yo.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Ae("scroll",e):l!=null&&ph(e,o,l,s))}switch(n){case"input":js(e),cf(e,i,!1);break;case"textarea":js(e),hf(e);break;case"option":i.value!=null&&e.setAttribute("value",""+xi(i.value));break;case"select":e.multiple=!!i.multiple,o=i.value,o!=null?Tr(e,!!i.multiple,o,!1):i.defaultValue!=null&&Tr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=tl)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lt(t),null;case 6:if(e&&t.stateNode!=null)R0(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(W(166));if(n=$i(os.current),$i(Cn.current),ea(t)){if(i=t.stateNode,n=t.memoizedProps,i[_n]=t,(o=i.nodeValue!==n)&&(e=Nt,e!==null))switch(e.tag){case 3:Js(i.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Js(i.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[_n]=t,t.stateNode=i}return lt(t),null;case 13:if(Ne(Re),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Te&&It!==null&&t.mode&1&&!(t.flags&128))t0(),Wr(),t.flags|=98560,o=!1;else if(o=ea(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(W(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(W(317));o[_n]=t}else Wr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),o=!1}else tn!==null&&(yd(tn),tn=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Re.current&1?Ke===0&&(Ke=3):Zh())),t.updateQueue!==null&&(t.flags|=4),lt(t),null);case 4:return Ur(),hd(e,t),e===null&&ts(t.stateNode.containerInfo),lt(t),null;case 10:return Nh(t.type._context),lt(t),null;case 17:return St(t.type)&&nl(),lt(t),null;case 19:if(Ne(Re),o=t.memoizedState,o===null)return lt(t),null;if(i=(t.flags&128)!==0,s=o.rendering,s===null)if(i)wo(o,!1);else{if(Ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ul(e),s!==null){for(t.flags|=128,wo(o,!1),i=s.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)o=n,e=i,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Pe(Re,Re.current&1|2),t.child}e=e.sibling}o.tail!==null&&Be()>Xr&&(t.flags|=128,i=!0,wo(o,!1),t.lanes=4194304)}else{if(!i)if(e=ul(s),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Te)return lt(t),null}else 2*Be()-o.renderingStartTime>Xr&&n!==1073741824&&(t.flags|=128,i=!0,wo(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Be(),t.sibling=null,n=Re.current,Pe(Re,i?n&1|2:n&1),t):(lt(t),null);case 22:case 23:return Xh(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Pt&1073741824&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function US(e,t){switch(zh(t),t.tag){case 1:return St(t.type)&&nl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ur(),Ne(kt),Ne(dt),Rh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Oh(t),null;case 13:if(Ne(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Wr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(Re),null;case 4:return Ur(),null;case 10:return Nh(t.type._context),null;case 22:case 23:return Xh(),null;case 24:return null;default:return null}}var ia=!1,ut=!1,YS=typeof WeakSet=="function"?WeakSet:Set,J=null;function Pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Ge(e,t,i)}else n.current=null}function pd(e,t,n){try{n()}catch(i){Ge(e,t,i)}}var tm=!1;function XS(e,t){if(qc=Ka,e=Bw(),Eh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,h=null;t:for(;;){for(var p;c!==n||r!==0&&c.nodeType!==3||(a=s+r),c!==o||i!==0&&c.nodeType!==3||(l=s+i),c.nodeType===3&&(s+=c.nodeValue.length),(p=c.firstChild)!==null;)h=c,c=p;for(;;){if(c===e)break t;if(h===n&&++u===r&&(a=s),h===o&&++d===i&&(l=s),(p=c.nextSibling)!==null)break;c=h,h=c.parentNode}c=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qc={focusedElem:e,selectionRange:n},Ka=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var f=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var v=f.memoizedProps,b=f.memoizedState,m=t.stateNode,w=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Kt(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(y){Ge(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return f=tm,tm=!1,f}function Vo(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&e)===e){var o=r.destroy;r.destroy=void 0,o!==void 0&&pd(t,n,o)}r=r.next}while(r!==i)}}function Yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function fd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function V0(e){var t=e.alternate;t!==null&&(e.alternate=null,V0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_n],delete t[is],delete t[ed],delete t[AS],delete t[IS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function F0(e){return e.tag===5||e.tag===3||e.tag===4}function nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||F0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function md(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tl));else if(i!==4&&(e=e.child,e!==null))for(md(e,t,n),e=e.sibling;e!==null;)md(e,t,n),e=e.sibling}function gd(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(gd(e,t,n),e=e.sibling;e!==null;)gd(e,t,n),e=e.sibling}var it=null,Jt=!1;function qn(e,t,n){for(n=n.child;n!==null;)H0(e,t,n),n=n.sibling}function H0(e,t,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(Fl,n)}catch{}switch(n.tag){case 5:ut||Pr(n,t);case 6:var i=it,r=Jt;it=null,qn(e,t,n),it=i,Jt=r,it!==null&&(Jt?(e=it,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):it.removeChild(n.stateNode));break;case 18:it!==null&&(Jt?(e=it,n=n.stateNode,e.nodeType===8?Wu(e.parentNode,n):e.nodeType===1&&Wu(e,n),Ko(e)):Wu(it,n.stateNode));break;case 4:i=it,r=Jt,it=n.stateNode.containerInfo,Jt=!0,qn(e,t,n),it=i,Jt=r;break;case 0:case 11:case 14:case 15:if(!ut&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&pd(n,t,s),r=r.next}while(r!==i)}qn(e,t,n);break;case 1:if(!ut&&(Pr(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){Ge(n,t,a)}qn(e,t,n);break;case 21:qn(e,t,n);break;case 22:n.mode&1?(ut=(i=ut)||n.memoizedState!==null,qn(e,t,n),ut=i):qn(e,t,n);break;default:qn(e,t,n)}}function im(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YS),t.forEach(function(i){var r=iC.bind(null,e,i);n.has(i)||(n.add(i),i.then(r,r))})}}function qt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:it=a.stateNode,Jt=!1;break e;case 3:it=a.stateNode.containerInfo,Jt=!0;break e;case 4:it=a.stateNode.containerInfo,Jt=!0;break e}a=a.return}if(it===null)throw Error(W(160));H0(o,s,r),it=null,Jt=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){Ge(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)G0(t,e),t=t.sibling}function G0(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qt(t,e),gn(e),i&4){try{Vo(3,e,e.return),Yl(3,e)}catch(v){Ge(e,e.return,v)}try{Vo(5,e,e.return)}catch(v){Ge(e,e.return,v)}}break;case 1:qt(t,e),gn(e),i&512&&n!==null&&Pr(n,n.return);break;case 5:if(qt(t,e),gn(e),i&512&&n!==null&&Pr(n,n.return),e.flags&32){var r=e.stateNode;try{Xo(r,"")}catch(v){Ge(e,e.return,v)}}if(i&4&&(r=e.stateNode,r!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&uw(r,o),Hc(a,s);var u=Hc(a,o);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?fw(r,c):d==="dangerouslySetInnerHTML"?hw(r,c):d==="children"?Xo(r,c):ph(r,d,c,u)}switch(a){case"input":Lc(r,o);break;case"textarea":cw(r,o);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Tr(r,!!o.multiple,p,!1):h!==!!o.multiple&&(o.defaultValue!=null?Tr(r,!!o.multiple,o.defaultValue,!0):Tr(r,!!o.multiple,o.multiple?[]:"",!1))}r[is]=o}catch(v){Ge(e,e.return,v)}}break;case 6:if(qt(t,e),gn(e),i&4){if(e.stateNode===null)throw Error(W(162));r=e.stateNode,o=e.memoizedProps;try{r.nodeValue=o}catch(v){Ge(e,e.return,v)}}break;case 3:if(qt(t,e),gn(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(v){Ge(e,e.return,v)}break;case 4:qt(t,e),gn(e);break;case 13:qt(t,e),gn(e),r=e.child,r.flags&8192&&(o=r.memoizedState!==null,r.stateNode.isHidden=o,!o||r.alternate!==null&&r.alternate.memoizedState!==null||(Uh=Be())),i&4&&im(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ut=(u=ut)||d,qt(t,e),ut=u):qt(t,e),gn(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(J=e,d=e.child;d!==null;){for(c=J=d;J!==null;){switch(h=J,p=h.child,h.tag){case 0:case 11:case 14:case 15:Vo(4,h,h.return);break;case 1:Pr(h,h.return);var f=h.stateNode;if(typeof f.componentWillUnmount=="function"){i=h,n=h.return;try{t=i,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(v){Ge(i,n,v)}}break;case 5:Pr(h,h.return);break;case 22:if(h.memoizedState!==null){om(c);continue}}p!==null?(p.return=h,J=p):om(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{r=c.stateNode,u?(o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=pw("display",s))}catch(v){Ge(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){Ge(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:qt(t,e),gn(e),i&4&&im(e);break;case 21:break;default:qt(t,e),gn(e)}}function gn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(F0(n)){var i=n;break e}n=n.return}throw Error(W(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(Xo(r,""),i.flags&=-33);var o=nm(e);gd(e,o,r);break;case 3:case 4:var s=i.stateNode.containerInfo,a=nm(e);md(e,a,s);break;default:throw Error(W(161))}}catch(l){Ge(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZS(e,t,n){J=e,B0(e)}function B0(e,t,n){for(var i=(e.mode&1)!==0;J!==null;){var r=J,o=r.child;if(r.tag===22&&i){var s=r.memoizedState!==null||ia;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||ut;a=ia;var u=ut;if(ia=s,(ut=l)&&!u)for(J=r;J!==null;)s=J,l=s.child,s.tag===22&&s.memoizedState!==null?sm(r):l!==null?(l.return=s,J=l):sm(r);for(;o!==null;)J=o,B0(o),o=o.sibling;J=r,ia=a,ut=u}rm(e)}else r.subtreeFlags&8772&&o!==null?(o.return=r,J=o):rm(e)}}function rm(e){for(;J!==null;){var t=J;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ut||Yl(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!ut)if(n===null)i.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:Kt(t.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Bf(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Bf(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&Ko(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}ut||t.flags&512&&fd(t)}catch(h){Ge(t,t.return,h)}}if(t===e){J=null;break}if(n=t.sibling,n!==null){n.return=t.return,J=n;break}J=t.return}}function om(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}function sm(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Yl(4,t)}catch(l){Ge(t,n,l)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var r=t.return;try{i.componentDidMount()}catch(l){Ge(t,r,l)}}var o=t.return;try{fd(t)}catch(l){Ge(t,o,l)}break;case 5:var s=t.return;try{fd(t)}catch(l){Ge(t,s,l)}}}catch(l){Ge(t,t.return,l)}if(t===e){J=null;break}var a=t.sibling;if(a!==null){a.return=t.return,J=a;break}J=t.return}}var qS=Math.ceil,hl=Un.ReactCurrentDispatcher,Wh=Un.ReactCurrentOwner,jt=Un.ReactCurrentBatchConfig,ke=0,nt=null,We=null,ot=0,Pt=0,Ar=Si(0),Ke=0,us=null,er=0,Xl=0,jh=0,Fo=null,yt=null,Uh=0,Xr=1/0,Mn=null,pl=!1,vd=null,gi=null,ra=!1,ui=null,fl=0,Ho=0,wd=null,Oa=-1,Ra=0;function gt(){return ke&6?Be():Oa!==-1?Oa:Oa=Be()}function vi(e){return e.mode&1?ke&2&&ot!==0?ot&-ot:TS.transition!==null?(Ra===0&&(Ra=Ew()),Ra):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:Tw(e.type)),e):1}function ln(e,t,n,i){if(50<Ho)throw Ho=0,wd=null,Error(W(185));Ds(e,n,i),(!(ke&2)||e!==nt)&&(e===nt&&(!(ke&2)&&(Xl|=n),Ke===4&&si(e,ot)),Ct(e,i),n===1&&ke===0&&!(t.mode&1)&&(Xr=Be()+500,Wl&&Ci()))}function Ct(e,t){var n=e.callbackNode;Tk(e,t);var i=Qa(e,e===nt?ot:0);if(i===0)n!==null&&mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(n!=null&&mf(n),t===1)e.tag===0?NS(am.bind(null,e)):Kw(am.bind(null,e)),zS(function(){!(ke&6)&&Ci()}),n=null;else{switch(Dw(i)){case 1:n=wh;break;case 4:n=Sw;break;case 16:n=qa;break;case 536870912:n=Cw;break;default:n=qa}n=q0(n,$0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $0(e,t){if(Oa=-1,Ra=0,ke&6)throw Error(W(327));var n=e.callbackNode;if(Vr()&&e.callbackNode!==n)return null;var i=Qa(e,e===nt?ot:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=ml(e,i);else{t=i;var r=ke;ke|=2;var o=j0();(nt!==e||ot!==t)&&(Mn=null,Xr=Be()+500,ji(e,t));do try{JS();break}catch(a){W0(e,a)}while(!0);Ih(),hl.current=o,ke=r,We!==null?t=0:(nt=null,ot=0,t=Ke)}if(t!==0){if(t===2&&(r=jc(e),r!==0&&(i=r,t=bd(e,r))),t===1)throw n=us,ji(e,0),si(e,i),Ct(e,Be()),n;if(t===6)si(e,i);else{if(r=e.current.alternate,!(i&30)&&!QS(r)&&(t=ml(e,i),t===2&&(o=jc(e),o!==0&&(i=o,t=bd(e,o))),t===1))throw n=us,ji(e,0),si(e,i),Ct(e,Be()),n;switch(e.finishedWork=r,e.finishedLanes=i,t){case 0:case 1:throw Error(W(345));case 2:Vi(e,yt,Mn);break;case 3:if(si(e,i),(i&130023424)===i&&(t=Uh+500-Be(),10<t)){if(Qa(e,0)!==0)break;if(r=e.suspendedLanes,(r&i)!==i){gt(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Jc(Vi.bind(null,e,yt,Mn),t);break}Vi(e,yt,Mn);break;case 4:if(si(e,i),(i&4194240)===i)break;for(t=e.eventTimes,r=-1;0<i;){var s=31-an(i);o=1<<s,s=t[s],s>r&&(r=s),i&=~o}if(i=r,i=Be()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qS(i/1960))-i,10<i){e.timeoutHandle=Jc(Vi.bind(null,e,yt,Mn),i);break}Vi(e,yt,Mn);break;case 5:Vi(e,yt,Mn);break;default:throw Error(W(329))}}}return Ct(e,Be()),e.callbackNode===n?$0.bind(null,e):null}function bd(e,t){var n=Fo;return e.current.memoizedState.isDehydrated&&(ji(e,t).flags|=256),e=ml(e,t),e!==2&&(t=yt,yt=n,t!==null&&yd(t)),e}function yd(e){yt===null?yt=e:yt.push.apply(yt,e)}function QS(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!cn(o(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function si(e,t){for(t&=~jh,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-an(t),i=1<<n;e[n]=-1,t&=~i}}function am(e){if(ke&6)throw Error(W(327));Vr();var t=Qa(e,0);if(!(t&1))return Ct(e,Be()),null;var n=ml(e,t);if(e.tag!==0&&n===2){var i=jc(e);i!==0&&(t=i,n=bd(e,i))}if(n===1)throw n=us,ji(e,0),si(e,t),Ct(e,Be()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vi(e,yt,Mn),Ct(e,Be()),null}function Yh(e,t){var n=ke;ke|=1;try{return e(t)}finally{ke=n,ke===0&&(Xr=Be()+500,Wl&&Ci())}}function tr(e){ui!==null&&ui.tag===0&&!(ke&6)&&Vr();var t=ke;ke|=1;var n=jt.transition,i=Ce;try{if(jt.transition=null,Ce=1,e)return e()}finally{Ce=i,jt.transition=n,ke=t,!(ke&6)&&Ci()}}function Xh(){Pt=Ar.current,Ne(Ar)}function ji(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,DS(n)),We!==null)for(n=We.return;n!==null;){var i=n;switch(zh(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&nl();break;case 3:Ur(),Ne(kt),Ne(dt),Rh();break;case 5:Oh(i);break;case 4:Ur();break;case 13:Ne(Re);break;case 19:Ne(Re);break;case 10:Nh(i.type._context);break;case 22:case 23:Xh()}n=n.return}if(nt=e,We=e=wi(e.current,null),ot=Pt=t,Ke=0,us=null,jh=Xl=er=0,yt=Fo=null,Bi!==null){for(t=0;t<Bi.length;t++)if(n=Bi[t],i=n.interleaved,i!==null){n.interleaved=null;var r=i.next,o=n.pending;if(o!==null){var s=o.next;o.next=r,i.next=s}n.pending=i}Bi=null}return e}function W0(e,t){do{var n=We;try{if(Ih(),Ta.current=dl,cl){for(var i=Ve.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}cl=!1}if(Ji=0,tt=Qe=Ve=null,Ro=!1,ss=0,Wh.current=null,n===null||n.return===null){Ke=1,us=t,We=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=ot,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Xf(s);if(p!==null){p.flags&=-257,Zf(p,s,a,o,t),p.mode&1&&Yf(o,u,t),t=p,l=u;var f=t.updateQueue;if(f===null){var v=new Set;v.add(l),t.updateQueue=v}else f.add(l);break e}else{if(!(t&1)){Yf(o,u,t),Zh();break e}l=Error(W(426))}}else if(Te&&a.mode&1){var b=Xf(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Zf(b,s,a,o,t),Ph(Yr(l,a));break e}}o=l=Yr(l,a),Ke!==4&&(Ke=2),Fo===null?Fo=[o]:Fo.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=D0(o,l,t);Gf(o,m);break e;case 1:a=l;var w=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof w.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(gi===null||!gi.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var y=z0(o,a,t);Gf(o,y);break e}}o=o.return}while(o!==null)}Y0(n)}catch(k){t=k,We===n&&n!==null&&(We=n=n.return);continue}break}while(!0)}function j0(){var e=hl.current;return hl.current=dl,e===null?dl:e}function Zh(){(Ke===0||Ke===3||Ke===2)&&(Ke=4),nt===null||!(er&268435455)&&!(Xl&268435455)||si(nt,ot)}function ml(e,t){var n=ke;ke|=2;var i=j0();(nt!==e||ot!==t)&&(Mn=null,ji(e,t));do try{KS();break}catch(r){W0(e,r)}while(!0);if(Ih(),ke=n,hl.current=i,We!==null)throw Error(W(261));return nt=null,ot=0,Ke}function KS(){for(;We!==null;)U0(We)}function JS(){for(;We!==null&&!Sk();)U0(We)}function U0(e){var t=Z0(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?Y0(e):We=t,Wh.current=null}function Y0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=US(n,t),n!==null){n.flags&=32767,We=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ke=6,We=null;return}}else if(n=jS(n,t,Pt),n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Ke===0&&(Ke=5)}function Vi(e,t,n){var i=Ce,r=jt.transition;try{jt.transition=null,Ce=1,eC(e,t,n,i)}finally{jt.transition=r,Ce=i}return null}function eC(e,t,n,i){do Vr();while(ui!==null);if(ke&6)throw Error(W(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Mk(e,o),e===nt&&(We=nt=null,ot=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ra||(ra=!0,q0(qa,function(){return Vr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=jt.transition,jt.transition=null;var s=Ce;Ce=1;var a=ke;ke|=4,Wh.current=null,XS(e,n),G0(n,e),yS(Qc),Ka=!!qc,Qc=qc=null,e.current=n,ZS(n),Ck(),ke=a,Ce=s,jt.transition=o}else e.current=n;if(ra&&(ra=!1,ui=e,fl=r),o=e.pendingLanes,o===0&&(gi=null),zk(n.stateNode),Ct(e,Be()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(pl)throw pl=!1,e=vd,vd=null,e;return fl&1&&e.tag!==0&&Vr(),o=e.pendingLanes,o&1?e===wd?Ho++:(Ho=0,wd=e):Ho=0,Ci(),null}function Vr(){if(ui!==null){var e=Dw(fl),t=jt.transition,n=Ce;try{if(jt.transition=null,Ce=16>e?16:e,ui===null)var i=!1;else{if(e=ui,ui=null,fl=0,ke&6)throw Error(W(331));var r=ke;for(ke|=4,J=e.current;J!==null;){var o=J,s=o.child;if(J.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(J=u;J!==null;){var d=J;switch(d.tag){case 0:case 11:case 15:Vo(8,d,o)}var c=d.child;if(c!==null)c.return=d,J=c;else for(;J!==null;){d=J;var h=d.sibling,p=d.return;if(V0(d),d===u){J=null;break}if(h!==null){h.return=p,J=h;break}J=p}}}var f=o.alternate;if(f!==null){var v=f.child;if(v!==null){f.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}J=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,J=s;else e:for(;J!==null;){if(o=J,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Vo(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,J=m;break e}J=o.return}}var w=e.current;for(J=w;J!==null;){s=J;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,J=g;else e:for(s=w;J!==null;){if(a=J,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Yl(9,a)}}catch(k){Ge(a,a.return,k)}if(a===s){J=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,J=y;break e}J=a.return}}if(ke=r,Ci(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(Fl,e)}catch{}i=!0}return i}finally{Ce=n,jt.transition=t}}return!1}function lm(e,t,n){t=Yr(n,t),t=D0(e,t,1),e=mi(e,t,1),t=gt(),e!==null&&(Ds(e,1,t),Ct(e,t))}function Ge(e,t,n){if(e.tag===3)lm(e,e,n);else for(;t!==null;){if(t.tag===3){lm(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(gi===null||!gi.has(i))){e=Yr(n,e),e=z0(t,e,1),t=mi(t,e,1),e=gt(),t!==null&&(Ds(t,1,e),Ct(t,e));break}}t=t.return}}function tC(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),t=gt(),e.pingedLanes|=e.suspendedLanes&n,nt===e&&(ot&n)===n&&(Ke===4||Ke===3&&(ot&130023424)===ot&&500>Be()-Uh?ji(e,0):jh|=n),Ct(e,t)}function X0(e,t){t===0&&(e.mode&1?(t=Xs,Xs<<=1,!(Xs&130023424)&&(Xs=4194304)):t=1);var n=gt();e=$n(e,t),e!==null&&(Ds(e,t,n),Ct(e,n))}function nC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),X0(e,n)}function iC(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(W(314))}i!==null&&i.delete(t),X0(e,n)}var Z0;Z0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xt=!1,WS(e,t,n);xt=!!(e.flags&131072)}else xt=!1,Te&&t.flags&1048576&&Jw(t,ol,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;La(e,t),e=t.pendingProps;var r=$r(t,dt.current);Rr(t,n),r=Fh(null,t,i,e,r,n);var o=Hh();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,St(i)?(o=!0,il(t)):o=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Mh(t),r.updater=Ul,t.stateNode=r,r._reactInternals=t,sd(t,i,e,n),t=ud(null,t,i,!0,o,n)):(t.tag=0,Te&&o&&Dh(t),ft(null,t,r,n),t=t.child),t;case 16:i=t.elementType;e:{switch(La(e,t),e=t.pendingProps,r=i._init,i=r(i._payload),t.type=i,r=t.tag=oC(i),e=Kt(i,e),r){case 0:t=ld(null,t,i,e,n);break e;case 1:t=Kf(null,t,i,e,n);break e;case 11:t=qf(null,t,i,e,n);break e;case 14:t=Qf(null,t,i,Kt(i.type,e),n);break e}throw Error(W(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),ld(e,t,i,r,n);case 1:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),Kf(e,t,i,r,n);case 3:e:{if(N0(t),e===null)throw Error(W(387));i=t.pendingProps,o=t.memoizedState,r=o.element,o0(e,t),ll(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){r=Yr(Error(W(423)),t),t=Jf(e,t,i,n,r);break e}else if(i!==r){r=Yr(Error(W(424)),t),t=Jf(e,t,i,n,r);break e}else for(It=fi(t.stateNode.containerInfo.firstChild),Nt=t,Te=!0,tn=null,n=i0(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wr(),i===r){t=Wn(e,t,n);break e}ft(e,t,i,n)}t=t.child}return t;case 5:return s0(t),e===null&&id(t),i=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,s=r.children,Kc(i,r)?s=null:o!==null&&Kc(i,o)&&(t.flags|=32),I0(e,t),ft(e,t,s,n),t.child;case 6:return e===null&&id(t),null;case 13:return T0(e,t,n);case 4:return Lh(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=jr(t,null,i,n):ft(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),qf(e,t,i,r,n);case 7:return ft(e,t,t.pendingProps,n),t.child;case 8:return ft(e,t,t.pendingProps.children,n),t.child;case 12:return ft(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,r=t.pendingProps,o=t.memoizedProps,s=r.value,Pe(sl,i._currentValue),i._currentValue=s,o!==null)if(cn(o.value,s)){if(o.children===r.children&&!kt.current){t=Wn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Hn(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),rd(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(W(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),rd(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ft(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,Rr(t,n),r=Ut(r),i=i(r),t.flags|=1,ft(e,t,i,n),t.child;case 14:return i=t.type,r=Kt(i,t.pendingProps),r=Kt(i.type,r),Qf(e,t,i,r,n);case 15:return P0(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),La(e,t),t.tag=1,St(i)?(e=!0,il(t)):e=!1,Rr(t,n),E0(t,i,r),sd(t,i,r,n),ud(null,t,i,!0,e,n);case 19:return M0(e,t,n);case 22:return A0(e,t,n)}throw Error(W(156,t.tag))};function q0(e,t){return kw(e,t)}function rC(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,n,i){return new rC(e,t,n,i)}function qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oC(e){if(typeof e=="function")return qh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mh)return 11;if(e===gh)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=$t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Va(e,t,n,i,r,o){var s=2;if(i=e,typeof e=="function")qh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case yr:return Ui(n.children,r,o,t);case fh:s=8,r|=8;break;case Ac:return e=$t(12,n,t,r|2),e.elementType=Ac,e.lanes=o,e;case Ic:return e=$t(13,n,t,r),e.elementType=Ic,e.lanes=o,e;case Nc:return e=$t(19,n,t,r),e.elementType=Nc,e.lanes=o,e;case sw:return Zl(n,r,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rw:s=10;break e;case ow:s=9;break e;case mh:s=11;break e;case gh:s=14;break e;case ii:s=16,i=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=$t(s,n,t,r),t.elementType=e,t.type=i,t.lanes=o,t}function Ui(e,t,n,i){return e=$t(7,e,i,t),e.lanes=n,e}function Zl(e,t,n,i){return e=$t(22,e,i,t),e.elementType=sw,e.lanes=n,e.stateNode={isHidden:!1},e}function Ku(e,t,n){return e=$t(6,e,null,t),e.lanes=n,e}function Ju(e,t,n){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sC(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tu(0),this.expirationTimes=Tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tu(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Qh(e,t,n,i,r,o,s,a,l){return e=new sC(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=$t(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mh(o),e}function aC(e,t,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:br,key:i==null?null:""+i,children:e,containerInfo:t,implementation:n}}function Q0(e){if(!e)return _i;e=e._reactInternals;e:{if(lr(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(St(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(St(n))return Qw(e,n,t)}return t}function K0(e,t,n,i,r,o,s,a,l){return e=Qh(n,i,!0,e,r,o,s,a,l),e.context=Q0(null),n=e.current,i=gt(),r=vi(n),o=Hn(i,r),o.callback=t??null,mi(n,o,r),e.current.lanes=r,Ds(e,r,i),Ct(e,i),e}function ql(e,t,n,i){var r=t.current,o=gt(),s=vi(r);return n=Q0(n),t.context===null?t.context=n:t.pendingContext=n,t=Hn(o,s),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=mi(r,t,s),e!==null&&(ln(e,r,s,o),Na(e,r,s)),s}function gl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function um(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Kh(e,t){um(e,t),(e=e.alternate)&&um(e,t)}function lC(){return null}var J0=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jh(e){this._internalRoot=e}Ql.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));ql(e,t,null,null)};Ql.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tr(function(){ql(null,e,null,null)}),t[Bn]=null}};function Ql(e){this._internalRoot=e}Ql.prototype.unstable_scheduleHydration=function(e){if(e){var t=Aw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<oi.length&&t!==0&&t<oi[n].priority;n++);oi.splice(n,0,e),n===0&&Nw(e)}};function ep(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Kl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function cm(){}function uC(e,t,n,i,r){if(r){if(typeof i=="function"){var o=i;i=function(){var u=gl(s);o.call(u)}}var s=K0(t,i,e,0,null,!1,!1,"",cm);return e._reactRootContainer=s,e[Bn]=s.current,ts(e.nodeType===8?e.parentNode:e),tr(),s}for(;r=e.lastChild;)e.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var u=gl(l);a.call(u)}}var l=Qh(e,0,!1,null,null,!1,!1,"",cm);return e._reactRootContainer=l,e[Bn]=l.current,ts(e.nodeType===8?e.parentNode:e),tr(function(){ql(t,l,n,i)}),l}function Jl(e,t,n,i,r){var o=n._reactRootContainer;if(o){var s=o;if(typeof r=="function"){var a=r;r=function(){var l=gl(s);a.call(l)}}ql(t,s,e,r)}else s=uC(n,t,e,r,i);return gl(s)}zw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=zo(t.pendingLanes);n!==0&&(bh(t,n|1),Ct(t,Be()),!(ke&6)&&(Xr=Be()+500,Ci()))}break;case 13:tr(function(){var i=$n(e,1);if(i!==null){var r=gt();ln(i,e,1,r)}}),Kh(e,1)}};yh=function(e){if(e.tag===13){var t=$n(e,134217728);if(t!==null){var n=gt();ln(t,e,134217728,n)}Kh(e,134217728)}};Pw=function(e){if(e.tag===13){var t=vi(e),n=$n(e,t);if(n!==null){var i=gt();ln(n,e,t,i)}Kh(e,t)}};Aw=function(){return Ce};Iw=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}};Bc=function(e,t,n){switch(t){case"input":if(Lc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=$l(i);if(!r)throw Error(W(90));lw(i),Lc(i,r)}}}break;case"textarea":cw(e,n);break;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}};vw=Yh;ww=tr;var cC={usingClientEntryPoint:!1,Events:[Ps,Sr,$l,mw,gw,Yh]},bo={findFiberByHostInstance:Gi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dC={bundleType:bo.bundleType,version:bo.version,rendererPackageName:bo.rendererPackageName,rendererConfig:bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Un.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=xw(e),e===null?null:e.stateNode},findFiberByHostInstance:bo.findFiberByHostInstance||lC,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 oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oa.isDisabled&&oa.supportsFiber)try{Fl=oa.inject(dC),Sn=oa}catch{}}Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cC;Ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ep(t))throw Error(W(200));return aC(e,t,null,n)};Ot.createRoot=function(e,t){if(!ep(e))throw Error(W(299));var n=!1,i="",r=J0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Qh(e,1,!1,null,null,n,!1,i,r),e[Bn]=t.current,ts(e.nodeType===8?e.parentNode:e),new Jh(t)};Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=xw(t),e=e===null?null:e.stateNode,e};Ot.flushSync=function(e){return tr(e)};Ot.hydrate=function(e,t,n){if(!Kl(t))throw Error(W(200));return Jl(null,e,t,!0,n)};Ot.hydrateRoot=function(e,t,n){if(!ep(e))throw Error(W(405));var i=n!=null&&n.hydratedSources||null,r=!1,o="",s=J0;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=K0(t,null,e,1,n??null,r,!1,o,s),e[Bn]=t.current,ts(e),i)for(e=0;e<i.length;e++)n=i[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Ql(t)};Ot.render=function(e,t,n){if(!Kl(t))throw Error(W(200));return Jl(null,e,t,!1,n)};Ot.unmountComponentAtNode=function(e){if(!Kl(e))throw Error(W(40));return e._reactRootContainer?(tr(function(){Jl(null,null,e,!1,function(){e._reactRootContainer=null,e[Bn]=null})}),!0):!1};Ot.unstable_batchedUpdates=Yh;Ot.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Kl(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return Jl(e,t,n,!1,i)};Ot.version="18.3.1-next-f1338f8080-20240426";function eb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eb)}catch(e){console.error(e)}}eb(),ew.exports=Ot;var tb=ew.exports;const hC=Cs(tb);var pC,dm=tb;pC=dm.createRoot,dm.hydrateRoot;function fC(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vC={};function hm(e,t){return(vC.jsx?gC:mC).test(e)}const wC=/[ \t\n\f\r]/g;function bC(e){return typeof e=="object"?e.type==="text"?pm(e.value):!1:pm(e)}function pm(e){return e.replace(wC,"")===""}class Is{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Is.prototype.normal={};Is.prototype.property={};Is.prototype.space=void 0;function nb(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new Is(n,i,t)}function xd(e){return e.toLowerCase()}class Et{constructor(t,n){this.attribute=n,this.property=t}}Et.prototype.attribute="";Et.prototype.booleanish=!1;Et.prototype.boolean=!1;Et.prototype.commaOrSpaceSeparated=!1;Et.prototype.commaSeparated=!1;Et.prototype.defined=!1;Et.prototype.mustUseProperty=!1;Et.prototype.number=!1;Et.prototype.overloadedBoolean=!1;Et.prototype.property="";Et.prototype.spaceSeparated=!1;Et.prototype.space=void 0;let yC=0;const fe=ur(),$e=ur(),_d=ur(),j=ur(),ze=ur(),Fr=ur(),zt=ur();function ur(){return 2**++yC}const kd=Object.freeze(Object.defineProperty({__proto__:null,boolean:fe,booleanish:$e,commaOrSpaceSeparated:zt,commaSeparated:Fr,number:j,overloadedBoolean:_d,spaceSeparated:ze},Symbol.toStringTag,{value:"Module"})),ec=Object.keys(kd);class tp extends Et{constructor(t,n,i,r){let o=-1;if(super(t,n),fm(this,"space",r),typeof i=="number")for(;++o<ec.length;){const s=ec[o];fm(this,ec[o],(i&kd[s])===kd[s])}}}tp.prototype.defined=!0;function fm(e,t,n){n&&(e[t]=n)}function ao(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new tp(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[xd(i)]=i,n[xd(o.attribute)]=i}return new Is(t,n,e.space)}const ib=ao({properties:{ariaActiveDescendant:null,ariaAtomic:$e,ariaAutoComplete:null,ariaBusy:$e,ariaChecked:$e,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:ze,ariaCurrent:null,ariaDescribedBy:ze,ariaDetails:null,ariaDisabled:$e,ariaDropEffect:ze,ariaErrorMessage:null,ariaExpanded:$e,ariaFlowTo:ze,ariaGrabbed:$e,ariaHasPopup:null,ariaHidden:$e,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ze,ariaLevel:j,ariaLive:null,ariaModal:$e,ariaMultiLine:$e,ariaMultiSelectable:$e,ariaOrientation:null,ariaOwns:ze,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:$e,ariaReadOnly:$e,ariaRelevant:null,ariaRequired:$e,ariaRoleDescription:ze,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:$e,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function rb(e,t){return t in e?e[t]:t}function ob(e,t){return rb(e,t.toLowerCase())}const xC=ao({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fr,acceptCharset:ze,accessKey:ze,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:ze,autoFocus:fe,autoPlay:fe,blocking:ze,capture:null,charSet:null,checked:fe,cite:null,className:ze,cols:j,colSpan:null,content:null,contentEditable:$e,controls:fe,controlsList:ze,coords:j|Fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:_d,draggable:$e,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:ze,height:j,hidden:_d,high:j,href:null,hrefLang:null,htmlFor:ze,httpEquiv:ze,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:ze,itemRef:ze,itemScope:fe,itemType:ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fe,optimum:j,pattern:null,ping:ze,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:ze,required:fe,reversed:fe,rows:j,rowSpan:j,sandbox:ze,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:$e,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:$e,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ze,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:$e,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fe,disableRemotePlayback:fe,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:ob}),_C=ao({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zt,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fr,g2:Fr,glyphName:Fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:zt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:j,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zt,rev:zt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zt,requiredFeatures:zt,requiredFonts:zt,requiredFormats:zt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:zt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zt,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rb}),sb=ao({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ab=ao({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ob}),lb=ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),kC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},SC=/[A-Z]/g,mm=/-[a-z]/g,CC=/^data[-\w.:]+$/i;function EC(e,t){const n=xd(t);let i=t,r=Et;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mm,zC);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mm.test(o)){let s=o.replace(SC,DC);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=tp}return new r(i,t)}function DC(e){return"-"+e.toLowerCase()}function zC(e){return e.charAt(1).toUpperCase()}const PC=nb([ib,xC,sb,ab,lb],"html"),np=nb([ib,_C,sb,ab,lb],"svg");function AC(e){return e.join(" ").trim()}var ip={},gm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,IC=/\n/g,NC=/^\s*/,TC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,MC=/^:\s*/,LC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,OC=/^[;\s]*/,RC=/^\s+|\s+$/g,VC=`
|
|
41
|
-
`,vm="/",wm="*",Hi="",FC="comment",HC="declaration";function GC(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(f){var v=f.match(IC);v&&(n+=v.length);var b=f.lastIndexOf(VC);i=~b?f.length-b:i+f.length}function o(){var f={line:n,column:i};return function(v){return v.position=new s(f),u(),v}}function s(f){this.start=f,this.end={line:n,column:i},this.source=t.source}s.prototype.content=e;function a(f){var v=new Error(t.source+":"+n+":"+i+": "+f);if(v.reason=f,v.filename=t.source,v.line=n,v.column=i,v.source=e,!t.silent)throw v}function l(f){var v=f.exec(e);if(v){var b=v[0];return r(b),e=e.slice(b.length),v}}function u(){l(NC)}function d(f){var v;for(f=f||[];v=c();)v!==!1&&f.push(v);return f}function c(){var f=o();if(!(vm!=e.charAt(0)||wm!=e.charAt(1))){for(var v=2;Hi!=e.charAt(v)&&(wm!=e.charAt(v)||vm!=e.charAt(v+1));)++v;if(v+=2,Hi===e.charAt(v-1))return a("End of comment missing");var b=e.slice(2,v-2);return i+=2,r(b),e=e.slice(v),i+=2,f({type:FC,comment:b})}}function h(){var f=o(),v=l(TC);if(v){if(c(),!l(MC))return a("property missing ':'");var b=l(LC),m=f({type:HC,property:bm(v[0].replace(gm,Hi)),value:b?bm(b[0].replace(gm,Hi)):Hi});return l(OC),m}}function p(){var f=[];d(f);for(var v;v=h();)v!==!1&&(f.push(v),d(f));return f}return u(),p()}function bm(e){return e?e.replace(RC,Hi):Hi}var BC=GC,$C=Ua&&Ua.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ip,"__esModule",{value:!0});ip.default=jC;const WC=$C(BC);function jC(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,WC.default)(e),r=typeof t=="function";return i.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;r?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var eu={};Object.defineProperty(eu,"__esModule",{value:!0});eu.camelCase=void 0;var UC=/^--[a-zA-Z0-9_-]+$/,YC=/-([a-z])/g,XC=/^[^-]+$/,ZC=/^-(webkit|moz|ms|o|khtml)-/,qC=/^-(ms)-/,QC=function(e){return!e||XC.test(e)||UC.test(e)},KC=function(e,t){return t.toUpperCase()},ym=function(e,t){return"".concat(t,"-")},JC=function(e,t){return t===void 0&&(t={}),QC(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qC,ym):e=e.replace(ZC,ym),e.replace(YC,KC))};eu.camelCase=JC;var eE=Ua&&Ua.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tE=eE(ip),nE=eu;function Sd(e,t){var n={};return!e||typeof e!="string"||(0,tE.default)(e,function(i,r){i&&r&&(n[(0,nE.camelCase)(i,t)]=r)}),n}Sd.default=Sd;var iE=Sd;const rE=Cs(iE),ub=cb("end"),rp=cb("start");function cb(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function oE(e){const t=rp(e),n=ub(e);if(t&&n)return{start:t,end:n}}function Go(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xm(e.position):"start"in e||"end"in e?xm(e):"line"in e||"column"in e?Cd(e):""}function Cd(e){return _m(e&&e.line)+":"+_m(e&&e.column)}function xm(e){return Cd(e&&e.start)+"-"+Cd(e&&e.end)}function _m(e){return e&&typeof e=="number"?e:1}class ht extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?r=t:!o.cause&&t&&(s=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?o.ruleId=i:(o.source=i.slice(0,l),o.ruleId=i.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Go(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ht.prototype.file="";ht.prototype.name="";ht.prototype.reason="";ht.prototype.message="";ht.prototype.stack="";ht.prototype.column=void 0;ht.prototype.line=void 0;ht.prototype.ancestors=void 0;ht.prototype.cause=void 0;ht.prototype.fatal=void 0;ht.prototype.place=void 0;ht.prototype.ruleId=void 0;ht.prototype.source=void 0;const op={}.hasOwnProperty,sE=new Map,aE=/[A-Z]/g,lE=new Set(["table","tbody","thead","tfoot","tr"]),uE=new Set(["td","th"]),db="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cE(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=wE(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=vE(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?np:PC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=hb(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function hb(e,t,n){if(t.type==="element")return dE(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fE(e,t,n);if(t.type==="mdxjsEsm")return pE(e,t);if(t.type==="root")return mE(e,t,n);if(t.type==="text")return gE(e,t)}function dE(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=np,e.schema=r),e.ancestors.push(t);const o=fb(e,t.tagName,!1),s=bE(e,t);let a=ap(e,t);return lE.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!bC(l):!0})),pb(e,s,o,t),sp(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}function hE(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}cs(e,t.position)}function pE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cs(e,t.position)}function fE(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=np,e.schema=r),e.ancestors.push(t);const o=t.name===null?e.Fragment:fb(e,t.name,!0),s=yE(e,t),a=ap(e,t);return pb(e,s,o,t),sp(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}function mE(e,t,n){const i={};return sp(i,ap(e,t)),e.create(t,e.Fragment,i,n)}function gE(e,t){return t.value}function pb(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function sp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vE(e,t,n){return i;function i(r,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function wE(e,t){return n;function n(i,r,o,s){const a=Array.isArray(o.children),l=rp(i);return t(r,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function bE(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&op.call(t.properties,r)){const o=xE(e,r,t.properties[r]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&uE.has(t.tagName)?i=a:n[s]=a}}if(i){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function yE(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cs(e,t.position);else{const r=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const a=i.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else cs(e,t.position);else o=i.value===null?!0:i.value;n[r]=o}return n}function ap(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:sE;for(;++i<t.children.length;){const o=t.children[i];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=r.get(l)||0;s=l+"-"+u,r.set(l,u+1)}}const a=hb(e,o,s);a!==void 0&&n.push(a)}return n}function xE(e,t,n){const i=EC(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?fC(n):AC(n)),i.property==="style"){let r=typeof n=="object"?n:_E(e,String(n));return e.stylePropertyNameCase==="css"&&(r=kE(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?kC[i.property]||i.property:i.attribute,n]}}function _E(e,t){try{return rE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new ht("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=db+"#cannot-parse-style-attribute",r}}function fb(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let o=-1,s;for(;++o<r.length;){const a=hm(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}i=s}else i=hm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return op.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);cs(e)}function cs(e,t){const n=new ht("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=db+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kE(e){const t={};let n;for(n in e)op.call(e,n)&&(t[SE(n)]=e[n]);return t}function SE(e){let t=e.replace(aE,CE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function CE(e){return"-"+e.toLowerCase()}const tc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},EE={};function lp(e,t){const n=EE,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return mb(e,i,r)}function mb(e,t,n){if(DE(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return km(e.children,t,n)}return Array.isArray(e)?km(e,t,n):""}function km(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=mb(e[r],t,n);return i.join("")}function DE(e){return!!(e&&typeof e=="object")}const Sm=document.createElement("i");function up(e){const t="&"+e+";";Sm.innerHTML=t;const n=Sm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tt(e,t,n,i){const r=e.length;let o=0,s;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)s=Array.from(i),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<i.length;)s=i.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Bt(e,t){return e.length>0?(Tt(e,e.length,0,t),e):t}const Cm={}.hasOwnProperty;function gb(e){const t={};let n=-1;for(;++n<e.length;)zE(t,e[n]);return t}function zE(e,t){let n;for(n in t){const r=(Cm.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Cm.call(r,s)||(r[s]=[]);const a=o[s];PE(r[s],Array.isArray(a)?a:a?[a]:[])}}}function PE(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Tt(e,0,0,i)}function vb(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function un(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mt=Ei(/[A-Za-z]/),ct=Ei(/[\dA-Za-z]/),AE=Ei(/[#-'*+\--9=?A-Z^-~]/);function vl(e){return e!==null&&(e<32||e===127)}const Ed=Ei(/\d/),IE=Ei(/[\dA-Fa-f]/),NE=Ei(/[!-/:-@[-`{-~]/);function ue(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function we(e){return e===-2||e===-1||e===32}const tu=Ei(new RegExp("\\p{P}|\\p{S}","u")),nr=Ei(/\s/);function Ei(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lo(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&ct(e.charCodeAt(n+1))&&ct(e.charCodeAt(n+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),r=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+r+1,s=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function xe(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return we(l)?(e.enter(n),a(l)):t(l)}function a(l){return we(l)&&o++<r?(e.consume(l),a):(e.exit(n),t(l))}}const TE={tokenize:ME};function ME(e){const t=e.attempt(this.parser.constructs.contentInitial,i,r);let n;return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xe(e,t,"linePrefix")}function r(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ue(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const LE={tokenize:OE},Em={tokenize:RE};function OE(e){const t=this,n=[];let i=0,r,o,s;return a;function a(g){if(i<n.length){const y=n[i];return t.containerState=y[1],e.attempt(y[0].continuation,l,u)(g)}return u(g)}function l(g){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();const y=t.events.length;let k=y,_;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){_=t.events[k][1].end;break}m(i);let E=y;for(;E<t.events.length;)t.events[E][1].end={..._},E++;return Tt(t.events,k+1,0,t.events.slice(y)),t.events.length=E,u(g)}return a(g)}function u(g){if(i===n.length){if(!r)return h(g);if(r.currentConstruct&&r.currentConstruct.concrete)return f(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Em,d,c)(g)}function d(g){return r&&w(),m(i),h(g)}function c(g){return t.parser.lazy[t.now().line]=i!==n.length,s=t.now().offset,f(g)}function h(g){return t.containerState={},e.attempt(Em,p,f)(g)}function p(g){return i++,n.push([t.currentConstruct,t.containerState]),h(g)}function f(g){if(g===null){r&&w(),m(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),v(g)}function v(g){if(g===null){b(e.exit("chunkFlow"),!0),m(0),e.consume(g);return}return ue(g)?(e.consume(g),b(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(g),v)}function b(g,y){const k=t.sliceStream(g);if(y&&k.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(k),t.parser.lazy[g.start.line]){let _=r.events.length;for(;_--;)if(r.events[_][1].start.offset<s&&(!r.events[_][1].end||r.events[_][1].end.offset>s))return;const E=t.events.length;let S=E,T,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(T){C=t.events[S][1].end;break}T=!0}for(m(i),_=E;_<t.events.length;)t.events[_][1].end={...C},_++;Tt(t.events,S+1,0,t.events.slice(E)),t.events.length=_}}function m(g){let y=n.length;for(;y-- >g;){const k=n[y];t.containerState=k[1],k[0].exit.call(t,e)}n.length=g}function w(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function RE(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zr(e){if(e===null||De(e)||nr(e))return 1;if(tu(e))return 2}function nu(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const o=e[r].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}const Dd={name:"attention",resolveAll:VE,tokenize:FE};function VE(e,t){let n=-1,i,r,o,s,a,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[i][1].end},h={...e[n][1].start};Dm(c,-l),Dm(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[i][1].end={...s.start},e[n][1].start={...a.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Bt(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Bt(u,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Bt(u,nu(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Bt(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Bt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Tt(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function FE(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Zr(i);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),d=Zr(l),c=!d||d===2&&r||n.includes(l),h=!r||r===2&&d||n.includes(i);return u._open=!!(o===42?c:c&&(r||!h)),u._close=!!(o===42?h:h&&(d||!c)),t(l)}}function Dm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const HE={name:"autolink",tokenize:GE};function GE(e,t,n){let i=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return mt(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||ct(p)?(i=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),i=0,l):(p===43||p===45||p===46||ct(p))&&i++<32?(e.consume(p),a):(i=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||vl(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):AE(p)?(e.consume(p),u):n(p)}function d(p){return ct(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),i=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||ct(p))&&i++<63){const f=p===45?h:c;return e.consume(p),f}return n(p)}}const Ns={partial:!0,tokenize:BE};function BE(e,t,n){return i;function i(o){return we(o)?xe(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||ue(o)?t(o):n(o)}}const wb={continuation:{tokenize:WE},exit:jE,name:"blockQuote",tokenize:$E};function $E(e,t,n){const i=this;return r;function r(s){if(s===62){const a=i.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return we(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function WE(e,t,n){const i=this;return r;function r(s){return we(s)?xe(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(wb,t,n)(s)}}function jE(e){e.exit("blockQuote")}const bb={name:"characterEscape",tokenize:UE};function UE(e,t,n){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return NE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const yb={name:"characterReference",tokenize:YE};function YE(e,t,n){const i=this;let r=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=ct,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=IE,d):(e.enter("characterReferenceValue"),o=7,s=Ed,d(c))}function d(c){if(c===59&&r){const h=e.exit("characterReferenceValue");return s===ct&&!up(i.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&r++<o?(e.consume(c),d):n(c)}}const zm={partial:!0,tokenize:ZE},Pm={concrete:!0,name:"codeFenced",tokenize:XE};function XE(e,t,n){const i=this,r={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(_){return u(_)}function u(_){const E=i.events[i.events.length-1];return o=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(_)}function d(_){return _===a?(s++,e.consume(_),d):s<3?n(_):(e.exit("codeFencedFenceSequence"),we(_)?xe(e,c,"whitespace")(_):c(_))}function c(_){return _===null||ue(_)?(e.exit("codeFencedFence"),i.interrupt?t(_):e.check(zm,v,y)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||ue(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(_)):we(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xe(e,p,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),h)}function p(_){return _===null||ue(_)?c(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===null||ue(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(_)):_===96&&_===a?n(_):(e.consume(_),f)}function v(_){return e.attempt(r,y,b)(_)}function b(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),m}function m(_){return o>0&&we(_)?xe(e,w,"linePrefix",o+1)(_):w(_)}function w(_){return _===null||ue(_)?e.check(zm,v,y)(_):(e.enter("codeFlowValue"),g(_))}function g(_){return _===null||ue(_)?(e.exit("codeFlowValue"),w(_)):(e.consume(_),g)}function y(_){return e.exit("codeFenced"),t(_)}function k(_,E,S){let T=0;return C;function C(P){return _.enter("lineEnding"),_.consume(P),_.exit("lineEnding"),I}function I(P){return _.enter("codeFencedFence"),we(P)?xe(_,L,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):L(P)}function L(P){return P===a?(_.enter("codeFencedFenceSequence"),V(P)):S(P)}function V(P){return P===a?(T++,_.consume(P),V):T>=s?(_.exit("codeFencedFenceSequence"),we(P)?xe(_,D,"whitespace")(P):D(P)):S(P)}function D(P){return P===null||ue(P)?(_.exit("codeFencedFence"),E(P)):S(P)}}}function ZE(e,t,n){const i=this;return r;function r(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return i.parser.lazy[i.now().line]?n(s):t(s)}}const nc={name:"codeIndented",tokenize:QE},qE={partial:!0,tokenize:KE};function QE(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),xe(e,o,"linePrefix",5)(u)}function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ue(u)?e.attempt(qE,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ue(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function KE(e,t,n){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):xe(e,o,"linePrefix",5)(s)}function o(s){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ue(s)?r(s):n(s)}}const JE={name:"codeText",previous:tD,resolve:eD,tokenize:nD};function eD(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)r===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(r=i):(i===t||e[i][1].type==="lineEnding")&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),t-=i-r-2,i=r+2),r=void 0);return e}function tD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nD(e,t,n){let i=0,r,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),i++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),r=0,d(c)):ue(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ue(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function d(c){return c===96?(e.consume(c),r++,d):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class iD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&yo(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);yo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);yo(this.left,n.reverse())}}}function yo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function xb(e){const t={};let n=-1,i,r,o,s,a,l,u;const d=new iD(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,rD(d,n)),n=t[n],u=!0);else if(i[1]._container){for(o=n,r=void 0;o--;)if(s=d.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(r&&(d.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;r&&(i[1].end={...d.get(r)[1].start},a=d.slice(r,n),a.unshift(i),d.splice(r,n-r+1,a))}}return Tt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function rD(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const o=[];let s=n._tokenizer;s||(s=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let d,c,h=-1,p=n,f=0,v=0;const b=[v];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(d=i.sliceStream(p),p.next||d.push(null),c&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(v=h+1,b.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),h=b.length;h--;){const m=a.slice(b[h],b[h+1]),w=o.pop();l.push([w,w+m.length-1]),e.splice(w,2,m)}for(l.reverse(),h=-1;++h<l.length;)u[f+l[h][0]]=f+l[h][1],f+=l[h][1]-l[h][0]-1;return u}const oD={resolve:aD,tokenize:lD},sD={partial:!0,tokenize:uD};function aD(e){return xb(e),e}function lD(e,t){let n;return i;function i(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?o(a):ue(a)?e.check(sD,s,o)(a):(e.consume(a),r)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function uD(e,t,n){const i=this;return r;function r(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),xe(e,o,"linePrefix")}function o(s){if(s===null||ue(s))return n(s);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(i.parser.constructs.flow,n,t)(s)}}function _b(e,t,n,i,r,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return c;function c(m){return m===60?(e.enter(i),e.enter(r),e.enter(o),e.consume(m),e.exit(o),h):m===null||m===32||m===41||vl(m)?n(m):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(m))}function h(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(a),h(m)):m===null||m===60||ue(m)?n(m):(e.consume(m),m===92?f:p)}function f(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function v(m){return!d&&(m===null||m===41||De(m))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(m)):d<u&&m===40?(e.consume(m),d++,v):m===41?(e.consume(m),d--,v):m===null||m===32||m===40||vl(m)?n(m):(e.consume(m),m===92?b:v)}function b(m){return m===40||m===41||m===92?(e.consume(m),v):v(m)}}function kb(e,t,n,i,r,o){const s=this;let a=0,l;return u;function u(p){return e.enter(i),e.enter(r),e.consume(p),e.exit(r),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(i),t):ue(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||ue(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!we(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function Sb(e,t,n,i,r,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ue(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||ue(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:d)}function c(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Bo(e,t){let n;return i;function i(r){return ue(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):we(r)?xe(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const cD={name:"definition",tokenize:hD},dD={partial:!0,tokenize:pD};function hD(e,t,n){const i=this;let r;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return kb.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return r=un(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return De(p)?Bo(e,u)(p):u(p)}function u(p){return _b(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(dD,c,c)(p)}function c(p){return we(p)?xe(e,h,"whitespace")(p):h(p)}function h(p){return p===null||ue(p)?(e.exit("definition"),i.parser.defined.push(r),t(p)):n(p)}}function pD(e,t,n){return i;function i(a){return De(a)?Bo(e,r)(a):n(a)}function r(a){return Sb(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return we(a)?xe(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ue(a)?t(a):n(a)}}const fD={name:"hardBreakEscape",tokenize:mD};function mD(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const gD={name:"headingAtx",resolve:vD,tokenize:wD};function vD(e,t){let n=e.length-2,i=3,r,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Tt(e,i,n-i+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function wD(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&i++<6?(e.consume(d),s):d===null||De(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ue(d)?(e.exit("atxHeading"),t(d)):we(d)?xe(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||De(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const bD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Am=["pre","script","style","textarea"],yD={concrete:!0,name:"htmlFlow",resolveTo:kD,tokenize:SD},xD={partial:!0,tokenize:ED},_D={partial:!0,tokenize:CD};function kD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SD(e,t,n){const i=this;let r,o,s,a,l;return u;function u(z){return d(z)}function d(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),c}function c(z){return z===33?(e.consume(z),h):z===47?(e.consume(z),o=!0,v):z===63?(e.consume(z),r=3,i.interrupt?t:x):mt(z)?(e.consume(z),s=String.fromCharCode(z),b):n(z)}function h(z){return z===45?(e.consume(z),r=2,p):z===91?(e.consume(z),r=5,a=0,f):mt(z)?(e.consume(z),r=4,i.interrupt?t:x):n(z)}function p(z){return z===45?(e.consume(z),i.interrupt?t:x):n(z)}function f(z){const X="CDATA[";return z===X.charCodeAt(a++)?(e.consume(z),a===X.length?i.interrupt?t:L:f):n(z)}function v(z){return mt(z)?(e.consume(z),s=String.fromCharCode(z),b):n(z)}function b(z){if(z===null||z===47||z===62||De(z)){const X=z===47,q=s.toLowerCase();return!X&&!o&&Am.includes(q)?(r=1,i.interrupt?t(z):L(z)):bD.includes(s.toLowerCase())?(r=6,X?(e.consume(z),m):i.interrupt?t(z):L(z)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(z):o?w(z):g(z))}return z===45||ct(z)?(e.consume(z),s+=String.fromCharCode(z),b):n(z)}function m(z){return z===62?(e.consume(z),i.interrupt?t:L):n(z)}function w(z){return we(z)?(e.consume(z),w):C(z)}function g(z){return z===47?(e.consume(z),C):z===58||z===95||mt(z)?(e.consume(z),y):we(z)?(e.consume(z),g):C(z)}function y(z){return z===45||z===46||z===58||z===95||ct(z)?(e.consume(z),y):k(z)}function k(z){return z===61?(e.consume(z),_):we(z)?(e.consume(z),k):g(z)}function _(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),l=z,E):we(z)?(e.consume(z),_):S(z)}function E(z){return z===l?(e.consume(z),l=null,T):z===null||ue(z)?n(z):(e.consume(z),E)}function S(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||De(z)?k(z):(e.consume(z),S)}function T(z){return z===47||z===62||we(z)?g(z):n(z)}function C(z){return z===62?(e.consume(z),I):n(z)}function I(z){return z===null||ue(z)?L(z):we(z)?(e.consume(z),I):n(z)}function L(z){return z===45&&r===2?(e.consume(z),A):z===60&&r===1?(e.consume(z),O):z===62&&r===4?(e.consume(z),F):z===63&&r===3?(e.consume(z),x):z===93&&r===5?(e.consume(z),M):ue(z)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(xD,H,V)(z)):z===null||ue(z)?(e.exit("htmlFlowData"),V(z)):(e.consume(z),L)}function V(z){return e.check(_D,D,H)(z)}function D(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),P}function P(z){return z===null||ue(z)?V(z):(e.enter("htmlFlowData"),L(z))}function A(z){return z===45?(e.consume(z),x):L(z)}function O(z){return z===47?(e.consume(z),s="",N):L(z)}function N(z){if(z===62){const X=s.toLowerCase();return Am.includes(X)?(e.consume(z),F):L(z)}return mt(z)&&s.length<8?(e.consume(z),s+=String.fromCharCode(z),N):L(z)}function M(z){return z===93?(e.consume(z),x):L(z)}function x(z){return z===62?(e.consume(z),F):z===45&&r===2?(e.consume(z),x):L(z)}function F(z){return z===null||ue(z)?(e.exit("htmlFlowData"),H(z)):(e.consume(z),F)}function H(z){return e.exit("htmlFlow"),t(z)}}function CD(e,t,n){const i=this;return r;function r(s){return ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return i.parser.lazy[i.now().line]?n(s):t(s)}}function ED(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Ns,t,n)}}const DD={name:"htmlText",tokenize:zD};function zD(e,t,n){const i=this;let r,o,s;return a;function a(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),k):x===63?(e.consume(x),g):mt(x)?(e.consume(x),S):n(x)}function u(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),o=0,f):mt(x)?(e.consume(x),w):n(x)}function d(x){return x===45?(e.consume(x),p):n(x)}function c(x){return x===null?n(x):x===45?(e.consume(x),h):ue(x)?(s=c,O(x)):(e.consume(x),c)}function h(x){return x===45?(e.consume(x),p):c(x)}function p(x){return x===62?A(x):x===45?h(x):c(x)}function f(x){const F="CDATA[";return x===F.charCodeAt(o++)?(e.consume(x),o===F.length?v:f):n(x)}function v(x){return x===null?n(x):x===93?(e.consume(x),b):ue(x)?(s=v,O(x)):(e.consume(x),v)}function b(x){return x===93?(e.consume(x),m):v(x)}function m(x){return x===62?A(x):x===93?(e.consume(x),m):v(x)}function w(x){return x===null||x===62?A(x):ue(x)?(s=w,O(x)):(e.consume(x),w)}function g(x){return x===null?n(x):x===63?(e.consume(x),y):ue(x)?(s=g,O(x)):(e.consume(x),g)}function y(x){return x===62?A(x):g(x)}function k(x){return mt(x)?(e.consume(x),_):n(x)}function _(x){return x===45||ct(x)?(e.consume(x),_):E(x)}function E(x){return ue(x)?(s=E,O(x)):we(x)?(e.consume(x),E):A(x)}function S(x){return x===45||ct(x)?(e.consume(x),S):x===47||x===62||De(x)?T(x):n(x)}function T(x){return x===47?(e.consume(x),A):x===58||x===95||mt(x)?(e.consume(x),C):ue(x)?(s=T,O(x)):we(x)?(e.consume(x),T):A(x)}function C(x){return x===45||x===46||x===58||x===95||ct(x)?(e.consume(x),C):I(x)}function I(x){return x===61?(e.consume(x),L):ue(x)?(s=I,O(x)):we(x)?(e.consume(x),I):T(x)}function L(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),r=x,V):ue(x)?(s=L,O(x)):we(x)?(e.consume(x),L):(e.consume(x),D)}function V(x){return x===r?(e.consume(x),r=void 0,P):x===null?n(x):ue(x)?(s=V,O(x)):(e.consume(x),V)}function D(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||De(x)?T(x):(e.consume(x),D)}function P(x){return x===47||x===62||De(x)?T(x):n(x)}function A(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function O(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),N}function N(x){return we(x)?xe(e,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):M(x)}function M(x){return e.enter("htmlTextData"),s(x)}}const cp={name:"labelEnd",resolveAll:ND,resolveTo:TD,tokenize:MD},PD={tokenize:LD},AD={tokenize:OD},ID={tokenize:RD};function ND(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",t+=r}}return e.length!==n.length&&Tt(e,0,e.length,n),e}function TD(e,t){let n=e.length,i=0,r,o,s,a;for(;n--;)if(r=e[n][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Bt(a,e.slice(o+1,o+i+3)),a=Bt(a,[["enter",d,t]]),a=Bt(a,nu(t.parser.constructs.insideSpan.null,e.slice(o+i+4,s-3),t)),a=Bt(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=Bt(a,e.slice(s+1)),a=Bt(a,[["exit",l,t]]),Tt(e,o,e.length,a),e}function MD(e,t,n){const i=this;let r=i.events.length,o,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){o=i.events[r][1];break}return a;function a(h){return o?o._inactive?c(h):(s=i.parser.defined.includes(un(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(PD,d,s?d:c)(h):h===91?e.attempt(AD,d,s?u:c)(h):s?d(h):c(h)}function u(h){return e.attempt(ID,d,c)(h)}function d(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function LD(e,t,n){return i;function i(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),r}function r(c){return De(c)?Bo(e,o)(c):o(c)}function o(c){return c===41?d(c):_b(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?Bo(e,l)(c):d(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Sb(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function u(c){return De(c)?Bo(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function OD(e,t,n){const i=this;return r;function r(a){return kb.call(i,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return i.parser.defined.includes(un(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function RD(e,t,n){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const VD={name:"labelStartImage",resolveAll:cp.resolveAll,tokenize:FD};function FD(e,t,n){const i=this;return r;function r(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const HD={name:"labelStartLink",resolveAll:cp.resolveAll,tokenize:GD};function GD(e,t,n){const i=this;return r;function r(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(s):t(s)}}const ic={name:"lineEnding",tokenize:BD};function BD(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),xe(e,t,"linePrefix")}}const Fa={name:"thematicBreak",tokenize:$D};function $D(e,t,n){let i=0,r;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return r=u,a(u)}function a(u){return u===r?(e.enter("thematicBreakSequence"),l(u)):i>=3&&(u===null||ue(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===r?(e.consume(u),i++,l):(e.exit("thematicBreakSequence"),we(u)?xe(e,a,"whitespace")(u):a(u))}}const bt={continuation:{tokenize:YD},exit:ZD,name:"list",tokenize:UD},WD={partial:!0,tokenize:qD},jD={partial:!0,tokenize:XD};function UD(e,t,n){const i=this,r=i.events[i.events.length-1];let o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(p){const f=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(f==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:Ed(p)){if(i.containerState.type||(i.containerState.type=f,e.enter(f,{_container:!0})),f==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Fa,n,u)(p):u(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ed(p)&&++s<10?(e.consume(p),l):(!i.interrupt||s<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(Ns,i.interrupt?n:d,e.attempt(WD,h,c))}function d(p){return i.containerState.initialBlankLine=!0,o++,h(p)}function c(p){return we(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function YD(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ns,r,o);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,xe(e,t,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!we(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(jD,t,s)(a))}function s(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,xe(e,e.attempt(bt,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function XD(e,t,n){const i=this;return xe(e,r,"listItemIndent",i.containerState.size+1);function r(o){const s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?t(o):n(o)}}function ZD(e){e.exit(this.containerState.type)}function qD(e,t,n){const i=this;return xe(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){const s=i.events[i.events.length-1];return!we(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Im={name:"setextUnderline",resolveTo:QD,tokenize:KD};function QD(e,t){let n=e.length,i,r,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",s,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=s,e.push(["exit",s,t]),e}function KD(e,t,n){const i=this;let r;return o;function o(u){let d=i.events.length,c;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){c=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||c)?(e.enter("setextHeadingLine"),r=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===r?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),we(u)?xe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ue(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const JD={tokenize:ez};function ez(e){const t=this,n=e.attempt(Ns,i,e.attempt(this.parser.constructs.flowInitial,r,xe(e,e.attempt(this.parser.constructs.flow,r,e.attempt(oD,r)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tz={resolveAll:Eb()},nz=Cb("string"),iz=Cb("text");function Cb(e){return{resolveAll:Eb(e==="text"?rz:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],o=n.attempt(r,s,a);return s;function s(d){return u(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const c=r[d];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function Eb(e){return t;function t(n,i){let r=-1,o;for(;++r<=n.length;)o===void 0?n[r]&&n[r][1].type==="data"&&(o=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==o+2&&(n[o][1].end=n[r-1][1].end,n.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(n,i):n}}function rz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],r=t.sliceStream(i);let o=r.length,s=-1,a=0,l;for(;o--;){const u=r[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...u.start},i.start.offset===i.end.offset?Object.assign(i,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const oz={42:bt,43:bt,45:bt,48:bt,49:bt,50:bt,51:bt,52:bt,53:bt,54:bt,55:bt,56:bt,57:bt,62:wb},sz={91:cD},az={[-2]:nc,[-1]:nc,32:nc},lz={35:gD,42:Fa,45:[Im,Fa],60:yD,61:Im,95:Fa,96:Pm,126:Pm},uz={38:yb,92:bb},cz={[-5]:ic,[-4]:ic,[-3]:ic,33:VD,38:yb,42:Dd,60:[HE,DD],91:HD,92:[fD,bb],93:cp,95:Dd,96:JE},dz={null:[Dd,tz]},hz={null:[42,95]},pz={null:[]},fz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hz,contentInitial:sz,disable:pz,document:oz,flow:lz,flowInitial:az,insideSpan:dz,string:uz,text:cz},Symbol.toStringTag,{value:"Module"}));function mz(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},o=[];let s=[],a=[];const l={attempt:E(k),check:E(_),consume:w,enter:g,exit:y,interrupt:E(_,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:f,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:c};let d=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(I){return s=Bt(s,I),b(),s[s.length-1]!==null?[]:(S(t,0),u.events=nu(o,u.events,u),u.events)}function h(I,L){return vz(p(I),L)}function p(I){return gz(s,I)}function f(){const{_bufferIndex:I,_index:L,line:V,column:D,offset:P}=i;return{_bufferIndex:I,_index:L,line:V,column:D,offset:P}}function v(I){r[I.line]=I.column,C()}function b(){let I;for(;i._index<s.length;){const L=s[i._index];if(typeof L=="string")for(I=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===I&&i._bufferIndex<L.length;)m(L.charCodeAt(i._bufferIndex));else m(L)}}function m(I){d=d(I)}function w(I){ue(I)?(i.line++,i.column=1,i.offset+=I===-3?2:1,C()):I!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),u.previous=I}function g(I,L){const V=L||{};return V.type=I,V.start=f(),u.events.push(["enter",V,u]),a.push(V),V}function y(I){const L=a.pop();return L.end=f(),u.events.push(["exit",L,u]),L}function k(I,L){S(I,L.from)}function _(I,L){L.restore()}function E(I,L){return V;function V(D,P,A){let O,N,M,x;return Array.isArray(D)?H(D):"tokenize"in D?H([D]):F(D);function F(U){return K;function K(Y){const Q=Y!==null&&U[Y],de=Y!==null&&U.null,le=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(de)?de:de?[de]:[]];return H(le)(Y)}}function H(U){return O=U,N=0,U.length===0?A:z(U[N])}function z(U){return K;function K(Y){return x=T(),M=U,U.partial||(u.currentConstruct=U),U.name&&u.parser.constructs.disable.null.includes(U.name)?q():U.tokenize.call(L?Object.assign(Object.create(u),L):u,l,X,q)(Y)}}function X(U){return I(M,x),P}function q(U){return x.restore(),++N<O.length?z(O[N]):A}}}function S(I,L){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&Tt(u.events,L,u.events.length-L,I.resolve(u.events.slice(L),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function T(){const I=f(),L=u.previous,V=u.currentConstruct,D=u.events.length,P=Array.from(a);return{from:D,restore:A};function A(){i=I,u.previous=L,u.currentConstruct=V,u.events.length=D,a=P,C()}}function C(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function gz(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex;let s;if(n===r)s=[e[n].slice(i,o)];else{if(s=e.slice(n,r),i>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(i):s.shift()}o>0&&s.push(e[r].slice(0,o))}return s}function vz(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:r,digest:null}}function qu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ad(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var GS=typeof WeakMap=="function"?WeakMap:Map;function z0(e,t,n){n=Hn(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){pl||(pl=!0,vd=i),ad(e,t)},n}function P0(e,t,n){n=Hn(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var r=t.value;n.payload=function(){return i(r)},n.callback=function(){ad(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ad(e,t),typeof i!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Xf(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new GS;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(r.add(n),e=tC.bind(null,e,t,n),t.then(e,e))}function Zf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function qf(e,t,n,i,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Hn(-1,1),t.tag=2,mi(n,t,1))),n.lanes|=1),e)}var BS=Un.ReactCurrentOwner,xt=!1;function ft(e,t,n,i){t.child=e===null?r0(t,null,n,i):jr(t,e.child,n,i)}function Qf(e,t,n,i,r){n=n.render;var o=t.ref;return Rr(t,r),i=Fh(e,t,n,i,o,r),n=Hh(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wn(e,t,r)):(Te&&n&&Dh(t),t.flags|=1,ft(e,t,i,r),t.child)}function Kf(e,t,n,i,r){if(e===null){var o=n.type;return typeof o=="function"&&!qh(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,A0(e,t,o,i,r)):(e=Va(n.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&r)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:es,n(s,i)&&e.ref===t.ref)return Wn(e,t,r)}return t.flags|=1,e=wi(o,i),e.ref=t.ref,e.return=t,t.child=e}function A0(e,t,n,i,r){if(e!==null){var o=e.memoizedProps;if(es(o,i)&&e.ref===t.ref)if(xt=!1,t.pendingProps=i=o,(e.lanes&r)!==0)e.flags&131072&&(xt=!0);else return t.lanes=e.lanes,Wn(e,t,r)}return ld(e,t,n,i,r)}function I0(e,t,n){var i=t.pendingProps,r=i.children,o=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(Ar,Pt),Pt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(Ar,Pt),Pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:n,Pe(Ar,Pt),Pt|=i}else o!==null?(i=o.baseLanes|n,t.memoizedState=null):i=n,Pe(Ar,Pt),Pt|=i;return ft(e,t,r,n),t.child}function N0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ld(e,t,n,i,r){var o=St(n)?Qi:dt.current;return o=$r(t,o),Rr(t,r),n=Fh(e,t,n,i,o,r),i=Hh(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wn(e,t,r)):(Te&&i&&Dh(t),t.flags|=1,ft(e,t,n,r),t.child)}function Jf(e,t,n,i,r){if(St(n)){var o=!0;il(t)}else o=!1;if(Rr(t,r),t.stateNode===null)La(e,t),D0(t,n,i),sd(t,n,i,r),i=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ut(u):(u=St(n)?Qi:dt.current,u=$r(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==i||l!==u)&&Yf(t,s,i,u),ri=!1;var h=t.memoizedState;s.state=h,ll(t,i,s,r),l=t.memoizedState,a!==i||h!==l||kt.current||ri?(typeof d=="function"&&(od(t,n,d,i),l=t.memoizedState),(a=ri||Uf(t,n,a,i,h,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),s.props=i,s.state=l,s.context=u,i=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{s=t.stateNode,s0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Kt(t.type,a),s.props=u,c=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ut(l):(l=St(n)?Qi:dt.current,l=$r(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==c||h!==l)&&Yf(t,s,i,l),ri=!1,h=t.memoizedState,s.state=h,ll(t,i,s,r);var f=t.memoizedState;a!==c||h!==f||kt.current||ri?(typeof p=="function"&&(od(t,n,p,i),f=t.memoizedState),(u=ri||Uf(t,n,u,i,h,f,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,f,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,f,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),s.props=i,s.state=f,s.context=l,i=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return ud(e,t,n,i,o,r)}function ud(e,t,n,i,r,o){N0(e,t);var s=(t.flags&128)!==0;if(!i&&!s)return r&&Vf(t,n,!1),Wn(e,t,o);i=t.stateNode,BS.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&s?(t.child=jr(t,e.child,null,o),t.child=jr(t,null,a,o)):ft(e,t,a,o),t.memoizedState=i.state,r&&Vf(t,n,!0),t.child}function T0(e){var t=e.stateNode;t.pendingContext?Rf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Rf(e,t.context,!1),Lh(e,t.containerInfo)}function em(e,t,n,i,r){return Wr(),Ph(r),t.flags|=256,ft(e,t,n,i),t.child}var cd={dehydrated:null,treeContext:null,retryLane:0};function dd(e){return{baseLanes:e,cachePool:null,transitions:null}}function M0(e,t,n){var i=t.pendingProps,r=Re.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Pe(Re,r&1),e===null)return id(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=i.children,e=i.fallback,o?(i=t.mode,o=t.child,s={mode:"hidden",children:s},!(i&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Zl(s,i,0,null),e=Ui(e,i,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=dd(n),t.memoizedState=cd,e):$h(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return $S(e,t,s,i,a,r,n);if(o){o=i.fallback,s=t.mode,r=e.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(s&1)&&t.child!==r?(i=t.child,i.childLanes=0,i.pendingProps=l,t.deletions=null):(i=wi(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=wi(a,o):(o=Ui(o,s,n,null),o.flags|=2),o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,s=e.child.memoizedState,s=s===null?dd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=cd,i}return o=e.child,e=o.sibling,i=wi(o,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function $h(e,t){return t=Zl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function na(e,t,n,i){return i!==null&&Ph(i),jr(t,e.child,null,n),e=$h(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $S(e,t,n,i,r,o,s){if(n)return t.flags&256?(t.flags&=-257,i=qu(Error(W(422))),na(e,t,s,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=i.fallback,r=t.mode,i=Zl({mode:"visible",children:i.children},r,0,null),o=Ui(o,r,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&jr(t,e.child,null,s),t.child.memoizedState=dd(s),t.memoizedState=cd,o);if(!(t.mode&1))return na(e,t,s,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error(W(419)),i=qu(o,i,void 0),na(e,t,s,i)}if(a=(s&e.childLanes)!==0,xt||a){if(i=nt,i!==null){switch(s&-s){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|s)?0:r,r!==0&&r!==o.retryLane&&(o.retryLane=r,$n(e,r),ln(i,e,r,-1))}return Zh(),i=qu(Error(W(421))),na(e,t,s,i)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=nC.bind(null,e),r._reactRetry=t,null):(e=o.treeContext,It=fi(r.nextSibling),Nt=t,Te=!0,tn=null,e!==null&&(Ht[Gt++]=On,Ht[Gt++]=Rn,Ht[Gt++]=Ki,On=e.id,Rn=e.overflow,Ki=t),t=$h(t,i.children),t.flags|=4096,t)}function tm(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),rd(e.return,t,n)}function Qu(e,t,n,i,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r)}function L0(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;if(ft(e,t,i.children,n),i=Re.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tm(e,n,t);else if(e.tag===19)tm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Pe(Re,i),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ul(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Qu(t,!1,r,n,o);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ul(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Qu(t,!0,n,null,o);break;case"together":Qu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function La(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),er|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function WS(e,t,n){switch(t.tag){case 3:T0(t),Wr();break;case 5:a0(t);break;case 1:St(t.type)&&il(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,r=t.memoizedProps.value;Pe(sl,i._currentValue),i._currentValue=r;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Pe(Re,Re.current&1),t.flags|=128,null):n&t.child.childLanes?M0(e,t,n):(Pe(Re,Re.current&1),e=Wn(e,t,n),e!==null?e.sibling:null);Pe(Re,Re.current&1);break;case 19:if(i=(n&t.childLanes)!==0,e.flags&128){if(i)return L0(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Pe(Re,Re.current),i)break;return null;case 22:case 23:return t.lanes=0,I0(e,t,n)}return Wn(e,t,n)}var O0,hd,R0,V0;O0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};hd=function(){};R0=function(e,t,n,i){var r=e.memoizedProps;if(r!==i){e=t.stateNode,$i(Cn.current);var o=null;switch(n){case"input":r=Mc(e,r),i=Mc(e,i),o=[];break;case"select":r=Fe({},r,{value:void 0}),i=Fe({},i,{value:void 0}),o=[];break;case"textarea":r=Rc(e,r),i=Rc(e,i),o=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=tl)}Fc(n,i);var s;n=null;for(u in r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yo.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in i){var l=i[u];if(a=r!=null?r[u]:void 0,i.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ae("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};V0=function(e,t,n,i){n!==i&&(t.flags|=4)};function wo(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function jS(e,t,n){var i=t.pendingProps;switch(zh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return St(t.type)&&nl(),lt(t),null;case 3:return i=t.stateNode,Ur(),Ne(kt),Ne(dt),Rh(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ea(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,tn!==null&&(yd(tn),tn=null))),hd(e,t),lt(t),null;case 5:Oh(t);var r=$i(os.current);if(n=t.type,e!==null&&t.stateNode!=null)R0(e,t,n,i,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(W(166));return lt(t),null}if(e=$i(Cn.current),ea(t)){i=t.stateNode,n=t.type;var o=t.memoizedProps;switch(i[_n]=t,i[is]=o,e=(t.mode&1)!==0,n){case"dialog":Ae("cancel",i),Ae("close",i);break;case"iframe":case"object":case"embed":Ae("load",i);break;case"video":case"audio":for(r=0;r<Po.length;r++)Ae(Po[r],i);break;case"source":Ae("error",i);break;case"img":case"image":case"link":Ae("error",i),Ae("load",i);break;case"details":Ae("toggle",i);break;case"input":cf(i,o),Ae("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!o.multiple},Ae("invalid",i);break;case"textarea":hf(i,o),Ae("invalid",i)}Fc(n,o),r=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?i.textContent!==a&&(o.suppressHydrationWarning!==!0&&Js(i.textContent,a,e),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Js(i.textContent,a,e),r=["children",""+a]):Yo.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ae("scroll",i)}switch(n){case"input":js(i),df(i,o,!0);break;case"textarea":js(i),pf(i);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(i.onclick=tl)}i=r,t.updateQueue=i,i!==null&&(t.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=hw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=s.createElement(n,{is:i.is}):(e=s.createElement(n),n==="select"&&(s=e,i.multiple?s.multiple=!0:i.size&&(s.size=i.size))):e=s.createElementNS(e,n),e[_n]=t,e[is]=i,O0(e,t,!1,!1),t.stateNode=e;e:{switch(s=Hc(n,i),n){case"dialog":Ae("cancel",e),Ae("close",e),r=i;break;case"iframe":case"object":case"embed":Ae("load",e),r=i;break;case"video":case"audio":for(r=0;r<Po.length;r++)Ae(Po[r],e);r=i;break;case"source":Ae("error",e),r=i;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),r=i;break;case"details":Ae("toggle",e),r=i;break;case"input":cf(e,i),r=Mc(e,i),Ae("invalid",e);break;case"option":r=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},r=Fe({},i,{value:void 0}),Ae("invalid",e);break;case"textarea":hf(e,i),r=Rc(e,i),Ae("invalid",e);break;default:r=i}Fc(n,r),a=r;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?mw(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&pw(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Xo(e,l):typeof l=="number"&&Xo(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Yo.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Ae("scroll",e):l!=null&&ph(e,o,l,s))}switch(n){case"input":js(e),df(e,i,!1);break;case"textarea":js(e),pf(e);break;case"option":i.value!=null&&e.setAttribute("value",""+xi(i.value));break;case"select":e.multiple=!!i.multiple,o=i.value,o!=null?Tr(e,!!i.multiple,o,!1):i.defaultValue!=null&&Tr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=tl)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lt(t),null;case 6:if(e&&t.stateNode!=null)V0(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(W(166));if(n=$i(os.current),$i(Cn.current),ea(t)){if(i=t.stateNode,n=t.memoizedProps,i[_n]=t,(o=i.nodeValue!==n)&&(e=Nt,e!==null))switch(e.tag){case 3:Js(i.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Js(i.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[_n]=t,t.stateNode=i}return lt(t),null;case 13:if(Ne(Re),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Te&&It!==null&&t.mode&1&&!(t.flags&128))n0(),Wr(),t.flags|=98560,o=!1;else if(o=ea(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(W(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(W(317));o[_n]=t}else Wr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),o=!1}else tn!==null&&(yd(tn),tn=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Re.current&1?Ke===0&&(Ke=3):Zh())),t.updateQueue!==null&&(t.flags|=4),lt(t),null);case 4:return Ur(),hd(e,t),e===null&&ts(t.stateNode.containerInfo),lt(t),null;case 10:return Nh(t.type._context),lt(t),null;case 17:return St(t.type)&&nl(),lt(t),null;case 19:if(Ne(Re),o=t.memoizedState,o===null)return lt(t),null;if(i=(t.flags&128)!==0,s=o.rendering,s===null)if(i)wo(o,!1);else{if(Ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ul(e),s!==null){for(t.flags|=128,wo(o,!1),i=s.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)o=n,e=i,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Pe(Re,Re.current&1|2),t.child}e=e.sibling}o.tail!==null&&Be()>Xr&&(t.flags|=128,i=!0,wo(o,!1),t.lanes=4194304)}else{if(!i)if(e=ul(s),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Te)return lt(t),null}else 2*Be()-o.renderingStartTime>Xr&&n!==1073741824&&(t.flags|=128,i=!0,wo(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Be(),t.sibling=null,n=Re.current,Pe(Re,i?n&1|2:n&1),t):(lt(t),null);case 22:case 23:return Xh(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Pt&1073741824&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function US(e,t){switch(zh(t),t.tag){case 1:return St(t.type)&&nl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ur(),Ne(kt),Ne(dt),Rh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Oh(t),null;case 13:if(Ne(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Wr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(Re),null;case 4:return Ur(),null;case 10:return Nh(t.type._context),null;case 22:case 23:return Xh(),null;case 24:return null;default:return null}}var ia=!1,ut=!1,YS=typeof WeakSet=="function"?WeakSet:Set,J=null;function Pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Ge(e,t,i)}else n.current=null}function pd(e,t,n){try{n()}catch(i){Ge(e,t,i)}}var nm=!1;function XS(e,t){if(qc=Ka,e=$w(),Eh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,h=null;t:for(;;){for(var p;c!==n||r!==0&&c.nodeType!==3||(a=s+r),c!==o||i!==0&&c.nodeType!==3||(l=s+i),c.nodeType===3&&(s+=c.nodeValue.length),(p=c.firstChild)!==null;)h=c,c=p;for(;;){if(c===e)break t;if(h===n&&++u===r&&(a=s),h===o&&++d===i&&(l=s),(p=c.nextSibling)!==null)break;c=h,h=c.parentNode}c=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qc={focusedElem:e,selectionRange:n},Ka=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var f=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var v=f.memoizedProps,b=f.memoizedState,m=t.stateNode,w=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Kt(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(y){Ge(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return f=nm,nm=!1,f}function Vo(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&e)===e){var o=r.destroy;r.destroy=void 0,o!==void 0&&pd(t,n,o)}r=r.next}while(r!==i)}}function Yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function fd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function F0(e){var t=e.alternate;t!==null&&(e.alternate=null,F0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_n],delete t[is],delete t[ed],delete t[AS],delete t[IS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function H0(e){return e.tag===5||e.tag===3||e.tag===4}function im(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||H0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function md(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tl));else if(i!==4&&(e=e.child,e!==null))for(md(e,t,n),e=e.sibling;e!==null;)md(e,t,n),e=e.sibling}function gd(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(gd(e,t,n),e=e.sibling;e!==null;)gd(e,t,n),e=e.sibling}var it=null,Jt=!1;function qn(e,t,n){for(n=n.child;n!==null;)G0(e,t,n),n=n.sibling}function G0(e,t,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(Fl,n)}catch{}switch(n.tag){case 5:ut||Pr(n,t);case 6:var i=it,r=Jt;it=null,qn(e,t,n),it=i,Jt=r,it!==null&&(Jt?(e=it,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):it.removeChild(n.stateNode));break;case 18:it!==null&&(Jt?(e=it,n=n.stateNode,e.nodeType===8?Wu(e.parentNode,n):e.nodeType===1&&Wu(e,n),Ko(e)):Wu(it,n.stateNode));break;case 4:i=it,r=Jt,it=n.stateNode.containerInfo,Jt=!0,qn(e,t,n),it=i,Jt=r;break;case 0:case 11:case 14:case 15:if(!ut&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&pd(n,t,s),r=r.next}while(r!==i)}qn(e,t,n);break;case 1:if(!ut&&(Pr(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){Ge(n,t,a)}qn(e,t,n);break;case 21:qn(e,t,n);break;case 22:n.mode&1?(ut=(i=ut)||n.memoizedState!==null,qn(e,t,n),ut=i):qn(e,t,n);break;default:qn(e,t,n)}}function rm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YS),t.forEach(function(i){var r=iC.bind(null,e,i);n.has(i)||(n.add(i),i.then(r,r))})}}function qt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:it=a.stateNode,Jt=!1;break e;case 3:it=a.stateNode.containerInfo,Jt=!0;break e;case 4:it=a.stateNode.containerInfo,Jt=!0;break e}a=a.return}if(it===null)throw Error(W(160));G0(o,s,r),it=null,Jt=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){Ge(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)B0(t,e),t=t.sibling}function B0(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qt(t,e),gn(e),i&4){try{Vo(3,e,e.return),Yl(3,e)}catch(v){Ge(e,e.return,v)}try{Vo(5,e,e.return)}catch(v){Ge(e,e.return,v)}}break;case 1:qt(t,e),gn(e),i&512&&n!==null&&Pr(n,n.return);break;case 5:if(qt(t,e),gn(e),i&512&&n!==null&&Pr(n,n.return),e.flags&32){var r=e.stateNode;try{Xo(r,"")}catch(v){Ge(e,e.return,v)}}if(i&4&&(r=e.stateNode,r!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&cw(r,o),Hc(a,s);var u=Hc(a,o);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?mw(r,c):d==="dangerouslySetInnerHTML"?pw(r,c):d==="children"?Xo(r,c):ph(r,d,c,u)}switch(a){case"input":Lc(r,o);break;case"textarea":dw(r,o);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Tr(r,!!o.multiple,p,!1):h!==!!o.multiple&&(o.defaultValue!=null?Tr(r,!!o.multiple,o.defaultValue,!0):Tr(r,!!o.multiple,o.multiple?[]:"",!1))}r[is]=o}catch(v){Ge(e,e.return,v)}}break;case 6:if(qt(t,e),gn(e),i&4){if(e.stateNode===null)throw Error(W(162));r=e.stateNode,o=e.memoizedProps;try{r.nodeValue=o}catch(v){Ge(e,e.return,v)}}break;case 3:if(qt(t,e),gn(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(v){Ge(e,e.return,v)}break;case 4:qt(t,e),gn(e);break;case 13:qt(t,e),gn(e),r=e.child,r.flags&8192&&(o=r.memoizedState!==null,r.stateNode.isHidden=o,!o||r.alternate!==null&&r.alternate.memoizedState!==null||(Uh=Be())),i&4&&rm(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ut=(u=ut)||d,qt(t,e),ut=u):qt(t,e),gn(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(J=e,d=e.child;d!==null;){for(c=J=d;J!==null;){switch(h=J,p=h.child,h.tag){case 0:case 11:case 14:case 15:Vo(4,h,h.return);break;case 1:Pr(h,h.return);var f=h.stateNode;if(typeof f.componentWillUnmount=="function"){i=h,n=h.return;try{t=i,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(v){Ge(i,n,v)}}break;case 5:Pr(h,h.return);break;case 22:if(h.memoizedState!==null){sm(c);continue}}p!==null?(p.return=h,J=p):sm(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{r=c.stateNode,u?(o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=fw("display",s))}catch(v){Ge(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){Ge(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:qt(t,e),gn(e),i&4&&rm(e);break;case 21:break;default:qt(t,e),gn(e)}}function gn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(H0(n)){var i=n;break e}n=n.return}throw Error(W(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(Xo(r,""),i.flags&=-33);var o=im(e);gd(e,o,r);break;case 3:case 4:var s=i.stateNode.containerInfo,a=im(e);md(e,a,s);break;default:throw Error(W(161))}}catch(l){Ge(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZS(e,t,n){J=e,$0(e)}function $0(e,t,n){for(var i=(e.mode&1)!==0;J!==null;){var r=J,o=r.child;if(r.tag===22&&i){var s=r.memoizedState!==null||ia;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||ut;a=ia;var u=ut;if(ia=s,(ut=l)&&!u)for(J=r;J!==null;)s=J,l=s.child,s.tag===22&&s.memoizedState!==null?am(r):l!==null?(l.return=s,J=l):am(r);for(;o!==null;)J=o,$0(o),o=o.sibling;J=r,ia=a,ut=u}om(e)}else r.subtreeFlags&8772&&o!==null?(o.return=r,J=o):om(e)}}function om(e){for(;J!==null;){var t=J;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ut||Yl(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!ut)if(n===null)i.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:Kt(t.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&$f(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}$f(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&Ko(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}ut||t.flags&512&&fd(t)}catch(h){Ge(t,t.return,h)}}if(t===e){J=null;break}if(n=t.sibling,n!==null){n.return=t.return,J=n;break}J=t.return}}function sm(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}function am(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Yl(4,t)}catch(l){Ge(t,n,l)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var r=t.return;try{i.componentDidMount()}catch(l){Ge(t,r,l)}}var o=t.return;try{fd(t)}catch(l){Ge(t,o,l)}break;case 5:var s=t.return;try{fd(t)}catch(l){Ge(t,s,l)}}}catch(l){Ge(t,t.return,l)}if(t===e){J=null;break}var a=t.sibling;if(a!==null){a.return=t.return,J=a;break}J=t.return}}var qS=Math.ceil,hl=Un.ReactCurrentDispatcher,Wh=Un.ReactCurrentOwner,jt=Un.ReactCurrentBatchConfig,ke=0,nt=null,We=null,ot=0,Pt=0,Ar=Si(0),Ke=0,us=null,er=0,Xl=0,jh=0,Fo=null,yt=null,Uh=0,Xr=1/0,Mn=null,pl=!1,vd=null,gi=null,ra=!1,ui=null,fl=0,Ho=0,wd=null,Oa=-1,Ra=0;function gt(){return ke&6?Be():Oa!==-1?Oa:Oa=Be()}function vi(e){return e.mode&1?ke&2&&ot!==0?ot&-ot:TS.transition!==null?(Ra===0&&(Ra=Dw()),Ra):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:Mw(e.type)),e):1}function ln(e,t,n,i){if(50<Ho)throw Ho=0,wd=null,Error(W(185));Ds(e,n,i),(!(ke&2)||e!==nt)&&(e===nt&&(!(ke&2)&&(Xl|=n),Ke===4&&si(e,ot)),Ct(e,i),n===1&&ke===0&&!(t.mode&1)&&(Xr=Be()+500,Wl&&Ci()))}function Ct(e,t){var n=e.callbackNode;Tk(e,t);var i=Qa(e,e===nt?ot:0);if(i===0)n!==null&&gf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(n!=null&&gf(n),t===1)e.tag===0?NS(lm.bind(null,e)):Jw(lm.bind(null,e)),zS(function(){!(ke&6)&&Ci()}),n=null;else{switch(zw(i)){case 1:n=wh;break;case 4:n=Cw;break;case 16:n=qa;break;case 536870912:n=Ew;break;default:n=qa}n=Q0(n,W0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function W0(e,t){if(Oa=-1,Ra=0,ke&6)throw Error(W(327));var n=e.callbackNode;if(Vr()&&e.callbackNode!==n)return null;var i=Qa(e,e===nt?ot:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=ml(e,i);else{t=i;var r=ke;ke|=2;var o=U0();(nt!==e||ot!==t)&&(Mn=null,Xr=Be()+500,ji(e,t));do try{JS();break}catch(a){j0(e,a)}while(!0);Ih(),hl.current=o,ke=r,We!==null?t=0:(nt=null,ot=0,t=Ke)}if(t!==0){if(t===2&&(r=jc(e),r!==0&&(i=r,t=bd(e,r))),t===1)throw n=us,ji(e,0),si(e,i),Ct(e,Be()),n;if(t===6)si(e,i);else{if(r=e.current.alternate,!(i&30)&&!QS(r)&&(t=ml(e,i),t===2&&(o=jc(e),o!==0&&(i=o,t=bd(e,o))),t===1))throw n=us,ji(e,0),si(e,i),Ct(e,Be()),n;switch(e.finishedWork=r,e.finishedLanes=i,t){case 0:case 1:throw Error(W(345));case 2:Vi(e,yt,Mn);break;case 3:if(si(e,i),(i&130023424)===i&&(t=Uh+500-Be(),10<t)){if(Qa(e,0)!==0)break;if(r=e.suspendedLanes,(r&i)!==i){gt(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Jc(Vi.bind(null,e,yt,Mn),t);break}Vi(e,yt,Mn);break;case 4:if(si(e,i),(i&4194240)===i)break;for(t=e.eventTimes,r=-1;0<i;){var s=31-an(i);o=1<<s,s=t[s],s>r&&(r=s),i&=~o}if(i=r,i=Be()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qS(i/1960))-i,10<i){e.timeoutHandle=Jc(Vi.bind(null,e,yt,Mn),i);break}Vi(e,yt,Mn);break;case 5:Vi(e,yt,Mn);break;default:throw Error(W(329))}}}return Ct(e,Be()),e.callbackNode===n?W0.bind(null,e):null}function bd(e,t){var n=Fo;return e.current.memoizedState.isDehydrated&&(ji(e,t).flags|=256),e=ml(e,t),e!==2&&(t=yt,yt=n,t!==null&&yd(t)),e}function yd(e){yt===null?yt=e:yt.push.apply(yt,e)}function QS(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!cn(o(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function si(e,t){for(t&=~jh,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-an(t),i=1<<n;e[n]=-1,t&=~i}}function lm(e){if(ke&6)throw Error(W(327));Vr();var t=Qa(e,0);if(!(t&1))return Ct(e,Be()),null;var n=ml(e,t);if(e.tag!==0&&n===2){var i=jc(e);i!==0&&(t=i,n=bd(e,i))}if(n===1)throw n=us,ji(e,0),si(e,t),Ct(e,Be()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vi(e,yt,Mn),Ct(e,Be()),null}function Yh(e,t){var n=ke;ke|=1;try{return e(t)}finally{ke=n,ke===0&&(Xr=Be()+500,Wl&&Ci())}}function tr(e){ui!==null&&ui.tag===0&&!(ke&6)&&Vr();var t=ke;ke|=1;var n=jt.transition,i=Ce;try{if(jt.transition=null,Ce=1,e)return e()}finally{Ce=i,jt.transition=n,ke=t,!(ke&6)&&Ci()}}function Xh(){Pt=Ar.current,Ne(Ar)}function ji(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,DS(n)),We!==null)for(n=We.return;n!==null;){var i=n;switch(zh(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&nl();break;case 3:Ur(),Ne(kt),Ne(dt),Rh();break;case 5:Oh(i);break;case 4:Ur();break;case 13:Ne(Re);break;case 19:Ne(Re);break;case 10:Nh(i.type._context);break;case 22:case 23:Xh()}n=n.return}if(nt=e,We=e=wi(e.current,null),ot=Pt=t,Ke=0,us=null,jh=Xl=er=0,yt=Fo=null,Bi!==null){for(t=0;t<Bi.length;t++)if(n=Bi[t],i=n.interleaved,i!==null){n.interleaved=null;var r=i.next,o=n.pending;if(o!==null){var s=o.next;o.next=r,i.next=s}n.pending=i}Bi=null}return e}function j0(e,t){do{var n=We;try{if(Ih(),Ta.current=dl,cl){for(var i=Ve.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}cl=!1}if(Ji=0,tt=Qe=Ve=null,Ro=!1,ss=0,Wh.current=null,n===null||n.return===null){Ke=1,us=t,We=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=ot,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Zf(s);if(p!==null){p.flags&=-257,qf(p,s,a,o,t),p.mode&1&&Xf(o,u,t),t=p,l=u;var f=t.updateQueue;if(f===null){var v=new Set;v.add(l),t.updateQueue=v}else f.add(l);break e}else{if(!(t&1)){Xf(o,u,t),Zh();break e}l=Error(W(426))}}else if(Te&&a.mode&1){var b=Zf(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),qf(b,s,a,o,t),Ph(Yr(l,a));break e}}o=l=Yr(l,a),Ke!==4&&(Ke=2),Fo===null?Fo=[o]:Fo.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=z0(o,l,t);Bf(o,m);break e;case 1:a=l;var w=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof w.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(gi===null||!gi.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var y=P0(o,a,t);Bf(o,y);break e}}o=o.return}while(o!==null)}X0(n)}catch(k){t=k,We===n&&n!==null&&(We=n=n.return);continue}break}while(!0)}function U0(){var e=hl.current;return hl.current=dl,e===null?dl:e}function Zh(){(Ke===0||Ke===3||Ke===2)&&(Ke=4),nt===null||!(er&268435455)&&!(Xl&268435455)||si(nt,ot)}function ml(e,t){var n=ke;ke|=2;var i=U0();(nt!==e||ot!==t)&&(Mn=null,ji(e,t));do try{KS();break}catch(r){j0(e,r)}while(!0);if(Ih(),ke=n,hl.current=i,We!==null)throw Error(W(261));return nt=null,ot=0,Ke}function KS(){for(;We!==null;)Y0(We)}function JS(){for(;We!==null&&!Sk();)Y0(We)}function Y0(e){var t=q0(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?X0(e):We=t,Wh.current=null}function X0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=US(n,t),n!==null){n.flags&=32767,We=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ke=6,We=null;return}}else if(n=jS(n,t,Pt),n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Ke===0&&(Ke=5)}function Vi(e,t,n){var i=Ce,r=jt.transition;try{jt.transition=null,Ce=1,eC(e,t,n,i)}finally{jt.transition=r,Ce=i}return null}function eC(e,t,n,i){do Vr();while(ui!==null);if(ke&6)throw Error(W(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Mk(e,o),e===nt&&(We=nt=null,ot=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ra||(ra=!0,Q0(qa,function(){return Vr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=jt.transition,jt.transition=null;var s=Ce;Ce=1;var a=ke;ke|=4,Wh.current=null,XS(e,n),B0(n,e),yS(Qc),Ka=!!qc,Qc=qc=null,e.current=n,ZS(n),Ck(),ke=a,Ce=s,jt.transition=o}else e.current=n;if(ra&&(ra=!1,ui=e,fl=r),o=e.pendingLanes,o===0&&(gi=null),zk(n.stateNode),Ct(e,Be()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(pl)throw pl=!1,e=vd,vd=null,e;return fl&1&&e.tag!==0&&Vr(),o=e.pendingLanes,o&1?e===wd?Ho++:(Ho=0,wd=e):Ho=0,Ci(),null}function Vr(){if(ui!==null){var e=zw(fl),t=jt.transition,n=Ce;try{if(jt.transition=null,Ce=16>e?16:e,ui===null)var i=!1;else{if(e=ui,ui=null,fl=0,ke&6)throw Error(W(331));var r=ke;for(ke|=4,J=e.current;J!==null;){var o=J,s=o.child;if(J.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(J=u;J!==null;){var d=J;switch(d.tag){case 0:case 11:case 15:Vo(8,d,o)}var c=d.child;if(c!==null)c.return=d,J=c;else for(;J!==null;){d=J;var h=d.sibling,p=d.return;if(F0(d),d===u){J=null;break}if(h!==null){h.return=p,J=h;break}J=p}}}var f=o.alternate;if(f!==null){var v=f.child;if(v!==null){f.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}J=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,J=s;else e:for(;J!==null;){if(o=J,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Vo(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,J=m;break e}J=o.return}}var w=e.current;for(J=w;J!==null;){s=J;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,J=g;else e:for(s=w;J!==null;){if(a=J,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Yl(9,a)}}catch(k){Ge(a,a.return,k)}if(a===s){J=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,J=y;break e}J=a.return}}if(ke=r,Ci(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(Fl,e)}catch{}i=!0}return i}finally{Ce=n,jt.transition=t}}return!1}function um(e,t,n){t=Yr(n,t),t=z0(e,t,1),e=mi(e,t,1),t=gt(),e!==null&&(Ds(e,1,t),Ct(e,t))}function Ge(e,t,n){if(e.tag===3)um(e,e,n);else for(;t!==null;){if(t.tag===3){um(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(gi===null||!gi.has(i))){e=Yr(n,e),e=P0(t,e,1),t=mi(t,e,1),e=gt(),t!==null&&(Ds(t,1,e),Ct(t,e));break}}t=t.return}}function tC(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),t=gt(),e.pingedLanes|=e.suspendedLanes&n,nt===e&&(ot&n)===n&&(Ke===4||Ke===3&&(ot&130023424)===ot&&500>Be()-Uh?ji(e,0):jh|=n),Ct(e,t)}function Z0(e,t){t===0&&(e.mode&1?(t=Xs,Xs<<=1,!(Xs&130023424)&&(Xs=4194304)):t=1);var n=gt();e=$n(e,t),e!==null&&(Ds(e,t,n),Ct(e,n))}function nC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Z0(e,n)}function iC(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(W(314))}i!==null&&i.delete(t),Z0(e,n)}var q0;q0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xt=!1,WS(e,t,n);xt=!!(e.flags&131072)}else xt=!1,Te&&t.flags&1048576&&e0(t,ol,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;La(e,t),e=t.pendingProps;var r=$r(t,dt.current);Rr(t,n),r=Fh(null,t,i,e,r,n);var o=Hh();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,St(i)?(o=!0,il(t)):o=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Mh(t),r.updater=Ul,t.stateNode=r,r._reactInternals=t,sd(t,i,e,n),t=ud(null,t,i,!0,o,n)):(t.tag=0,Te&&o&&Dh(t),ft(null,t,r,n),t=t.child),t;case 16:i=t.elementType;e:{switch(La(e,t),e=t.pendingProps,r=i._init,i=r(i._payload),t.type=i,r=t.tag=oC(i),e=Kt(i,e),r){case 0:t=ld(null,t,i,e,n);break e;case 1:t=Jf(null,t,i,e,n);break e;case 11:t=Qf(null,t,i,e,n);break e;case 14:t=Kf(null,t,i,Kt(i.type,e),n);break e}throw Error(W(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),ld(e,t,i,r,n);case 1:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),Jf(e,t,i,r,n);case 3:e:{if(T0(t),e===null)throw Error(W(387));i=t.pendingProps,o=t.memoizedState,r=o.element,s0(e,t),ll(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){r=Yr(Error(W(423)),t),t=em(e,t,i,n,r);break e}else if(i!==r){r=Yr(Error(W(424)),t),t=em(e,t,i,n,r);break e}else for(It=fi(t.stateNode.containerInfo.firstChild),Nt=t,Te=!0,tn=null,n=r0(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wr(),i===r){t=Wn(e,t,n);break e}ft(e,t,i,n)}t=t.child}return t;case 5:return a0(t),e===null&&id(t),i=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,s=r.children,Kc(i,r)?s=null:o!==null&&Kc(i,o)&&(t.flags|=32),N0(e,t),ft(e,t,s,n),t.child;case 6:return e===null&&id(t),null;case 13:return M0(e,t,n);case 4:return Lh(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=jr(t,null,i,n):ft(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),Qf(e,t,i,r,n);case 7:return ft(e,t,t.pendingProps,n),t.child;case 8:return ft(e,t,t.pendingProps.children,n),t.child;case 12:return ft(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,r=t.pendingProps,o=t.memoizedProps,s=r.value,Pe(sl,i._currentValue),i._currentValue=s,o!==null)if(cn(o.value,s)){if(o.children===r.children&&!kt.current){t=Wn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Hn(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),rd(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(W(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),rd(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ft(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,Rr(t,n),r=Ut(r),i=i(r),t.flags|=1,ft(e,t,i,n),t.child;case 14:return i=t.type,r=Kt(i,t.pendingProps),r=Kt(i.type,r),Kf(e,t,i,r,n);case 15:return A0(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Kt(i,r),La(e,t),t.tag=1,St(i)?(e=!0,il(t)):e=!1,Rr(t,n),D0(t,i,r),sd(t,i,r,n),ud(null,t,i,!0,e,n);case 19:return L0(e,t,n);case 22:return I0(e,t,n)}throw Error(W(156,t.tag))};function Q0(e,t){return Sw(e,t)}function rC(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,n,i){return new rC(e,t,n,i)}function qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oC(e){if(typeof e=="function")return qh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mh)return 11;if(e===gh)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=$t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Va(e,t,n,i,r,o){var s=2;if(i=e,typeof e=="function")qh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case yr:return Ui(n.children,r,o,t);case fh:s=8,r|=8;break;case Ac:return e=$t(12,n,t,r|2),e.elementType=Ac,e.lanes=o,e;case Ic:return e=$t(13,n,t,r),e.elementType=Ic,e.lanes=o,e;case Nc:return e=$t(19,n,t,r),e.elementType=Nc,e.lanes=o,e;case aw:return Zl(n,r,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ow:s=10;break e;case sw:s=9;break e;case mh:s=11;break e;case gh:s=14;break e;case ii:s=16,i=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=$t(s,n,t,r),t.elementType=e,t.type=i,t.lanes=o,t}function Ui(e,t,n,i){return e=$t(7,e,i,t),e.lanes=n,e}function Zl(e,t,n,i){return e=$t(22,e,i,t),e.elementType=aw,e.lanes=n,e.stateNode={isHidden:!1},e}function Ku(e,t,n){return e=$t(6,e,null,t),e.lanes=n,e}function Ju(e,t,n){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sC(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tu(0),this.expirationTimes=Tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tu(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Qh(e,t,n,i,r,o,s,a,l){return e=new sC(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=$t(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mh(o),e}function aC(e,t,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:br,key:i==null?null:""+i,children:e,containerInfo:t,implementation:n}}function K0(e){if(!e)return _i;e=e._reactInternals;e:{if(lr(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(St(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(St(n))return Kw(e,n,t)}return t}function J0(e,t,n,i,r,o,s,a,l){return e=Qh(n,i,!0,e,r,o,s,a,l),e.context=K0(null),n=e.current,i=gt(),r=vi(n),o=Hn(i,r),o.callback=t??null,mi(n,o,r),e.current.lanes=r,Ds(e,r,i),Ct(e,i),e}function ql(e,t,n,i){var r=t.current,o=gt(),s=vi(r);return n=K0(n),t.context===null?t.context=n:t.pendingContext=n,t=Hn(o,s),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=mi(r,t,s),e!==null&&(ln(e,r,s,o),Na(e,r,s)),s}function gl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Kh(e,t){cm(e,t),(e=e.alternate)&&cm(e,t)}function lC(){return null}var eb=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jh(e){this._internalRoot=e}Ql.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));ql(e,t,null,null)};Ql.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tr(function(){ql(null,e,null,null)}),t[Bn]=null}};function Ql(e){this._internalRoot=e}Ql.prototype.unstable_scheduleHydration=function(e){if(e){var t=Iw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<oi.length&&t!==0&&t<oi[n].priority;n++);oi.splice(n,0,e),n===0&&Tw(e)}};function ep(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Kl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dm(){}function uC(e,t,n,i,r){if(r){if(typeof i=="function"){var o=i;i=function(){var u=gl(s);o.call(u)}}var s=J0(t,i,e,0,null,!1,!1,"",dm);return e._reactRootContainer=s,e[Bn]=s.current,ts(e.nodeType===8?e.parentNode:e),tr(),s}for(;r=e.lastChild;)e.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var u=gl(l);a.call(u)}}var l=Qh(e,0,!1,null,null,!1,!1,"",dm);return e._reactRootContainer=l,e[Bn]=l.current,ts(e.nodeType===8?e.parentNode:e),tr(function(){ql(t,l,n,i)}),l}function Jl(e,t,n,i,r){var o=n._reactRootContainer;if(o){var s=o;if(typeof r=="function"){var a=r;r=function(){var l=gl(s);a.call(l)}}ql(t,s,e,r)}else s=uC(n,t,e,r,i);return gl(s)}Pw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=zo(t.pendingLanes);n!==0&&(bh(t,n|1),Ct(t,Be()),!(ke&6)&&(Xr=Be()+500,Ci()))}break;case 13:tr(function(){var i=$n(e,1);if(i!==null){var r=gt();ln(i,e,1,r)}}),Kh(e,1)}};yh=function(e){if(e.tag===13){var t=$n(e,134217728);if(t!==null){var n=gt();ln(t,e,134217728,n)}Kh(e,134217728)}};Aw=function(e){if(e.tag===13){var t=vi(e),n=$n(e,t);if(n!==null){var i=gt();ln(n,e,t,i)}Kh(e,t)}};Iw=function(){return Ce};Nw=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}};Bc=function(e,t,n){switch(t){case"input":if(Lc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=$l(i);if(!r)throw Error(W(90));uw(i),Lc(i,r)}}}break;case"textarea":dw(e,n);break;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}};ww=Yh;bw=tr;var cC={usingClientEntryPoint:!1,Events:[Ps,Sr,$l,gw,vw,Yh]},bo={findFiberByHostInstance:Gi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dC={bundleType:bo.bundleType,version:bo.version,rendererPackageName:bo.rendererPackageName,rendererConfig:bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Un.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_w(e),e===null?null:e.stateNode},findFiberByHostInstance:bo.findFiberByHostInstance||lC,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 oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oa.isDisabled&&oa.supportsFiber)try{Fl=oa.inject(dC),Sn=oa}catch{}}Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cC;Ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ep(t))throw Error(W(200));return aC(e,t,null,n)};Ot.createRoot=function(e,t){if(!ep(e))throw Error(W(299));var n=!1,i="",r=eb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Qh(e,1,!1,null,null,n,!1,i,r),e[Bn]=t.current,ts(e.nodeType===8?e.parentNode:e),new Jh(t)};Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=_w(t),e=e===null?null:e.stateNode,e};Ot.flushSync=function(e){return tr(e)};Ot.hydrate=function(e,t,n){if(!Kl(t))throw Error(W(200));return Jl(null,e,t,!0,n)};Ot.hydrateRoot=function(e,t,n){if(!ep(e))throw Error(W(405));var i=n!=null&&n.hydratedSources||null,r=!1,o="",s=eb;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=J0(t,null,e,1,n??null,r,!1,o,s),e[Bn]=t.current,ts(e),i)for(e=0;e<i.length;e++)n=i[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Ql(t)};Ot.render=function(e,t,n){if(!Kl(t))throw Error(W(200));return Jl(null,e,t,!1,n)};Ot.unmountComponentAtNode=function(e){if(!Kl(e))throw Error(W(40));return e._reactRootContainer?(tr(function(){Jl(null,null,e,!1,function(){e._reactRootContainer=null,e[Bn]=null})}),!0):!1};Ot.unstable_batchedUpdates=Yh;Ot.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Kl(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return Jl(e,t,n,!1,i)};Ot.version="18.3.1-next-f1338f8080-20240426";function tb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tb)}catch(e){console.error(e)}}tb(),tw.exports=Ot;var nb=tw.exports;const hC=Cs(nb);var pC,hm=nb;pC=hm.createRoot,hm.hydrateRoot;function fC(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vC={};function pm(e,t){return(vC.jsx?gC:mC).test(e)}const wC=/[ \t\n\f\r]/g;function bC(e){return typeof e=="object"?e.type==="text"?fm(e.value):!1:fm(e)}function fm(e){return e.replace(wC,"")===""}class Is{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Is.prototype.normal={};Is.prototype.property={};Is.prototype.space=void 0;function ib(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new Is(n,i,t)}function xd(e){return e.toLowerCase()}class Et{constructor(t,n){this.attribute=n,this.property=t}}Et.prototype.attribute="";Et.prototype.booleanish=!1;Et.prototype.boolean=!1;Et.prototype.commaOrSpaceSeparated=!1;Et.prototype.commaSeparated=!1;Et.prototype.defined=!1;Et.prototype.mustUseProperty=!1;Et.prototype.number=!1;Et.prototype.overloadedBoolean=!1;Et.prototype.property="";Et.prototype.spaceSeparated=!1;Et.prototype.space=void 0;let yC=0;const fe=ur(),$e=ur(),_d=ur(),j=ur(),ze=ur(),Fr=ur(),zt=ur();function ur(){return 2**++yC}const kd=Object.freeze(Object.defineProperty({__proto__:null,boolean:fe,booleanish:$e,commaOrSpaceSeparated:zt,commaSeparated:Fr,number:j,overloadedBoolean:_d,spaceSeparated:ze},Symbol.toStringTag,{value:"Module"})),ec=Object.keys(kd);class tp extends Et{constructor(t,n,i,r){let o=-1;if(super(t,n),mm(this,"space",r),typeof i=="number")for(;++o<ec.length;){const s=ec[o];mm(this,ec[o],(i&kd[s])===kd[s])}}}tp.prototype.defined=!0;function mm(e,t,n){n&&(e[t]=n)}function ao(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new tp(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[xd(i)]=i,n[xd(o.attribute)]=i}return new Is(t,n,e.space)}const rb=ao({properties:{ariaActiveDescendant:null,ariaAtomic:$e,ariaAutoComplete:null,ariaBusy:$e,ariaChecked:$e,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:ze,ariaCurrent:null,ariaDescribedBy:ze,ariaDetails:null,ariaDisabled:$e,ariaDropEffect:ze,ariaErrorMessage:null,ariaExpanded:$e,ariaFlowTo:ze,ariaGrabbed:$e,ariaHasPopup:null,ariaHidden:$e,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ze,ariaLevel:j,ariaLive:null,ariaModal:$e,ariaMultiLine:$e,ariaMultiSelectable:$e,ariaOrientation:null,ariaOwns:ze,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:$e,ariaReadOnly:$e,ariaRelevant:null,ariaRequired:$e,ariaRoleDescription:ze,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:$e,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ob(e,t){return t in e?e[t]:t}function sb(e,t){return ob(e,t.toLowerCase())}const xC=ao({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fr,acceptCharset:ze,accessKey:ze,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:ze,autoFocus:fe,autoPlay:fe,blocking:ze,capture:null,charSet:null,checked:fe,cite:null,className:ze,cols:j,colSpan:null,content:null,contentEditable:$e,controls:fe,controlsList:ze,coords:j|Fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:_d,draggable:$e,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:ze,height:j,hidden:_d,high:j,href:null,hrefLang:null,htmlFor:ze,httpEquiv:ze,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:ze,itemRef:ze,itemScope:fe,itemType:ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fe,optimum:j,pattern:null,ping:ze,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:ze,required:fe,reversed:fe,rows:j,rowSpan:j,sandbox:ze,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:$e,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:$e,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ze,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:$e,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fe,disableRemotePlayback:fe,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:sb}),_C=ao({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zt,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fr,g2:Fr,glyphName:Fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:zt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:j,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zt,rev:zt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zt,requiredFeatures:zt,requiredFonts:zt,requiredFormats:zt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:zt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zt,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ob}),ab=ao({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),lb=ao({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sb}),ub=ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),kC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},SC=/[A-Z]/g,gm=/-[a-z]/g,CC=/^data[-\w.:]+$/i;function EC(e,t){const n=xd(t);let i=t,r=Et;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(gm,zC);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!gm.test(o)){let s=o.replace(SC,DC);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=tp}return new r(i,t)}function DC(e){return"-"+e.toLowerCase()}function zC(e){return e.charAt(1).toUpperCase()}const PC=ib([rb,xC,ab,lb,ub],"html"),np=ib([rb,_C,ab,lb,ub],"svg");function AC(e){return e.join(" ").trim()}var ip={},vm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,IC=/\n/g,NC=/^\s*/,TC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,MC=/^:\s*/,LC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,OC=/^[;\s]*/,RC=/^\s+|\s+$/g,VC=`
|
|
41
|
+
`,wm="/",bm="*",Hi="",FC="comment",HC="declaration";function GC(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(f){var v=f.match(IC);v&&(n+=v.length);var b=f.lastIndexOf(VC);i=~b?f.length-b:i+f.length}function o(){var f={line:n,column:i};return function(v){return v.position=new s(f),u(),v}}function s(f){this.start=f,this.end={line:n,column:i},this.source=t.source}s.prototype.content=e;function a(f){var v=new Error(t.source+":"+n+":"+i+": "+f);if(v.reason=f,v.filename=t.source,v.line=n,v.column=i,v.source=e,!t.silent)throw v}function l(f){var v=f.exec(e);if(v){var b=v[0];return r(b),e=e.slice(b.length),v}}function u(){l(NC)}function d(f){var v;for(f=f||[];v=c();)v!==!1&&f.push(v);return f}function c(){var f=o();if(!(wm!=e.charAt(0)||bm!=e.charAt(1))){for(var v=2;Hi!=e.charAt(v)&&(bm!=e.charAt(v)||wm!=e.charAt(v+1));)++v;if(v+=2,Hi===e.charAt(v-1))return a("End of comment missing");var b=e.slice(2,v-2);return i+=2,r(b),e=e.slice(v),i+=2,f({type:FC,comment:b})}}function h(){var f=o(),v=l(TC);if(v){if(c(),!l(MC))return a("property missing ':'");var b=l(LC),m=f({type:HC,property:ym(v[0].replace(vm,Hi)),value:b?ym(b[0].replace(vm,Hi)):Hi});return l(OC),m}}function p(){var f=[];d(f);for(var v;v=h();)v!==!1&&(f.push(v),d(f));return f}return u(),p()}function ym(e){return e?e.replace(RC,Hi):Hi}var BC=GC,$C=Ua&&Ua.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ip,"__esModule",{value:!0});ip.default=jC;const WC=$C(BC);function jC(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,WC.default)(e),r=typeof t=="function";return i.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;r?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var eu={};Object.defineProperty(eu,"__esModule",{value:!0});eu.camelCase=void 0;var UC=/^--[a-zA-Z0-9_-]+$/,YC=/-([a-z])/g,XC=/^[^-]+$/,ZC=/^-(webkit|moz|ms|o|khtml)-/,qC=/^-(ms)-/,QC=function(e){return!e||XC.test(e)||UC.test(e)},KC=function(e,t){return t.toUpperCase()},xm=function(e,t){return"".concat(t,"-")},JC=function(e,t){return t===void 0&&(t={}),QC(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qC,xm):e=e.replace(ZC,xm),e.replace(YC,KC))};eu.camelCase=JC;var eE=Ua&&Ua.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tE=eE(ip),nE=eu;function Sd(e,t){var n={};return!e||typeof e!="string"||(0,tE.default)(e,function(i,r){i&&r&&(n[(0,nE.camelCase)(i,t)]=r)}),n}Sd.default=Sd;var iE=Sd;const rE=Cs(iE),cb=db("end"),rp=db("start");function db(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function oE(e){const t=rp(e),n=cb(e);if(t&&n)return{start:t,end:n}}function Go(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_m(e.position):"start"in e||"end"in e?_m(e):"line"in e||"column"in e?Cd(e):""}function Cd(e){return km(e&&e.line)+":"+km(e&&e.column)}function _m(e){return Cd(e&&e.start)+"-"+Cd(e&&e.end)}function km(e){return e&&typeof e=="number"?e:1}class ht extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?r=t:!o.cause&&t&&(s=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?o.ruleId=i:(o.source=i.slice(0,l),o.ruleId=i.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Go(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ht.prototype.file="";ht.prototype.name="";ht.prototype.reason="";ht.prototype.message="";ht.prototype.stack="";ht.prototype.column=void 0;ht.prototype.line=void 0;ht.prototype.ancestors=void 0;ht.prototype.cause=void 0;ht.prototype.fatal=void 0;ht.prototype.place=void 0;ht.prototype.ruleId=void 0;ht.prototype.source=void 0;const op={}.hasOwnProperty,sE=new Map,aE=/[A-Z]/g,lE=new Set(["table","tbody","thead","tfoot","tr"]),uE=new Set(["td","th"]),hb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cE(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=wE(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=vE(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?np:PC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=pb(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function pb(e,t,n){if(t.type==="element")return dE(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fE(e,t,n);if(t.type==="mdxjsEsm")return pE(e,t);if(t.type==="root")return mE(e,t,n);if(t.type==="text")return gE(e,t)}function dE(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=np,e.schema=r),e.ancestors.push(t);const o=mb(e,t.tagName,!1),s=bE(e,t);let a=ap(e,t);return lE.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!bC(l):!0})),fb(e,s,o,t),sp(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}function hE(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}cs(e,t.position)}function pE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cs(e,t.position)}function fE(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=np,e.schema=r),e.ancestors.push(t);const o=t.name===null?e.Fragment:mb(e,t.name,!0),s=yE(e,t),a=ap(e,t);return fb(e,s,o,t),sp(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}function mE(e,t,n){const i={};return sp(i,ap(e,t)),e.create(t,e.Fragment,i,n)}function gE(e,t){return t.value}function fb(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function sp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vE(e,t,n){return i;function i(r,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function wE(e,t){return n;function n(i,r,o,s){const a=Array.isArray(o.children),l=rp(i);return t(r,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function bE(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&op.call(t.properties,r)){const o=xE(e,r,t.properties[r]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&uE.has(t.tagName)?i=a:n[s]=a}}if(i){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function yE(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cs(e,t.position);else{const r=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const a=i.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else cs(e,t.position);else o=i.value===null?!0:i.value;n[r]=o}return n}function ap(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:sE;for(;++i<t.children.length;){const o=t.children[i];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=r.get(l)||0;s=l+"-"+u,r.set(l,u+1)}}const a=pb(e,o,s);a!==void 0&&n.push(a)}return n}function xE(e,t,n){const i=EC(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?fC(n):AC(n)),i.property==="style"){let r=typeof n=="object"?n:_E(e,String(n));return e.stylePropertyNameCase==="css"&&(r=kE(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?kC[i.property]||i.property:i.attribute,n]}}function _E(e,t){try{return rE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new ht("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=hb+"#cannot-parse-style-attribute",r}}function mb(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let o=-1,s;for(;++o<r.length;){const a=pm(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}i=s}else i=pm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return op.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);cs(e)}function cs(e,t){const n=new ht("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=hb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kE(e){const t={};let n;for(n in e)op.call(e,n)&&(t[SE(n)]=e[n]);return t}function SE(e){let t=e.replace(aE,CE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function CE(e){return"-"+e.toLowerCase()}const tc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},EE={};function lp(e,t){const n=EE,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return gb(e,i,r)}function gb(e,t,n){if(DE(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Sm(e.children,t,n)}return Array.isArray(e)?Sm(e,t,n):""}function Sm(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=gb(e[r],t,n);return i.join("")}function DE(e){return!!(e&&typeof e=="object")}const Cm=document.createElement("i");function up(e){const t="&"+e+";";Cm.innerHTML=t;const n=Cm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tt(e,t,n,i){const r=e.length;let o=0,s;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)s=Array.from(i),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<i.length;)s=i.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Bt(e,t){return e.length>0?(Tt(e,e.length,0,t),e):t}const Em={}.hasOwnProperty;function vb(e){const t={};let n=-1;for(;++n<e.length;)zE(t,e[n]);return t}function zE(e,t){let n;for(n in t){const r=(Em.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Em.call(r,s)||(r[s]=[]);const a=o[s];PE(r[s],Array.isArray(a)?a:a?[a]:[])}}}function PE(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Tt(e,0,0,i)}function wb(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function un(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mt=Ei(/[A-Za-z]/),ct=Ei(/[\dA-Za-z]/),AE=Ei(/[#-'*+\--9=?A-Z^-~]/);function vl(e){return e!==null&&(e<32||e===127)}const Ed=Ei(/\d/),IE=Ei(/[\dA-Fa-f]/),NE=Ei(/[!-/:-@[-`{-~]/);function ue(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function we(e){return e===-2||e===-1||e===32}const tu=Ei(new RegExp("\\p{P}|\\p{S}","u")),nr=Ei(/\s/);function Ei(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lo(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&ct(e.charCodeAt(n+1))&&ct(e.charCodeAt(n+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),r=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+r+1,s=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function _e(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return we(l)?(e.enter(n),a(l)):t(l)}function a(l){return we(l)&&o++<r?(e.consume(l),a):(e.exit(n),t(l))}}const TE={tokenize:ME};function ME(e){const t=e.attempt(this.parser.constructs.contentInitial,i,r);let n;return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),_e(e,t,"linePrefix")}function r(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ue(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const LE={tokenize:OE},Dm={tokenize:RE};function OE(e){const t=this,n=[];let i=0,r,o,s;return a;function a(g){if(i<n.length){const y=n[i];return t.containerState=y[1],e.attempt(y[0].continuation,l,u)(g)}return u(g)}function l(g){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();const y=t.events.length;let k=y,_;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){_=t.events[k][1].end;break}m(i);let E=y;for(;E<t.events.length;)t.events[E][1].end={..._},E++;return Tt(t.events,k+1,0,t.events.slice(y)),t.events.length=E,u(g)}return a(g)}function u(g){if(i===n.length){if(!r)return h(g);if(r.currentConstruct&&r.currentConstruct.concrete)return f(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Dm,d,c)(g)}function d(g){return r&&w(),m(i),h(g)}function c(g){return t.parser.lazy[t.now().line]=i!==n.length,s=t.now().offset,f(g)}function h(g){return t.containerState={},e.attempt(Dm,p,f)(g)}function p(g){return i++,n.push([t.currentConstruct,t.containerState]),h(g)}function f(g){if(g===null){r&&w(),m(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),v(g)}function v(g){if(g===null){b(e.exit("chunkFlow"),!0),m(0),e.consume(g);return}return ue(g)?(e.consume(g),b(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(g),v)}function b(g,y){const k=t.sliceStream(g);if(y&&k.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(k),t.parser.lazy[g.start.line]){let _=r.events.length;for(;_--;)if(r.events[_][1].start.offset<s&&(!r.events[_][1].end||r.events[_][1].end.offset>s))return;const E=t.events.length;let S=E,T,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(T){C=t.events[S][1].end;break}T=!0}for(m(i),_=E;_<t.events.length;)t.events[_][1].end={...C},_++;Tt(t.events,S+1,0,t.events.slice(E)),t.events.length=_}}function m(g){let y=n.length;for(;y-- >g;){const k=n[y];t.containerState=k[1],k[0].exit.call(t,e)}n.length=g}function w(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function RE(e,t,n){return _e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zr(e){if(e===null||De(e)||nr(e))return 1;if(tu(e))return 2}function nu(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const o=e[r].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}const Dd={name:"attention",resolveAll:VE,tokenize:FE};function VE(e,t){let n=-1,i,r,o,s,a,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[i][1].end},h={...e[n][1].start};zm(c,-l),zm(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[i][1].end={...s.start},e[n][1].start={...a.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Bt(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Bt(u,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Bt(u,nu(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Bt(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Bt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Tt(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function FE(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Zr(i);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),d=Zr(l),c=!d||d===2&&r||n.includes(l),h=!r||r===2&&d||n.includes(i);return u._open=!!(o===42?c:c&&(r||!h)),u._close=!!(o===42?h:h&&(d||!c)),t(l)}}function zm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const HE={name:"autolink",tokenize:GE};function GE(e,t,n){let i=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return mt(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||ct(p)?(i=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),i=0,l):(p===43||p===45||p===46||ct(p))&&i++<32?(e.consume(p),a):(i=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||vl(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):AE(p)?(e.consume(p),u):n(p)}function d(p){return ct(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),i=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||ct(p))&&i++<63){const f=p===45?h:c;return e.consume(p),f}return n(p)}}const Ns={partial:!0,tokenize:BE};function BE(e,t,n){return i;function i(o){return we(o)?_e(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||ue(o)?t(o):n(o)}}const bb={continuation:{tokenize:WE},exit:jE,name:"blockQuote",tokenize:$E};function $E(e,t,n){const i=this;return r;function r(s){if(s===62){const a=i.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return we(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function WE(e,t,n){const i=this;return r;function r(s){return we(s)?_e(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(bb,t,n)(s)}}function jE(e){e.exit("blockQuote")}const yb={name:"characterEscape",tokenize:UE};function UE(e,t,n){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return NE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const xb={name:"characterReference",tokenize:YE};function YE(e,t,n){const i=this;let r=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=ct,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=IE,d):(e.enter("characterReferenceValue"),o=7,s=Ed,d(c))}function d(c){if(c===59&&r){const h=e.exit("characterReferenceValue");return s===ct&&!up(i.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&r++<o?(e.consume(c),d):n(c)}}const Pm={partial:!0,tokenize:ZE},Am={concrete:!0,name:"codeFenced",tokenize:XE};function XE(e,t,n){const i=this,r={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(_){return u(_)}function u(_){const E=i.events[i.events.length-1];return o=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(_)}function d(_){return _===a?(s++,e.consume(_),d):s<3?n(_):(e.exit("codeFencedFenceSequence"),we(_)?_e(e,c,"whitespace")(_):c(_))}function c(_){return _===null||ue(_)?(e.exit("codeFencedFence"),i.interrupt?t(_):e.check(Pm,v,y)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||ue(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(_)):we(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_e(e,p,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),h)}function p(_){return _===null||ue(_)?c(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===null||ue(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(_)):_===96&&_===a?n(_):(e.consume(_),f)}function v(_){return e.attempt(r,y,b)(_)}function b(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),m}function m(_){return o>0&&we(_)?_e(e,w,"linePrefix",o+1)(_):w(_)}function w(_){return _===null||ue(_)?e.check(Pm,v,y)(_):(e.enter("codeFlowValue"),g(_))}function g(_){return _===null||ue(_)?(e.exit("codeFlowValue"),w(_)):(e.consume(_),g)}function y(_){return e.exit("codeFenced"),t(_)}function k(_,E,S){let T=0;return C;function C(P){return _.enter("lineEnding"),_.consume(P),_.exit("lineEnding"),I}function I(P){return _.enter("codeFencedFence"),we(P)?_e(_,L,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):L(P)}function L(P){return P===a?(_.enter("codeFencedFenceSequence"),V(P)):S(P)}function V(P){return P===a?(T++,_.consume(P),V):T>=s?(_.exit("codeFencedFenceSequence"),we(P)?_e(_,D,"whitespace")(P):D(P)):S(P)}function D(P){return P===null||ue(P)?(_.exit("codeFencedFence"),E(P)):S(P)}}}function ZE(e,t,n){const i=this;return r;function r(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return i.parser.lazy[i.now().line]?n(s):t(s)}}const nc={name:"codeIndented",tokenize:QE},qE={partial:!0,tokenize:KE};function QE(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),_e(e,o,"linePrefix",5)(u)}function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ue(u)?e.attempt(qE,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ue(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function KE(e,t,n){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):_e(e,o,"linePrefix",5)(s)}function o(s){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ue(s)?r(s):n(s)}}const JE={name:"codeText",previous:tD,resolve:eD,tokenize:nD};function eD(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)r===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(r=i):(i===t||e[i][1].type==="lineEnding")&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),t-=i-r-2,i=r+2),r=void 0);return e}function tD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nD(e,t,n){let i=0,r,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),i++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),r=0,d(c)):ue(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ue(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function d(c){return c===96?(e.consume(c),r++,d):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class iD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&yo(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);yo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);yo(this.left,n.reverse())}}}function yo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _b(e){const t={};let n=-1,i,r,o,s,a,l,u;const d=new iD(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,rD(d,n)),n=t[n],u=!0);else if(i[1]._container){for(o=n,r=void 0;o--;)if(s=d.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(r&&(d.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;r&&(i[1].end={...d.get(r)[1].start},a=d.slice(r,n),a.unshift(i),d.splice(r,n-r+1,a))}}return Tt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function rD(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const o=[];let s=n._tokenizer;s||(s=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let d,c,h=-1,p=n,f=0,v=0;const b=[v];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(d=i.sliceStream(p),p.next||d.push(null),c&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(v=h+1,b.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),h=b.length;h--;){const m=a.slice(b[h],b[h+1]),w=o.pop();l.push([w,w+m.length-1]),e.splice(w,2,m)}for(l.reverse(),h=-1;++h<l.length;)u[f+l[h][0]]=f+l[h][1],f+=l[h][1]-l[h][0]-1;return u}const oD={resolve:aD,tokenize:lD},sD={partial:!0,tokenize:uD};function aD(e){return _b(e),e}function lD(e,t){let n;return i;function i(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?o(a):ue(a)?e.check(sD,s,o)(a):(e.consume(a),r)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function uD(e,t,n){const i=this;return r;function r(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),_e(e,o,"linePrefix")}function o(s){if(s===null||ue(s))return n(s);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(i.parser.constructs.flow,n,t)(s)}}function kb(e,t,n,i,r,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return c;function c(m){return m===60?(e.enter(i),e.enter(r),e.enter(o),e.consume(m),e.exit(o),h):m===null||m===32||m===41||vl(m)?n(m):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(m))}function h(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(a),h(m)):m===null||m===60||ue(m)?n(m):(e.consume(m),m===92?f:p)}function f(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function v(m){return!d&&(m===null||m===41||De(m))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(m)):d<u&&m===40?(e.consume(m),d++,v):m===41?(e.consume(m),d--,v):m===null||m===32||m===40||vl(m)?n(m):(e.consume(m),m===92?b:v)}function b(m){return m===40||m===41||m===92?(e.consume(m),v):v(m)}}function Sb(e,t,n,i,r,o){const s=this;let a=0,l;return u;function u(p){return e.enter(i),e.enter(r),e.consume(p),e.exit(r),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(i),t):ue(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||ue(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!we(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function Cb(e,t,n,i,r,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ue(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),_e(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||ue(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:d)}function c(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Bo(e,t){let n;return i;function i(r){return ue(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):we(r)?_e(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const cD={name:"definition",tokenize:hD},dD={partial:!0,tokenize:pD};function hD(e,t,n){const i=this;let r;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Sb.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return r=un(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return De(p)?Bo(e,u)(p):u(p)}function u(p){return kb(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(dD,c,c)(p)}function c(p){return we(p)?_e(e,h,"whitespace")(p):h(p)}function h(p){return p===null||ue(p)?(e.exit("definition"),i.parser.defined.push(r),t(p)):n(p)}}function pD(e,t,n){return i;function i(a){return De(a)?Bo(e,r)(a):n(a)}function r(a){return Cb(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return we(a)?_e(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ue(a)?t(a):n(a)}}const fD={name:"hardBreakEscape",tokenize:mD};function mD(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const gD={name:"headingAtx",resolve:vD,tokenize:wD};function vD(e,t){let n=e.length-2,i=3,r,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Tt(e,i,n-i+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function wD(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&i++<6?(e.consume(d),s):d===null||De(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ue(d)?(e.exit("atxHeading"),t(d)):we(d)?_e(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||De(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const bD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Im=["pre","script","style","textarea"],yD={concrete:!0,name:"htmlFlow",resolveTo:kD,tokenize:SD},xD={partial:!0,tokenize:ED},_D={partial:!0,tokenize:CD};function kD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SD(e,t,n){const i=this;let r,o,s,a,l;return u;function u(z){return d(z)}function d(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),c}function c(z){return z===33?(e.consume(z),h):z===47?(e.consume(z),o=!0,v):z===63?(e.consume(z),r=3,i.interrupt?t:x):mt(z)?(e.consume(z),s=String.fromCharCode(z),b):n(z)}function h(z){return z===45?(e.consume(z),r=2,p):z===91?(e.consume(z),r=5,a=0,f):mt(z)?(e.consume(z),r=4,i.interrupt?t:x):n(z)}function p(z){return z===45?(e.consume(z),i.interrupt?t:x):n(z)}function f(z){const X="CDATA[";return z===X.charCodeAt(a++)?(e.consume(z),a===X.length?i.interrupt?t:L:f):n(z)}function v(z){return mt(z)?(e.consume(z),s=String.fromCharCode(z),b):n(z)}function b(z){if(z===null||z===47||z===62||De(z)){const X=z===47,q=s.toLowerCase();return!X&&!o&&Im.includes(q)?(r=1,i.interrupt?t(z):L(z)):bD.includes(s.toLowerCase())?(r=6,X?(e.consume(z),m):i.interrupt?t(z):L(z)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(z):o?w(z):g(z))}return z===45||ct(z)?(e.consume(z),s+=String.fromCharCode(z),b):n(z)}function m(z){return z===62?(e.consume(z),i.interrupt?t:L):n(z)}function w(z){return we(z)?(e.consume(z),w):C(z)}function g(z){return z===47?(e.consume(z),C):z===58||z===95||mt(z)?(e.consume(z),y):we(z)?(e.consume(z),g):C(z)}function y(z){return z===45||z===46||z===58||z===95||ct(z)?(e.consume(z),y):k(z)}function k(z){return z===61?(e.consume(z),_):we(z)?(e.consume(z),k):g(z)}function _(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),l=z,E):we(z)?(e.consume(z),_):S(z)}function E(z){return z===l?(e.consume(z),l=null,T):z===null||ue(z)?n(z):(e.consume(z),E)}function S(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||De(z)?k(z):(e.consume(z),S)}function T(z){return z===47||z===62||we(z)?g(z):n(z)}function C(z){return z===62?(e.consume(z),I):n(z)}function I(z){return z===null||ue(z)?L(z):we(z)?(e.consume(z),I):n(z)}function L(z){return z===45&&r===2?(e.consume(z),A):z===60&&r===1?(e.consume(z),O):z===62&&r===4?(e.consume(z),F):z===63&&r===3?(e.consume(z),x):z===93&&r===5?(e.consume(z),M):ue(z)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(xD,H,V)(z)):z===null||ue(z)?(e.exit("htmlFlowData"),V(z)):(e.consume(z),L)}function V(z){return e.check(_D,D,H)(z)}function D(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),P}function P(z){return z===null||ue(z)?V(z):(e.enter("htmlFlowData"),L(z))}function A(z){return z===45?(e.consume(z),x):L(z)}function O(z){return z===47?(e.consume(z),s="",N):L(z)}function N(z){if(z===62){const X=s.toLowerCase();return Im.includes(X)?(e.consume(z),F):L(z)}return mt(z)&&s.length<8?(e.consume(z),s+=String.fromCharCode(z),N):L(z)}function M(z){return z===93?(e.consume(z),x):L(z)}function x(z){return z===62?(e.consume(z),F):z===45&&r===2?(e.consume(z),x):L(z)}function F(z){return z===null||ue(z)?(e.exit("htmlFlowData"),H(z)):(e.consume(z),F)}function H(z){return e.exit("htmlFlow"),t(z)}}function CD(e,t,n){const i=this;return r;function r(s){return ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return i.parser.lazy[i.now().line]?n(s):t(s)}}function ED(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Ns,t,n)}}const DD={name:"htmlText",tokenize:zD};function zD(e,t,n){const i=this;let r,o,s;return a;function a(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),k):x===63?(e.consume(x),g):mt(x)?(e.consume(x),S):n(x)}function u(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),o=0,f):mt(x)?(e.consume(x),w):n(x)}function d(x){return x===45?(e.consume(x),p):n(x)}function c(x){return x===null?n(x):x===45?(e.consume(x),h):ue(x)?(s=c,O(x)):(e.consume(x),c)}function h(x){return x===45?(e.consume(x),p):c(x)}function p(x){return x===62?A(x):x===45?h(x):c(x)}function f(x){const F="CDATA[";return x===F.charCodeAt(o++)?(e.consume(x),o===F.length?v:f):n(x)}function v(x){return x===null?n(x):x===93?(e.consume(x),b):ue(x)?(s=v,O(x)):(e.consume(x),v)}function b(x){return x===93?(e.consume(x),m):v(x)}function m(x){return x===62?A(x):x===93?(e.consume(x),m):v(x)}function w(x){return x===null||x===62?A(x):ue(x)?(s=w,O(x)):(e.consume(x),w)}function g(x){return x===null?n(x):x===63?(e.consume(x),y):ue(x)?(s=g,O(x)):(e.consume(x),g)}function y(x){return x===62?A(x):g(x)}function k(x){return mt(x)?(e.consume(x),_):n(x)}function _(x){return x===45||ct(x)?(e.consume(x),_):E(x)}function E(x){return ue(x)?(s=E,O(x)):we(x)?(e.consume(x),E):A(x)}function S(x){return x===45||ct(x)?(e.consume(x),S):x===47||x===62||De(x)?T(x):n(x)}function T(x){return x===47?(e.consume(x),A):x===58||x===95||mt(x)?(e.consume(x),C):ue(x)?(s=T,O(x)):we(x)?(e.consume(x),T):A(x)}function C(x){return x===45||x===46||x===58||x===95||ct(x)?(e.consume(x),C):I(x)}function I(x){return x===61?(e.consume(x),L):ue(x)?(s=I,O(x)):we(x)?(e.consume(x),I):T(x)}function L(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),r=x,V):ue(x)?(s=L,O(x)):we(x)?(e.consume(x),L):(e.consume(x),D)}function V(x){return x===r?(e.consume(x),r=void 0,P):x===null?n(x):ue(x)?(s=V,O(x)):(e.consume(x),V)}function D(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||De(x)?T(x):(e.consume(x),D)}function P(x){return x===47||x===62||De(x)?T(x):n(x)}function A(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function O(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),N}function N(x){return we(x)?_e(e,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):M(x)}function M(x){return e.enter("htmlTextData"),s(x)}}const cp={name:"labelEnd",resolveAll:ND,resolveTo:TD,tokenize:MD},PD={tokenize:LD},AD={tokenize:OD},ID={tokenize:RD};function ND(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",t+=r}}return e.length!==n.length&&Tt(e,0,e.length,n),e}function TD(e,t){let n=e.length,i=0,r,o,s,a;for(;n--;)if(r=e[n][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Bt(a,e.slice(o+1,o+i+3)),a=Bt(a,[["enter",d,t]]),a=Bt(a,nu(t.parser.constructs.insideSpan.null,e.slice(o+i+4,s-3),t)),a=Bt(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=Bt(a,e.slice(s+1)),a=Bt(a,[["exit",l,t]]),Tt(e,o,e.length,a),e}function MD(e,t,n){const i=this;let r=i.events.length,o,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){o=i.events[r][1];break}return a;function a(h){return o?o._inactive?c(h):(s=i.parser.defined.includes(un(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(PD,d,s?d:c)(h):h===91?e.attempt(AD,d,s?u:c)(h):s?d(h):c(h)}function u(h){return e.attempt(ID,d,c)(h)}function d(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function LD(e,t,n){return i;function i(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),r}function r(c){return De(c)?Bo(e,o)(c):o(c)}function o(c){return c===41?d(c):kb(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?Bo(e,l)(c):d(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Cb(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function u(c){return De(c)?Bo(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function OD(e,t,n){const i=this;return r;function r(a){return Sb.call(i,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return i.parser.defined.includes(un(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function RD(e,t,n){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const VD={name:"labelStartImage",resolveAll:cp.resolveAll,tokenize:FD};function FD(e,t,n){const i=this;return r;function r(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const HD={name:"labelStartLink",resolveAll:cp.resolveAll,tokenize:GD};function GD(e,t,n){const i=this;return r;function r(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(s):t(s)}}const ic={name:"lineEnding",tokenize:BD};function BD(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),_e(e,t,"linePrefix")}}const Fa={name:"thematicBreak",tokenize:$D};function $D(e,t,n){let i=0,r;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return r=u,a(u)}function a(u){return u===r?(e.enter("thematicBreakSequence"),l(u)):i>=3&&(u===null||ue(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===r?(e.consume(u),i++,l):(e.exit("thematicBreakSequence"),we(u)?_e(e,a,"whitespace")(u):a(u))}}const bt={continuation:{tokenize:YD},exit:ZD,name:"list",tokenize:UD},WD={partial:!0,tokenize:qD},jD={partial:!0,tokenize:XD};function UD(e,t,n){const i=this,r=i.events[i.events.length-1];let o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(p){const f=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(f==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:Ed(p)){if(i.containerState.type||(i.containerState.type=f,e.enter(f,{_container:!0})),f==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Fa,n,u)(p):u(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ed(p)&&++s<10?(e.consume(p),l):(!i.interrupt||s<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(Ns,i.interrupt?n:d,e.attempt(WD,h,c))}function d(p){return i.containerState.initialBlankLine=!0,o++,h(p)}function c(p){return we(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function YD(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ns,r,o);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,_e(e,t,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!we(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(jD,t,s)(a))}function s(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,_e(e,e.attempt(bt,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function XD(e,t,n){const i=this;return _e(e,r,"listItemIndent",i.containerState.size+1);function r(o){const s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?t(o):n(o)}}function ZD(e){e.exit(this.containerState.type)}function qD(e,t,n){const i=this;return _e(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){const s=i.events[i.events.length-1];return!we(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Nm={name:"setextUnderline",resolveTo:QD,tokenize:KD};function QD(e,t){let n=e.length,i,r,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",s,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=s,e.push(["exit",s,t]),e}function KD(e,t,n){const i=this;let r;return o;function o(u){let d=i.events.length,c;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){c=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||c)?(e.enter("setextHeadingLine"),r=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===r?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),we(u)?_e(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ue(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const JD={tokenize:ez};function ez(e){const t=this,n=e.attempt(Ns,i,e.attempt(this.parser.constructs.flowInitial,r,_e(e,e.attempt(this.parser.constructs.flow,r,e.attempt(oD,r)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tz={resolveAll:Db()},nz=Eb("string"),iz=Eb("text");function Eb(e){return{resolveAll:Db(e==="text"?rz:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],o=n.attempt(r,s,a);return s;function s(d){return u(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const c=r[d];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function Db(e){return t;function t(n,i){let r=-1,o;for(;++r<=n.length;)o===void 0?n[r]&&n[r][1].type==="data"&&(o=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==o+2&&(n[o][1].end=n[r-1][1].end,n.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(n,i):n}}function rz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],r=t.sliceStream(i);let o=r.length,s=-1,a=0,l;for(;o--;){const u=r[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...u.start},i.start.offset===i.end.offset?Object.assign(i,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const oz={42:bt,43:bt,45:bt,48:bt,49:bt,50:bt,51:bt,52:bt,53:bt,54:bt,55:bt,56:bt,57:bt,62:bb},sz={91:cD},az={[-2]:nc,[-1]:nc,32:nc},lz={35:gD,42:Fa,45:[Nm,Fa],60:yD,61:Nm,95:Fa,96:Am,126:Am},uz={38:xb,92:yb},cz={[-5]:ic,[-4]:ic,[-3]:ic,33:VD,38:xb,42:Dd,60:[HE,DD],91:HD,92:[fD,yb],93:cp,95:Dd,96:JE},dz={null:[Dd,tz]},hz={null:[42,95]},pz={null:[]},fz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hz,contentInitial:sz,disable:pz,document:oz,flow:lz,flowInitial:az,insideSpan:dz,string:uz,text:cz},Symbol.toStringTag,{value:"Module"}));function mz(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},o=[];let s=[],a=[];const l={attempt:E(k),check:E(_),consume:w,enter:g,exit:y,interrupt:E(_,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:f,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:c};let d=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(I){return s=Bt(s,I),b(),s[s.length-1]!==null?[]:(S(t,0),u.events=nu(o,u.events,u),u.events)}function h(I,L){return vz(p(I),L)}function p(I){return gz(s,I)}function f(){const{_bufferIndex:I,_index:L,line:V,column:D,offset:P}=i;return{_bufferIndex:I,_index:L,line:V,column:D,offset:P}}function v(I){r[I.line]=I.column,C()}function b(){let I;for(;i._index<s.length;){const L=s[i._index];if(typeof L=="string")for(I=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===I&&i._bufferIndex<L.length;)m(L.charCodeAt(i._bufferIndex));else m(L)}}function m(I){d=d(I)}function w(I){ue(I)?(i.line++,i.column=1,i.offset+=I===-3?2:1,C()):I!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),u.previous=I}function g(I,L){const V=L||{};return V.type=I,V.start=f(),u.events.push(["enter",V,u]),a.push(V),V}function y(I){const L=a.pop();return L.end=f(),u.events.push(["exit",L,u]),L}function k(I,L){S(I,L.from)}function _(I,L){L.restore()}function E(I,L){return V;function V(D,P,A){let O,N,M,x;return Array.isArray(D)?H(D):"tokenize"in D?H([D]):F(D);function F(U){return K;function K(Y){const Q=Y!==null&&U[Y],de=Y!==null&&U.null,le=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(de)?de:de?[de]:[]];return H(le)(Y)}}function H(U){return O=U,N=0,U.length===0?A:z(U[N])}function z(U){return K;function K(Y){return x=T(),M=U,U.partial||(u.currentConstruct=U),U.name&&u.parser.constructs.disable.null.includes(U.name)?q():U.tokenize.call(L?Object.assign(Object.create(u),L):u,l,X,q)(Y)}}function X(U){return I(M,x),P}function q(U){return x.restore(),++N<O.length?z(O[N]):A}}}function S(I,L){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&Tt(u.events,L,u.events.length-L,I.resolve(u.events.slice(L),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function T(){const I=f(),L=u.previous,V=u.currentConstruct,D=u.events.length,P=Array.from(a);return{from:D,restore:A};function A(){i=I,u.previous=L,u.currentConstruct=V,u.events.length=D,a=P,C()}}function C(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function gz(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex;let s;if(n===r)s=[e[n].slice(i,o)];else{if(s=e.slice(n,r),i>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(i):s.shift()}o>0&&s.push(e[r].slice(0,o))}return s}function vz(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
42
42
|
`;break}case-3:{s=`\r
|
|
43
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&r)continue;s=" ";break}default:s=String.fromCharCode(o)}r=o===-2,i.push(s)}return i.join("")}function wz(e){const i={constructs:gb([fz,...(e||{}).extensions||[]]),content:r(TE),defined:[],document:r(LE),flow:r(JD),lazy:{},string:r(nz),text:r(iz)};return i;function r(o){return s;function s(a){return mz(i,o,a)}}}function bz(e){for(;!xb(e););return e}const Nm=/[\0\t\n\r]/g;function yz(){let e=1,t="",n=!0,i;return r;function r(o,s,a){const l=[];let u,d,c,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Nm.lastIndex=c,u=Nm.exec(o),h=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(h),!u){t=o.slice(c);break}if(p===10&&c===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:i=!0,e=1}c=h+1}return a&&(i&&l.push(-5),t&&l.push(t),l.push(null)),l}}const xz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _z(e){return e.replace(xz,kz)}function kz(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),o=r===120||r===88;return vb(n.slice(o?2:1),o?16:10)}return up(n)||e}const Db={}.hasOwnProperty;function Sz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Cz(n)(bz(wz(n).document().write(yz()(e,t,!0))))}function Cz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Vt),autolinkProtocol:T,autolinkEmail:T,atxHeading:o(Ee),blockQuote:o(de),characterEscape:T,characterReference:T,codeFenced:o(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(le,s),codeText:o(se,s),codeTextData:T,data:T,codeFlowValue:T,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(Xe,s),htmlFlowData:T,htmlText:o(Xe,s),htmlTextData:T,image:o(fn),label:s,link:o(Vt),listItem:o(Pi),listItemValue:h,listOrdered:o(mn,c),listUnordered:o(mn),paragraph:o(Ai),reference:z,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ee),strong:o(Ii),thematicBreak:o(hr)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:Q,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:U,characterReference:K,codeFenced:l(b),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:C,codeIndented:l(m),codeText:l(P),codeTextData:C,data:C,definition:l(),definitionDestinationString:y,definitionLabelString:w,definitionTitleString:g,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(V),htmlFlowData:C,htmlText:l(D),htmlTextData:C,image:l(O),label:M,labelText:N,lineEnding:I,link:l(A),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:X,resourceDestinationString:x,resourceTitleString:F,resource:H,setextHeading:l(S),setextHeadingLineSequence:E,setextHeadingText:_,strong:l(),thematicBreak:l()}};zb(t,(e||{}).mdastExtensions||[]);const n={};return i;function i($){let Z={type:"root",children:[]};const he={stack:[Z],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},ve=[];let Se=-1;for(;++Se<$.length;)if($[Se][1].type==="listOrdered"||$[Se][1].type==="listUnordered")if($[Se][0]==="enter")ve.push(Se);else{const Dt=ve.pop();Se=r($,Dt,Se)}for(Se=-1;++Se<$.length;){const Dt=t[$[Se][0]];Db.call(Dt,$[Se][1].type)&&Dt[$[Se][1].type].call(Object.assign({sliceSerialize:$[Se][2].sliceSerialize},he),$[Se][1])}if(he.tokenStack.length>0){const Dt=he.tokenStack[he.tokenStack.length-1];(Dt[1]||Tm).call(he,void 0,Dt[0])}for(Z.position={start:Qn($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Qn($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)Z=t.transforms[Se](Z)||Z;return Z}function r($,Z,he){let ve=Z-1,Se=-1,Dt=!1,In,Xt,Ni,Ti;for(;++ve<=he;){const pt=$[ve];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Se++:Se--,Ti=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(In&&!Ti&&!Se&&!Ni&&(Ni=ve),Ti=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ti=void 0}if(!Se&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Se===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(In){let Zn=ve;for(Xt=void 0;Zn--;){const Zt=$[Zn];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;Xt&&($[Xt][1].type="lineEndingBlank",Dt=!0),Zt[1].type="lineEnding",Xt=Zn}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}Ni&&(!Xt||Ni<Xt)&&(In._spread=!0),In.end=Object.assign({},Xt?$[Xt][1].start:pt[1].end),$.splice(Xt||ve,0,["exit",In,pt[2]]),ve++,he++}if(pt[1].type==="listItemPrefix"){const Zn={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};In=Zn,$.splice(ve,0,["enter",Zn,pt[2]]),ve++,he++,Ni=void 0,Ti=!0}}}return $[Z][1]._spread=Dt,he}function o($,Z){return he;function he(ve){a.call(this,$(ve),ve),Z&&Z.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,Z,he){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([Z,he||void 0]),$.position={start:Qn(Z.start),end:void 0}}function l($){return Z;function Z(he){$&&$.call(this,he),u.call(this,he)}}function u($,Z){const he=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==$.type&&(Z?Z.call(this,$,ve[0]):(ve[1]||Tm).call(this,$,ve[0]));else throw new Error("Cannot close `"+$.type+"` ("+Go({start:$.start,end:$.end})+"): it’s not open");he.position.end=Qn($.end)}function d(){return lp(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h($){if(this.data.expectingFirstListItemValue){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function p(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=$}function f(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=$}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$.replace(/(\r?\n|\r)$/g,"")}function w($){const Z=this.resume(),he=this.stack[this.stack.length-1];he.label=Z,he.identifier=un(this.sliceSerialize($)).toLowerCase()}function g(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.title=$}function y(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.url=$}function k($){const Z=this.stack[this.stack.length-1];if(!Z.depth){const he=this.sliceSerialize($).length;Z.depth=he}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function E($){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function T($){const he=this.stack[this.stack.length-1].children;let ve=he[he.length-1];(!ve||ve.type!=="text")&&(ve=co(),ve.position={start:Qn($.start),end:void 0},he.push(ve)),this.stack.push(ve)}function C($){const Z=this.stack.pop();Z.value+=this.sliceSerialize($),Z.position.end=Qn($.end)}function I($){const Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const he=Z.children[Z.children.length-1];he.position.end=Qn($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(T.call(this,$),C.call(this,$))}function L(){this.data.atHardBreak=!0}function V(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$}function D(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$}function P(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$}function A(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Z,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function O(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Z,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function N($){const Z=this.sliceSerialize($),he=this.stack[this.stack.length-2];he.label=_z(Z),he.identifier=un(Z).toLowerCase()}function M(){const $=this.stack[this.stack.length-1],Z=this.resume(),he=this.stack[this.stack.length-1];if(this.data.inReference=!0,he.type==="link"){const ve=$.children;he.children=ve}else he.alt=Z}function x(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.url=$}function F(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.title=$}function H(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function X($){const Z=this.resume(),he=this.stack[this.stack.length-1];he.label=Z,he.identifier=un(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function q($){this.data.characterReferenceType=$.type}function U($){const Z=this.sliceSerialize($),he=this.data.characterReferenceType;let ve;he?(ve=vb(Z,he==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=up(Z);const Se=this.stack[this.stack.length-1];Se.value+=ve}function K($){const Z=this.stack.pop();Z.position.end=Qn($.end)}function Y($){C.call(this,$);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize($)}function Q($){C.call(this,$);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize($)}function de(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function Ee(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function fn(){return{type:"image",title:null,url:"",alt:null}}function Vt(){return{type:"link",title:null,url:"",children:[]}}function mn($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function Pi($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function Ai(){return{type:"paragraph",children:[]}}function Ii(){return{type:"strong",children:[]}}function co(){return{type:"text",value:""}}function hr(){return{type:"thematicBreak"}}}function Qn(e){return{line:e.line,column:e.column,offset:e.offset}}function zb(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?zb(e,i):Ez(e,i)}}function Ez(e,t){let n;for(n in t)if(Db.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Tm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Go({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Go({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Go({start:t.start,end:t.end})+") is still open")}function Dz(e){const t=this;t.parser=n;function n(i){return Sz(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zz(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Pz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
43
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&r)continue;s=" ";break}default:s=String.fromCharCode(o)}r=o===-2,i.push(s)}return i.join("")}function wz(e){const i={constructs:vb([fz,...(e||{}).extensions||[]]),content:r(TE),defined:[],document:r(LE),flow:r(JD),lazy:{},string:r(nz),text:r(iz)};return i;function r(o){return s;function s(a){return mz(i,o,a)}}}function bz(e){for(;!_b(e););return e}const Tm=/[\0\t\n\r]/g;function yz(){let e=1,t="",n=!0,i;return r;function r(o,s,a){const l=[];let u,d,c,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Tm.lastIndex=c,u=Tm.exec(o),h=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(h),!u){t=o.slice(c);break}if(p===10&&c===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:i=!0,e=1}c=h+1}return a&&(i&&l.push(-5),t&&l.push(t),l.push(null)),l}}const xz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _z(e){return e.replace(xz,kz)}function kz(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),o=r===120||r===88;return wb(n.slice(o?2:1),o?16:10)}return up(n)||e}const zb={}.hasOwnProperty;function Sz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Cz(n)(bz(wz(n).document().write(yz()(e,t,!0))))}function Cz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Vt),autolinkProtocol:T,autolinkEmail:T,atxHeading:o(Ee),blockQuote:o(de),characterEscape:T,characterReference:T,codeFenced:o(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(le,s),codeText:o(se,s),codeTextData:T,data:T,codeFlowValue:T,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(Xe,s),htmlFlowData:T,htmlText:o(Xe,s),htmlTextData:T,image:o(fn),label:s,link:o(Vt),listItem:o(Pi),listItemValue:h,listOrdered:o(mn,c),listUnordered:o(mn),paragraph:o(Ai),reference:z,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ee),strong:o(Ii),thematicBreak:o(hr)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:Q,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:U,characterReference:K,codeFenced:l(b),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:C,codeIndented:l(m),codeText:l(P),codeTextData:C,data:C,definition:l(),definitionDestinationString:y,definitionLabelString:w,definitionTitleString:g,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(V),htmlFlowData:C,htmlText:l(D),htmlTextData:C,image:l(O),label:M,labelText:N,lineEnding:I,link:l(A),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:X,resourceDestinationString:x,resourceTitleString:F,resource:H,setextHeading:l(S),setextHeadingLineSequence:E,setextHeadingText:_,strong:l(),thematicBreak:l()}};Pb(t,(e||{}).mdastExtensions||[]);const n={};return i;function i($){let Z={type:"root",children:[]};const he={stack:[Z],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},ve=[];let Se=-1;for(;++Se<$.length;)if($[Se][1].type==="listOrdered"||$[Se][1].type==="listUnordered")if($[Se][0]==="enter")ve.push(Se);else{const Dt=ve.pop();Se=r($,Dt,Se)}for(Se=-1;++Se<$.length;){const Dt=t[$[Se][0]];zb.call(Dt,$[Se][1].type)&&Dt[$[Se][1].type].call(Object.assign({sliceSerialize:$[Se][2].sliceSerialize},he),$[Se][1])}if(he.tokenStack.length>0){const Dt=he.tokenStack[he.tokenStack.length-1];(Dt[1]||Mm).call(he,void 0,Dt[0])}for(Z.position={start:Qn($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Qn($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)Z=t.transforms[Se](Z)||Z;return Z}function r($,Z,he){let ve=Z-1,Se=-1,Dt=!1,In,Xt,Ni,Ti;for(;++ve<=he;){const pt=$[ve];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Se++:Se--,Ti=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(In&&!Ti&&!Se&&!Ni&&(Ni=ve),Ti=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ti=void 0}if(!Se&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Se===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(In){let Zn=ve;for(Xt=void 0;Zn--;){const Zt=$[Zn];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;Xt&&($[Xt][1].type="lineEndingBlank",Dt=!0),Zt[1].type="lineEnding",Xt=Zn}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}Ni&&(!Xt||Ni<Xt)&&(In._spread=!0),In.end=Object.assign({},Xt?$[Xt][1].start:pt[1].end),$.splice(Xt||ve,0,["exit",In,pt[2]]),ve++,he++}if(pt[1].type==="listItemPrefix"){const Zn={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};In=Zn,$.splice(ve,0,["enter",Zn,pt[2]]),ve++,he++,Ni=void 0,Ti=!0}}}return $[Z][1]._spread=Dt,he}function o($,Z){return he;function he(ve){a.call(this,$(ve),ve),Z&&Z.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,Z,he){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([Z,he||void 0]),$.position={start:Qn(Z.start),end:void 0}}function l($){return Z;function Z(he){$&&$.call(this,he),u.call(this,he)}}function u($,Z){const he=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==$.type&&(Z?Z.call(this,$,ve[0]):(ve[1]||Mm).call(this,$,ve[0]));else throw new Error("Cannot close `"+$.type+"` ("+Go({start:$.start,end:$.end})+"): it’s not open");he.position.end=Qn($.end)}function d(){return lp(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h($){if(this.data.expectingFirstListItemValue){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function p(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=$}function f(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=$}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$.replace(/(\r?\n|\r)$/g,"")}function w($){const Z=this.resume(),he=this.stack[this.stack.length-1];he.label=Z,he.identifier=un(this.sliceSerialize($)).toLowerCase()}function g(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.title=$}function y(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.url=$}function k($){const Z=this.stack[this.stack.length-1];if(!Z.depth){const he=this.sliceSerialize($).length;Z.depth=he}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function E($){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function T($){const he=this.stack[this.stack.length-1].children;let ve=he[he.length-1];(!ve||ve.type!=="text")&&(ve=co(),ve.position={start:Qn($.start),end:void 0},he.push(ve)),this.stack.push(ve)}function C($){const Z=this.stack.pop();Z.value+=this.sliceSerialize($),Z.position.end=Qn($.end)}function I($){const Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const he=Z.children[Z.children.length-1];he.position.end=Qn($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(T.call(this,$),C.call(this,$))}function L(){this.data.atHardBreak=!0}function V(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$}function D(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$}function P(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.value=$}function A(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Z,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function O(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Z,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function N($){const Z=this.sliceSerialize($),he=this.stack[this.stack.length-2];he.label=_z(Z),he.identifier=un(Z).toLowerCase()}function M(){const $=this.stack[this.stack.length-1],Z=this.resume(),he=this.stack[this.stack.length-1];if(this.data.inReference=!0,he.type==="link"){const ve=$.children;he.children=ve}else he.alt=Z}function x(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.url=$}function F(){const $=this.resume(),Z=this.stack[this.stack.length-1];Z.title=$}function H(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function X($){const Z=this.resume(),he=this.stack[this.stack.length-1];he.label=Z,he.identifier=un(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function q($){this.data.characterReferenceType=$.type}function U($){const Z=this.sliceSerialize($),he=this.data.characterReferenceType;let ve;he?(ve=wb(Z,he==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=up(Z);const Se=this.stack[this.stack.length-1];Se.value+=ve}function K($){const Z=this.stack.pop();Z.position.end=Qn($.end)}function Y($){C.call(this,$);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize($)}function Q($){C.call(this,$);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize($)}function de(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function Ee(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function fn(){return{type:"image",title:null,url:"",alt:null}}function Vt(){return{type:"link",title:null,url:"",children:[]}}function mn($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function Pi($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function Ai(){return{type:"paragraph",children:[]}}function Ii(){return{type:"strong",children:[]}}function co(){return{type:"text",value:""}}function hr(){return{type:"thematicBreak"}}}function Qn(e){return{line:e.line,column:e.column,offset:e.offset}}function Pb(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Pb(e,i):Ez(e,i)}}function Ez(e,t){let n;for(n in t)if(zb.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Mm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Go({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Go({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Go({start:t.start,end:t.end})+") is still open")}function Dz(e){const t=this;t.parser=n;function n(i){return Sz(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zz(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Pz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
44
44
|
`}]}function Az(e,t){const n=t.value?t.value+`
|
|
45
|
-
`:"",i={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Iz(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nz(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tz(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=lo(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let s,a=e.footnoteCounts.get(i);a===void 0?(a=0,e.footnoteOrder.push(i),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Mz(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lz(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function
|
|
45
|
+
`:"",i={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Iz(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nz(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tz(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=lo(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let s,a=e.footnoteCounts.get(i);a===void 0?(a=0,e.footnoteOrder.push(i),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Mz(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lz(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ab(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),o=r[0];o&&o.type==="text"?o.value="["+o.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&s.type==="text"?s.value+=i:r.push({type:"text",value:i}),r}function Oz(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Ab(e,t);const r={src:lo(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)}function Rz(e,t){const n={src:lo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function Vz(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function Fz(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Ab(e,t);const r={href:lo(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Hz(e,t){const n={href:lo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Gz(e,t,n){const i=e.all(t),r=n?Bz(n):Ib(t),o={},s=[];if(typeof t.checked=="boolean"){const d=i[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},i.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<i.length;){const d=i[a];(r||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
46
46
|
`}),d.type==="element"&&d.tagName==="p"&&!r?s.push(...d.children):s.push(d)}const l=i[i.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
47
|
-
`});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function Bz(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=
|
|
47
|
+
`});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function Bz(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Ib(n[i])}return t}function Ib(e){const t=e.spread;return t??e.children.length>1}function $z(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<i.length;){const s=i[r];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Wz(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jz(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Uz(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yz(e,t){const n=e.all(t),i=n.shift(),r=[];if(i){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],s),r.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=rp(t.children[1]),l=cb(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),r.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function Xz(e,t,n){const i=n?n.children:void 0,o=(i?i.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},p=s?s[l]:void 0;p&&(h.align=p);let f={type:"element",tagName:o,properties:h,children:[]};c&&(f.children=e.all(c),e.patch(c,f),f=e.applyData(c,f)),u.push(f)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function Zz(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Lm=9,Om=32;function qz(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const o=[];for(;i;)o.push(Rm(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return o.push(Rm(t.slice(r),r>0,!1)),o.join("")}function Rm(e,t,n){let i=0,r=e.length;if(t){let o=e.codePointAt(i);for(;o===Lm||o===Om;)i++,o=e.codePointAt(i)}if(n){let o=e.codePointAt(r-1);for(;o===Lm||o===Om;)r--,o=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function Qz(e,t){const n={type:"text",value:qz(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Kz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Jz={blockquote:zz,break:Pz,code:Az,delete:Iz,emphasis:Nz,footnoteReference:Tz,heading:Mz,html:Lz,imageReference:Oz,image:Rz,inlineCode:Vz,linkReference:Fz,link:Hz,listItem:Gz,list:$z,paragraph:Wz,root:jz,strong:Uz,table:Yz,tableCell:Zz,tableRow:Xz,text:Qz,thematicBreak:Kz,toml:sa,yaml:sa,definition:sa,footnoteDefinition:sa};function sa(){}const Nb=-1,iu=0,$o=1,wl=2,dp=3,hp=4,pp=5,fp=6,Tb=7,Mb=8,Vm=typeof self=="object"?self:globalThis,eP=(e,t)=>{const n=(r,o)=>(e.set(o,r),r),i=r=>{if(e.has(r))return e.get(r);const[o,s]=t[r];switch(o){case iu:case Nb:return n(s,r);case $o:{const a=n([],r);for(const l of s)a.push(i(l));return a}case wl:{const a=n({},r);for(const[l,u]of s)a[i(l)]=i(u);return a}case dp:return n(new Date(s),r);case hp:{const{source:a,flags:l}=s;return n(new RegExp(a,l),r)}case pp:{const a=n(new Map,r);for(const[l,u]of s)a.set(i(l),i(u));return a}case fp:{const a=n(new Set,r);for(const l of s)a.add(i(l));return a}case Tb:{const{name:a,message:l}=s;return n(new Vm[a](l),r)}case Mb:return n(BigInt(s),r);case"BigInt":return n(Object(BigInt(s)),r);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new Vm[o](s),r)};return i},Fm=e=>eP(new Map,e)(0),fr="",{toString:tP}={},{keys:nP}=Object,xo=e=>{const t=typeof e;if(t!=="object"||!e)return[iu,t];const n=tP.call(e).slice(8,-1);switch(n){case"Array":return[$o,fr];case"Object":return[wl,fr];case"Date":return[dp,fr];case"RegExp":return[hp,fr];case"Map":return[pp,fr];case"Set":return[fp,fr];case"DataView":return[$o,n]}return n.includes("Array")?[$o,n]:n.includes("Error")?[Tb,n]:[wl,n]},aa=([e,t])=>e===iu&&(t==="function"||t==="symbol"),iP=(e,t,n,i)=>{const r=(s,a)=>{const l=i.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=xo(s);switch(a){case iu:{let d=s;switch(l){case"bigint":a=Mb,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return r([Nb],s)}return r([a,d],s)}case $o:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),r([l,[...h]],s)}const d=[],c=r([a,d],s);for(const h of s)d.push(o(h));return c}case wl:{if(l)switch(l){case"BigInt":return r([l,s.toString()],s);case"Boolean":case"Number":case"String":return r([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const d=[],c=r([a,d],s);for(const h of nP(s))(e||!aa(xo(s[h])))&&d.push([o(h),o(s[h])]);return c}case dp:return r([a,s.toISOString()],s);case hp:{const{source:d,flags:c}=s;return r([a,{source:d,flags:c}],s)}case pp:{const d=[],c=r([a,d],s);for(const[h,p]of s)(e||!(aa(xo(h))||aa(xo(p))))&&d.push([o(h),o(p)]);return c}case fp:{const d=[],c=r([a,d],s);for(const h of s)(e||!aa(xo(h)))&&d.push(o(h));return c}}const{message:u}=s;return r([a,{name:l,message:u}],s)};return o},Hm=(e,{json:t,lossy:n}={})=>{const i=[];return iP(!(t||n),!!t,new Map,i)(e),i},bl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fm(Hm(e,t)):structuredClone(e):(e,t)=>Fm(Hm(e,t));function rP(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rP,i=e.options.footnoteBackLabel||oP,r=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),c=String(u.identifier).toUpperCase(),h=lo(c.toLowerCase());let p=0;const f=[],v=e.footnoteCounts.get(c);for(;v!==void 0&&++p<=v;){f.length>0&&f.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,p);typeof w=="string"&&(w={type:"text",value:w}),f.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const w=b.children[b.children.length-1];w&&w.type==="text"?w.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...f)}else d.push(...f);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,m),a.push(m)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...bl(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
48
48
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
49
|
-
`}]}}const ru=function(e){if(e==null)return cP;if(typeof e=="function")return ou(e);if(typeof e=="object")return Array.isArray(e)?aP(e):lP(e);if(typeof e=="string")return uP(e);throw new Error("Expected function, string, or object as test")};function aP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ru(e[n]);return ou(i);function i(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function lP(e){const t=e;return ou(n);function n(i){const r=i;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function uP(e){return ou(t);function t(n){return n&&n.type===e}}function ou(e){return t;function t(n,i,r){return!!(dP(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function cP(){return!0}function dP(e){return e!==null&&typeof e=="object"&&"type"in e}const
|
|
49
|
+
`}]}}const ru=function(e){if(e==null)return cP;if(typeof e=="function")return ou(e);if(typeof e=="object")return Array.isArray(e)?aP(e):lP(e);if(typeof e=="string")return uP(e);throw new Error("Expected function, string, or object as test")};function aP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ru(e[n]);return ou(i);function i(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function lP(e){const t=e;return ou(n);function n(i){const r=i;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function uP(e){return ou(t);function t(n){return n&&n.type===e}}function ou(e){return t;function t(n,i,r){return!!(dP(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function cP(){return!0}function dP(e){return e!==null&&typeof e=="object"&&"type"in e}const Lb=[],hP=!0,zd=!1,pP="skip";function Ob(e,t,n,i){let r;typeof t=="function"&&typeof n!="function"?(i=n,n=t):r=t;const o=ru(r),s=i?-1:1;a(e,void 0,[])();function a(l,u,d){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Lb,f,v,b;if((!t||o(l,u,d[d.length-1]||void 0))&&(p=fP(n(l,d)),p[0]===zd))return p;if("children"in l&&l.children){const m=l;if(m.children&&p[0]!==pP)for(v=(i?m.children.length:-1)+s,b=d.concat(m);v>-1&&v<m.children.length;){const w=m.children[v];if(f=a(w,v,b)(),f[0]===zd)return f;v=typeof f[1]=="number"?f[1]:v+s}}return p}}}function fP(e){return Array.isArray(e)?e:typeof e=="number"?[hP,e]:e==null?Lb:[e]}function su(e,t,n,i){let r,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,r=n):(o=t,s=n,r=i),Ob(e,o,a,r);function a(l,u){const d=u[u.length-1],c=d?d.children.indexOf(l):void 0;return s(l,c,d)}}const Pd={}.hasOwnProperty,mP={};function gP(e,t){const n=t||mP,i=new Map,r=new Map,o=new Map,s={...Jz,...n.handlers},a={all:u,applyData:wP,definitionById:i,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:vP,wrap:yP};return su(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const c=d.type==="definition"?i:r,h=String(d.identifier).toUpperCase();c.has(h)||c.set(h,d)}}),a;function l(d,c){const h=d.type,p=a.handlers[h];if(Pd.call(a.handlers,h)&&p)return p(a,d,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in d){const{children:v,...b}=d,m=bl(b);return m.children=a.all(d),m}return bl(d)}return(a.options.unknownHandler||bP)(a,d,c)}function u(d){const c=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const f=a.one(h[p],d);if(f){if(p&&h[p-1].type==="break"&&(!Array.isArray(f)&&f.type==="text"&&(f.value=Gm(f.value)),!Array.isArray(f)&&f.type==="element")){const v=f.children[0];v&&v.type==="text"&&(v.value=Gm(v.value))}Array.isArray(f)?c.push(...f):c.push(f)}}}return c}}function vP(e,t){e.position&&(t.position=oE(e))}function wP(e,t){let n=t;if(e&&e.data){const i=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const s="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,bl(o)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function bP(e,t){const n=t.data||{},i="value"in t&&!(Pd.call(n,"hProperties")||Pd.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function yP(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
50
50
|
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
51
51
|
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
52
|
-
`}),n}function
|
|
53
|
-
`},r),o}function xP(e,t){return e&&"run"in e?async function(n,i){const r=Gm(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Gm(n,{file:i,...e||t})}}function Bm(e){if(e)throw e}var Ha=Object.prototype.hasOwnProperty,Ob=Object.prototype.toString,$m=Object.defineProperty,Wm=Object.getOwnPropertyDescriptor,jm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ob.call(t)==="[object Array]"},Um=function(t){if(!t||Ob.call(t)!=="[object Object]")return!1;var n=Ha.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&Ha.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||Ha.call(t,r)},Ym=function(t,n){$m&&n.name==="__proto__"?$m(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Xm=function(t,n){if(n==="__proto__")if(Ha.call(t,n)){if(Wm)return Wm(t,n).value}else return;return t[n]},_P=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,u=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)i=Xm(a,n),r=Xm(t,n),a!==r&&(d&&r&&(Um(r)||(o=jm(r)))?(o?(o=!1,s=i&&jm(i)?i:[]):s=i&&Um(i)?i:{},Ym(a,{name:n,newValue:e(d,s,r)})):typeof r<"u"&&Ym(a,{name:n,newValue:r}));return a};const rc=Cs(_P);function Ad(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kP(){const e=[],t={run:n,use:i};return t;function n(...r){let o=-1;const s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...r);function a(l,...u){const d=e[++o];let c=-1;if(l){s(l);return}for(;++c<r.length;)(u[c]===null||u[c]===void 0)&&(u[c]=r[c]);r=u,d?SP(d,a)(...u):s(null,...u)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function SP(e,t){let n;return i;function i(...s){const a=e.length>s.length;let l;a&&s.push(r);try{l=e.apply(this,s)}catch(u){const d=u;if(a&&n)throw d;return r(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,r):l instanceof Error?r(l):o(l))}function r(s,...a){n||(n=!0,t(s,...a))}function o(s){r(null,s)}}const wn={basename:CP,dirname:EP,extname:DP,join:zP,sep:"/"};function CP(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ts(e);let n=0,i=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){n=r+1;break}}else i<0&&(o=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let s=-1,a=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){n=r+1;break}}else s<0&&(o=!0,s=r+1),a>-1&&(e.codePointAt(r)===t.codePointAt(a--)?a<0&&(i=r):(a=-1,i=s));return n===i?i=s:i<0&&(i=e.length),e.slice(n,i)}function EP(e){if(Ts(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function DP(e){Ts(e);let t=e.length,n=-1,i=0,r=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){i=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||n<0||o===0||o===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function zP(...e){let t=-1,n;for(;++t<e.length;)Ts(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PP(n)}function PP(e){Ts(e);const t=e.codePointAt(0)===47;let n=AP(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function AP(e,t){let n="",i=0,r=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(r===s-1||o===1))if(r!==s-1&&o===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),r=s,o=0;continue}}else if(n.length>0){n="",i=0,r=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,s):n=e.slice(r+1,s),i=s-r-1;r=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Ts(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const IP={cwd:NP};function NP(){return"/"}function Id(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TP(e){if(typeof e=="string")e=new URL(e);else if(!Id(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return MP(e)}function MP(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const oc=["history","path","basename","stem","extname","dirname"];class Rb{constructor(t){let n;t?Id(t)?n={path:t}:typeof t=="string"||LP(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":IP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<oc.length;){const o=oc[i];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let r;for(r in n)oc.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?wn.basename(this.path):void 0}set basename(t){ac(t,"basename"),sc(t,"basename"),this.path=wn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wn.dirname(this.path):void 0}set dirname(t){Zm(this.basename,"dirname"),this.path=wn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wn.extname(this.path):void 0}set extname(t){if(sc(t,"extname"),Zm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Id(t)&&(t=TP(t)),ac(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wn.basename(this.path,this.extname):void 0}set stem(t){ac(t,"stem"),sc(t,"stem"),this.path=wn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const r=this.message(t,n,i);throw r.fatal=!0,r}info(t,n,i){const r=this.message(t,n,i);return r.fatal=void 0,r}message(t,n,i){const r=new ht(t,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sc(e,t){if(e&&e.includes(wn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wn.sep+"`")}function ac(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Zm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function LP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OP=function(e){const i=this.constructor.prototype,r=i[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,i),o},RP={}.hasOwnProperty;class mp extends OP{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kP()}copy(){const t=new mp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(rc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(cc("data",this.frozen),this.namespace[t]=n,this):RP.call(this.namespace,t)&&this.namespace[t]||void 0:t?(cc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(t,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=la(t),i=this.parser||this.Parser;return lc("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),lc("process",this.parser||this.Parser),uc("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(o,s){const a=la(t),l=i.parse(a);i.run(l,a,function(d,c,h){if(d||!c||!h)return u(d);const p=c,f=i.stringify(p,h);HP(f)?h.value=f:h.result=f,u(d,h)});function u(d,c){d||!c?s(d):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,i;return this.freeze(),lc("processSync",this.parser||this.Parser),uc("processSync",this.compiler||this.Compiler),this.process(t,r),Qm("processSync","process",n),i;function r(o,s){n=!0,Bm(o),i=s}}run(t,n,i){qm(t),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?o(void 0,i):new Promise(o);function o(s,a){const l=la(n);r.run(t,l,u);function u(d,c,h){const p=c||t;d?a(d):s?s(p):i(void 0,p,h)}}}runSync(t,n){let i=!1,r;return this.run(t,n,o),Qm("runSync","run",i),r;function o(s,a){Bm(s),r=a,i=!0}}stringify(t,n){this.freeze();const i=la(n),r=this.compiler||this.Compiler;return uc("stringify",r),qm(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(cc("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...c]=u;l(d,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(r.settings=rc(!0,r.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const c=u[d];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let c=-1,h=-1;for(;++c<i.length;)if(i[c][0]===u){h=c;break}if(h===-1)i.push([u,...d]);else if(d.length>0){let[p,...f]=d;const v=i[h][1];Ad(v)&&Ad(p)&&(p=rc(!0,v,p)),i[h]=[u,p,...f]}}}}const VP=new mp().freeze();function lc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qm(e){if(!Ad(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function la(e){return FP(e)?e:new Rb(e)}function FP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HP(e){return typeof e=="string"||GP(e)}function GP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Km=[],Jm={allowDangerousHtml:!0},$P=/^(https?|ircs?|mailto|xmpp)$/i,WP=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YV(e){const t=jP(e),n=UP(e);return YP(t.runSync(t.parse(n),n),e)}function jP(e){const t=e.rehypePlugins||Km,n=e.remarkPlugins||Km,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jm}:Jm;return VP().use(Dz).use(n).use(xP,i).use(t)}function UP(e){const t=e.children||"",n=new Rb;return typeof t=="string"&&(n.value=t),n}function YP(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||XP;for(const d of WP)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+BP+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),su(e,u),cE(e,{Fragment:G.Fragment,components:r,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function u(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return s?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let p;for(p in tc)if(Object.hasOwn(tc,p)&&Object.hasOwn(d.properties,p)){const f=d.properties[p],v=tc[p];(v===null||v.includes(d.tagName))&&(d.properties[p]=l(String(f||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!p&&i&&typeof c=="number"&&(p=!i(d,c,h)),p&&h&&typeof c=="number")return a&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function XP(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||$P.test(e.slice(0,t))?e:""}function eg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function ZP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Vb(e,t,n){const r=ru((n||{}).ignore||[]),o=qP(t);let s=-1;for(;++s<o.length;)Lb(e,"text",a);function a(u,d){let c=-1,h;for(;++c<d.length;){const p=d[c],f=h?h.children:void 0;if(r(p,f?f.indexOf(p):void 0,h))return;h=p}if(h)return l(u,d)}function l(u,d){const c=d[d.length-1],h=o[s][0],p=o[s][1];let f=0;const b=c.children.indexOf(u);let m=!1,w=[];h.lastIndex=0;let g=h.exec(u.value);for(;g;){const y=g.index,k={index:g.index,input:g.input,stack:[...d,u]};let _=p(...g,k);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?h.lastIndex=y+1:(f!==y&&w.push({type:"text",value:u.value.slice(f,y)}),Array.isArray(_)?w.push(..._):_&&w.push(_),f=y+g[0].length,m=!0),!h.global)break;g=h.exec(u.value)}return m?(f<u.value.length&&w.push({type:"text",value:u.value.slice(f)}),c.children.splice(b,1,...w)):w=[u],b+w.length}}function qP(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const r=n[i];t.push([QP(r[0]),KP(r[1])])}return t}function QP(e){return typeof e=="string"?new RegExp(ZP(e),"g"):e}function KP(e){return typeof e=="function"?e:function(){return e}}const dc="phrasing",hc=["autolink","link","image","label"];function JP(){return{transforms:[sA],enter:{literalAutolink:tA,literalAutolinkEmail:pc,literalAutolinkHttp:pc,literalAutolinkWww:pc},exit:{literalAutolink:oA,literalAutolinkEmail:rA,literalAutolinkHttp:nA,literalAutolinkWww:iA}}}function eA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:hc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:hc},{character:":",before:"[ps]",after:"\\/",inConstruct:dc,notInConstruct:hc}]}}function tA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pc(e){this.config.enter.autolinkProtocol.call(this,e)}function nA(e){this.config.exit.autolinkProtocol.call(this,e)}function iA(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function rA(e){this.config.exit.autolinkEmail.call(this,e)}function oA(e){this.exit(e)}function sA(e){Vb(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aA],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lA]],{ignore:["link","linkReference"]})}function aA(e,t,n,i,r){let o="";if(!Fb(r)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!uA(n)))return!1;const s=cA(n+i);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function lA(e,t,n,i){return!Fb(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function uA(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cA(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=eg(e,"(");let o=eg(e,")");for(;i!==-1&&r>o;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),o++;return[e,n]}function Fb(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||nr(n)||tu(n))&&(!t||n!==47)}Hb.peek=bA;function dA(){this.buffer()}function hA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pA(){this.buffer()}function fA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mA(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=un(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gA(e){this.exit(e)}function vA(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=un(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wA(e){this.exit(e)}function bA(){return"["}function Hb(e,t,n,i){const r=n.createTracker(i);let o=r.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=r.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=r.move("]"),o}function yA(){return{enter:{gfmFootnoteCallString:dA,gfmFootnoteCall:hA,gfmFootnoteDefinitionLabelString:pA,gfmFootnoteDefinition:fA},exit:{gfmFootnoteCallString:mA,gfmFootnoteCall:gA,gfmFootnoteDefinitionLabelString:vA,gfmFootnoteDefinition:wA}}}function xA(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Hb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),d=o.enter("label");return l+=a.move(o.safe(o.associationId(i),{before:l,after:"]"})),d(),l+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
54
|
-
`:" ")+o.indentLines(o.containerFlow(i,a.current()),t?
|
|
55
|
-
`)}function IA(e){return e==null?"":String(e)}function
|
|
52
|
+
`}),n}function Gm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Bm(e,t){const n=gP(e,t),i=n.one(e,void 0),r=sP(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&o.children.push({type:"text",value:`
|
|
53
|
+
`},r),o}function xP(e,t){return e&&"run"in e?async function(n,i){const r=Bm(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Bm(n,{file:i,...e||t})}}function $m(e){if(e)throw e}var Ha=Object.prototype.hasOwnProperty,Rb=Object.prototype.toString,Wm=Object.defineProperty,jm=Object.getOwnPropertyDescriptor,Um=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Rb.call(t)==="[object Array]"},Ym=function(t){if(!t||Rb.call(t)!=="[object Object]")return!1;var n=Ha.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&Ha.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||Ha.call(t,r)},Xm=function(t,n){Wm&&n.name==="__proto__"?Wm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Zm=function(t,n){if(n==="__proto__")if(Ha.call(t,n)){if(jm)return jm(t,n).value}else return;return t[n]},_P=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,u=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)i=Zm(a,n),r=Zm(t,n),a!==r&&(d&&r&&(Ym(r)||(o=Um(r)))?(o?(o=!1,s=i&&Um(i)?i:[]):s=i&&Ym(i)?i:{},Xm(a,{name:n,newValue:e(d,s,r)})):typeof r<"u"&&Xm(a,{name:n,newValue:r}));return a};const rc=Cs(_P);function Ad(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kP(){const e=[],t={run:n,use:i};return t;function n(...r){let o=-1;const s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...r);function a(l,...u){const d=e[++o];let c=-1;if(l){s(l);return}for(;++c<r.length;)(u[c]===null||u[c]===void 0)&&(u[c]=r[c]);r=u,d?SP(d,a)(...u):s(null,...u)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function SP(e,t){let n;return i;function i(...s){const a=e.length>s.length;let l;a&&s.push(r);try{l=e.apply(this,s)}catch(u){const d=u;if(a&&n)throw d;return r(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,r):l instanceof Error?r(l):o(l))}function r(s,...a){n||(n=!0,t(s,...a))}function o(s){r(null,s)}}const wn={basename:CP,dirname:EP,extname:DP,join:zP,sep:"/"};function CP(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ts(e);let n=0,i=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){n=r+1;break}}else i<0&&(o=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let s=-1,a=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){n=r+1;break}}else s<0&&(o=!0,s=r+1),a>-1&&(e.codePointAt(r)===t.codePointAt(a--)?a<0&&(i=r):(a=-1,i=s));return n===i?i=s:i<0&&(i=e.length),e.slice(n,i)}function EP(e){if(Ts(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function DP(e){Ts(e);let t=e.length,n=-1,i=0,r=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){i=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||n<0||o===0||o===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function zP(...e){let t=-1,n;for(;++t<e.length;)Ts(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PP(n)}function PP(e){Ts(e);const t=e.codePointAt(0)===47;let n=AP(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function AP(e,t){let n="",i=0,r=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(r===s-1||o===1))if(r!==s-1&&o===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),r=s,o=0;continue}}else if(n.length>0){n="",i=0,r=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,s):n=e.slice(r+1,s),i=s-r-1;r=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Ts(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const IP={cwd:NP};function NP(){return"/"}function Id(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TP(e){if(typeof e=="string")e=new URL(e);else if(!Id(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return MP(e)}function MP(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const oc=["history","path","basename","stem","extname","dirname"];class Vb{constructor(t){let n;t?Id(t)?n={path:t}:typeof t=="string"||LP(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":IP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<oc.length;){const o=oc[i];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let r;for(r in n)oc.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?wn.basename(this.path):void 0}set basename(t){ac(t,"basename"),sc(t,"basename"),this.path=wn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wn.dirname(this.path):void 0}set dirname(t){qm(this.basename,"dirname"),this.path=wn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wn.extname(this.path):void 0}set extname(t){if(sc(t,"extname"),qm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Id(t)&&(t=TP(t)),ac(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wn.basename(this.path,this.extname):void 0}set stem(t){ac(t,"stem"),sc(t,"stem"),this.path=wn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const r=this.message(t,n,i);throw r.fatal=!0,r}info(t,n,i){const r=this.message(t,n,i);return r.fatal=void 0,r}message(t,n,i){const r=new ht(t,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sc(e,t){if(e&&e.includes(wn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wn.sep+"`")}function ac(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function LP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OP=function(e){const i=this.constructor.prototype,r=i[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,i),o},RP={}.hasOwnProperty;class mp extends OP{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kP()}copy(){const t=new mp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(rc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(cc("data",this.frozen),this.namespace[t]=n,this):RP.call(this.namespace,t)&&this.namespace[t]||void 0:t?(cc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(t,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=la(t),i=this.parser||this.Parser;return lc("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),lc("process",this.parser||this.Parser),uc("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(o,s){const a=la(t),l=i.parse(a);i.run(l,a,function(d,c,h){if(d||!c||!h)return u(d);const p=c,f=i.stringify(p,h);HP(f)?h.value=f:h.result=f,u(d,h)});function u(d,c){d||!c?s(d):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,i;return this.freeze(),lc("processSync",this.parser||this.Parser),uc("processSync",this.compiler||this.Compiler),this.process(t,r),Km("processSync","process",n),i;function r(o,s){n=!0,$m(o),i=s}}run(t,n,i){Qm(t),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?o(void 0,i):new Promise(o);function o(s,a){const l=la(n);r.run(t,l,u);function u(d,c,h){const p=c||t;d?a(d):s?s(p):i(void 0,p,h)}}}runSync(t,n){let i=!1,r;return this.run(t,n,o),Km("runSync","run",i),r;function o(s,a){$m(s),r=a,i=!0}}stringify(t,n){this.freeze();const i=la(n),r=this.compiler||this.Compiler;return uc("stringify",r),Qm(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(cc("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...c]=u;l(d,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(r.settings=rc(!0,r.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const c=u[d];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let c=-1,h=-1;for(;++c<i.length;)if(i[c][0]===u){h=c;break}if(h===-1)i.push([u,...d]);else if(d.length>0){let[p,...f]=d;const v=i[h][1];Ad(v)&&Ad(p)&&(p=rc(!0,v,p)),i[h]=[u,p,...f]}}}}const VP=new mp().freeze();function lc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Qm(e){if(!Ad(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Km(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function la(e){return FP(e)?e:new Vb(e)}function FP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HP(e){return typeof e=="string"||GP(e)}function GP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Jm=[],eg={allowDangerousHtml:!0},$P=/^(https?|ircs?|mailto|xmpp)$/i,WP=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function XV(e){const t=jP(e),n=UP(e);return YP(t.runSync(t.parse(n),n),e)}function jP(e){const t=e.rehypePlugins||Jm,n=e.remarkPlugins||Jm,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...eg}:eg;return VP().use(Dz).use(n).use(xP,i).use(t)}function UP(e){const t=e.children||"",n=new Vb;return typeof t=="string"&&(n.value=t),n}function YP(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||XP;for(const d of WP)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+BP+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),su(e,u),cE(e,{Fragment:G.Fragment,components:r,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function u(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return s?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let p;for(p in tc)if(Object.hasOwn(tc,p)&&Object.hasOwn(d.properties,p)){const f=d.properties[p],v=tc[p];(v===null||v.includes(d.tagName))&&(d.properties[p]=l(String(f||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!p&&i&&typeof c=="number"&&(p=!i(d,c,h)),p&&h&&typeof c=="number")return a&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function XP(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||$P.test(e.slice(0,t))?e:""}function tg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function ZP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Fb(e,t,n){const r=ru((n||{}).ignore||[]),o=qP(t);let s=-1;for(;++s<o.length;)Ob(e,"text",a);function a(u,d){let c=-1,h;for(;++c<d.length;){const p=d[c],f=h?h.children:void 0;if(r(p,f?f.indexOf(p):void 0,h))return;h=p}if(h)return l(u,d)}function l(u,d){const c=d[d.length-1],h=o[s][0],p=o[s][1];let f=0;const b=c.children.indexOf(u);let m=!1,w=[];h.lastIndex=0;let g=h.exec(u.value);for(;g;){const y=g.index,k={index:g.index,input:g.input,stack:[...d,u]};let _=p(...g,k);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?h.lastIndex=y+1:(f!==y&&w.push({type:"text",value:u.value.slice(f,y)}),Array.isArray(_)?w.push(..._):_&&w.push(_),f=y+g[0].length,m=!0),!h.global)break;g=h.exec(u.value)}return m?(f<u.value.length&&w.push({type:"text",value:u.value.slice(f)}),c.children.splice(b,1,...w)):w=[u],b+w.length}}function qP(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const r=n[i];t.push([QP(r[0]),KP(r[1])])}return t}function QP(e){return typeof e=="string"?new RegExp(ZP(e),"g"):e}function KP(e){return typeof e=="function"?e:function(){return e}}const dc="phrasing",hc=["autolink","link","image","label"];function JP(){return{transforms:[sA],enter:{literalAutolink:tA,literalAutolinkEmail:pc,literalAutolinkHttp:pc,literalAutolinkWww:pc},exit:{literalAutolink:oA,literalAutolinkEmail:rA,literalAutolinkHttp:nA,literalAutolinkWww:iA}}}function eA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:hc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:hc},{character:":",before:"[ps]",after:"\\/",inConstruct:dc,notInConstruct:hc}]}}function tA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pc(e){this.config.enter.autolinkProtocol.call(this,e)}function nA(e){this.config.exit.autolinkProtocol.call(this,e)}function iA(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function rA(e){this.config.exit.autolinkEmail.call(this,e)}function oA(e){this.exit(e)}function sA(e){Fb(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aA],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lA]],{ignore:["link","linkReference"]})}function aA(e,t,n,i,r){let o="";if(!Hb(r)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!uA(n)))return!1;const s=cA(n+i);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function lA(e,t,n,i){return!Hb(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function uA(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cA(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=tg(e,"(");let o=tg(e,")");for(;i!==-1&&r>o;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),o++;return[e,n]}function Hb(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||nr(n)||tu(n))&&(!t||n!==47)}Gb.peek=bA;function dA(){this.buffer()}function hA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pA(){this.buffer()}function fA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mA(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=un(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gA(e){this.exit(e)}function vA(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=un(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wA(e){this.exit(e)}function bA(){return"["}function Gb(e,t,n,i){const r=n.createTracker(i);let o=r.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=r.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=r.move("]"),o}function yA(){return{enter:{gfmFootnoteCallString:dA,gfmFootnoteCall:hA,gfmFootnoteDefinitionLabelString:pA,gfmFootnoteDefinition:fA},exit:{gfmFootnoteCallString:mA,gfmFootnoteCall:gA,gfmFootnoteDefinitionLabelString:vA,gfmFootnoteDefinition:wA}}}function xA(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),d=o.enter("label");return l+=a.move(o.safe(o.associationId(i),{before:l,after:"]"})),d(),l+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
54
|
+
`:" ")+o.indentLines(o.containerFlow(i,a.current()),t?Bb:_A))),u(),l}}function _A(e,t,n){return t===0?e:Bb(e,t,n)}function Bb(e,t,n){return(n?"":" ")+e}const kA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$b.peek=zA;function SA(){return{canContainEols:["delete"],enter:{strikethrough:EA},exit:{strikethrough:DA}}}function CA(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kA}],handlers:{delete:$b}}}function EA(e){this.enter({type:"delete",children:[]},e)}function DA(e){this.exit(e)}function $b(e,t,n,i){const r=n.createTracker(i),o=n.enter("strikethrough");let s=r.move("~~");return s+=n.containerPhrasing(e,{...r.current(),before:s,after:"~"}),s+=r.move("~~"),o(),s}function zA(){return"~"}function PA(e){return e.length}function AA(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||PA,o=[],s=[],a=[],l=[];let u=0,d=-1;for(;++d<e.length;){const v=[],b=[];let m=-1;for(e[d].length>u&&(u=e[d].length);++m<e[d].length;){const w=IA(e[d][m]);if(n.alignDelimiters!==!1){const g=r(w);b[m]=g,(l[m]===void 0||g>l[m])&&(l[m]=g)}v.push(w)}s[d]=v,a[d]=b}let c=-1;if(typeof i=="object"&&"length"in i)for(;++c<u;)o[c]=ng(i[c]);else{const v=ng(i);for(;++c<u;)o[c]=v}c=-1;const h=[],p=[];for(;++c<u;){const v=o[c];let b="",m="";v===99?(b=":",m=":"):v===108?b=":":v===114&&(m=":");let w=n.alignDelimiters===!1?1:Math.max(1,l[c]-b.length-m.length);const g=b+"-".repeat(w)+m;n.alignDelimiters!==!1&&(w=b.length+w+m.length,w>l[c]&&(l[c]=w),p[c]=w),h[c]=g}s.splice(1,0,h),a.splice(1,0,p),d=-1;const f=[];for(;++d<s.length;){const v=s[d],b=a[d];c=-1;const m=[];for(;++c<u;){const w=v[c]||"";let g="",y="";if(n.alignDelimiters!==!1){const k=l[c]-(b[c]||0),_=o[c];_===114?g=" ".repeat(k):_===99?k%2?(g=" ".repeat(k/2+.5),y=" ".repeat(k/2-.5)):(g=" ".repeat(k/2),y=g):y=" ".repeat(k)}n.delimiterStart!==!1&&!c&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||c)&&m.push(" "),n.alignDelimiters!==!1&&m.push(g),m.push(w),n.alignDelimiters!==!1&&m.push(y),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&m.push("|")}f.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return f.join(`
|
|
55
|
+
`)}function IA(e){return e==null?"":String(e)}function ng(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function NA(e,t,n,i){const r=n.enter("blockquote"),o=n.createTracker(i);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),TA);return r(),s}function TA(e,t,n){return">"+(n?"":" ")+e}function MA(e,t){return ig(e,t.inConstruct,!0)&&!ig(e,t.notInConstruct,!1)}function ig(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function rg(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
|
|
56
56
|
`&&MA(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
57
57
|
`}function LA(e,t){const n=String(e);let i=n.indexOf(t),r=i,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++o>s&&(s=o):o=1,r=i+t.length,i=n.indexOf(t,r);return s}function OA(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function RA(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function VA(e,t,n,i){const r=RA(n),o=e.value||"",s=r==="`"?"GraveAccent":"Tilde";if(OA(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,FA);return c(),h}const a=n.createTracker(i),l=r.repeat(Math.max(LA(o,r)+1,3)),u=n.enter("codeFenced");let d=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
|
|
58
58
|
`,encode:["`"],...a.current()})),c()}return d+=a.move(`
|
|
59
59
|
`),o&&(d+=a.move(o+`
|
|
60
60
|
`)),d+=a.move(l),u(),d}function FA(e,t,n){return(n?"":" ")+e}function gp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function HA(e,t,n,i){const r=gp(n),o=r==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
61
|
-
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+r),u+=l.move(n.safe(e.title,{before:u,after:r,...l.current()})),u+=l.move(r),a()),s(),u}function GA(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ds(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yl(e,t,n){const i=Zr(e),r=Zr(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}
|
|
61
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+r),u+=l.move(n.safe(e.title,{before:u,after:r,...l.current()})),u+=l.move(r),a()),s(),u}function GA(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ds(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yl(e,t,n){const i=Zr(e),r=Zr(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Wb.peek=BA;function Wb(e,t,n,i){const r=GA(n),o=n.enter("emphasis"),s=n.createTracker(i),a=s.move(r);let l=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const u=l.charCodeAt(0),d=yl(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(l=ds(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=yl(i.after.charCodeAt(0),c,r);h.inside&&(l=l.slice(0,-1)+ds(c));const p=s.move(r);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+p}function BA(e,t,n){return n.options.emphasis||"*"}function $A(e,t){let n=!1;return su(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,zd}),!!((!e.depth||e.depth<3)&&lp(e)&&(t.options.setext||n))}function WA(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(i);if($A(e,n)){const d=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
62
62
|
`,after:`
|
|
63
63
|
`});return c(),d(),h+`
|
|
64
64
|
`+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
65
65
|
`))+1))}const s="#".repeat(r),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
66
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=ds(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}
|
|
66
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=ds(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}jb.peek=jA;function jb(e){return e.value||""}function jA(){return"<"}Ub.peek=UA;function Ub(e,t,n,i){const r=gp(n),o=r==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+r),u+=l.move(n.safe(e.title,{before:u,after:r,...l.current()})),u+=l.move(r),a()),u+=l.move(")"),s(),u}function UA(){return"!"}Yb.peek=YA;function Yb(e,t,n,i){const r=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=d,o(),r==="full"||!u||u!==c?l+=a.move(c+"]"):r==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function YA(){return"!"}Xb.peek=XA;function Xb(e,t,n){let i=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(i);){let u=l.index;i.charCodeAt(u)===10&&i.charCodeAt(u-1)===13&&u--,i=i.slice(0,u)+" "+i.slice(l.index+1)}}return r+i+r}function XA(){return"`"}function Zb(e,t){const n=lp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}qb.peek=ZA;function qb(e,t,n,i){const r=gp(n),o=r==='"'?"Quote":"Apostrophe",s=n.createTracker(i);let a,l;if(Zb(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=d,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(n.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),u+=s.move(")"),a(),u}function ZA(e,t,n){return Zb(e,n)?"<":"["}Qb.peek=qA;function Qb(e,t,n,i){const r=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=d,o(),r==="full"||!u||u!==c?l+=a.move(c+"]"):r==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function qA(){return"["}function vp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function QA(e){const t=vp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function KA(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Kb(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function JA(e,t,n,i){const r=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?KA(n):vp(n);const a=e.ordered?s==="."?")":".":QA(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Kb(n)===s&&d){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,i);return n.bulletLastUsed=s,n.bulletCurrent=o,r(),u}function e2(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function t2(e,t,n,i){const r=e2(n);let o=n.bulletCurrent||vp(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(i);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),d);return l(),u;function d(c,h,p){return h?(p?"":" ".repeat(s))+c:(p?o:o+" ".repeat(s-o.length))+c}}function n2(e,t,n,i){const r=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,i);return o(),r(),s}const i2=ru(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function r2(e,t,n,i){return(e.children.some(function(s){return i2(s)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function o2(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Jb.peek=s2;function Jb(e,t,n,i){const r=o2(n),o=n.enter("strong"),s=n.createTracker(i),a=s.move(r+r);let l=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const u=l.charCodeAt(0),d=yl(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(l=ds(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=yl(i.after.charCodeAt(0),c,r);h.inside&&(l=l.slice(0,-1)+ds(c));const p=s.move(r+r);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+p}function s2(e,t,n){return n.options.strong||"*"}function a2(e,t,n,i){return n.safe(e.value,i)}function l2(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function u2(e,t,n){const i=(Kb(n)+(n.options.ruleSpaces?" ":"")).repeat(l2(n));return n.options.ruleSpaces?i.slice(0,-1):i}const ey={blockquote:NA,break:rg,code:VA,definition:HA,emphasis:Wb,hardBreak:rg,heading:WA,html:jb,image:Ub,imageReference:Yb,inlineCode:Xb,link:qb,linkReference:Qb,list:JA,listItem:t2,paragraph:n2,root:r2,strong:Jb,text:a2,thematicBreak:u2};function c2(){return{enter:{table:d2,tableData:og,tableHeader:og,tableRow:p2},exit:{codeText:f2,table:h2,tableData:fc,tableHeader:fc,tableRow:fc}}}function d2(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function h2(e){this.exit(e),this.data.inTable=void 0}function p2(e){this.enter({type:"tableRow",children:[]},e)}function fc(e){this.exit(e)}function og(e){this.enter({type:"tableCell",children:[]},e)}function f2(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,m2));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function m2(e,t){return t==="|"?t:e}function g2(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
67
67
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:a}};function s(p,f,v,b){return u(d(p,v,b),p.align)}function a(p,f,v,b){const m=c(p,v,b),w=u([m]);return w.slice(0,w.indexOf(`
|
|
68
|
-
`))}function l(p,f,v,b){const m=v.enter("tableCell"),w=v.enter("phrasing"),g=v.containerPhrasing(p,{...b,before:o,after:o});return w(),m(),g}function u(p,f){return AA(p,{align:f,alignDelimiters:i,padding:n,stringLength:r})}function d(p,f,v){const b=p.children;let m=-1;const w=[],g=f.enter("table");for(;++m<b.length;)w[m]=c(b[m],f,v);return g(),w}function c(p,f,v){const b=p.children;let m=-1;const w=[],g=f.enter("tableRow");for(;++m<b.length;)w[m]=l(b[m],p,f,v);return g(),w}function h(p,f,v){let b=Jb.inlineCode(p,f,v);return v.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function v2(){return{exit:{taskListCheckValueChecked:og,taskListCheckValueUnchecked:og,paragraph:b2}}}function w2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:y2}}}function og(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function b2(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=t.children;let o=-1,s;for(;++o<r.length;){const a=r[o];if(a.type==="paragraph"){s=a;break}}s===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function y2(e,t,n,i){const r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);o&&a.move(s);let l=Jb.listItem(e,t,n,{...i,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+s}}function x2(){return[JP(),yA(),SA(),c2(),v2()]}function _2(e){return{extensions:[eA(),xA(e),CA(),g2(e),w2()]}}const k2={tokenize:P2,partial:!0},ey={tokenize:A2,partial:!0},ty={tokenize:I2,partial:!0},ny={tokenize:N2,partial:!0},S2={tokenize:T2,partial:!0},iy={name:"wwwAutolink",tokenize:D2,previous:oy},ry={name:"protocolAutolink",tokenize:z2,previous:sy},Yn={name:"emailAutolink",tokenize:E2,previous:ay},Pn={};function C2(){return{text:Pn}}let Mi=48;for(;Mi<123;)Pn[Mi]=Yn,Mi++,Mi===58?Mi=65:Mi===91&&(Mi=97);Pn[43]=Yn;Pn[45]=Yn;Pn[46]=Yn;Pn[95]=Yn;Pn[72]=[Yn,ry];Pn[104]=[Yn,ry];Pn[87]=[Yn,iy];Pn[119]=[Yn,iy];function E2(e,t,n){const i=this;let r,o;return s;function s(c){return!Nd(c)||!ay.call(i,i.previous)||wp(i.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Nd(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(S2,d,u)(c):c===45||c===95||ct(c)?(o=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),r=!0,l}function d(c){return o&&r&&mt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function D2(e,t,n){const i=this;return r;function r(s){return s!==87&&s!==119||!oy.call(i,i.previous)||wp(i.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(k2,e.attempt(ey,e.attempt(ty,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function z2(e,t,n){const i=this;let r="",o=!1;return s;function s(c){return(c===72||c===104)&&sy.call(i,i.previous)&&!wp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(mt(c)&&r.length<5)return r+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=r.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||vl(c)||De(c)||nr(c)||tu(c)?n(c):e.attempt(ey,e.attempt(ty,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function P2(e,t,n){let i=0;return r;function r(s){return(s===87||s===119)&&i<3?(i++,e.consume(s),r):s===46&&i===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function A2(e,t,n){let i,r,o;return s;function s(u){return u===46||u===95?e.check(ny,l,a)(u):u===null||De(u)||nr(u)||u!==45&&tu(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?i=!0:(r=i,i=void 0),e.consume(u),s}function l(u){return r||i||!o?n(u):t(u)}}function I2(e,t){let n=0,i=0;return r;function r(s){return s===40?(n++,e.consume(s),r):s===41&&i<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(ny,t,o)(s):s===null||De(s)||nr(s)?t(s):(e.consume(s),r)}function o(s){return s===41&&i++,e.consume(s),r}}function N2(e,t,n){return i;function i(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),i):a===38?(e.consume(a),o):a===93?(e.consume(a),r):a===60||a===null||De(a)||nr(a)?t(a):n(a)}function r(a){return a===null||a===40||a===91||De(a)||nr(a)?t(a):i(a)}function o(a){return mt(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),i):mt(a)?(e.consume(a),s):n(a)}}function T2(e,t,n){return i;function i(o){return e.consume(o),r}function r(o){return ct(o)?n(o):t(o)}}function oy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function sy(e){return!mt(e)}function ay(e){return!(e===47||Nd(e))}function Nd(e){return e===43||e===45||e===46||e===95||ct(e)}function wp(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const M2={tokenize:B2,partial:!0};function L2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:F2,continuation:{tokenize:H2},exit:G2}},text:{91:{name:"gfmFootnoteCall",tokenize:V2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:O2,resolveTo:R2}}}}function O2(e,t,n){const i=this;let r=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;r--;){const l=i.events[r][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=un(i.sliceSerialize({start:s.end,end:i.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function R2(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...a),e}function V2(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(un(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function F2(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(f){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(f){return f===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(f)}function d(f){if(s>999||f===93&&!a||f===null||f===91||De(f))return n(f);if(f===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=un(i.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(f)||(a=!0),s++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}function h(f){return f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),r.includes(o)||r.push(o),xe(e,p,"gfmFootnoteDefinitionWhitespace")):n(f)}function p(f){return t(f)}}function H2(e,t,n){return e.check(Ns,t,e.attempt(M2,t,n))}function G2(e){e.exit("gfmFootnoteDefinition")}function B2(e,t,n){const i=this;return xe(e,r,"gfmFootnoteDefinitionIndent",5);function r(o){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function $2(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&Tt(h,h.length,0,nu(p,s.slice(u+1,l),a)),Tt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),Tt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,d=this.events;let c=0;return h;function h(f){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(f):(s.enter("strikethroughSequenceTemporary"),p(f))}function p(f){const v=Zr(u);if(f===126)return c>1?l(f):(s.consume(f),c++,p);if(c<2&&!n)return l(f);const b=s.exit("strikethroughSequenceTemporary"),m=Zr(f);return b._open=!m||m===2&&!!v,b._close=!v||v===2&&!!m,a(f)}}}class W2{constructor(){this.map=[]}add(t,n,i){j2(this,t,n,i)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const o of r)t.push(o);r=i.pop()}this.map.length=0}}function j2(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...i);return}r+=1}e.map.push([t,n,i])}}function U2(e,t){let n=!1;const i=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function Y2(){return{flow:{null:{name:"table",tokenize:X2,resolveAll:Z2}}}}function X2(e,t,n){const i=this;let r=0,o=0,s;return a;function a(C){let I=i.events.length-1;for(;I>-1;){const D=i.events[I][1].type;if(D==="lineEnding"||D==="linePrefix")I--;else break}const L=I>-1?i.events[I][1].type:null,V=L==="tableHead"||L==="tableRow"?_:l;return V===_&&i.parser.lazy[i.now().line]?n(C):V(C)}function l(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(s=!0,o+=1),d(C)}function d(C){return C===null?n(C):ue(C)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),p):n(C):we(C)?xe(e,d,"whitespace")(C):(o+=1,s&&(s=!1,r+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),c(C)))}function c(C){return C===null||C===124||De(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?h:c)}function h(C){return C===92||C===124?(e.consume(C),c):c(C)}function p(C){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(C):(e.enter("tableDelimiterRow"),s=!1,we(C)?xe(e,f,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):f(C))}function f(C){return C===45||C===58?b(C):C===124?(s=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),v):k(C)}function v(C){return we(C)?xe(e,b,"whitespace")(C):b(C)}function b(C){return C===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),m):C===45?(o+=1,m(C)):C===null||ue(C)?y(C):k(C)}function m(C){return C===45?(e.enter("tableDelimiterFiller"),w(C)):k(C)}function w(C){return C===45?(e.consume(C),w):C===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(C))}function g(C){return we(C)?xe(e,y,"whitespace")(C):y(C)}function y(C){return C===124?f(C):C===null||ue(C)?!s||r!==o?k(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):k(C)}function k(C){return n(C)}function _(C){return e.enter("tableRow"),E(C)}function E(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),E):C===null||ue(C)?(e.exit("tableRow"),t(C)):we(C)?xe(e,E,"whitespace")(C):(e.enter("data"),S(C))}function S(C){return C===null||C===124||De(C)?(e.exit("data"),E(C)):(e.consume(C),C===92?T:S)}function T(C){return C===92||C===124?(e.consume(C),S):S(C)}}function Z2(e,t){let n=-1,i=!0,r=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,d,c;const h=new W2;for(;++n<e.length;){const p=e[n],f=p[1];p[0]==="enter"?f.type==="tableHead"?(a=!1,l!==0&&(sg(h,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(n,0,[["enter",u,t]])):f.type==="tableRow"||f.type==="tableDelimiterRow"?(i=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(n,0,[["enter",d,t]])),r=f.type==="tableDelimiterRow"?2:d?3:1):r&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=ua(h,t,o,r,void 0,c),o=[0,0,0,0]),s[2]=n)):f.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(s[0]=s[1],c=ua(h,t,o,r,void 0,c)),o=s,s=[o[1],n,0,0])):f.type==="tableHead"?(a=!0,l=n):f.type==="tableRow"||f.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=ua(h,t,o,r,n,c)):s[1]!==0&&(c=ua(h,t,s,r,n,c)),r=0):r&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&sg(h,t,l,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=U2(t.events,n))}return e}function ua(e,t,n,i,r,o){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},vr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=vr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=vr(t.events,n[2]),d=vr(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),i!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const f=n[2]+1,v=n[3]-n[2]-1;e.add(f,v,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return r!==void 0&&(o.end=Object.assign({},vr(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function sg(e,t,n,i,r){const o=[],s=vr(t.events,n);r&&(r.end=Object.assign({},s),o.push(["exit",r,t])),i.end=Object.assign({},s),o.push(["exit",i,t]),e.add(n+1,0,o)}function vr(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const q2={name:"tasklistCheck",tokenize:K2};function Q2(){return{text:{91:q2}}}function K2(e,t,n){const i=this;return r;function r(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ue(l)?t(l):we(l)?e.check({tokenize:J2},t,n)(l):n(l)}}function J2(e,t,n){return xe(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function eI(e){return gb([C2(),L2(),$2(e),Y2(),Q2()])}const tI={};function XV(e){const t=this,n=e||tI,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(eI(n)),o.push(x2()),s.push(_2(n))}const nI=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,iI=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,ZV=({legacyTitle:e=!1,tagName:t="div",classNames:n=""}={})=>i=>{su(i,"blockquote",(r,o,s)=>{let a="",l="",u=!0,d=r.children.map(c=>{if(u&&c.type==="paragraph"){const h=c.children[0],p=h.type==="text"?h.value:"",f=e?iI:nI,v=p.match(f);if(v&&(u=!1,a=v[1].toLocaleLowerCase(),l=e&&v[2]||a.toLocaleUpperCase(),p.includes(`
|
|
68
|
+
`))}function l(p,f,v,b){const m=v.enter("tableCell"),w=v.enter("phrasing"),g=v.containerPhrasing(p,{...b,before:o,after:o});return w(),m(),g}function u(p,f){return AA(p,{align:f,alignDelimiters:i,padding:n,stringLength:r})}function d(p,f,v){const b=p.children;let m=-1;const w=[],g=f.enter("table");for(;++m<b.length;)w[m]=c(b[m],f,v);return g(),w}function c(p,f,v){const b=p.children;let m=-1;const w=[],g=f.enter("tableRow");for(;++m<b.length;)w[m]=l(b[m],p,f,v);return g(),w}function h(p,f,v){let b=ey.inlineCode(p,f,v);return v.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function v2(){return{exit:{taskListCheckValueChecked:sg,taskListCheckValueUnchecked:sg,paragraph:b2}}}function w2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:y2}}}function sg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function b2(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=t.children;let o=-1,s;for(;++o<r.length;){const a=r[o];if(a.type==="paragraph"){s=a;break}}s===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function y2(e,t,n,i){const r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);o&&a.move(s);let l=ey.listItem(e,t,n,{...i,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+s}}function x2(){return[JP(),yA(),SA(),c2(),v2()]}function _2(e){return{extensions:[eA(),xA(e),CA(),g2(e),w2()]}}const k2={tokenize:P2,partial:!0},ty={tokenize:A2,partial:!0},ny={tokenize:I2,partial:!0},iy={tokenize:N2,partial:!0},S2={tokenize:T2,partial:!0},ry={name:"wwwAutolink",tokenize:D2,previous:sy},oy={name:"protocolAutolink",tokenize:z2,previous:ay},Yn={name:"emailAutolink",tokenize:E2,previous:ly},Pn={};function C2(){return{text:Pn}}let Mi=48;for(;Mi<123;)Pn[Mi]=Yn,Mi++,Mi===58?Mi=65:Mi===91&&(Mi=97);Pn[43]=Yn;Pn[45]=Yn;Pn[46]=Yn;Pn[95]=Yn;Pn[72]=[Yn,oy];Pn[104]=[Yn,oy];Pn[87]=[Yn,ry];Pn[119]=[Yn,ry];function E2(e,t,n){const i=this;let r,o;return s;function s(c){return!Nd(c)||!ly.call(i,i.previous)||wp(i.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Nd(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(S2,d,u)(c):c===45||c===95||ct(c)?(o=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),r=!0,l}function d(c){return o&&r&&mt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function D2(e,t,n){const i=this;return r;function r(s){return s!==87&&s!==119||!sy.call(i,i.previous)||wp(i.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(k2,e.attempt(ty,e.attempt(ny,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function z2(e,t,n){const i=this;let r="",o=!1;return s;function s(c){return(c===72||c===104)&&ay.call(i,i.previous)&&!wp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(mt(c)&&r.length<5)return r+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=r.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||vl(c)||De(c)||nr(c)||tu(c)?n(c):e.attempt(ty,e.attempt(ny,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function P2(e,t,n){let i=0;return r;function r(s){return(s===87||s===119)&&i<3?(i++,e.consume(s),r):s===46&&i===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function A2(e,t,n){let i,r,o;return s;function s(u){return u===46||u===95?e.check(iy,l,a)(u):u===null||De(u)||nr(u)||u!==45&&tu(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?i=!0:(r=i,i=void 0),e.consume(u),s}function l(u){return r||i||!o?n(u):t(u)}}function I2(e,t){let n=0,i=0;return r;function r(s){return s===40?(n++,e.consume(s),r):s===41&&i<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(iy,t,o)(s):s===null||De(s)||nr(s)?t(s):(e.consume(s),r)}function o(s){return s===41&&i++,e.consume(s),r}}function N2(e,t,n){return i;function i(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),i):a===38?(e.consume(a),o):a===93?(e.consume(a),r):a===60||a===null||De(a)||nr(a)?t(a):n(a)}function r(a){return a===null||a===40||a===91||De(a)||nr(a)?t(a):i(a)}function o(a){return mt(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),i):mt(a)?(e.consume(a),s):n(a)}}function T2(e,t,n){return i;function i(o){return e.consume(o),r}function r(o){return ct(o)?n(o):t(o)}}function sy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function ay(e){return!mt(e)}function ly(e){return!(e===47||Nd(e))}function Nd(e){return e===43||e===45||e===46||e===95||ct(e)}function wp(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const M2={tokenize:B2,partial:!0};function L2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:F2,continuation:{tokenize:H2},exit:G2}},text:{91:{name:"gfmFootnoteCall",tokenize:V2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:O2,resolveTo:R2}}}}function O2(e,t,n){const i=this;let r=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;r--;){const l=i.events[r][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=un(i.sliceSerialize({start:s.end,end:i.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function R2(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...a),e}function V2(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(un(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function F2(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(f){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(f){return f===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(f)}function d(f){if(s>999||f===93&&!a||f===null||f===91||De(f))return n(f);if(f===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=un(i.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(f)||(a=!0),s++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}function h(f){return f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),r.includes(o)||r.push(o),_e(e,p,"gfmFootnoteDefinitionWhitespace")):n(f)}function p(f){return t(f)}}function H2(e,t,n){return e.check(Ns,t,e.attempt(M2,t,n))}function G2(e){e.exit("gfmFootnoteDefinition")}function B2(e,t,n){const i=this;return _e(e,r,"gfmFootnoteDefinitionIndent",5);function r(o){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function $2(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&Tt(h,h.length,0,nu(p,s.slice(u+1,l),a)),Tt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),Tt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,d=this.events;let c=0;return h;function h(f){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(f):(s.enter("strikethroughSequenceTemporary"),p(f))}function p(f){const v=Zr(u);if(f===126)return c>1?l(f):(s.consume(f),c++,p);if(c<2&&!n)return l(f);const b=s.exit("strikethroughSequenceTemporary"),m=Zr(f);return b._open=!m||m===2&&!!v,b._close=!v||v===2&&!!m,a(f)}}}class W2{constructor(){this.map=[]}add(t,n,i){j2(this,t,n,i)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const o of r)t.push(o);r=i.pop()}this.map.length=0}}function j2(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...i);return}r+=1}e.map.push([t,n,i])}}function U2(e,t){let n=!1;const i=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function Y2(){return{flow:{null:{name:"table",tokenize:X2,resolveAll:Z2}}}}function X2(e,t,n){const i=this;let r=0,o=0,s;return a;function a(C){let I=i.events.length-1;for(;I>-1;){const D=i.events[I][1].type;if(D==="lineEnding"||D==="linePrefix")I--;else break}const L=I>-1?i.events[I][1].type:null,V=L==="tableHead"||L==="tableRow"?_:l;return V===_&&i.parser.lazy[i.now().line]?n(C):V(C)}function l(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(s=!0,o+=1),d(C)}function d(C){return C===null?n(C):ue(C)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),p):n(C):we(C)?_e(e,d,"whitespace")(C):(o+=1,s&&(s=!1,r+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),c(C)))}function c(C){return C===null||C===124||De(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?h:c)}function h(C){return C===92||C===124?(e.consume(C),c):c(C)}function p(C){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(C):(e.enter("tableDelimiterRow"),s=!1,we(C)?_e(e,f,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):f(C))}function f(C){return C===45||C===58?b(C):C===124?(s=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),v):k(C)}function v(C){return we(C)?_e(e,b,"whitespace")(C):b(C)}function b(C){return C===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),m):C===45?(o+=1,m(C)):C===null||ue(C)?y(C):k(C)}function m(C){return C===45?(e.enter("tableDelimiterFiller"),w(C)):k(C)}function w(C){return C===45?(e.consume(C),w):C===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(C))}function g(C){return we(C)?_e(e,y,"whitespace")(C):y(C)}function y(C){return C===124?f(C):C===null||ue(C)?!s||r!==o?k(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):k(C)}function k(C){return n(C)}function _(C){return e.enter("tableRow"),E(C)}function E(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),E):C===null||ue(C)?(e.exit("tableRow"),t(C)):we(C)?_e(e,E,"whitespace")(C):(e.enter("data"),S(C))}function S(C){return C===null||C===124||De(C)?(e.exit("data"),E(C)):(e.consume(C),C===92?T:S)}function T(C){return C===92||C===124?(e.consume(C),S):S(C)}}function Z2(e,t){let n=-1,i=!0,r=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,d,c;const h=new W2;for(;++n<e.length;){const p=e[n],f=p[1];p[0]==="enter"?f.type==="tableHead"?(a=!1,l!==0&&(ag(h,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(n,0,[["enter",u,t]])):f.type==="tableRow"||f.type==="tableDelimiterRow"?(i=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(n,0,[["enter",d,t]])),r=f.type==="tableDelimiterRow"?2:d?3:1):r&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=ua(h,t,o,r,void 0,c),o=[0,0,0,0]),s[2]=n)):f.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(s[0]=s[1],c=ua(h,t,o,r,void 0,c)),o=s,s=[o[1],n,0,0])):f.type==="tableHead"?(a=!0,l=n):f.type==="tableRow"||f.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=ua(h,t,o,r,n,c)):s[1]!==0&&(c=ua(h,t,s,r,n,c)),r=0):r&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&ag(h,t,l,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=U2(t.events,n))}return e}function ua(e,t,n,i,r,o){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},vr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=vr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=vr(t.events,n[2]),d=vr(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),i!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const f=n[2]+1,v=n[3]-n[2]-1;e.add(f,v,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return r!==void 0&&(o.end=Object.assign({},vr(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function ag(e,t,n,i,r){const o=[],s=vr(t.events,n);r&&(r.end=Object.assign({},s),o.push(["exit",r,t])),i.end=Object.assign({},s),o.push(["exit",i,t]),e.add(n+1,0,o)}function vr(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const q2={name:"tasklistCheck",tokenize:K2};function Q2(){return{text:{91:q2}}}function K2(e,t,n){const i=this;return r;function r(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ue(l)?t(l):we(l)?e.check({tokenize:J2},t,n)(l):n(l)}}function J2(e,t,n){return _e(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function eI(e){return vb([C2(),L2(),$2(e),Y2(),Q2()])}const tI={};function ZV(e){const t=this,n=e||tI,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(eI(n)),o.push(x2()),s.push(_2(n))}const nI=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,iI=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,qV=({legacyTitle:e=!1,tagName:t="div",classNames:n=""}={})=>i=>{su(i,"blockquote",(r,o,s)=>{let a="",l="",u=!0,d=r.children.map(c=>{if(u&&c.type==="paragraph"){const h=c.children[0],p=h.type==="text"?h.value:"",f=e?iI:nI,v=p.match(f);if(v&&(u=!1,a=v[1].toLocaleLowerCase(),l=e&&v[2]||a.toLocaleUpperCase(),p.includes(`
|
|
69
69
|
`)&&(c.children[0]={type:"text",value:p.replace(f,"").replace(/^\n+/,"")}),!p.includes(`
|
|
70
|
-
`))){const b=[];c.children.forEach((m,w)=>{w!=0&&(w==1&&m.type==="break"||b.push(m))}),c.children=[...b]}}return c});a&&(r.data={hName:t,hProperties:{className:["markdown-alert",`markdown-alert-${a}`,...n.split(" ").filter(c=>c.length)],dir:"auto"}},d.unshift({type:"paragraph",children:[rI(a),{type:"text",value:l.replace(/^\//,"")}],data:{hProperties:{className:"markdown-alert-title",dir:"auto"}}})),r.children=[...d]})};function rI(e){let t=oI[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{className:["octicon"],viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const oI={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function sI(e){Vb(e,[/\r?\n|\r/g,aI])}function aI(){return{type:"break"}}function qV(){return function(e){sI(e)}}function ly(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=ly(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function QV(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ly(e))&&(i&&(i+=" "),i+=t);return i}const lI=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},uI=(e,t)=>({classGroupId:e,validator:t}),uy=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xl="-",ag=[],cI="arbitrary..",dI=e=>{const t=pI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return hI(s);const a=s.split(xl),l=a[0]===""&&a.length>1?1:0;return cy(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=i[s],u=n[s];return l?u?lI(u,l):l:u||ag}return n[s]||ag}}},cy=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const u=cy(e,t+1,o);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(xl):e.slice(t).join(xl),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},hI=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?cI+i:void 0})(),pI=e=>{const{theme:t,classGroups:n}=e;return fI(n,t)},fI=(e,t)=>{const n=uy();for(const i in e){const r=e[i];bp(r,n,i,t)}return n},bp=(e,t,n,i)=>{const r=e.length;for(let o=0;o<r;o++){const s=e[o];mI(s,t,n,i)}},mI=(e,t,n,i)=>{if(typeof e=="string"){gI(e,t,n);return}if(typeof e=="function"){vI(e,t,n,i);return}wI(e,t,n,i)},gI=(e,t,n)=>{const i=e===""?t:dy(t,e);i.classGroupId=n},vI=(e,t,n,i)=>{if(bI(e)){bp(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(uI(n,e))},wI=(e,t,n,i)=>{const r=Object.entries(e),o=r.length;for(let s=0;s<o;s++){const[a,l]=r[s];bp(l,dy(t,a),n,i)}},dy=(e,t)=>{let n=e;const i=t.split(xl),r=i.length;for(let o=0;o<r;o++){const s=i[o];let a=n.nextPart.get(s);a||(a=uy(),n.nextPart.set(s,a)),n=a}return n},bI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const r=(o,s)=>{n[o]=s,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=i[o])!==void 0)return r(o,s),s},set(o,s){o in n?n[o]=s:r(o,s)}}},Td="!",lg=":",xI=[],ug=(e,t,n,i,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),_I=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=r=>{const o=[];let s=0,a=0,l=0,u;const d=r.length;for(let v=0;v<d;v++){const b=r[v];if(s===0&&a===0){if(b===lg){o.push(r.slice(l,v)),l=v+1;continue}if(b==="/"){u=v;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const c=o.length===0?r:r.slice(l);let h=c,p=!1;c.endsWith(Td)?(h=c.slice(0,-1),p=!0):c.startsWith(Td)&&(h=c.slice(1),p=!0);const f=u&&u>l?u-l:void 0;return ug(o,p,h,f)};if(t){const r=t+lg,o=i;i=s=>s.startsWith(r)?o(s.slice(r.length)):ug(xI,!1,s,void 0,!0)}if(n){const r=i;i=o=>n({className:o,parseClassName:r})}return i},kI=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let o=0;o<n.length;o++){const s=n[o],a=s[0]==="[",l=t.has(s);a||l?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(s)):r.push(s)}return r.length>0&&(r.sort(),i.push(...r)),i}},SI=e=>({cache:yI(e.cacheSize),parseClassName:_I(e),sortModifiers:kI(e),...dI(e)}),CI=/\s+/,EI=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:o}=t,s=[],a=e.trim().split(CI);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:c,modifiers:h,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:v}=n(d);if(c){l=d+(l.length>0?" "+l:l);continue}let b=!!v,m=i(b?f.substring(0,v):f);if(!m){if(!b){l=d+(l.length>0?" "+l:l);continue}if(m=i(f),!m){l=d+(l.length>0?" "+l:l);continue}b=!1}const w=h.length===0?"":h.length===1?h[0]:o(h).join(":"),g=p?w+Td:w,y=g+m;if(s.indexOf(y)>-1)continue;s.push(y);const k=r(m,b);for(let _=0;_<k.length;++_){const E=k[_];s.push(g+E)}l=d+(l.length>0?" "+l:l)}return l},DI=(...e)=>{let t=0,n,i,r="";for(;t<e.length;)(n=e[t++])&&(i=hy(n))&&(r&&(r+=" "),r+=i);return r},hy=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=hy(e[i]))&&(n&&(n+=" "),n+=t);return n},zI=(e,...t)=>{let n,i,r,o;const s=l=>{const u=t.reduce((d,c)=>c(d),e());return n=SI(u),i=n.cache.get,r=n.cache.set,o=a,a(l)},a=l=>{const u=i(l);if(u)return u;const d=EI(l,n);return r(l,d),d};return o=s,(...l)=>o(DI(...l))},PI=[],Ze=e=>{const t=n=>n[e]||PI;return t.isThemeGetter=!0,t},py=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,II=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,TI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,MI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kn=e=>AI.test(e),me=e=>!!e&&!Number.isNaN(Number(e)),Jn=e=>!!e&&Number.isInteger(Number(e)),mc=e=>e.endsWith("%")&&me(e.slice(0,-1)),Nn=e=>II.test(e),my=()=>!0,OI=e=>NI.test(e)&&!TI.test(e),yp=()=>!1,RI=e=>MI.test(e),VI=e=>LI.test(e),FI=e=>!ee(e)&&!te(e),HI=e=>Di(e,wy,yp),ee=e=>py.test(e),Li=e=>Di(e,by,OI),cg=e=>Di(e,XI,me),GI=e=>Di(e,xy,my),BI=e=>Di(e,yy,yp),dg=e=>Di(e,gy,yp),$I=e=>Di(e,vy,VI),ca=e=>Di(e,_y,RI),te=e=>fy.test(e),_o=e=>cr(e,by),WI=e=>cr(e,yy),hg=e=>cr(e,gy),jI=e=>cr(e,wy),UI=e=>cr(e,vy),da=e=>cr(e,_y,!0),YI=e=>cr(e,xy,!0),Di=(e,t,n)=>{const i=py.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},cr=(e,t,n=!1)=>{const i=fy.exec(e);return i?i[1]?t(i[1]):n:!1},gy=e=>e==="position"||e==="percentage",vy=e=>e==="image"||e==="url",wy=e=>e==="length"||e==="size"||e==="bg-size",by=e=>e==="length",XI=e=>e==="number",yy=e=>e==="family-name",xy=e=>e==="number"||e==="weight",_y=e=>e==="shadow",ZI=()=>{const e=Ze("color"),t=Ze("font"),n=Ze("text"),i=Ze("font-weight"),r=Ze("tracking"),o=Ze("leading"),s=Ze("breakpoint"),a=Ze("container"),l=Ze("spacing"),u=Ze("radius"),d=Ze("shadow"),c=Ze("inset-shadow"),h=Ze("text-shadow"),p=Ze("drop-shadow"),f=Ze("blur"),v=Ze("perspective"),b=Ze("aspect"),m=Ze("ease"),w=Ze("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...y(),te,ee],_=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],S=()=>[te,ee,l],T=()=>[Kn,"full","auto",...S()],C=()=>[Jn,"none","subgrid",te,ee],I=()=>["auto",{span:["full",Jn,te,ee]},Jn,te,ee],L=()=>[Jn,"auto",te,ee],V=()=>["auto","min","max","fr",te,ee],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...S()],O=()=>[Kn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],N=()=>[Kn,"screen","full","dvw","lvw","svw","min","max","fit",...S()],M=()=>[Kn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],x=()=>[e,te,ee],F=()=>[...y(),hg,dg,{position:[te,ee]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",jI,HI,{size:[te,ee]}],X=()=>[mc,_o,Li],q=()=>["","none","full",u,te,ee],U=()=>["",me,_o,Li],K=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[me,mc,hg,dg],de=()=>["","none",f,te,ee],le=()=>["none",me,te,ee],se=()=>["none",me,te,ee],oe=()=>[me,te,ee],ge=()=>[Kn,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Nn],breakpoint:[Nn],color:[my],container:[Nn],"drop-shadow":[Nn],ease:["in","out","in-out"],font:[FI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Nn],shadow:[Nn],spacing:["px",me],text:[Nn],"text-shadow":[Nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Kn,ee,te,b]}],container:["container"],columns:[{columns:[me,ee,te,a]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Jn,"auto",te,ee]}],basis:[{basis:[Kn,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[me,Kn,"auto","initial","none",ee]}],grow:[{grow:["",me,te,ee]}],shrink:[{shrink:["",me,te,ee]}],order:[{order:[Jn,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[a,"screen",...O()]}],"min-w":[{"min-w":[a,"screen","none",...O()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,_o,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,YI,GI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mc,ee]}],"font-family":[{font:[WI,BI,t]}],"font-features":[{"font-features":[ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,te,ee]}],"line-clamp":[{"line-clamp":[me,"none",te,cg]}],leading:[{leading:[o,...S()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:x()}],"text-color":[{text:x()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[me,"from-font","auto",te,Li]}],"text-decoration-color":[{decoration:x()}],"underline-offset":[{"underline-offset":[me,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jn,te,ee],radial:["",te,ee],conic:[Jn,te,ee]},UI,$I]}],"bg-color":[{bg:x()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:x()}],"gradient-via":[{via:x()}],"gradient-to":[{to:x()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-bs":[{"border-bs":U()}],"border-w-be":[{"border-be":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:x()}],"border-color-x":[{"border-x":x()}],"border-color-y":[{"border-y":x()}],"border-color-s":[{"border-s":x()}],"border-color-e":[{"border-e":x()}],"border-color-bs":[{"border-bs":x()}],"border-color-be":[{"border-be":x()}],"border-color-t":[{"border-t":x()}],"border-color-r":[{"border-r":x()}],"border-color-b":[{"border-b":x()}],"border-color-l":[{"border-l":x()}],"divide-color":[{divide:x()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[me,te,ee]}],"outline-w":[{outline:["",me,_o,Li]}],"outline-color":[{outline:x()}],shadow:[{shadow:["","none",d,da,ca]}],"shadow-color":[{shadow:x()}],"inset-shadow":[{"inset-shadow":["none",c,da,ca]}],"inset-shadow-color":[{"inset-shadow":x()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:x()}],"ring-offset-w":[{"ring-offset":[me,Li]}],"ring-offset-color":[{"ring-offset":x()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":x()}],"text-shadow":[{"text-shadow":["none",h,da,ca]}],"text-shadow-color":[{"text-shadow":x()}],opacity:[{opacity:[me,te,ee]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[me]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":x()}],"mask-image-linear-to-color":[{"mask-linear-to":x()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":x()}],"mask-image-t-to-color":[{"mask-t-to":x()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":x()}],"mask-image-r-to-color":[{"mask-r-to":x()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":x()}],"mask-image-b-to-color":[{"mask-b-to":x()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":x()}],"mask-image-l-to-color":[{"mask-l-to":x()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":x()}],"mask-image-x-to-color":[{"mask-x-to":x()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":x()}],"mask-image-y-to-color":[{"mask-y-to":x()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":x()}],"mask-image-radial-to-color":[{"mask-radial-to":x()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[me]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":x()}],"mask-image-conic-to-color":[{"mask-conic-to":x()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:de()}],brightness:[{brightness:[me,te,ee]}],contrast:[{contrast:[me,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",p,da,ca]}],"drop-shadow-color":[{"drop-shadow":x()}],grayscale:[{grayscale:["",me,te,ee]}],"hue-rotate":[{"hue-rotate":[me,te,ee]}],invert:[{invert:["",me,te,ee]}],saturate:[{saturate:[me,te,ee]}],sepia:[{sepia:["",me,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[me,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[me,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",me,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[me,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",me,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[me,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[me,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",me,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[me,"initial",te,ee]}],ease:[{ease:["linear","initial",m,te,ee]}],delay:[{delay:[me,te,ee]}],animate:[{animate:["none",w,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,te,ee]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":["translate-none"],accent:[{accent:x()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:x()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,ee]}],fill:[{fill:["none",...x()]}],"stroke-w":[{stroke:[me,_o,Li,cg]}],stroke:[{stroke:["none",...x()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},KV=zI(ZI);/**
|
|
70
|
+
`))){const b=[];c.children.forEach((m,w)=>{w!=0&&(w==1&&m.type==="break"||b.push(m))}),c.children=[...b]}}return c});a&&(r.data={hName:t,hProperties:{className:["markdown-alert",`markdown-alert-${a}`,...n.split(" ").filter(c=>c.length)],dir:"auto"}},d.unshift({type:"paragraph",children:[rI(a),{type:"text",value:l.replace(/^\//,"")}],data:{hProperties:{className:"markdown-alert-title",dir:"auto"}}})),r.children=[...d]})};function rI(e){let t=oI[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{className:["octicon"],viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const oI={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function sI(e){Fb(e,[/\r?\n|\r/g,aI])}function aI(){return{type:"break"}}function QV(){return function(e){sI(e)}}function uy(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=uy(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function KV(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=uy(e))&&(i&&(i+=" "),i+=t);return i}const lI=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},uI=(e,t)=>({classGroupId:e,validator:t}),cy=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xl="-",lg=[],cI="arbitrary..",dI=e=>{const t=pI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return hI(s);const a=s.split(xl),l=a[0]===""&&a.length>1?1:0;return dy(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=i[s],u=n[s];return l?u?lI(u,l):l:u||lg}return n[s]||lg}}},dy=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const u=dy(e,t+1,o);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(xl):e.slice(t).join(xl),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},hI=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?cI+i:void 0})(),pI=e=>{const{theme:t,classGroups:n}=e;return fI(n,t)},fI=(e,t)=>{const n=cy();for(const i in e){const r=e[i];bp(r,n,i,t)}return n},bp=(e,t,n,i)=>{const r=e.length;for(let o=0;o<r;o++){const s=e[o];mI(s,t,n,i)}},mI=(e,t,n,i)=>{if(typeof e=="string"){gI(e,t,n);return}if(typeof e=="function"){vI(e,t,n,i);return}wI(e,t,n,i)},gI=(e,t,n)=>{const i=e===""?t:hy(t,e);i.classGroupId=n},vI=(e,t,n,i)=>{if(bI(e)){bp(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(uI(n,e))},wI=(e,t,n,i)=>{const r=Object.entries(e),o=r.length;for(let s=0;s<o;s++){const[a,l]=r[s];bp(l,hy(t,a),n,i)}},hy=(e,t)=>{let n=e;const i=t.split(xl),r=i.length;for(let o=0;o<r;o++){const s=i[o];let a=n.nextPart.get(s);a||(a=cy(),n.nextPart.set(s,a)),n=a}return n},bI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const r=(o,s)=>{n[o]=s,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=i[o])!==void 0)return r(o,s),s},set(o,s){o in n?n[o]=s:r(o,s)}}},Td="!",ug=":",xI=[],cg=(e,t,n,i,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),_I=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=r=>{const o=[];let s=0,a=0,l=0,u;const d=r.length;for(let v=0;v<d;v++){const b=r[v];if(s===0&&a===0){if(b===ug){o.push(r.slice(l,v)),l=v+1;continue}if(b==="/"){u=v;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const c=o.length===0?r:r.slice(l);let h=c,p=!1;c.endsWith(Td)?(h=c.slice(0,-1),p=!0):c.startsWith(Td)&&(h=c.slice(1),p=!0);const f=u&&u>l?u-l:void 0;return cg(o,p,h,f)};if(t){const r=t+ug,o=i;i=s=>s.startsWith(r)?o(s.slice(r.length)):cg(xI,!1,s,void 0,!0)}if(n){const r=i;i=o=>n({className:o,parseClassName:r})}return i},kI=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let o=0;o<n.length;o++){const s=n[o],a=s[0]==="[",l=t.has(s);a||l?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(s)):r.push(s)}return r.length>0&&(r.sort(),i.push(...r)),i}},SI=e=>({cache:yI(e.cacheSize),parseClassName:_I(e),sortModifiers:kI(e),...dI(e)}),CI=/\s+/,EI=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:o}=t,s=[],a=e.trim().split(CI);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:c,modifiers:h,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:v}=n(d);if(c){l=d+(l.length>0?" "+l:l);continue}let b=!!v,m=i(b?f.substring(0,v):f);if(!m){if(!b){l=d+(l.length>0?" "+l:l);continue}if(m=i(f),!m){l=d+(l.length>0?" "+l:l);continue}b=!1}const w=h.length===0?"":h.length===1?h[0]:o(h).join(":"),g=p?w+Td:w,y=g+m;if(s.indexOf(y)>-1)continue;s.push(y);const k=r(m,b);for(let _=0;_<k.length;++_){const E=k[_];s.push(g+E)}l=d+(l.length>0?" "+l:l)}return l},DI=(...e)=>{let t=0,n,i,r="";for(;t<e.length;)(n=e[t++])&&(i=py(n))&&(r&&(r+=" "),r+=i);return r},py=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=py(e[i]))&&(n&&(n+=" "),n+=t);return n},zI=(e,...t)=>{let n,i,r,o;const s=l=>{const u=t.reduce((d,c)=>c(d),e());return n=SI(u),i=n.cache.get,r=n.cache.set,o=a,a(l)},a=l=>{const u=i(l);if(u)return u;const d=EI(l,n);return r(l,d),d};return o=s,(...l)=>o(DI(...l))},PI=[],Ze=e=>{const t=n=>n[e]||PI;return t.isThemeGetter=!0,t},fy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,my=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,II=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,TI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,MI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kn=e=>AI.test(e),me=e=>!!e&&!Number.isNaN(Number(e)),Jn=e=>!!e&&Number.isInteger(Number(e)),mc=e=>e.endsWith("%")&&me(e.slice(0,-1)),Nn=e=>II.test(e),gy=()=>!0,OI=e=>NI.test(e)&&!TI.test(e),yp=()=>!1,RI=e=>MI.test(e),VI=e=>LI.test(e),FI=e=>!ee(e)&&!te(e),HI=e=>Di(e,by,yp),ee=e=>fy.test(e),Li=e=>Di(e,yy,OI),dg=e=>Di(e,XI,me),GI=e=>Di(e,_y,gy),BI=e=>Di(e,xy,yp),hg=e=>Di(e,vy,yp),$I=e=>Di(e,wy,VI),ca=e=>Di(e,ky,RI),te=e=>my.test(e),_o=e=>cr(e,yy),WI=e=>cr(e,xy),pg=e=>cr(e,vy),jI=e=>cr(e,by),UI=e=>cr(e,wy),da=e=>cr(e,ky,!0),YI=e=>cr(e,_y,!0),Di=(e,t,n)=>{const i=fy.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},cr=(e,t,n=!1)=>{const i=my.exec(e);return i?i[1]?t(i[1]):n:!1},vy=e=>e==="position"||e==="percentage",wy=e=>e==="image"||e==="url",by=e=>e==="length"||e==="size"||e==="bg-size",yy=e=>e==="length",XI=e=>e==="number",xy=e=>e==="family-name",_y=e=>e==="number"||e==="weight",ky=e=>e==="shadow",ZI=()=>{const e=Ze("color"),t=Ze("font"),n=Ze("text"),i=Ze("font-weight"),r=Ze("tracking"),o=Ze("leading"),s=Ze("breakpoint"),a=Ze("container"),l=Ze("spacing"),u=Ze("radius"),d=Ze("shadow"),c=Ze("inset-shadow"),h=Ze("text-shadow"),p=Ze("drop-shadow"),f=Ze("blur"),v=Ze("perspective"),b=Ze("aspect"),m=Ze("ease"),w=Ze("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...y(),te,ee],_=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],S=()=>[te,ee,l],T=()=>[Kn,"full","auto",...S()],C=()=>[Jn,"none","subgrid",te,ee],I=()=>["auto",{span:["full",Jn,te,ee]},Jn,te,ee],L=()=>[Jn,"auto",te,ee],V=()=>["auto","min","max","fr",te,ee],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...S()],O=()=>[Kn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],N=()=>[Kn,"screen","full","dvw","lvw","svw","min","max","fit",...S()],M=()=>[Kn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],x=()=>[e,te,ee],F=()=>[...y(),pg,hg,{position:[te,ee]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",jI,HI,{size:[te,ee]}],X=()=>[mc,_o,Li],q=()=>["","none","full",u,te,ee],U=()=>["",me,_o,Li],K=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[me,mc,pg,hg],de=()=>["","none",f,te,ee],le=()=>["none",me,te,ee],se=()=>["none",me,te,ee],oe=()=>[me,te,ee],ge=()=>[Kn,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Nn],breakpoint:[Nn],color:[gy],container:[Nn],"drop-shadow":[Nn],ease:["in","out","in-out"],font:[FI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Nn],shadow:[Nn],spacing:["px",me],text:[Nn],"text-shadow":[Nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Kn,ee,te,b]}],container:["container"],columns:[{columns:[me,ee,te,a]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Jn,"auto",te,ee]}],basis:[{basis:[Kn,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[me,Kn,"auto","initial","none",ee]}],grow:[{grow:["",me,te,ee]}],shrink:[{shrink:["",me,te,ee]}],order:[{order:[Jn,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[a,"screen",...O()]}],"min-w":[{"min-w":[a,"screen","none",...O()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,_o,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,YI,GI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mc,ee]}],"font-family":[{font:[WI,BI,t]}],"font-features":[{"font-features":[ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,te,ee]}],"line-clamp":[{"line-clamp":[me,"none",te,dg]}],leading:[{leading:[o,...S()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:x()}],"text-color":[{text:x()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[me,"from-font","auto",te,Li]}],"text-decoration-color":[{decoration:x()}],"underline-offset":[{"underline-offset":[me,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jn,te,ee],radial:["",te,ee],conic:[Jn,te,ee]},UI,$I]}],"bg-color":[{bg:x()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:x()}],"gradient-via":[{via:x()}],"gradient-to":[{to:x()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-bs":[{"border-bs":U()}],"border-w-be":[{"border-be":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:x()}],"border-color-x":[{"border-x":x()}],"border-color-y":[{"border-y":x()}],"border-color-s":[{"border-s":x()}],"border-color-e":[{"border-e":x()}],"border-color-bs":[{"border-bs":x()}],"border-color-be":[{"border-be":x()}],"border-color-t":[{"border-t":x()}],"border-color-r":[{"border-r":x()}],"border-color-b":[{"border-b":x()}],"border-color-l":[{"border-l":x()}],"divide-color":[{divide:x()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[me,te,ee]}],"outline-w":[{outline:["",me,_o,Li]}],"outline-color":[{outline:x()}],shadow:[{shadow:["","none",d,da,ca]}],"shadow-color":[{shadow:x()}],"inset-shadow":[{"inset-shadow":["none",c,da,ca]}],"inset-shadow-color":[{"inset-shadow":x()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:x()}],"ring-offset-w":[{"ring-offset":[me,Li]}],"ring-offset-color":[{"ring-offset":x()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":x()}],"text-shadow":[{"text-shadow":["none",h,da,ca]}],"text-shadow-color":[{"text-shadow":x()}],opacity:[{opacity:[me,te,ee]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[me]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":x()}],"mask-image-linear-to-color":[{"mask-linear-to":x()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":x()}],"mask-image-t-to-color":[{"mask-t-to":x()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":x()}],"mask-image-r-to-color":[{"mask-r-to":x()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":x()}],"mask-image-b-to-color":[{"mask-b-to":x()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":x()}],"mask-image-l-to-color":[{"mask-l-to":x()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":x()}],"mask-image-x-to-color":[{"mask-x-to":x()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":x()}],"mask-image-y-to-color":[{"mask-y-to":x()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":x()}],"mask-image-radial-to-color":[{"mask-radial-to":x()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[me]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":x()}],"mask-image-conic-to-color":[{"mask-conic-to":x()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:de()}],brightness:[{brightness:[me,te,ee]}],contrast:[{contrast:[me,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",p,da,ca]}],"drop-shadow-color":[{"drop-shadow":x()}],grayscale:[{grayscale:["",me,te,ee]}],"hue-rotate":[{"hue-rotate":[me,te,ee]}],invert:[{invert:["",me,te,ee]}],saturate:[{saturate:[me,te,ee]}],sepia:[{sepia:["",me,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[me,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[me,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",me,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[me,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",me,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[me,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[me,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",me,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[me,"initial",te,ee]}],ease:[{ease:["linear","initial",m,te,ee]}],delay:[{delay:[me,te,ee]}],animate:[{animate:["none",w,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,te,ee]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":["translate-none"],accent:[{accent:x()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:x()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,ee]}],fill:[{fill:["none",...x()]}],"stroke-w":[{stroke:[me,_o,Li,dg]}],stroke:[{stroke:["none",...x()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},JV=zI(ZI);/**
|
|
71
71
|
* @remix-run/router v1.23.2
|
|
72
72
|
*
|
|
73
73
|
* Copyright (c) Remix Software Inc.
|
|
@@ -76,7 +76,7 @@ Error generating stack: `+o.message+`
|
|
|
76
76
|
* LICENSE.md file in the root directory of this source tree.
|
|
77
77
|
*
|
|
78
78
|
* @license MIT
|
|
79
|
-
*/function hs(){return hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},hs.apply(this,arguments)}var ci;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ci||(ci={}));const
|
|
79
|
+
*/function hs(){return hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},hs.apply(this,arguments)}var ci;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ci||(ci={}));const fg="popstate";function qI(e){e===void 0&&(e={});function t(i,r){let{pathname:o,search:s,hash:a}=i.location;return Md("",{pathname:o,search:s,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(i,r){return typeof r=="string"?r:Sy(r)}return KI(t,n,null,e)}function Ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xp(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function QI(){return Math.random().toString(36).substr(2,8)}function mg(e,t){return{usr:e.state,key:e.key,idx:t}}function Md(e,t,n,i){return n===void 0&&(n=null),hs({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?uo(t):t,{state:n,key:t&&t.key||i||QI()})}function Sy(e){let{pathname:t="/",search:n="",hash:i=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function uo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substr(i),e=e.substr(0,i)),e&&(t.pathname=e)}return t}function KI(e,t,n,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:o=!1}=i,s=r.history,a=ci.Pop,l=null,u=d();u==null&&(u=0,s.replaceState(hs({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function c(){a=ci.Pop;let b=d(),m=b==null?null:b-u;u=b,l&&l({action:a,location:v.location,delta:m})}function h(b,m){a=ci.Push;let w=Md(v.location,b,m);u=d()+1;let g=mg(w,u),y=v.createHref(w);try{s.pushState(g,"",y)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(y)}o&&l&&l({action:a,location:v.location,delta:1})}function p(b,m){a=ci.Replace;let w=Md(v.location,b,m);u=d();let g=mg(w,u),y=v.createHref(w);s.replaceState(g,"",y),o&&l&&l({action:a,location:v.location,delta:0})}function f(b){let m=r.location.origin!=="null"?r.location.origin:r.location.href,w=typeof b=="string"?b:Sy(b);return w=w.replace(/ $/,"%20"),Ue(m,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,m)}let v={get action(){return a},get location(){return e(r,s)},listen(b){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(fg,c),l=b,()=>{r.removeEventListener(fg,c),l=null}},createHref(b){return t(r,b)},createURL:f,encodeLocation(b){let m=f(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:p,go(b){return s.go(b)}};return v}var gg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gg||(gg={}));function JI(e,t,n){return n===void 0&&(n="/"),eN(e,t,n)}function eN(e,t,n,i){let r=typeof t=="string"?uo(t):t,o=Dy(r.pathname||"/",n);if(o==null)return null;let s=Cy(e);tN(s);let a=null;for(let l=0;a==null&&l<s.length;++l){let u=pN(o);a=cN(s[l],u)}return a}function Cy(e,t,n,i){t===void 0&&(t=[]),n===void 0&&(n=[]),i===void 0&&(i="");let r=(o,s,a)=>{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Ue(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let u=Yi([i,l.relativePath]),d=n.concat(l);o.children&&o.children.length>0&&(Ue(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Cy(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:lN(u,o.index),routesMeta:d})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))r(o,s);else for(let l of Ey(o.path))r(o,s,l)}),t}function Ey(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let s=Ey(i.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),r&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function tN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:uN(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}const nN=/^:[\w-]+$/,iN=3,rN=2,oN=1,sN=10,aN=-2,vg=e=>e==="*";function lN(e,t){let n=e.split("/"),i=n.length;return n.some(vg)&&(i+=aN),t&&(i+=rN),n.filter(r=>!vg(r)).reduce((r,o)=>r+(nN.test(o)?iN:o===""?oN:sN),i)}function uN(e,t){return e.length===t.length&&e.slice(0,-1).every((i,r)=>i===t[r])?e[e.length-1]-t[t.length-1]:0}function cN(e,t,n){let{routesMeta:i}=e,r={},o="/",s=[];for(let a=0;a<i.length;++a){let l=i[a],u=a===i.length-1,d=o==="/"?t:t.slice(o.length)||"/",c=dN({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),h=l.route;if(!c)return null;Object.assign(r,c.params),s.push({params:r,pathname:Yi([o,c.pathname]),pathnameBase:wN(Yi([o,c.pathnameBase])),route:h}),c.pathnameBase!=="/"&&(o=Yi([o,c.pathnameBase]))}return s}function dN(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=hN(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let o=r[0],s=o.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce((u,d,c)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let v=a[c]||"";s=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const f=a[c];return p&&!f?u[h]=void 0:u[h]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:s,pattern:e}}function hN(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),xp(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(i.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),i]}function pN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xp(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Dy(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}const fN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mN=e=>fN.test(e);function gN(e,t){t===void 0&&(t="/");let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?uo(e):e,o;if(n)if(mN(n))o=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),xp(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?o=wg(n.substring(1),"/"):o=wg(n,t)}else o=t;return{pathname:o,search:bN(i),hash:yN(r)}}function wg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function gc(e,t,n,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zy(e,t){let n=vN(e);return t?n.map((i,r)=>r===n.length-1?i.pathname:i.pathnameBase):n.map(i=>i.pathnameBase)}function Py(e,t,n,i){i===void 0&&(i=!1);let r;typeof e=="string"?r=uo(e):(r=hs({},e),Ue(!r.pathname||!r.pathname.includes("?"),gc("?","pathname","search",r)),Ue(!r.pathname||!r.pathname.includes("#"),gc("#","pathname","hash",r)),Ue(!r.search||!r.search.includes("#"),gc("#","search","hash",r)));let o=e===""||r.pathname==="",s=o?"/":r.pathname,a;if(s==null)a=n;else{let c=t.length-1;if(!i&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),c-=1;r.pathname=h.join("/")}a=c>=0?t[c]:"/"}let l=gN(r,a),u=s&&s!=="/"&&s.endsWith("/"),d=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Yi=e=>e.join("/").replace(/\/\/+/g,"/"),wN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ay=["post","put","patch","delete"];new Set(Ay);const _N=["get",...Ay];new Set(_N);/**
|
|
80
80
|
* React Router v6.30.3
|
|
81
81
|
*
|
|
82
82
|
* Copyright (c) Remix Software Inc.
|
|
@@ -85,7 +85,7 @@ Error generating stack: `+o.message+`
|
|
|
85
85
|
* LICENSE.md file in the root directory of this source tree.
|
|
86
86
|
*
|
|
87
87
|
* @license MIT
|
|
88
|
-
*/function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ps.apply(this,arguments)}const _p=R.createContext(null),kN=R.createContext(null),Ms=R.createContext(null),au=R.createContext(null),zi=R.createContext({outlet:null,matches:[],isDataRoute:!1}),
|
|
88
|
+
*/function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ps.apply(this,arguments)}const _p=R.createContext(null),kN=R.createContext(null),Ms=R.createContext(null),au=R.createContext(null),zi=R.createContext({outlet:null,matches:[],isDataRoute:!1}),Iy=R.createContext(null);function Ls(){return R.useContext(au)!=null}function lu(){return Ls()||Ue(!1),R.useContext(au).location}function Ny(e){R.useContext(Ms).static||R.useLayoutEffect(e)}function Ty(){let{isDataRoute:e}=R.useContext(zi);return e?ON():SN()}function SN(){Ls()||Ue(!1);let e=R.useContext(_p),{basename:t,future:n,navigator:i}=R.useContext(Ms),{matches:r}=R.useContext(zi),{pathname:o}=lu(),s=JSON.stringify(zy(r,n.v7_relativeSplatPath)),a=R.useRef(!1);return Ny(()=>{a.current=!0}),R.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){i.go(u);return}let c=Py(u,JSON.parse(s),o,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Yi([t,c.pathname])),(d.replace?i.replace:i.push)(c,d.state,d)},[t,i,s,o,e])}function e8(){let{matches:e}=R.useContext(zi),t=e[e.length-1];return t?t.params:{}}function CN(e,t){return EN(e,t)}function EN(e,t,n,i){Ls()||Ue(!1);let{navigator:r}=R.useContext(Ms),{matches:o}=R.useContext(zi),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=lu(),d;if(t){var c;let b=typeof t=="string"?uo(t):t;l==="/"||(c=b.pathname)!=null&&c.startsWith(l)||Ue(!1),d=b}else d=u;let h=d.pathname||"/",p=h;if(l!=="/"){let b=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let f=JI(e,{pathname:p}),v=IN(f&&f.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:Yi([l,r.encodeLocation?r.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:Yi([l,r.encodeLocation?r.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,n,i);return t&&v?R.createElement(au.Provider,{value:{location:ps({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ci.Pop}},v):v}function DN(){let e=LN(),t=xN(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},t),n?R.createElement("pre",{style:r},n):null,null)}const zN=R.createElement(DN,null);class PN extends R.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?R.createElement(zi.Provider,{value:this.props.routeContext},R.createElement(Iy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AN(e){let{routeContext:t,match:n,children:i}=e,r=R.useContext(_p);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),R.createElement(zi.Provider,{value:t},i)}function IN(e,t,n,i){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),i===void 0&&(i=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=i)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let d=s.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);d>=0||Ue(!1),s=s.slice(0,Math.min(s.length,d+1))}let l=!1,u=-1;if(n&&i&&i.v7_partialHydration)for(let d=0;d<s.length;d++){let c=s[d];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(u=d),c.route.id){let{loaderData:h,errors:p}=n,f=c.route.loader&&h[c.route.id]===void 0&&(!p||p[c.route.id]===void 0);if(c.route.lazy||f){l=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,c,h)=>{let p,f=!1,v=null,b=null;n&&(p=a&&c.route.id?a[c.route.id]:void 0,v=c.route.errorElement||zN,l&&(u<0&&h===0?(RN("route-fallback"),f=!0,b=null):u===h&&(f=!0,b=c.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,h+1)),w=()=>{let g;return p?g=v:f?g=b:c.route.Component?g=R.createElement(c.route.Component,null):c.route.element?g=c.route.element:g=d,R.createElement(AN,{match:c,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:g})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?R.createElement(PN,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:w(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):w()},null)}var My=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(My||{}),Ly=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ly||{});function NN(e){let t=R.useContext(_p);return t||Ue(!1),t}function TN(e){let t=R.useContext(kN);return t||Ue(!1),t}function MN(e){let t=R.useContext(zi);return t||Ue(!1),t}function Oy(e){let t=MN(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function LN(){var e;let t=R.useContext(Iy),n=TN(),i=Oy();return t!==void 0?t:(e=n.errors)==null?void 0:e[i]}function ON(){let{router:e}=NN(My.UseNavigateStable),t=Oy(Ly.UseNavigateStable),n=R.useRef(!1);return Ny(()=>{n.current=!0}),R.useCallback(function(r,o){o===void 0&&(o={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,ps({fromRouteId:t},o)))},[e,t])}const bg={};function RN(e,t,n){bg[e]||(bg[e]=!0)}function VN(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function t8(e){let{to:t,replace:n,state:i,relative:r}=e;Ls()||Ue(!1);let{future:o,static:s}=R.useContext(Ms),{matches:a}=R.useContext(zi),{pathname:l}=lu(),u=Ty(),d=Py(t,zy(a,o.v7_relativeSplatPath),l,r==="path"),c=JSON.stringify(d);return R.useEffect(()=>u(JSON.parse(c),{replace:n,state:i,relative:r}),[u,c,r,n,i]),null}function FN(e){Ue(!1)}function HN(e){let{basename:t="/",children:n=null,location:i,navigationType:r=ci.Pop,navigator:o,static:s=!1,future:a}=e;Ls()&&Ue(!1);let l=t.replace(/^\/*/,"/"),u=R.useMemo(()=>({basename:l,navigator:o,static:s,future:ps({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof i=="string"&&(i=uo(i));let{pathname:d="/",search:c="",hash:h="",state:p=null,key:f="default"}=i,v=R.useMemo(()=>{let b=Dy(d,l);return b==null?null:{location:{pathname:b,search:c,hash:h,state:p,key:f},navigationType:r}},[l,d,c,h,p,f,r]);return v==null?null:R.createElement(Ms.Provider,{value:u},R.createElement(au.Provider,{children:n,value:v}))}function n8(e){let{children:t,location:n}=e;return CN(Ld(t),n)}new Promise(()=>{});function Ld(e,t){t===void 0&&(t=[]);let n=[];return R.Children.forEach(e,(i,r)=>{if(!R.isValidElement(i))return;let o=[...t,r];if(i.type===R.Fragment){n.push.apply(n,Ld(i.props.children,o));return}i.type!==FN&&Ue(!1),!i.props.index||!i.props.children||Ue(!1);let s={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(s.children=Ld(i.props.children,o)),n.push(s)}),n}/**
|
|
89
89
|
* React Router DOM v6.30.3
|
|
90
90
|
*
|
|
91
91
|
* Copyright (c) Remix Software Inc.
|
|
@@ -94,7 +94,7 @@ Error generating stack: `+o.message+`
|
|
|
94
94
|
* LICENSE.md file in the root directory of this source tree.
|
|
95
95
|
*
|
|
96
96
|
* @license MIT
|
|
97
|
-
*/function Od(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function GN(e,t){let n=Od(e);return t&&t.forEach((i,r)=>{n.has(r)||t.getAll(r).forEach(o=>{n.append(r,o)})}),n}const BN="6";try{window.__reactRouterVersion=BN}catch{}const $N="startTransition",
|
|
97
|
+
*/function Od(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function GN(e,t){let n=Od(e);return t&&t.forEach((i,r)=>{n.has(r)||t.getAll(r).forEach(o=>{n.append(r,o)})}),n}const BN="6";try{window.__reactRouterVersion=BN}catch{}const $N="startTransition",yg=tk[$N];function i8(e){let{basename:t,children:n,future:i,window:r}=e,o=R.useRef();o.current==null&&(o.current=qI({window:r,v5Compat:!0}));let s=o.current,[a,l]=R.useState({action:s.action,location:s.location}),{v7_startTransition:u}=i||{},d=R.useCallback(c=>{u&&yg?yg(()=>l(c)):l(c)},[l,u]);return R.useLayoutEffect(()=>s.listen(d),[s,d]),R.useEffect(()=>VN(i),[i]),R.createElement(HN,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:i})}var xg;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xg||(xg={}));var _g;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_g||(_g={}));function r8(e){let t=R.useRef(Od(e)),n=R.useRef(!1),i=lu(),r=R.useMemo(()=>GN(i.search,n.current?null:t.current),[i.search]),o=Ty(),s=R.useCallback((a,l)=>{const u=Od(typeof a=="function"?a(r):a);n.current=!0,o("?"+u,l)},[o,r]);return[r,s]}/**
|
|
98
98
|
* dockview-core
|
|
99
99
|
* @version 5.2.0
|
|
100
100
|
* @link https://github.com/mathuo/dockview
|
|
@@ -1407,7 +1407,7 @@ Error generating stack: `+o.message+`
|
|
|
1407
1407
|
.dv-watermark {
|
|
1408
1408
|
display: flex;
|
|
1409
1409
|
height: 100%;
|
|
1410
|
-
}`;WN(jN);class Oy{}class bi extends Oy{constructor(t,n,i){super(),this.viewId=t,this.groupId=n,this.panelId=i}}class Wo extends Oy{constructor(t,n){super(),this.viewId=t,this.paneId=n}}class Dn{constructor(){}static getInstance(){return Dn.INSTANCE}hasData(t){return t&&t===this.proto}clearData(t){this.hasData(t)&&(this.proto=void 0,this.data=void 0)}getData(t){if(this.hasData(t))return this.data}setData(t,n){n&&(this.data=t,this.proto=n)}}Dn.INSTANCE=new Dn;function rt(){const e=Dn.getInstance();if(e.hasData(bi.prototype))return e.getData(bi.prototype)[0]}function ko(){const e=Dn.getInstance();if(e.hasData(Wo.prototype))return e.getData(Wo.prototype)[0]}var Xi;(function(e){e.any=(...t)=>n=>{const i=t.map(r=>r(n));return{dispose:()=>{i.forEach(r=>{r.dispose()})}}}})(Xi||(Xi={}));class kp{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class Ry{constructor(){this._isAccepted=!1}get isAccepted(){return this._isAccepted}accept(){this._isAccepted=!0}}class UN{constructor(){this.events=new Map}get size(){return this.events.size}add(t,n){this.events.set(t,n)}delete(t){this.events.delete(t)}clear(){this.events.clear()}}class _l{static create(){var t;return new _l((t=new Error().stack)!==null&&t!==void 0?t:"")}constructor(t){this.value=t}print(){console.warn("dockview: stacktrace",this.value)}}class YN{constructor(t,n){this.callback=t,this.stacktrace=n}}class B{static setLeakageMonitorEnabled(t){t!==B.ENABLE_TRACKING&&B.MEMORY_LEAK_WATCHER.clear(),B.ENABLE_TRACKING=t}get value(){return this._last}constructor(t){this.options=t,this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>{var n;!((n=this.options)===null||n===void 0)&&n.replay&&this._last!==void 0&&t(this._last);const i=new YN(t,B.ENABLE_TRACKING?_l.create():void 0);return this._listeners.push(i),{dispose:()=>{const r=this._listeners.indexOf(i);r>-1&&this._listeners.splice(r,1)}}},B.ENABLE_TRACKING&&B.MEMORY_LEAK_WATCHER.add(this._event,_l.create())),this._event}fire(t){var n;!((n=this.options)===null||n===void 0)&&n.replay&&(this._last=t);for(const i of this._listeners)i.callback(t)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(B.ENABLE_TRACKING&&queueMicrotask(()=>{var t;for(const n of this._listeners)console.warn("dockview: stacktrace",(t=n.stacktrace)===null||t===void 0?void 0:t.print())}),this._listeners=[]),B.ENABLE_TRACKING&&this._event&&B.MEMORY_LEAK_WATCHER.delete(this._event))}}B.ENABLE_TRACKING=!1;B.MEMORY_LEAK_WATCHER=new UN;function pe(e,t,n,i){return e.addEventListener(t,n,i),{dispose:()=>{e.removeEventListener(t,n,i)}}}class _g{constructor(){this._onFired=new B,this._currentFireCount=0,this._queued=!1,this.onEvent=t=>{const n=this._currentFireCount;return this._onFired.event(()=>{this._currentFireCount>n&&t()})}}fire(){this._currentFireCount++,!this._queued&&(this._queued=!0,queueMicrotask(()=>{this._queued=!1,this._onFired.fire()}))}dispose(){this._onFired.dispose()}}var je;(function(e){e.NONE={dispose:()=>{}};function t(n){return{dispose:()=>{n()}}}e.from=t})(je||(je={}));class ce{get isDisposed(){return this._isDisposed}constructor(...t){this._isDisposed=!1,this._disposables=new Set(t)}addDisposables(...t){t.forEach(n=>this._disposables.add(n))}removeDisposable(t){this._disposables.delete(t)}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposables.forEach(t=>t.dispose()),this._disposables.clear())}}class Je{constructor(){this._disposable=je.NONE}set value(t){this._disposable&&this._disposable.dispose(),this._disposable=t}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=je.NONE)}}class XN extends ce{constructor(t){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._value=null,this.addDisposables(this._onDidChange,uu(t,n=>{const i=n.target.scrollWidth>n.target.clientWidth,r=n.target.scrollHeight>n.target.clientHeight;this._value={hasScrollX:i,hasScrollY:r},this._onDidChange.fire(this._value)}))}}function uu(e,t){const n=new ResizeObserver(i=>{requestAnimationFrame(()=>{const r=i[0];t(r)})});return n.observe(e),{dispose:()=>{n.unobserve(e),n.disconnect()}}}const dn=(e,...t)=>{for(const n of t)e.classList.contains(n)&&e.classList.remove(n)},hn=(e,...t)=>{for(const n of t)e.classList.contains(n)||e.classList.add(n)},ne=(e,t,n)=>{const i=e.classList.contains(t);n&&!i&&e.classList.add(t),!n&&i&&e.classList.remove(t)};function Rd(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Vy(e){return new ZN(e)}class ZN extends ce{constructor(t){super(),this._onDidFocus=new B,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new B,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let n=Rd(document.activeElement,t),i=!1;const r=()=>{i=!1,n||(n=!0,this._onDidFocus.fire())},o=()=>{n&&(i=!0,window.setTimeout(()=>{i&&(i=!1,n=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Rd(document.activeElement,t)!==n&&(n?o():r())},this.addDisposables(pe(t,"focus",r,!0)),this.addDisposables(pe(t,"blur",o,!0))}refreshState(){this._refreshStateHandler()}}const Fy="dv-quasiPreventDefault";function qN(e){e[Fy]=!0}function kg(e){return e[Fy]}function QN(e,t){const n=Array.from(t);for(const i of n){if(i.href){const o=e.createElement("link");o.href=i.href,o.type=i.type,o.rel="stylesheet",e.head.appendChild(o)}let r=[];try{i.cssRules&&(r=Array.from(i.cssRules).map(o=>o.cssText))}catch{}for(const o of r){const s=e.createElement("style");s.appendChild(e.createTextNode(o)),e.head.appendChild(s)}}}function Vd(e){const{left:t,top:n,width:i,height:r}=e.getBoundingClientRect();return{left:t+window.scrollX,top:n+window.scrollY,width:i,height:r}}function KN(e){let t=e;for(;t!=null&&t.parentNode;){if(t.parentNode===document)return!0;t.parentNode instanceof DocumentFragment?t=t.parentNode.host:t=t.parentNode}return!1}function JN(e,t){e.setAttribute("data-testid",t)}function eT(e){const t=[];function n(i){if(i.nodeType===Node.ELEMENT_NODE){e.includes(i.tagName)&&t.push(i),i.shadowRoot&&n(i.shadowRoot);for(const r of i.children)n(r)}}return n(document.documentElement),t}function kl(e=document){const t=eT(["IFRAME","WEBVIEW"]),n=new WeakMap;for(const i of t)n.set(i,i.style.pointerEvents),i.style.pointerEvents="none";return{release:()=>{var i;for(const r of t)r.style.pointerEvents=(i=n.get(r))!==null&&i!==void 0?i:"auto";t.splice(0,t.length)}}}function tT(e){function t(r){const o=[];for(let s=0;s<r.classList.length;s++)o.push(r.classList.item(s));return o}let n,i=e;for(;i!==null&&(n=t(i).find(r=>r.startsWith("dockview-theme-")),typeof n!="string");)i=i.parentElement;return n}class cu{constructor(t){this.element=t,this._classNames=[]}setClassNames(t){for(const n of this._classNames)ne(this.element,n,!1);this._classNames=t.split(" ").filter(n=>n.trim().length>0);for(const n of this._classNames)ne(this.element,n,!0)}}const Hy=100;function nT(e,t){const n=Vd(e),i=Vd(t);return!(n.left<i.left||n.left+n.width>i.left+i.width||n.top<i.top||n.top+n.height>i.top+i.height)}function iT(e){const t=new B;let n=e.screenX,i=e.screenY,r;const o=()=>{if(e.closed)return;const s=e.screenX,a=e.screenY;(s!==n||a!==i)&&(clearTimeout(r),r=setTimeout(()=>{t.fire()},Hy),n=s,i=a),requestAnimationFrame(o)};return o(),t}function rT(e,t){let n;return new ce(pe(e,"resize",()=>{clearTimeout(n),n=setTimeout(()=>{t()},Hy)}))}function oT(e,t,n={buffer:10}){const i=n.buffer,r=e.getBoundingClientRect(),o=t.getBoundingClientRect();let s=0,a=0;const l=r.left-o.left,u=r.top-o.top,d=r.bottom-o.bottom,c=r.right-o.right;l<i?s=i-l:c>i&&(s=-i-c),u<i?a=i-u:d>i&&(a=-d-i),(s!==0||a!==0)&&(e.style.transform=`translate(${s}px, ${a}px)`)}function sT(e){let t=e;for(;t&&(t.style.zIndex==="auto"||t.style.zIndex==="");)t=t.parentElement;return t}function Vn(e){if(e.length===0)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function Gy(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function vc(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function ha(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function aT(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(t(i))return n}return-1}function wc(e,t){const n=e.findIndex(i=>i===t);return n>-1?(e.splice(n,1),!0):!1}const Ie=(e,t,n)=>t>n?t:Math.min(n,Math.max(e,t)),Sp=()=>{let e=1;return{next:()=>(e++).toString()}},Qt=(e,t)=>{const n=[];if(typeof t!="number"&&(t=e,e=0),e<=t)for(let i=e;i<t;i++)n.push(i);else for(let i=e;i>t;i--)n.push(i);return n};class lT{set size(t){this._size=t}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(t){this.container.style.pointerEvents=t?"":"none"}constructor(t,n,i,r){this.container=t,this.view=n,this.disposable=r,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,t.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}setVisible(t,n){var i;t!==this.visible&&(t?(this.size=Ie((i=this._cachedVisibleSize)!==null&&i!==void 0?i:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("visible",t),this.view.setVisible&&this.view.setVisible(t))}dispose(){return this.disposable.dispose(),this.view}}var re;(function(e){e.HORIZONTAL="HORIZONTAL",e.VERTICAL="VERTICAL"})(re||(re={}));var Ft;(function(e){e[e.MAXIMUM=0]="MAXIMUM",e[e.MINIMUM=1]="MINIMUM",e[e.DISABLED=2]="DISABLED",e[e.ENABLED=3]="ENABLED"})(Ft||(Ft={}));var qe;(function(e){e.Low="low",e.High="high",e.Normal="normal"})(qe||(qe={}));var Wt;(function(e){e.Distribute={type:"distribute"};function t(i){return{type:"split",index:i}}e.Split=t;function n(i){return{type:"invisible",cachedVisibleSize:i}}e.Invisible=n})(Wt||(Wt={}));class fs{get contentSize(){return this._contentSize}get size(){return this._size}set size(t){this._size=t}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(t){this._orthogonalSize=t}get length(){return this.viewItems.length}get proportions(){return this._proportions?[...this._proportions]:void 0}get orientation(){return this._orientation}set orientation(t){this._orientation=t;const n=this.size;this.size=this.orthogonalSize,this.orthogonalSize=n,dn(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==re.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce((t,n)=>t+n.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((t,n)=>t+n.maximumSize,0)}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}get disabled(){return this._disabled}set disabled(t){this._disabled=t,ne(this.element,"dv-splitview-disabled",t)}get margin(){return this._margin}set margin(t){this._margin=t,ne(this.element,"dv-splitview-has-margin",t!==0)}constructor(t,n){var i,r;this.container=t,this.viewItems=[],this.sashes=[],this._size=0,this._orthogonalSize=0,this._contentSize=0,this._proportions=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this._disabled=!1,this._margin=0,this._onDidSashEnd=new B,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new B,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new B,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(o,s,a=this.viewItems.map(f=>f.size),l,u,d=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h,p)=>{if(o<0||o>this.viewItems.length)return 0;const f=Qt(o,-1),v=Qt(o+1,this.viewItems.length);if(u)for(const P of u)vc(f,P),vc(v,P);if(l)for(const P of l)ha(f,P),ha(v,P);const b=f.map(P=>this.viewItems[P]),m=f.map(P=>a[P]),w=v.map(P=>this.viewItems[P]),g=v.map(P=>a[P]),y=f.reduce((P,A)=>P+this.viewItems[A].minimumSize-a[A],0),k=f.reduce((P,A)=>P+this.viewItems[A].maximumSize-a[A],0),_=v.length===0?Number.POSITIVE_INFINITY:v.reduce((P,A)=>P+a[A]-this.viewItems[A].minimumSize,0),E=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((P,A)=>P+a[A]-this.viewItems[A].maximumSize,0),S=Math.max(y,E),T=Math.min(_,k);let C=!1;if(h){const P=this.viewItems[h.index],A=s>=h.limitDelta;C=A!==P.visible,P.setVisible(A,h.size)}if(!C&&p){const P=this.viewItems[p.index],A=s<p.limitDelta;C=A!==P.visible,P.setVisible(A,p.size)}if(C)return this.resize(o,s,a,l,u,d,c);const I=Ie(s,S,T);let L=0,V=I;for(let P=0;P<b.length;P++){const A=b[P],O=Ie(m[P]+V,A.minimumSize,A.maximumSize),N=O-m[P];L+=N,V-=N,A.size=O}let D=L;for(let P=0;P<w.length;P++){const A=w[P],O=Ie(g[P]-D,A.minimumSize,A.maximumSize),N=O-g[P];D+=N,A.size=O}return s},this._orientation=(i=n.orientation)!==null&&i!==void 0?i:re.VERTICAL,this.element=this.createContainer(),this.margin=(r=n.margin)!==null&&r!==void 0?r:0,this.proportionalLayout=n.proportionalLayout===void 0?!0:!!n.proportionalLayout,this.viewContainer=this.createViewContainer(),this.sashContainer=this.createSashContainer(),this.element.appendChild(this.sashContainer),this.element.appendChild(this.viewContainer),this.container.appendChild(this.element),this.style(n.styles),n.descriptor&&(this._size=n.descriptor.size,n.descriptor.views.forEach((o,s)=>{const a=o.visible===void 0||o.visible?o.size:{type:"invisible",cachedVisibleSize:o.size},l=o.view;this.addView(l,a,s,!0)}),this._contentSize=this.viewItems.reduce((o,s)=>o+s.size,0),this.saveProportions())}style(t){(t==null?void 0:t.separatorBorder)==="transparent"?(dn(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(hn(this.element,"dv-separator-border"),t!=null&&t.separatorBorder&&this.element.style.setProperty("--dv-separator-border",t.separatorBorder))}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const i=this.viewItems[t];i.setVisible(n,i.size),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}resizeView(t,n){if(t<0||t>=this.viewItems.length)return;const i=Qt(this.viewItems.length).filter(a=>a!==t),r=[...i.filter(a=>this.viewItems[a].priority===qe.Low),t],o=i.filter(a=>this.viewItems[a].priority===qe.High),s=this.viewItems[t];n=Math.round(n),n=Ie(n,s.minimumSize,Math.min(s.maximumSize,this._size)),s.size=n,this.relayout(r,o)}getViews(){return this.viewItems.map(t=>t.view)}onDidChange(t,n){const i=this.viewItems.indexOf(t);if(i<0||i>=this.viewItems.length)return;n=typeof n=="number"?n:t.size,n=Ie(n,t.minimumSize,t.maximumSize),t.size=n;const r=Qt(this.viewItems.length).filter(a=>a!==i),o=[...r.filter(a=>this.viewItems[a].priority===qe.Low),i],s=r.filter(a=>this.viewItems[a].priority===qe.High);this.relayout([...o,i],s)}addView(t,n={type:"distribute"},i=this.viewItems.length,r){const o=document.createElement("div");o.className="dv-view",o.appendChild(t.element);let s;typeof n=="number"?s=n:n.type==="split"?s=this.getViewSize(n.index)/2:n.type==="invisible"?s={cachedVisibleSize:n.cachedVisibleSize}:s=t.minimumSize;const a=t.onDidChange(u=>this.onDidChange(l,u.size)),l=new lT(o,t,s,{dispose:()=>{a.dispose(),this.viewContainer.removeChild(o)}});if(i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i)),this.viewItems.splice(i,0,l),this.viewItems.length>1){const u=document.createElement("div");u.className="dv-sash";const d=h=>{for(const P of this.viewItems)P.enabled=!1;const p=kl(),f=this._orientation===re.HORIZONTAL?h.clientX:h.clientY,v=aT(this.sashes,P=>P.container===u),b=this.viewItems.map(P=>P.size);let m,w;const g=Qt(v,-1),y=Qt(v+1,this.viewItems.length),k=g.reduce((P,A)=>P+(this.viewItems[A].minimumSize-b[A]),0),_=g.reduce((P,A)=>P+(this.viewItems[A].viewMaximumSize-b[A]),0),E=y.length===0?Number.POSITIVE_INFINITY:y.reduce((P,A)=>P+(b[A]-this.viewItems[A].minimumSize),0),S=y.length===0?Number.NEGATIVE_INFINITY:y.reduce((P,A)=>P+(b[A]-this.viewItems[A].viewMaximumSize),0),T=Math.max(k,S),C=Math.min(E,_),I=this.findFirstSnapIndex(g),L=this.findFirstSnapIndex(y);if(typeof I=="number"){const P=this.viewItems[I],A=Math.floor(P.viewMinimumSize/2);m={index:I,limitDelta:P.visible?T-A:T+A,size:P.size}}if(typeof L=="number"){const P=this.viewItems[L],A=Math.floor(P.viewMinimumSize/2);w={index:L,limitDelta:P.visible?C+A:C-A,size:P.size}}const V=P=>{const O=(this._orientation===re.HORIZONTAL?P.clientX:P.clientY)-f;this.resize(v,O,b,void 0,void 0,T,C,m,w),this.distributeEmptySpace(),this.layoutViews()},D=()=>{for(const P of this.viewItems)P.enabled=!0;p.release(),this.saveProportions(),document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",D),document.removeEventListener("pointercancel",D),document.removeEventListener("contextmenu",D),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",V),document.addEventListener("pointerup",D),document.addEventListener("pointercancel",D),document.addEventListener("contextmenu",D)};u.addEventListener("pointerdown",d);const c={container:u,disposable:()=>{u.removeEventListener("pointerdown",d),this.sashContainer.removeChild(u)}};this.sashContainer.appendChild(u),this.sashes.push(c)}r||this.relayout([i]),!r&&typeof n!="number"&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidAddView.fire(t)}distributeViewSizes(){const t=[];let n=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(t.push(a),n+=a.size);const i=Math.floor(n/t.length);for(const a of t)a.size=Ie(i,a.minimumSize,a.maximumSize);const r=Qt(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===qe.Low),s=r.filter(a=>this.viewItems[a].priority===qe.High);this.relayout(o,s)}removeView(t,n,i=!1){const r=this.viewItems.splice(t,1)[0];if(r.dispose(),this.viewItems.length>=1){const o=Math.max(t-1,0);this.sashes.splice(o,1)[0].disposable()}return i||this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidRemoveView.fire(r.view),r.view}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}moveView(t,n){const i=this.getViewCachedVisibleSize(t),r=typeof i>"u"?this.getViewSize(t):Wt.Invisible(i),o=this.removeView(t,void 0,!0);this.addView(o,r,n)}layout(t,n){const i=Math.max(this.size,this._contentSize);if(this.size=t,this.orthogonalSize=n,this.proportions){let r=0;for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"?r+=a:t-=s.size}for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"&&r>0&&(s.size=Ie(Math.round(a*t/r),s.minimumSize,s.maximumSize))}}else{const r=Qt(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===qe.Low),s=r.filter(a=>this.viewItems[a].priority===qe.High);this.resize(this.viewItems.length-1,t-i,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}relayout(t,n){const i=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this._size-i,void 0,t,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(t){const n=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-n;const r=Qt(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===qe.Low),s=r.filter(a=>this.viewItems[a].priority===qe.High);for(const a of s)vc(r,a);for(const a of o)ha(r,a);typeof t=="number"&&ha(r,t);for(let a=0;i!==0&&a<r.length;a++){const l=this.viewItems[r[a]],u=Ie(l.size+i,l.minimumSize,l.maximumSize),d=u-l.size;i-=d,l.size=u}}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this._proportions=this.viewItems.map(t=>t.visible?t.size/this._contentSize:void 0))}layoutViews(){if(this._contentSize=this.viewItems.reduce((l,u)=>l+u.size,0),this.updateSashEnablement(),this.viewItems.length===0)return;const t=this.viewItems.filter(l=>l.visible),n=Math.max(0,t.length-1),i=this.margin*n/Math.max(1,t.length);let r=0;const o=[],s=4,a=this.viewItems.reduce((l,u,d)=>{const c=u.visible?1:0;return d===0?l.push(c):l.push(l[d-1]+c),l},[]);this.viewItems.forEach((l,u)=>{r+=this.viewItems[u].size,o.push(r);const d=l.visible?l.size-i:0,c=Math.max(0,a[u]-1),h=u===0||c===0?0:o[u-1]+c/n*i;if(u<this.viewItems.length-1){const p=l.visible?h+d-s/2+this.margin/2:h;this._orientation===re.HORIZONTAL&&(this.sashes[u].container.style.left=`${p}px`,this.sashes[u].container.style.top="0px"),this._orientation===re.VERTICAL&&(this.sashes[u].container.style.left="0px",this.sashes[u].container.style.top=`${p}px`)}this._orientation===re.HORIZONTAL&&(l.container.style.width=`${d}px`,l.container.style.left=`${h}px`,l.container.style.top="",l.container.style.height=""),this._orientation===re.VERTICAL&&(l.container.style.height=`${d}px`,l.container.style.top=`${h}px`,l.container.style.width="",l.container.style.left=""),l.view.layout(l.size-i,this._orthogonalSize)})}findFirstSnapIndex(t){for(const n of t){const i=this.viewItems[n];if(i.visible&&i.snap)return n}for(const n of t){const i=this.viewItems[n];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return n}}updateSashEnablement(){let t=!1;const n=this.viewItems.map(l=>t=l.size-l.minimumSize>0||t);t=!1;const i=this.viewItems.map(l=>t=l.maximumSize-l.size>0||t),r=[...this.viewItems].reverse();t=!1;const o=r.map(l=>t=l.size-l.minimumSize>0||t).reverse();t=!1;const s=r.map(l=>t=l.maximumSize-l.size>0||t).reverse();let a=0;for(let l=0;l<this.sashes.length;l++){const u=this.sashes[l],d=this.viewItems[l];a+=d.size;const c=!(n[l]&&s[l+1]),h=!(i[l]&&o[l+1]);if(c&&h){const p=Qt(l,-1),f=Qt(l+1,this.viewItems.length),v=this.findFirstSnapIndex(p),b=this.findFirstSnapIndex(f),m=typeof v=="number"&&!this.viewItems[v].visible,w=typeof b=="number"&&!this.viewItems[b].visible;m&&o[l]&&(a>0||this.startSnappingEnabled)?this.updateSash(u,Ft.MINIMUM):w&&n[l]&&(a<this._contentSize||this.endSnappingEnabled)?this.updateSash(u,Ft.MAXIMUM):this.updateSash(u,Ft.DISABLED)}else c&&!h?this.updateSash(u,Ft.MINIMUM):!c&&h?this.updateSash(u,Ft.MAXIMUM):this.updateSash(u,Ft.ENABLED)}}updateSash(t,n){ne(t.container,"dv-disabled",n===Ft.DISABLED),ne(t.container,"dv-enabled",n===Ft.ENABLED),ne(t.container,"dv-maximum",n===Ft.MAXIMUM),ne(t.container,"dv-minimum",n===Ft.MINIMUM)}createViewContainer(){const t=document.createElement("div");return t.className="dv-view-container",t}createSashContainer(){const t=document.createElement("div");return t.className="dv-sash-container",t}createContainer(){const t=document.createElement("div"),n=this._orientation===re.HORIZONTAL?"dv-horizontal":"dv-vertical";return t.className=`dv-split-view-container ${n}`,t}dispose(){this._onDidSashEnd.dispose(),this._onDidAddView.dispose(),this._onDidRemoveView.dispose();for(let t=0;t<this.element.children.length;t++)if(this.element.children.item(t)===this.element){this.element.removeChild(this.element);break}for(const t of this.viewItems)t.dispose();this.element.remove()}}const Fd=Object.keys({orientation:void 0,descriptor:void 0,proportionalLayout:void 0,styles:void 0,margin:void 0,disableAutoResizing:void 0,className:void 0});class Sg extends ce{get onDidAddView(){return this.splitview.onDidAddView}get onDidRemoveView(){return this.splitview.onDidRemoveView}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get orientation(){return this.splitview.orientation}get size(){return this.splitview.size}get orthogonalSize(){return this.splitview.orthogonalSize}constructor(t,n){var i;super(),this.paneItems=[],this.skipAnimation=!1,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._orientation=(i=n.orientation)!==null&&i!==void 0?i:re.VERTICAL,this.element=document.createElement("div"),this.element.className="dv-pane-container",t.appendChild(this.element),this.splitview=new fs(this.element,{orientation:this._orientation,proportionalLayout:!1,descriptor:n.descriptor}),this.getPanes().forEach(r=>{const o=new ce(r.onDidChangeExpansionState(()=>{this.setupAnimation(),this._onDidChange.fire(void 0)})),s={pane:r,disposable:{dispose:()=>{o.dispose()}}};this.paneItems.push(s),r.orthogonalSize=this.splitview.orthogonalSize}),this.addDisposables(this._onDidChange,this.splitview.onDidSashEnd(()=>{this._onDidChange.fire(void 0)}),this.splitview.onDidAddView(()=>{this._onDidChange.fire()}),this.splitview.onDidRemoveView(()=>{this._onDidChange.fire()}))}setViewVisible(t,n){this.splitview.setViewVisible(t,n)}addPane(t,n,i=this.splitview.length,r=!1){const o=t.onDidChangeExpansionState(()=>{this.setupAnimation(),this._onDidChange.fire(void 0)}),s={pane:t,disposable:{dispose:()=>{o.dispose()}}};this.paneItems.splice(i,0,s),t.orthogonalSize=this.splitview.orthogonalSize,this.splitview.addView(t,n,i,r)}getViewSize(t){return this.splitview.getViewSize(t)}getPanes(){return this.splitview.getViews()}removePane(t,n={skipDispose:!1}){const i=this.paneItems.splice(t,1)[0];return this.splitview.removeView(t),n.skipDispose||(i.disposable.dispose(),i.pane.dispose()),i}moveView(t,n){if(t===n)return;const i=this.removePane(t,{skipDispose:!0});this.skipAnimation=!0;try{this.addPane(i.pane,i.pane.size,n,!1)}finally{this.skipAnimation=!1}}layout(t,n){this.splitview.layout(t,n)}setupAnimation(){this.skipAnimation||(this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),hn(this.element,"dv-animated"),this.animationTimer=setTimeout(()=>{this.animationTimer=void 0,dn(this.element,"dv-animated")},200))}dispose(){super.dispose(),this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),this.paneItems.forEach(t=>{t.disposable.dispose(),t.pane.dispose()}),this.paneItems=[],this.splitview.dispose(),this.element.remove()}}class et{get minimumWidth(){return this.view.minimumWidth}get maximumWidth(){return this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get priority(){return this.view.priority}get snap(){return this.view.snap}get minimumSize(){return this.orientation===re.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===re.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===re.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===re.HORIZONTAL?this.maximumWidth:this.maximumHeight}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get element(){return this.view.element}get width(){return this.orientation===re.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===re.HORIZONTAL?this.size:this.orthogonalSize}constructor(t,n,i,r=0){this.view=t,this.orientation=n,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._orthogonalSize=i,this._size=r,this._disposable=this.view.onDidChange(o=>{o?this._onDidChange.fire({size:this.orientation===re.VERTICAL?o.width:o.height,orthogonalSize:this.orientation===re.VERTICAL?o.height:o.width}):this._onDidChange.fire({})})}setVisible(t){this.view.setVisible&&this.view.setVisible(t)}layout(t,n){this._size=t,this._orthogonalSize=n,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class He extends ce{get width(){return this.orientation===re.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===re.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return this.children.length===0?0:Math.max(...this.children.map((t,n)=>this.splitview.isViewVisible(n)?t.minimumOrthogonalSize:0))}get maximumSize(){return Math.min(...this.children.map((t,n)=>this.splitview.isViewVisible(n)?t.maximumOrthogonalSize:Number.POSITIVE_INFINITY))}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get minimumWidth(){return this.orientation===re.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===re.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===re.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===re.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(this.children.length===0)return qe.Normal;const t=this.children.map(n=>typeof n.priority>"u"?qe.Normal:n.priority);return t.some(n=>n===qe.High)?qe.High:t.some(n=>n===qe.Low)?qe.Low:qe.Normal}get disabled(){return this.splitview.disabled}set disabled(t){this.splitview.disabled=t}get margin(){return this.splitview.margin}set margin(t){this.splitview.margin=t,this.children.forEach(n=>{n instanceof He&&(n.margin=t)})}constructor(t,n,i,r,o,s,a,l){if(super(),this.orientation=t,this.proportionalLayout=n,this.styles=i,this._childrenDisposable=je.NONE,this.children=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new B,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=o,this._size=r,this.element=document.createElement("div"),this.element.className="dv-branch-node",!l)this.splitview=new fs(this.element,{orientation:this.orientation,proportionalLayout:n,styles:i,margin:a}),this.splitview.layout(this.size,this.orthogonalSize);else{const u={views:l.map(d=>({view:d.node,size:d.node.size,visible:d.node instanceof et&&d.visible!==void 0?d.visible:!0})),size:this.orthogonalSize};this.children=l.map(d=>d.node),this.splitview=new fs(this.element,{orientation:this.orientation,descriptor:u,proportionalLayout:n,styles:i,margin:a})}this.disabled=s,this.addDisposables(this._onDidChange,this._onDidVisibilityChange,this.splitview.onDidSashEnd(()=>{this._onDidChange.fire({})})),this.setupChildrenEvents()}setVisible(t){}isChildVisible(t){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.isViewVisible(t)}setChildVisible(t,n){if(t<0||t>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(t)===n)return;const i=this.splitview.contentSize===0;this.splitview.setViewVisible(t,n);const r=this.splitview.contentSize===0;(n&&i||!n&&r)&&this._onDidVisibilityChange.fire({visible:n})}moveChild(t,n){if(t===n)return;if(t<0||t>=this.children.length)throw new Error("Invalid from index");t<n&&n--,this.splitview.moveView(t,n);const i=this._removeChild(t);this._addChild(i,n)}getChildSize(t){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(t)}resizeChild(t,n){if(t<0||t>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(t,n)}layout(t,n){this._size=n,this._orthogonalSize=t,this.splitview.layout(n,t)}addChild(t,n,i,r){if(i<0||i>this.children.length)throw new Error("Invalid index");this.splitview.addView(t,n,i,r),this._addChild(t,i)}getChildCachedVisibleSize(t){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(t)}removeChild(t,n){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(t,n),this._removeChild(t)}_addChild(t,n){this.children.splice(n,0,t),this.setupChildrenEvents()}_removeChild(t){const[n]=this.children.splice(t,1);return this.setupChildrenEvents(),n}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new ce(Xi.any(...this.children.map(t=>t.onDidChange))(t=>{this._onDidChange.fire({size:t.orthogonalSize})}),...this.children.map((t,n)=>t instanceof He?t.onDidVisibilityChange(({visible:i})=>{this.setChildVisible(n,i)}):je.NONE))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach(t=>t.dispose()),super.dispose()}}function Hd(e,t){if(e instanceof et)return e;if(e instanceof He)return Hd(e.children[t?e.children.length-1:0],t);throw new Error("invalid node")}function By(e,t,n){if(e instanceof He){const i=new He(e.orientation,e.proportionalLayout,e.styles,t,n,e.disabled,e.margin);for(let r=e.children.length-1;r>=0;r--){const o=e.children[r];i.addChild(By(o,o.size,o.orthogonalSize),o.size,0,!0)}return i}else return new et(e.view,e.orientation,n)}function Gd(e,t,n){if(e instanceof He){const i=new He(kn(e.orientation),e.proportionalLayout,e.styles,t,n,e.disabled,e.margin);let r=0;for(let o=e.children.length-1;o>=0;o--){const s=e.children[o],a=s instanceof He?s.orthogonalSize:s.size;let l=e.size===0?0:Math.round(t*a/e.size);r+=l,o===0&&(l+=t-r),i.addChild(Gd(s,n,l),l,0,!0)}return i}else return new et(e.view,kn(e.orientation),n)}function uT(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");let n=t.firstElementChild,i=0;for(;n!==e&&n!==t.lastElementChild&&n;)n=n.nextElementSibling,i++;return i}function Oe(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(t.className))return[];const n=uT(t),i=t.parentElement.parentElement.parentElement;return[...Oe(i),n]}function bn(e,t,n){const i=dT(e,t),r=cT(n);if(i===r){const[o,s]=Vn(t);let a=s;return(n==="right"||n==="bottom")&&(a+=1),[...o,a]}else{const o=n==="right"||n==="bottom"?1:0;return[...t,o]}}function cT(e){return e==="top"||e==="bottom"?re.VERTICAL:re.HORIZONTAL}function dT(e,t){return t.length%2===0?kn(e):e}const kn=e=>e===re.HORIZONTAL?re.VERTICAL:re.HORIZONTAL;function hT(e){return!!e.children}const Bd=(e,t)=>{const n=t===re.VERTICAL?e.box.width:e.box.height;return hT(e)?{type:"branch",data:e.children.map(i=>Bd(i,kn(t))),size:n}:typeof e.cachedVisibleSize=="number"?{type:"leaf",data:e.view.toJSON(),size:e.cachedVisibleSize,visible:!1}:{type:"leaf",data:e.view.toJSON(),size:n}};class pT{get length(){return this._root?this._root.children.length:0}get orientation(){return this.root.orientation}set orientation(t){if(this.root.orientation===t)return;const{size:n,orthogonalSize:i}=this.root;this.root=Gd(this.root,i,n),this.root.layout(n,i)}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get locked(){return this._locked}set locked(t){this._locked=t;const n=[this.root];for(;n.length>0;){const i=n.pop();i instanceof He&&(i.disabled=t,n.push(...i.children))}}get margin(){return this._margin}set margin(t){this._margin=t,this.root.margin=t}maximizedView(){var t;return(t=this._maximizedNode)===null||t===void 0?void 0:t.leaf.view}hasMaximizedView(){return this._maximizedNode!==void 0}maximizeView(t){var n;const i=Oe(t.element),[r,o]=this.getNode(i);if(!(o instanceof et)||((n=this._maximizedNode)===null||n===void 0?void 0:n.leaf)===o)return;this.hasMaximizedView()&&this.exitMaximizedView(),Bd(this.getView(),this.orientation);const s=[];function a(l,u){for(let d=0;d<l.children.length;d++){const c=l.children[d];c instanceof et?c!==u&&(l.isChildVisible(d)?l.setChildVisible(d,!1):s.push(c)):a(c,u)}}a(this.root,o),this._maximizedNode={leaf:o,hiddenOnMaximize:s},this._onDidMaximizedNodeChange.fire({view:o.view,isMaximized:!0})}exitMaximizedView(){if(!this._maximizedNode)return;const t=this._maximizedNode.hiddenOnMaximize;function n(r){for(let o=r.children.length-1;o>=0;o--){const s=r.children[o];s instanceof et?t.includes(s)||r.setChildVisible(o,!0):n(s)}}n(this.root);const i=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:i.view,isMaximized:!1})}serialize(){const t=this.maximizedView();let n;t&&(n=Oe(t.element)),this.hasMaximizedView()&&this.exitMaximizedView();const r={root:Bd(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return n&&(r.maximizedNode={location:n}),t&&this.maximizeView(t),r}dispose(){this.disposable.dispose(),this._onDidChange.dispose(),this._onDidMaximizedNodeChange.dispose(),this._onDidViewVisibilityChange.dispose(),this.root.dispose(),this._maximizedNode=void 0,this.element.remove()}clear(){const t=this.root.orientation;this.root=new He(t,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(t,n){const i=t.orientation,r=i===re.VERTICAL?t.height:t.width;if(this._deserialize(t.root,i,n,r),this.layout(t.width,t.height),t.maximizedNode){const o=t.maximizedNode.location,[s,a]=this.getNode(o);if(!(a instanceof et))return;this.maximizeView(a.view)}}_deserialize(t,n,i,r){this.root=this._deserializeNode(t,n,i,r)}_deserializeNode(t,n,i,r){var o;let s;if(t.type==="branch"){const l=t.data.map(u=>({node:this._deserializeNode(u,kn(n),i,t.size),visible:u.visible}));s=new He(n,this.proportionalLayout,this.styles,t.size,r,this.locked,this.margin,l)}else{const a=i.fromJSON(t);typeof t.visible=="boolean"&&((o=a.setVisible)===null||o===void 0||o.call(a,t.visible)),s=new et(a,n,r,t.size)}return s}get root(){return this._root}set root(t){const n=this._root;n&&(n.dispose(),this._maximizedNode=void 0,this.element.removeChild(n.element)),this._root=t,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(i=>{this._onDidChange.fire(i)})}normalize(){if(!this._root||this._root.children.length!==1)return;const t=this.root,n=t.children[0];if(n instanceof et)return;t.element.remove();const i=t.removeChild(0);t.dispose(),i.dispose(),this._root=By(n,n.size,n.orthogonalSize),this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(r=>{this._onDidChange.fire(r)})}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const t=this.root;if(t.element.remove(),this._root=new He(kn(t.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),t.children.length!==0)if(t.children.length===1){const n=t.children[0];t.removeChild(0).dispose(),t.dispose(),this._root.addChild(Gd(n,n.orthogonalSize,n.size),Wt.Distribute,0)}else this._root.addChild(t,Wt.Distribute,0);this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(n=>{this._onDidChange.fire(n)})}next(t){return this.progmaticSelect(t)}previous(t){return this.progmaticSelect(t,!0)}getView(t){const n=t?this.getNode(t)[1]:this.root;return this._getViews(n,this.orientation)}_getViews(t,n,i){const r={height:t.height,width:t.width};if(t instanceof et)return{box:r,view:t.view,cachedVisibleSize:i};const o=[];for(let s=0;s<t.children.length;s++){const a=t.children[s],l=t.getChildCachedVisibleSize(s);o.push(this._getViews(a,kn(n),l))}return{box:r,children:o}}progmaticSelect(t,n=!1){const[i,r]=this.getNode(t);if(!(r instanceof et))throw new Error("invalid location");for(let o=i.length-1;o>-1;o--){const s=i[o],a=t[o]||0;if(n?a-1>-1:a+1<s.children.length)return Hd(s.children[n?a-1:a+1],n)}return Hd(this.root,n)}constructor(t,n,i,r,o){this.proportionalLayout=t,this.styles=n,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new Je,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new B,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new B,this.onDidMaximizedNodeChange=this._onDidMaximizedNodeChange.event,this.element=document.createElement("div"),this.element.className="dv-grid-view",this._locked=r??!1,this._margin=o??0,this.root=new He(i,t,n,0,0,this.locked,this.margin)}isViewVisible(t){const[n,i]=Vn(t),[,r]=this.getNode(n);if(!(r instanceof He))throw new Error("Invalid from location");return r.isChildVisible(i)}setViewVisible(t,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=Vn(t),[,o]=this.getNode(i);if(!(o instanceof He))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),o.setChildVisible(r,n)}moveView(t,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,r]=this.getNode(t);if(!(r instanceof He))throw new Error("Invalid location");r.moveChild(n,i)}addView(t,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[r,o]=Vn(i),[s,a]=this.getNode(r);if(a instanceof He){const l=new et(t,kn(a.orientation),a.orthogonalSize);a.addChild(l,n,o)}else{const[l,...u]=[...s].reverse(),[d,...c]=[...r].reverse();let h=0;const p=l.getChildCachedVisibleSize(d);typeof p=="number"&&(h=Wt.Invisible(p)),l.removeChild(d).dispose();const v=new He(a.orientation,this.proportionalLayout,this.styles,a.size,a.orthogonalSize,this.locked,this.margin);l.addChild(v,a.size,d);const b=new et(a.view,l.orientation,a.size);v.addChild(b,h,0),typeof n!="number"&&n.type==="split"&&(n={type:"split",index:0});const m=new et(t,l.orientation,a.size);v.addChild(m,n,o)}}remove(t,n){const i=Oe(t.element);return this.removeView(i,n)}removeView(t,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=Vn(t),[o,s]=this.getNode(i);if(!(s instanceof He))throw new Error("Invalid location");const a=s.children[r];if(!(a instanceof et))throw new Error("Invalid location");if(s.removeChild(r,n),a.dispose(),s.children.length!==1)return a.view;const l=s.children[0];if(o.length===0)return l instanceof et||(s.removeChild(0,n),this.root=l),a.view;const[u,...d]=[...o].reverse(),[c,...h]=[...i].reverse(),p=s.isChildVisible(0);s.removeChild(0,n);const f=u.children.map((v,b)=>u.getChildSize(b));if(u.removeChild(c,n).dispose(),l instanceof He){f.splice(c,1,...l.children.map(v=>v.size));for(let v=0;v<l.children.length;v++){const b=l.children[v];u.addChild(b,b.size,c+v)}for(;l.children.length>0;)l.removeChild(0)}else{const v=new et(l.view,kn(l.orientation),l.size),b=p?l.orthogonalSize:Wt.Invisible(l.orthogonalSize);u.addChild(v,b,c)}l.dispose();for(let v=0;v<f.length;v++)u.resizeChild(v,f[v]);return a.view}layout(t,n){const[i,r]=this.root.orientation===re.HORIZONTAL?[n,t]:[t,n];this.root.layout(i,r)}getNode(t,n=this.root,i=[]){if(t.length===0)return[i,n];if(!(n instanceof He))throw new Error("Invalid location");const[r,...o]=t;if(r<0||r>=n.children.length)throw new Error("Invalid location");const s=n.children[r];return i.push(n),this.getNode(o,s,i)}}const $d=Object.keys({disableAutoResizing:void 0,proportionalLayout:void 0,orientation:void 0,hideBorders:void 0,className:void 0});class Cp extends ce{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(t){this._disableResizing=t}constructor(t,n=!1){super(),this._disableResizing=n,this._element=t,this.addDisposables(uu(this._element,i=>{if(this.isDisposed||this.disableResizing||!this._element.offsetParent||!KN(this._element))return;const{width:r,height:o}=i.contentRect;this.layout(r,o)}))}}const fT=Sp();function Sl(e){switch(e){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";case"within":default:return"center"}}class $y extends Cp{get id(){return this._id}get size(){return this._groups.size}get groups(){return Array.from(this._groups.values()).map(t=>t.value)}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumHeight(){return this.gridview.minimumHeight}get maximumHeight(){return this.gridview.maximumHeight}get minimumWidth(){return this.gridview.minimumWidth}get maximumWidth(){return this.gridview.maximumWidth}get activeGroup(){return this._activeGroup}get locked(){return this.gridview.locked}set locked(t){this.gridview.locked=t}constructor(t,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._id=fT.next(),this._groups=new Map,this._onDidRemove=new B,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new B,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new B,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new B,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new _g,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new _g,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new cu(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),t.appendChild(this.element),this.gridview=new pT(!!n.proportionalLayout,n.styles,n.orientation,n.locked,n.margin),this.gridview.locked=!!n.locked,this.element.appendChild(this.gridview.element),this.layout(0,0,!0),this.addDisposables(this.gridview.onDidMaximizedNodeChange(r=>{this._onDidMaximizedChange.fire({panel:r.view,isMaximized:r.isMaximized})}),this.gridview.onDidViewVisibilityChange(()=>this._onDidViewVisibilityChangeMicroTaskQueue.fire()),this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.layout(this.width,this.height,!0)}),je.from(()=>{var r;(r=this.element.parentElement)===null||r===void 0||r.removeChild(this.element)}),this.gridview.onDidChange(()=>{this._bufferOnDidLayoutChange.fire()}),Xi.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)(()=>{this._bufferOnDidLayoutChange.fire()}),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(t,n){this.gridview.setViewVisible(Oe(t.element),n),this._bufferOnDidLayoutChange.fire()}isVisible(t){return this.gridview.isViewVisible(Oe(t.element))}updateOptions(t){var n,i,r,o;t.proportionalLayout,t.orientation&&(this.gridview.orientation=t.orientation),"disableResizing"in t&&(this.disableResizing=(n=t.disableAutoResizing)!==null&&n!==void 0?n:!1),"locked"in t&&(this.locked=(i=t.locked)!==null&&i!==void 0?i:!1),"margin"in t&&(this.gridview.margin=(r=t.margin)!==null&&r!==void 0?r:0),"className"in t&&this._classNames.setClassNames((o=t.className)!==null&&o!==void 0?o:"")}maximizeGroup(t){this.gridview.maximizeView(t),this.doSetGroupActive(t)}isMaximizedGroup(t){return this.gridview.maximizedView()===t}exitMaximizedGroup(){this.gridview.exitMaximizedView()}hasMaximizedGroup(){return this.gridview.hasMaximizedView()}doAddGroup(t,n=[0],i){this.gridview.addView(t,i??Wt.Distribute,n),this._onDidAdd.fire(t)}doRemoveGroup(t,n){if(!this._groups.has(t.id))throw new Error("invalid operation");const i=this._groups.get(t.id),r=this.gridview.remove(t,Wt.Distribute);if(i&&!(n!=null&&n.skipDispose)&&(i.disposable.dispose(),i.value.dispose(),this._groups.delete(t.id),this._onDidRemove.fire(t)),!(n!=null&&n.skipActive)&&this._activeGroup===t){const o=Array.from(this._groups.values());this.doSetGroupActive(o.length>0?o[0].value:void 0)}return r}getPanel(t){var n;return(n=this._groups.get(t))===null||n===void 0?void 0:n.value}doSetGroupActive(t){this._activeGroup!==t&&(this._activeGroup&&this._activeGroup.setActive(!1),t&&t.setActive(!0),this._activeGroup=t,this._onDidActiveChange.fire(t))}removeGroup(t){this.doRemoveGroup(t)}moveToNext(t){var n;if(t||(t={}),!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}const i=Oe(t.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}moveToPrevious(t){var n;if(t||(t={}),!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}const i=Oe(t.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}layout(t,n,i){(i||t!==this.width||n!==this.height)&&(this.gridview.element.style.height=`${n}px`,this.gridview.element.style.width=`${t}px`,this.gridview.layout(t,n))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const t of this.groups)t.dispose();this.gridview.dispose(),super.dispose()}}class Wy{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get length(){return this.component.length}get orientation(){return this.component.orientation}get panels(){return this.component.panels}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}constructor(t){this.component=t}removePanel(t,n){this.component.removePanel(t,n)}focus(){this.component.focus()}getPanel(t){return this.component.getPanel(t)}layout(t,n){return this.component.layout(t,n)}addPanel(t){return this.component.addPanel(t)}movePanel(t,n){this.component.movePanel(t,n)}fromJSON(t){this.component.fromJSON(t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class ms{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get panels(){return this.component.panels}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}get onDidDrop(){return this.component.onDidDrop}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}constructor(t){this.component=t}removePanel(t){this.component.removePanel(t)}getPanel(t){return this.component.getPanel(t)}movePanel(t,n){this.component.movePanel(t,n)}focus(){this.component.focus()}layout(t,n){this.component.layout(t,n)}addPanel(t){return this.component.addPanel(t)}fromJSON(t){this.component.fromJSON(t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class jy{get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddPanel(){return this.component.onDidAddGroup}get onDidRemovePanel(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActiveGroupChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get panels(){return this.component.groups}get orientation(){return this.component.orientation}set orientation(t){this.component.updateOptions({orientation:t})}constructor(t){this.component=t}focus(){this.component.focus()}layout(t,n,i=!1){this.component.layout(t,n,i)}addPanel(t){return this.component.addPanel(t)}removePanel(t,n){this.component.removePanel(t,n)}movePanel(t,n){this.component.movePanel(t,n)}getPanel(t){return this.component.getPanel(t)}fromJSON(t){return this.component.fromJSON(t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class Cl{get id(){return this.component.id}get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get size(){return this.component.size}get totalPanels(){return this.component.totalPanels}get onDidActiveGroupChange(){return this.component.onDidActiveGroupChange}get onDidAddGroup(){return this.component.onDidAddGroup}get onDidRemoveGroup(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActivePanelChange}get onDidAddPanel(){return this.component.onDidAddPanel}get onDidRemovePanel(){return this.component.onDidRemovePanel}get onDidMovePanel(){return this.component.onDidMovePanel}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidDrop(){return this.component.onDidDrop}get onWillDrop(){return this.component.onWillDrop}get onWillShowOverlay(){return this.component.onWillShowOverlay}get onWillDragGroup(){return this.component.onWillDragGroup}get onWillDragPanel(){return this.component.onWillDragPanel}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}get onDidPopoutGroupSizeChange(){return this.component.onDidPopoutGroupSizeChange}get onDidPopoutGroupPositionChange(){return this.component.onDidPopoutGroupPositionChange}get onDidOpenPopoutWindowFail(){return this.component.onDidOpenPopoutWindowFail}get panels(){return this.component.panels}get groups(){return this.component.groups}get activePanel(){return this.component.activePanel}get activeGroup(){return this.component.activeGroup}constructor(t){this.component=t}focus(){this.component.focus()}getPanel(t){return this.component.getGroupPanel(t)}layout(t,n,i=!1){this.component.layout(t,n,i)}addPanel(t){return this.component.addPanel(t)}removePanel(t){this.component.removePanel(t)}addGroup(t){return this.component.addGroup(t)}closeAllGroups(){return this.component.closeAllGroups()}removeGroup(t){this.component.removeGroup(t)}getGroup(t){return this.component.getPanel(t)}addFloatingGroup(t,n){return this.component.addFloatingGroup(t,n)}fromJSON(t,n){this.component.fromJSON(t,n)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}moveToNext(t){this.component.moveToNext(t)}moveToPrevious(t){this.component.moveToPrevious(t)}maximizeGroup(t){this.component.maximizeGroup(t.group)}hasMaximizedGroup(){return this.component.hasMaximizedGroup()}exitMaximizedGroup(){this.component.exitMaximizedGroup()}get onDidMaximizedGroupChange(){return this.component.onDidMaximizedGroupChange}addPopoutGroup(t,n){return this.component.addPopoutGroup(t,n)}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class Ep extends ce{constructor(t,n){super(),this.el=t,this.disabled=n,this.dataDisposable=new Je,this.pointerEventsDisposable=new Je,this._onDragStart=new B,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}setDisabled(t){this.disabled=t}isCancelled(t){return!1}configure(){this.addDisposables(this._onDragStart,pe(this.el,"dragstart",t=>{if(t.defaultPrevented||this.isCancelled(t)||this.disabled){t.preventDefault();return}const n=kl();this.pointerEventsDisposable.value={dispose:()=>{n.release()}},this.el.classList.add("dv-dragged"),setTimeout(()=>this.el.classList.remove("dv-dragged"),0),this.dataDisposable.value=this.getData(t),this._onDragStart.fire(t),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.items.length>0||t.dataTransfer.setData("text/plain",""))}),pe(this.el,"dragend",()=>{this.pointerEventsDisposable.dispose(),setTimeout(()=>{this.dataDisposable.dispose()},0)}))}}class Uy extends ce{constructor(t,n){super(),this.element=t,this.callbacks=n,this.target=null,this.registerListeners()}onDragEnter(t){this.target=t.target,this.callbacks.onDragEnter(t)}onDragOver(t){t.preventDefault(),this.callbacks.onDragOver&&this.callbacks.onDragOver(t)}onDragLeave(t){this.target===t.target&&(this.target=null,this.callbacks.onDragLeave(t))}onDragEnd(t){this.target=null,this.callbacks.onDragEnd(t)}onDrop(t){this.callbacks.onDrop(t)}registerListeners(){this.addDisposables(pe(this.element,"dragenter",t=>{this.onDragEnter(t)},!0)),this.addDisposables(pe(this.element,"dragover",t=>{this.onDragOver(t)},!0)),this.addDisposables(pe(this.element,"dragleave",t=>{this.onDragLeave(t)})),this.addDisposables(pe(this.element,"dragend",t=>{this.onDragEnd(t)})),this.addDisposables(pe(this.element,"drop",t=>{this.onDrop(t)}))}}function mT(e,t){const{top:n,left:i,width:r,height:o}=t,s=`${Math.round(n)}px`,a=`${Math.round(i)}px`,l=`${Math.round(r)}px`,u=`${Math.round(o)}px`;e.style.top=s,e.style.left=a,e.style.width=l,e.style.height=u,e.style.visibility="visible",(!e.style.transform||e.style.transform==="")&&(e.style.transform="translate3d(0, 0, 0)")}function gT(e,t){const{top:n,left:i,width:r,height:o}=t;e.style.top=n,e.style.left=i,e.style.width=r,e.style.height=o,e.style.visibility="visible",(!e.style.transform||e.style.transform==="")&&(e.style.transform="translate3d(0, 0, 0)")}function vT(e,t){const{top:n,left:i,width:r,height:o}=t,s=`${Math.round(n)}px`,a=`${Math.round(i)}px`,l=`${Math.round(r)}px`,u=`${Math.round(o)}px`;return e.style.top!==s||e.style.left!==a||e.style.width!==l||e.style.height!==u}class wT extends kp{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(t){super(),this.options=t}}function Cg(e){switch(e){case"above":return"top";case"below":return"bottom";case"left":return"left";case"right":return"right";case"within":return"center";default:throw new Error(`invalid direction '${e}'`)}}function bT(e){switch(e){case"top":return"above";case"bottom":return"below";case"left":return"left";case"right":return"right";case"center":return"within";default:throw new Error(`invalid position '${e}'`)}}const yT={value:20,type:"percentage"},xT={value:50,type:"percentage"},_T=100,kT=100;class rn extends ce{get disabled(){return this._disabled}set disabled(t){this._disabled=t}get state(){return this._state}constructor(t,n){super(),this.element=t,this.options=n,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._disabled=!1,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new Uy(this.element,{onDragEnter:()=>{var i,r,o;(o=(r=(i=this.options).getOverrideTarget)===null||r===void 0?void 0:r.call(i))===null||o===void 0||o.getElements()},onDragOver:i=>{var r,o,s,a,l,u,d;rn.ACTUAL_TARGET=this;const c=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r);if(this._acceptedTargetZonesSet.size===0){if(c)return;this.removeDropTarget();return}const h=(l=(a=(s=this.options).getOverlayOutline)===null||a===void 0?void 0:a.call(s))!==null&&l!==void 0?l:this.element,p=h.offsetWidth,f=h.offsetHeight;if(p===0||f===0)return;const v=i.currentTarget.getBoundingClientRect(),b=((u=i.clientX)!==null&&u!==void 0?u:0)-v.left,m=((d=i.clientY)!==null&&d!==void 0?d:0)-v.top,w=this.calculateQuadrant(this._acceptedTargetZonesSet,b,m,p,f);if(this.isAlreadyUsed(i)||w===null){this.removeDropTarget();return}if(!this.options.canDisplayOverlay(i,w)){if(c)return;this.removeDropTarget();return}const g=new wT({nativeEvent:i,position:w});if(this._onWillShowOverlay.fire(g),g.defaultPrevented){this.removeDropTarget();return}this.markAsUsed(i),c||this.targetElement||(this.targetElement=document.createElement("div"),this.targetElement.className="dv-drop-target-dropzone",this.overlayElement=document.createElement("div"),this.overlayElement.className="dv-drop-target-selection",this._state="center",this.targetElement.appendChild(this.overlayElement),h.classList.add("dv-drop-target"),h.append(this.targetElement)),this.toggleClasses(w,p,f),this._state=w},onDragLeave:()=>{var i,r;!((r=(i=this.options).getOverrideTarget)===null||r===void 0)&&r.call(i)||this.removeDropTarget()},onDragEnd:i=>{var r,o;const s=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r);s&&rn.ACTUAL_TARGET===this&&this._state&&(i.stopPropagation(),this._onDrop.fire({position:this._state,nativeEvent:i})),this.removeDropTarget(),s==null||s.clear()},onDrop:i=>{var r,o,s;i.preventDefault();const a=this._state;this.removeDropTarget(),(s=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r))===null||s===void 0||s.clear(),a&&(i.stopPropagation(),this._onDrop.fire({position:a,nativeEvent:i}))}}),this.addDisposables(this._onDrop,this._onWillShowOverlay,this.dnd)}setTargetZones(t){this._acceptedTargetZonesSet=new Set(t)}setOverlayModel(t){this.options.overlayModel=t}dispose(){this.removeDropTarget(),super.dispose()}markAsUsed(t){t[rn.USED_EVENT_ID]=!0}isAlreadyUsed(t){const n=t[rn.USED_EVENT_ID];return typeof n=="boolean"&&n}toggleClasses(t,n,i){var r,o,s,a,l,u,d;const c=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r);if(!c&&!this.overlayElement)return;const h=n<_T,p=i<kT,f=t==="left",v=t==="right",b=t==="top",m=t==="bottom",w=!h&&v,g=!h&&f,y=!p&&b,k=!p&&m;let _=1;const E=(a=(s=this.options.overlayModel)===null||s===void 0?void 0:s.size)!==null&&a!==void 0?a:xT;if(E.type==="percentage"?_=Ie(E.value,0,100)/100:((w||g)&&(_=Ie(0,E.value,n)/n),(y||k)&&(_=Ie(0,E.value,i)/i)),c){const T=(d=(u=(l=this.options).getOverlayOutline)===null||u===void 0?void 0:u.call(l))!==null&&d!==void 0?d:this.element,C=T.getBoundingClientRect(),I=c.getElements(void 0,T),L=I.root,V=I.overlay,D=L.getBoundingClientRect(),P=C.top-D.top,A=C.left-D.left,O={top:P,left:A,width:n,height:i};if(w?(O.left=A+n*(1-_),O.width=n*_):g?O.width=n*_:y?O.height=i*_:k&&(O.top=P+i*(1-_),O.height=i*_),h&&f&&(O.width=4),h&&v&&(O.left=A+n-4,O.width=4),!vT(V,O))return;mT(V,O),V.className=`dv-drop-target-anchor${this.options.className?` ${this.options.className}`:""}`,ne(V,"dv-drop-target-left",f),ne(V,"dv-drop-target-right",v),ne(V,"dv-drop-target-top",b),ne(V,"dv-drop-target-bottom",m),ne(V,"dv-drop-target-center",t==="center"),I.changed&&(ne(V,"dv-drop-target-anchor-container-changed",!0),setTimeout(()=>{ne(V,"dv-drop-target-anchor-container-changed",!1)},10));return}if(!this.overlayElement)return;const S={top:"0px",left:"0px",width:"100%",height:"100%"};w?(S.left=`${100*(1-_)}%`,S.width=`${100*_}%`):g?S.width=`${100*_}%`:y?S.height=`${100*_}%`:k&&(S.top=`${100*(1-_)}%`,S.height=`${100*_}%`),gT(this.overlayElement,S),ne(this.overlayElement,"dv-drop-target-small-vertical",p),ne(this.overlayElement,"dv-drop-target-small-horizontal",h),ne(this.overlayElement,"dv-drop-target-left",f),ne(this.overlayElement,"dv-drop-target-right",v),ne(this.overlayElement,"dv-drop-target-top",b),ne(this.overlayElement,"dv-drop-target-bottom",m),ne(this.overlayElement,"dv-drop-target-center",t==="center")}calculateQuadrant(t,n,i,r,o){var s,a;const l=(a=(s=this.options.overlayModel)===null||s===void 0?void 0:s.activationSize)!==null&&a!==void 0?a:yT;return l.type==="percentage"?ST(t,n,i,r,o,l.value):CT(t,n,i,r,o,l.value)}removeDropTarget(){var t;this.targetElement&&(this._state=void 0,(t=this.targetElement.parentElement)===null||t===void 0||t.classList.remove("dv-drop-target"),this.targetElement.remove(),this.targetElement=void 0,this.overlayElement=void 0)}}rn.USED_EVENT_ID="__dockview_droptarget_event_is_used__";function ST(e,t,n,i,r,o){const s=100*t/i,a=100*n/r;return e.has("left")&&s<o?"left":e.has("right")&&s>100-o?"right":e.has("top")&&a<o?"top":e.has("bottom")&&a>100-o?"bottom":e.has("center")?"center":null}function CT(e,t,n,i,r,o){return e.has("left")&&t<o?"left":e.has("right")&&t>i-o?"right":e.has("top")&&n<o?"top":e.has("bottom")&&n>r-o?"bottom":e.has("center")?"center":null}const Wd=Object.keys({disableAutoResizing:void 0,disableDnd:void 0,className:void 0});class ET extends Ry{constructor(t,n,i,r){super(),this.nativeEvent=t,this.position=n,this.getData=i,this.panel=r}}class Yy extends kp{constructor(){super()}}class Xy extends ce{get isFocused(){return this._isFocused}get isActive(){return this._isActive}get isVisible(){return this._isVisible}get width(){return this._width}get height(){return this._height}constructor(t,n){super(),this.id=t,this.component=n,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new Je,this._onDidDimensionChange=new B,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new B,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new B,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new B,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new B,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new B,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new B,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new B,this.onDidParametersChange=this._onDidParametersChange.event,this.addDisposables(this.onDidFocusChange(i=>{this._isFocused=i.isFocused}),this.onDidActiveChange(i=>{this._isActive=i.isActive}),this.onDidVisibilityChange(i=>{this._isVisible=i.isVisible}),this.onDidDimensionsChange(i=>{this._width=i.width,this._height=i.height}),this.panelUpdatesDisposable,this._onDidDimensionChange,this._onDidChangeFocus,this._onDidVisibilityChange,this._onDidActiveChange,this._onWillFocus,this._onActiveChange,this._onWillFocus,this._onWillVisibilityChange,this._onDidParametersChange)}getParameters(){return this._parameters}initialize(t){this.panelUpdatesDisposable.value=this._onDidParametersChange.event(n=>{this._parameters=n,t.update({params:n})})}setVisible(t){this._onWillVisibilityChange.fire({isVisible:t})}setActive(){this._onActiveChange.fire()}updateParameters(t){this._onDidParametersChange.fire(t)}}class Zy extends Xy{constructor(t,n){super(t,n),this._onDidConstraintsChangeInternal=new B,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new B({replay:!0}),this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new B,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange)}setConstraints(t){this._onDidConstraintsChangeInternal.fire(t)}setSize(t){this._onDidSizeChange.fire(t)}}class DT extends Zy{set pane(t){this._pane=t}constructor(t,n){super(t,n),this._onDidExpansionChange=new B({replay:!0}),this.onDidExpansionChange=this._onDidExpansionChange.event,this._onMouseEnter=new B({}),this.onMouseEnter=this._onMouseEnter.event,this._onMouseLeave=new B({}),this.onMouseLeave=this._onMouseLeave.event,this.addDisposables(this._onDidExpansionChange,this._onMouseEnter,this._onMouseLeave)}setExpanded(t){var n;(n=this._pane)===null||n===void 0||n.setExpanded(t)}get isExpanded(){var t;return!!(!((t=this._pane)===null||t===void 0)&&t.isExpanded())}}class Dp extends ce{get element(){return this._element}get width(){return this._width}get height(){return this._height}get params(){var t;return(t=this._params)===null||t===void 0?void 0:t.params}constructor(t,n,i){super(),this.id=t,this.component=n,this.api=i,this._height=0,this._width=0,this._element=document.createElement("div"),this._element.tabIndex=-1,this._element.style.outline="none",this._element.style.height="100%",this._element.style.width="100%",this._element.style.overflow="hidden";const r=Vy(this._element);this.addDisposables(this.api,r.onDidFocus(()=>{this.api._onDidChangeFocus.fire({isFocused:!0})}),r.onDidBlur(()=>{this.api._onDidChangeFocus.fire({isFocused:!1})}),r)}focus(){const t=new Yy;this.api._onWillFocus.fire(t),!t.defaultPrevented&&this._element.focus()}layout(t,n){this._width=t,this._height=n,this.api._onDidDimensionChange.fire({width:t,height:n}),this.part&&this._params&&this.part.update(this._params.params)}init(t){this._params=t,this.part=this.getComponent()}update(t){var n,i;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},(n=this._params)===null||n===void 0?void 0:n.params),t.params)});for(const r of Object.keys(t.params))t.params[r]===void 0&&delete this._params.params[r];(i=this.part)===null||i===void 0||i.update({params:this._params.params})}toJSON(){var t,n;const i=(n=(t=this._params)===null||t===void 0?void 0:t.params)!==null&&n!==void 0?n:{};return{id:this.id,component:this.component,params:Object.keys(i).length>0?i:void 0}}dispose(){var t;this.api.dispose(),(t=this.part)===null||t===void 0||t.dispose(),super.dispose()}}class zT extends Dp{set orientation(t){this._orientation=t}get orientation(){return this._orientation}get minimumSize(){const t=this.headerSize,i=this.isExpanded()?this._minimumBodySize:0;return t+i}get maximumSize(){const t=this.headerSize,i=this.isExpanded()?this._maximumBodySize:0;return t+i}get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(t){this._orthogonalSize=t}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(t){this._minimumBodySize=typeof t=="number"?t:0}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(t){this._maximumBodySize=typeof t=="number"?t:Number.POSITIVE_INFINITY}get headerVisible(){return this._headerVisible}set headerVisible(t){this._headerVisible=t,this.header.style.display=t?"":"none"}constructor(t){super(t.id,t.component,new DT(t.id,t.component)),this._onDidChangeExpansionState=new B({replay:!0}),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._orthogonalSize=0,this._size=0,this._isExpanded=!1,this.api.pane=this,this.api.initialize(this),this.headerSize=t.headerSize,this.headerComponent=t.headerComponent,this._minimumBodySize=t.minimumBodySize,this._maximumBodySize=t.maximumBodySize,this._isExpanded=t.isExpanded,this._headerVisible=t.isHeaderVisible,this._onDidChangeExpansionState.fire(this.isExpanded()),this._orientation=t.orientation,this.element.classList.add("dv-pane"),this.addDisposables(this.api.onWillVisibilityChange(n=>{const{isVisible:i}=n,{accessor:r}=this._params;r.setVisible(this,i)}),this.api.onDidSizeChange(n=>{this._onDidChange.fire({size:n.size})}),pe(this.element,"mouseenter",n=>{this.api._onMouseEnter.fire(n)}),pe(this.element,"mouseleave",n=>{this.api._onMouseLeave.fire(n)})),this.addDisposables(this._onDidChangeExpansionState,this.onDidChangeExpansionState(n=>{this.api._onDidExpansionChange.fire({isExpanded:n})}),this.api.onDidFocusChange(n=>{this.header&&(n.isFocused?hn(this.header,"focused"):dn(this.header,"focused"))})),this.renderOnce()}setVisible(t){this.api._onDidVisibilityChange.fire({isVisible:t})}setActive(t){this.api._onDidActiveChange.fire({isActive:t})}isExpanded(){return this._isExpanded}setExpanded(t){this._isExpanded!==t&&(this._isExpanded=t,t?(this.animationTimer&&clearTimeout(this.animationTimer),this.body&&this.element.appendChild(this.body)):this.animationTimer=setTimeout(()=>{var n;(n=this.body)===null||n===void 0||n.remove()},200),this._onDidChange.fire(t?{size:this.width}:{}),this._onDidChangeExpansionState.fire(t))}layout(t,n){this._size=t,this._orthogonalSize=n;const[i,r]=this.orientation===re.HORIZONTAL?[t,n]:[n,t];super.layout(i,r)}init(t){var n,i;super.init(t),typeof t.minimumBodySize=="number"&&(this.minimumBodySize=t.minimumBodySize),typeof t.maximumBodySize=="number"&&(this.maximumBodySize=t.maximumBodySize),this.bodyPart=this.getBodyComponent(),this.headerPart=this.getHeaderComponent(),this.bodyPart.init(Object.assign(Object.assign({},t),{api:this.api})),this.headerPart.init(Object.assign(Object.assign({},t),{api:this.api})),(n=this.body)===null||n===void 0||n.append(this.bodyPart.element),(i=this.header)===null||i===void 0||i.append(this.headerPart.element),typeof t.isExpanded=="boolean"&&this.setExpanded(t.isExpanded)}toJSON(){const t=this._params;return Object.assign(Object.assign({},super.toJSON()),{headerComponent:this.headerComponent,title:t.title})}renderOnce(){this.header=document.createElement("div"),this.header.tabIndex=0,this.header.className="dv-pane-header",this.header.style.height=`${this.headerSize}px`,this.header.style.lineHeight=`${this.headerSize}px`,this.header.style.minHeight=`${this.headerSize}px`,this.header.style.maxHeight=`${this.headerSize}px`,this.element.appendChild(this.header),this.body=document.createElement("div"),this.body.className="dv-pane-body",this.element.appendChild(this.body)}getComponent(){return{update:t=>{var n,i;(n=this.bodyPart)===null||n===void 0||n.update({params:t}),(i=this.headerPart)===null||i===void 0||i.update({params:t})},dispose:()=>{var t,n;(t=this.bodyPart)===null||t===void 0||t.dispose(),(n=this.headerPart)===null||n===void 0||n.dispose()}}}}class PT extends zT{constructor(t){super({id:t.id,component:t.component,headerComponent:t.headerComponent,orientation:t.orientation,isExpanded:t.isExpanded,isHeaderVisible:!0,headerSize:t.headerSize,minimumBodySize:t.minimumBodySize,maximumBodySize:t.maximumBodySize}),this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.accessor=t.accessor,this.addDisposables(this._onDidDrop,this._onUnhandledDragOverEvent),t.disableDnd||this.initDragFeatures()}initDragFeatures(){if(!this.header)return;const t=this.id,n=this.accessor.id;this.header.draggable=!0,this.handler=new class extends Ep{getData(){return Dn.getInstance().setData([new Wo(n,t)],Wo.prototype),{dispose:()=>{Dn.getInstance().clearData(Wo.prototype)}}}}(this.header),this.target=new rn(this.element,{acceptedTargetZones:["top","bottom"],overlayModel:{activationSize:{type:"percentage",value:50}},canDisplayOverlay:(i,r)=>{const o=ko();if(o&&o.paneId!==this.id&&o.viewId===this.accessor.id)return!0;const s=new ET(i,r,ko,this);return this._onUnhandledDragOverEvent.fire(s),s.isAccepted}}),this.addDisposables(this._onDidDrop,this.handler,this.target,this.target.onDrop(i=>{this.onDrop(i)}))}onDrop(t){const n=ko();if(!n||n.viewId!==this.accessor.id){this._onDidDrop.fire(Object.assign(Object.assign({},t),{panel:this,api:new ms(this.accessor),getData:ko}));return}const i=this._params.containerApi,r=n.paneId,o=i.getPanel(r);if(!o){this._onDidDrop.fire(Object.assign(Object.assign({},t),{panel:this,getData:ko,api:new ms(this.accessor)}));return}const s=i.panels,a=s.indexOf(o);let l=i.panels.indexOf(this);(t.position==="left"||t.position==="top")&&(l=Math.max(0,l-1)),(t.position==="right"||t.position==="bottom")&&(a>l&&l++,l=Math.min(s.length-1,l)),i.movePanel(a,l)}}class AT extends ce{get element(){return this._element}constructor(t,n){super(),this.accessor=t,this.group=n,this.disposable=new Je,this._onDidFocus=new B,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new B,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-content-container",this._element.tabIndex=-1,this.addDisposables(this._onDidFocus,this._onDidBlur);const i=n.dropTargetContainer;this.dropTarget=new rn(this.element,{getOverlayOutline:()=>{var r;return((r=t.options.theme)===null||r===void 0?void 0:r.dndPanelOverlay)==="group"?this.element.parentElement:null},className:"dv-drop-target-content",acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(r,o)=>{if(this.group.locked==="no-drop-target"||this.group.locked&&o==="center")return!1;const s=rt();return!s&&r.shiftKey&&this.group.location.type!=="floating"?!1:s&&s.viewId===this.accessor.id?!0:this.group.canDisplayOverlay(r,o,"content")},getOverrideTarget:i?()=>i.model:void 0}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(t,n={asActive:!0}){const i=n.asActive||this.panel&&this.group.isPanelActive(this.panel);this.panel&&this.panel.view.content.element.parentElement===this._element&&this._element.removeChild(this.panel.view.content.element),this.panel=t;let r;switch(t.api.renderer){case"onlyWhenVisible":this.group.renderContainer.detatch(t),this.panel&&i&&this._element.appendChild(this.panel.view.content.element),r=this._element;break;case"always":t.view.content.element.parentElement===this._element&&this._element.removeChild(t.view.content.element),r=this.group.renderContainer.attach({panel:t,referenceContainer:this});break;default:throw new Error(`dockview: invalid renderer type '${t.api.renderer}'`)}if(i){const o=Vy(r);this.focusTracker=o;const s=new ce;s.addDisposables(o,o.onDidFocus(()=>this._onDidFocus.fire()),o.onDidBlur(()=>this._onDidBlur.fire())),this.disposable.value=s}}openPanel(t){this.panel!==t&&this.renderPanel(t)}layout(t,n){}closePanel(){var t;this.panel&&this.panel.api.renderer==="onlyWhenVisible"&&((t=this.panel.view.content.element.parentElement)===null||t===void 0||t.removeChild(this.panel.view.content.element)),this.panel=void 0}dispose(){this.disposable.dispose(),super.dispose()}refreshFocusState(){var t;!((t=this.focusTracker)===null||t===void 0)&&t.refreshState&&this.focusTracker.refreshState()}}function qy(e,t,n){var i,r;hn(t,"dv-dragged"),t.style.top="-9999px",document.body.appendChild(t),e.setDragImage(t,(i=n==null?void 0:n.x)!==null&&i!==void 0?i:0,(r=n==null?void 0:n.y)!==null&&r!==void 0?r:0),setTimeout(()=>{dn(t,"dv-dragged"),t.remove()},0)}class IT extends Ep{constructor(t,n,i,r,o){super(t,o),this.accessor=n,this.group=i,this.panel=r,this.panelTransfer=Dn.getInstance()}getData(t){return this.panelTransfer.setData([new bi(this.accessor.id,this.group.id,this.panel.id)],bi.prototype),{dispose:()=>{this.panelTransfer.clearData(bi.prototype)}}}}class NT extends ce{get element(){return this._element}constructor(t,n,i){super(),this.panel=t,this.accessor=n,this.group=i,this.content=void 0,this._onPointDown=new B,this.onPointerDown=this._onPointDown.event,this._onDropped=new B,this.onDrop=this._onDropped.event,this._onDragStart=new B,this.onDragStart=this._onDragStart.event,this._onDragEnd=new B,this.onDragEnd=this._onDragEnd.event,this._element=document.createElement("div"),this._element.className="dv-tab",this._element.tabIndex=0,this._element.draggable=!this.accessor.options.disableDnd,ne(this.element,"dv-inactive-tab",!0),this.dragHandler=new IT(this._element,this.accessor,this.group,this.panel,!!this.accessor.options.disableDnd),this.dropTarget=new rn(this._element,{acceptedTargetZones:["left","right"],overlayModel:{activationSize:{value:50,type:"percentage"}},canDisplayOverlay:(r,o)=>{if(this.group.locked)return!1;const s=rt();return s&&this.accessor.id===s.viewId?!(this.accessor.options.tabAnimation==="smooth"&&s.groupId===this.group.id):this.group.model.canDisplayOverlay(r,o,"tab")},getOverrideTarget:()=>{var r;return(r=i.model.dropTargetContainer)===null||r===void 0?void 0:r.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onPointDown,this._onDropped,this._onDragStart,this._onDragEnd,this.dragHandler.onDragStart(r=>{if(r.dataTransfer){const o=getComputedStyle(this.element),s=this.element.cloneNode(!0);Array.from(o).forEach(a=>s.style.setProperty(a,o.getPropertyValue(a),o.getPropertyPriority(a))),s.style.position="absolute",qy(r.dataTransfer,s,{y:-10,x:30})}this._onDragStart.fire(r),this.accessor.options.tabAnimation==="smooth"&&requestAnimationFrame(()=>{ne(this.element,"dv-tab--dragging",!0)})}),pe(this._element,"dragend",r=>{ne(this.element,"dv-tab--dragging",!1),this._onDragEnd.fire(r)}),this.dragHandler,pe(this._element,"pointerdown",r=>{this._onPointDown.fire(r)}),this.dropTarget.onDrop(r=>{this._onDropped.fire(r)}),this.dropTarget)}setActive(t){ne(this.element,"dv-active-tab",t),ne(this.element,"dv-inactive-tab",!t)}setContent(t){this.content&&this._element.removeChild(this.content.element),this.content=t,this._element.appendChild(this.content.element)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,this.dragHandler.setDisabled(!!this.accessor.options.disableDnd)}dispose(){super.dispose()}}class du{get kind(){return this.options.kind}get nativeEvent(){return this.event.nativeEvent}get position(){return this.event.position}get defaultPrevented(){return this.event.defaultPrevented}get panel(){return this.options.panel}get api(){return this.options.api}get group(){return this.options.group}preventDefault(){this.event.preventDefault()}getData(){return this.options.getData()}constructor(t,n){this.event=t,this.options=n}}class TT extends Ep{constructor(t,n,i,r){super(t,r),this.accessor=n,this.group=i,this.panelTransfer=Dn.getInstance(),this.addDisposables(pe(t,"pointerdown",o=>{o.shiftKey&&qN(o)},!0))}isCancelled(t){return this.group.api.location.type==="floating"&&!t.shiftKey}getData(t){const n=t.dataTransfer;this.panelTransfer.setData([new bi(this.accessor.id,this.group.id,null)],bi.prototype);const i=window.getComputedStyle(this.el),r=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),o=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(n){const s=document.createElement("div");s.style.backgroundColor=r,s.style.color=o,s.style.padding="2px 8px",s.style.height="24px",s.style.fontSize="11px",s.style.lineHeight="20px",s.style.borderRadius="12px",s.style.position="absolute",s.style.pointerEvents="none",s.style.top="-9999px",s.textContent=`Multiple Panels (${this.group.size})`,qy(n,s,{y:-10,x:30})}return{dispose:()=>{this.panelTransfer.clearData(bi.prototype)}}}}class MT extends ce{get element(){return this._element}constructor(t,n){super(),this.accessor=t,this.group=n,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onDragStart=new B,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!this.accessor.options.disableDnd,ne(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.addDisposables(this._onDrop,this._onDragStart,pe(this._element,"pointerdown",()=>{this.accessor.doSetGroupActive(this.group)})),this.handler=new TT(this._element,t,n,!!this.accessor.options.disableDnd),this.dropTarget=new rn(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(i,r)=>{const o=rt();return o&&this.accessor.id===o.viewId?!0:n.model.canDisplayOverlay(i,r,"header_space")},getOverrideTarget:()=>{var i;return(i=n.model.dropTargetContainer)===null||i===void 0?void 0:i.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this.handler,this.handler.onDragStart(i=>{this._onDragStart.fire(i)}),this.dropTarget.onDrop(i=>{this._onDrop.fire(i)}),this.dropTarget)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,ne(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.handler.setDisabled(!!this.accessor.options.disableDnd)}}class hu extends ce{get element(){return this._element}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._scrollOffset=0,this._orientation=t,dn(this._scrollbar,"dv-scrollbar-vertical","dv-scrollbar-horizontal"),t==="vertical"?hn(this._scrollbar,"dv-scrollbar-vertical"):hn(this._scrollbar,"dv-scrollbar-horizontal"))}constructor(t){super(),this.scrollableElement=t,this._scrollOffset=0,this._orientation="horizontal",this._element=document.createElement("div"),this._element.className="dv-scrollable",this._scrollbar=document.createElement("div"),this._scrollbar.className="dv-scrollbar dv-scrollbar-horizontal",this.element.appendChild(t),this.element.appendChild(this._scrollbar),this.addDisposables(pe(this.element,"wheel",n=>{this._scrollOffset+=n.deltaY*hu.MouseWheelSpeed,this.calculateScrollbarStyles()}),pe(this._scrollbar,"pointerdown",n=>{n.preventDefault(),ne(this.element,"dv-scrollable-scrolling",!0);const i=this._orientation==="horizontal"?n.clientX:n.clientY,r=this._scrollOffset,o=a=>{const l=this._orientation==="horizontal"?a.clientX-i:a.clientY-i,u=this._orientation==="horizontal"?this.element.clientWidth:this.element.clientHeight,d=this._orientation==="horizontal"?this.scrollableElement.scrollWidth:this.scrollableElement.scrollHeight,c=u/d;this._scrollOffset=r+l/c,this.calculateScrollbarStyles()},s=()=>{ne(this.element,"dv-scrollable-scrolling",!1),document.removeEventListener("pointermove",o),document.removeEventListener("pointerup",s),document.removeEventListener("pointercancel",s)};document.addEventListener("pointermove",o),document.addEventListener("pointerup",s),document.addEventListener("pointercancel",s)}),pe(this.element,"scroll",()=>{this.calculateScrollbarStyles()}),pe(this.scrollableElement,"scroll",()=>{this._scrollOffset=this._orientation==="horizontal"?this.scrollableElement.scrollLeft:this.scrollableElement.scrollTop,this.calculateScrollbarStyles()}),uu(this.element,()=>{ne(this.element,"dv-scrollable-resizing",!0),this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(()=>{clearTimeout(this._animationTimer),ne(this.element,"dv-scrollable-resizing",!1)},500),this.calculateScrollbarStyles()}))}calculateScrollbarStyles(){const t=this._orientation==="horizontal"?this.element.clientWidth:this.element.clientHeight,n=this._orientation==="horizontal"?this.scrollableElement.scrollWidth:this.scrollableElement.scrollHeight;if(n>t){const r=t*(t/n);this._orientation==="horizontal"?(this._scrollbar.style.width=`${r}px`,this._scrollbar.style.height=""):(this._scrollbar.style.height=`${r}px`,this._scrollbar.style.width=""),this._scrollOffset=Ie(this._scrollOffset,0,n-t),this._orientation==="horizontal"?this.scrollableElement.scrollLeft=this._scrollOffset:this.scrollableElement.scrollTop=this._scrollOffset;const o=this._scrollOffset/(n-t);this._orientation==="horizontal"?(this._scrollbar.style.left=`${(t-r)*o}px`,this._scrollbar.style.top=""):(this._scrollbar.style.top=`${(t-r)*o}px`,this._scrollbar.style.left="")}else this._orientation==="horizontal"?(this._scrollbar.style.width="0px",this._scrollbar.style.left="0px"):(this._scrollbar.style.height="0px",this._scrollbar.style.top="0px"),this._scrollOffset=0}}hu.MouseWheelSpeed=1;class LT extends ce{get showTabsOverflowControl(){return this._showTabsOverflowControl}set showTabsOverflowControl(t){if(this._showTabsOverflowControl!=t&&(this._showTabsOverflowControl=t,t)){const n=new XN(this._tabsList);this._observerDisposable.value=new ce(n,n.onDidChange(i=>{const r=i.hasScrollX||i.hasScrollY;this.toggleDropdown({reset:!r})}),pe(this._tabsList,"scroll",()=>{this.toggleDropdown({reset:!1})}))}}get element(){return this._element}get panels(){return this._tabs.map(t=>t.value.panel.id)}get size(){return this._tabs.length}get tabs(){return this._tabs.map(t=>t.value)}get direction(){return this._direction}set direction(t){this._direction!==t&&(this._direction=t,this._scrollbar&&(this._scrollbar.orientation=t),dn(this._tabsList,"dv-horizontal","dv-vertical"),t==="vertical"?hn(this._tabsList,"dv-tabs-container-vertical","dv-vertical"):(dn(this._tabsList,"dv-tabs-container-vertical"),hn(this._tabsList,"dv-horizontal")))}constructor(t,n,i){super(),this.group=t,this.accessor=n,this._observerDisposable=new Je,this._scrollbar=null,this._tabs=[],this.selectedIndex=-1,this._showTabsOverflowControl=!1,this._direction="horizontal",this._animState=null,this._onTabDragStart=new B,this.onTabDragStart=this._onTabDragStart.event,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onOverflowTabsChange=new B,this.onOverflowTabsChange=this._onOverflowTabsChange.event,this._tabsList=document.createElement("div"),this._tabsList.className="dv-tabs-container",this.showTabsOverflowControl=i.showTabsOverflowControl,n.options.scrollbars==="native"?this._element=this._tabsList:(this._scrollbar=new hu(this._tabsList),this._scrollbar.orientation=this.direction,this._element=this._scrollbar.element,this.addDisposables(this._scrollbar)),this.addDisposables(this._onOverflowTabsChange,this._observerDisposable,this._onWillShowOverlay,this._onDrop,this._onTabDragStart,pe(this.element,"pointerdown",r=>{if(r.defaultPrevented)return;r.button===0&&this.accessor.doSetGroupActive(this.group)}),pe(this._tabsList,"dragover",r=>{if(!this._animState){if(this.accessor.options.tabAnimation!=="smooth"||this.accessor.options.disableDnd)return;const o=rt();if(o&&o.panelId&&o.groupId!==this.group.id)this._animState={sourceTabId:o.panelId,sourceIndex:-1,tabPositions:this.snapshotTabPositions(),currentInsertionIndex:null};else return}this.handleDragOver(r)},!0),pe(this._tabsList,"dragleave",r=>{this._animState&&(r.relatedTarget&&this._tabsList.contains(r.relatedTarget)||(this.resetTabTransforms(),this._animState&&(this._animState.sourceIndex===-1?this._animState=null:this._animState.currentInsertionIndex=null)))},!0),pe(this._tabsList,"dragend",()=>{this.resetDragAnimation()}),pe(this._tabsList,"drop",r=>{if(this.accessor.options.tabAnimation!=="smooth"||!this._animState||this._animState.currentInsertionIndex===null)return;r.stopPropagation(),r.preventDefault();const o=this._animState;this._animState=null;const s=o.currentInsertionIndex,a=o.sourceIndex,l=s-(a!==-1&&a<s?1:0);if(l===a){this.resetTabTransforms();return}const u=this.snapshotTabPositions();this.resetTabTransforms(),this._onDrop.fire({event:r,index:l}),this.runFlipAnimation(u,o.sourceTabId,o.sourceIndex===-1,{from:Math.min(a,l),to:Math.max(a,l)})},!0),je.from(()=>{this.resetDragAnimation();for(const{value:r,disposable:o}of this._tabs)o.dispose(),r.dispose();this._tabs=[]}))}indexOf(t){return this._tabs.findIndex(n=>n.value.panel.id===t)}isActive(t){return this.selectedIndex>-1&&this._tabs[this.selectedIndex].value===t}setActivePanel(t){let n=0;for(const i of this._tabs){const r=t.id===i.value.panel.id;if(i.value.setActive(r),r){const o=i.value.element,s=o.parentElement;(n<s.scrollLeft||n+o.clientWidth>s.scrollLeft+s.clientWidth)&&(s.scrollLeft=n)}n+=i.value.element.clientWidth}}openPanel(t,n=this._tabs.length){if(this._tabs.find(s=>s.value.panel.id===t.id))return;const i=new NT(t,this.accessor,this.group);i.setContent(t.view.tab);const r=new ce(i.onDragStart(s=>{this._onTabDragStart.fire({nativeEvent:s,panel:t}),this.accessor.options.tabAnimation==="smooth"&&(this._animState={sourceTabId:t.id,sourceIndex:this._tabs.findIndex(a=>a.value===i),tabPositions:this.snapshotTabPositions(),currentInsertionIndex:null})}),i.onPointerDown(s=>{if(s.defaultPrevented)return;const a=!this.accessor.options.disableFloatingGroups,l=this.group.api.location.type==="floating"&&this.size===1;if(a&&!l&&s.shiftKey){s.preventDefault();const u=this.accessor.getGroupPanel(i.panel.id),{top:d,left:c}=i.element.getBoundingClientRect(),{top:h,left:p}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(u,{x:c-p,y:d-h,inDragMode:!0});return}switch(s.button){case 0:this.group.activePanel!==t&&this.group.model.openPanel(t);break}}),i.onDrop(s=>{const a=this._animState;this._animState=null;const l=this._tabs.findIndex(u=>u.value===i);if(a){const u=this.snapshotTabPositions();this.resetTabTransforms(),this._onDrop.fire({event:s.nativeEvent,index:l}),this.runFlipAnimation(u,a.sourceTabId,a.sourceIndex===-1,a.sourceIndex!==-1?{from:Math.min(a.sourceIndex,l),to:Math.max(a.sourceIndex,l)}:void 0)}else this._onDrop.fire({event:s.nativeEvent,index:l})}),i.onWillShowOverlay(s=>{this._onWillShowOverlay.fire(new du(s,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:rt}))})),o={value:i,disposable:r};this.addTab(o,n),this._animState&&(this._animState.tabPositions=this.snapshotTabPositions(),this.applyDragOverTransforms())}delete(t){var n;((n=this._animState)===null||n===void 0?void 0:n.sourceTabId)===t&&(this.resetTabTransforms(),this._animState=null);const i=this.indexOf(t),r=this._tabs.splice(i,1)[0],{value:o,disposable:s}=r;s.dispose(),o.dispose(),o.element.remove(),this._animState&&(this._animState.tabPositions=this.snapshotTabPositions(),this.applyDragOverTransforms())}addTab(t,n=this._tabs.length){if(n<0||n>this._tabs.length)throw new Error("invalid location");this._tabsList.insertBefore(t.value.element,this._tabsList.children[n]),this._tabs=[...this._tabs.slice(0,n),t,...this._tabs.slice(n)],this.selectedIndex<0&&(this.selectedIndex=n)}toggleDropdown(t){const n=t.reset?[]:this._tabs.filter(i=>!nT(i.value.element,this._tabsList)).map(i=>i.value.panel.id);this._onOverflowTabsChange.fire({tabs:n,reset:t.reset})}updateDragAndDropState(){for(const t of this._tabs)t.value.updateDragAndDropState()}snapshotTabPositions(){const t=new Map;for(const n of this._tabs)t.set(n.value.panel.id,n.value.element.getBoundingClientRect());return t}getAverageTabWidth(){if(this._tabs.length===0)return 0;let t=0;for(const n of this._tabs)t+=n.value.element.getBoundingClientRect().width;return t/this._tabs.length}handleDragOver(t){if(!this._animState)return;const n=t.clientX;let i=null;for(let r=0;r<this._tabs.length;r++){const o=this._tabs[r].value;if(o.panel.id===this._animState.sourceTabId)continue;const s=o.element.getBoundingClientRect(),a=s.left+s.width/2;if(n<a){i=r;break}i=r+1}i!==this._animState.currentInsertionIndex&&(this._animState.currentInsertionIndex=i,this.applyDragOverTransforms())}applyDragOverTransforms(){if(!this._animState||this._animState.currentInsertionIndex===null){this.resetTabTransforms();return}const t=this._animState.currentInsertionIndex,n=this._animState.tabPositions.get(this._animState.sourceTabId),i=n?n.width:this.getAverageTabWidth();let r=!1;for(let o=0;o<this._tabs.length;o++){const s=this._tabs[o].value;if(s.panel.id!==this._animState.sourceTabId)if(!r&&o>=t)s.element.style.marginLeft=`${i}px`,ne(s.element,"dv-tab--shifting",!0),r=!0;else if(s.element.style.marginLeft){s.element.style.marginLeft="0px",ne(s.element,"dv-tab--shifting",!0);const a=()=>{s.element.style.removeProperty("margin-left"),ne(s.element,"dv-tab--shifting",!1),s.element.removeEventListener("transitionend",a)};s.element.addEventListener("transitionend",a)}else ne(s.element,"dv-tab--shifting",!1)}}resetTabTransforms(){for(const t of this._tabs)t.value.element.style.removeProperty("margin-left"),t.value.element.style.removeProperty("transform"),ne(t.value.element,"dv-tab--shifting",!1)}resetDragAnimation(){this.resetTabTransforms(),this._animState=null;for(const t of this._tabs)ne(t.value.element,"dv-tab--dragging",!1)}runFlipAnimation(t,n,i=!1,r){let o=!1;for(let s=0;s<this._tabs.length;s++){const a=this._tabs[s],l=a.value.panel.id;if(l===n){if(i){const h=a.value.element.getBoundingClientRect();a.value.element.style.transform=`translateX(${h.width}px)`,ne(a.value.element,"dv-tab--shifting",!0),o=!0}continue}if(r!==void 0&&(s<r.from||s>r.to))continue;const u=t.get(l);if(!u)continue;const d=a.value.element.getBoundingClientRect(),c=u.left-d.left;Math.abs(c)<1||(a.value.element.style.transform=`translateX(${c}px)`,ne(a.value.element,"dv-tab--shifting",!0),o=!0)}o&&requestAnimationFrame(()=>{for(const a of this._tabs)a.value.element.style.transform&&(a.value.element.style.transform="");const s=a=>{if(a.propertyName==="transform"){this._tabsList.removeEventListener("transitionend",s);for(const l of this._tabs)ne(l.value.element,"dv-tab--shifting",!1)}};this._tabsList.addEventListener("transitionend",s)})}}const zp=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"height",e.height),t.setAttributeNS(null,"width",e.width),t.setAttributeNS(null,"viewBox",e.viewbox),t.setAttributeNS(null,"aria-hidden","false"),t.setAttributeNS(null,"focusable","false"),t.classList.add("dv-svg");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d",e.path),t.appendChild(n),t},OT=()=>zp({width:"11",height:"11",viewbox:"0 0 28 28",path:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"}),RT=()=>zp({width:"11",height:"11",viewbox:"0 0 24 15",path:"M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z"}),Qy=()=>zp({width:"11",height:"11",viewbox:"0 0 15 25",path:"M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z"});function VT(){const e=document.createElement("div");e.className="dv-tabs-overflow-dropdown-default";const t=document.createElement("span");t.textContent="";const n=Qy();return e.appendChild(n),e.appendChild(t),{element:e,update:i=>{t.textContent=`${i.tabs}`}}}class FT extends ce{get onTabDragStart(){return this.tabs.onTabDragStart}get panels(){return this.tabs.panels}get size(){return this.tabs.size}get hidden(){return this._hidden}set hidden(t){this._hidden=t,this.element.style.display=t?"none":""}get direction(){return this._direction}set direction(t){this._direction=t,t==="vertical"?(hn(this._element,"dv-groupview-header-vertical"),hn(this.rightActionsContainer,"dv-right-actions-container-vertical"),this.tabs.direction=t):(dn(this._element,"dv-groupview-header-vertical"),dn(this.rightActionsContainer,"dv-right-actions-container-vertical"),this.tabs.direction=t)}get element(){return this._element}constructor(t,n){super(),this.accessor=t,this.group=n,this._hidden=!1,this._direction="horizontal",this.dropdownPart=null,this._overflowTabs=[],this._dropdownDisposable=new Je,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onGroupDragStart=new B,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",ne(this._element,"dv-full-width-single-tab",this.accessor.options.singleTabMode==="fullwidth"),this.rightActionsContainer=document.createElement("div"),this.rightActionsContainer.className="dv-right-actions-container",this.leftActionsContainer=document.createElement("div"),this.leftActionsContainer.className="dv-left-actions-container",this.preActionsContainer=document.createElement("div"),this.preActionsContainer.className="dv-pre-actions-container",this.tabs=new LT(n,t,{showTabsOverflowControl:!t.options.disableTabsOverflowList}),this.voidContainer=new MT(this.accessor,this.group),this._element.appendChild(this.preActionsContainer),this._element.appendChild(this.tabs.element),this._element.appendChild(this.leftActionsContainer),this._element.appendChild(this.voidContainer.element),this._element.appendChild(this.rightActionsContainer),this.addDisposables(this.tabs.onDrop(i=>this._onDrop.fire(i)),this.tabs.onWillShowOverlay(i=>this._onWillShowOverlay.fire(i)),t.onDidOptionsChange(()=>{this.tabs.showTabsOverflowControl=!t.options.disableTabsOverflowList}),this.tabs.onOverflowTabsChange(i=>{this.toggleDropdown(i)}),this.tabs,this._onWillShowOverlay,this._onDrop,this._onGroupDragStart,this.voidContainer,this.voidContainer.onDragStart(i=>{this._onGroupDragStart.fire({nativeEvent:i,group:this.group})}),this.voidContainer.onDrop(i=>{this._onDrop.fire({event:i.nativeEvent,index:this.tabs.size})}),this.voidContainer.onWillShowOverlay(i=>{this._onWillShowOverlay.fire(new du(i,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:rt}))}),pe(this.voidContainer.element,"pointerdown",i=>{if(i.defaultPrevented)return;if(!this.accessor.options.disableFloatingGroups&&i.shiftKey&&this.group.api.location.type!=="floating"){i.preventDefault();const{top:o,left:s}=this.element.getBoundingClientRect(),{top:a,left:l}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:s-l+20,y:o-a+20,inDragMode:!0})}}))}show(){this.hidden||(this.element.style.display="")}hide(){this._element.style.display="none"}setRightActionsElement(t){this.rightActions!==t&&(this.rightActions&&(this.rightActions.remove(),this.rightActions=void 0),t&&(this.rightActionsContainer.appendChild(t),this.rightActions=t))}setLeftActionsElement(t){this.leftActions!==t&&(this.leftActions&&(this.leftActions.remove(),this.leftActions=void 0),t&&(this.leftActionsContainer.appendChild(t),this.leftActions=t))}setPrefixActionsElement(t){this.preActions!==t&&(this.preActions&&(this.preActions.remove(),this.preActions=void 0),t&&(this.preActionsContainer.appendChild(t),this.preActions=t))}isActive(t){return this.tabs.isActive(t)}indexOf(t){return this.tabs.indexOf(t)}setActive(t){}delete(t){this.tabs.delete(t),this.updateClassnames()}setActivePanel(t){this.tabs.setActivePanel(t)}openPanel(t,n=this.tabs.size){this.tabs.openPanel(t,n),this.updateClassnames()}closePanel(t){this.delete(t.id)}updateClassnames(){ne(this._element,"dv-single-tab",this.size===1)}toggleDropdown(t){const n=t.reset?[]:t.tabs;if(this._overflowTabs=n,this._overflowTabs.length>0&&this.dropdownPart){this.dropdownPart.update({tabs:n.length});return}if(this._overflowTabs.length===0){this._dropdownDisposable.dispose();return}const i=document.createElement("div");i.className="dv-tabs-overflow-dropdown-root";const r=VT();r.update({tabs:n.length}),this.dropdownPart=r,i.appendChild(r.element),this.rightActionsContainer.prepend(i),this._dropdownDisposable.value=new ce(je.from(()=>{var o,s;i.remove(),(s=(o=this.dropdownPart)===null||o===void 0?void 0:o.dispose)===null||s===void 0||s.call(o),this.dropdownPart=null}),pe(i,"pointerdown",o=>{o.preventDefault()},{capture:!0}),pe(i,"click",o=>{const s=document.createElement("div");s.style.overflow="auto",s.className="dv-tabs-overflow-container";for(const l of this.tabs.tabs.filter(u=>this._overflowTabs.includes(u.panel.id))){const u=this.group.panels.find(p=>p===l.panel),c=u.view.createTabRenderer("headerOverflow").element,h=document.createElement("div");ne(h,"dv-tab",!0),ne(h,"dv-active-tab",u.api.isActive),ne(h,"dv-inactive-tab",!u.api.isActive),h.addEventListener("click",p=>{this.accessor.popupService.close(),!p.defaultPrevented&&(l.element.scrollIntoView(),l.panel.api.setActive())}),h.appendChild(c),s.appendChild(h)}const a=sT(i);this.accessor.popupService.openPopover(s,{x:o.clientX,y:o.clientY,zIndex:a!=null&&a.style.zIndex?`calc(${a.style.zIndex} * 2)`:void 0})}))}updateDragAndDropState(){this.tabs.updateDragAndDropState(),this.voidContainer.updateDragAndDropState()}}class Ky extends Ry{constructor(t,n,i,r,o){super(),this.nativeEvent=t,this.target=n,this.position=i,this.getData=r,this.group=o}}const jd=Object.keys({disableAutoResizing:void 0,hideBorders:void 0,singleTabMode:void 0,disableFloatingGroups:void 0,floatingGroupBounds:void 0,popoutUrl:void 0,defaultRenderer:void 0,defaultHeaderPosition:void 0,debug:void 0,rootOverlayModel:void 0,locked:void 0,disableDnd:void 0,className:void 0,noPanelsOverlay:void 0,dndEdges:void 0,theme:void 0,disableTabsOverflowList:void 0,scrollbars:void 0,tabAnimation:void 0});function HT(e){return!!e.referencePanel}function GT(e){return!!e.referenceGroup}function BT(e){return!!e.referencePanel}function $T(e){return!!e.referenceGroup}class Pp extends kp{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}get panel(){return this.options.panel}get group(){return this.options.group}get api(){return this.options.api}constructor(t){super(),this.options=t}getData(){return this.options.getData()}}class Jy extends Pp{get kind(){return this._kind}constructor(t){super(t),this._kind=t.kind}}class WT extends ce{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(t){this._locked=t,ne(this.container,"dv-locked-groupview",t==="no-drop-target"||t)}get isActive(){return this._isGroupActive}get panels(){return this._panels}get size(){return this._panels.length}get isEmpty(){return this._panels.length===0}get hasWatermark(){return!!(this.watermark&&this.container.contains(this.watermark.element))}get header(){return this.tabsContainer}get isContentFocused(){return document.activeElement?Rd(document.activeElement,this.contentContainer.element):!1}get headerPosition(){var t;return(t=this._headerPosition)!==null&&t!==void 0?t:"top"}set headerPosition(t){var n;this._headerPosition=t,dn(this.container,"dv-groupview-header-top","dv-groupview-header-bottom","dv-groupview-header-left","dv-groupview-header-right"),hn(this.container,`dv-groupview-header-${t}`);const i=t==="top"||t==="bottom"?"horizontal":"vertical";this.tabsContainer.direction=i,this.header.direction=i,!((n=this._activePanel)===null||n===void 0)&&n.layout&&this._activePanel.layout(this._width,this._height),(this._leftHeaderActions||this._rightHeaderActions||this._prefixHeaderActions)&&this.updateHeaderActions()}get location(){return this._location}set location(t){switch(this._location=t,ne(this.container,"dv-groupview-floating",!1),ne(this.container,"dv-groupview-popout",!1),t.type){case"grid":this.contentContainer.dropTarget.setTargetZones(["top","bottom","left","right","center"]);break;case"floating":this.contentContainer.dropTarget.setTargetZones(["center"]),this.contentContainer.dropTarget.setTargetZones(t?["center"]:["top","bottom","left","right","center"]),ne(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),ne(this.container,"dv-groupview-popout",!0);break}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(t,n,i,r,o){var s,a;super(),this.container=t,this.accessor=n,this.id=i,this.options=r,this.groupPanel=o,this._isGroupActive=!1,this._locked=!1,this._rightHeaderActionsDisposable=new Je,this._leftHeaderActionsDisposable=new Je,this._prefixHeaderActionsDisposable=new Je,this._location={type:"grid"},this.mostRecentlyUsed=[],this._overwriteRenderContainer=null,this._overwriteDropTargetContainer=null,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new B,this.onMove=this._onMove.event,this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new B,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new B,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new B,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new B,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new B,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new B,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new B,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new B,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,ne(this.container,"dv-groupview",!0),this._api=new Cl(this.accessor),this.tabsContainer=new FT(this.accessor,this.groupPanel),this.contentContainer=new AT(this.accessor,this),t.append(this.tabsContainer.element,this.contentContainer.element),this.header.hidden=!!r.hideHeader,this.locked=(s=r.locked)!==null&&s!==void 0?s:!1,this.headerPosition=(a=r.headerPosition)!==null&&a!==void 0?a:n.defaultHeaderPosition,this.addDisposables(this._onTabDragStart,this._onGroupDragStart,this._onWillShowOverlay,this._rightHeaderActionsDisposable,this._leftHeaderActionsDisposable,this._prefixHeaderActionsDisposable,this.tabsContainer.onTabDragStart(l=>{this._onTabDragStart.fire(l)}),this.tabsContainer.onGroupDragStart(l=>{this._onGroupDragStart.fire(l)}),this.tabsContainer.onDrop(l=>{this.handleDropEvent("header",l.event,"center",l.index)}),this.contentContainer.onDidFocus(()=>{this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.onDidBlur(()=>{}),this.contentContainer.dropTarget.onDrop(l=>{this.handleDropEvent("content",l.nativeEvent,l.position)}),this.tabsContainer.onWillShowOverlay(l=>{this._onWillShowOverlay.fire(l)}),this.contentContainer.dropTarget.onWillShowOverlay(l=>{this._onWillShowOverlay.fire(new du(l,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:rt}))}),this._onMove,this._onDidChange,this._onDidDrop,this._onWillDrop,this._onDidAddPanel,this._onDidRemovePanel,this._onDidActivePanelChange,this._onUnhandledDragOverEvent,this._onDidPanelTitleChange,this._onDidPanelParametersChange)}focusContent(){this.contentContainer.element.focus()}set renderContainer(t){this.panels.forEach(n=>{this.renderContainer.detatch(n)}),this._overwriteRenderContainer=t,this.panels.forEach(n=>{this.rerender(n)})}get renderContainer(){var t;return(t=this._overwriteRenderContainer)!==null&&t!==void 0?t:this.accessor.overlayRenderContainer}set dropTargetContainer(t){this._overwriteDropTargetContainer=t}get dropTargetContainer(){var t;return(t=this._overwriteDropTargetContainer)!==null&&t!==void 0?t:this.accessor.rootDropTargetContainer}initialize(){this.options.panels&&this.options.panels.forEach(t=>{this.doAddPanel(t)}),this.options.activePanel&&this.openPanel(this.options.activePanel),this.setActive(this.isActive,!0),this.updateContainer(),this.updateHeaderActions()}updateHeaderActions(){this.accessor.options.createRightHeaderActionComponent?(this._rightHeaderActions=this.accessor.options.createRightHeaderActionComponent(this.groupPanel),this._rightHeaderActionsDisposable.value=this._rightHeaderActions,this._rightHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element)):(this._rightHeaderActions=void 0,this._rightHeaderActionsDisposable.dispose(),this.tabsContainer.setRightActionsElement(void 0)),this.accessor.options.createLeftHeaderActionComponent?(this._leftHeaderActions=this.accessor.options.createLeftHeaderActionComponent(this.groupPanel),this._leftHeaderActionsDisposable.value=this._leftHeaderActions,this._leftHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element)):(this._leftHeaderActions=void 0,this._leftHeaderActionsDisposable.dispose(),this.tabsContainer.setLeftActionsElement(void 0)),this.accessor.options.createPrefixHeaderActionComponent?(this._prefixHeaderActions=this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel),this._prefixHeaderActionsDisposable.value=this._prefixHeaderActions,this._prefixHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element)):(this._prefixHeaderActions=void 0,this._prefixHeaderActionsDisposable.dispose(),this.tabsContainer.setPrefixActionsElement(void 0))}rerender(t){this.contentContainer.renderPanel(t,{asActive:!1})}indexOf(t){return this.tabsContainer.indexOf(t.id)}toJSON(){var t;const n={views:this.tabsContainer.panels,activeView:(t=this._activePanel)===null||t===void 0?void 0:t.id,id:this.id};return this.locked!==!1&&(n.locked=this.locked),this.header.hidden&&(n.hideHeader=!0),this.headerPosition!=="top"&&(n.headerPosition=this.headerPosition),n}moveToNext(t){t||(t={}),t.panel||(t.panel=this.activePanel);const n=t.panel?this.panels.indexOf(t.panel):-1;let i;if(n<this.panels.length-1)i=n+1;else if(!t.suppressRoll)i=0;else return;this.openPanel(this.panels[i])}moveToPrevious(t){if(t||(t={}),t.panel||(t.panel=this.activePanel),!t.panel)return;const n=this.panels.indexOf(t.panel);let i;if(n>0)i=n-1;else if(!t.suppressRoll)i=this.panels.length-1;else return;this.openPanel(this.panels[i])}containsPanel(t){return this.panels.includes(t)}init(t){}update(t){}focus(){var t;(t=this._activePanel)===null||t===void 0||t.focus()}openPanel(t,n={}){(typeof n.index!="number"||n.index>this.panels.length)&&(n.index=this.panels.length);const i=!!n.skipSetActive;if(t.updateParentGroup(this.groupPanel,{skipSetActive:n.skipSetActive}),this.doAddPanel(t,n.index,{skipSetActive:i}),this._activePanel===t){this.contentContainer.renderPanel(t,{asActive:!0});return}i||this.doSetActivePanel(t),n.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),n.skipSetActive||this.updateContainer()}removePanel(t,n={skipSetActive:!1}){const i=typeof t=="string"?t:t.id,r=this._panels.find(o=>o.id===i);if(!r)throw new Error("invalid operation");return this._removePanel(r,n)}closeAllPanels(){if(this.panels.length>0){const t=[...this.panels];for(const n of t)this.doClose(n)}else this.accessor.removeGroup(this.groupPanel)}closePanel(t){this.doClose(t)}doClose(t){const n=this.panels.length===1&&this.accessor.groups.length===1;this.accessor.removePanel(t,n&&this.accessor.options.noPanelsOverlay==="emptyGroup"?{removeEmptyGroup:!1}:void 0)}isPanelActive(t){return this._activePanel===t}updateActions(t){this.tabsContainer.setRightActionsElement(t)}setActive(t,n=!1){!n&&this.isActive===t||(this._isGroupActive=t,ne(this.container,"dv-active-group",t),ne(this.container,"dv-inactive-group",!t),this.tabsContainer.setActive(this.isActive),!this._activePanel&&this.panels.length>0&&this.doSetActivePanel(this.panels[0]),this.updateContainer())}layout(t,n){var i;this._width=t,this._height=n,this.contentContainer.layout(this._width,this._height),!((i=this._activePanel)===null||i===void 0)&&i.layout&&this._activePanel.layout(this._width,this._height)}_removePanel(t,n){const i=this._activePanel===t;if(this.doRemovePanel(t),i&&this.panels.length>0){const r=this.mostRecentlyUsed[0];this.openPanel(r,{skipSetActive:n.skipSetActive,skipSetGroupActive:n.skipSetActiveGroup})}return this._activePanel&&this.panels.length===0&&this.doSetActivePanel(void 0),n.skipSetActive||this.updateContainer(),t}doRemovePanel(t){const n=this.panels.indexOf(t);if(this._activePanel===t&&this.contentContainer.closePanel(),this.tabsContainer.delete(t.id),this._panels.splice(n,1),this.mostRecentlyUsed.includes(t)){const r=this.mostRecentlyUsed.indexOf(t);this.mostRecentlyUsed.splice(r,1)}const i=this._panelDisposables.get(t.id);i&&(i.dispose(),this._panelDisposables.delete(t.id)),this._onDidRemovePanel.fire({panel:t})}doAddPanel(t,n=this.panels.length,i={skipSetActive:!1}){const o=this._panels.indexOf(t)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(t,n),i.skipSetActive?t.api.renderer==="always"&&this.contentContainer.renderPanel(t,{asActive:!1}):this.contentContainer.openPanel(t),!o&&(this.updateMru(t),this.panels.splice(n,0,t),this._panelDisposables.set(t.id,new ce(t.api.onDidTitleChange(s=>this._onDidPanelTitleChange.fire(s)),t.api.onDidParametersChange(s=>this._onDidPanelParametersChange.fire(s)))),this._onDidAddPanel.fire({panel:t}))}doSetActivePanel(t){this._activePanel!==t&&(this._activePanel=t,t&&(this.tabsContainer.setActivePanel(t),this.contentContainer.openPanel(t),t.layout(this._width,this._height),this.updateMru(t),this.contentContainer.refreshFocusState(),this._onDidActivePanelChange.fire({panel:t})))}updateMru(t){this.mostRecentlyUsed.includes(t)&&this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(t),1),this.mostRecentlyUsed=[t,...this.mostRecentlyUsed]}updateContainer(){var t,n;if(this.panels.forEach(i=>i.runEvents()),this.isEmpty&&!this.watermark){const i=this.accessor.createWatermarkComponent();i.init({containerApi:this._api,group:this.groupPanel}),this.watermark=i,pe(this.watermark.element,"pointerdown",()=>{this.isActive||this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.element.appendChild(this.watermark.element)}!this.isEmpty&&this.watermark&&(this.watermark.element.remove(),(n=(t=this.watermark).dispose)===null||n===void 0||n.call(t),this.watermark=void 0)}canDisplayOverlay(t,n,i){const r=new Ky(t,i,n,rt,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(r),r.isAccepted}handleDropEvent(t,n,i,r){if(this.locked==="no-drop-target")return;function o(){switch(t){case"header":return typeof r=="number"?"tab":"header_space";case"content":return"content"}}const s=typeof r=="number"?this.panels[r]:void 0,a=new Jy({nativeEvent:n,position:i,panel:s,getData:()=>rt(),kind:o(),group:this.groupPanel,api:this._api});if(this._onWillDrop.fire(a),a.defaultPrevented)return;const l=rt();if(l&&l.viewId===this.accessor.id){if(t==="content"&&l.groupId===this.id&&(i==="center"||l.panelId===null)||t==="header"&&l.groupId===this.id&&l.panelId===null)return;if(l.panelId===null){const{groupId:p}=l;this._onMove.fire({target:i,groupId:p,index:r});return}if(this.tabsContainer.indexOf(l.panelId)!==-1&&this.tabsContainer.size===1)return;const{groupId:d,panelId:c}=l;if(this.id===d&&!i&&this.tabsContainer.indexOf(c)===r)return;this._onMove.fire({target:i,groupId:l.groupId,itemId:l.panelId,index:r})}else this._onDidDrop.fire(new Pp({nativeEvent:n,position:i,panel:s,getData:()=>rt(),group:this.groupPanel,api:this._api}))}updateDragAndDropState(){this.tabsContainer.updateDragAndDropState()}dispose(){var t,n,i;super.dispose(),(t=this.watermark)===null||t===void 0||t.element.remove(),(i=(n=this.watermark)===null||n===void 0?void 0:n.dispose)===null||i===void 0||i.call(n),this.watermark=void 0;for(const r of this.panels)r.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class Ap extends Xy{constructor(t,n,i){super(t,n),this._onDidConstraintsChangeInternal=new B,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new B,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new B,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),i&&this.initialize(i)}setConstraints(t){this._onDidConstraintsChangeInternal.fire(t)}setSize(t){this._onDidSizeChange.fire(t)}}class ex extends Dp{get priority(){return this._priority}get snap(){return this._snap}get minimumWidth(){return this.__minimumWidth()}get minimumHeight(){return this.__minimumHeight()}get maximumHeight(){return this.__maximumHeight()}get maximumWidth(){return this.__maximumWidth()}__minimumWidth(){const t=typeof this._minimumWidth=="function"?this._minimumWidth():this._minimumWidth;return t!==this._evaluatedMinimumWidth&&(this._evaluatedMinimumWidth=t,this.updateConstraints()),t}__maximumWidth(){const t=typeof this._maximumWidth=="function"?this._maximumWidth():this._maximumWidth;return t!==this._evaluatedMaximumWidth&&(this._evaluatedMaximumWidth=t,this.updateConstraints()),t}__minimumHeight(){const t=typeof this._minimumHeight=="function"?this._minimumHeight():this._minimumHeight;return t!==this._evaluatedMinimumHeight&&(this._evaluatedMinimumHeight=t,this.updateConstraints()),t}__maximumHeight(){const t=typeof this._maximumHeight=="function"?this._maximumHeight():this._maximumHeight;return t!==this._evaluatedMaximumHeight&&(this._evaluatedMaximumHeight=t,this.updateConstraints()),t}get isActive(){return this.api.isActive}get isVisible(){return this.api.isVisible}constructor(t,n,i,r){super(t,n,r??new Ap(t,n)),this._evaluatedMinimumWidth=0,this._evaluatedMaximumWidth=Number.MAX_SAFE_INTEGER,this._evaluatedMinimumHeight=0,this._evaluatedMaximumHeight=Number.MAX_SAFE_INTEGER,this._minimumWidth=0,this._minimumHeight=0,this._maximumWidth=Number.MAX_SAFE_INTEGER,this._maximumHeight=Number.MAX_SAFE_INTEGER,this._snap=!1,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,typeof(i==null?void 0:i.minimumWidth)=="number"&&(this._minimumWidth=i.minimumWidth),typeof(i==null?void 0:i.maximumWidth)=="number"&&(this._maximumWidth=i.maximumWidth),typeof(i==null?void 0:i.minimumHeight)=="number"&&(this._minimumHeight=i.minimumHeight),typeof(i==null?void 0:i.maximumHeight)=="number"&&(this._maximumHeight=i.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange(o=>{const{isVisible:s}=o,{accessor:a}=this._params;a.setVisible(this,s)}),this.api.onActiveChange(()=>{const{accessor:o}=this._params;o.doSetGroupActive(this)}),this.api.onDidConstraintsChangeInternal(o=>{(typeof o.minimumWidth=="number"||typeof o.minimumWidth=="function")&&(this._minimumWidth=o.minimumWidth),(typeof o.minimumHeight=="number"||typeof o.minimumHeight=="function")&&(this._minimumHeight=o.minimumHeight),(typeof o.maximumWidth=="number"||typeof o.maximumWidth=="function")&&(this._maximumWidth=o.maximumWidth),(typeof o.maximumHeight=="number"||typeof o.maximumHeight=="function")&&(this._maximumHeight=o.maximumHeight)}),this.api.onDidSizeChange(o=>{this._onDidChange.fire({height:o.height,width:o.width})}),this._onDidChange)}setVisible(t){this.api._onDidVisibilityChange.fire({isVisible:t})}setActive(t){this.api._onDidActiveChange.fire({isActive:t})}init(t){t.maximumHeight&&(this._maximumHeight=t.maximumHeight),t.minimumHeight&&(this._minimumHeight=t.minimumHeight),t.maximumWidth&&(this._maximumWidth=t.maximumWidth),t.minimumWidth&&(this._minimumWidth=t.minimumWidth),this._priority=t.priority,this._snap=!!t.snap,super.init(t),typeof t.isVisible=="boolean"&&this.setVisible(t.isVisible)}updateConstraints(){this.api._onDidConstraintsChange.fire({minimumWidth:this._evaluatedMinimumWidth,maximumWidth:this._evaluatedMaximumWidth,minimumHeight:this._evaluatedMinimumHeight,maximumHeight:this._evaluatedMaximumHeight})}toJSON(){const t=super.toJSON(),n=r=>r===Number.MAX_SAFE_INTEGER?void 0:r,i=r=>r<=0?void 0:r;return Object.assign(Object.assign({},t),{minimumHeight:i(this.minimumHeight),maximumHeight:n(this.maximumHeight),minimumWidth:i(this.minimumWidth),maximumWidth:n(this.maximumWidth),snap:this.snap,priority:this.priority})}}const Oi="dockview: DockviewGroupPanelApiImpl not initialized";class jT extends Ap{get location(){if(!this._group)throw new Error(Oi);return this._group.model.location}constructor(t,n){super(t,"__dockviewgroup__"),this.accessor=n,this._onDidLocationChange=new B,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new B,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this.addDisposables(this._onDidLocationChange,this._onDidActivePanelChange,this._onDidVisibilityChange.event(i=>{i.isVisible&&this._pendingSize&&(super.setSize(this._pendingSize),this._pendingSize=void 0)}))}setSize(t){this._pendingSize=Object.assign({},t),super.setSize(t)}close(){if(this._group)return this.accessor.removeGroup(this._group)}getWindow(){return this.location.type==="popout"?this.location.getWindow():window}setHeaderPosition(t){if(!this._group)throw new Error(Oi);this._group.model.headerPosition=t}getHeaderPosition(){if(!this._group)throw new Error(Oi);return this._group.model.headerPosition}moveTo(t){var n,i,r,o;if(!this._group)throw new Error(Oi);const s=(n=t.group)!==null&&n!==void 0?n:this.accessor.addGroup({direction:bT((i=t.position)!==null&&i!==void 0?i:"right"),skipSetActive:(r=t.skipSetActive)!==null&&r!==void 0?r:!1});this.accessor.moveGroupOrPanel({from:{groupId:this._group.id},to:{group:s,position:t.group&&(o=t.position)!==null&&o!==void 0?o:"center",index:t.index},skipSetActive:t.skipSetActive})}maximize(){if(!this._group)throw new Error(Oi);this.location.type==="grid"&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(Oi);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(Oi);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(t){this._group=t}}const UT=100,YT=100;class Eg extends ex{get minimumWidth(){var t;if(typeof this._explicitConstraints.minimumWidth=="number")return this._explicitConstraints.minimumWidth;const n=(t=this.activePanel)===null||t===void 0?void 0:t.minimumWidth;return typeof n=="number"?n:super.__minimumWidth()}get minimumHeight(){var t;if(typeof this._explicitConstraints.minimumHeight=="number")return this._explicitConstraints.minimumHeight;const n=(t=this.activePanel)===null||t===void 0?void 0:t.minimumHeight;return typeof n=="number"?n:super.__minimumHeight()}get maximumWidth(){var t;if(typeof this._explicitConstraints.maximumWidth=="number")return this._explicitConstraints.maximumWidth;const n=(t=this.activePanel)===null||t===void 0?void 0:t.maximumWidth;return typeof n=="number"?n:super.__maximumWidth()}get maximumHeight(){var t;if(typeof this._explicitConstraints.maximumHeight=="number")return this._explicitConstraints.maximumHeight;const n=(t=this.activePanel)===null||t===void 0?void 0:t.maximumHeight;return typeof n=="number"?n:super.__maximumHeight()}get panels(){return this._model.panels}get activePanel(){return this._model.activePanel}get size(){return this._model.size}get model(){return this._model}get locked(){return this._model.locked}set locked(t){this._model.locked=t}get header(){return this._model.header}constructor(t,n,i){var r,o,s,a,l,u;super(n,"groupview_default",{minimumHeight:(o=(r=i.constraints)===null||r===void 0?void 0:r.minimumHeight)!==null&&o!==void 0?o:YT,minimumWidth:(a=(s=i.constraints)===null||s===void 0?void 0:s.minimumWidth)!==null&&a!==void 0?a:UT,maximumHeight:(l=i.constraints)===null||l===void 0?void 0:l.maximumHeight,maximumWidth:(u=i.constraints)===null||u===void 0?void 0:u.maximumWidth},new jT(n,t)),this._explicitConstraints={},this.api.initialize(this),this._model=new WT(this.element,t,n,i,this),this.addDisposables(this.model.onDidActivePanelChange(d=>{this.api._onDidActivePanelChange.fire(d)}),this.api.onDidConstraintsChangeInternal(d=>{d.minimumWidth!==void 0&&(this._explicitConstraints.minimumWidth=typeof d.minimumWidth=="function"?d.minimumWidth():d.minimumWidth),d.minimumHeight!==void 0&&(this._explicitConstraints.minimumHeight=typeof d.minimumHeight=="function"?d.minimumHeight():d.minimumHeight),d.maximumWidth!==void 0&&(this._explicitConstraints.maximumWidth=typeof d.maximumWidth=="function"?d.maximumWidth():d.maximumWidth),d.maximumHeight!==void 0&&(this._explicitConstraints.maximumHeight=typeof d.maximumHeight=="function"?d.maximumHeight():d.maximumHeight)}))}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(t){super.setActive(t),this.model.setActive(t)}layout(t,n){super.layout(t,n),this.model.layout(t,n)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}const o8={name:"dark",className:"dockview-theme-dark"},s8={name:"light",className:"dockview-theme-light"},XT={className:"dockview-theme-abyss"};class ZT extends Ap{get location(){return this.group.api.location}get title(){return this.panel.title}get isGroupActive(){return this.group.isActive}get renderer(){return this.panel.renderer}set group(t){const n=this._group;this._group!==t&&(this._group=t,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(n),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(t,n,i,r,o){super(t.id,r),this.panel=t,this.accessor=i,this._onDidTitleChange=new B,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new B,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new B,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new B,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new B,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new Je,this._tabComponent=o,this.initialize(t),this._group=n,this.setupGroupEventListeners(),this.addDisposables(this.groupEventsDisposable,this._onDidRendererChange,this._onDidTitleChange,this._onDidGroupChange,this._onDidActiveGroupChange,this._onDidLocationChange)}getWindow(){return this.group.api.getWindow()}moveTo(t){var n,i;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:(n=t.group)!==null&&n!==void 0?n:this._group,position:t.group&&(i=t.position)!==null&&i!==void 0?i:"center",index:t.index},skipSetActive:t.skipSetActive})}setTitle(t){this.panel.setTitle(t)}setRenderer(t){this.panel.setRenderer(t)}close(){this.group.model.closePanel(this.panel)}maximize(){this.group.api.maximize()}isMaximized(){return this.group.api.isMaximized()}exitMaximized(){this.group.api.exitMaximized()}setupGroupEventListeners(t){var n;let i=(n=t==null?void 0:t.isActive)!==null&&n!==void 0?n:!1;this.groupEventsDisposable.value=new ce(this.group.api.onDidVisibilityChange(r=>{const o=!r.isVisible&&this.isVisible,s=r.isVisible&&!this.isVisible,a=this.group.model.isPanelActive(this.panel);(o||s&&a)&&this._onDidVisibilityChange.fire(r)}),this.group.api.onDidLocationChange(r=>{this.group===this.panel.group&&this._onDidLocationChange.fire(r)}),this.group.api.onDidActiveChange(()=>{this.group===this.panel.group&&i!==this.isGroupActive&&(i=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))}))}}class wr extends ce{get params(){return this._params}get title(){return this._title}get group(){return this._group}get renderer(){var t;return(t=this._renderer)!==null&&t!==void 0?t:this.accessor.renderer}get minimumWidth(){return this._minimumWidth}get minimumHeight(){return this._minimumHeight}get maximumWidth(){return this._maximumWidth}get maximumHeight(){return this._maximumHeight}constructor(t,n,i,r,o,s,a,l){super(),this.id=t,this.accessor=r,this.containerApi=o,this.view=a,this._renderer=l.renderer,this._group=s,this._minimumWidth=l.minimumWidth,this._minimumHeight=l.minimumHeight,this._maximumWidth=l.maximumWidth,this._maximumHeight=l.maximumHeight,this.api=new ZT(this,this._group,r,n,i),this.addDisposables(this.api.onActiveChange(()=>{r.setActivePanel(this)}),this.api.onDidSizeChange(u=>{this.group.api.setSize(u)}),this.api.onDidRendererChange(()=>{this.group.model.rerender(this)}))}init(t){this._params=t.params,this.view.init(Object.assign(Object.assign({},t),{api:this.api,containerApi:this.containerApi})),this.setTitle(t.title)}focus(){const t=new Yy;this.api._onWillFocus.fire(t),!t.defaultPrevented&&(this.api.isActive||this.api.setActive())}toJSON(){return{id:this.id,contentComponent:this.view.contentComponent,tabComponent:this.view.tabComponent,params:Object.keys(this._params||{}).length>0?this._params:void 0,title:this.title,renderer:this._renderer,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,minimumWidth:this._minimumWidth,maximumWidth:this._maximumWidth}}setTitle(t){t!==this.title&&(this._title=t,this.api._onDidTitleChange.fire({title:t}))}setRenderer(t){t!==this.renderer&&(this._renderer=t,this.api._onDidRendererChange.fire({renderer:t}))}update(t){var n;this._params=Object.assign(Object.assign({},(n=this._params)!==null&&n!==void 0?n:{}),t.params);for(const i of Object.keys(t.params))t.params[i]===void 0&&delete this._params[i];this.view.update({params:this._params})}updateFromStateModel(t){var n,i,r;this._maximumHeight=t.maximumHeight,this._minimumHeight=t.minimumHeight,this._maximumWidth=t.maximumWidth,this._minimumWidth=t.minimumWidth,this.update({params:(n=t.params)!==null&&n!==void 0?n:{}}),this.setTitle((i=t.title)!==null&&i!==void 0?i:this.id),this.setRenderer((r=t.renderer)!==null&&r!==void 0?r:this.accessor.renderer)}updateParentGroup(t,n){this._group=t,this.api.group=this._group;const i=this._group.model.isPanelActive(this),r=this.group.api.isActive&&i;n!=null&&n.skipSetActive||this.api.isActive!==r&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&i}),this.api.isVisible!==i&&this.api._onDidVisibilityChange.fire({isVisible:i})}runEvents(){const t=this._group.model.isPanelActive(this),n=this.group.api.isActive&&t;this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&t}),this.api.isVisible!==t&&this.api._onDidVisibilityChange.fire({isVisible:t})}layout(t,n){this.api._onDidDimensionChange.fire({width:t,height:n}),this.view.layout(t,n)}dispose(){this.api.dispose(),this.view.dispose()}}class Dg extends ce{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-default-tab",this._content=document.createElement("div"),this._content.className="dv-default-tab-content",this.action=document.createElement("div"),this.action.className="dv-default-tab-action",this.action.appendChild(OT()),this._element.appendChild(this._content),this._element.appendChild(this.action),this.render()}init(t){this._title=t.title,this.addDisposables(t.api.onDidTitleChange(n=>{this._title=n.title,this.render()}),pe(this.action,"pointerdown",n=>{n.preventDefault()}),pe(this.action,"click",n=>{n.defaultPrevented||(n.preventDefault(),t.api.close())})),this.render()}render(){var t;this._content.textContent!==this._title&&(this._content.textContent=(t=this._title)!==null&&t!==void 0?t:"")}}class tx{get content(){return this._content}get tab(){return this._tab}constructor(t,n,i,r){this.accessor=t,this.id=n,this.contentComponent=i,this.tabComponent=r,this._content=this.createContentComponent(this.id,i),this._tab=this.createTabComponent(this.id,r)}createTabRenderer(t){var n;const i=this.createTabComponent(this.id,this.tabComponent);return this._params&&i.init(Object.assign(Object.assign({},this._params),{tabLocation:t})),this._updateEvent&&((n=i.update)===null||n===void 0||n.call(i,this._updateEvent)),i}init(t){this._params=t,this.content.init(t),this.tab.init(Object.assign(Object.assign({},t),{tabLocation:"header"}))}layout(t,n){var i,r;(r=(i=this.content).layout)===null||r===void 0||r.call(i,t,n)}update(t){var n,i,r,o;this._updateEvent=t,(i=(n=this.content).update)===null||i===void 0||i.call(n,t),(o=(r=this.tab).update)===null||o===void 0||o.call(r,t)}dispose(){var t,n,i,r;(n=(t=this.content).dispose)===null||n===void 0||n.call(t),(r=(i=this.tab).dispose)===null||r===void 0||r.call(i)}createContentComponent(t,n){return this.accessor.options.createComponent({id:t,name:n})}createTabComponent(t,n){const i=n??this.accessor.options.defaultTabComponent;if(i){if(this.accessor.options.createTabComponent){const r=this.accessor.options.createTabComponent({id:t,name:i});return r||new Dg}console.warn(`dockview: tabComponent '${n}' was not found. falling back to the default tab.`)}return new Dg}}class qT{constructor(t){this.accessor=t}fromJSON(t,n){var i,r;const o=t.id,s=t.params,a=t.title,l=t.view,u=l?l.content.id:(i=t.contentComponent)!==null&&i!==void 0?i:"unknown",d=l?(r=l.tab)===null||r===void 0?void 0:r.id:t.tabComponent,c=new tx(this.accessor,o,u,d),h=new wr(o,u,d,this.accessor,new Cl(this.accessor),n,c,{renderer:t.renderer,minimumWidth:t.minimumWidth,minimumHeight:t.minimumHeight,maximumWidth:t.maximumWidth,maximumHeight:t.maximumHeight});return h.init({title:a??o,params:s??{}}),h}}class QT extends ce{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(t){}}class KT{constructor(){this._orderedList=[]}push(t){this._orderedList=[...this._orderedList.filter(n=>n!==t),t],this.update()}destroy(t){this._orderedList=this._orderedList.filter(n=>n!==t),this.update()}update(){for(let t=0;t<this._orderedList.length;t++)this._orderedList[t].setAttribute("aria-level",`${t}`),this._orderedList[t].style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${t*2})`}}const pa=new KT;class yn extends ce{set minimumInViewportWidth(t){this.options.minimumInViewportWidth=t}set minimumInViewportHeight(t){this.options.minimumInViewportHeight=t}get element(){return this._element}get isVisible(){return this._isVisible}constructor(t){super(),this.options=t,this._element=document.createElement("div"),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new B,this.onDidChangeEnd=this._onDidChangeEnd.event,this.addDisposables(this._onDidChange,this._onDidChangeEnd),this._element.className="dv-resize-container",this._isVisible=!0,this.setupResize("top"),this.setupResize("bottom"),this.setupResize("left"),this.setupResize("right"),this.setupResize("topleft"),this.setupResize("topright"),this.setupResize("bottomleft"),this.setupResize("bottomright"),this._element.appendChild(this.options.content),this.options.container.appendChild(this._element),this.setBounds(Object.assign(Object.assign(Object.assign(Object.assign({height:this.options.height,width:this.options.width},"top"in this.options&&{top:this.options.top}),"bottom"in this.options&&{bottom:this.options.bottom}),"left"in this.options&&{left:this.options.left}),"right"in this.options&&{right:this.options.right})),pa.push(this._element)}setVisible(t){t!==this.isVisible&&(this._isVisible=t,ne(this.element,"dv-hidden",!this.isVisible))}bringToFront(){pa.push(this._element)}setBounds(t={}){typeof t.height=="number"&&(this._element.style.height=`${t.height}px`),typeof t.width=="number"&&(this._element.style.width=`${t.width}px`),"top"in t&&typeof t.top=="number"&&(this._element.style.top=`${t.top}px`,this._element.style.bottom="auto",this.verticalAlignment="top"),"bottom"in t&&typeof t.bottom=="number"&&(this._element.style.bottom=`${t.bottom}px`,this._element.style.top="auto",this.verticalAlignment="bottom"),"left"in t&&typeof t.left=="number"&&(this._element.style.left=`${t.left}px`,this._element.style.right="auto",this.horiziontalAlignment="left"),"right"in t&&typeof t.right=="number"&&(this._element.style.right=`${t.right}px`,this._element.style.left="auto",this.horiziontalAlignment="right");const n=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),r=Math.max(0,this.getMinimumWidth(i.width)),o=Math.max(0,this.getMinimumHeight(i.height));if(this.verticalAlignment==="top"){const s=Ie(i.top-n.top,-o,Math.max(0,n.height-i.height+o));this._element.style.top=`${s}px`,this._element.style.bottom="auto"}if(this.verticalAlignment==="bottom"){const s=Ie(n.bottom-i.bottom,-o,Math.max(0,n.height-i.height+o));this._element.style.bottom=`${s}px`,this._element.style.top="auto"}if(this.horiziontalAlignment==="left"){const s=Ie(i.left-n.left,-r,Math.max(0,n.width-i.width+r));this._element.style.left=`${s}px`,this._element.style.right="auto"}if(this.horiziontalAlignment==="right"){const s=Ie(n.right-i.right,-r,Math.max(0,n.width-i.width+r));this._element.style.right=`${s}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const t=this.options.container.getBoundingClientRect(),n=this._element.getBoundingClientRect(),i={};return this.verticalAlignment==="top"?i.top=parseFloat(this._element.style.top):this.verticalAlignment==="bottom"?i.bottom=parseFloat(this._element.style.bottom):i.top=n.top-t.top,this.horiziontalAlignment==="left"?i.left=parseFloat(this._element.style.left):this.horiziontalAlignment==="right"?i.right=parseFloat(this._element.style.right):i.left=n.left-t.left,i.width=n.width,i.height=n.height,i}setupDrag(t,n={inDragMode:!1}){const i=new Je,r=()=>{let o=null;const s=kl();i.value=new ce({dispose:()=>{s.release()}},pe(window,"pointermove",a=>{const l=this.options.container.getBoundingClientRect(),u=a.clientX-l.left,d=a.clientY-l.top;ne(this._element,"dv-resize-container-dragging",!0);const c=this._element.getBoundingClientRect();o===null&&(o={x:a.clientX-c.left,y:a.clientY-c.top});const h=Math.max(0,this.getMinimumWidth(c.width)),p=Math.max(0,this.getMinimumHeight(c.height)),f=Ie(d-o.y,-p,Math.max(0,l.height-c.height+p)),v=Ie(o.y-d+l.height-c.height,-p,Math.max(0,l.height-c.height+p)),b=Ie(u-o.x,-h,Math.max(0,l.width-c.width+h)),m=Ie(o.x-u+l.width-c.width,-h,Math.max(0,l.width-c.width+h)),w={};f<=v?w.top=f:w.bottom=v,b<=m?w.left=b:w.right=m,this.setBounds(w)}),pe(window,"pointerup",()=>{ne(this._element,"dv-resize-container-dragging",!1),i.dispose(),this._onDidChangeEnd.fire()}))};this.addDisposables(i,pe(t,"pointerdown",o=>{if(o.defaultPrevented){o.preventDefault();return}kg(o)||r()}),pe(this.options.content,"pointerdown",o=>{o.defaultPrevented||kg(o)||o.shiftKey&&r()}),pe(this.options.content,"pointerdown",()=>{pa.push(this._element)},!0)),n.inDragMode&&r()}setupResize(t){const n=document.createElement("div");n.className=`dv-resize-handle-${t}`,this._element.appendChild(n);const i=new Je;this.addDisposables(i,pe(n,"pointerdown",r=>{r.preventDefault();let o=null;const s=kl();i.value=new ce(pe(window,"pointermove",a=>{const l=this.options.container.getBoundingClientRect(),u=this._element.getBoundingClientRect(),d=a.clientY-l.top,c=a.clientX-l.left;o===null&&(o={originalY:d,originalHeight:u.height,originalX:c,originalWidth:u.width});let h,p,f,v,b,m;const w=()=>{const E=o.originalY+o.originalHeight>l.height?Math.max(0,l.height-yn.MINIMUM_HEIGHT):Math.max(0,o.originalY+o.originalHeight-yn.MINIMUM_HEIGHT);h=Ie(d,0,E),f=o.originalY+o.originalHeight-h,p=l.height-h-f},g=()=>{h=o.originalY-o.originalHeight;const E=h<0&&typeof this.options.minimumInViewportHeight=="number"?-h+this.options.minimumInViewportHeight:yn.MINIMUM_HEIGHT,S=l.height-Math.max(0,h);f=Ie(d-h,E,S),p=l.height-h-f},y=()=>{const E=o.originalX+o.originalWidth>l.width?Math.max(0,l.width-yn.MINIMUM_WIDTH):Math.max(0,o.originalX+o.originalWidth-yn.MINIMUM_WIDTH);v=Ie(c,0,E),m=o.originalX+o.originalWidth-v,b=l.width-v-m},k=()=>{v=o.originalX-o.originalWidth;const E=v<0&&typeof this.options.minimumInViewportWidth=="number"?-v+this.options.minimumInViewportWidth:yn.MINIMUM_WIDTH,S=l.width-Math.max(0,v);m=Ie(c-v,E,S),b=l.width-v-m};switch(t){case"top":w();break;case"bottom":g();break;case"left":y();break;case"right":k();break;case"topleft":w(),y();break;case"topright":w(),k();break;case"bottomleft":g(),y();break;case"bottomright":g(),k();break}const _={};h<=p?_.top=h:_.bottom=p,v<=b?_.left=v:_.right=b,_.height=f,_.width=m,this.setBounds(_)}),{dispose:()=>{s.release()}},pe(window,"pointerup",()=>{i.dispose(),this._onDidChangeEnd.fire()}))}))}getMinimumWidth(t){return typeof this.options.minimumInViewportWidth=="number"?t-this.options.minimumInViewportWidth:0}getMinimumHeight(t){return typeof this.options.minimumInViewportHeight=="number"?t-this.options.minimumInViewportHeight:0}dispose(){pa.destroy(this._element),this._element.remove(),super.dispose()}}yn.MINIMUM_HEIGHT=20;yn.MINIMUM_WIDTH=20;class JT extends ce{constructor(t,n){super(),this.group=t,this.overlay=n,this.addDisposables(n)}position(t){this.overlay.setBounds(t)}}const fa=100,ei={left:100,top:100,width:300,height:300},eM=100;class tM{constructor(){this.cache=new Map,this.currentFrameId=0,this.rafId=null}getPosition(t){const n=this.cache.get(t);if(n&&n.frameId===this.currentFrameId)return n.rect;this.scheduleFrameUpdate();const i=Vd(t);return this.cache.set(t,{rect:i,frameId:this.currentFrameId}),i}invalidate(){this.currentFrameId++}scheduleFrameUpdate(){this.rafId||(this.rafId=requestAnimationFrame(()=>{this.currentFrameId++,this.rafId=null}))}}function nM(){const e=document.createElement("div");return e.tabIndex=-1,e}class zg extends ce{constructor(t,n){super(),this.element=t,this.accessor=n,this.map={},this._disposed=!1,this.positionCache=new tM,this.pendingUpdates=new Set,this.addDisposables(je.from(()=>{for(const i of Object.values(this.map))i.disposable.dispose(),i.destroy.dispose();this._disposed=!0}))}updateAllPositions(){if(!this._disposed){this.positionCache.invalidate();for(const t of Object.values(this.map))t.panel.api.isVisible&&t.resize&&t.resize()}}detatch(t){if(this.map[t.api.id]){const{disposable:n,destroy:i}=this.map[t.api.id];return n.dispose(),i.dispose(),delete this.map[t.api.id],!0}return!1}attach(t){const{panel:n,referenceContainer:i}=t;if(!this.map[n.api.id]){const d=nM();d.className="dv-render-overlay",d.style.visibility="hidden",this.map[n.api.id]={panel:n,disposable:je.NONE,destroy:je.NONE,element:d}}const r=this.map[n.api.id].element;n.view.content.element.parentElement!==r&&r.appendChild(n.view.content.element),r.parentElement!==this.element&&this.element.appendChild(r);const o=()=>{const d=n.api.id;this.pendingUpdates.has(d)||(this.pendingUpdates.add(d),requestAnimationFrame(()=>{if(this.pendingUpdates.delete(d),this.isDisposed||!this.map[d])return;const c=this.positionCache.getPosition(i.element),h=this.positionCache.getPosition(this.element),p=c.left-h.left,f=c.top-h.top,v=c.width,b=c.height;r.style.left=`${p}px`,r.style.top=`${f}px`,r.style.width=`${v}px`,r.style.height=`${b}px`,r.style.visibility==="hidden"&&(r.style.visibility=""),ne(r,"dv-render-overlay-float",n.group.api.location.type==="floating")}))},s=()=>{n.api.isVisible&&(this.positionCache.invalidate(),o()),r.style.display=n.api.isVisible?"":"none"},a=new Je,l=()=>{n.api.location.type==="floating"?queueMicrotask(()=>{const d=this.accessor.floatingGroups.find(f=>f.group===n.api.group);if(!d)return;const c=d.overlay.element,h=()=>{const f=Number(c.getAttribute("aria-level"));r.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${f*2+1})`},p=new MutationObserver(()=>{h()});a.value=je.from(()=>p.disconnect()),p.observe(c,{attributeFilter:["aria-level"],attributes:!0}),h()}):r.style.zIndex=""},u=new ce(a,new Uy(r,{onDragEnd:d=>{i.dropTarget.dnd.onDragEnd(d)},onDragEnter:d=>{i.dropTarget.dnd.onDragEnter(d)},onDragLeave:d=>{i.dropTarget.dnd.onDragLeave(d)},onDrop:d=>{i.dropTarget.dnd.onDrop(d)},onDragOver:d=>{i.dropTarget.dnd.onDragOver(d)}}),n.api.onDidVisibilityChange(()=>{s()}),n.api.onDidDimensionsChange(()=>{n.api.isVisible&&o()}),n.api.onDidLocationChange(()=>{l()}));return this.map[n.api.id].destroy=je.from(()=>{var d;n.view.content.element.parentElement===r&&r.removeChild(n.view.content.element),(d=r.parentElement)===null||d===void 0||d.removeChild(r)}),l(),queueMicrotask(()=>{this.isDisposed||s()}),this.map[n.api.id].disposable.dispose(),this.map[n.api.id].disposable=u,this.map[n.api.id].resize=o,r}}function iM(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(d){try{u(i.next(d))}catch(c){s(c)}}function l(d){try{u(i.throw(d))}catch(c){s(c)}}function u(d){d.done?o(d.value):r(d.value).then(a,l)}u((i=i.apply(e,[])).next())})}class rM extends ce{get window(){var t,n;return(n=(t=this._window)===null||t===void 0?void 0:t.value)!==null&&n!==void 0?n:null}constructor(t,n,i){super(),this.target=t,this.className=n,this.options=i,this._onWillClose=new B,this.onWillClose=this._onWillClose.event,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,this._window=null,this.addDisposables(this._onWillClose,this._onDidClose,{dispose:()=>{this.close()}})}dimensions(){if(!this._window)return null;const t=this._window.value.screenX,n=this._window.value.screenY,i=this._window.value.innerWidth,r=this._window.value.innerHeight;return{top:n,left:t,width:i,height:r}}close(){var t,n;this._window&&(this._onWillClose.fire(),(n=(t=this.options).onWillClose)===null||n===void 0||n.call(t,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var t,n;return iM(this,void 0,void 0,function*(){if(this._window)throw new Error("instance of popout window is already open");const i=`${this.options.url}`,r=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map(([l,u])=>`${l}=${u}`).join(","),o=window.open(i,this.target,r);if(!o)return null;const s=new ce;this._window={value:o,disposable:s},s.addDisposables(je.from(()=>{o.close()}),pe(window,"beforeunload",()=>{this.close()}));const a=this.createPopoutWindowContainer();return this.className&&a.classList.add(this.className),(n=(t=this.options).onDidOpen)===null||n===void 0||n.call(t,{id:this.target,window:o}),new Promise((l,u)=>{o.addEventListener("unload",d=>{}),o.addEventListener("load",()=>{try{const d=o.document;d.title=document.title,d.body.appendChild(a),QN(d,window.document.styleSheets),pe(o,"beforeunload",()=>{this.close()}),l(a)}catch(d){u(d)}})})})}createPopoutWindowContainer(){const t=document.createElement("div");return t.classList.add("dv-popout-window"),t.id="dv-popout-window",t.style.position="absolute",t.style.width="100%",t.style.height="100%",t.style.top="0px",t.style.left="0px",t}}class oM extends ce{constructor(t){super(),this.accessor=t,this.init()}init(){const t=new Set,n=new Set;this.addDisposables(this.accessor.onDidAddPanel(i=>{if(t.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${i.api.id} but panel already exists`);t.add(i.api.id)}),this.accessor.onDidRemovePanel(i=>{if(t.has(i.api.id))t.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${i.api.id} but panel does not exists`)}),this.accessor.onDidAddGroup(i=>{if(n.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${i.api.id} but group already exists`);n.add(i.api.id)}),this.accessor.onDidRemoveGroup(i=>{if(n.has(i.api.id))n.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${i.api.id} but group does not exists`)}))}}class sM extends ce{constructor(t){super(),this.root=t,this._active=null,this._activeDisposable=new Je,this._element=document.createElement("div"),this._element.className="dv-popover-anchor",this._element.style.position="relative",this.root.prepend(this._element),this.addDisposables(je.from(()=>{this.close()}),this._activeDisposable)}openPopover(t,n){var i;this.close();const r=document.createElement("div");r.style.position="absolute",r.style.zIndex=(i=n.zIndex)!==null&&i!==void 0?i:"var(--dv-overlay-z-index)",r.appendChild(t);const o=this._element.getBoundingClientRect(),s=o.left,a=o.top;r.style.top=`${n.y-a}px`,r.style.left=`${n.x-s}px`,this._element.appendChild(r),this._active=r,this._activeDisposable.value=new ce(pe(window,"pointerdown",l=>{var u;const d=l.target;if(!(d instanceof HTMLElement))return;let c=d;for(;c&&c!==r;)c=(u=c==null?void 0:c.parentElement)!==null&&u!==void 0?u:null;c||this.close()}),pe(window,"resize",()=>{this.close()})),requestAnimationFrame(()=>{oT(r,this.root)})}close(){this._active&&(this._active.remove(),this._activeDisposable.dispose(),this._active=null)}}class Pg extends ce{get disabled(){return this._disabled}set disabled(t){var n;this.disabled!==t&&(this._disabled=t,t&&((n=this.model)===null||n===void 0||n.clear()))}get model(){if(!this.disabled)return{clear:()=>{var t;this._model&&((t=this._model.root.parentElement)===null||t===void 0||t.removeChild(this._model.root)),this._model=void 0},exists:()=>!!this._model,getElements:(t,n)=>{const i=this._outline!==n;if(this._outline=n,this._model)return this._model.changed=i,this._model;const r=this.createContainer(),o=this.createAnchor();if(this._model={root:r,overlay:o,changed:i},r.appendChild(o),this.element.appendChild(r),(t==null?void 0:t.target)instanceof HTMLElement){const s=t.target.getBoundingClientRect(),a=this.element.getBoundingClientRect();o.style.left=`${s.left-a.left}px`,o.style.top=`${s.top-a.top}px`}return this._model}}}constructor(t,n){super(),this.element=t,this._disabled=!1,this._disabled=n.disabled,this.addDisposables(je.from(()=>{var i;(i=this.model)===null||i===void 0||i.clear()}))}createContainer(){const t=document.createElement("div");return t.className="dv-drop-target-container",t}createAnchor(){const t=document.createElement("div");return t.className="dv-drop-target-anchor",t.style.visibility="hidden",t}}const Ag={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function ma(e){const t=e.from.activePanel;[...e.from.panels].map(i=>{const r=e.from.model.removePanel(i);return e.from.model.renderContainer.detatch(i),r}).forEach(i=>{e.to.model.openPanel(i,{skipSetActive:t!==i,skipSetGroupActive:!0})})}class aM extends $y{get orientation(){return this.gridview.orientation}get totalPanels(){return this.panels.length}get panels(){return this.groups.flatMap(t=>t.panels)}get options(){return this._options}get activePanel(){const t=this.activeGroup;if(t)return t.activePanel}get renderer(){var t;return(t=this.options.defaultRenderer)!==null&&t!==void 0?t:"onlyWhenVisible"}get defaultHeaderPosition(){var t;return(t=this.options.defaultHeaderPosition)!==null&&t!==void 0?t:"top"}get api(){return this._api}get floatingGroups(){return this._floatingGroups}get popoutRestorationPromise(){return this._popoutRestorationPromise}constructor(t,n){var i,r,o;super(t,{proportionalLayout:!0,orientation:re.HORIZONTAL,styles:n.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:n.disableAutoResizing,locked:n.locked,margin:(r=(i=n.theme)===null||i===void 0?void 0:i.gap)!==null&&r!==void 0?r:0,className:n.className}),this.nextGroupId=Sp(),this._deserializer=new qT(this),this._watermark=null,this._onWillDragPanel=new B,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new B,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new B,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new B,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new B,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPopoutGroupSizeChange=new B,this.onDidPopoutGroupSizeChange=this._onDidPopoutGroupSizeChange.event,this._onDidPopoutGroupPositionChange=new B,this.onDidPopoutGroupPositionChange=this._onDidPopoutGroupPositionChange.event,this._onDidOpenPopoutWindowFail=new B,this.onDidOpenPopoutWindowFail=this._onDidOpenPopoutWindowFail.event,this._onDidLayoutFromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new B({replay:!0}),this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new B,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new B,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._popoutRestorationPromise=Promise.resolve(),this._onDidRemoveGroup=new B,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new B,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidOptionsChange=new B,this.onDidOptionsChange=this._onDidOptionsChange.event,this._onDidActiveGroupChange=new B,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this._options=n,this.popupService=new sM(this.element),this._themeClassnames=new cu(this.element),this._api=new Cl(this),this.rootDropTargetContainer=new Pg(this.element,{disabled:!0}),this.overlayRenderContainer=new zg(this.gridview.element,this),this._rootDropTarget=new rn(this.element,{className:"dv-drop-target-edge",canDisplayOverlay:(s,a)=>{const l=rt();if(l)return l.viewId!==this.id?!1:a==="center"?this.gridview.length===0:!0;if(a==="center"&&this.gridview.length!==0)return!1;const u=new Ky(s,"edge",a,rt);return this._onUnhandledDragOverEvent.fire(u),u.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:(o=n.rootOverlayModel)!==null&&o!==void 0?o:Ag,getOverrideTarget:()=>{var s;return(s=this.rootDropTargetContainer)===null||s===void 0?void 0:s.model}}),this.updateDropTargetModel(n),ne(this.gridview.element,"dv-dockview",!0),ne(this.element,"dv-debug",!!n.debug),this.updateTheme(),this.updateWatermark(),n.debug&&this.addDisposables(new oM(this)),this.addDisposables(this.rootDropTargetContainer,this.overlayRenderContainer,this._onWillDragPanel,this._onWillDragGroup,this._onWillShowOverlay,this._onDidActivePanelChange,this._onDidAddPanel,this._onDidRemovePanel,this._onDidLayoutFromJSON,this._onDidDrop,this._onWillDrop,this._onDidMovePanel,this._onDidMovePanel.event(()=>{this.debouncedUpdateAllPositions()}),this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this._onUnhandledDragOverEvent,this._onDidMaximizedGroupChange,this._onDidOptionsChange,this._onDidPopoutGroupSizeChange,this._onDidPopoutGroupPositionChange,this._onDidOpenPopoutWindowFail,this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.updateWatermark()}),this.onDidAdd(s=>{this._moving||this._onDidAddGroup.fire(s)}),this.onDidRemove(s=>{this._moving||this._onDidRemoveGroup.fire(s)}),this.onDidActiveChange(s=>{this._moving||this._onDidActiveGroupChange.fire(s)}),this.onDidMaximizedChange(s=>{this._onDidMaximizedGroupChange.fire({group:s.panel,isMaximized:s.isMaximized})}),Xi.any(this.onDidAdd,this.onDidRemove)(()=>{this.updateWatermark()}),Xi.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange,this.onDidPopoutGroupPositionChange,this.onDidPopoutGroupSizeChange)(()=>{this._bufferOnDidLayoutChange.fire()}),je.from(()=>{for(const s of[...this._floatingGroups])s.dispose();for(const s of[...this._popoutGroups])s.disposable.dispose()}),this._rootDropTarget,this._rootDropTarget.onWillShowOverlay(s=>{this.gridview.length>0&&s.position==="center"||this._onWillShowOverlay.fire(new du(s,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:rt}))}),this._rootDropTarget.onDrop(s=>{var a;const l=new Jy({nativeEvent:s.nativeEvent,position:s.position,panel:void 0,api:this._api,group:void 0,getData:rt,kind:"edge"});if(this._onWillDrop.fire(l),l.defaultPrevented)return;const u=rt();u?this.moveGroupOrPanel({from:{groupId:u.groupId,panelId:(a=u.panelId)!==null&&a!==void 0?a:void 0},to:{group:this.orthogonalize(s.position),position:"center"}}):this._onDidDrop.fire(new Pp({nativeEvent:s.nativeEvent,position:s.position,panel:void 0,api:this._api,group:void 0,getData:rt}))}),this._rootDropTarget)}setVisible(t,n){switch(t.api.location.type){case"grid":super.setVisible(t,n);break;case"floating":{const i=this.floatingGroups.find(r=>r.group===t);i&&(i.overlay.setVisible(n),t.api._onDidVisibilityChange.fire({isVisible:n}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window");break}}addPopoutGroup(t,n){var i,r,o,s,a;if(t instanceof wr&&t.group.size===1)return this.addPopoutGroup(t.group,n);const l=tT(this.gridview.element),u=this.element;function d(){return n!=null&&n.position?n.position:t instanceof Eg?t.element.getBoundingClientRect():t.group?t.group.element.getBoundingClientRect():u.getBoundingClientRect()}const c=d(),h=(r=(i=n==null?void 0:n.overridePopoutGroup)===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:this.getNextGroupId(),p=new rM(`${this.id}-${h}`,l??"",{url:(a=(o=n==null?void 0:n.popoutUrl)!==null&&o!==void 0?o:(s=this.options)===null||s===void 0?void 0:s.popoutUrl)!==null&&a!==void 0?a:"/popout.html",left:window.screenX+c.left,top:window.screenY+c.top,width:c.width,height:c.height,onDidOpen:n==null?void 0:n.onDidOpen,onWillClose:n==null?void 0:n.onWillClose}),f=new ce(p,p.onDidClose(()=>{f.dispose()}));return p.open().then(v=>{var b;if(p.isDisposed)return!1;const m=n!=null&&n.referenceGroup?n.referenceGroup:t instanceof wr?t.group:t,w=t.api.location.type,g=m.element.parentElement!==null;let y;if(g?n!=null&&n.overridePopoutGroup?y=n.overridePopoutGroup:(y=this.createGroup({id:h}),v&&this._onDidAddGroup.fire(y)):y=m,v===null)return console.error("dockview: failed to create popout. perhaps you need to allow pop-ups for this website"),f.dispose(),this._onDidOpenPopoutWindowFail.fire(),this.movingLock(()=>ma({from:y,to:m})),m.api.isVisible||m.api.setVisible(!0),!1;const k=document.createElement("div");k.className="dv-overlay-render-container";const _=new zg(k,this);y.model.renderContainer=_,y.layout(p.window.innerWidth,p.window.innerHeight);let E;if(!(n!=null&&n.overridePopoutGroup)&&g)if(t instanceof wr)this.movingLock(()=>{const D=m.model.removePanel(t);y.model.openPanel(D)});else switch(this.movingLock(()=>ma({from:m,to:y})),w){case"grid":m.api.setVisible(!1);break;case"floating":case"popout":E=(b=this._floatingGroups.find(D=>D.group.api.id===t.api.id))===null||b===void 0?void 0:b.overlay.toJSON(),this.removeGroup(m);break}v.classList.add("dv-dockview"),v.style.overflow="hidden",v.appendChild(k),v.appendChild(y.element);const S=document.createElement("div"),T=new Pg(S,{disabled:this.rootDropTargetContainer.disabled});v.appendChild(S),y.model.dropTargetContainer=T,y.model.location={type:"popout",getWindow:()=>p.window,popoutUrl:n==null?void 0:n.popoutUrl},g&&t.api.location.type==="grid"&&t.api.setVisible(!1),this.doSetGroupAndPanelActive(y),f.addDisposables(y.api.onDidActiveChange(D=>{var P;D.isActive&&((P=p.window)===null||P===void 0||P.focus())}),y.api.onWillFocus(()=>{var D;(D=p.window)===null||D===void 0||D.focus()}));let C;const I=g&&m&&this.getPanel(m.id),L={window:p,popoutGroup:y,referenceGroup:I?m.id:void 0,disposable:{dispose:()=>(f.dispose(),C)}},V=iT(p.window);return f.addDisposables(V,rT(p.window,()=>{this._onDidPopoutGroupSizeChange.fire({width:p.window.innerWidth,height:p.window.innerHeight,group:y})}),V.event(()=>{this._onDidPopoutGroupPositionChange.fire({screenX:p.window.screenX,screenY:p.window.screenX,group:y})}),pe(p.window,"resize",()=>{y.layout(p.window.innerWidth,p.window.innerHeight)}),_,je.from(()=>{if(!this.isDisposed){if(g&&this.getPanel(m.id))this.movingLock(()=>ma({from:y,to:m})),m.api.isVisible||m.api.setVisible(!0),this.getPanel(y.id)&&this.doRemoveGroup(y,{skipPopoutAssociated:!0});else if(this.getPanel(y.id)){if(y.model.renderContainer=this.overlayRenderContainer,y.model.dropTargetContainer=this.rootDropTargetContainer,C=y,!this._popoutGroups.find(P=>P.popoutGroup===y))return;E?this.addFloatingGroup(y,{height:E.height,width:E.width,position:E}):(this.doRemoveGroup(y,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),y.model.location={type:"grid"},this.movingLock(()=>{this.doAddGroup(y,[0])})),this.doSetGroupAndPanelActive(y)}}})),this._popoutGroups.push(L),this.updateWatermark(),!0}).catch(v=>(console.error("dockview: failed to create popout.",v),!1))}addFloatingGroup(t,n){var i,r,o,s,a;let l;if(t instanceof wr)l=this.createGroup(),this._onDidAddGroup.fire(l),this.movingLock(()=>this.removePanel(t,{removeEmptyGroup:!0,skipDispose:!0,skipSetActiveGroup:!0})),this.movingLock(()=>l.model.openPanel(t,{skipSetGroupActive:!0}));else{l=t;const v=(i=this._popoutGroups.find(w=>w.popoutGroup===l))===null||i===void 0?void 0:i.referenceGroup,b=v?this.getPanel(v):void 0;typeof(n==null?void 0:n.skipRemoveGroup)=="boolean"&&n.skipRemoveGroup||(b?(this.movingLock(()=>ma({from:t,to:b})),this.doRemoveGroup(t,{skipPopoutReturn:!0,skipPopoutAssociated:!0}),this.doRemoveGroup(b,{skipDispose:!0}),l=b):this.doRemoveGroup(t,{skipDispose:!0,skipPopoutReturn:!0,skipPopoutAssociated:!1}))}function u(){if(n!=null&&n.position){const v={};return"left"in n.position?v.left=Math.max(n.position.left,0):"right"in n.position?v.right=Math.max(n.position.right,0):v.left=ei.left,"top"in n.position?v.top=Math.max(n.position.top,0):"bottom"in n.position?v.bottom=Math.max(n.position.bottom,0):v.top=ei.top,typeof n.width=="number"?v.width=Math.max(n.width,0):v.width=ei.width,typeof n.height=="number"?v.height=Math.max(n.height,0):v.height=ei.height,v}return{left:typeof(n==null?void 0:n.x)=="number"?Math.max(n.x,0):ei.left,top:typeof(n==null?void 0:n.y)=="number"?Math.max(n.y,0):ei.top,width:typeof(n==null?void 0:n.width)=="number"?Math.max(n.width,0):ei.width,height:typeof(n==null?void 0:n.height)=="number"?Math.max(n.height,0):ei.height}}const d=u(),c=new yn(Object.assign(Object.assign({container:this.gridview.element,content:l.element},d),{minimumInViewportWidth:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(o=(r=this.options.floatingGroupBounds)===null||r===void 0?void 0:r.minimumWidthWithinViewport)!==null&&o!==void 0?o:fa,minimumInViewportHeight:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(a=(s=this.options.floatingGroupBounds)===null||s===void 0?void 0:s.minimumHeightWithinViewport)!==null&&a!==void 0?a:fa})),h=l.element.querySelector(".dv-void-container");if(!h)throw new Error("dockview: failed to find drag handle");c.setupDrag(h,{inDragMode:typeof(n==null?void 0:n.inDragMode)=="boolean"?n.inDragMode:!1});const p=new JT(l,c),f=new ce(l.api.onDidActiveChange(v=>{v.isActive&&c.bringToFront()}),uu(l.element,v=>{const{width:b,height:m}=v.contentRect;l.layout(b,m)}));p.addDisposables(c.onDidChange(()=>{l.layout(l.width,l.height)}),c.onDidChangeEnd(()=>{this._bufferOnDidLayoutChange.fire()}),l.onDidChange(v=>{c.setBounds({height:v==null?void 0:v.height,width:v==null?void 0:v.width})}),{dispose:()=>{f.dispose(),wc(this._floatingGroups,p),l.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(p),l.model.location={type:"floating"},n!=null&&n.skipActiveGroup||this.doSetGroupAndPanelActive(l),this.updateWatermark()}orthogonalize(t,n){switch(this.gridview.normalize(),t){case"top":case"bottom":this.gridview.orientation===re.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===re.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break}switch(t){case"top":case"left":case"center":return this.createGroupAtLocation([0],void 0,n);case"bottom":case"right":return this.createGroupAtLocation([this.gridview.length],void 0,n);default:throw new Error(`dockview: unsupported position ${t}`)}}updateOptions(t){var n,i;if(super.updateOptions(t),"floatingGroupBounds"in t)for(const s of this._floatingGroups){switch(t.floatingGroupBounds){case"boundedWithinViewport":s.overlay.minimumInViewportHeight=void 0,s.overlay.minimumInViewportWidth=void 0;break;case void 0:s.overlay.minimumInViewportHeight=fa,s.overlay.minimumInViewportWidth=fa;break;default:s.overlay.minimumInViewportHeight=(n=t.floatingGroupBounds)===null||n===void 0?void 0:n.minimumHeightWithinViewport,s.overlay.minimumInViewportWidth=(i=t.floatingGroupBounds)===null||i===void 0?void 0:i.minimumWidthWithinViewport}s.overlay.setBounds()}this.updateDropTargetModel(t);const r=this.options.disableDnd;this._options=Object.assign(Object.assign({},this.options),t);const o=this.options.disableDnd;if(r!==o&&this.updateDragAndDropState(),"theme"in t&&this.updateTheme(),"createRightHeaderActionComponent"in t||"createLeftHeaderActionComponent"in t||"createPrefixHeaderActionComponent"in t)for(const s of this.groups)s.model.updateHeaderActions();this.layout(this.gridview.width,this.gridview.height,!0)}layout(t,n,i){if(super.layout(t,n,i),this._floatingGroups)for(const r of this._floatingGroups)r.overlay.setBounds()}updateDragAndDropState(){for(const t of this.groups)t.model.updateDragAndDropState()}focus(){var t;(t=this.activeGroup)===null||t===void 0||t.focus()}getGroupPanel(t){return this.panels.find(n=>n.id===t)}setActivePanel(t){t.group.model.openPanel(t),this.doSetGroupAndPanelActive(t.group)}moveToNext(t={}){var n;if(!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}if(t.includePanel&&t.group&&t.group.activePanel!==t.group.panels[t.group.panels.length-1]){t.group.model.moveToNext({suppressRoll:!0});return}const i=Oe(t.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupAndPanelActive(r)}moveToPrevious(t={}){var n;if(!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}if(t.includePanel&&t.group&&t.group.activePanel!==t.group.panels[0]){t.group.model.moveToPrevious({suppressRoll:!0});return}const i=Oe(t.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;r&&this.doSetGroupAndPanelActive(r)}toJSON(){var t;const n=this.gridview.serialize(),i=this.panels.reduce((a,l)=>(a[l.id]=l.toJSON(),a),{}),r=this._floatingGroups.map(a=>({data:a.group.toJSON(),position:a.overlay.toJSON()})),o=this._popoutGroups.map(a=>({data:a.popoutGroup.toJSON(),gridReferenceGroup:a.referenceGroup,position:a.window.dimensions(),url:a.popoutGroup.api.location.type==="popout"?a.popoutGroup.api.location.popoutUrl:void 0})),s={grid:n,panels:i,activeGroup:(t=this.activeGroup)===null||t===void 0?void 0:t.id};return r.length>0&&(s.floatingGroups=r),o.length>0&&(s.popoutGroups=o),s}fromJSON(t,n){var i,r;const o=new Map;let s;if(n!=null&&n.reuseExistingPanels){s=this.createGroup(),this._groups.delete(s.api.id);const d=Object.keys(t.panels);for(const c of this.panels)d.includes(c.api.id)&&o.set(c.api.id,c);this.movingLock(()=>{Array.from(o.values()).forEach(c=>{this.moveGroupOrPanel({from:{groupId:c.api.group.api.id,panelId:c.api.id},to:{group:s,position:"center"},keepEmptyGroups:!0})})})}if(this.clear(),typeof t!="object"||t===null)throw new Error("dockview: serialized layout must be a non-null object");const{grid:a,panels:l,activeGroup:u}=t;if(a.root.type!=="branch"||!Array.isArray(a.root.data))throw new Error("dockview: root must be of type branch");try{const d=this.width,c=this.height,h=b=>{const{id:m,locked:w,hideHeader:g,headerPosition:y,views:k,activeView:_}=b;if(typeof m!="string")throw new Error("dockview: group id must be of type string");const E=this.createGroup({id:m,locked:!!w,hideHeader:!!g,headerPosition:y});this._onDidAddGroup.fire(E);const S=[];for(const T of k){const C=o.get(T);if(s&&C)this.movingLock(()=>{s.model.removePanel(C)}),S.push(C),C.updateFromStateModel(l[T]);else{const I=this._deserializer.fromJSON(l[T],E);S.push(I)}}for(let T=0;T<k.length;T++){const C=S[T],I=typeof _=="string"&&_===C.id;o.has(C.api.id)?this.movingLock(()=>{E.model.openPanel(C,{skipSetActive:!I,skipSetGroupActive:!0})}):E.model.openPanel(C,{skipSetActive:!I,skipSetGroupActive:!0})}return!E.activePanel&&E.panels.length>0&&E.model.openPanel(E.panels[E.panels.length-1],{skipSetGroupActive:!0}),E};this.gridview.deserialize(a,{fromJSON:b=>h(b.data)}),this.layout(d,c,!0);const p=(i=t.floatingGroups)!==null&&i!==void 0?i:[];for(const b of p){const{data:m,position:w}=b,g=h(m);this.addFloatingGroup(g,{position:w,width:w.width,height:w.height,skipRemoveGroup:!0,inDragMode:!1})}const f=(r=t.popoutGroups)!==null&&r!==void 0?r:[],v=[];f.forEach((b,m)=>{const{data:w,position:g,gridReferenceGroup:y,url:k}=b,_=h(w),E=new Promise(S=>{setTimeout(()=>{this.addPopoutGroup(_,{position:g??void 0,overridePopoutGroup:y?_:void 0,referenceGroup:y?this.getPanel(y):void 0,popoutUrl:k}),S()},m*eM)});v.push(E)}),this._popoutRestorationPromise=Promise.all(v).then(()=>{});for(const b of this._floatingGroups)b.overlay.setBounds();if(typeof u=="string"){const b=this.getPanel(u);b&&this.doSetGroupAndPanelActive(b)}}catch(d){console.error("dockview: failed to deserialize layout. Reverting changes",d);for(const c of this.groups)for(const h of c.panels)this.removePanel(h,{removeEmptyGroup:!1,skipDispose:!1});for(const c of this.groups)c.dispose(),this._groups.delete(c.id),this._onDidRemoveGroup.fire(c);for(const c of[...this._floatingGroups])c.dispose();throw this.clear(),d}this.updateWatermark(),this.debouncedUpdateAllPositions(),this._onDidLayoutFromJSON.fire()}clear(){const t=Array.from(this._groups.values()).map(i=>i.value),n=!!this.activeGroup;for(const i of t)this.removeGroup(i,{skipActive:!0});n&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const t of this._groups.entries()){const[n,i]=t;i.value.model.closeAllPanels()}}addPanel(t){var n,i;if(this.panels.find(l=>l.id===t.id))throw new Error(`dockview: panel with id ${t.id} already exists`);let r;if(t.position&&t.floating)throw new Error("dockview: you can only provide one of: position, floating as arguments to .addPanel(...)");const o={width:t.initialWidth,height:t.initialHeight};let s;if(t.position)if(HT(t.position)){const l=typeof t.position.referencePanel=="string"?this.getGroupPanel(t.position.referencePanel):t.position.referencePanel;if(s=t.position.index,!l)throw new Error(`dockview: referencePanel '${t.position.referencePanel}' does not exist`);r=this.findGroup(l)}else if(GT(t.position)){if(r=typeof t.position.referenceGroup=="string"?(n=this._groups.get(t.position.referenceGroup))===null||n===void 0?void 0:n.value:t.position.referenceGroup,s=t.position.index,!r)throw new Error(`dockview: referenceGroup '${t.position.referenceGroup}' does not exist`)}else{const l=this.orthogonalize(Cg(t.position.direction)),u=this.createPanel(t,l);return l.model.openPanel(u,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),t.inactive||this.doSetGroupAndPanelActive(l),l.api.setSize({height:o==null?void 0:o.height,width:o==null?void 0:o.width}),u}else r=this.activeGroup;let a;if(r){const l=Sl(((i=t.position)===null||i===void 0?void 0:i.direction)||"within");if(t.floating){const u=this.createGroup();this._onDidAddGroup.fire(u);const d=typeof t.floating=="object"&&t.floating!==null?t.floating:{};this.addFloatingGroup(u,Object.assign(Object.assign({},d),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(t,u),u.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s})}else if(r.api.location.type==="floating"||l==="center")a=this.createPanel(t,r),r.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),r.api.setSize({width:o==null?void 0:o.width,height:o==null?void 0:o.height}),t.inactive||this.doSetGroupAndPanelActive(r);else{const u=Oe(r.element),d=bn(this.gridview.orientation,u,l),c=this.createGroupAtLocation(d,this.orientationAtLocation(d)===re.VERTICAL?o==null?void 0:o.height:o==null?void 0:o.width);a=this.createPanel(t,c),c.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),t.inactive||this.doSetGroupAndPanelActive(c)}}else if(t.floating){const l=this.createGroup();this._onDidAddGroup.fire(l);const u=typeof t.floating=="object"&&t.floating!==null?t.floating:{};this.addFloatingGroup(l,Object.assign(Object.assign({},u),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(t,l),l.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s})}else{const l=this.createGroupAtLocation([0],this.gridview.orientation===re.VERTICAL?o==null?void 0:o.height:o==null?void 0:o.width);a=this.createPanel(t,l),l.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),t.inactive||this.doSetGroupAndPanelActive(l)}return a}removePanel(t,n={removeEmptyGroup:!0}){const i=t.group;if(!i)throw new Error(`dockview: cannot remove panel ${t.id}. it's missing a group.`);i.model.removePanel(t,{skipSetActiveGroup:n.skipSetActiveGroup}),n.skipDispose||(t.group.model.renderContainer.detatch(t),t.dispose()),i.size===0&&n.removeEmptyGroup&&this.removeGroup(i,{skipActive:n.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new QT}updateWatermark(){var t,n;if(this.groups.filter(i=>i.api.location.type==="grid"&&i.api.isVisible).length===0){if(!this._watermark){this._watermark=this.createWatermarkComponent(),this._watermark.init({containerApi:new Cl(this)});const i=document.createElement("div");i.className="dv-watermark-container",JN(i,"watermark-component"),i.appendChild(this._watermark.element),this.gridview.element.appendChild(i)}}else this._watermark&&(this._watermark.element.parentElement.remove(),(n=(t=this._watermark).dispose)===null||n===void 0||n.call(t),this._watermark=null)}addGroup(t){var n;if(t){let i;if(BT(t)){const u=typeof t.referencePanel=="string"?this.panels.find(d=>d.id===t.referencePanel):t.referencePanel;if(!u)throw new Error(`dockview: reference panel ${t.referencePanel} does not exist`);if(i=this.findGroup(u),!i)throw new Error(`dockview: reference group for reference panel ${t.referencePanel} does not exist`)}else if($T(t)){if(i=typeof t.referenceGroup=="string"?(n=this._groups.get(t.referenceGroup))===null||n===void 0?void 0:n.value:t.referenceGroup,!i)throw new Error(`dockview: reference group ${t.referenceGroup} does not exist`)}else{const u=this.orthogonalize(Cg(t.direction),t);return t.skipSetActive||this.doSetGroupAndPanelActive(u),u}const r=Sl(t.direction||"within"),o=Oe(i.element),s=bn(this.gridview.orientation,o,r),a=this.createGroup(t),l=this.getLocationOrientation(s)===re.VERTICAL?t.initialHeight:t.initialWidth;return this.doAddGroup(a,s,l),t.skipSetActive||this.doSetGroupAndPanelActive(a),a}else{const i=this.createGroup(t);return this.doAddGroup(i),this.doSetGroupAndPanelActive(i),i}}getLocationOrientation(t){return t.length%2==0&&this.gridview.orientation===re.HORIZONTAL?re.HORIZONTAL:re.VERTICAL}removeGroup(t,n){this.doRemoveGroup(t,n)}doRemoveGroup(t,n){var i;const r=[...t.panels];if(!(n!=null&&n.skipDispose))for(const a of r)this.removePanel(a,{removeEmptyGroup:!1,skipDispose:(i=n==null?void 0:n.skipDispose)!==null&&i!==void 0?i:!1});const o=this.activePanel;if(t.api.location.type==="floating"){const a=this._floatingGroups.find(l=>l.group===t);if(a){if(n!=null&&n.skipDispose||(a.group.dispose(),this._groups.delete(t.id),this._onDidRemoveGroup.fire(t)),wc(this._floatingGroups,a),a.dispose(),!(n!=null&&n.skipActive)&&this._activeGroup===t){const l=Array.from(this._groups.values());this.doSetGroupAndPanelActive(l.length>0?l[0].value:void 0)}return a.group}throw new Error("dockview: failed to find floating group")}if(t.api.location.type==="popout"){const a=this._popoutGroups.find(l=>l.popoutGroup===t);if(a){if(!(n!=null&&n.skipDispose)){if(!(n!=null&&n.skipPopoutAssociated)){const u=a.referenceGroup?this.getPanel(a.referenceGroup):void 0;u&&u.panels.length===0&&this.removeGroup(u)}a.popoutGroup.dispose(),this._groups.delete(t.id),this._onDidRemoveGroup.fire(t)}wc(this._popoutGroups,a);const l=a.disposable.dispose();if(!(n!=null&&n.skipPopoutReturn)&&l&&(this.doAddGroup(l,[0]),this.doSetGroupAndPanelActive(l)),!(n!=null&&n.skipActive)&&this._activeGroup===t){const u=Array.from(this._groups.values());this.doSetGroupAndPanelActive(u.length>0?u[0].value:void 0)}return this.updateWatermark(),a.popoutGroup}throw new Error("dockview: failed to find popout group")}const s=super.doRemoveGroup(t,n);return n!=null&&n.skipActive||this.activePanel!==o&&this._onDidActivePanelChange.fire(this.activePanel),s}debouncedUpdateAllPositions(){this._updatePositionsFrameId!==void 0&&cancelAnimationFrame(this._updatePositionsFrameId),this._updatePositionsFrameId=requestAnimationFrame(()=>{this._updatePositionsFrameId=void 0,this.overlayRenderContainer.updateAllPositions()})}movingLock(t){const n=this._moving;try{return this._moving=!0,t()}finally{this._moving=n}}moveGroupOrPanel(t){var n;const i=t.to.group,r=t.from.groupId,o=t.from.panelId,s=t.to.position,a=t.to.index,l=r?(n=this._groups.get(r))===null||n===void 0?void 0:n.value:void 0;if(!l)throw new Error(`dockview: Failed to find group id ${r}`);if(o===void 0){this.moveGroup({from:{group:l},to:{group:i,position:s},skipSetActive:t.skipSetActive});return}if(!s||s==="center"){const u=this.movingLock(()=>l.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!u)throw new Error(`dockview: No panel with id ${o}`);!t.keepEmptyGroups&&l.model.size===0&&this.doRemoveGroup(l,{skipActive:!0});const d=i.model.size===0;this.movingLock(()=>{var c;return i.model.openPanel(u,{index:a,skipSetActive:((c=t.skipSetActive)!==null&&c!==void 0?c:!1)&&!d,skipSetGroupActive:!0})}),t.skipSetActive||this.doSetGroupAndPanelActive(i),this._onDidMovePanel.fire({panel:u,from:l})}else{const u=Oe(i.element),d=bn(this.gridview.orientation,u,s);if(l.size<2){const[c,h]=Vn(d);if(l.api.location.type==="grid"){const b=Oe(l.element),[m,w]=Vn(b);if(Gy(m,c)){this.gridview.moveView(m,w,h),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:l});return}}if(l.api.location.type==="popout"){const b=this._popoutGroups.find(g=>g.popoutGroup===l),m=this.movingLock(()=>b.popoutGroup.model.removePanel(b.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0}));this.doRemoveGroup(l,{skipActive:!0});const w=this.createGroupAtLocation(d);this.movingLock(()=>w.model.openPanel(m,{skipSetActive:!0})),this.doSetGroupAndPanelActive(w),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:l});return}const p=this.movingLock(()=>this.doRemoveGroup(l,{skipActive:!0,skipDispose:!0})),f=Oe(i.element),v=bn(this.gridview.orientation,f,s);this.movingLock(()=>this.doAddGroup(p,v)),this.doSetGroupAndPanelActive(p),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:l})}else{const c=this.movingLock(()=>l.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!c)throw new Error(`dockview: No panel with id ${o}`);const h=bn(this.gridview.orientation,u,s),p=this.createGroupAtLocation(h);this.movingLock(()=>p.model.openPanel(c,{skipSetGroupActive:!0})),this.doSetGroupAndPanelActive(p),this._onDidMovePanel.fire({panel:c,from:l})}}}moveGroup(t){const n=t.from.group,i=t.to.group,r=t.to.position;if(r==="center"){const o=n.activePanel,s=this.movingLock(()=>[...n.panels].map(a=>n.model.removePanel(a.id,{skipSetActive:!0})));(n==null?void 0:n.model.size)===0&&this.doRemoveGroup(n,{skipActive:!0}),this.movingLock(()=>{for(const a of s)i.model.openPanel(a,{skipSetActive:a!==o,skipSetGroupActive:!0})}),t.skipSetActive!==!0?this.doSetGroupAndPanelActive(i):this.activePanel||this.doSetGroupAndPanelActive(i)}else{switch(n.api.location.type){case"grid":this.gridview.removeView(Oe(n.element));break;case"floating":{const o=this._floatingGroups.find(s=>s.group===n);if(!o)throw new Error("dockview: failed to find floating group");o.dispose();break}case"popout":{const o=this._popoutGroups.find(a=>a.popoutGroup===n);if(!o)throw new Error("dockview: failed to find popout group");const s=this._popoutGroups.indexOf(o);if(s>=0&&this._popoutGroups.splice(s,1),o.referenceGroup){const a=this.getPanel(o.referenceGroup);a&&!a.api.isVisible&&this.doRemoveGroup(a,{skipActive:!0})}o.window.dispose(),i.api.location.type==="grid"?(n.model.renderContainer=this.overlayRenderContainer,n.model.dropTargetContainer=this.rootDropTargetContainer,n.model.location={type:"grid"}):i.api.location.type==="floating"&&(n.model.renderContainer=this.overlayRenderContainer,n.model.dropTargetContainer=this.rootDropTargetContainer,n.model.location={type:"floating"});break}}if(i.api.location.type==="grid"){const o=Oe(i.element),s=bn(this.gridview.orientation,o,r);let a;switch(this.gridview.orientation){case re.VERTICAL:a=o.length%2==0?n.api.width:n.api.height;break;case re.HORIZONTAL:a=o.length%2==0?n.api.height:n.api.width;break}this.gridview.addView(n,a,s)}else if(i.api.location.type==="floating"){const o=this._floatingGroups.find(s=>s.group===i);if(o){const s=o.overlay.toJSON();let a,l;"left"in s?a=s.left+50:"right"in s?a=Math.max(0,s.right-s.width-50):a=50,"top"in s?l=s.top+50:"bottom"in s?l=Math.max(0,s.bottom-s.height-50):l=50,this.addFloatingGroup(n,{height:s.height,width:s.width,position:{left:a,top:l}})}}}if(n.panels.forEach(o=>{this._onDidMovePanel.fire({panel:o,from:n})}),this.debouncedUpdateAllPositions(),t.skipSetActive===!1){const o=i??n;this.doSetGroupAndPanelActive(o)}}doSetGroupActive(t){super.doSetGroupActive(t);const n=this.activePanel;!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}doSetGroupAndPanelActive(t){super.doSetGroupActive(t);const n=this.activePanel;t&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(t)&&this.exitMaximizedGroup(),!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}getNextGroupId(){let t=this.nextGroupId.next();for(;this._groups.has(t);)t=this.nextGroupId.next();return t}createGroup(t){t||(t={});let n=t==null?void 0:t.id;if(n&&this._groups.has(t.id)&&(console.warn(`dockview: Duplicate group id ${t==null?void 0:t.id}. reassigning group id to avoid errors`),n=void 0),!n)for(n=this.nextGroupId.next();this._groups.has(n);)n=this.nextGroupId.next();const i=new Eg(this,n,t);if(i.init({params:{},accessor:this}),!this._groups.has(i.id)){const r=new ce(i.model.onTabDragStart(o=>{this._onWillDragPanel.fire(o)}),i.model.onGroupDragStart(o=>{this._onWillDragGroup.fire(o)}),i.model.onMove(o=>{const{groupId:s,itemId:a,target:l,index:u}=o;this.moveGroupOrPanel({from:{groupId:s,panelId:a},to:{group:i,position:l,index:u}})}),i.model.onDidDrop(o=>{this._onDidDrop.fire(o)}),i.model.onWillDrop(o=>{this._onWillDrop.fire(o)}),i.model.onWillShowOverlay(o=>{if(this.options.disableDnd){o.preventDefault();return}this._onWillShowOverlay.fire(o)}),i.model.onUnhandledDragOverEvent(o=>{this._onUnhandledDragOverEvent.fire(o)}),i.model.onDidAddPanel(o=>{this._moving||this._onDidAddPanel.fire(o.panel)}),i.model.onDidRemovePanel(o=>{this._moving||this._onDidRemovePanel.fire(o.panel)}),i.model.onDidActivePanelChange(o=>{this._moving||o.panel===this.activePanel&&this._onDidActivePanelChange.value!==o.panel&&this._onDidActivePanelChange.fire(o.panel)}),Xi.any(i.model.onDidPanelTitleChange,i.model.onDidPanelParametersChange)(()=>{this._bufferOnDidLayoutChange.fire()}));this._groups.set(i.id,{value:i,disposable:r})}return i.initialize(),i}createPanel(t,n){var i,r,o;const s=t.component,a=(i=t.tabComponent)!==null&&i!==void 0?i:this.options.defaultTabComponent,l=new tx(this,t.id,s,a),u=new wr(t.id,s,a,this,this._api,n,l,{renderer:t.renderer,minimumWidth:t.minimumWidth,minimumHeight:t.minimumHeight,maximumWidth:t.maximumWidth,maximumHeight:t.maximumHeight});return u.init({title:(r=t.title)!==null&&r!==void 0?r:t.id,params:(o=t==null?void 0:t.params)!==null&&o!==void 0?o:{}}),u}createGroupAtLocation(t,n,i){const r=this.createGroup(i);return this.doAddGroup(r,t,n),r}findGroup(t){var n;return(n=Array.from(this._groups.values()).find(i=>i.value.model.containsPanel(t)))===null||n===void 0?void 0:n.value}orientationAtLocation(t){const n=this.gridview.orientation;return t.length%2==1?n:kn(n)}updateDropTargetModel(t){"dndEdges"in t&&(this._rootDropTarget.disabled=typeof t.dndEdges=="boolean"&&t.dndEdges===!1,typeof t.dndEdges=="object"&&t.dndEdges!==null?this._rootDropTarget.setOverlayModel(t.dndEdges):this._rootDropTarget.setOverlayModel(Ag)),"rootOverlayModel"in t&&this.updateDropTargetModel({dndEdges:t.dndEdges})}updateTheme(){var t,n;const i=(t=this._options.theme)!==null&&t!==void 0?t:XT;switch(this._themeClassnames.setClassNames(i.className),this.gridview.margin=(n=i.gap)!==null&&n!==void 0?n:0,i.dndOverlayMounting){case"absolute":this.rootDropTargetContainer.disabled=!1;break;case"relative":default:this.rootDropTargetContainer.disabled=!0;break}}}class lM extends $y{get orientation(){return this.gridview.orientation}set orientation(t){this.gridview.orientation=t}get options(){return this._options}get deserializer(){return this._deserializer}set deserializer(t){this._deserializer=t}constructor(t,n){var i;super(t,{proportionalLayout:(i=n.proportionalLayout)!==null&&i!==void 0?i:!0,orientation:n.orientation,styles:n.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:n.disableAutoResizing,className:n.className}),this._onDidLayoutfromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidRemoveGroup=new B,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new B,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new B,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._options=n,this.addDisposables(this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this.onDidAdd(r=>{this._onDidAddGroup.fire(r)}),this.onDidRemove(r=>{this._onDidRemoveGroup.fire(r)}),this.onDidActiveChange(r=>{this._onDidActiveGroupChange.fire(r)}))}updateOptions(t){super.updateOptions(t);const n=typeof t.orientation=="string"&&this.gridview.orientation!==t.orientation;this._options=Object.assign(Object.assign({},this.options),t),n&&(this.gridview.orientation=t.orientation),this.layout(this.gridview.width,this.gridview.height,!0)}removePanel(t){this.removeGroup(t)}toJSON(){var t;return{grid:this.gridview.serialize(),activePanel:(t=this.activeGroup)===null||t===void 0?void 0:t.id}}setVisible(t,n){this.gridview.setViewVisible(Oe(t.element),n)}setActive(t){this._groups.forEach((n,i)=>{n.value.setActive(t===n.value)})}focus(){var t;(t=this.activeGroup)===null||t===void 0||t.focus()}fromJSON(t){this.clear();const{grid:n,activePanel:i}=t;try{const r=[],o=this.width,s=this.height;if(this.gridview.deserialize(n,{fromJSON:a=>{const{data:l}=a,u=this.options.createComponent({id:l.id,name:l.component});return r.push(()=>u.init({params:l.params,minimumWidth:l.minimumWidth,maximumWidth:l.maximumWidth,minimumHeight:l.minimumHeight,maximumHeight:l.maximumHeight,priority:l.priority,snap:!!l.snap,accessor:this,isVisible:a.visible})),this._onDidAddGroup.fire(u),this.registerPanel(u),u}}),this.layout(o,s,!0),r.forEach(a=>a()),typeof i=="string"){const a=this.getPanel(i);a&&this.doSetGroupActive(a)}}catch(r){for(const o of this.groups)o.dispose(),this._groups.delete(o.id),this._onDidRemoveGroup.fire(o);throw this.clear(),r}this._onDidLayoutfromJSON.fire()}clear(){const t=this.activeGroup,n=Array.from(this._groups.values());for(const i of n)i.disposable.dispose(),this.doRemoveGroup(i.value,{skipActive:!0});t&&this.doSetGroupActive(void 0),this.gridview.clear()}movePanel(t,n){var i;let r;const o=this.gridview.remove(t),s=(i=this._groups.get(n.reference))===null||i===void 0?void 0:i.value;if(!s)throw new Error(`reference group ${n.reference} does not exist`);const a=Sl(n.direction);if(a==="center")throw new Error(`${a} not supported as an option`);{const l=Oe(s.element);r=bn(this.gridview.orientation,l,a)}this.doAddGroup(o,r,n.size)}addPanel(t){var n,i,r,o;let s=(n=t.location)!==null&&n!==void 0?n:[0];if(!((i=t.position)===null||i===void 0)&&i.referencePanel){const l=(r=this._groups.get(t.position.referencePanel))===null||r===void 0?void 0:r.value;if(!l)throw new Error(`reference group ${t.position.referencePanel} does not exist`);const u=Sl(t.position.direction);if(u==="center")throw new Error(`${u} not supported as an option`);{const d=Oe(l.element);s=bn(this.gridview.orientation,d,u)}}const a=this.options.createComponent({id:t.id,name:t.component});return a.init({params:(o=t.params)!==null&&o!==void 0?o:{},minimumWidth:t.minimumWidth,maximumWidth:t.maximumWidth,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,priority:t.priority,snap:!!t.snap,accessor:this,isVisible:!0}),this.doAddGroup(a,s,t.size),this.registerPanel(a),this.doSetGroupActive(a),a}registerPanel(t){const n=new ce(t.api.onDidFocusChange(i=>{i.isFocused&&this._groups.forEach(r=>{const o=r.value;o!==t?o.setActive(!1):o.setActive(!0)})}));this._groups.set(t.id,{value:t,disposable:n})}moveGroup(t,n,i){const r=this.getPanel(n);if(!r)throw new Error("invalid operation");const o=Oe(t.element),s=bn(this.gridview.orientation,o,i),[a,l]=Vn(s),u=Oe(r.element),[d,c]=Vn(u);if(Gy(d,a)){this.gridview.moveView(d,c,l);return}const h=this.doRemoveGroup(r,{skipActive:!0,skipDispose:!0}),p=Oe(t.element),f=bn(this.gridview.orientation,p,i);this.doAddGroup(h,f)}removeGroup(t){super.removeGroup(t)}dispose(){super.dispose(),this._onDidLayoutfromJSON.dispose()}}class uM extends Cp{get panels(){return this.splitview.getViews()}get options(){return this._options}get length(){return this._panels.size}get orientation(){return this.splitview.orientation}get splitview(){return this._splitview}set splitview(t){this._splitview&&this._splitview.dispose(),this._splitview=t,this._splitviewChangeDisposable.value=new ce(this._splitview.onDidSashEnd(()=>{this._onDidLayoutChange.fire(void 0)}),this._splitview.onDidAddView(n=>this._onDidAddView.fire(n)),this._splitview.onDidRemoveView(n=>this._onDidRemoveView.fire(n)))}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get height(){return this.splitview.orientation===re.HORIZONTAL?this.splitview.orthogonalSize:this.splitview.size}get width(){return this.splitview.orientation===re.HORIZONTAL?this.splitview.size:this.splitview.orthogonalSize}constructor(t,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._splitviewChangeDisposable=new Je,this._panels=new Map,this._onDidLayoutfromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidAddView=new B,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new B,this.onDidRemoveView=this._onDidRemoveView.event,this._onDidLayoutChange=new B,this.onDidLayoutChange=this._onDidLayoutChange.event,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new cu(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),t.appendChild(this.element),this._options=n,this.splitview=new fs(this.element,n),this.addDisposables(this._onDidAddView,this._onDidLayoutfromJSON,this._onDidRemoveView,this._onDidLayoutChange)}updateOptions(t){var n,i;"className"in t&&this._classNames.setClassNames((n=t.className)!==null&&n!==void 0?n:""),"disableResizing"in t&&(this.disableResizing=(i=t.disableAutoResizing)!==null&&i!==void 0?i:!1),typeof t.orientation=="string"&&(this.splitview.orientation=t.orientation),this._options=Object.assign(Object.assign({},this.options),t),this.splitview.layout(this.splitview.size,this.splitview.orthogonalSize)}focus(){var t;(t=this._activePanel)===null||t===void 0||t.focus()}movePanel(t,n){this.splitview.moveView(t,n)}setVisible(t,n){const i=this.panels.indexOf(t);this.splitview.setViewVisible(i,n)}setActive(t,n){this._activePanel=t,this.panels.filter(i=>i!==t).forEach(i=>{i.api._onDidActiveChange.fire({isActive:!1}),n||i.focus()}),t.api._onDidActiveChange.fire({isActive:!0}),n||t.focus()}removePanel(t,n){const i=this._panels.get(t.id);if(!i)throw new Error(`unknown splitview panel ${t.id}`);i.dispose(),this._panels.delete(t.id);const r=this.panels.findIndex(a=>a===t);this.splitview.removeView(r,n).dispose();const s=this.panels;s.length>0&&this.setActive(s[s.length-1])}getPanel(t){return this.panels.find(n=>n.id===t)}addPanel(t){var n;if(this._panels.has(t.id))throw new Error(`panel ${t.id} already exists`);const i=this.options.createComponent({id:t.id,name:t.component});i.orientation=this.splitview.orientation,i.init({params:(n=t.params)!==null&&n!==void 0?n:{},minimumSize:t.minimumSize,maximumSize:t.maximumSize,snap:t.snap,priority:t.priority,accessor:this});const r=typeof t.size=="number"?t.size:Wt.Distribute,o=typeof t.index=="number"?t.index:void 0;return this.splitview.addView(i,r,o),this.doAddView(i),this.setActive(i),i}layout(t,n){const[i,r]=this.splitview.orientation===re.HORIZONTAL?[t,n]:[n,t];this.splitview.layout(i,r)}doAddView(t){const n=t.api.onDidFocusChange(i=>{i.isFocused&&this.setActive(t,!0)});this._panels.set(t.id,n)}toJSON(){var t;return{views:this.splitview.getViews().map((i,r)=>({size:this.splitview.getViewSize(r),data:i.toJSON(),snap:!!i.snap,priority:i.priority})),activeView:(t=this._activePanel)===null||t===void 0?void 0:t.id,size:this.splitview.size,orientation:this.splitview.orientation}}fromJSON(t){this.clear();const{views:n,orientation:i,size:r,activeView:o}=t,s=[],a=this.width,l=this.height;if(this.splitview=new fs(this.element,{orientation:i,proportionalLayout:this.options.proportionalLayout,descriptor:{size:r,views:n.map(u=>{const d=u.data;if(this._panels.has(d.id))throw new Error(`panel ${d.id} already exists`);const c=this.options.createComponent({id:d.id,name:d.component});return s.push(()=>{var h;c.init({params:(h=d.params)!==null&&h!==void 0?h:{},minimumSize:d.minimumSize,maximumSize:d.maximumSize,snap:u.snap,priority:u.priority,accessor:this})}),c.orientation=i,this.doAddView(c),setTimeout(()=>{this._onDidAddView.fire(c)},0),{size:u.size,view:c}})}}),this.layout(a,l),s.forEach(u=>u()),typeof o=="string"){const u=this.getPanel(o);u&&this.setActive(u)}this._onDidLayoutfromJSON.fire()}clear(){for(const t of this._panels.values())t.dispose();for(this._panels.clear();this.splitview.length>0;)this.splitview.removeView(0,Wt.Distribute,!0).dispose()}dispose(){for(const n of this._panels.values())n.dispose();this._panels.clear();const t=this.splitview.getViews();this._splitviewChangeDisposable.dispose(),this.splitview.dispose();for(const n of t)n.dispose();this.element.remove(),super.dispose()}}class Ig extends ce{get element(){return this._element}constructor(){super(),this._expandedIcon=RT(),this._collapsedIcon=Qy(),this.disposable=new Je,this.apiRef={api:null},this._element=document.createElement("div"),this.element.className="dv-default-header",this._content=document.createElement("span"),this._expander=document.createElement("div"),this._expander.className="dv-pane-header-icon",this.element.appendChild(this._expander),this.element.appendChild(this._content),this.addDisposables(pe(this._element,"click",()=>{var t;(t=this.apiRef.api)===null||t===void 0||t.setExpanded(!this.apiRef.api.isExpanded)}))}init(t){this.apiRef.api=t.api,this._content.textContent=t.title,this.updateIcon(),this.disposable.value=t.api.onDidExpansionChange(()=>{this.updateIcon()})}updateIcon(){var t;const n=!!(!((t=this.apiRef.api)===null||t===void 0)&&t.isExpanded);ne(this._expander,"collapsed",!n),n?(this._expander.contains(this._collapsedIcon)&&this._collapsedIcon.remove(),this._expander.contains(this._expandedIcon)||this._expander.appendChild(this._expandedIcon)):(this._expander.contains(this._expandedIcon)&&this._expandedIcon.remove(),this._expander.contains(this._collapsedIcon)||this._expander.appendChild(this._collapsedIcon))}update(t){}dispose(){this.disposable.dispose(),super.dispose()}}const cM=Sp(),Ng=22,Tg=0,Mg=Number.MAX_SAFE_INTEGER;class Lg extends PT{constructor(t){super({accessor:t.accessor,id:t.id,component:t.component,headerComponent:t.headerComponent,orientation:t.orientation,isExpanded:t.isExpanded,disableDnd:t.disableDnd,headerSize:t.headerSize,minimumBodySize:t.minimumBodySize,maximumBodySize:t.maximumBodySize}),this.options=t}getBodyComponent(){return this.options.body}getHeaderComponent(){return this.options.header}}class dM extends Cp{get id(){return this._id}get panels(){return this.paneview.getPanes()}set paneview(t){this._paneview=t,this._disposable.value=new ce(this._paneview.onDidChange(()=>{this._onDidLayoutChange.fire(void 0)}),this._paneview.onDidAddView(n=>this._onDidAddView.fire(n)),this._paneview.onDidRemoveView(n=>this._onDidRemoveView.fire(n)))}get paneview(){return this._paneview}get minimumSize(){return this.paneview.minimumSize}get maximumSize(){return this.paneview.maximumSize}get height(){return this.paneview.orientation===re.HORIZONTAL?this.paneview.orthogonalSize:this.paneview.size}get width(){return this.paneview.orientation===re.HORIZONTAL?this.paneview.size:this.paneview.orthogonalSize}get options(){return this._options}constructor(t,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._id=cM.next(),this._disposable=new Je,this._viewDisposables=new Map,this._onDidLayoutfromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidLayoutChange=new B,this.onDidLayoutChange=this._onDidLayoutChange.event,this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onDidAddView=new B,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new B,this.onDidRemoveView=this._onDidRemoveView.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.element.style.height="100%",this.element.style.width="100%",this.addDisposables(this._onDidLayoutChange,this._onDidLayoutfromJSON,this._onDidDrop,this._onDidAddView,this._onDidRemoveView,this._onUnhandledDragOverEvent),this._classNames=new cu(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),t.appendChild(this.element),this._options=n,this.paneview=new Sg(this.element,{orientation:re.VERTICAL}),this.addDisposables(this._disposable)}setVisible(t,n){const i=this.panels.indexOf(t);this.paneview.setViewVisible(i,n)}focus(){}updateOptions(t){var n,i;"className"in t&&this._classNames.setClassNames((n=t.className)!==null&&n!==void 0?n:""),"disableResizing"in t&&(this.disableResizing=(i=t.disableAutoResizing)!==null&&i!==void 0?i:!1),this._options=Object.assign(Object.assign({},this.options),t)}addPanel(t){var n,i;const r=this.options.createComponent({id:t.id,name:t.component});let o;t.headerComponent&&this.options.createHeaderComponent&&(o=this.options.createHeaderComponent({id:t.id,name:t.headerComponent})),o||(o=new Ig);const s=new Lg({id:t.id,component:t.component,headerComponent:t.headerComponent,header:o,body:r,orientation:re.VERTICAL,isExpanded:!!t.isExpanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:(n=t.headerSize)!==null&&n!==void 0?n:Ng,minimumBodySize:Tg,maximumBodySize:Mg});this.doAddPanel(s);const a=typeof t.size=="number"?t.size:Wt.Distribute,l=typeof t.index=="number"?t.index:void 0;return s.init({params:(i=t.params)!==null&&i!==void 0?i:{},minimumBodySize:t.minimumBodySize,maximumBodySize:t.maximumBodySize,isExpanded:t.isExpanded,title:t.title,containerApi:new ms(this),accessor:this}),this.paneview.addPane(s,a,l),s.orientation=this.paneview.orientation,s}removePanel(t){const i=this.panels.findIndex(r=>r===t);this.paneview.removePane(i),this.doRemovePanel(t)}movePanel(t,n){this.paneview.moveView(t,n)}getPanel(t){return this.panels.find(n=>n.id===t)}layout(t,n){const[i,r]=this.paneview.orientation===re.HORIZONTAL?[t,n]:[n,t];this.paneview.layout(i,r)}toJSON(){const t=r=>r===Number.MAX_SAFE_INTEGER||r===Number.POSITIVE_INFINITY?void 0:r,n=r=>r<=0?void 0:r;return{views:this.paneview.getPanes().map((r,o)=>({size:this.paneview.getViewSize(o),data:r.toJSON(),minimumSize:n(r.minimumBodySize),maximumSize:t(r.maximumBodySize),headerSize:r.headerSize,expanded:r.isExpanded()})),size:this.paneview.size}}fromJSON(t){this.clear();const{views:n,size:i}=t,r=[],o=this.width,s=this.height;this.paneview=new Sg(this.element,{orientation:re.VERTICAL,descriptor:{size:i,views:n.map(a=>{var l,u,d;const c=a.data,h=this.options.createComponent({id:c.id,name:c.component});let p;c.headerComponent&&this.options.createHeaderComponent&&(p=this.options.createHeaderComponent({id:c.id,name:c.headerComponent})),p||(p=new Ig);const f=new Lg({id:c.id,component:c.component,headerComponent:c.headerComponent,header:p,body:h,orientation:re.VERTICAL,isExpanded:!!a.expanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:(l=a.headerSize)!==null&&l!==void 0?l:Ng,minimumBodySize:(u=a.minimumSize)!==null&&u!==void 0?u:Tg,maximumBodySize:(d=a.maximumSize)!==null&&d!==void 0?d:Mg});return this.doAddPanel(f),r.push(()=>{var v;f.init({params:(v=c.params)!==null&&v!==void 0?v:{},minimumBodySize:a.minimumSize,maximumBodySize:a.maximumSize,title:c.title,isExpanded:!!a.expanded,containerApi:new ms(this),accessor:this}),f.orientation=this.paneview.orientation}),setTimeout(()=>{this._onDidAddView.fire(f)},0),{size:a.size,view:f}})}}),this.layout(o,s),r.forEach(a=>a()),this._onDidLayoutfromJSON.fire()}clear(){for(const[t,n]of this._viewDisposables.entries())n.dispose();this._viewDisposables.clear(),this.paneview.dispose()}doAddPanel(t){const n=new ce(t.onDidDrop(i=>{this._onDidDrop.fire(i)}),t.onUnhandledDragOverEvent(i=>{this._onUnhandledDragOverEvent.fire(i)}));this._viewDisposables.set(t.id,n)}doRemovePanel(t){const n=this._viewDisposables.get(t.id);n&&(n.dispose(),this._viewDisposables.delete(t.id))}dispose(){super.dispose();for(const[t,n]of this._viewDisposables.entries())n.dispose();this._viewDisposables.clear(),this.element.remove(),this.paneview.dispose()}}class hM extends Dp{get priority(){return this._priority}set orientation(t){this._orientation=t}get orientation(){return this._orientation}get minimumSize(){const t=typeof this._minimumSize=="function"?this._minimumSize():this._minimumSize;return t!==this._evaluatedMinimumSize&&(this._evaluatedMinimumSize=t,this.updateConstraints()),t}get maximumSize(){const t=typeof this._maximumSize=="function"?this._maximumSize():this._maximumSize;return t!==this._evaluatedMaximumSize&&(this._evaluatedMaximumSize=t,this.updateConstraints()),t}get snap(){return this._snap}constructor(t,n){super(t,n,new Zy(t,n)),this._evaluatedMinimumSize=0,this._evaluatedMaximumSize=Number.POSITIVE_INFINITY,this._minimumSize=0,this._maximumSize=Number.POSITIVE_INFINITY,this._snap=!1,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.api.initialize(this),this.addDisposables(this._onDidChange,this.api.onWillVisibilityChange(i=>{const{isVisible:r}=i,{accessor:o}=this._params;o.setVisible(this,r)}),this.api.onActiveChange(()=>{const{accessor:i}=this._params;i.setActive(this)}),this.api.onDidConstraintsChangeInternal(i=>{(typeof i.minimumSize=="number"||typeof i.minimumSize=="function")&&(this._minimumSize=i.minimumSize),(typeof i.maximumSize=="number"||typeof i.maximumSize=="function")&&(this._maximumSize=i.maximumSize),this.updateConstraints()}),this.api.onDidSizeChange(i=>{this._onDidChange.fire({size:i.size})}))}setVisible(t){this.api._onDidVisibilityChange.fire({isVisible:t})}setActive(t){this.api._onDidActiveChange.fire({isActive:t})}layout(t,n){const[i,r]=this.orientation===re.HORIZONTAL?[t,n]:[n,t];super.layout(i,r)}init(t){super.init(t),this._priority=t.priority,t.minimumSize&&(this._minimumSize=t.minimumSize),t.maximumSize&&(this._maximumSize=t.maximumSize),t.snap&&(this._snap=t.snap)}toJSON(){const t=i=>i===Number.MAX_SAFE_INTEGER||i===Number.POSITIVE_INFINITY?void 0:i,n=i=>i<=0?void 0:i;return Object.assign(Object.assign({},super.toJSON()),{minimumSize:n(this.minimumSize),maximumSize:t(this.maximumSize)})}updateConstraints(){this.api._onDidConstraintsChange.fire({maximumSize:this._evaluatedMaximumSize,minimumSize:this._evaluatedMinimumSize})}}function pM(e,t){return new aM(e,t).api}function fM(e,t){const n=new uM(e,t);return new Wy(n)}function mM(e,t){const n=new lM(e,t);return new jy(n)}function gM(e,t){const n=new dM(e,t);return new ms(n)}/**
|
|
1410
|
+
}`;WN(jN);class Ry{}class bi extends Ry{constructor(t,n,i){super(),this.viewId=t,this.groupId=n,this.panelId=i}}class Wo extends Ry{constructor(t,n){super(),this.viewId=t,this.paneId=n}}class Dn{constructor(){}static getInstance(){return Dn.INSTANCE}hasData(t){return t&&t===this.proto}clearData(t){this.hasData(t)&&(this.proto=void 0,this.data=void 0)}getData(t){if(this.hasData(t))return this.data}setData(t,n){n&&(this.data=t,this.proto=n)}}Dn.INSTANCE=new Dn;function rt(){const e=Dn.getInstance();if(e.hasData(bi.prototype))return e.getData(bi.prototype)[0]}function ko(){const e=Dn.getInstance();if(e.hasData(Wo.prototype))return e.getData(Wo.prototype)[0]}var Xi;(function(e){e.any=(...t)=>n=>{const i=t.map(r=>r(n));return{dispose:()=>{i.forEach(r=>{r.dispose()})}}}})(Xi||(Xi={}));class kp{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class Vy{constructor(){this._isAccepted=!1}get isAccepted(){return this._isAccepted}accept(){this._isAccepted=!0}}class UN{constructor(){this.events=new Map}get size(){return this.events.size}add(t,n){this.events.set(t,n)}delete(t){this.events.delete(t)}clear(){this.events.clear()}}class _l{static create(){var t;return new _l((t=new Error().stack)!==null&&t!==void 0?t:"")}constructor(t){this.value=t}print(){console.warn("dockview: stacktrace",this.value)}}class YN{constructor(t,n){this.callback=t,this.stacktrace=n}}class B{static setLeakageMonitorEnabled(t){t!==B.ENABLE_TRACKING&&B.MEMORY_LEAK_WATCHER.clear(),B.ENABLE_TRACKING=t}get value(){return this._last}constructor(t){this.options=t,this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>{var n;!((n=this.options)===null||n===void 0)&&n.replay&&this._last!==void 0&&t(this._last);const i=new YN(t,B.ENABLE_TRACKING?_l.create():void 0);return this._listeners.push(i),{dispose:()=>{const r=this._listeners.indexOf(i);r>-1&&this._listeners.splice(r,1)}}},B.ENABLE_TRACKING&&B.MEMORY_LEAK_WATCHER.add(this._event,_l.create())),this._event}fire(t){var n;!((n=this.options)===null||n===void 0)&&n.replay&&(this._last=t);for(const i of this._listeners)i.callback(t)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(B.ENABLE_TRACKING&&queueMicrotask(()=>{var t;for(const n of this._listeners)console.warn("dockview: stacktrace",(t=n.stacktrace)===null||t===void 0?void 0:t.print())}),this._listeners=[]),B.ENABLE_TRACKING&&this._event&&B.MEMORY_LEAK_WATCHER.delete(this._event))}}B.ENABLE_TRACKING=!1;B.MEMORY_LEAK_WATCHER=new UN;function pe(e,t,n,i){return e.addEventListener(t,n,i),{dispose:()=>{e.removeEventListener(t,n,i)}}}class kg{constructor(){this._onFired=new B,this._currentFireCount=0,this._queued=!1,this.onEvent=t=>{const n=this._currentFireCount;return this._onFired.event(()=>{this._currentFireCount>n&&t()})}}fire(){this._currentFireCount++,!this._queued&&(this._queued=!0,queueMicrotask(()=>{this._queued=!1,this._onFired.fire()}))}dispose(){this._onFired.dispose()}}var je;(function(e){e.NONE={dispose:()=>{}};function t(n){return{dispose:()=>{n()}}}e.from=t})(je||(je={}));class ce{get isDisposed(){return this._isDisposed}constructor(...t){this._isDisposed=!1,this._disposables=new Set(t)}addDisposables(...t){t.forEach(n=>this._disposables.add(n))}removeDisposable(t){this._disposables.delete(t)}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposables.forEach(t=>t.dispose()),this._disposables.clear())}}class Je{constructor(){this._disposable=je.NONE}set value(t){this._disposable&&this._disposable.dispose(),this._disposable=t}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=je.NONE)}}class XN extends ce{constructor(t){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._value=null,this.addDisposables(this._onDidChange,uu(t,n=>{const i=n.target.scrollWidth>n.target.clientWidth,r=n.target.scrollHeight>n.target.clientHeight;this._value={hasScrollX:i,hasScrollY:r},this._onDidChange.fire(this._value)}))}}function uu(e,t){const n=new ResizeObserver(i=>{requestAnimationFrame(()=>{const r=i[0];t(r)})});return n.observe(e),{dispose:()=>{n.unobserve(e),n.disconnect()}}}const dn=(e,...t)=>{for(const n of t)e.classList.contains(n)&&e.classList.remove(n)},hn=(e,...t)=>{for(const n of t)e.classList.contains(n)||e.classList.add(n)},ne=(e,t,n)=>{const i=e.classList.contains(t);n&&!i&&e.classList.add(t),!n&&i&&e.classList.remove(t)};function Rd(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Fy(e){return new ZN(e)}class ZN extends ce{constructor(t){super(),this._onDidFocus=new B,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new B,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let n=Rd(document.activeElement,t),i=!1;const r=()=>{i=!1,n||(n=!0,this._onDidFocus.fire())},o=()=>{n&&(i=!0,window.setTimeout(()=>{i&&(i=!1,n=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Rd(document.activeElement,t)!==n&&(n?o():r())},this.addDisposables(pe(t,"focus",r,!0)),this.addDisposables(pe(t,"blur",o,!0))}refreshState(){this._refreshStateHandler()}}const Hy="dv-quasiPreventDefault";function qN(e){e[Hy]=!0}function Sg(e){return e[Hy]}function QN(e,t){const n=Array.from(t);for(const i of n){if(i.href){const o=e.createElement("link");o.href=i.href,o.type=i.type,o.rel="stylesheet",e.head.appendChild(o)}let r=[];try{i.cssRules&&(r=Array.from(i.cssRules).map(o=>o.cssText))}catch{}for(const o of r){const s=e.createElement("style");s.appendChild(e.createTextNode(o)),e.head.appendChild(s)}}}function Vd(e){const{left:t,top:n,width:i,height:r}=e.getBoundingClientRect();return{left:t+window.scrollX,top:n+window.scrollY,width:i,height:r}}function KN(e){let t=e;for(;t!=null&&t.parentNode;){if(t.parentNode===document)return!0;t.parentNode instanceof DocumentFragment?t=t.parentNode.host:t=t.parentNode}return!1}function JN(e,t){e.setAttribute("data-testid",t)}function eT(e){const t=[];function n(i){if(i.nodeType===Node.ELEMENT_NODE){e.includes(i.tagName)&&t.push(i),i.shadowRoot&&n(i.shadowRoot);for(const r of i.children)n(r)}}return n(document.documentElement),t}function kl(e=document){const t=eT(["IFRAME","WEBVIEW"]),n=new WeakMap;for(const i of t)n.set(i,i.style.pointerEvents),i.style.pointerEvents="none";return{release:()=>{var i;for(const r of t)r.style.pointerEvents=(i=n.get(r))!==null&&i!==void 0?i:"auto";t.splice(0,t.length)}}}function tT(e){function t(r){const o=[];for(let s=0;s<r.classList.length;s++)o.push(r.classList.item(s));return o}let n,i=e;for(;i!==null&&(n=t(i).find(r=>r.startsWith("dockview-theme-")),typeof n!="string");)i=i.parentElement;return n}class cu{constructor(t){this.element=t,this._classNames=[]}setClassNames(t){for(const n of this._classNames)ne(this.element,n,!1);this._classNames=t.split(" ").filter(n=>n.trim().length>0);for(const n of this._classNames)ne(this.element,n,!0)}}const Gy=100;function nT(e,t){const n=Vd(e),i=Vd(t);return!(n.left<i.left||n.left+n.width>i.left+i.width||n.top<i.top||n.top+n.height>i.top+i.height)}function iT(e){const t=new B;let n=e.screenX,i=e.screenY,r;const o=()=>{if(e.closed)return;const s=e.screenX,a=e.screenY;(s!==n||a!==i)&&(clearTimeout(r),r=setTimeout(()=>{t.fire()},Gy),n=s,i=a),requestAnimationFrame(o)};return o(),t}function rT(e,t){let n;return new ce(pe(e,"resize",()=>{clearTimeout(n),n=setTimeout(()=>{t()},Gy)}))}function oT(e,t,n={buffer:10}){const i=n.buffer,r=e.getBoundingClientRect(),o=t.getBoundingClientRect();let s=0,a=0;const l=r.left-o.left,u=r.top-o.top,d=r.bottom-o.bottom,c=r.right-o.right;l<i?s=i-l:c>i&&(s=-i-c),u<i?a=i-u:d>i&&(a=-d-i),(s!==0||a!==0)&&(e.style.transform=`translate(${s}px, ${a}px)`)}function sT(e){let t=e;for(;t&&(t.style.zIndex==="auto"||t.style.zIndex==="");)t=t.parentElement;return t}function Vn(e){if(e.length===0)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function By(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function vc(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function ha(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function aT(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(t(i))return n}return-1}function wc(e,t){const n=e.findIndex(i=>i===t);return n>-1?(e.splice(n,1),!0):!1}const Ie=(e,t,n)=>t>n?t:Math.min(n,Math.max(e,t)),Sp=()=>{let e=1;return{next:()=>(e++).toString()}},Qt=(e,t)=>{const n=[];if(typeof t!="number"&&(t=e,e=0),e<=t)for(let i=e;i<t;i++)n.push(i);else for(let i=e;i>t;i--)n.push(i);return n};class lT{set size(t){this._size=t}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(t){this.container.style.pointerEvents=t?"":"none"}constructor(t,n,i,r){this.container=t,this.view=n,this.disposable=r,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,t.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}setVisible(t,n){var i;t!==this.visible&&(t?(this.size=Ie((i=this._cachedVisibleSize)!==null&&i!==void 0?i:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("visible",t),this.view.setVisible&&this.view.setVisible(t))}dispose(){return this.disposable.dispose(),this.view}}var re;(function(e){e.HORIZONTAL="HORIZONTAL",e.VERTICAL="VERTICAL"})(re||(re={}));var Ft;(function(e){e[e.MAXIMUM=0]="MAXIMUM",e[e.MINIMUM=1]="MINIMUM",e[e.DISABLED=2]="DISABLED",e[e.ENABLED=3]="ENABLED"})(Ft||(Ft={}));var qe;(function(e){e.Low="low",e.High="high",e.Normal="normal"})(qe||(qe={}));var Wt;(function(e){e.Distribute={type:"distribute"};function t(i){return{type:"split",index:i}}e.Split=t;function n(i){return{type:"invisible",cachedVisibleSize:i}}e.Invisible=n})(Wt||(Wt={}));class fs{get contentSize(){return this._contentSize}get size(){return this._size}set size(t){this._size=t}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(t){this._orthogonalSize=t}get length(){return this.viewItems.length}get proportions(){return this._proportions?[...this._proportions]:void 0}get orientation(){return this._orientation}set orientation(t){this._orientation=t;const n=this.size;this.size=this.orthogonalSize,this.orthogonalSize=n,dn(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==re.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce((t,n)=>t+n.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((t,n)=>t+n.maximumSize,0)}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}get disabled(){return this._disabled}set disabled(t){this._disabled=t,ne(this.element,"dv-splitview-disabled",t)}get margin(){return this._margin}set margin(t){this._margin=t,ne(this.element,"dv-splitview-has-margin",t!==0)}constructor(t,n){var i,r;this.container=t,this.viewItems=[],this.sashes=[],this._size=0,this._orthogonalSize=0,this._contentSize=0,this._proportions=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this._disabled=!1,this._margin=0,this._onDidSashEnd=new B,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new B,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new B,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(o,s,a=this.viewItems.map(f=>f.size),l,u,d=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h,p)=>{if(o<0||o>this.viewItems.length)return 0;const f=Qt(o,-1),v=Qt(o+1,this.viewItems.length);if(u)for(const P of u)vc(f,P),vc(v,P);if(l)for(const P of l)ha(f,P),ha(v,P);const b=f.map(P=>this.viewItems[P]),m=f.map(P=>a[P]),w=v.map(P=>this.viewItems[P]),g=v.map(P=>a[P]),y=f.reduce((P,A)=>P+this.viewItems[A].minimumSize-a[A],0),k=f.reduce((P,A)=>P+this.viewItems[A].maximumSize-a[A],0),_=v.length===0?Number.POSITIVE_INFINITY:v.reduce((P,A)=>P+a[A]-this.viewItems[A].minimumSize,0),E=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((P,A)=>P+a[A]-this.viewItems[A].maximumSize,0),S=Math.max(y,E),T=Math.min(_,k);let C=!1;if(h){const P=this.viewItems[h.index],A=s>=h.limitDelta;C=A!==P.visible,P.setVisible(A,h.size)}if(!C&&p){const P=this.viewItems[p.index],A=s<p.limitDelta;C=A!==P.visible,P.setVisible(A,p.size)}if(C)return this.resize(o,s,a,l,u,d,c);const I=Ie(s,S,T);let L=0,V=I;for(let P=0;P<b.length;P++){const A=b[P],O=Ie(m[P]+V,A.minimumSize,A.maximumSize),N=O-m[P];L+=N,V-=N,A.size=O}let D=L;for(let P=0;P<w.length;P++){const A=w[P],O=Ie(g[P]-D,A.minimumSize,A.maximumSize),N=O-g[P];D+=N,A.size=O}return s},this._orientation=(i=n.orientation)!==null&&i!==void 0?i:re.VERTICAL,this.element=this.createContainer(),this.margin=(r=n.margin)!==null&&r!==void 0?r:0,this.proportionalLayout=n.proportionalLayout===void 0?!0:!!n.proportionalLayout,this.viewContainer=this.createViewContainer(),this.sashContainer=this.createSashContainer(),this.element.appendChild(this.sashContainer),this.element.appendChild(this.viewContainer),this.container.appendChild(this.element),this.style(n.styles),n.descriptor&&(this._size=n.descriptor.size,n.descriptor.views.forEach((o,s)=>{const a=o.visible===void 0||o.visible?o.size:{type:"invisible",cachedVisibleSize:o.size},l=o.view;this.addView(l,a,s,!0)}),this._contentSize=this.viewItems.reduce((o,s)=>o+s.size,0),this.saveProportions())}style(t){(t==null?void 0:t.separatorBorder)==="transparent"?(dn(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(hn(this.element,"dv-separator-border"),t!=null&&t.separatorBorder&&this.element.style.setProperty("--dv-separator-border",t.separatorBorder))}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const i=this.viewItems[t];i.setVisible(n,i.size),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}resizeView(t,n){if(t<0||t>=this.viewItems.length)return;const i=Qt(this.viewItems.length).filter(a=>a!==t),r=[...i.filter(a=>this.viewItems[a].priority===qe.Low),t],o=i.filter(a=>this.viewItems[a].priority===qe.High),s=this.viewItems[t];n=Math.round(n),n=Ie(n,s.minimumSize,Math.min(s.maximumSize,this._size)),s.size=n,this.relayout(r,o)}getViews(){return this.viewItems.map(t=>t.view)}onDidChange(t,n){const i=this.viewItems.indexOf(t);if(i<0||i>=this.viewItems.length)return;n=typeof n=="number"?n:t.size,n=Ie(n,t.minimumSize,t.maximumSize),t.size=n;const r=Qt(this.viewItems.length).filter(a=>a!==i),o=[...r.filter(a=>this.viewItems[a].priority===qe.Low),i],s=r.filter(a=>this.viewItems[a].priority===qe.High);this.relayout([...o,i],s)}addView(t,n={type:"distribute"},i=this.viewItems.length,r){const o=document.createElement("div");o.className="dv-view",o.appendChild(t.element);let s;typeof n=="number"?s=n:n.type==="split"?s=this.getViewSize(n.index)/2:n.type==="invisible"?s={cachedVisibleSize:n.cachedVisibleSize}:s=t.minimumSize;const a=t.onDidChange(u=>this.onDidChange(l,u.size)),l=new lT(o,t,s,{dispose:()=>{a.dispose(),this.viewContainer.removeChild(o)}});if(i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i)),this.viewItems.splice(i,0,l),this.viewItems.length>1){const u=document.createElement("div");u.className="dv-sash";const d=h=>{for(const P of this.viewItems)P.enabled=!1;const p=kl(),f=this._orientation===re.HORIZONTAL?h.clientX:h.clientY,v=aT(this.sashes,P=>P.container===u),b=this.viewItems.map(P=>P.size);let m,w;const g=Qt(v,-1),y=Qt(v+1,this.viewItems.length),k=g.reduce((P,A)=>P+(this.viewItems[A].minimumSize-b[A]),0),_=g.reduce((P,A)=>P+(this.viewItems[A].viewMaximumSize-b[A]),0),E=y.length===0?Number.POSITIVE_INFINITY:y.reduce((P,A)=>P+(b[A]-this.viewItems[A].minimumSize),0),S=y.length===0?Number.NEGATIVE_INFINITY:y.reduce((P,A)=>P+(b[A]-this.viewItems[A].viewMaximumSize),0),T=Math.max(k,S),C=Math.min(E,_),I=this.findFirstSnapIndex(g),L=this.findFirstSnapIndex(y);if(typeof I=="number"){const P=this.viewItems[I],A=Math.floor(P.viewMinimumSize/2);m={index:I,limitDelta:P.visible?T-A:T+A,size:P.size}}if(typeof L=="number"){const P=this.viewItems[L],A=Math.floor(P.viewMinimumSize/2);w={index:L,limitDelta:P.visible?C+A:C-A,size:P.size}}const V=P=>{const O=(this._orientation===re.HORIZONTAL?P.clientX:P.clientY)-f;this.resize(v,O,b,void 0,void 0,T,C,m,w),this.distributeEmptySpace(),this.layoutViews()},D=()=>{for(const P of this.viewItems)P.enabled=!0;p.release(),this.saveProportions(),document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",D),document.removeEventListener("pointercancel",D),document.removeEventListener("contextmenu",D),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",V),document.addEventListener("pointerup",D),document.addEventListener("pointercancel",D),document.addEventListener("contextmenu",D)};u.addEventListener("pointerdown",d);const c={container:u,disposable:()=>{u.removeEventListener("pointerdown",d),this.sashContainer.removeChild(u)}};this.sashContainer.appendChild(u),this.sashes.push(c)}r||this.relayout([i]),!r&&typeof n!="number"&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidAddView.fire(t)}distributeViewSizes(){const t=[];let n=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(t.push(a),n+=a.size);const i=Math.floor(n/t.length);for(const a of t)a.size=Ie(i,a.minimumSize,a.maximumSize);const r=Qt(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===qe.Low),s=r.filter(a=>this.viewItems[a].priority===qe.High);this.relayout(o,s)}removeView(t,n,i=!1){const r=this.viewItems.splice(t,1)[0];if(r.dispose(),this.viewItems.length>=1){const o=Math.max(t-1,0);this.sashes.splice(o,1)[0].disposable()}return i||this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidRemoveView.fire(r.view),r.view}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}moveView(t,n){const i=this.getViewCachedVisibleSize(t),r=typeof i>"u"?this.getViewSize(t):Wt.Invisible(i),o=this.removeView(t,void 0,!0);this.addView(o,r,n)}layout(t,n){const i=Math.max(this.size,this._contentSize);if(this.size=t,this.orthogonalSize=n,this.proportions){let r=0;for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"?r+=a:t-=s.size}for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"&&r>0&&(s.size=Ie(Math.round(a*t/r),s.minimumSize,s.maximumSize))}}else{const r=Qt(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===qe.Low),s=r.filter(a=>this.viewItems[a].priority===qe.High);this.resize(this.viewItems.length-1,t-i,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}relayout(t,n){const i=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this._size-i,void 0,t,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(t){const n=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-n;const r=Qt(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===qe.Low),s=r.filter(a=>this.viewItems[a].priority===qe.High);for(const a of s)vc(r,a);for(const a of o)ha(r,a);typeof t=="number"&&ha(r,t);for(let a=0;i!==0&&a<r.length;a++){const l=this.viewItems[r[a]],u=Ie(l.size+i,l.minimumSize,l.maximumSize),d=u-l.size;i-=d,l.size=u}}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this._proportions=this.viewItems.map(t=>t.visible?t.size/this._contentSize:void 0))}layoutViews(){if(this._contentSize=this.viewItems.reduce((l,u)=>l+u.size,0),this.updateSashEnablement(),this.viewItems.length===0)return;const t=this.viewItems.filter(l=>l.visible),n=Math.max(0,t.length-1),i=this.margin*n/Math.max(1,t.length);let r=0;const o=[],s=4,a=this.viewItems.reduce((l,u,d)=>{const c=u.visible?1:0;return d===0?l.push(c):l.push(l[d-1]+c),l},[]);this.viewItems.forEach((l,u)=>{r+=this.viewItems[u].size,o.push(r);const d=l.visible?l.size-i:0,c=Math.max(0,a[u]-1),h=u===0||c===0?0:o[u-1]+c/n*i;if(u<this.viewItems.length-1){const p=l.visible?h+d-s/2+this.margin/2:h;this._orientation===re.HORIZONTAL&&(this.sashes[u].container.style.left=`${p}px`,this.sashes[u].container.style.top="0px"),this._orientation===re.VERTICAL&&(this.sashes[u].container.style.left="0px",this.sashes[u].container.style.top=`${p}px`)}this._orientation===re.HORIZONTAL&&(l.container.style.width=`${d}px`,l.container.style.left=`${h}px`,l.container.style.top="",l.container.style.height=""),this._orientation===re.VERTICAL&&(l.container.style.height=`${d}px`,l.container.style.top=`${h}px`,l.container.style.width="",l.container.style.left=""),l.view.layout(l.size-i,this._orthogonalSize)})}findFirstSnapIndex(t){for(const n of t){const i=this.viewItems[n];if(i.visible&&i.snap)return n}for(const n of t){const i=this.viewItems[n];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return n}}updateSashEnablement(){let t=!1;const n=this.viewItems.map(l=>t=l.size-l.minimumSize>0||t);t=!1;const i=this.viewItems.map(l=>t=l.maximumSize-l.size>0||t),r=[...this.viewItems].reverse();t=!1;const o=r.map(l=>t=l.size-l.minimumSize>0||t).reverse();t=!1;const s=r.map(l=>t=l.maximumSize-l.size>0||t).reverse();let a=0;for(let l=0;l<this.sashes.length;l++){const u=this.sashes[l],d=this.viewItems[l];a+=d.size;const c=!(n[l]&&s[l+1]),h=!(i[l]&&o[l+1]);if(c&&h){const p=Qt(l,-1),f=Qt(l+1,this.viewItems.length),v=this.findFirstSnapIndex(p),b=this.findFirstSnapIndex(f),m=typeof v=="number"&&!this.viewItems[v].visible,w=typeof b=="number"&&!this.viewItems[b].visible;m&&o[l]&&(a>0||this.startSnappingEnabled)?this.updateSash(u,Ft.MINIMUM):w&&n[l]&&(a<this._contentSize||this.endSnappingEnabled)?this.updateSash(u,Ft.MAXIMUM):this.updateSash(u,Ft.DISABLED)}else c&&!h?this.updateSash(u,Ft.MINIMUM):!c&&h?this.updateSash(u,Ft.MAXIMUM):this.updateSash(u,Ft.ENABLED)}}updateSash(t,n){ne(t.container,"dv-disabled",n===Ft.DISABLED),ne(t.container,"dv-enabled",n===Ft.ENABLED),ne(t.container,"dv-maximum",n===Ft.MAXIMUM),ne(t.container,"dv-minimum",n===Ft.MINIMUM)}createViewContainer(){const t=document.createElement("div");return t.className="dv-view-container",t}createSashContainer(){const t=document.createElement("div");return t.className="dv-sash-container",t}createContainer(){const t=document.createElement("div"),n=this._orientation===re.HORIZONTAL?"dv-horizontal":"dv-vertical";return t.className=`dv-split-view-container ${n}`,t}dispose(){this._onDidSashEnd.dispose(),this._onDidAddView.dispose(),this._onDidRemoveView.dispose();for(let t=0;t<this.element.children.length;t++)if(this.element.children.item(t)===this.element){this.element.removeChild(this.element);break}for(const t of this.viewItems)t.dispose();this.element.remove()}}const Fd=Object.keys({orientation:void 0,descriptor:void 0,proportionalLayout:void 0,styles:void 0,margin:void 0,disableAutoResizing:void 0,className:void 0});class Cg extends ce{get onDidAddView(){return this.splitview.onDidAddView}get onDidRemoveView(){return this.splitview.onDidRemoveView}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get orientation(){return this.splitview.orientation}get size(){return this.splitview.size}get orthogonalSize(){return this.splitview.orthogonalSize}constructor(t,n){var i;super(),this.paneItems=[],this.skipAnimation=!1,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._orientation=(i=n.orientation)!==null&&i!==void 0?i:re.VERTICAL,this.element=document.createElement("div"),this.element.className="dv-pane-container",t.appendChild(this.element),this.splitview=new fs(this.element,{orientation:this._orientation,proportionalLayout:!1,descriptor:n.descriptor}),this.getPanes().forEach(r=>{const o=new ce(r.onDidChangeExpansionState(()=>{this.setupAnimation(),this._onDidChange.fire(void 0)})),s={pane:r,disposable:{dispose:()=>{o.dispose()}}};this.paneItems.push(s),r.orthogonalSize=this.splitview.orthogonalSize}),this.addDisposables(this._onDidChange,this.splitview.onDidSashEnd(()=>{this._onDidChange.fire(void 0)}),this.splitview.onDidAddView(()=>{this._onDidChange.fire()}),this.splitview.onDidRemoveView(()=>{this._onDidChange.fire()}))}setViewVisible(t,n){this.splitview.setViewVisible(t,n)}addPane(t,n,i=this.splitview.length,r=!1){const o=t.onDidChangeExpansionState(()=>{this.setupAnimation(),this._onDidChange.fire(void 0)}),s={pane:t,disposable:{dispose:()=>{o.dispose()}}};this.paneItems.splice(i,0,s),t.orthogonalSize=this.splitview.orthogonalSize,this.splitview.addView(t,n,i,r)}getViewSize(t){return this.splitview.getViewSize(t)}getPanes(){return this.splitview.getViews()}removePane(t,n={skipDispose:!1}){const i=this.paneItems.splice(t,1)[0];return this.splitview.removeView(t),n.skipDispose||(i.disposable.dispose(),i.pane.dispose()),i}moveView(t,n){if(t===n)return;const i=this.removePane(t,{skipDispose:!0});this.skipAnimation=!0;try{this.addPane(i.pane,i.pane.size,n,!1)}finally{this.skipAnimation=!1}}layout(t,n){this.splitview.layout(t,n)}setupAnimation(){this.skipAnimation||(this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),hn(this.element,"dv-animated"),this.animationTimer=setTimeout(()=>{this.animationTimer=void 0,dn(this.element,"dv-animated")},200))}dispose(){super.dispose(),this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),this.paneItems.forEach(t=>{t.disposable.dispose(),t.pane.dispose()}),this.paneItems=[],this.splitview.dispose(),this.element.remove()}}class et{get minimumWidth(){return this.view.minimumWidth}get maximumWidth(){return this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get priority(){return this.view.priority}get snap(){return this.view.snap}get minimumSize(){return this.orientation===re.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===re.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===re.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===re.HORIZONTAL?this.maximumWidth:this.maximumHeight}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get element(){return this.view.element}get width(){return this.orientation===re.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===re.HORIZONTAL?this.size:this.orthogonalSize}constructor(t,n,i,r=0){this.view=t,this.orientation=n,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._orthogonalSize=i,this._size=r,this._disposable=this.view.onDidChange(o=>{o?this._onDidChange.fire({size:this.orientation===re.VERTICAL?o.width:o.height,orthogonalSize:this.orientation===re.VERTICAL?o.height:o.width}):this._onDidChange.fire({})})}setVisible(t){this.view.setVisible&&this.view.setVisible(t)}layout(t,n){this._size=t,this._orthogonalSize=n,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class He extends ce{get width(){return this.orientation===re.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===re.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return this.children.length===0?0:Math.max(...this.children.map((t,n)=>this.splitview.isViewVisible(n)?t.minimumOrthogonalSize:0))}get maximumSize(){return Math.min(...this.children.map((t,n)=>this.splitview.isViewVisible(n)?t.maximumOrthogonalSize:Number.POSITIVE_INFINITY))}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get minimumWidth(){return this.orientation===re.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===re.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===re.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===re.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(this.children.length===0)return qe.Normal;const t=this.children.map(n=>typeof n.priority>"u"?qe.Normal:n.priority);return t.some(n=>n===qe.High)?qe.High:t.some(n=>n===qe.Low)?qe.Low:qe.Normal}get disabled(){return this.splitview.disabled}set disabled(t){this.splitview.disabled=t}get margin(){return this.splitview.margin}set margin(t){this.splitview.margin=t,this.children.forEach(n=>{n instanceof He&&(n.margin=t)})}constructor(t,n,i,r,o,s,a,l){if(super(),this.orientation=t,this.proportionalLayout=n,this.styles=i,this._childrenDisposable=je.NONE,this.children=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new B,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=o,this._size=r,this.element=document.createElement("div"),this.element.className="dv-branch-node",!l)this.splitview=new fs(this.element,{orientation:this.orientation,proportionalLayout:n,styles:i,margin:a}),this.splitview.layout(this.size,this.orthogonalSize);else{const u={views:l.map(d=>({view:d.node,size:d.node.size,visible:d.node instanceof et&&d.visible!==void 0?d.visible:!0})),size:this.orthogonalSize};this.children=l.map(d=>d.node),this.splitview=new fs(this.element,{orientation:this.orientation,descriptor:u,proportionalLayout:n,styles:i,margin:a})}this.disabled=s,this.addDisposables(this._onDidChange,this._onDidVisibilityChange,this.splitview.onDidSashEnd(()=>{this._onDidChange.fire({})})),this.setupChildrenEvents()}setVisible(t){}isChildVisible(t){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.isViewVisible(t)}setChildVisible(t,n){if(t<0||t>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(t)===n)return;const i=this.splitview.contentSize===0;this.splitview.setViewVisible(t,n);const r=this.splitview.contentSize===0;(n&&i||!n&&r)&&this._onDidVisibilityChange.fire({visible:n})}moveChild(t,n){if(t===n)return;if(t<0||t>=this.children.length)throw new Error("Invalid from index");t<n&&n--,this.splitview.moveView(t,n);const i=this._removeChild(t);this._addChild(i,n)}getChildSize(t){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(t)}resizeChild(t,n){if(t<0||t>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(t,n)}layout(t,n){this._size=n,this._orthogonalSize=t,this.splitview.layout(n,t)}addChild(t,n,i,r){if(i<0||i>this.children.length)throw new Error("Invalid index");this.splitview.addView(t,n,i,r),this._addChild(t,i)}getChildCachedVisibleSize(t){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(t)}removeChild(t,n){if(t<0||t>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(t,n),this._removeChild(t)}_addChild(t,n){this.children.splice(n,0,t),this.setupChildrenEvents()}_removeChild(t){const[n]=this.children.splice(t,1);return this.setupChildrenEvents(),n}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new ce(Xi.any(...this.children.map(t=>t.onDidChange))(t=>{this._onDidChange.fire({size:t.orthogonalSize})}),...this.children.map((t,n)=>t instanceof He?t.onDidVisibilityChange(({visible:i})=>{this.setChildVisible(n,i)}):je.NONE))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach(t=>t.dispose()),super.dispose()}}function Hd(e,t){if(e instanceof et)return e;if(e instanceof He)return Hd(e.children[t?e.children.length-1:0],t);throw new Error("invalid node")}function $y(e,t,n){if(e instanceof He){const i=new He(e.orientation,e.proportionalLayout,e.styles,t,n,e.disabled,e.margin);for(let r=e.children.length-1;r>=0;r--){const o=e.children[r];i.addChild($y(o,o.size,o.orthogonalSize),o.size,0,!0)}return i}else return new et(e.view,e.orientation,n)}function Gd(e,t,n){if(e instanceof He){const i=new He(kn(e.orientation),e.proportionalLayout,e.styles,t,n,e.disabled,e.margin);let r=0;for(let o=e.children.length-1;o>=0;o--){const s=e.children[o],a=s instanceof He?s.orthogonalSize:s.size;let l=e.size===0?0:Math.round(t*a/e.size);r+=l,o===0&&(l+=t-r),i.addChild(Gd(s,n,l),l,0,!0)}return i}else return new et(e.view,kn(e.orientation),n)}function uT(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");let n=t.firstElementChild,i=0;for(;n!==e&&n!==t.lastElementChild&&n;)n=n.nextElementSibling,i++;return i}function Oe(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(t.className))return[];const n=uT(t),i=t.parentElement.parentElement.parentElement;return[...Oe(i),n]}function bn(e,t,n){const i=dT(e,t),r=cT(n);if(i===r){const[o,s]=Vn(t);let a=s;return(n==="right"||n==="bottom")&&(a+=1),[...o,a]}else{const o=n==="right"||n==="bottom"?1:0;return[...t,o]}}function cT(e){return e==="top"||e==="bottom"?re.VERTICAL:re.HORIZONTAL}function dT(e,t){return t.length%2===0?kn(e):e}const kn=e=>e===re.HORIZONTAL?re.VERTICAL:re.HORIZONTAL;function hT(e){return!!e.children}const Bd=(e,t)=>{const n=t===re.VERTICAL?e.box.width:e.box.height;return hT(e)?{type:"branch",data:e.children.map(i=>Bd(i,kn(t))),size:n}:typeof e.cachedVisibleSize=="number"?{type:"leaf",data:e.view.toJSON(),size:e.cachedVisibleSize,visible:!1}:{type:"leaf",data:e.view.toJSON(),size:n}};class pT{get length(){return this._root?this._root.children.length:0}get orientation(){return this.root.orientation}set orientation(t){if(this.root.orientation===t)return;const{size:n,orthogonalSize:i}=this.root;this.root=Gd(this.root,i,n),this.root.layout(n,i)}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get locked(){return this._locked}set locked(t){this._locked=t;const n=[this.root];for(;n.length>0;){const i=n.pop();i instanceof He&&(i.disabled=t,n.push(...i.children))}}get margin(){return this._margin}set margin(t){this._margin=t,this.root.margin=t}maximizedView(){var t;return(t=this._maximizedNode)===null||t===void 0?void 0:t.leaf.view}hasMaximizedView(){return this._maximizedNode!==void 0}maximizeView(t){var n;const i=Oe(t.element),[r,o]=this.getNode(i);if(!(o instanceof et)||((n=this._maximizedNode)===null||n===void 0?void 0:n.leaf)===o)return;this.hasMaximizedView()&&this.exitMaximizedView(),Bd(this.getView(),this.orientation);const s=[];function a(l,u){for(let d=0;d<l.children.length;d++){const c=l.children[d];c instanceof et?c!==u&&(l.isChildVisible(d)?l.setChildVisible(d,!1):s.push(c)):a(c,u)}}a(this.root,o),this._maximizedNode={leaf:o,hiddenOnMaximize:s},this._onDidMaximizedNodeChange.fire({view:o.view,isMaximized:!0})}exitMaximizedView(){if(!this._maximizedNode)return;const t=this._maximizedNode.hiddenOnMaximize;function n(r){for(let o=r.children.length-1;o>=0;o--){const s=r.children[o];s instanceof et?t.includes(s)||r.setChildVisible(o,!0):n(s)}}n(this.root);const i=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:i.view,isMaximized:!1})}serialize(){const t=this.maximizedView();let n;t&&(n=Oe(t.element)),this.hasMaximizedView()&&this.exitMaximizedView();const r={root:Bd(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return n&&(r.maximizedNode={location:n}),t&&this.maximizeView(t),r}dispose(){this.disposable.dispose(),this._onDidChange.dispose(),this._onDidMaximizedNodeChange.dispose(),this._onDidViewVisibilityChange.dispose(),this.root.dispose(),this._maximizedNode=void 0,this.element.remove()}clear(){const t=this.root.orientation;this.root=new He(t,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(t,n){const i=t.orientation,r=i===re.VERTICAL?t.height:t.width;if(this._deserialize(t.root,i,n,r),this.layout(t.width,t.height),t.maximizedNode){const o=t.maximizedNode.location,[s,a]=this.getNode(o);if(!(a instanceof et))return;this.maximizeView(a.view)}}_deserialize(t,n,i,r){this.root=this._deserializeNode(t,n,i,r)}_deserializeNode(t,n,i,r){var o;let s;if(t.type==="branch"){const l=t.data.map(u=>({node:this._deserializeNode(u,kn(n),i,t.size),visible:u.visible}));s=new He(n,this.proportionalLayout,this.styles,t.size,r,this.locked,this.margin,l)}else{const a=i.fromJSON(t);typeof t.visible=="boolean"&&((o=a.setVisible)===null||o===void 0||o.call(a,t.visible)),s=new et(a,n,r,t.size)}return s}get root(){return this._root}set root(t){const n=this._root;n&&(n.dispose(),this._maximizedNode=void 0,this.element.removeChild(n.element)),this._root=t,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(i=>{this._onDidChange.fire(i)})}normalize(){if(!this._root||this._root.children.length!==1)return;const t=this.root,n=t.children[0];if(n instanceof et)return;t.element.remove();const i=t.removeChild(0);t.dispose(),i.dispose(),this._root=$y(n,n.size,n.orthogonalSize),this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(r=>{this._onDidChange.fire(r)})}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const t=this.root;if(t.element.remove(),this._root=new He(kn(t.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),t.children.length!==0)if(t.children.length===1){const n=t.children[0];t.removeChild(0).dispose(),t.dispose(),this._root.addChild(Gd(n,n.orthogonalSize,n.size),Wt.Distribute,0)}else this._root.addChild(t,Wt.Distribute,0);this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(n=>{this._onDidChange.fire(n)})}next(t){return this.progmaticSelect(t)}previous(t){return this.progmaticSelect(t,!0)}getView(t){const n=t?this.getNode(t)[1]:this.root;return this._getViews(n,this.orientation)}_getViews(t,n,i){const r={height:t.height,width:t.width};if(t instanceof et)return{box:r,view:t.view,cachedVisibleSize:i};const o=[];for(let s=0;s<t.children.length;s++){const a=t.children[s],l=t.getChildCachedVisibleSize(s);o.push(this._getViews(a,kn(n),l))}return{box:r,children:o}}progmaticSelect(t,n=!1){const[i,r]=this.getNode(t);if(!(r instanceof et))throw new Error("invalid location");for(let o=i.length-1;o>-1;o--){const s=i[o],a=t[o]||0;if(n?a-1>-1:a+1<s.children.length)return Hd(s.children[n?a-1:a+1],n)}return Hd(this.root,n)}constructor(t,n,i,r,o){this.proportionalLayout=t,this.styles=n,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new Je,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new B,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new B,this.onDidMaximizedNodeChange=this._onDidMaximizedNodeChange.event,this.element=document.createElement("div"),this.element.className="dv-grid-view",this._locked=r??!1,this._margin=o??0,this.root=new He(i,t,n,0,0,this.locked,this.margin)}isViewVisible(t){const[n,i]=Vn(t),[,r]=this.getNode(n);if(!(r instanceof He))throw new Error("Invalid from location");return r.isChildVisible(i)}setViewVisible(t,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=Vn(t),[,o]=this.getNode(i);if(!(o instanceof He))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),o.setChildVisible(r,n)}moveView(t,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,r]=this.getNode(t);if(!(r instanceof He))throw new Error("Invalid location");r.moveChild(n,i)}addView(t,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[r,o]=Vn(i),[s,a]=this.getNode(r);if(a instanceof He){const l=new et(t,kn(a.orientation),a.orthogonalSize);a.addChild(l,n,o)}else{const[l,...u]=[...s].reverse(),[d,...c]=[...r].reverse();let h=0;const p=l.getChildCachedVisibleSize(d);typeof p=="number"&&(h=Wt.Invisible(p)),l.removeChild(d).dispose();const v=new He(a.orientation,this.proportionalLayout,this.styles,a.size,a.orthogonalSize,this.locked,this.margin);l.addChild(v,a.size,d);const b=new et(a.view,l.orientation,a.size);v.addChild(b,h,0),typeof n!="number"&&n.type==="split"&&(n={type:"split",index:0});const m=new et(t,l.orientation,a.size);v.addChild(m,n,o)}}remove(t,n){const i=Oe(t.element);return this.removeView(i,n)}removeView(t,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=Vn(t),[o,s]=this.getNode(i);if(!(s instanceof He))throw new Error("Invalid location");const a=s.children[r];if(!(a instanceof et))throw new Error("Invalid location");if(s.removeChild(r,n),a.dispose(),s.children.length!==1)return a.view;const l=s.children[0];if(o.length===0)return l instanceof et||(s.removeChild(0,n),this.root=l),a.view;const[u,...d]=[...o].reverse(),[c,...h]=[...i].reverse(),p=s.isChildVisible(0);s.removeChild(0,n);const f=u.children.map((v,b)=>u.getChildSize(b));if(u.removeChild(c,n).dispose(),l instanceof He){f.splice(c,1,...l.children.map(v=>v.size));for(let v=0;v<l.children.length;v++){const b=l.children[v];u.addChild(b,b.size,c+v)}for(;l.children.length>0;)l.removeChild(0)}else{const v=new et(l.view,kn(l.orientation),l.size),b=p?l.orthogonalSize:Wt.Invisible(l.orthogonalSize);u.addChild(v,b,c)}l.dispose();for(let v=0;v<f.length;v++)u.resizeChild(v,f[v]);return a.view}layout(t,n){const[i,r]=this.root.orientation===re.HORIZONTAL?[n,t]:[t,n];this.root.layout(i,r)}getNode(t,n=this.root,i=[]){if(t.length===0)return[i,n];if(!(n instanceof He))throw new Error("Invalid location");const[r,...o]=t;if(r<0||r>=n.children.length)throw new Error("Invalid location");const s=n.children[r];return i.push(n),this.getNode(o,s,i)}}const $d=Object.keys({disableAutoResizing:void 0,proportionalLayout:void 0,orientation:void 0,hideBorders:void 0,className:void 0});class Cp extends ce{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(t){this._disableResizing=t}constructor(t,n=!1){super(),this._disableResizing=n,this._element=t,this.addDisposables(uu(this._element,i=>{if(this.isDisposed||this.disableResizing||!this._element.offsetParent||!KN(this._element))return;const{width:r,height:o}=i.contentRect;this.layout(r,o)}))}}const fT=Sp();function Sl(e){switch(e){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";case"within":default:return"center"}}class Wy extends Cp{get id(){return this._id}get size(){return this._groups.size}get groups(){return Array.from(this._groups.values()).map(t=>t.value)}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumHeight(){return this.gridview.minimumHeight}get maximumHeight(){return this.gridview.maximumHeight}get minimumWidth(){return this.gridview.minimumWidth}get maximumWidth(){return this.gridview.maximumWidth}get activeGroup(){return this._activeGroup}get locked(){return this.gridview.locked}set locked(t){this.gridview.locked=t}constructor(t,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._id=fT.next(),this._groups=new Map,this._onDidRemove=new B,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new B,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new B,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new B,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new kg,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new kg,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new cu(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),t.appendChild(this.element),this.gridview=new pT(!!n.proportionalLayout,n.styles,n.orientation,n.locked,n.margin),this.gridview.locked=!!n.locked,this.element.appendChild(this.gridview.element),this.layout(0,0,!0),this.addDisposables(this.gridview.onDidMaximizedNodeChange(r=>{this._onDidMaximizedChange.fire({panel:r.view,isMaximized:r.isMaximized})}),this.gridview.onDidViewVisibilityChange(()=>this._onDidViewVisibilityChangeMicroTaskQueue.fire()),this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.layout(this.width,this.height,!0)}),je.from(()=>{var r;(r=this.element.parentElement)===null||r===void 0||r.removeChild(this.element)}),this.gridview.onDidChange(()=>{this._bufferOnDidLayoutChange.fire()}),Xi.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)(()=>{this._bufferOnDidLayoutChange.fire()}),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(t,n){this.gridview.setViewVisible(Oe(t.element),n),this._bufferOnDidLayoutChange.fire()}isVisible(t){return this.gridview.isViewVisible(Oe(t.element))}updateOptions(t){var n,i,r,o;t.proportionalLayout,t.orientation&&(this.gridview.orientation=t.orientation),"disableResizing"in t&&(this.disableResizing=(n=t.disableAutoResizing)!==null&&n!==void 0?n:!1),"locked"in t&&(this.locked=(i=t.locked)!==null&&i!==void 0?i:!1),"margin"in t&&(this.gridview.margin=(r=t.margin)!==null&&r!==void 0?r:0),"className"in t&&this._classNames.setClassNames((o=t.className)!==null&&o!==void 0?o:"")}maximizeGroup(t){this.gridview.maximizeView(t),this.doSetGroupActive(t)}isMaximizedGroup(t){return this.gridview.maximizedView()===t}exitMaximizedGroup(){this.gridview.exitMaximizedView()}hasMaximizedGroup(){return this.gridview.hasMaximizedView()}doAddGroup(t,n=[0],i){this.gridview.addView(t,i??Wt.Distribute,n),this._onDidAdd.fire(t)}doRemoveGroup(t,n){if(!this._groups.has(t.id))throw new Error("invalid operation");const i=this._groups.get(t.id),r=this.gridview.remove(t,Wt.Distribute);if(i&&!(n!=null&&n.skipDispose)&&(i.disposable.dispose(),i.value.dispose(),this._groups.delete(t.id),this._onDidRemove.fire(t)),!(n!=null&&n.skipActive)&&this._activeGroup===t){const o=Array.from(this._groups.values());this.doSetGroupActive(o.length>0?o[0].value:void 0)}return r}getPanel(t){var n;return(n=this._groups.get(t))===null||n===void 0?void 0:n.value}doSetGroupActive(t){this._activeGroup!==t&&(this._activeGroup&&this._activeGroup.setActive(!1),t&&t.setActive(!0),this._activeGroup=t,this._onDidActiveChange.fire(t))}removeGroup(t){this.doRemoveGroup(t)}moveToNext(t){var n;if(t||(t={}),!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}const i=Oe(t.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}moveToPrevious(t){var n;if(t||(t={}),!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}const i=Oe(t.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}layout(t,n,i){(i||t!==this.width||n!==this.height)&&(this.gridview.element.style.height=`${n}px`,this.gridview.element.style.width=`${t}px`,this.gridview.layout(t,n))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const t of this.groups)t.dispose();this.gridview.dispose(),super.dispose()}}class jy{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get length(){return this.component.length}get orientation(){return this.component.orientation}get panels(){return this.component.panels}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}constructor(t){this.component=t}removePanel(t,n){this.component.removePanel(t,n)}focus(){this.component.focus()}getPanel(t){return this.component.getPanel(t)}layout(t,n){return this.component.layout(t,n)}addPanel(t){return this.component.addPanel(t)}movePanel(t,n){this.component.movePanel(t,n)}fromJSON(t){this.component.fromJSON(t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class ms{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get panels(){return this.component.panels}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}get onDidDrop(){return this.component.onDidDrop}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}constructor(t){this.component=t}removePanel(t){this.component.removePanel(t)}getPanel(t){return this.component.getPanel(t)}movePanel(t,n){this.component.movePanel(t,n)}focus(){this.component.focus()}layout(t,n){this.component.layout(t,n)}addPanel(t){return this.component.addPanel(t)}fromJSON(t){this.component.fromJSON(t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class Uy{get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddPanel(){return this.component.onDidAddGroup}get onDidRemovePanel(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActiveGroupChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get panels(){return this.component.groups}get orientation(){return this.component.orientation}set orientation(t){this.component.updateOptions({orientation:t})}constructor(t){this.component=t}focus(){this.component.focus()}layout(t,n,i=!1){this.component.layout(t,n,i)}addPanel(t){return this.component.addPanel(t)}removePanel(t,n){this.component.removePanel(t,n)}movePanel(t,n){this.component.movePanel(t,n)}getPanel(t){return this.component.getPanel(t)}fromJSON(t){return this.component.fromJSON(t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class Cl{get id(){return this.component.id}get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get size(){return this.component.size}get totalPanels(){return this.component.totalPanels}get onDidActiveGroupChange(){return this.component.onDidActiveGroupChange}get onDidAddGroup(){return this.component.onDidAddGroup}get onDidRemoveGroup(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActivePanelChange}get onDidAddPanel(){return this.component.onDidAddPanel}get onDidRemovePanel(){return this.component.onDidRemovePanel}get onDidMovePanel(){return this.component.onDidMovePanel}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidDrop(){return this.component.onDidDrop}get onWillDrop(){return this.component.onWillDrop}get onWillShowOverlay(){return this.component.onWillShowOverlay}get onWillDragGroup(){return this.component.onWillDragGroup}get onWillDragPanel(){return this.component.onWillDragPanel}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}get onDidPopoutGroupSizeChange(){return this.component.onDidPopoutGroupSizeChange}get onDidPopoutGroupPositionChange(){return this.component.onDidPopoutGroupPositionChange}get onDidOpenPopoutWindowFail(){return this.component.onDidOpenPopoutWindowFail}get panels(){return this.component.panels}get groups(){return this.component.groups}get activePanel(){return this.component.activePanel}get activeGroup(){return this.component.activeGroup}constructor(t){this.component=t}focus(){this.component.focus()}getPanel(t){return this.component.getGroupPanel(t)}layout(t,n,i=!1){this.component.layout(t,n,i)}addPanel(t){return this.component.addPanel(t)}removePanel(t){this.component.removePanel(t)}addGroup(t){return this.component.addGroup(t)}closeAllGroups(){return this.component.closeAllGroups()}removeGroup(t){this.component.removeGroup(t)}getGroup(t){return this.component.getPanel(t)}addFloatingGroup(t,n){return this.component.addFloatingGroup(t,n)}fromJSON(t,n){this.component.fromJSON(t,n)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}moveToNext(t){this.component.moveToNext(t)}moveToPrevious(t){this.component.moveToPrevious(t)}maximizeGroup(t){this.component.maximizeGroup(t.group)}hasMaximizedGroup(){return this.component.hasMaximizedGroup()}exitMaximizedGroup(){this.component.exitMaximizedGroup()}get onDidMaximizedGroupChange(){return this.component.onDidMaximizedGroupChange}addPopoutGroup(t,n){return this.component.addPopoutGroup(t,n)}updateOptions(t){this.component.updateOptions(t)}dispose(){this.component.dispose()}}class Ep extends ce{constructor(t,n){super(),this.el=t,this.disabled=n,this.dataDisposable=new Je,this.pointerEventsDisposable=new Je,this._onDragStart=new B,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}setDisabled(t){this.disabled=t}isCancelled(t){return!1}configure(){this.addDisposables(this._onDragStart,pe(this.el,"dragstart",t=>{if(t.defaultPrevented||this.isCancelled(t)||this.disabled){t.preventDefault();return}const n=kl();this.pointerEventsDisposable.value={dispose:()=>{n.release()}},this.el.classList.add("dv-dragged"),setTimeout(()=>this.el.classList.remove("dv-dragged"),0),this.dataDisposable.value=this.getData(t),this._onDragStart.fire(t),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.items.length>0||t.dataTransfer.setData("text/plain",""))}),pe(this.el,"dragend",()=>{this.pointerEventsDisposable.dispose(),setTimeout(()=>{this.dataDisposable.dispose()},0)}))}}class Yy extends ce{constructor(t,n){super(),this.element=t,this.callbacks=n,this.target=null,this.registerListeners()}onDragEnter(t){this.target=t.target,this.callbacks.onDragEnter(t)}onDragOver(t){t.preventDefault(),this.callbacks.onDragOver&&this.callbacks.onDragOver(t)}onDragLeave(t){this.target===t.target&&(this.target=null,this.callbacks.onDragLeave(t))}onDragEnd(t){this.target=null,this.callbacks.onDragEnd(t)}onDrop(t){this.callbacks.onDrop(t)}registerListeners(){this.addDisposables(pe(this.element,"dragenter",t=>{this.onDragEnter(t)},!0)),this.addDisposables(pe(this.element,"dragover",t=>{this.onDragOver(t)},!0)),this.addDisposables(pe(this.element,"dragleave",t=>{this.onDragLeave(t)})),this.addDisposables(pe(this.element,"dragend",t=>{this.onDragEnd(t)})),this.addDisposables(pe(this.element,"drop",t=>{this.onDrop(t)}))}}function mT(e,t){const{top:n,left:i,width:r,height:o}=t,s=`${Math.round(n)}px`,a=`${Math.round(i)}px`,l=`${Math.round(r)}px`,u=`${Math.round(o)}px`;e.style.top=s,e.style.left=a,e.style.width=l,e.style.height=u,e.style.visibility="visible",(!e.style.transform||e.style.transform==="")&&(e.style.transform="translate3d(0, 0, 0)")}function gT(e,t){const{top:n,left:i,width:r,height:o}=t;e.style.top=n,e.style.left=i,e.style.width=r,e.style.height=o,e.style.visibility="visible",(!e.style.transform||e.style.transform==="")&&(e.style.transform="translate3d(0, 0, 0)")}function vT(e,t){const{top:n,left:i,width:r,height:o}=t,s=`${Math.round(n)}px`,a=`${Math.round(i)}px`,l=`${Math.round(r)}px`,u=`${Math.round(o)}px`;return e.style.top!==s||e.style.left!==a||e.style.width!==l||e.style.height!==u}class wT extends kp{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(t){super(),this.options=t}}function Eg(e){switch(e){case"above":return"top";case"below":return"bottom";case"left":return"left";case"right":return"right";case"within":return"center";default:throw new Error(`invalid direction '${e}'`)}}function bT(e){switch(e){case"top":return"above";case"bottom":return"below";case"left":return"left";case"right":return"right";case"center":return"within";default:throw new Error(`invalid position '${e}'`)}}const yT={value:20,type:"percentage"},xT={value:50,type:"percentage"},_T=100,kT=100;class rn extends ce{get disabled(){return this._disabled}set disabled(t){this._disabled=t}get state(){return this._state}constructor(t,n){super(),this.element=t,this.options=n,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._disabled=!1,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new Yy(this.element,{onDragEnter:()=>{var i,r,o;(o=(r=(i=this.options).getOverrideTarget)===null||r===void 0?void 0:r.call(i))===null||o===void 0||o.getElements()},onDragOver:i=>{var r,o,s,a,l,u,d;rn.ACTUAL_TARGET=this;const c=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r);if(this._acceptedTargetZonesSet.size===0){if(c)return;this.removeDropTarget();return}const h=(l=(a=(s=this.options).getOverlayOutline)===null||a===void 0?void 0:a.call(s))!==null&&l!==void 0?l:this.element,p=h.offsetWidth,f=h.offsetHeight;if(p===0||f===0)return;const v=i.currentTarget.getBoundingClientRect(),b=((u=i.clientX)!==null&&u!==void 0?u:0)-v.left,m=((d=i.clientY)!==null&&d!==void 0?d:0)-v.top,w=this.calculateQuadrant(this._acceptedTargetZonesSet,b,m,p,f);if(this.isAlreadyUsed(i)||w===null){this.removeDropTarget();return}if(!this.options.canDisplayOverlay(i,w)){if(c)return;this.removeDropTarget();return}const g=new wT({nativeEvent:i,position:w});if(this._onWillShowOverlay.fire(g),g.defaultPrevented){this.removeDropTarget();return}this.markAsUsed(i),c||this.targetElement||(this.targetElement=document.createElement("div"),this.targetElement.className="dv-drop-target-dropzone",this.overlayElement=document.createElement("div"),this.overlayElement.className="dv-drop-target-selection",this._state="center",this.targetElement.appendChild(this.overlayElement),h.classList.add("dv-drop-target"),h.append(this.targetElement)),this.toggleClasses(w,p,f),this._state=w},onDragLeave:()=>{var i,r;!((r=(i=this.options).getOverrideTarget)===null||r===void 0)&&r.call(i)||this.removeDropTarget()},onDragEnd:i=>{var r,o;const s=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r);s&&rn.ACTUAL_TARGET===this&&this._state&&(i.stopPropagation(),this._onDrop.fire({position:this._state,nativeEvent:i})),this.removeDropTarget(),s==null||s.clear()},onDrop:i=>{var r,o,s;i.preventDefault();const a=this._state;this.removeDropTarget(),(s=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r))===null||s===void 0||s.clear(),a&&(i.stopPropagation(),this._onDrop.fire({position:a,nativeEvent:i}))}}),this.addDisposables(this._onDrop,this._onWillShowOverlay,this.dnd)}setTargetZones(t){this._acceptedTargetZonesSet=new Set(t)}setOverlayModel(t){this.options.overlayModel=t}dispose(){this.removeDropTarget(),super.dispose()}markAsUsed(t){t[rn.USED_EVENT_ID]=!0}isAlreadyUsed(t){const n=t[rn.USED_EVENT_ID];return typeof n=="boolean"&&n}toggleClasses(t,n,i){var r,o,s,a,l,u,d;const c=(o=(r=this.options).getOverrideTarget)===null||o===void 0?void 0:o.call(r);if(!c&&!this.overlayElement)return;const h=n<_T,p=i<kT,f=t==="left",v=t==="right",b=t==="top",m=t==="bottom",w=!h&&v,g=!h&&f,y=!p&&b,k=!p&&m;let _=1;const E=(a=(s=this.options.overlayModel)===null||s===void 0?void 0:s.size)!==null&&a!==void 0?a:xT;if(E.type==="percentage"?_=Ie(E.value,0,100)/100:((w||g)&&(_=Ie(0,E.value,n)/n),(y||k)&&(_=Ie(0,E.value,i)/i)),c){const T=(d=(u=(l=this.options).getOverlayOutline)===null||u===void 0?void 0:u.call(l))!==null&&d!==void 0?d:this.element,C=T.getBoundingClientRect(),I=c.getElements(void 0,T),L=I.root,V=I.overlay,D=L.getBoundingClientRect(),P=C.top-D.top,A=C.left-D.left,O={top:P,left:A,width:n,height:i};if(w?(O.left=A+n*(1-_),O.width=n*_):g?O.width=n*_:y?O.height=i*_:k&&(O.top=P+i*(1-_),O.height=i*_),h&&f&&(O.width=4),h&&v&&(O.left=A+n-4,O.width=4),!vT(V,O))return;mT(V,O),V.className=`dv-drop-target-anchor${this.options.className?` ${this.options.className}`:""}`,ne(V,"dv-drop-target-left",f),ne(V,"dv-drop-target-right",v),ne(V,"dv-drop-target-top",b),ne(V,"dv-drop-target-bottom",m),ne(V,"dv-drop-target-center",t==="center"),I.changed&&(ne(V,"dv-drop-target-anchor-container-changed",!0),setTimeout(()=>{ne(V,"dv-drop-target-anchor-container-changed",!1)},10));return}if(!this.overlayElement)return;const S={top:"0px",left:"0px",width:"100%",height:"100%"};w?(S.left=`${100*(1-_)}%`,S.width=`${100*_}%`):g?S.width=`${100*_}%`:y?S.height=`${100*_}%`:k&&(S.top=`${100*(1-_)}%`,S.height=`${100*_}%`),gT(this.overlayElement,S),ne(this.overlayElement,"dv-drop-target-small-vertical",p),ne(this.overlayElement,"dv-drop-target-small-horizontal",h),ne(this.overlayElement,"dv-drop-target-left",f),ne(this.overlayElement,"dv-drop-target-right",v),ne(this.overlayElement,"dv-drop-target-top",b),ne(this.overlayElement,"dv-drop-target-bottom",m),ne(this.overlayElement,"dv-drop-target-center",t==="center")}calculateQuadrant(t,n,i,r,o){var s,a;const l=(a=(s=this.options.overlayModel)===null||s===void 0?void 0:s.activationSize)!==null&&a!==void 0?a:yT;return l.type==="percentage"?ST(t,n,i,r,o,l.value):CT(t,n,i,r,o,l.value)}removeDropTarget(){var t;this.targetElement&&(this._state=void 0,(t=this.targetElement.parentElement)===null||t===void 0||t.classList.remove("dv-drop-target"),this.targetElement.remove(),this.targetElement=void 0,this.overlayElement=void 0)}}rn.USED_EVENT_ID="__dockview_droptarget_event_is_used__";function ST(e,t,n,i,r,o){const s=100*t/i,a=100*n/r;return e.has("left")&&s<o?"left":e.has("right")&&s>100-o?"right":e.has("top")&&a<o?"top":e.has("bottom")&&a>100-o?"bottom":e.has("center")?"center":null}function CT(e,t,n,i,r,o){return e.has("left")&&t<o?"left":e.has("right")&&t>i-o?"right":e.has("top")&&n<o?"top":e.has("bottom")&&n>r-o?"bottom":e.has("center")?"center":null}const Wd=Object.keys({disableAutoResizing:void 0,disableDnd:void 0,className:void 0});class ET extends Vy{constructor(t,n,i,r){super(),this.nativeEvent=t,this.position=n,this.getData=i,this.panel=r}}class Xy extends kp{constructor(){super()}}class Zy extends ce{get isFocused(){return this._isFocused}get isActive(){return this._isActive}get isVisible(){return this._isVisible}get width(){return this._width}get height(){return this._height}constructor(t,n){super(),this.id=t,this.component=n,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new Je,this._onDidDimensionChange=new B,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new B,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new B,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new B,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new B,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new B,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new B,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new B,this.onDidParametersChange=this._onDidParametersChange.event,this.addDisposables(this.onDidFocusChange(i=>{this._isFocused=i.isFocused}),this.onDidActiveChange(i=>{this._isActive=i.isActive}),this.onDidVisibilityChange(i=>{this._isVisible=i.isVisible}),this.onDidDimensionsChange(i=>{this._width=i.width,this._height=i.height}),this.panelUpdatesDisposable,this._onDidDimensionChange,this._onDidChangeFocus,this._onDidVisibilityChange,this._onDidActiveChange,this._onWillFocus,this._onActiveChange,this._onWillFocus,this._onWillVisibilityChange,this._onDidParametersChange)}getParameters(){return this._parameters}initialize(t){this.panelUpdatesDisposable.value=this._onDidParametersChange.event(n=>{this._parameters=n,t.update({params:n})})}setVisible(t){this._onWillVisibilityChange.fire({isVisible:t})}setActive(){this._onActiveChange.fire()}updateParameters(t){this._onDidParametersChange.fire(t)}}class qy extends Zy{constructor(t,n){super(t,n),this._onDidConstraintsChangeInternal=new B,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new B({replay:!0}),this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new B,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange)}setConstraints(t){this._onDidConstraintsChangeInternal.fire(t)}setSize(t){this._onDidSizeChange.fire(t)}}class DT extends qy{set pane(t){this._pane=t}constructor(t,n){super(t,n),this._onDidExpansionChange=new B({replay:!0}),this.onDidExpansionChange=this._onDidExpansionChange.event,this._onMouseEnter=new B({}),this.onMouseEnter=this._onMouseEnter.event,this._onMouseLeave=new B({}),this.onMouseLeave=this._onMouseLeave.event,this.addDisposables(this._onDidExpansionChange,this._onMouseEnter,this._onMouseLeave)}setExpanded(t){var n;(n=this._pane)===null||n===void 0||n.setExpanded(t)}get isExpanded(){var t;return!!(!((t=this._pane)===null||t===void 0)&&t.isExpanded())}}class Dp extends ce{get element(){return this._element}get width(){return this._width}get height(){return this._height}get params(){var t;return(t=this._params)===null||t===void 0?void 0:t.params}constructor(t,n,i){super(),this.id=t,this.component=n,this.api=i,this._height=0,this._width=0,this._element=document.createElement("div"),this._element.tabIndex=-1,this._element.style.outline="none",this._element.style.height="100%",this._element.style.width="100%",this._element.style.overflow="hidden";const r=Fy(this._element);this.addDisposables(this.api,r.onDidFocus(()=>{this.api._onDidChangeFocus.fire({isFocused:!0})}),r.onDidBlur(()=>{this.api._onDidChangeFocus.fire({isFocused:!1})}),r)}focus(){const t=new Xy;this.api._onWillFocus.fire(t),!t.defaultPrevented&&this._element.focus()}layout(t,n){this._width=t,this._height=n,this.api._onDidDimensionChange.fire({width:t,height:n}),this.part&&this._params&&this.part.update(this._params.params)}init(t){this._params=t,this.part=this.getComponent()}update(t){var n,i;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},(n=this._params)===null||n===void 0?void 0:n.params),t.params)});for(const r of Object.keys(t.params))t.params[r]===void 0&&delete this._params.params[r];(i=this.part)===null||i===void 0||i.update({params:this._params.params})}toJSON(){var t,n;const i=(n=(t=this._params)===null||t===void 0?void 0:t.params)!==null&&n!==void 0?n:{};return{id:this.id,component:this.component,params:Object.keys(i).length>0?i:void 0}}dispose(){var t;this.api.dispose(),(t=this.part)===null||t===void 0||t.dispose(),super.dispose()}}class zT extends Dp{set orientation(t){this._orientation=t}get orientation(){return this._orientation}get minimumSize(){const t=this.headerSize,i=this.isExpanded()?this._minimumBodySize:0;return t+i}get maximumSize(){const t=this.headerSize,i=this.isExpanded()?this._maximumBodySize:0;return t+i}get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(t){this._orthogonalSize=t}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(t){this._minimumBodySize=typeof t=="number"?t:0}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(t){this._maximumBodySize=typeof t=="number"?t:Number.POSITIVE_INFINITY}get headerVisible(){return this._headerVisible}set headerVisible(t){this._headerVisible=t,this.header.style.display=t?"":"none"}constructor(t){super(t.id,t.component,new DT(t.id,t.component)),this._onDidChangeExpansionState=new B({replay:!0}),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._orthogonalSize=0,this._size=0,this._isExpanded=!1,this.api.pane=this,this.api.initialize(this),this.headerSize=t.headerSize,this.headerComponent=t.headerComponent,this._minimumBodySize=t.minimumBodySize,this._maximumBodySize=t.maximumBodySize,this._isExpanded=t.isExpanded,this._headerVisible=t.isHeaderVisible,this._onDidChangeExpansionState.fire(this.isExpanded()),this._orientation=t.orientation,this.element.classList.add("dv-pane"),this.addDisposables(this.api.onWillVisibilityChange(n=>{const{isVisible:i}=n,{accessor:r}=this._params;r.setVisible(this,i)}),this.api.onDidSizeChange(n=>{this._onDidChange.fire({size:n.size})}),pe(this.element,"mouseenter",n=>{this.api._onMouseEnter.fire(n)}),pe(this.element,"mouseleave",n=>{this.api._onMouseLeave.fire(n)})),this.addDisposables(this._onDidChangeExpansionState,this.onDidChangeExpansionState(n=>{this.api._onDidExpansionChange.fire({isExpanded:n})}),this.api.onDidFocusChange(n=>{this.header&&(n.isFocused?hn(this.header,"focused"):dn(this.header,"focused"))})),this.renderOnce()}setVisible(t){this.api._onDidVisibilityChange.fire({isVisible:t})}setActive(t){this.api._onDidActiveChange.fire({isActive:t})}isExpanded(){return this._isExpanded}setExpanded(t){this._isExpanded!==t&&(this._isExpanded=t,t?(this.animationTimer&&clearTimeout(this.animationTimer),this.body&&this.element.appendChild(this.body)):this.animationTimer=setTimeout(()=>{var n;(n=this.body)===null||n===void 0||n.remove()},200),this._onDidChange.fire(t?{size:this.width}:{}),this._onDidChangeExpansionState.fire(t))}layout(t,n){this._size=t,this._orthogonalSize=n;const[i,r]=this.orientation===re.HORIZONTAL?[t,n]:[n,t];super.layout(i,r)}init(t){var n,i;super.init(t),typeof t.minimumBodySize=="number"&&(this.minimumBodySize=t.minimumBodySize),typeof t.maximumBodySize=="number"&&(this.maximumBodySize=t.maximumBodySize),this.bodyPart=this.getBodyComponent(),this.headerPart=this.getHeaderComponent(),this.bodyPart.init(Object.assign(Object.assign({},t),{api:this.api})),this.headerPart.init(Object.assign(Object.assign({},t),{api:this.api})),(n=this.body)===null||n===void 0||n.append(this.bodyPart.element),(i=this.header)===null||i===void 0||i.append(this.headerPart.element),typeof t.isExpanded=="boolean"&&this.setExpanded(t.isExpanded)}toJSON(){const t=this._params;return Object.assign(Object.assign({},super.toJSON()),{headerComponent:this.headerComponent,title:t.title})}renderOnce(){this.header=document.createElement("div"),this.header.tabIndex=0,this.header.className="dv-pane-header",this.header.style.height=`${this.headerSize}px`,this.header.style.lineHeight=`${this.headerSize}px`,this.header.style.minHeight=`${this.headerSize}px`,this.header.style.maxHeight=`${this.headerSize}px`,this.element.appendChild(this.header),this.body=document.createElement("div"),this.body.className="dv-pane-body",this.element.appendChild(this.body)}getComponent(){return{update:t=>{var n,i;(n=this.bodyPart)===null||n===void 0||n.update({params:t}),(i=this.headerPart)===null||i===void 0||i.update({params:t})},dispose:()=>{var t,n;(t=this.bodyPart)===null||t===void 0||t.dispose(),(n=this.headerPart)===null||n===void 0||n.dispose()}}}}class PT extends zT{constructor(t){super({id:t.id,component:t.component,headerComponent:t.headerComponent,orientation:t.orientation,isExpanded:t.isExpanded,isHeaderVisible:!0,headerSize:t.headerSize,minimumBodySize:t.minimumBodySize,maximumBodySize:t.maximumBodySize}),this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.accessor=t.accessor,this.addDisposables(this._onDidDrop,this._onUnhandledDragOverEvent),t.disableDnd||this.initDragFeatures()}initDragFeatures(){if(!this.header)return;const t=this.id,n=this.accessor.id;this.header.draggable=!0,this.handler=new class extends Ep{getData(){return Dn.getInstance().setData([new Wo(n,t)],Wo.prototype),{dispose:()=>{Dn.getInstance().clearData(Wo.prototype)}}}}(this.header),this.target=new rn(this.element,{acceptedTargetZones:["top","bottom"],overlayModel:{activationSize:{type:"percentage",value:50}},canDisplayOverlay:(i,r)=>{const o=ko();if(o&&o.paneId!==this.id&&o.viewId===this.accessor.id)return!0;const s=new ET(i,r,ko,this);return this._onUnhandledDragOverEvent.fire(s),s.isAccepted}}),this.addDisposables(this._onDidDrop,this.handler,this.target,this.target.onDrop(i=>{this.onDrop(i)}))}onDrop(t){const n=ko();if(!n||n.viewId!==this.accessor.id){this._onDidDrop.fire(Object.assign(Object.assign({},t),{panel:this,api:new ms(this.accessor),getData:ko}));return}const i=this._params.containerApi,r=n.paneId,o=i.getPanel(r);if(!o){this._onDidDrop.fire(Object.assign(Object.assign({},t),{panel:this,getData:ko,api:new ms(this.accessor)}));return}const s=i.panels,a=s.indexOf(o);let l=i.panels.indexOf(this);(t.position==="left"||t.position==="top")&&(l=Math.max(0,l-1)),(t.position==="right"||t.position==="bottom")&&(a>l&&l++,l=Math.min(s.length-1,l)),i.movePanel(a,l)}}class AT extends ce{get element(){return this._element}constructor(t,n){super(),this.accessor=t,this.group=n,this.disposable=new Je,this._onDidFocus=new B,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new B,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-content-container",this._element.tabIndex=-1,this.addDisposables(this._onDidFocus,this._onDidBlur);const i=n.dropTargetContainer;this.dropTarget=new rn(this.element,{getOverlayOutline:()=>{var r;return((r=t.options.theme)===null||r===void 0?void 0:r.dndPanelOverlay)==="group"?this.element.parentElement:null},className:"dv-drop-target-content",acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(r,o)=>{if(this.group.locked==="no-drop-target"||this.group.locked&&o==="center")return!1;const s=rt();return!s&&r.shiftKey&&this.group.location.type!=="floating"?!1:s&&s.viewId===this.accessor.id?!0:this.group.canDisplayOverlay(r,o,"content")},getOverrideTarget:i?()=>i.model:void 0}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(t,n={asActive:!0}){const i=n.asActive||this.panel&&this.group.isPanelActive(this.panel);this.panel&&this.panel.view.content.element.parentElement===this._element&&this._element.removeChild(this.panel.view.content.element),this.panel=t;let r;switch(t.api.renderer){case"onlyWhenVisible":this.group.renderContainer.detatch(t),this.panel&&i&&this._element.appendChild(this.panel.view.content.element),r=this._element;break;case"always":t.view.content.element.parentElement===this._element&&this._element.removeChild(t.view.content.element),r=this.group.renderContainer.attach({panel:t,referenceContainer:this});break;default:throw new Error(`dockview: invalid renderer type '${t.api.renderer}'`)}if(i){const o=Fy(r);this.focusTracker=o;const s=new ce;s.addDisposables(o,o.onDidFocus(()=>this._onDidFocus.fire()),o.onDidBlur(()=>this._onDidBlur.fire())),this.disposable.value=s}}openPanel(t){this.panel!==t&&this.renderPanel(t)}layout(t,n){}closePanel(){var t;this.panel&&this.panel.api.renderer==="onlyWhenVisible"&&((t=this.panel.view.content.element.parentElement)===null||t===void 0||t.removeChild(this.panel.view.content.element)),this.panel=void 0}dispose(){this.disposable.dispose(),super.dispose()}refreshFocusState(){var t;!((t=this.focusTracker)===null||t===void 0)&&t.refreshState&&this.focusTracker.refreshState()}}function Qy(e,t,n){var i,r;hn(t,"dv-dragged"),t.style.top="-9999px",document.body.appendChild(t),e.setDragImage(t,(i=n==null?void 0:n.x)!==null&&i!==void 0?i:0,(r=n==null?void 0:n.y)!==null&&r!==void 0?r:0),setTimeout(()=>{dn(t,"dv-dragged"),t.remove()},0)}class IT extends Ep{constructor(t,n,i,r,o){super(t,o),this.accessor=n,this.group=i,this.panel=r,this.panelTransfer=Dn.getInstance()}getData(t){return this.panelTransfer.setData([new bi(this.accessor.id,this.group.id,this.panel.id)],bi.prototype),{dispose:()=>{this.panelTransfer.clearData(bi.prototype)}}}}class NT extends ce{get element(){return this._element}constructor(t,n,i){super(),this.panel=t,this.accessor=n,this.group=i,this.content=void 0,this._onPointDown=new B,this.onPointerDown=this._onPointDown.event,this._onDropped=new B,this.onDrop=this._onDropped.event,this._onDragStart=new B,this.onDragStart=this._onDragStart.event,this._onDragEnd=new B,this.onDragEnd=this._onDragEnd.event,this._element=document.createElement("div"),this._element.className="dv-tab",this._element.tabIndex=0,this._element.draggable=!this.accessor.options.disableDnd,ne(this.element,"dv-inactive-tab",!0),this.dragHandler=new IT(this._element,this.accessor,this.group,this.panel,!!this.accessor.options.disableDnd),this.dropTarget=new rn(this._element,{acceptedTargetZones:["left","right"],overlayModel:{activationSize:{value:50,type:"percentage"}},canDisplayOverlay:(r,o)=>{if(this.group.locked)return!1;const s=rt();return s&&this.accessor.id===s.viewId?!(this.accessor.options.tabAnimation==="smooth"&&s.groupId===this.group.id):this.group.model.canDisplayOverlay(r,o,"tab")},getOverrideTarget:()=>{var r;return(r=i.model.dropTargetContainer)===null||r===void 0?void 0:r.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onPointDown,this._onDropped,this._onDragStart,this._onDragEnd,this.dragHandler.onDragStart(r=>{if(r.dataTransfer){const o=getComputedStyle(this.element),s=this.element.cloneNode(!0);Array.from(o).forEach(a=>s.style.setProperty(a,o.getPropertyValue(a),o.getPropertyPriority(a))),s.style.position="absolute",Qy(r.dataTransfer,s,{y:-10,x:30})}this._onDragStart.fire(r),this.accessor.options.tabAnimation==="smooth"&&requestAnimationFrame(()=>{ne(this.element,"dv-tab--dragging",!0)})}),pe(this._element,"dragend",r=>{ne(this.element,"dv-tab--dragging",!1),this._onDragEnd.fire(r)}),this.dragHandler,pe(this._element,"pointerdown",r=>{this._onPointDown.fire(r)}),this.dropTarget.onDrop(r=>{this._onDropped.fire(r)}),this.dropTarget)}setActive(t){ne(this.element,"dv-active-tab",t),ne(this.element,"dv-inactive-tab",!t)}setContent(t){this.content&&this._element.removeChild(this.content.element),this.content=t,this._element.appendChild(this.content.element)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,this.dragHandler.setDisabled(!!this.accessor.options.disableDnd)}dispose(){super.dispose()}}class du{get kind(){return this.options.kind}get nativeEvent(){return this.event.nativeEvent}get position(){return this.event.position}get defaultPrevented(){return this.event.defaultPrevented}get panel(){return this.options.panel}get api(){return this.options.api}get group(){return this.options.group}preventDefault(){this.event.preventDefault()}getData(){return this.options.getData()}constructor(t,n){this.event=t,this.options=n}}class TT extends Ep{constructor(t,n,i,r){super(t,r),this.accessor=n,this.group=i,this.panelTransfer=Dn.getInstance(),this.addDisposables(pe(t,"pointerdown",o=>{o.shiftKey&&qN(o)},!0))}isCancelled(t){return this.group.api.location.type==="floating"&&!t.shiftKey}getData(t){const n=t.dataTransfer;this.panelTransfer.setData([new bi(this.accessor.id,this.group.id,null)],bi.prototype);const i=window.getComputedStyle(this.el),r=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),o=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(n){const s=document.createElement("div");s.style.backgroundColor=r,s.style.color=o,s.style.padding="2px 8px",s.style.height="24px",s.style.fontSize="11px",s.style.lineHeight="20px",s.style.borderRadius="12px",s.style.position="absolute",s.style.pointerEvents="none",s.style.top="-9999px",s.textContent=`Multiple Panels (${this.group.size})`,Qy(n,s,{y:-10,x:30})}return{dispose:()=>{this.panelTransfer.clearData(bi.prototype)}}}}class MT extends ce{get element(){return this._element}constructor(t,n){super(),this.accessor=t,this.group=n,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onDragStart=new B,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!this.accessor.options.disableDnd,ne(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.addDisposables(this._onDrop,this._onDragStart,pe(this._element,"pointerdown",()=>{this.accessor.doSetGroupActive(this.group)})),this.handler=new TT(this._element,t,n,!!this.accessor.options.disableDnd),this.dropTarget=new rn(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(i,r)=>{const o=rt();return o&&this.accessor.id===o.viewId?!0:n.model.canDisplayOverlay(i,r,"header_space")},getOverrideTarget:()=>{var i;return(i=n.model.dropTargetContainer)===null||i===void 0?void 0:i.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this.handler,this.handler.onDragStart(i=>{this._onDragStart.fire(i)}),this.dropTarget.onDrop(i=>{this._onDrop.fire(i)}),this.dropTarget)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,ne(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.handler.setDisabled(!!this.accessor.options.disableDnd)}}class hu extends ce{get element(){return this._element}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._scrollOffset=0,this._orientation=t,dn(this._scrollbar,"dv-scrollbar-vertical","dv-scrollbar-horizontal"),t==="vertical"?hn(this._scrollbar,"dv-scrollbar-vertical"):hn(this._scrollbar,"dv-scrollbar-horizontal"))}constructor(t){super(),this.scrollableElement=t,this._scrollOffset=0,this._orientation="horizontal",this._element=document.createElement("div"),this._element.className="dv-scrollable",this._scrollbar=document.createElement("div"),this._scrollbar.className="dv-scrollbar dv-scrollbar-horizontal",this.element.appendChild(t),this.element.appendChild(this._scrollbar),this.addDisposables(pe(this.element,"wheel",n=>{this._scrollOffset+=n.deltaY*hu.MouseWheelSpeed,this.calculateScrollbarStyles()}),pe(this._scrollbar,"pointerdown",n=>{n.preventDefault(),ne(this.element,"dv-scrollable-scrolling",!0);const i=this._orientation==="horizontal"?n.clientX:n.clientY,r=this._scrollOffset,o=a=>{const l=this._orientation==="horizontal"?a.clientX-i:a.clientY-i,u=this._orientation==="horizontal"?this.element.clientWidth:this.element.clientHeight,d=this._orientation==="horizontal"?this.scrollableElement.scrollWidth:this.scrollableElement.scrollHeight,c=u/d;this._scrollOffset=r+l/c,this.calculateScrollbarStyles()},s=()=>{ne(this.element,"dv-scrollable-scrolling",!1),document.removeEventListener("pointermove",o),document.removeEventListener("pointerup",s),document.removeEventListener("pointercancel",s)};document.addEventListener("pointermove",o),document.addEventListener("pointerup",s),document.addEventListener("pointercancel",s)}),pe(this.element,"scroll",()=>{this.calculateScrollbarStyles()}),pe(this.scrollableElement,"scroll",()=>{this._scrollOffset=this._orientation==="horizontal"?this.scrollableElement.scrollLeft:this.scrollableElement.scrollTop,this.calculateScrollbarStyles()}),uu(this.element,()=>{ne(this.element,"dv-scrollable-resizing",!0),this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(()=>{clearTimeout(this._animationTimer),ne(this.element,"dv-scrollable-resizing",!1)},500),this.calculateScrollbarStyles()}))}calculateScrollbarStyles(){const t=this._orientation==="horizontal"?this.element.clientWidth:this.element.clientHeight,n=this._orientation==="horizontal"?this.scrollableElement.scrollWidth:this.scrollableElement.scrollHeight;if(n>t){const r=t*(t/n);this._orientation==="horizontal"?(this._scrollbar.style.width=`${r}px`,this._scrollbar.style.height=""):(this._scrollbar.style.height=`${r}px`,this._scrollbar.style.width=""),this._scrollOffset=Ie(this._scrollOffset,0,n-t),this._orientation==="horizontal"?this.scrollableElement.scrollLeft=this._scrollOffset:this.scrollableElement.scrollTop=this._scrollOffset;const o=this._scrollOffset/(n-t);this._orientation==="horizontal"?(this._scrollbar.style.left=`${(t-r)*o}px`,this._scrollbar.style.top=""):(this._scrollbar.style.top=`${(t-r)*o}px`,this._scrollbar.style.left="")}else this._orientation==="horizontal"?(this._scrollbar.style.width="0px",this._scrollbar.style.left="0px"):(this._scrollbar.style.height="0px",this._scrollbar.style.top="0px"),this._scrollOffset=0}}hu.MouseWheelSpeed=1;class LT extends ce{get showTabsOverflowControl(){return this._showTabsOverflowControl}set showTabsOverflowControl(t){if(this._showTabsOverflowControl!=t&&(this._showTabsOverflowControl=t,t)){const n=new XN(this._tabsList);this._observerDisposable.value=new ce(n,n.onDidChange(i=>{const r=i.hasScrollX||i.hasScrollY;this.toggleDropdown({reset:!r})}),pe(this._tabsList,"scroll",()=>{this.toggleDropdown({reset:!1})}))}}get element(){return this._element}get panels(){return this._tabs.map(t=>t.value.panel.id)}get size(){return this._tabs.length}get tabs(){return this._tabs.map(t=>t.value)}get direction(){return this._direction}set direction(t){this._direction!==t&&(this._direction=t,this._scrollbar&&(this._scrollbar.orientation=t),dn(this._tabsList,"dv-horizontal","dv-vertical"),t==="vertical"?hn(this._tabsList,"dv-tabs-container-vertical","dv-vertical"):(dn(this._tabsList,"dv-tabs-container-vertical"),hn(this._tabsList,"dv-horizontal")))}constructor(t,n,i){super(),this.group=t,this.accessor=n,this._observerDisposable=new Je,this._scrollbar=null,this._tabs=[],this.selectedIndex=-1,this._showTabsOverflowControl=!1,this._direction="horizontal",this._animState=null,this._onTabDragStart=new B,this.onTabDragStart=this._onTabDragStart.event,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onOverflowTabsChange=new B,this.onOverflowTabsChange=this._onOverflowTabsChange.event,this._tabsList=document.createElement("div"),this._tabsList.className="dv-tabs-container",this.showTabsOverflowControl=i.showTabsOverflowControl,n.options.scrollbars==="native"?this._element=this._tabsList:(this._scrollbar=new hu(this._tabsList),this._scrollbar.orientation=this.direction,this._element=this._scrollbar.element,this.addDisposables(this._scrollbar)),this.addDisposables(this._onOverflowTabsChange,this._observerDisposable,this._onWillShowOverlay,this._onDrop,this._onTabDragStart,pe(this.element,"pointerdown",r=>{if(r.defaultPrevented)return;r.button===0&&this.accessor.doSetGroupActive(this.group)}),pe(this._tabsList,"dragover",r=>{if(!this._animState){if(this.accessor.options.tabAnimation!=="smooth"||this.accessor.options.disableDnd)return;const o=rt();if(o&&o.panelId&&o.groupId!==this.group.id)this._animState={sourceTabId:o.panelId,sourceIndex:-1,tabPositions:this.snapshotTabPositions(),currentInsertionIndex:null};else return}this.handleDragOver(r)},!0),pe(this._tabsList,"dragleave",r=>{this._animState&&(r.relatedTarget&&this._tabsList.contains(r.relatedTarget)||(this.resetTabTransforms(),this._animState&&(this._animState.sourceIndex===-1?this._animState=null:this._animState.currentInsertionIndex=null)))},!0),pe(this._tabsList,"dragend",()=>{this.resetDragAnimation()}),pe(this._tabsList,"drop",r=>{if(this.accessor.options.tabAnimation!=="smooth"||!this._animState||this._animState.currentInsertionIndex===null)return;r.stopPropagation(),r.preventDefault();const o=this._animState;this._animState=null;const s=o.currentInsertionIndex,a=o.sourceIndex,l=s-(a!==-1&&a<s?1:0);if(l===a){this.resetTabTransforms();return}const u=this.snapshotTabPositions();this.resetTabTransforms(),this._onDrop.fire({event:r,index:l}),this.runFlipAnimation(u,o.sourceTabId,o.sourceIndex===-1,{from:Math.min(a,l),to:Math.max(a,l)})},!0),je.from(()=>{this.resetDragAnimation();for(const{value:r,disposable:o}of this._tabs)o.dispose(),r.dispose();this._tabs=[]}))}indexOf(t){return this._tabs.findIndex(n=>n.value.panel.id===t)}isActive(t){return this.selectedIndex>-1&&this._tabs[this.selectedIndex].value===t}setActivePanel(t){let n=0;for(const i of this._tabs){const r=t.id===i.value.panel.id;if(i.value.setActive(r),r){const o=i.value.element,s=o.parentElement;(n<s.scrollLeft||n+o.clientWidth>s.scrollLeft+s.clientWidth)&&(s.scrollLeft=n)}n+=i.value.element.clientWidth}}openPanel(t,n=this._tabs.length){if(this._tabs.find(s=>s.value.panel.id===t.id))return;const i=new NT(t,this.accessor,this.group);i.setContent(t.view.tab);const r=new ce(i.onDragStart(s=>{this._onTabDragStart.fire({nativeEvent:s,panel:t}),this.accessor.options.tabAnimation==="smooth"&&(this._animState={sourceTabId:t.id,sourceIndex:this._tabs.findIndex(a=>a.value===i),tabPositions:this.snapshotTabPositions(),currentInsertionIndex:null})}),i.onPointerDown(s=>{if(s.defaultPrevented)return;const a=!this.accessor.options.disableFloatingGroups,l=this.group.api.location.type==="floating"&&this.size===1;if(a&&!l&&s.shiftKey){s.preventDefault();const u=this.accessor.getGroupPanel(i.panel.id),{top:d,left:c}=i.element.getBoundingClientRect(),{top:h,left:p}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(u,{x:c-p,y:d-h,inDragMode:!0});return}switch(s.button){case 0:this.group.activePanel!==t&&this.group.model.openPanel(t);break}}),i.onDrop(s=>{const a=this._animState;this._animState=null;const l=this._tabs.findIndex(u=>u.value===i);if(a){const u=this.snapshotTabPositions();this.resetTabTransforms(),this._onDrop.fire({event:s.nativeEvent,index:l}),this.runFlipAnimation(u,a.sourceTabId,a.sourceIndex===-1,a.sourceIndex!==-1?{from:Math.min(a.sourceIndex,l),to:Math.max(a.sourceIndex,l)}:void 0)}else this._onDrop.fire({event:s.nativeEvent,index:l})}),i.onWillShowOverlay(s=>{this._onWillShowOverlay.fire(new du(s,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:rt}))})),o={value:i,disposable:r};this.addTab(o,n),this._animState&&(this._animState.tabPositions=this.snapshotTabPositions(),this.applyDragOverTransforms())}delete(t){var n;((n=this._animState)===null||n===void 0?void 0:n.sourceTabId)===t&&(this.resetTabTransforms(),this._animState=null);const i=this.indexOf(t),r=this._tabs.splice(i,1)[0],{value:o,disposable:s}=r;s.dispose(),o.dispose(),o.element.remove(),this._animState&&(this._animState.tabPositions=this.snapshotTabPositions(),this.applyDragOverTransforms())}addTab(t,n=this._tabs.length){if(n<0||n>this._tabs.length)throw new Error("invalid location");this._tabsList.insertBefore(t.value.element,this._tabsList.children[n]),this._tabs=[...this._tabs.slice(0,n),t,...this._tabs.slice(n)],this.selectedIndex<0&&(this.selectedIndex=n)}toggleDropdown(t){const n=t.reset?[]:this._tabs.filter(i=>!nT(i.value.element,this._tabsList)).map(i=>i.value.panel.id);this._onOverflowTabsChange.fire({tabs:n,reset:t.reset})}updateDragAndDropState(){for(const t of this._tabs)t.value.updateDragAndDropState()}snapshotTabPositions(){const t=new Map;for(const n of this._tabs)t.set(n.value.panel.id,n.value.element.getBoundingClientRect());return t}getAverageTabWidth(){if(this._tabs.length===0)return 0;let t=0;for(const n of this._tabs)t+=n.value.element.getBoundingClientRect().width;return t/this._tabs.length}handleDragOver(t){if(!this._animState)return;const n=t.clientX;let i=null;for(let r=0;r<this._tabs.length;r++){const o=this._tabs[r].value;if(o.panel.id===this._animState.sourceTabId)continue;const s=o.element.getBoundingClientRect(),a=s.left+s.width/2;if(n<a){i=r;break}i=r+1}i!==this._animState.currentInsertionIndex&&(this._animState.currentInsertionIndex=i,this.applyDragOverTransforms())}applyDragOverTransforms(){if(!this._animState||this._animState.currentInsertionIndex===null){this.resetTabTransforms();return}const t=this._animState.currentInsertionIndex,n=this._animState.tabPositions.get(this._animState.sourceTabId),i=n?n.width:this.getAverageTabWidth();let r=!1;for(let o=0;o<this._tabs.length;o++){const s=this._tabs[o].value;if(s.panel.id!==this._animState.sourceTabId)if(!r&&o>=t)s.element.style.marginLeft=`${i}px`,ne(s.element,"dv-tab--shifting",!0),r=!0;else if(s.element.style.marginLeft){s.element.style.marginLeft="0px",ne(s.element,"dv-tab--shifting",!0);const a=()=>{s.element.style.removeProperty("margin-left"),ne(s.element,"dv-tab--shifting",!1),s.element.removeEventListener("transitionend",a)};s.element.addEventListener("transitionend",a)}else ne(s.element,"dv-tab--shifting",!1)}}resetTabTransforms(){for(const t of this._tabs)t.value.element.style.removeProperty("margin-left"),t.value.element.style.removeProperty("transform"),ne(t.value.element,"dv-tab--shifting",!1)}resetDragAnimation(){this.resetTabTransforms(),this._animState=null;for(const t of this._tabs)ne(t.value.element,"dv-tab--dragging",!1)}runFlipAnimation(t,n,i=!1,r){let o=!1;for(let s=0;s<this._tabs.length;s++){const a=this._tabs[s],l=a.value.panel.id;if(l===n){if(i){const h=a.value.element.getBoundingClientRect();a.value.element.style.transform=`translateX(${h.width}px)`,ne(a.value.element,"dv-tab--shifting",!0),o=!0}continue}if(r!==void 0&&(s<r.from||s>r.to))continue;const u=t.get(l);if(!u)continue;const d=a.value.element.getBoundingClientRect(),c=u.left-d.left;Math.abs(c)<1||(a.value.element.style.transform=`translateX(${c}px)`,ne(a.value.element,"dv-tab--shifting",!0),o=!0)}o&&requestAnimationFrame(()=>{for(const a of this._tabs)a.value.element.style.transform&&(a.value.element.style.transform="");const s=a=>{if(a.propertyName==="transform"){this._tabsList.removeEventListener("transitionend",s);for(const l of this._tabs)ne(l.value.element,"dv-tab--shifting",!1)}};this._tabsList.addEventListener("transitionend",s)})}}const zp=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"height",e.height),t.setAttributeNS(null,"width",e.width),t.setAttributeNS(null,"viewBox",e.viewbox),t.setAttributeNS(null,"aria-hidden","false"),t.setAttributeNS(null,"focusable","false"),t.classList.add("dv-svg");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d",e.path),t.appendChild(n),t},OT=()=>zp({width:"11",height:"11",viewbox:"0 0 28 28",path:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"}),RT=()=>zp({width:"11",height:"11",viewbox:"0 0 24 15",path:"M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z"}),Ky=()=>zp({width:"11",height:"11",viewbox:"0 0 15 25",path:"M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z"});function VT(){const e=document.createElement("div");e.className="dv-tabs-overflow-dropdown-default";const t=document.createElement("span");t.textContent="";const n=Ky();return e.appendChild(n),e.appendChild(t),{element:e,update:i=>{t.textContent=`${i.tabs}`}}}class FT extends ce{get onTabDragStart(){return this.tabs.onTabDragStart}get panels(){return this.tabs.panels}get size(){return this.tabs.size}get hidden(){return this._hidden}set hidden(t){this._hidden=t,this.element.style.display=t?"none":""}get direction(){return this._direction}set direction(t){this._direction=t,t==="vertical"?(hn(this._element,"dv-groupview-header-vertical"),hn(this.rightActionsContainer,"dv-right-actions-container-vertical"),this.tabs.direction=t):(dn(this._element,"dv-groupview-header-vertical"),dn(this.rightActionsContainer,"dv-right-actions-container-vertical"),this.tabs.direction=t)}get element(){return this._element}constructor(t,n){super(),this.accessor=t,this.group=n,this._hidden=!1,this._direction="horizontal",this.dropdownPart=null,this._overflowTabs=[],this._dropdownDisposable=new Je,this._onDrop=new B,this.onDrop=this._onDrop.event,this._onGroupDragStart=new B,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",ne(this._element,"dv-full-width-single-tab",this.accessor.options.singleTabMode==="fullwidth"),this.rightActionsContainer=document.createElement("div"),this.rightActionsContainer.className="dv-right-actions-container",this.leftActionsContainer=document.createElement("div"),this.leftActionsContainer.className="dv-left-actions-container",this.preActionsContainer=document.createElement("div"),this.preActionsContainer.className="dv-pre-actions-container",this.tabs=new LT(n,t,{showTabsOverflowControl:!t.options.disableTabsOverflowList}),this.voidContainer=new MT(this.accessor,this.group),this._element.appendChild(this.preActionsContainer),this._element.appendChild(this.tabs.element),this._element.appendChild(this.leftActionsContainer),this._element.appendChild(this.voidContainer.element),this._element.appendChild(this.rightActionsContainer),this.addDisposables(this.tabs.onDrop(i=>this._onDrop.fire(i)),this.tabs.onWillShowOverlay(i=>this._onWillShowOverlay.fire(i)),t.onDidOptionsChange(()=>{this.tabs.showTabsOverflowControl=!t.options.disableTabsOverflowList}),this.tabs.onOverflowTabsChange(i=>{this.toggleDropdown(i)}),this.tabs,this._onWillShowOverlay,this._onDrop,this._onGroupDragStart,this.voidContainer,this.voidContainer.onDragStart(i=>{this._onGroupDragStart.fire({nativeEvent:i,group:this.group})}),this.voidContainer.onDrop(i=>{this._onDrop.fire({event:i.nativeEvent,index:this.tabs.size})}),this.voidContainer.onWillShowOverlay(i=>{this._onWillShowOverlay.fire(new du(i,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:rt}))}),pe(this.voidContainer.element,"pointerdown",i=>{if(i.defaultPrevented)return;if(!this.accessor.options.disableFloatingGroups&&i.shiftKey&&this.group.api.location.type!=="floating"){i.preventDefault();const{top:o,left:s}=this.element.getBoundingClientRect(),{top:a,left:l}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:s-l+20,y:o-a+20,inDragMode:!0})}}))}show(){this.hidden||(this.element.style.display="")}hide(){this._element.style.display="none"}setRightActionsElement(t){this.rightActions!==t&&(this.rightActions&&(this.rightActions.remove(),this.rightActions=void 0),t&&(this.rightActionsContainer.appendChild(t),this.rightActions=t))}setLeftActionsElement(t){this.leftActions!==t&&(this.leftActions&&(this.leftActions.remove(),this.leftActions=void 0),t&&(this.leftActionsContainer.appendChild(t),this.leftActions=t))}setPrefixActionsElement(t){this.preActions!==t&&(this.preActions&&(this.preActions.remove(),this.preActions=void 0),t&&(this.preActionsContainer.appendChild(t),this.preActions=t))}isActive(t){return this.tabs.isActive(t)}indexOf(t){return this.tabs.indexOf(t)}setActive(t){}delete(t){this.tabs.delete(t),this.updateClassnames()}setActivePanel(t){this.tabs.setActivePanel(t)}openPanel(t,n=this.tabs.size){this.tabs.openPanel(t,n),this.updateClassnames()}closePanel(t){this.delete(t.id)}updateClassnames(){ne(this._element,"dv-single-tab",this.size===1)}toggleDropdown(t){const n=t.reset?[]:t.tabs;if(this._overflowTabs=n,this._overflowTabs.length>0&&this.dropdownPart){this.dropdownPart.update({tabs:n.length});return}if(this._overflowTabs.length===0){this._dropdownDisposable.dispose();return}const i=document.createElement("div");i.className="dv-tabs-overflow-dropdown-root";const r=VT();r.update({tabs:n.length}),this.dropdownPart=r,i.appendChild(r.element),this.rightActionsContainer.prepend(i),this._dropdownDisposable.value=new ce(je.from(()=>{var o,s;i.remove(),(s=(o=this.dropdownPart)===null||o===void 0?void 0:o.dispose)===null||s===void 0||s.call(o),this.dropdownPart=null}),pe(i,"pointerdown",o=>{o.preventDefault()},{capture:!0}),pe(i,"click",o=>{const s=document.createElement("div");s.style.overflow="auto",s.className="dv-tabs-overflow-container";for(const l of this.tabs.tabs.filter(u=>this._overflowTabs.includes(u.panel.id))){const u=this.group.panels.find(p=>p===l.panel),c=u.view.createTabRenderer("headerOverflow").element,h=document.createElement("div");ne(h,"dv-tab",!0),ne(h,"dv-active-tab",u.api.isActive),ne(h,"dv-inactive-tab",!u.api.isActive),h.addEventListener("click",p=>{this.accessor.popupService.close(),!p.defaultPrevented&&(l.element.scrollIntoView(),l.panel.api.setActive())}),h.appendChild(c),s.appendChild(h)}const a=sT(i);this.accessor.popupService.openPopover(s,{x:o.clientX,y:o.clientY,zIndex:a!=null&&a.style.zIndex?`calc(${a.style.zIndex} * 2)`:void 0})}))}updateDragAndDropState(){this.tabs.updateDragAndDropState(),this.voidContainer.updateDragAndDropState()}}class Jy extends Vy{constructor(t,n,i,r,o){super(),this.nativeEvent=t,this.target=n,this.position=i,this.getData=r,this.group=o}}const jd=Object.keys({disableAutoResizing:void 0,hideBorders:void 0,singleTabMode:void 0,disableFloatingGroups:void 0,floatingGroupBounds:void 0,popoutUrl:void 0,defaultRenderer:void 0,defaultHeaderPosition:void 0,debug:void 0,rootOverlayModel:void 0,locked:void 0,disableDnd:void 0,className:void 0,noPanelsOverlay:void 0,dndEdges:void 0,theme:void 0,disableTabsOverflowList:void 0,scrollbars:void 0,tabAnimation:void 0});function HT(e){return!!e.referencePanel}function GT(e){return!!e.referenceGroup}function BT(e){return!!e.referencePanel}function $T(e){return!!e.referenceGroup}class Pp extends kp{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}get panel(){return this.options.panel}get group(){return this.options.group}get api(){return this.options.api}constructor(t){super(),this.options=t}getData(){return this.options.getData()}}class ex extends Pp{get kind(){return this._kind}constructor(t){super(t),this._kind=t.kind}}class WT extends ce{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(t){this._locked=t,ne(this.container,"dv-locked-groupview",t==="no-drop-target"||t)}get isActive(){return this._isGroupActive}get panels(){return this._panels}get size(){return this._panels.length}get isEmpty(){return this._panels.length===0}get hasWatermark(){return!!(this.watermark&&this.container.contains(this.watermark.element))}get header(){return this.tabsContainer}get isContentFocused(){return document.activeElement?Rd(document.activeElement,this.contentContainer.element):!1}get headerPosition(){var t;return(t=this._headerPosition)!==null&&t!==void 0?t:"top"}set headerPosition(t){var n;this._headerPosition=t,dn(this.container,"dv-groupview-header-top","dv-groupview-header-bottom","dv-groupview-header-left","dv-groupview-header-right"),hn(this.container,`dv-groupview-header-${t}`);const i=t==="top"||t==="bottom"?"horizontal":"vertical";this.tabsContainer.direction=i,this.header.direction=i,!((n=this._activePanel)===null||n===void 0)&&n.layout&&this._activePanel.layout(this._width,this._height),(this._leftHeaderActions||this._rightHeaderActions||this._prefixHeaderActions)&&this.updateHeaderActions()}get location(){return this._location}set location(t){switch(this._location=t,ne(this.container,"dv-groupview-floating",!1),ne(this.container,"dv-groupview-popout",!1),t.type){case"grid":this.contentContainer.dropTarget.setTargetZones(["top","bottom","left","right","center"]);break;case"floating":this.contentContainer.dropTarget.setTargetZones(["center"]),this.contentContainer.dropTarget.setTargetZones(t?["center"]:["top","bottom","left","right","center"]),ne(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),ne(this.container,"dv-groupview-popout",!0);break}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(t,n,i,r,o){var s,a;super(),this.container=t,this.accessor=n,this.id=i,this.options=r,this.groupPanel=o,this._isGroupActive=!1,this._locked=!1,this._rightHeaderActionsDisposable=new Je,this._leftHeaderActionsDisposable=new Je,this._prefixHeaderActionsDisposable=new Je,this._location={type:"grid"},this.mostRecentlyUsed=[],this._overwriteRenderContainer=null,this._overwriteDropTargetContainer=null,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new B,this.onMove=this._onMove.event,this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new B,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new B,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new B,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new B,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new B,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new B,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new B,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new B,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,ne(this.container,"dv-groupview",!0),this._api=new Cl(this.accessor),this.tabsContainer=new FT(this.accessor,this.groupPanel),this.contentContainer=new AT(this.accessor,this),t.append(this.tabsContainer.element,this.contentContainer.element),this.header.hidden=!!r.hideHeader,this.locked=(s=r.locked)!==null&&s!==void 0?s:!1,this.headerPosition=(a=r.headerPosition)!==null&&a!==void 0?a:n.defaultHeaderPosition,this.addDisposables(this._onTabDragStart,this._onGroupDragStart,this._onWillShowOverlay,this._rightHeaderActionsDisposable,this._leftHeaderActionsDisposable,this._prefixHeaderActionsDisposable,this.tabsContainer.onTabDragStart(l=>{this._onTabDragStart.fire(l)}),this.tabsContainer.onGroupDragStart(l=>{this._onGroupDragStart.fire(l)}),this.tabsContainer.onDrop(l=>{this.handleDropEvent("header",l.event,"center",l.index)}),this.contentContainer.onDidFocus(()=>{this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.onDidBlur(()=>{}),this.contentContainer.dropTarget.onDrop(l=>{this.handleDropEvent("content",l.nativeEvent,l.position)}),this.tabsContainer.onWillShowOverlay(l=>{this._onWillShowOverlay.fire(l)}),this.contentContainer.dropTarget.onWillShowOverlay(l=>{this._onWillShowOverlay.fire(new du(l,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:rt}))}),this._onMove,this._onDidChange,this._onDidDrop,this._onWillDrop,this._onDidAddPanel,this._onDidRemovePanel,this._onDidActivePanelChange,this._onUnhandledDragOverEvent,this._onDidPanelTitleChange,this._onDidPanelParametersChange)}focusContent(){this.contentContainer.element.focus()}set renderContainer(t){this.panels.forEach(n=>{this.renderContainer.detatch(n)}),this._overwriteRenderContainer=t,this.panels.forEach(n=>{this.rerender(n)})}get renderContainer(){var t;return(t=this._overwriteRenderContainer)!==null&&t!==void 0?t:this.accessor.overlayRenderContainer}set dropTargetContainer(t){this._overwriteDropTargetContainer=t}get dropTargetContainer(){var t;return(t=this._overwriteDropTargetContainer)!==null&&t!==void 0?t:this.accessor.rootDropTargetContainer}initialize(){this.options.panels&&this.options.panels.forEach(t=>{this.doAddPanel(t)}),this.options.activePanel&&this.openPanel(this.options.activePanel),this.setActive(this.isActive,!0),this.updateContainer(),this.updateHeaderActions()}updateHeaderActions(){this.accessor.options.createRightHeaderActionComponent?(this._rightHeaderActions=this.accessor.options.createRightHeaderActionComponent(this.groupPanel),this._rightHeaderActionsDisposable.value=this._rightHeaderActions,this._rightHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element)):(this._rightHeaderActions=void 0,this._rightHeaderActionsDisposable.dispose(),this.tabsContainer.setRightActionsElement(void 0)),this.accessor.options.createLeftHeaderActionComponent?(this._leftHeaderActions=this.accessor.options.createLeftHeaderActionComponent(this.groupPanel),this._leftHeaderActionsDisposable.value=this._leftHeaderActions,this._leftHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element)):(this._leftHeaderActions=void 0,this._leftHeaderActionsDisposable.dispose(),this.tabsContainer.setLeftActionsElement(void 0)),this.accessor.options.createPrefixHeaderActionComponent?(this._prefixHeaderActions=this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel),this._prefixHeaderActionsDisposable.value=this._prefixHeaderActions,this._prefixHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element)):(this._prefixHeaderActions=void 0,this._prefixHeaderActionsDisposable.dispose(),this.tabsContainer.setPrefixActionsElement(void 0))}rerender(t){this.contentContainer.renderPanel(t,{asActive:!1})}indexOf(t){return this.tabsContainer.indexOf(t.id)}toJSON(){var t;const n={views:this.tabsContainer.panels,activeView:(t=this._activePanel)===null||t===void 0?void 0:t.id,id:this.id};return this.locked!==!1&&(n.locked=this.locked),this.header.hidden&&(n.hideHeader=!0),this.headerPosition!=="top"&&(n.headerPosition=this.headerPosition),n}moveToNext(t){t||(t={}),t.panel||(t.panel=this.activePanel);const n=t.panel?this.panels.indexOf(t.panel):-1;let i;if(n<this.panels.length-1)i=n+1;else if(!t.suppressRoll)i=0;else return;this.openPanel(this.panels[i])}moveToPrevious(t){if(t||(t={}),t.panel||(t.panel=this.activePanel),!t.panel)return;const n=this.panels.indexOf(t.panel);let i;if(n>0)i=n-1;else if(!t.suppressRoll)i=this.panels.length-1;else return;this.openPanel(this.panels[i])}containsPanel(t){return this.panels.includes(t)}init(t){}update(t){}focus(){var t;(t=this._activePanel)===null||t===void 0||t.focus()}openPanel(t,n={}){(typeof n.index!="number"||n.index>this.panels.length)&&(n.index=this.panels.length);const i=!!n.skipSetActive;if(t.updateParentGroup(this.groupPanel,{skipSetActive:n.skipSetActive}),this.doAddPanel(t,n.index,{skipSetActive:i}),this._activePanel===t){this.contentContainer.renderPanel(t,{asActive:!0});return}i||this.doSetActivePanel(t),n.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),n.skipSetActive||this.updateContainer()}removePanel(t,n={skipSetActive:!1}){const i=typeof t=="string"?t:t.id,r=this._panels.find(o=>o.id===i);if(!r)throw new Error("invalid operation");return this._removePanel(r,n)}closeAllPanels(){if(this.panels.length>0){const t=[...this.panels];for(const n of t)this.doClose(n)}else this.accessor.removeGroup(this.groupPanel)}closePanel(t){this.doClose(t)}doClose(t){const n=this.panels.length===1&&this.accessor.groups.length===1;this.accessor.removePanel(t,n&&this.accessor.options.noPanelsOverlay==="emptyGroup"?{removeEmptyGroup:!1}:void 0)}isPanelActive(t){return this._activePanel===t}updateActions(t){this.tabsContainer.setRightActionsElement(t)}setActive(t,n=!1){!n&&this.isActive===t||(this._isGroupActive=t,ne(this.container,"dv-active-group",t),ne(this.container,"dv-inactive-group",!t),this.tabsContainer.setActive(this.isActive),!this._activePanel&&this.panels.length>0&&this.doSetActivePanel(this.panels[0]),this.updateContainer())}layout(t,n){var i;this._width=t,this._height=n,this.contentContainer.layout(this._width,this._height),!((i=this._activePanel)===null||i===void 0)&&i.layout&&this._activePanel.layout(this._width,this._height)}_removePanel(t,n){const i=this._activePanel===t;if(this.doRemovePanel(t),i&&this.panels.length>0){const r=this.mostRecentlyUsed[0];this.openPanel(r,{skipSetActive:n.skipSetActive,skipSetGroupActive:n.skipSetActiveGroup})}return this._activePanel&&this.panels.length===0&&this.doSetActivePanel(void 0),n.skipSetActive||this.updateContainer(),t}doRemovePanel(t){const n=this.panels.indexOf(t);if(this._activePanel===t&&this.contentContainer.closePanel(),this.tabsContainer.delete(t.id),this._panels.splice(n,1),this.mostRecentlyUsed.includes(t)){const r=this.mostRecentlyUsed.indexOf(t);this.mostRecentlyUsed.splice(r,1)}const i=this._panelDisposables.get(t.id);i&&(i.dispose(),this._panelDisposables.delete(t.id)),this._onDidRemovePanel.fire({panel:t})}doAddPanel(t,n=this.panels.length,i={skipSetActive:!1}){const o=this._panels.indexOf(t)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(t,n),i.skipSetActive?t.api.renderer==="always"&&this.contentContainer.renderPanel(t,{asActive:!1}):this.contentContainer.openPanel(t),!o&&(this.updateMru(t),this.panels.splice(n,0,t),this._panelDisposables.set(t.id,new ce(t.api.onDidTitleChange(s=>this._onDidPanelTitleChange.fire(s)),t.api.onDidParametersChange(s=>this._onDidPanelParametersChange.fire(s)))),this._onDidAddPanel.fire({panel:t}))}doSetActivePanel(t){this._activePanel!==t&&(this._activePanel=t,t&&(this.tabsContainer.setActivePanel(t),this.contentContainer.openPanel(t),t.layout(this._width,this._height),this.updateMru(t),this.contentContainer.refreshFocusState(),this._onDidActivePanelChange.fire({panel:t})))}updateMru(t){this.mostRecentlyUsed.includes(t)&&this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(t),1),this.mostRecentlyUsed=[t,...this.mostRecentlyUsed]}updateContainer(){var t,n;if(this.panels.forEach(i=>i.runEvents()),this.isEmpty&&!this.watermark){const i=this.accessor.createWatermarkComponent();i.init({containerApi:this._api,group:this.groupPanel}),this.watermark=i,pe(this.watermark.element,"pointerdown",()=>{this.isActive||this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.element.appendChild(this.watermark.element)}!this.isEmpty&&this.watermark&&(this.watermark.element.remove(),(n=(t=this.watermark).dispose)===null||n===void 0||n.call(t),this.watermark=void 0)}canDisplayOverlay(t,n,i){const r=new Jy(t,i,n,rt,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(r),r.isAccepted}handleDropEvent(t,n,i,r){if(this.locked==="no-drop-target")return;function o(){switch(t){case"header":return typeof r=="number"?"tab":"header_space";case"content":return"content"}}const s=typeof r=="number"?this.panels[r]:void 0,a=new ex({nativeEvent:n,position:i,panel:s,getData:()=>rt(),kind:o(),group:this.groupPanel,api:this._api});if(this._onWillDrop.fire(a),a.defaultPrevented)return;const l=rt();if(l&&l.viewId===this.accessor.id){if(t==="content"&&l.groupId===this.id&&(i==="center"||l.panelId===null)||t==="header"&&l.groupId===this.id&&l.panelId===null)return;if(l.panelId===null){const{groupId:p}=l;this._onMove.fire({target:i,groupId:p,index:r});return}if(this.tabsContainer.indexOf(l.panelId)!==-1&&this.tabsContainer.size===1)return;const{groupId:d,panelId:c}=l;if(this.id===d&&!i&&this.tabsContainer.indexOf(c)===r)return;this._onMove.fire({target:i,groupId:l.groupId,itemId:l.panelId,index:r})}else this._onDidDrop.fire(new Pp({nativeEvent:n,position:i,panel:s,getData:()=>rt(),group:this.groupPanel,api:this._api}))}updateDragAndDropState(){this.tabsContainer.updateDragAndDropState()}dispose(){var t,n,i;super.dispose(),(t=this.watermark)===null||t===void 0||t.element.remove(),(i=(n=this.watermark)===null||n===void 0?void 0:n.dispose)===null||i===void 0||i.call(n),this.watermark=void 0;for(const r of this.panels)r.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class Ap extends Zy{constructor(t,n,i){super(t,n),this._onDidConstraintsChangeInternal=new B,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new B,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new B,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),i&&this.initialize(i)}setConstraints(t){this._onDidConstraintsChangeInternal.fire(t)}setSize(t){this._onDidSizeChange.fire(t)}}class tx extends Dp{get priority(){return this._priority}get snap(){return this._snap}get minimumWidth(){return this.__minimumWidth()}get minimumHeight(){return this.__minimumHeight()}get maximumHeight(){return this.__maximumHeight()}get maximumWidth(){return this.__maximumWidth()}__minimumWidth(){const t=typeof this._minimumWidth=="function"?this._minimumWidth():this._minimumWidth;return t!==this._evaluatedMinimumWidth&&(this._evaluatedMinimumWidth=t,this.updateConstraints()),t}__maximumWidth(){const t=typeof this._maximumWidth=="function"?this._maximumWidth():this._maximumWidth;return t!==this._evaluatedMaximumWidth&&(this._evaluatedMaximumWidth=t,this.updateConstraints()),t}__minimumHeight(){const t=typeof this._minimumHeight=="function"?this._minimumHeight():this._minimumHeight;return t!==this._evaluatedMinimumHeight&&(this._evaluatedMinimumHeight=t,this.updateConstraints()),t}__maximumHeight(){const t=typeof this._maximumHeight=="function"?this._maximumHeight():this._maximumHeight;return t!==this._evaluatedMaximumHeight&&(this._evaluatedMaximumHeight=t,this.updateConstraints()),t}get isActive(){return this.api.isActive}get isVisible(){return this.api.isVisible}constructor(t,n,i,r){super(t,n,r??new Ap(t,n)),this._evaluatedMinimumWidth=0,this._evaluatedMaximumWidth=Number.MAX_SAFE_INTEGER,this._evaluatedMinimumHeight=0,this._evaluatedMaximumHeight=Number.MAX_SAFE_INTEGER,this._minimumWidth=0,this._minimumHeight=0,this._maximumWidth=Number.MAX_SAFE_INTEGER,this._maximumHeight=Number.MAX_SAFE_INTEGER,this._snap=!1,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,typeof(i==null?void 0:i.minimumWidth)=="number"&&(this._minimumWidth=i.minimumWidth),typeof(i==null?void 0:i.maximumWidth)=="number"&&(this._maximumWidth=i.maximumWidth),typeof(i==null?void 0:i.minimumHeight)=="number"&&(this._minimumHeight=i.minimumHeight),typeof(i==null?void 0:i.maximumHeight)=="number"&&(this._maximumHeight=i.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange(o=>{const{isVisible:s}=o,{accessor:a}=this._params;a.setVisible(this,s)}),this.api.onActiveChange(()=>{const{accessor:o}=this._params;o.doSetGroupActive(this)}),this.api.onDidConstraintsChangeInternal(o=>{(typeof o.minimumWidth=="number"||typeof o.minimumWidth=="function")&&(this._minimumWidth=o.minimumWidth),(typeof o.minimumHeight=="number"||typeof o.minimumHeight=="function")&&(this._minimumHeight=o.minimumHeight),(typeof o.maximumWidth=="number"||typeof o.maximumWidth=="function")&&(this._maximumWidth=o.maximumWidth),(typeof o.maximumHeight=="number"||typeof o.maximumHeight=="function")&&(this._maximumHeight=o.maximumHeight)}),this.api.onDidSizeChange(o=>{this._onDidChange.fire({height:o.height,width:o.width})}),this._onDidChange)}setVisible(t){this.api._onDidVisibilityChange.fire({isVisible:t})}setActive(t){this.api._onDidActiveChange.fire({isActive:t})}init(t){t.maximumHeight&&(this._maximumHeight=t.maximumHeight),t.minimumHeight&&(this._minimumHeight=t.minimumHeight),t.maximumWidth&&(this._maximumWidth=t.maximumWidth),t.minimumWidth&&(this._minimumWidth=t.minimumWidth),this._priority=t.priority,this._snap=!!t.snap,super.init(t),typeof t.isVisible=="boolean"&&this.setVisible(t.isVisible)}updateConstraints(){this.api._onDidConstraintsChange.fire({minimumWidth:this._evaluatedMinimumWidth,maximumWidth:this._evaluatedMaximumWidth,minimumHeight:this._evaluatedMinimumHeight,maximumHeight:this._evaluatedMaximumHeight})}toJSON(){const t=super.toJSON(),n=r=>r===Number.MAX_SAFE_INTEGER?void 0:r,i=r=>r<=0?void 0:r;return Object.assign(Object.assign({},t),{minimumHeight:i(this.minimumHeight),maximumHeight:n(this.maximumHeight),minimumWidth:i(this.minimumWidth),maximumWidth:n(this.maximumWidth),snap:this.snap,priority:this.priority})}}const Oi="dockview: DockviewGroupPanelApiImpl not initialized";class jT extends Ap{get location(){if(!this._group)throw new Error(Oi);return this._group.model.location}constructor(t,n){super(t,"__dockviewgroup__"),this.accessor=n,this._onDidLocationChange=new B,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new B,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this.addDisposables(this._onDidLocationChange,this._onDidActivePanelChange,this._onDidVisibilityChange.event(i=>{i.isVisible&&this._pendingSize&&(super.setSize(this._pendingSize),this._pendingSize=void 0)}))}setSize(t){this._pendingSize=Object.assign({},t),super.setSize(t)}close(){if(this._group)return this.accessor.removeGroup(this._group)}getWindow(){return this.location.type==="popout"?this.location.getWindow():window}setHeaderPosition(t){if(!this._group)throw new Error(Oi);this._group.model.headerPosition=t}getHeaderPosition(){if(!this._group)throw new Error(Oi);return this._group.model.headerPosition}moveTo(t){var n,i,r,o;if(!this._group)throw new Error(Oi);const s=(n=t.group)!==null&&n!==void 0?n:this.accessor.addGroup({direction:bT((i=t.position)!==null&&i!==void 0?i:"right"),skipSetActive:(r=t.skipSetActive)!==null&&r!==void 0?r:!1});this.accessor.moveGroupOrPanel({from:{groupId:this._group.id},to:{group:s,position:t.group&&(o=t.position)!==null&&o!==void 0?o:"center",index:t.index},skipSetActive:t.skipSetActive})}maximize(){if(!this._group)throw new Error(Oi);this.location.type==="grid"&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(Oi);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(Oi);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(t){this._group=t}}const UT=100,YT=100;class Dg extends tx{get minimumWidth(){var t;if(typeof this._explicitConstraints.minimumWidth=="number")return this._explicitConstraints.minimumWidth;const n=(t=this.activePanel)===null||t===void 0?void 0:t.minimumWidth;return typeof n=="number"?n:super.__minimumWidth()}get minimumHeight(){var t;if(typeof this._explicitConstraints.minimumHeight=="number")return this._explicitConstraints.minimumHeight;const n=(t=this.activePanel)===null||t===void 0?void 0:t.minimumHeight;return typeof n=="number"?n:super.__minimumHeight()}get maximumWidth(){var t;if(typeof this._explicitConstraints.maximumWidth=="number")return this._explicitConstraints.maximumWidth;const n=(t=this.activePanel)===null||t===void 0?void 0:t.maximumWidth;return typeof n=="number"?n:super.__maximumWidth()}get maximumHeight(){var t;if(typeof this._explicitConstraints.maximumHeight=="number")return this._explicitConstraints.maximumHeight;const n=(t=this.activePanel)===null||t===void 0?void 0:t.maximumHeight;return typeof n=="number"?n:super.__maximumHeight()}get panels(){return this._model.panels}get activePanel(){return this._model.activePanel}get size(){return this._model.size}get model(){return this._model}get locked(){return this._model.locked}set locked(t){this._model.locked=t}get header(){return this._model.header}constructor(t,n,i){var r,o,s,a,l,u;super(n,"groupview_default",{minimumHeight:(o=(r=i.constraints)===null||r===void 0?void 0:r.minimumHeight)!==null&&o!==void 0?o:YT,minimumWidth:(a=(s=i.constraints)===null||s===void 0?void 0:s.minimumWidth)!==null&&a!==void 0?a:UT,maximumHeight:(l=i.constraints)===null||l===void 0?void 0:l.maximumHeight,maximumWidth:(u=i.constraints)===null||u===void 0?void 0:u.maximumWidth},new jT(n,t)),this._explicitConstraints={},this.api.initialize(this),this._model=new WT(this.element,t,n,i,this),this.addDisposables(this.model.onDidActivePanelChange(d=>{this.api._onDidActivePanelChange.fire(d)}),this.api.onDidConstraintsChangeInternal(d=>{d.minimumWidth!==void 0&&(this._explicitConstraints.minimumWidth=typeof d.minimumWidth=="function"?d.minimumWidth():d.minimumWidth),d.minimumHeight!==void 0&&(this._explicitConstraints.minimumHeight=typeof d.minimumHeight=="function"?d.minimumHeight():d.minimumHeight),d.maximumWidth!==void 0&&(this._explicitConstraints.maximumWidth=typeof d.maximumWidth=="function"?d.maximumWidth():d.maximumWidth),d.maximumHeight!==void 0&&(this._explicitConstraints.maximumHeight=typeof d.maximumHeight=="function"?d.maximumHeight():d.maximumHeight)}))}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(t){super.setActive(t),this.model.setActive(t)}layout(t,n){super.layout(t,n),this.model.layout(t,n)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}const s8={name:"dark",className:"dockview-theme-dark"},a8={name:"light",className:"dockview-theme-light"},XT={className:"dockview-theme-abyss"};class ZT extends Ap{get location(){return this.group.api.location}get title(){return this.panel.title}get isGroupActive(){return this.group.isActive}get renderer(){return this.panel.renderer}set group(t){const n=this._group;this._group!==t&&(this._group=t,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(n),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(t,n,i,r,o){super(t.id,r),this.panel=t,this.accessor=i,this._onDidTitleChange=new B,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new B,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new B,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new B,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new B,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new Je,this._tabComponent=o,this.initialize(t),this._group=n,this.setupGroupEventListeners(),this.addDisposables(this.groupEventsDisposable,this._onDidRendererChange,this._onDidTitleChange,this._onDidGroupChange,this._onDidActiveGroupChange,this._onDidLocationChange)}getWindow(){return this.group.api.getWindow()}moveTo(t){var n,i;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:(n=t.group)!==null&&n!==void 0?n:this._group,position:t.group&&(i=t.position)!==null&&i!==void 0?i:"center",index:t.index},skipSetActive:t.skipSetActive})}setTitle(t){this.panel.setTitle(t)}setRenderer(t){this.panel.setRenderer(t)}close(){this.group.model.closePanel(this.panel)}maximize(){this.group.api.maximize()}isMaximized(){return this.group.api.isMaximized()}exitMaximized(){this.group.api.exitMaximized()}setupGroupEventListeners(t){var n;let i=(n=t==null?void 0:t.isActive)!==null&&n!==void 0?n:!1;this.groupEventsDisposable.value=new ce(this.group.api.onDidVisibilityChange(r=>{const o=!r.isVisible&&this.isVisible,s=r.isVisible&&!this.isVisible,a=this.group.model.isPanelActive(this.panel);(o||s&&a)&&this._onDidVisibilityChange.fire(r)}),this.group.api.onDidLocationChange(r=>{this.group===this.panel.group&&this._onDidLocationChange.fire(r)}),this.group.api.onDidActiveChange(()=>{this.group===this.panel.group&&i!==this.isGroupActive&&(i=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))}))}}class wr extends ce{get params(){return this._params}get title(){return this._title}get group(){return this._group}get renderer(){var t;return(t=this._renderer)!==null&&t!==void 0?t:this.accessor.renderer}get minimumWidth(){return this._minimumWidth}get minimumHeight(){return this._minimumHeight}get maximumWidth(){return this._maximumWidth}get maximumHeight(){return this._maximumHeight}constructor(t,n,i,r,o,s,a,l){super(),this.id=t,this.accessor=r,this.containerApi=o,this.view=a,this._renderer=l.renderer,this._group=s,this._minimumWidth=l.minimumWidth,this._minimumHeight=l.minimumHeight,this._maximumWidth=l.maximumWidth,this._maximumHeight=l.maximumHeight,this.api=new ZT(this,this._group,r,n,i),this.addDisposables(this.api.onActiveChange(()=>{r.setActivePanel(this)}),this.api.onDidSizeChange(u=>{this.group.api.setSize(u)}),this.api.onDidRendererChange(()=>{this.group.model.rerender(this)}))}init(t){this._params=t.params,this.view.init(Object.assign(Object.assign({},t),{api:this.api,containerApi:this.containerApi})),this.setTitle(t.title)}focus(){const t=new Xy;this.api._onWillFocus.fire(t),!t.defaultPrevented&&(this.api.isActive||this.api.setActive())}toJSON(){return{id:this.id,contentComponent:this.view.contentComponent,tabComponent:this.view.tabComponent,params:Object.keys(this._params||{}).length>0?this._params:void 0,title:this.title,renderer:this._renderer,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,minimumWidth:this._minimumWidth,maximumWidth:this._maximumWidth}}setTitle(t){t!==this.title&&(this._title=t,this.api._onDidTitleChange.fire({title:t}))}setRenderer(t){t!==this.renderer&&(this._renderer=t,this.api._onDidRendererChange.fire({renderer:t}))}update(t){var n;this._params=Object.assign(Object.assign({},(n=this._params)!==null&&n!==void 0?n:{}),t.params);for(const i of Object.keys(t.params))t.params[i]===void 0&&delete this._params[i];this.view.update({params:this._params})}updateFromStateModel(t){var n,i,r;this._maximumHeight=t.maximumHeight,this._minimumHeight=t.minimumHeight,this._maximumWidth=t.maximumWidth,this._minimumWidth=t.minimumWidth,this.update({params:(n=t.params)!==null&&n!==void 0?n:{}}),this.setTitle((i=t.title)!==null&&i!==void 0?i:this.id),this.setRenderer((r=t.renderer)!==null&&r!==void 0?r:this.accessor.renderer)}updateParentGroup(t,n){this._group=t,this.api.group=this._group;const i=this._group.model.isPanelActive(this),r=this.group.api.isActive&&i;n!=null&&n.skipSetActive||this.api.isActive!==r&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&i}),this.api.isVisible!==i&&this.api._onDidVisibilityChange.fire({isVisible:i})}runEvents(){const t=this._group.model.isPanelActive(this),n=this.group.api.isActive&&t;this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&t}),this.api.isVisible!==t&&this.api._onDidVisibilityChange.fire({isVisible:t})}layout(t,n){this.api._onDidDimensionChange.fire({width:t,height:n}),this.view.layout(t,n)}dispose(){this.api.dispose(),this.view.dispose()}}class zg extends ce{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-default-tab",this._content=document.createElement("div"),this._content.className="dv-default-tab-content",this.action=document.createElement("div"),this.action.className="dv-default-tab-action",this.action.appendChild(OT()),this._element.appendChild(this._content),this._element.appendChild(this.action),this.render()}init(t){this._title=t.title,this.addDisposables(t.api.onDidTitleChange(n=>{this._title=n.title,this.render()}),pe(this.action,"pointerdown",n=>{n.preventDefault()}),pe(this.action,"click",n=>{n.defaultPrevented||(n.preventDefault(),t.api.close())})),this.render()}render(){var t;this._content.textContent!==this._title&&(this._content.textContent=(t=this._title)!==null&&t!==void 0?t:"")}}class nx{get content(){return this._content}get tab(){return this._tab}constructor(t,n,i,r){this.accessor=t,this.id=n,this.contentComponent=i,this.tabComponent=r,this._content=this.createContentComponent(this.id,i),this._tab=this.createTabComponent(this.id,r)}createTabRenderer(t){var n;const i=this.createTabComponent(this.id,this.tabComponent);return this._params&&i.init(Object.assign(Object.assign({},this._params),{tabLocation:t})),this._updateEvent&&((n=i.update)===null||n===void 0||n.call(i,this._updateEvent)),i}init(t){this._params=t,this.content.init(t),this.tab.init(Object.assign(Object.assign({},t),{tabLocation:"header"}))}layout(t,n){var i,r;(r=(i=this.content).layout)===null||r===void 0||r.call(i,t,n)}update(t){var n,i,r,o;this._updateEvent=t,(i=(n=this.content).update)===null||i===void 0||i.call(n,t),(o=(r=this.tab).update)===null||o===void 0||o.call(r,t)}dispose(){var t,n,i,r;(n=(t=this.content).dispose)===null||n===void 0||n.call(t),(r=(i=this.tab).dispose)===null||r===void 0||r.call(i)}createContentComponent(t,n){return this.accessor.options.createComponent({id:t,name:n})}createTabComponent(t,n){const i=n??this.accessor.options.defaultTabComponent;if(i){if(this.accessor.options.createTabComponent){const r=this.accessor.options.createTabComponent({id:t,name:i});return r||new zg}console.warn(`dockview: tabComponent '${n}' was not found. falling back to the default tab.`)}return new zg}}class qT{constructor(t){this.accessor=t}fromJSON(t,n){var i,r;const o=t.id,s=t.params,a=t.title,l=t.view,u=l?l.content.id:(i=t.contentComponent)!==null&&i!==void 0?i:"unknown",d=l?(r=l.tab)===null||r===void 0?void 0:r.id:t.tabComponent,c=new nx(this.accessor,o,u,d),h=new wr(o,u,d,this.accessor,new Cl(this.accessor),n,c,{renderer:t.renderer,minimumWidth:t.minimumWidth,minimumHeight:t.minimumHeight,maximumWidth:t.maximumWidth,maximumHeight:t.maximumHeight});return h.init({title:a??o,params:s??{}}),h}}class QT extends ce{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(t){}}class KT{constructor(){this._orderedList=[]}push(t){this._orderedList=[...this._orderedList.filter(n=>n!==t),t],this.update()}destroy(t){this._orderedList=this._orderedList.filter(n=>n!==t),this.update()}update(){for(let t=0;t<this._orderedList.length;t++)this._orderedList[t].setAttribute("aria-level",`${t}`),this._orderedList[t].style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${t*2})`}}const pa=new KT;class yn extends ce{set minimumInViewportWidth(t){this.options.minimumInViewportWidth=t}set minimumInViewportHeight(t){this.options.minimumInViewportHeight=t}get element(){return this._element}get isVisible(){return this._isVisible}constructor(t){super(),this.options=t,this._element=document.createElement("div"),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new B,this.onDidChangeEnd=this._onDidChangeEnd.event,this.addDisposables(this._onDidChange,this._onDidChangeEnd),this._element.className="dv-resize-container",this._isVisible=!0,this.setupResize("top"),this.setupResize("bottom"),this.setupResize("left"),this.setupResize("right"),this.setupResize("topleft"),this.setupResize("topright"),this.setupResize("bottomleft"),this.setupResize("bottomright"),this._element.appendChild(this.options.content),this.options.container.appendChild(this._element),this.setBounds(Object.assign(Object.assign(Object.assign(Object.assign({height:this.options.height,width:this.options.width},"top"in this.options&&{top:this.options.top}),"bottom"in this.options&&{bottom:this.options.bottom}),"left"in this.options&&{left:this.options.left}),"right"in this.options&&{right:this.options.right})),pa.push(this._element)}setVisible(t){t!==this.isVisible&&(this._isVisible=t,ne(this.element,"dv-hidden",!this.isVisible))}bringToFront(){pa.push(this._element)}setBounds(t={}){typeof t.height=="number"&&(this._element.style.height=`${t.height}px`),typeof t.width=="number"&&(this._element.style.width=`${t.width}px`),"top"in t&&typeof t.top=="number"&&(this._element.style.top=`${t.top}px`,this._element.style.bottom="auto",this.verticalAlignment="top"),"bottom"in t&&typeof t.bottom=="number"&&(this._element.style.bottom=`${t.bottom}px`,this._element.style.top="auto",this.verticalAlignment="bottom"),"left"in t&&typeof t.left=="number"&&(this._element.style.left=`${t.left}px`,this._element.style.right="auto",this.horiziontalAlignment="left"),"right"in t&&typeof t.right=="number"&&(this._element.style.right=`${t.right}px`,this._element.style.left="auto",this.horiziontalAlignment="right");const n=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),r=Math.max(0,this.getMinimumWidth(i.width)),o=Math.max(0,this.getMinimumHeight(i.height));if(this.verticalAlignment==="top"){const s=Ie(i.top-n.top,-o,Math.max(0,n.height-i.height+o));this._element.style.top=`${s}px`,this._element.style.bottom="auto"}if(this.verticalAlignment==="bottom"){const s=Ie(n.bottom-i.bottom,-o,Math.max(0,n.height-i.height+o));this._element.style.bottom=`${s}px`,this._element.style.top="auto"}if(this.horiziontalAlignment==="left"){const s=Ie(i.left-n.left,-r,Math.max(0,n.width-i.width+r));this._element.style.left=`${s}px`,this._element.style.right="auto"}if(this.horiziontalAlignment==="right"){const s=Ie(n.right-i.right,-r,Math.max(0,n.width-i.width+r));this._element.style.right=`${s}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const t=this.options.container.getBoundingClientRect(),n=this._element.getBoundingClientRect(),i={};return this.verticalAlignment==="top"?i.top=parseFloat(this._element.style.top):this.verticalAlignment==="bottom"?i.bottom=parseFloat(this._element.style.bottom):i.top=n.top-t.top,this.horiziontalAlignment==="left"?i.left=parseFloat(this._element.style.left):this.horiziontalAlignment==="right"?i.right=parseFloat(this._element.style.right):i.left=n.left-t.left,i.width=n.width,i.height=n.height,i}setupDrag(t,n={inDragMode:!1}){const i=new Je,r=()=>{let o=null;const s=kl();i.value=new ce({dispose:()=>{s.release()}},pe(window,"pointermove",a=>{const l=this.options.container.getBoundingClientRect(),u=a.clientX-l.left,d=a.clientY-l.top;ne(this._element,"dv-resize-container-dragging",!0);const c=this._element.getBoundingClientRect();o===null&&(o={x:a.clientX-c.left,y:a.clientY-c.top});const h=Math.max(0,this.getMinimumWidth(c.width)),p=Math.max(0,this.getMinimumHeight(c.height)),f=Ie(d-o.y,-p,Math.max(0,l.height-c.height+p)),v=Ie(o.y-d+l.height-c.height,-p,Math.max(0,l.height-c.height+p)),b=Ie(u-o.x,-h,Math.max(0,l.width-c.width+h)),m=Ie(o.x-u+l.width-c.width,-h,Math.max(0,l.width-c.width+h)),w={};f<=v?w.top=f:w.bottom=v,b<=m?w.left=b:w.right=m,this.setBounds(w)}),pe(window,"pointerup",()=>{ne(this._element,"dv-resize-container-dragging",!1),i.dispose(),this._onDidChangeEnd.fire()}))};this.addDisposables(i,pe(t,"pointerdown",o=>{if(o.defaultPrevented){o.preventDefault();return}Sg(o)||r()}),pe(this.options.content,"pointerdown",o=>{o.defaultPrevented||Sg(o)||o.shiftKey&&r()}),pe(this.options.content,"pointerdown",()=>{pa.push(this._element)},!0)),n.inDragMode&&r()}setupResize(t){const n=document.createElement("div");n.className=`dv-resize-handle-${t}`,this._element.appendChild(n);const i=new Je;this.addDisposables(i,pe(n,"pointerdown",r=>{r.preventDefault();let o=null;const s=kl();i.value=new ce(pe(window,"pointermove",a=>{const l=this.options.container.getBoundingClientRect(),u=this._element.getBoundingClientRect(),d=a.clientY-l.top,c=a.clientX-l.left;o===null&&(o={originalY:d,originalHeight:u.height,originalX:c,originalWidth:u.width});let h,p,f,v,b,m;const w=()=>{const E=o.originalY+o.originalHeight>l.height?Math.max(0,l.height-yn.MINIMUM_HEIGHT):Math.max(0,o.originalY+o.originalHeight-yn.MINIMUM_HEIGHT);h=Ie(d,0,E),f=o.originalY+o.originalHeight-h,p=l.height-h-f},g=()=>{h=o.originalY-o.originalHeight;const E=h<0&&typeof this.options.minimumInViewportHeight=="number"?-h+this.options.minimumInViewportHeight:yn.MINIMUM_HEIGHT,S=l.height-Math.max(0,h);f=Ie(d-h,E,S),p=l.height-h-f},y=()=>{const E=o.originalX+o.originalWidth>l.width?Math.max(0,l.width-yn.MINIMUM_WIDTH):Math.max(0,o.originalX+o.originalWidth-yn.MINIMUM_WIDTH);v=Ie(c,0,E),m=o.originalX+o.originalWidth-v,b=l.width-v-m},k=()=>{v=o.originalX-o.originalWidth;const E=v<0&&typeof this.options.minimumInViewportWidth=="number"?-v+this.options.minimumInViewportWidth:yn.MINIMUM_WIDTH,S=l.width-Math.max(0,v);m=Ie(c-v,E,S),b=l.width-v-m};switch(t){case"top":w();break;case"bottom":g();break;case"left":y();break;case"right":k();break;case"topleft":w(),y();break;case"topright":w(),k();break;case"bottomleft":g(),y();break;case"bottomright":g(),k();break}const _={};h<=p?_.top=h:_.bottom=p,v<=b?_.left=v:_.right=b,_.height=f,_.width=m,this.setBounds(_)}),{dispose:()=>{s.release()}},pe(window,"pointerup",()=>{i.dispose(),this._onDidChangeEnd.fire()}))}))}getMinimumWidth(t){return typeof this.options.minimumInViewportWidth=="number"?t-this.options.minimumInViewportWidth:0}getMinimumHeight(t){return typeof this.options.minimumInViewportHeight=="number"?t-this.options.minimumInViewportHeight:0}dispose(){pa.destroy(this._element),this._element.remove(),super.dispose()}}yn.MINIMUM_HEIGHT=20;yn.MINIMUM_WIDTH=20;class JT extends ce{constructor(t,n){super(),this.group=t,this.overlay=n,this.addDisposables(n)}position(t){this.overlay.setBounds(t)}}const fa=100,ei={left:100,top:100,width:300,height:300},eM=100;class tM{constructor(){this.cache=new Map,this.currentFrameId=0,this.rafId=null}getPosition(t){const n=this.cache.get(t);if(n&&n.frameId===this.currentFrameId)return n.rect;this.scheduleFrameUpdate();const i=Vd(t);return this.cache.set(t,{rect:i,frameId:this.currentFrameId}),i}invalidate(){this.currentFrameId++}scheduleFrameUpdate(){this.rafId||(this.rafId=requestAnimationFrame(()=>{this.currentFrameId++,this.rafId=null}))}}function nM(){const e=document.createElement("div");return e.tabIndex=-1,e}class Pg extends ce{constructor(t,n){super(),this.element=t,this.accessor=n,this.map={},this._disposed=!1,this.positionCache=new tM,this.pendingUpdates=new Set,this.addDisposables(je.from(()=>{for(const i of Object.values(this.map))i.disposable.dispose(),i.destroy.dispose();this._disposed=!0}))}updateAllPositions(){if(!this._disposed){this.positionCache.invalidate();for(const t of Object.values(this.map))t.panel.api.isVisible&&t.resize&&t.resize()}}detatch(t){if(this.map[t.api.id]){const{disposable:n,destroy:i}=this.map[t.api.id];return n.dispose(),i.dispose(),delete this.map[t.api.id],!0}return!1}attach(t){const{panel:n,referenceContainer:i}=t;if(!this.map[n.api.id]){const d=nM();d.className="dv-render-overlay",d.style.visibility="hidden",this.map[n.api.id]={panel:n,disposable:je.NONE,destroy:je.NONE,element:d}}const r=this.map[n.api.id].element;n.view.content.element.parentElement!==r&&r.appendChild(n.view.content.element),r.parentElement!==this.element&&this.element.appendChild(r);const o=()=>{const d=n.api.id;this.pendingUpdates.has(d)||(this.pendingUpdates.add(d),requestAnimationFrame(()=>{if(this.pendingUpdates.delete(d),this.isDisposed||!this.map[d])return;const c=this.positionCache.getPosition(i.element),h=this.positionCache.getPosition(this.element),p=c.left-h.left,f=c.top-h.top,v=c.width,b=c.height;r.style.left=`${p}px`,r.style.top=`${f}px`,r.style.width=`${v}px`,r.style.height=`${b}px`,r.style.visibility==="hidden"&&(r.style.visibility=""),ne(r,"dv-render-overlay-float",n.group.api.location.type==="floating")}))},s=()=>{n.api.isVisible&&(this.positionCache.invalidate(),o()),r.style.display=n.api.isVisible?"":"none"},a=new Je,l=()=>{n.api.location.type==="floating"?queueMicrotask(()=>{const d=this.accessor.floatingGroups.find(f=>f.group===n.api.group);if(!d)return;const c=d.overlay.element,h=()=>{const f=Number(c.getAttribute("aria-level"));r.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${f*2+1})`},p=new MutationObserver(()=>{h()});a.value=je.from(()=>p.disconnect()),p.observe(c,{attributeFilter:["aria-level"],attributes:!0}),h()}):r.style.zIndex=""},u=new ce(a,new Yy(r,{onDragEnd:d=>{i.dropTarget.dnd.onDragEnd(d)},onDragEnter:d=>{i.dropTarget.dnd.onDragEnter(d)},onDragLeave:d=>{i.dropTarget.dnd.onDragLeave(d)},onDrop:d=>{i.dropTarget.dnd.onDrop(d)},onDragOver:d=>{i.dropTarget.dnd.onDragOver(d)}}),n.api.onDidVisibilityChange(()=>{s()}),n.api.onDidDimensionsChange(()=>{n.api.isVisible&&o()}),n.api.onDidLocationChange(()=>{l()}));return this.map[n.api.id].destroy=je.from(()=>{var d;n.view.content.element.parentElement===r&&r.removeChild(n.view.content.element),(d=r.parentElement)===null||d===void 0||d.removeChild(r)}),l(),queueMicrotask(()=>{this.isDisposed||s()}),this.map[n.api.id].disposable.dispose(),this.map[n.api.id].disposable=u,this.map[n.api.id].resize=o,r}}function iM(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(d){try{u(i.next(d))}catch(c){s(c)}}function l(d){try{u(i.throw(d))}catch(c){s(c)}}function u(d){d.done?o(d.value):r(d.value).then(a,l)}u((i=i.apply(e,[])).next())})}class rM extends ce{get window(){var t,n;return(n=(t=this._window)===null||t===void 0?void 0:t.value)!==null&&n!==void 0?n:null}constructor(t,n,i){super(),this.target=t,this.className=n,this.options=i,this._onWillClose=new B,this.onWillClose=this._onWillClose.event,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,this._window=null,this.addDisposables(this._onWillClose,this._onDidClose,{dispose:()=>{this.close()}})}dimensions(){if(!this._window)return null;const t=this._window.value.screenX,n=this._window.value.screenY,i=this._window.value.innerWidth,r=this._window.value.innerHeight;return{top:n,left:t,width:i,height:r}}close(){var t,n;this._window&&(this._onWillClose.fire(),(n=(t=this.options).onWillClose)===null||n===void 0||n.call(t,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var t,n;return iM(this,void 0,void 0,function*(){if(this._window)throw new Error("instance of popout window is already open");const i=`${this.options.url}`,r=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map(([l,u])=>`${l}=${u}`).join(","),o=window.open(i,this.target,r);if(!o)return null;const s=new ce;this._window={value:o,disposable:s},s.addDisposables(je.from(()=>{o.close()}),pe(window,"beforeunload",()=>{this.close()}));const a=this.createPopoutWindowContainer();return this.className&&a.classList.add(this.className),(n=(t=this.options).onDidOpen)===null||n===void 0||n.call(t,{id:this.target,window:o}),new Promise((l,u)=>{o.addEventListener("unload",d=>{}),o.addEventListener("load",()=>{try{const d=o.document;d.title=document.title,d.body.appendChild(a),QN(d,window.document.styleSheets),pe(o,"beforeunload",()=>{this.close()}),l(a)}catch(d){u(d)}})})})}createPopoutWindowContainer(){const t=document.createElement("div");return t.classList.add("dv-popout-window"),t.id="dv-popout-window",t.style.position="absolute",t.style.width="100%",t.style.height="100%",t.style.top="0px",t.style.left="0px",t}}class oM extends ce{constructor(t){super(),this.accessor=t,this.init()}init(){const t=new Set,n=new Set;this.addDisposables(this.accessor.onDidAddPanel(i=>{if(t.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${i.api.id} but panel already exists`);t.add(i.api.id)}),this.accessor.onDidRemovePanel(i=>{if(t.has(i.api.id))t.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${i.api.id} but panel does not exists`)}),this.accessor.onDidAddGroup(i=>{if(n.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${i.api.id} but group already exists`);n.add(i.api.id)}),this.accessor.onDidRemoveGroup(i=>{if(n.has(i.api.id))n.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${i.api.id} but group does not exists`)}))}}class sM extends ce{constructor(t){super(),this.root=t,this._active=null,this._activeDisposable=new Je,this._element=document.createElement("div"),this._element.className="dv-popover-anchor",this._element.style.position="relative",this.root.prepend(this._element),this.addDisposables(je.from(()=>{this.close()}),this._activeDisposable)}openPopover(t,n){var i;this.close();const r=document.createElement("div");r.style.position="absolute",r.style.zIndex=(i=n.zIndex)!==null&&i!==void 0?i:"var(--dv-overlay-z-index)",r.appendChild(t);const o=this._element.getBoundingClientRect(),s=o.left,a=o.top;r.style.top=`${n.y-a}px`,r.style.left=`${n.x-s}px`,this._element.appendChild(r),this._active=r,this._activeDisposable.value=new ce(pe(window,"pointerdown",l=>{var u;const d=l.target;if(!(d instanceof HTMLElement))return;let c=d;for(;c&&c!==r;)c=(u=c==null?void 0:c.parentElement)!==null&&u!==void 0?u:null;c||this.close()}),pe(window,"resize",()=>{this.close()})),requestAnimationFrame(()=>{oT(r,this.root)})}close(){this._active&&(this._active.remove(),this._activeDisposable.dispose(),this._active=null)}}class Ag extends ce{get disabled(){return this._disabled}set disabled(t){var n;this.disabled!==t&&(this._disabled=t,t&&((n=this.model)===null||n===void 0||n.clear()))}get model(){if(!this.disabled)return{clear:()=>{var t;this._model&&((t=this._model.root.parentElement)===null||t===void 0||t.removeChild(this._model.root)),this._model=void 0},exists:()=>!!this._model,getElements:(t,n)=>{const i=this._outline!==n;if(this._outline=n,this._model)return this._model.changed=i,this._model;const r=this.createContainer(),o=this.createAnchor();if(this._model={root:r,overlay:o,changed:i},r.appendChild(o),this.element.appendChild(r),(t==null?void 0:t.target)instanceof HTMLElement){const s=t.target.getBoundingClientRect(),a=this.element.getBoundingClientRect();o.style.left=`${s.left-a.left}px`,o.style.top=`${s.top-a.top}px`}return this._model}}}constructor(t,n){super(),this.element=t,this._disabled=!1,this._disabled=n.disabled,this.addDisposables(je.from(()=>{var i;(i=this.model)===null||i===void 0||i.clear()}))}createContainer(){const t=document.createElement("div");return t.className="dv-drop-target-container",t}createAnchor(){const t=document.createElement("div");return t.className="dv-drop-target-anchor",t.style.visibility="hidden",t}}const Ig={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function ma(e){const t=e.from.activePanel;[...e.from.panels].map(i=>{const r=e.from.model.removePanel(i);return e.from.model.renderContainer.detatch(i),r}).forEach(i=>{e.to.model.openPanel(i,{skipSetActive:t!==i,skipSetGroupActive:!0})})}class aM extends Wy{get orientation(){return this.gridview.orientation}get totalPanels(){return this.panels.length}get panels(){return this.groups.flatMap(t=>t.panels)}get options(){return this._options}get activePanel(){const t=this.activeGroup;if(t)return t.activePanel}get renderer(){var t;return(t=this.options.defaultRenderer)!==null&&t!==void 0?t:"onlyWhenVisible"}get defaultHeaderPosition(){var t;return(t=this.options.defaultHeaderPosition)!==null&&t!==void 0?t:"top"}get api(){return this._api}get floatingGroups(){return this._floatingGroups}get popoutRestorationPromise(){return this._popoutRestorationPromise}constructor(t,n){var i,r,o;super(t,{proportionalLayout:!0,orientation:re.HORIZONTAL,styles:n.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:n.disableAutoResizing,locked:n.locked,margin:(r=(i=n.theme)===null||i===void 0?void 0:i.gap)!==null&&r!==void 0?r:0,className:n.className}),this.nextGroupId=Sp(),this._deserializer=new qT(this),this._watermark=null,this._onWillDragPanel=new B,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new B,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new B,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new B,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new B,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new B,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPopoutGroupSizeChange=new B,this.onDidPopoutGroupSizeChange=this._onDidPopoutGroupSizeChange.event,this._onDidPopoutGroupPositionChange=new B,this.onDidPopoutGroupPositionChange=this._onDidPopoutGroupPositionChange.event,this._onDidOpenPopoutWindowFail=new B,this.onDidOpenPopoutWindowFail=this._onDidOpenPopoutWindowFail.event,this._onDidLayoutFromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new B({replay:!0}),this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new B,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new B,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._popoutRestorationPromise=Promise.resolve(),this._onDidRemoveGroup=new B,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new B,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidOptionsChange=new B,this.onDidOptionsChange=this._onDidOptionsChange.event,this._onDidActiveGroupChange=new B,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this._options=n,this.popupService=new sM(this.element),this._themeClassnames=new cu(this.element),this._api=new Cl(this),this.rootDropTargetContainer=new Ag(this.element,{disabled:!0}),this.overlayRenderContainer=new Pg(this.gridview.element,this),this._rootDropTarget=new rn(this.element,{className:"dv-drop-target-edge",canDisplayOverlay:(s,a)=>{const l=rt();if(l)return l.viewId!==this.id?!1:a==="center"?this.gridview.length===0:!0;if(a==="center"&&this.gridview.length!==0)return!1;const u=new Jy(s,"edge",a,rt);return this._onUnhandledDragOverEvent.fire(u),u.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:(o=n.rootOverlayModel)!==null&&o!==void 0?o:Ig,getOverrideTarget:()=>{var s;return(s=this.rootDropTargetContainer)===null||s===void 0?void 0:s.model}}),this.updateDropTargetModel(n),ne(this.gridview.element,"dv-dockview",!0),ne(this.element,"dv-debug",!!n.debug),this.updateTheme(),this.updateWatermark(),n.debug&&this.addDisposables(new oM(this)),this.addDisposables(this.rootDropTargetContainer,this.overlayRenderContainer,this._onWillDragPanel,this._onWillDragGroup,this._onWillShowOverlay,this._onDidActivePanelChange,this._onDidAddPanel,this._onDidRemovePanel,this._onDidLayoutFromJSON,this._onDidDrop,this._onWillDrop,this._onDidMovePanel,this._onDidMovePanel.event(()=>{this.debouncedUpdateAllPositions()}),this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this._onUnhandledDragOverEvent,this._onDidMaximizedGroupChange,this._onDidOptionsChange,this._onDidPopoutGroupSizeChange,this._onDidPopoutGroupPositionChange,this._onDidOpenPopoutWindowFail,this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.updateWatermark()}),this.onDidAdd(s=>{this._moving||this._onDidAddGroup.fire(s)}),this.onDidRemove(s=>{this._moving||this._onDidRemoveGroup.fire(s)}),this.onDidActiveChange(s=>{this._moving||this._onDidActiveGroupChange.fire(s)}),this.onDidMaximizedChange(s=>{this._onDidMaximizedGroupChange.fire({group:s.panel,isMaximized:s.isMaximized})}),Xi.any(this.onDidAdd,this.onDidRemove)(()=>{this.updateWatermark()}),Xi.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange,this.onDidPopoutGroupPositionChange,this.onDidPopoutGroupSizeChange)(()=>{this._bufferOnDidLayoutChange.fire()}),je.from(()=>{for(const s of[...this._floatingGroups])s.dispose();for(const s of[...this._popoutGroups])s.disposable.dispose()}),this._rootDropTarget,this._rootDropTarget.onWillShowOverlay(s=>{this.gridview.length>0&&s.position==="center"||this._onWillShowOverlay.fire(new du(s,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:rt}))}),this._rootDropTarget.onDrop(s=>{var a;const l=new ex({nativeEvent:s.nativeEvent,position:s.position,panel:void 0,api:this._api,group:void 0,getData:rt,kind:"edge"});if(this._onWillDrop.fire(l),l.defaultPrevented)return;const u=rt();u?this.moveGroupOrPanel({from:{groupId:u.groupId,panelId:(a=u.panelId)!==null&&a!==void 0?a:void 0},to:{group:this.orthogonalize(s.position),position:"center"}}):this._onDidDrop.fire(new Pp({nativeEvent:s.nativeEvent,position:s.position,panel:void 0,api:this._api,group:void 0,getData:rt}))}),this._rootDropTarget)}setVisible(t,n){switch(t.api.location.type){case"grid":super.setVisible(t,n);break;case"floating":{const i=this.floatingGroups.find(r=>r.group===t);i&&(i.overlay.setVisible(n),t.api._onDidVisibilityChange.fire({isVisible:n}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window");break}}addPopoutGroup(t,n){var i,r,o,s,a;if(t instanceof wr&&t.group.size===1)return this.addPopoutGroup(t.group,n);const l=tT(this.gridview.element),u=this.element;function d(){return n!=null&&n.position?n.position:t instanceof Dg?t.element.getBoundingClientRect():t.group?t.group.element.getBoundingClientRect():u.getBoundingClientRect()}const c=d(),h=(r=(i=n==null?void 0:n.overridePopoutGroup)===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:this.getNextGroupId(),p=new rM(`${this.id}-${h}`,l??"",{url:(a=(o=n==null?void 0:n.popoutUrl)!==null&&o!==void 0?o:(s=this.options)===null||s===void 0?void 0:s.popoutUrl)!==null&&a!==void 0?a:"/popout.html",left:window.screenX+c.left,top:window.screenY+c.top,width:c.width,height:c.height,onDidOpen:n==null?void 0:n.onDidOpen,onWillClose:n==null?void 0:n.onWillClose}),f=new ce(p,p.onDidClose(()=>{f.dispose()}));return p.open().then(v=>{var b;if(p.isDisposed)return!1;const m=n!=null&&n.referenceGroup?n.referenceGroup:t instanceof wr?t.group:t,w=t.api.location.type,g=m.element.parentElement!==null;let y;if(g?n!=null&&n.overridePopoutGroup?y=n.overridePopoutGroup:(y=this.createGroup({id:h}),v&&this._onDidAddGroup.fire(y)):y=m,v===null)return console.error("dockview: failed to create popout. perhaps you need to allow pop-ups for this website"),f.dispose(),this._onDidOpenPopoutWindowFail.fire(),this.movingLock(()=>ma({from:y,to:m})),m.api.isVisible||m.api.setVisible(!0),!1;const k=document.createElement("div");k.className="dv-overlay-render-container";const _=new Pg(k,this);y.model.renderContainer=_,y.layout(p.window.innerWidth,p.window.innerHeight);let E;if(!(n!=null&&n.overridePopoutGroup)&&g)if(t instanceof wr)this.movingLock(()=>{const D=m.model.removePanel(t);y.model.openPanel(D)});else switch(this.movingLock(()=>ma({from:m,to:y})),w){case"grid":m.api.setVisible(!1);break;case"floating":case"popout":E=(b=this._floatingGroups.find(D=>D.group.api.id===t.api.id))===null||b===void 0?void 0:b.overlay.toJSON(),this.removeGroup(m);break}v.classList.add("dv-dockview"),v.style.overflow="hidden",v.appendChild(k),v.appendChild(y.element);const S=document.createElement("div"),T=new Ag(S,{disabled:this.rootDropTargetContainer.disabled});v.appendChild(S),y.model.dropTargetContainer=T,y.model.location={type:"popout",getWindow:()=>p.window,popoutUrl:n==null?void 0:n.popoutUrl},g&&t.api.location.type==="grid"&&t.api.setVisible(!1),this.doSetGroupAndPanelActive(y),f.addDisposables(y.api.onDidActiveChange(D=>{var P;D.isActive&&((P=p.window)===null||P===void 0||P.focus())}),y.api.onWillFocus(()=>{var D;(D=p.window)===null||D===void 0||D.focus()}));let C;const I=g&&m&&this.getPanel(m.id),L={window:p,popoutGroup:y,referenceGroup:I?m.id:void 0,disposable:{dispose:()=>(f.dispose(),C)}},V=iT(p.window);return f.addDisposables(V,rT(p.window,()=>{this._onDidPopoutGroupSizeChange.fire({width:p.window.innerWidth,height:p.window.innerHeight,group:y})}),V.event(()=>{this._onDidPopoutGroupPositionChange.fire({screenX:p.window.screenX,screenY:p.window.screenX,group:y})}),pe(p.window,"resize",()=>{y.layout(p.window.innerWidth,p.window.innerHeight)}),_,je.from(()=>{if(!this.isDisposed){if(g&&this.getPanel(m.id))this.movingLock(()=>ma({from:y,to:m})),m.api.isVisible||m.api.setVisible(!0),this.getPanel(y.id)&&this.doRemoveGroup(y,{skipPopoutAssociated:!0});else if(this.getPanel(y.id)){if(y.model.renderContainer=this.overlayRenderContainer,y.model.dropTargetContainer=this.rootDropTargetContainer,C=y,!this._popoutGroups.find(P=>P.popoutGroup===y))return;E?this.addFloatingGroup(y,{height:E.height,width:E.width,position:E}):(this.doRemoveGroup(y,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),y.model.location={type:"grid"},this.movingLock(()=>{this.doAddGroup(y,[0])})),this.doSetGroupAndPanelActive(y)}}})),this._popoutGroups.push(L),this.updateWatermark(),!0}).catch(v=>(console.error("dockview: failed to create popout.",v),!1))}addFloatingGroup(t,n){var i,r,o,s,a;let l;if(t instanceof wr)l=this.createGroup(),this._onDidAddGroup.fire(l),this.movingLock(()=>this.removePanel(t,{removeEmptyGroup:!0,skipDispose:!0,skipSetActiveGroup:!0})),this.movingLock(()=>l.model.openPanel(t,{skipSetGroupActive:!0}));else{l=t;const v=(i=this._popoutGroups.find(w=>w.popoutGroup===l))===null||i===void 0?void 0:i.referenceGroup,b=v?this.getPanel(v):void 0;typeof(n==null?void 0:n.skipRemoveGroup)=="boolean"&&n.skipRemoveGroup||(b?(this.movingLock(()=>ma({from:t,to:b})),this.doRemoveGroup(t,{skipPopoutReturn:!0,skipPopoutAssociated:!0}),this.doRemoveGroup(b,{skipDispose:!0}),l=b):this.doRemoveGroup(t,{skipDispose:!0,skipPopoutReturn:!0,skipPopoutAssociated:!1}))}function u(){if(n!=null&&n.position){const v={};return"left"in n.position?v.left=Math.max(n.position.left,0):"right"in n.position?v.right=Math.max(n.position.right,0):v.left=ei.left,"top"in n.position?v.top=Math.max(n.position.top,0):"bottom"in n.position?v.bottom=Math.max(n.position.bottom,0):v.top=ei.top,typeof n.width=="number"?v.width=Math.max(n.width,0):v.width=ei.width,typeof n.height=="number"?v.height=Math.max(n.height,0):v.height=ei.height,v}return{left:typeof(n==null?void 0:n.x)=="number"?Math.max(n.x,0):ei.left,top:typeof(n==null?void 0:n.y)=="number"?Math.max(n.y,0):ei.top,width:typeof(n==null?void 0:n.width)=="number"?Math.max(n.width,0):ei.width,height:typeof(n==null?void 0:n.height)=="number"?Math.max(n.height,0):ei.height}}const d=u(),c=new yn(Object.assign(Object.assign({container:this.gridview.element,content:l.element},d),{minimumInViewportWidth:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(o=(r=this.options.floatingGroupBounds)===null||r===void 0?void 0:r.minimumWidthWithinViewport)!==null&&o!==void 0?o:fa,minimumInViewportHeight:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(a=(s=this.options.floatingGroupBounds)===null||s===void 0?void 0:s.minimumHeightWithinViewport)!==null&&a!==void 0?a:fa})),h=l.element.querySelector(".dv-void-container");if(!h)throw new Error("dockview: failed to find drag handle");c.setupDrag(h,{inDragMode:typeof(n==null?void 0:n.inDragMode)=="boolean"?n.inDragMode:!1});const p=new JT(l,c),f=new ce(l.api.onDidActiveChange(v=>{v.isActive&&c.bringToFront()}),uu(l.element,v=>{const{width:b,height:m}=v.contentRect;l.layout(b,m)}));p.addDisposables(c.onDidChange(()=>{l.layout(l.width,l.height)}),c.onDidChangeEnd(()=>{this._bufferOnDidLayoutChange.fire()}),l.onDidChange(v=>{c.setBounds({height:v==null?void 0:v.height,width:v==null?void 0:v.width})}),{dispose:()=>{f.dispose(),wc(this._floatingGroups,p),l.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(p),l.model.location={type:"floating"},n!=null&&n.skipActiveGroup||this.doSetGroupAndPanelActive(l),this.updateWatermark()}orthogonalize(t,n){switch(this.gridview.normalize(),t){case"top":case"bottom":this.gridview.orientation===re.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===re.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break}switch(t){case"top":case"left":case"center":return this.createGroupAtLocation([0],void 0,n);case"bottom":case"right":return this.createGroupAtLocation([this.gridview.length],void 0,n);default:throw new Error(`dockview: unsupported position ${t}`)}}updateOptions(t){var n,i;if(super.updateOptions(t),"floatingGroupBounds"in t)for(const s of this._floatingGroups){switch(t.floatingGroupBounds){case"boundedWithinViewport":s.overlay.minimumInViewportHeight=void 0,s.overlay.minimumInViewportWidth=void 0;break;case void 0:s.overlay.minimumInViewportHeight=fa,s.overlay.minimumInViewportWidth=fa;break;default:s.overlay.minimumInViewportHeight=(n=t.floatingGroupBounds)===null||n===void 0?void 0:n.minimumHeightWithinViewport,s.overlay.minimumInViewportWidth=(i=t.floatingGroupBounds)===null||i===void 0?void 0:i.minimumWidthWithinViewport}s.overlay.setBounds()}this.updateDropTargetModel(t);const r=this.options.disableDnd;this._options=Object.assign(Object.assign({},this.options),t);const o=this.options.disableDnd;if(r!==o&&this.updateDragAndDropState(),"theme"in t&&this.updateTheme(),"createRightHeaderActionComponent"in t||"createLeftHeaderActionComponent"in t||"createPrefixHeaderActionComponent"in t)for(const s of this.groups)s.model.updateHeaderActions();this.layout(this.gridview.width,this.gridview.height,!0)}layout(t,n,i){if(super.layout(t,n,i),this._floatingGroups)for(const r of this._floatingGroups)r.overlay.setBounds()}updateDragAndDropState(){for(const t of this.groups)t.model.updateDragAndDropState()}focus(){var t;(t=this.activeGroup)===null||t===void 0||t.focus()}getGroupPanel(t){return this.panels.find(n=>n.id===t)}setActivePanel(t){t.group.model.openPanel(t),this.doSetGroupAndPanelActive(t.group)}moveToNext(t={}){var n;if(!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}if(t.includePanel&&t.group&&t.group.activePanel!==t.group.panels[t.group.panels.length-1]){t.group.model.moveToNext({suppressRoll:!0});return}const i=Oe(t.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupAndPanelActive(r)}moveToPrevious(t={}){var n;if(!t.group){if(!this.activeGroup)return;t.group=this.activeGroup}if(t.includePanel&&t.group&&t.group.activePanel!==t.group.panels[0]){t.group.model.moveToPrevious({suppressRoll:!0});return}const i=Oe(t.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;r&&this.doSetGroupAndPanelActive(r)}toJSON(){var t;const n=this.gridview.serialize(),i=this.panels.reduce((a,l)=>(a[l.id]=l.toJSON(),a),{}),r=this._floatingGroups.map(a=>({data:a.group.toJSON(),position:a.overlay.toJSON()})),o=this._popoutGroups.map(a=>({data:a.popoutGroup.toJSON(),gridReferenceGroup:a.referenceGroup,position:a.window.dimensions(),url:a.popoutGroup.api.location.type==="popout"?a.popoutGroup.api.location.popoutUrl:void 0})),s={grid:n,panels:i,activeGroup:(t=this.activeGroup)===null||t===void 0?void 0:t.id};return r.length>0&&(s.floatingGroups=r),o.length>0&&(s.popoutGroups=o),s}fromJSON(t,n){var i,r;const o=new Map;let s;if(n!=null&&n.reuseExistingPanels){s=this.createGroup(),this._groups.delete(s.api.id);const d=Object.keys(t.panels);for(const c of this.panels)d.includes(c.api.id)&&o.set(c.api.id,c);this.movingLock(()=>{Array.from(o.values()).forEach(c=>{this.moveGroupOrPanel({from:{groupId:c.api.group.api.id,panelId:c.api.id},to:{group:s,position:"center"},keepEmptyGroups:!0})})})}if(this.clear(),typeof t!="object"||t===null)throw new Error("dockview: serialized layout must be a non-null object");const{grid:a,panels:l,activeGroup:u}=t;if(a.root.type!=="branch"||!Array.isArray(a.root.data))throw new Error("dockview: root must be of type branch");try{const d=this.width,c=this.height,h=b=>{const{id:m,locked:w,hideHeader:g,headerPosition:y,views:k,activeView:_}=b;if(typeof m!="string")throw new Error("dockview: group id must be of type string");const E=this.createGroup({id:m,locked:!!w,hideHeader:!!g,headerPosition:y});this._onDidAddGroup.fire(E);const S=[];for(const T of k){const C=o.get(T);if(s&&C)this.movingLock(()=>{s.model.removePanel(C)}),S.push(C),C.updateFromStateModel(l[T]);else{const I=this._deserializer.fromJSON(l[T],E);S.push(I)}}for(let T=0;T<k.length;T++){const C=S[T],I=typeof _=="string"&&_===C.id;o.has(C.api.id)?this.movingLock(()=>{E.model.openPanel(C,{skipSetActive:!I,skipSetGroupActive:!0})}):E.model.openPanel(C,{skipSetActive:!I,skipSetGroupActive:!0})}return!E.activePanel&&E.panels.length>0&&E.model.openPanel(E.panels[E.panels.length-1],{skipSetGroupActive:!0}),E};this.gridview.deserialize(a,{fromJSON:b=>h(b.data)}),this.layout(d,c,!0);const p=(i=t.floatingGroups)!==null&&i!==void 0?i:[];for(const b of p){const{data:m,position:w}=b,g=h(m);this.addFloatingGroup(g,{position:w,width:w.width,height:w.height,skipRemoveGroup:!0,inDragMode:!1})}const f=(r=t.popoutGroups)!==null&&r!==void 0?r:[],v=[];f.forEach((b,m)=>{const{data:w,position:g,gridReferenceGroup:y,url:k}=b,_=h(w),E=new Promise(S=>{setTimeout(()=>{this.addPopoutGroup(_,{position:g??void 0,overridePopoutGroup:y?_:void 0,referenceGroup:y?this.getPanel(y):void 0,popoutUrl:k}),S()},m*eM)});v.push(E)}),this._popoutRestorationPromise=Promise.all(v).then(()=>{});for(const b of this._floatingGroups)b.overlay.setBounds();if(typeof u=="string"){const b=this.getPanel(u);b&&this.doSetGroupAndPanelActive(b)}}catch(d){console.error("dockview: failed to deserialize layout. Reverting changes",d);for(const c of this.groups)for(const h of c.panels)this.removePanel(h,{removeEmptyGroup:!1,skipDispose:!1});for(const c of this.groups)c.dispose(),this._groups.delete(c.id),this._onDidRemoveGroup.fire(c);for(const c of[...this._floatingGroups])c.dispose();throw this.clear(),d}this.updateWatermark(),this.debouncedUpdateAllPositions(),this._onDidLayoutFromJSON.fire()}clear(){const t=Array.from(this._groups.values()).map(i=>i.value),n=!!this.activeGroup;for(const i of t)this.removeGroup(i,{skipActive:!0});n&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const t of this._groups.entries()){const[n,i]=t;i.value.model.closeAllPanels()}}addPanel(t){var n,i;if(this.panels.find(l=>l.id===t.id))throw new Error(`dockview: panel with id ${t.id} already exists`);let r;if(t.position&&t.floating)throw new Error("dockview: you can only provide one of: position, floating as arguments to .addPanel(...)");const o={width:t.initialWidth,height:t.initialHeight};let s;if(t.position)if(HT(t.position)){const l=typeof t.position.referencePanel=="string"?this.getGroupPanel(t.position.referencePanel):t.position.referencePanel;if(s=t.position.index,!l)throw new Error(`dockview: referencePanel '${t.position.referencePanel}' does not exist`);r=this.findGroup(l)}else if(GT(t.position)){if(r=typeof t.position.referenceGroup=="string"?(n=this._groups.get(t.position.referenceGroup))===null||n===void 0?void 0:n.value:t.position.referenceGroup,s=t.position.index,!r)throw new Error(`dockview: referenceGroup '${t.position.referenceGroup}' does not exist`)}else{const l=this.orthogonalize(Eg(t.position.direction)),u=this.createPanel(t,l);return l.model.openPanel(u,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),t.inactive||this.doSetGroupAndPanelActive(l),l.api.setSize({height:o==null?void 0:o.height,width:o==null?void 0:o.width}),u}else r=this.activeGroup;let a;if(r){const l=Sl(((i=t.position)===null||i===void 0?void 0:i.direction)||"within");if(t.floating){const u=this.createGroup();this._onDidAddGroup.fire(u);const d=typeof t.floating=="object"&&t.floating!==null?t.floating:{};this.addFloatingGroup(u,Object.assign(Object.assign({},d),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(t,u),u.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s})}else if(r.api.location.type==="floating"||l==="center")a=this.createPanel(t,r),r.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),r.api.setSize({width:o==null?void 0:o.width,height:o==null?void 0:o.height}),t.inactive||this.doSetGroupAndPanelActive(r);else{const u=Oe(r.element),d=bn(this.gridview.orientation,u,l),c=this.createGroupAtLocation(d,this.orientationAtLocation(d)===re.VERTICAL?o==null?void 0:o.height:o==null?void 0:o.width);a=this.createPanel(t,c),c.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),t.inactive||this.doSetGroupAndPanelActive(c)}}else if(t.floating){const l=this.createGroup();this._onDidAddGroup.fire(l);const u=typeof t.floating=="object"&&t.floating!==null?t.floating:{};this.addFloatingGroup(l,Object.assign(Object.assign({},u),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(t,l),l.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s})}else{const l=this.createGroupAtLocation([0],this.gridview.orientation===re.VERTICAL?o==null?void 0:o.height:o==null?void 0:o.width);a=this.createPanel(t,l),l.model.openPanel(a,{skipSetActive:t.inactive,skipSetGroupActive:t.inactive,index:s}),t.inactive||this.doSetGroupAndPanelActive(l)}return a}removePanel(t,n={removeEmptyGroup:!0}){const i=t.group;if(!i)throw new Error(`dockview: cannot remove panel ${t.id}. it's missing a group.`);i.model.removePanel(t,{skipSetActiveGroup:n.skipSetActiveGroup}),n.skipDispose||(t.group.model.renderContainer.detatch(t),t.dispose()),i.size===0&&n.removeEmptyGroup&&this.removeGroup(i,{skipActive:n.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new QT}updateWatermark(){var t,n;if(this.groups.filter(i=>i.api.location.type==="grid"&&i.api.isVisible).length===0){if(!this._watermark){this._watermark=this.createWatermarkComponent(),this._watermark.init({containerApi:new Cl(this)});const i=document.createElement("div");i.className="dv-watermark-container",JN(i,"watermark-component"),i.appendChild(this._watermark.element),this.gridview.element.appendChild(i)}}else this._watermark&&(this._watermark.element.parentElement.remove(),(n=(t=this._watermark).dispose)===null||n===void 0||n.call(t),this._watermark=null)}addGroup(t){var n;if(t){let i;if(BT(t)){const u=typeof t.referencePanel=="string"?this.panels.find(d=>d.id===t.referencePanel):t.referencePanel;if(!u)throw new Error(`dockview: reference panel ${t.referencePanel} does not exist`);if(i=this.findGroup(u),!i)throw new Error(`dockview: reference group for reference panel ${t.referencePanel} does not exist`)}else if($T(t)){if(i=typeof t.referenceGroup=="string"?(n=this._groups.get(t.referenceGroup))===null||n===void 0?void 0:n.value:t.referenceGroup,!i)throw new Error(`dockview: reference group ${t.referenceGroup} does not exist`)}else{const u=this.orthogonalize(Eg(t.direction),t);return t.skipSetActive||this.doSetGroupAndPanelActive(u),u}const r=Sl(t.direction||"within"),o=Oe(i.element),s=bn(this.gridview.orientation,o,r),a=this.createGroup(t),l=this.getLocationOrientation(s)===re.VERTICAL?t.initialHeight:t.initialWidth;return this.doAddGroup(a,s,l),t.skipSetActive||this.doSetGroupAndPanelActive(a),a}else{const i=this.createGroup(t);return this.doAddGroup(i),this.doSetGroupAndPanelActive(i),i}}getLocationOrientation(t){return t.length%2==0&&this.gridview.orientation===re.HORIZONTAL?re.HORIZONTAL:re.VERTICAL}removeGroup(t,n){this.doRemoveGroup(t,n)}doRemoveGroup(t,n){var i;const r=[...t.panels];if(!(n!=null&&n.skipDispose))for(const a of r)this.removePanel(a,{removeEmptyGroup:!1,skipDispose:(i=n==null?void 0:n.skipDispose)!==null&&i!==void 0?i:!1});const o=this.activePanel;if(t.api.location.type==="floating"){const a=this._floatingGroups.find(l=>l.group===t);if(a){if(n!=null&&n.skipDispose||(a.group.dispose(),this._groups.delete(t.id),this._onDidRemoveGroup.fire(t)),wc(this._floatingGroups,a),a.dispose(),!(n!=null&&n.skipActive)&&this._activeGroup===t){const l=Array.from(this._groups.values());this.doSetGroupAndPanelActive(l.length>0?l[0].value:void 0)}return a.group}throw new Error("dockview: failed to find floating group")}if(t.api.location.type==="popout"){const a=this._popoutGroups.find(l=>l.popoutGroup===t);if(a){if(!(n!=null&&n.skipDispose)){if(!(n!=null&&n.skipPopoutAssociated)){const u=a.referenceGroup?this.getPanel(a.referenceGroup):void 0;u&&u.panels.length===0&&this.removeGroup(u)}a.popoutGroup.dispose(),this._groups.delete(t.id),this._onDidRemoveGroup.fire(t)}wc(this._popoutGroups,a);const l=a.disposable.dispose();if(!(n!=null&&n.skipPopoutReturn)&&l&&(this.doAddGroup(l,[0]),this.doSetGroupAndPanelActive(l)),!(n!=null&&n.skipActive)&&this._activeGroup===t){const u=Array.from(this._groups.values());this.doSetGroupAndPanelActive(u.length>0?u[0].value:void 0)}return this.updateWatermark(),a.popoutGroup}throw new Error("dockview: failed to find popout group")}const s=super.doRemoveGroup(t,n);return n!=null&&n.skipActive||this.activePanel!==o&&this._onDidActivePanelChange.fire(this.activePanel),s}debouncedUpdateAllPositions(){this._updatePositionsFrameId!==void 0&&cancelAnimationFrame(this._updatePositionsFrameId),this._updatePositionsFrameId=requestAnimationFrame(()=>{this._updatePositionsFrameId=void 0,this.overlayRenderContainer.updateAllPositions()})}movingLock(t){const n=this._moving;try{return this._moving=!0,t()}finally{this._moving=n}}moveGroupOrPanel(t){var n;const i=t.to.group,r=t.from.groupId,o=t.from.panelId,s=t.to.position,a=t.to.index,l=r?(n=this._groups.get(r))===null||n===void 0?void 0:n.value:void 0;if(!l)throw new Error(`dockview: Failed to find group id ${r}`);if(o===void 0){this.moveGroup({from:{group:l},to:{group:i,position:s},skipSetActive:t.skipSetActive});return}if(!s||s==="center"){const u=this.movingLock(()=>l.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!u)throw new Error(`dockview: No panel with id ${o}`);!t.keepEmptyGroups&&l.model.size===0&&this.doRemoveGroup(l,{skipActive:!0});const d=i.model.size===0;this.movingLock(()=>{var c;return i.model.openPanel(u,{index:a,skipSetActive:((c=t.skipSetActive)!==null&&c!==void 0?c:!1)&&!d,skipSetGroupActive:!0})}),t.skipSetActive||this.doSetGroupAndPanelActive(i),this._onDidMovePanel.fire({panel:u,from:l})}else{const u=Oe(i.element),d=bn(this.gridview.orientation,u,s);if(l.size<2){const[c,h]=Vn(d);if(l.api.location.type==="grid"){const b=Oe(l.element),[m,w]=Vn(b);if(By(m,c)){this.gridview.moveView(m,w,h),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:l});return}}if(l.api.location.type==="popout"){const b=this._popoutGroups.find(g=>g.popoutGroup===l),m=this.movingLock(()=>b.popoutGroup.model.removePanel(b.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0}));this.doRemoveGroup(l,{skipActive:!0});const w=this.createGroupAtLocation(d);this.movingLock(()=>w.model.openPanel(m,{skipSetActive:!0})),this.doSetGroupAndPanelActive(w),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:l});return}const p=this.movingLock(()=>this.doRemoveGroup(l,{skipActive:!0,skipDispose:!0})),f=Oe(i.element),v=bn(this.gridview.orientation,f,s);this.movingLock(()=>this.doAddGroup(p,v)),this.doSetGroupAndPanelActive(p),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:l})}else{const c=this.movingLock(()=>l.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!c)throw new Error(`dockview: No panel with id ${o}`);const h=bn(this.gridview.orientation,u,s),p=this.createGroupAtLocation(h);this.movingLock(()=>p.model.openPanel(c,{skipSetGroupActive:!0})),this.doSetGroupAndPanelActive(p),this._onDidMovePanel.fire({panel:c,from:l})}}}moveGroup(t){const n=t.from.group,i=t.to.group,r=t.to.position;if(r==="center"){const o=n.activePanel,s=this.movingLock(()=>[...n.panels].map(a=>n.model.removePanel(a.id,{skipSetActive:!0})));(n==null?void 0:n.model.size)===0&&this.doRemoveGroup(n,{skipActive:!0}),this.movingLock(()=>{for(const a of s)i.model.openPanel(a,{skipSetActive:a!==o,skipSetGroupActive:!0})}),t.skipSetActive!==!0?this.doSetGroupAndPanelActive(i):this.activePanel||this.doSetGroupAndPanelActive(i)}else{switch(n.api.location.type){case"grid":this.gridview.removeView(Oe(n.element));break;case"floating":{const o=this._floatingGroups.find(s=>s.group===n);if(!o)throw new Error("dockview: failed to find floating group");o.dispose();break}case"popout":{const o=this._popoutGroups.find(a=>a.popoutGroup===n);if(!o)throw new Error("dockview: failed to find popout group");const s=this._popoutGroups.indexOf(o);if(s>=0&&this._popoutGroups.splice(s,1),o.referenceGroup){const a=this.getPanel(o.referenceGroup);a&&!a.api.isVisible&&this.doRemoveGroup(a,{skipActive:!0})}o.window.dispose(),i.api.location.type==="grid"?(n.model.renderContainer=this.overlayRenderContainer,n.model.dropTargetContainer=this.rootDropTargetContainer,n.model.location={type:"grid"}):i.api.location.type==="floating"&&(n.model.renderContainer=this.overlayRenderContainer,n.model.dropTargetContainer=this.rootDropTargetContainer,n.model.location={type:"floating"});break}}if(i.api.location.type==="grid"){const o=Oe(i.element),s=bn(this.gridview.orientation,o,r);let a;switch(this.gridview.orientation){case re.VERTICAL:a=o.length%2==0?n.api.width:n.api.height;break;case re.HORIZONTAL:a=o.length%2==0?n.api.height:n.api.width;break}this.gridview.addView(n,a,s)}else if(i.api.location.type==="floating"){const o=this._floatingGroups.find(s=>s.group===i);if(o){const s=o.overlay.toJSON();let a,l;"left"in s?a=s.left+50:"right"in s?a=Math.max(0,s.right-s.width-50):a=50,"top"in s?l=s.top+50:"bottom"in s?l=Math.max(0,s.bottom-s.height-50):l=50,this.addFloatingGroup(n,{height:s.height,width:s.width,position:{left:a,top:l}})}}}if(n.panels.forEach(o=>{this._onDidMovePanel.fire({panel:o,from:n})}),this.debouncedUpdateAllPositions(),t.skipSetActive===!1){const o=i??n;this.doSetGroupAndPanelActive(o)}}doSetGroupActive(t){super.doSetGroupActive(t);const n=this.activePanel;!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}doSetGroupAndPanelActive(t){super.doSetGroupActive(t);const n=this.activePanel;t&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(t)&&this.exitMaximizedGroup(),!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}getNextGroupId(){let t=this.nextGroupId.next();for(;this._groups.has(t);)t=this.nextGroupId.next();return t}createGroup(t){t||(t={});let n=t==null?void 0:t.id;if(n&&this._groups.has(t.id)&&(console.warn(`dockview: Duplicate group id ${t==null?void 0:t.id}. reassigning group id to avoid errors`),n=void 0),!n)for(n=this.nextGroupId.next();this._groups.has(n);)n=this.nextGroupId.next();const i=new Dg(this,n,t);if(i.init({params:{},accessor:this}),!this._groups.has(i.id)){const r=new ce(i.model.onTabDragStart(o=>{this._onWillDragPanel.fire(o)}),i.model.onGroupDragStart(o=>{this._onWillDragGroup.fire(o)}),i.model.onMove(o=>{const{groupId:s,itemId:a,target:l,index:u}=o;this.moveGroupOrPanel({from:{groupId:s,panelId:a},to:{group:i,position:l,index:u}})}),i.model.onDidDrop(o=>{this._onDidDrop.fire(o)}),i.model.onWillDrop(o=>{this._onWillDrop.fire(o)}),i.model.onWillShowOverlay(o=>{if(this.options.disableDnd){o.preventDefault();return}this._onWillShowOverlay.fire(o)}),i.model.onUnhandledDragOverEvent(o=>{this._onUnhandledDragOverEvent.fire(o)}),i.model.onDidAddPanel(o=>{this._moving||this._onDidAddPanel.fire(o.panel)}),i.model.onDidRemovePanel(o=>{this._moving||this._onDidRemovePanel.fire(o.panel)}),i.model.onDidActivePanelChange(o=>{this._moving||o.panel===this.activePanel&&this._onDidActivePanelChange.value!==o.panel&&this._onDidActivePanelChange.fire(o.panel)}),Xi.any(i.model.onDidPanelTitleChange,i.model.onDidPanelParametersChange)(()=>{this._bufferOnDidLayoutChange.fire()}));this._groups.set(i.id,{value:i,disposable:r})}return i.initialize(),i}createPanel(t,n){var i,r,o;const s=t.component,a=(i=t.tabComponent)!==null&&i!==void 0?i:this.options.defaultTabComponent,l=new nx(this,t.id,s,a),u=new wr(t.id,s,a,this,this._api,n,l,{renderer:t.renderer,minimumWidth:t.minimumWidth,minimumHeight:t.minimumHeight,maximumWidth:t.maximumWidth,maximumHeight:t.maximumHeight});return u.init({title:(r=t.title)!==null&&r!==void 0?r:t.id,params:(o=t==null?void 0:t.params)!==null&&o!==void 0?o:{}}),u}createGroupAtLocation(t,n,i){const r=this.createGroup(i);return this.doAddGroup(r,t,n),r}findGroup(t){var n;return(n=Array.from(this._groups.values()).find(i=>i.value.model.containsPanel(t)))===null||n===void 0?void 0:n.value}orientationAtLocation(t){const n=this.gridview.orientation;return t.length%2==1?n:kn(n)}updateDropTargetModel(t){"dndEdges"in t&&(this._rootDropTarget.disabled=typeof t.dndEdges=="boolean"&&t.dndEdges===!1,typeof t.dndEdges=="object"&&t.dndEdges!==null?this._rootDropTarget.setOverlayModel(t.dndEdges):this._rootDropTarget.setOverlayModel(Ig)),"rootOverlayModel"in t&&this.updateDropTargetModel({dndEdges:t.dndEdges})}updateTheme(){var t,n;const i=(t=this._options.theme)!==null&&t!==void 0?t:XT;switch(this._themeClassnames.setClassNames(i.className),this.gridview.margin=(n=i.gap)!==null&&n!==void 0?n:0,i.dndOverlayMounting){case"absolute":this.rootDropTargetContainer.disabled=!1;break;case"relative":default:this.rootDropTargetContainer.disabled=!0;break}}}class lM extends Wy{get orientation(){return this.gridview.orientation}set orientation(t){this.gridview.orientation=t}get options(){return this._options}get deserializer(){return this._deserializer}set deserializer(t){this._deserializer=t}constructor(t,n){var i;super(t,{proportionalLayout:(i=n.proportionalLayout)!==null&&i!==void 0?i:!0,orientation:n.orientation,styles:n.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:n.disableAutoResizing,className:n.className}),this._onDidLayoutfromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidRemoveGroup=new B,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new B,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new B,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._options=n,this.addDisposables(this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this.onDidAdd(r=>{this._onDidAddGroup.fire(r)}),this.onDidRemove(r=>{this._onDidRemoveGroup.fire(r)}),this.onDidActiveChange(r=>{this._onDidActiveGroupChange.fire(r)}))}updateOptions(t){super.updateOptions(t);const n=typeof t.orientation=="string"&&this.gridview.orientation!==t.orientation;this._options=Object.assign(Object.assign({},this.options),t),n&&(this.gridview.orientation=t.orientation),this.layout(this.gridview.width,this.gridview.height,!0)}removePanel(t){this.removeGroup(t)}toJSON(){var t;return{grid:this.gridview.serialize(),activePanel:(t=this.activeGroup)===null||t===void 0?void 0:t.id}}setVisible(t,n){this.gridview.setViewVisible(Oe(t.element),n)}setActive(t){this._groups.forEach((n,i)=>{n.value.setActive(t===n.value)})}focus(){var t;(t=this.activeGroup)===null||t===void 0||t.focus()}fromJSON(t){this.clear();const{grid:n,activePanel:i}=t;try{const r=[],o=this.width,s=this.height;if(this.gridview.deserialize(n,{fromJSON:a=>{const{data:l}=a,u=this.options.createComponent({id:l.id,name:l.component});return r.push(()=>u.init({params:l.params,minimumWidth:l.minimumWidth,maximumWidth:l.maximumWidth,minimumHeight:l.minimumHeight,maximumHeight:l.maximumHeight,priority:l.priority,snap:!!l.snap,accessor:this,isVisible:a.visible})),this._onDidAddGroup.fire(u),this.registerPanel(u),u}}),this.layout(o,s,!0),r.forEach(a=>a()),typeof i=="string"){const a=this.getPanel(i);a&&this.doSetGroupActive(a)}}catch(r){for(const o of this.groups)o.dispose(),this._groups.delete(o.id),this._onDidRemoveGroup.fire(o);throw this.clear(),r}this._onDidLayoutfromJSON.fire()}clear(){const t=this.activeGroup,n=Array.from(this._groups.values());for(const i of n)i.disposable.dispose(),this.doRemoveGroup(i.value,{skipActive:!0});t&&this.doSetGroupActive(void 0),this.gridview.clear()}movePanel(t,n){var i;let r;const o=this.gridview.remove(t),s=(i=this._groups.get(n.reference))===null||i===void 0?void 0:i.value;if(!s)throw new Error(`reference group ${n.reference} does not exist`);const a=Sl(n.direction);if(a==="center")throw new Error(`${a} not supported as an option`);{const l=Oe(s.element);r=bn(this.gridview.orientation,l,a)}this.doAddGroup(o,r,n.size)}addPanel(t){var n,i,r,o;let s=(n=t.location)!==null&&n!==void 0?n:[0];if(!((i=t.position)===null||i===void 0)&&i.referencePanel){const l=(r=this._groups.get(t.position.referencePanel))===null||r===void 0?void 0:r.value;if(!l)throw new Error(`reference group ${t.position.referencePanel} does not exist`);const u=Sl(t.position.direction);if(u==="center")throw new Error(`${u} not supported as an option`);{const d=Oe(l.element);s=bn(this.gridview.orientation,d,u)}}const a=this.options.createComponent({id:t.id,name:t.component});return a.init({params:(o=t.params)!==null&&o!==void 0?o:{},minimumWidth:t.minimumWidth,maximumWidth:t.maximumWidth,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,priority:t.priority,snap:!!t.snap,accessor:this,isVisible:!0}),this.doAddGroup(a,s,t.size),this.registerPanel(a),this.doSetGroupActive(a),a}registerPanel(t){const n=new ce(t.api.onDidFocusChange(i=>{i.isFocused&&this._groups.forEach(r=>{const o=r.value;o!==t?o.setActive(!1):o.setActive(!0)})}));this._groups.set(t.id,{value:t,disposable:n})}moveGroup(t,n,i){const r=this.getPanel(n);if(!r)throw new Error("invalid operation");const o=Oe(t.element),s=bn(this.gridview.orientation,o,i),[a,l]=Vn(s),u=Oe(r.element),[d,c]=Vn(u);if(By(d,a)){this.gridview.moveView(d,c,l);return}const h=this.doRemoveGroup(r,{skipActive:!0,skipDispose:!0}),p=Oe(t.element),f=bn(this.gridview.orientation,p,i);this.doAddGroup(h,f)}removeGroup(t){super.removeGroup(t)}dispose(){super.dispose(),this._onDidLayoutfromJSON.dispose()}}class uM extends Cp{get panels(){return this.splitview.getViews()}get options(){return this._options}get length(){return this._panels.size}get orientation(){return this.splitview.orientation}get splitview(){return this._splitview}set splitview(t){this._splitview&&this._splitview.dispose(),this._splitview=t,this._splitviewChangeDisposable.value=new ce(this._splitview.onDidSashEnd(()=>{this._onDidLayoutChange.fire(void 0)}),this._splitview.onDidAddView(n=>this._onDidAddView.fire(n)),this._splitview.onDidRemoveView(n=>this._onDidRemoveView.fire(n)))}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get height(){return this.splitview.orientation===re.HORIZONTAL?this.splitview.orthogonalSize:this.splitview.size}get width(){return this.splitview.orientation===re.HORIZONTAL?this.splitview.size:this.splitview.orthogonalSize}constructor(t,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._splitviewChangeDisposable=new Je,this._panels=new Map,this._onDidLayoutfromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidAddView=new B,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new B,this.onDidRemoveView=this._onDidRemoveView.event,this._onDidLayoutChange=new B,this.onDidLayoutChange=this._onDidLayoutChange.event,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new cu(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),t.appendChild(this.element),this._options=n,this.splitview=new fs(this.element,n),this.addDisposables(this._onDidAddView,this._onDidLayoutfromJSON,this._onDidRemoveView,this._onDidLayoutChange)}updateOptions(t){var n,i;"className"in t&&this._classNames.setClassNames((n=t.className)!==null&&n!==void 0?n:""),"disableResizing"in t&&(this.disableResizing=(i=t.disableAutoResizing)!==null&&i!==void 0?i:!1),typeof t.orientation=="string"&&(this.splitview.orientation=t.orientation),this._options=Object.assign(Object.assign({},this.options),t),this.splitview.layout(this.splitview.size,this.splitview.orthogonalSize)}focus(){var t;(t=this._activePanel)===null||t===void 0||t.focus()}movePanel(t,n){this.splitview.moveView(t,n)}setVisible(t,n){const i=this.panels.indexOf(t);this.splitview.setViewVisible(i,n)}setActive(t,n){this._activePanel=t,this.panels.filter(i=>i!==t).forEach(i=>{i.api._onDidActiveChange.fire({isActive:!1}),n||i.focus()}),t.api._onDidActiveChange.fire({isActive:!0}),n||t.focus()}removePanel(t,n){const i=this._panels.get(t.id);if(!i)throw new Error(`unknown splitview panel ${t.id}`);i.dispose(),this._panels.delete(t.id);const r=this.panels.findIndex(a=>a===t);this.splitview.removeView(r,n).dispose();const s=this.panels;s.length>0&&this.setActive(s[s.length-1])}getPanel(t){return this.panels.find(n=>n.id===t)}addPanel(t){var n;if(this._panels.has(t.id))throw new Error(`panel ${t.id} already exists`);const i=this.options.createComponent({id:t.id,name:t.component});i.orientation=this.splitview.orientation,i.init({params:(n=t.params)!==null&&n!==void 0?n:{},minimumSize:t.minimumSize,maximumSize:t.maximumSize,snap:t.snap,priority:t.priority,accessor:this});const r=typeof t.size=="number"?t.size:Wt.Distribute,o=typeof t.index=="number"?t.index:void 0;return this.splitview.addView(i,r,o),this.doAddView(i),this.setActive(i),i}layout(t,n){const[i,r]=this.splitview.orientation===re.HORIZONTAL?[t,n]:[n,t];this.splitview.layout(i,r)}doAddView(t){const n=t.api.onDidFocusChange(i=>{i.isFocused&&this.setActive(t,!0)});this._panels.set(t.id,n)}toJSON(){var t;return{views:this.splitview.getViews().map((i,r)=>({size:this.splitview.getViewSize(r),data:i.toJSON(),snap:!!i.snap,priority:i.priority})),activeView:(t=this._activePanel)===null||t===void 0?void 0:t.id,size:this.splitview.size,orientation:this.splitview.orientation}}fromJSON(t){this.clear();const{views:n,orientation:i,size:r,activeView:o}=t,s=[],a=this.width,l=this.height;if(this.splitview=new fs(this.element,{orientation:i,proportionalLayout:this.options.proportionalLayout,descriptor:{size:r,views:n.map(u=>{const d=u.data;if(this._panels.has(d.id))throw new Error(`panel ${d.id} already exists`);const c=this.options.createComponent({id:d.id,name:d.component});return s.push(()=>{var h;c.init({params:(h=d.params)!==null&&h!==void 0?h:{},minimumSize:d.minimumSize,maximumSize:d.maximumSize,snap:u.snap,priority:u.priority,accessor:this})}),c.orientation=i,this.doAddView(c),setTimeout(()=>{this._onDidAddView.fire(c)},0),{size:u.size,view:c}})}}),this.layout(a,l),s.forEach(u=>u()),typeof o=="string"){const u=this.getPanel(o);u&&this.setActive(u)}this._onDidLayoutfromJSON.fire()}clear(){for(const t of this._panels.values())t.dispose();for(this._panels.clear();this.splitview.length>0;)this.splitview.removeView(0,Wt.Distribute,!0).dispose()}dispose(){for(const n of this._panels.values())n.dispose();this._panels.clear();const t=this.splitview.getViews();this._splitviewChangeDisposable.dispose(),this.splitview.dispose();for(const n of t)n.dispose();this.element.remove(),super.dispose()}}class Ng extends ce{get element(){return this._element}constructor(){super(),this._expandedIcon=RT(),this._collapsedIcon=Ky(),this.disposable=new Je,this.apiRef={api:null},this._element=document.createElement("div"),this.element.className="dv-default-header",this._content=document.createElement("span"),this._expander=document.createElement("div"),this._expander.className="dv-pane-header-icon",this.element.appendChild(this._expander),this.element.appendChild(this._content),this.addDisposables(pe(this._element,"click",()=>{var t;(t=this.apiRef.api)===null||t===void 0||t.setExpanded(!this.apiRef.api.isExpanded)}))}init(t){this.apiRef.api=t.api,this._content.textContent=t.title,this.updateIcon(),this.disposable.value=t.api.onDidExpansionChange(()=>{this.updateIcon()})}updateIcon(){var t;const n=!!(!((t=this.apiRef.api)===null||t===void 0)&&t.isExpanded);ne(this._expander,"collapsed",!n),n?(this._expander.contains(this._collapsedIcon)&&this._collapsedIcon.remove(),this._expander.contains(this._expandedIcon)||this._expander.appendChild(this._expandedIcon)):(this._expander.contains(this._expandedIcon)&&this._expandedIcon.remove(),this._expander.contains(this._collapsedIcon)||this._expander.appendChild(this._collapsedIcon))}update(t){}dispose(){this.disposable.dispose(),super.dispose()}}const cM=Sp(),Tg=22,Mg=0,Lg=Number.MAX_SAFE_INTEGER;class Og extends PT{constructor(t){super({accessor:t.accessor,id:t.id,component:t.component,headerComponent:t.headerComponent,orientation:t.orientation,isExpanded:t.isExpanded,disableDnd:t.disableDnd,headerSize:t.headerSize,minimumBodySize:t.minimumBodySize,maximumBodySize:t.maximumBodySize}),this.options=t}getBodyComponent(){return this.options.body}getHeaderComponent(){return this.options.header}}class dM extends Cp{get id(){return this._id}get panels(){return this.paneview.getPanes()}set paneview(t){this._paneview=t,this._disposable.value=new ce(this._paneview.onDidChange(()=>{this._onDidLayoutChange.fire(void 0)}),this._paneview.onDidAddView(n=>this._onDidAddView.fire(n)),this._paneview.onDidRemoveView(n=>this._onDidRemoveView.fire(n)))}get paneview(){return this._paneview}get minimumSize(){return this.paneview.minimumSize}get maximumSize(){return this.paneview.maximumSize}get height(){return this.paneview.orientation===re.HORIZONTAL?this.paneview.orthogonalSize:this.paneview.size}get width(){return this.paneview.orientation===re.HORIZONTAL?this.paneview.size:this.paneview.orthogonalSize}get options(){return this._options}constructor(t,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._id=cM.next(),this._disposable=new Je,this._viewDisposables=new Map,this._onDidLayoutfromJSON=new B,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidLayoutChange=new B,this.onDidLayoutChange=this._onDidLayoutChange.event,this._onDidDrop=new B,this.onDidDrop=this._onDidDrop.event,this._onDidAddView=new B,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new B,this.onDidRemoveView=this._onDidRemoveView.event,this._onUnhandledDragOverEvent=new B,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.element.style.height="100%",this.element.style.width="100%",this.addDisposables(this._onDidLayoutChange,this._onDidLayoutfromJSON,this._onDidDrop,this._onDidAddView,this._onDidRemoveView,this._onUnhandledDragOverEvent),this._classNames=new cu(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),t.appendChild(this.element),this._options=n,this.paneview=new Cg(this.element,{orientation:re.VERTICAL}),this.addDisposables(this._disposable)}setVisible(t,n){const i=this.panels.indexOf(t);this.paneview.setViewVisible(i,n)}focus(){}updateOptions(t){var n,i;"className"in t&&this._classNames.setClassNames((n=t.className)!==null&&n!==void 0?n:""),"disableResizing"in t&&(this.disableResizing=(i=t.disableAutoResizing)!==null&&i!==void 0?i:!1),this._options=Object.assign(Object.assign({},this.options),t)}addPanel(t){var n,i;const r=this.options.createComponent({id:t.id,name:t.component});let o;t.headerComponent&&this.options.createHeaderComponent&&(o=this.options.createHeaderComponent({id:t.id,name:t.headerComponent})),o||(o=new Ng);const s=new Og({id:t.id,component:t.component,headerComponent:t.headerComponent,header:o,body:r,orientation:re.VERTICAL,isExpanded:!!t.isExpanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:(n=t.headerSize)!==null&&n!==void 0?n:Tg,minimumBodySize:Mg,maximumBodySize:Lg});this.doAddPanel(s);const a=typeof t.size=="number"?t.size:Wt.Distribute,l=typeof t.index=="number"?t.index:void 0;return s.init({params:(i=t.params)!==null&&i!==void 0?i:{},minimumBodySize:t.minimumBodySize,maximumBodySize:t.maximumBodySize,isExpanded:t.isExpanded,title:t.title,containerApi:new ms(this),accessor:this}),this.paneview.addPane(s,a,l),s.orientation=this.paneview.orientation,s}removePanel(t){const i=this.panels.findIndex(r=>r===t);this.paneview.removePane(i),this.doRemovePanel(t)}movePanel(t,n){this.paneview.moveView(t,n)}getPanel(t){return this.panels.find(n=>n.id===t)}layout(t,n){const[i,r]=this.paneview.orientation===re.HORIZONTAL?[t,n]:[n,t];this.paneview.layout(i,r)}toJSON(){const t=r=>r===Number.MAX_SAFE_INTEGER||r===Number.POSITIVE_INFINITY?void 0:r,n=r=>r<=0?void 0:r;return{views:this.paneview.getPanes().map((r,o)=>({size:this.paneview.getViewSize(o),data:r.toJSON(),minimumSize:n(r.minimumBodySize),maximumSize:t(r.maximumBodySize),headerSize:r.headerSize,expanded:r.isExpanded()})),size:this.paneview.size}}fromJSON(t){this.clear();const{views:n,size:i}=t,r=[],o=this.width,s=this.height;this.paneview=new Cg(this.element,{orientation:re.VERTICAL,descriptor:{size:i,views:n.map(a=>{var l,u,d;const c=a.data,h=this.options.createComponent({id:c.id,name:c.component});let p;c.headerComponent&&this.options.createHeaderComponent&&(p=this.options.createHeaderComponent({id:c.id,name:c.headerComponent})),p||(p=new Ng);const f=new Og({id:c.id,component:c.component,headerComponent:c.headerComponent,header:p,body:h,orientation:re.VERTICAL,isExpanded:!!a.expanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:(l=a.headerSize)!==null&&l!==void 0?l:Tg,minimumBodySize:(u=a.minimumSize)!==null&&u!==void 0?u:Mg,maximumBodySize:(d=a.maximumSize)!==null&&d!==void 0?d:Lg});return this.doAddPanel(f),r.push(()=>{var v;f.init({params:(v=c.params)!==null&&v!==void 0?v:{},minimumBodySize:a.minimumSize,maximumBodySize:a.maximumSize,title:c.title,isExpanded:!!a.expanded,containerApi:new ms(this),accessor:this}),f.orientation=this.paneview.orientation}),setTimeout(()=>{this._onDidAddView.fire(f)},0),{size:a.size,view:f}})}}),this.layout(o,s),r.forEach(a=>a()),this._onDidLayoutfromJSON.fire()}clear(){for(const[t,n]of this._viewDisposables.entries())n.dispose();this._viewDisposables.clear(),this.paneview.dispose()}doAddPanel(t){const n=new ce(t.onDidDrop(i=>{this._onDidDrop.fire(i)}),t.onUnhandledDragOverEvent(i=>{this._onUnhandledDragOverEvent.fire(i)}));this._viewDisposables.set(t.id,n)}doRemovePanel(t){const n=this._viewDisposables.get(t.id);n&&(n.dispose(),this._viewDisposables.delete(t.id))}dispose(){super.dispose();for(const[t,n]of this._viewDisposables.entries())n.dispose();this._viewDisposables.clear(),this.element.remove(),this.paneview.dispose()}}class hM extends Dp{get priority(){return this._priority}set orientation(t){this._orientation=t}get orientation(){return this._orientation}get minimumSize(){const t=typeof this._minimumSize=="function"?this._minimumSize():this._minimumSize;return t!==this._evaluatedMinimumSize&&(this._evaluatedMinimumSize=t,this.updateConstraints()),t}get maximumSize(){const t=typeof this._maximumSize=="function"?this._maximumSize():this._maximumSize;return t!==this._evaluatedMaximumSize&&(this._evaluatedMaximumSize=t,this.updateConstraints()),t}get snap(){return this._snap}constructor(t,n){super(t,n,new qy(t,n)),this._evaluatedMinimumSize=0,this._evaluatedMaximumSize=Number.POSITIVE_INFINITY,this._minimumSize=0,this._maximumSize=Number.POSITIVE_INFINITY,this._snap=!1,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.api.initialize(this),this.addDisposables(this._onDidChange,this.api.onWillVisibilityChange(i=>{const{isVisible:r}=i,{accessor:o}=this._params;o.setVisible(this,r)}),this.api.onActiveChange(()=>{const{accessor:i}=this._params;i.setActive(this)}),this.api.onDidConstraintsChangeInternal(i=>{(typeof i.minimumSize=="number"||typeof i.minimumSize=="function")&&(this._minimumSize=i.minimumSize),(typeof i.maximumSize=="number"||typeof i.maximumSize=="function")&&(this._maximumSize=i.maximumSize),this.updateConstraints()}),this.api.onDidSizeChange(i=>{this._onDidChange.fire({size:i.size})}))}setVisible(t){this.api._onDidVisibilityChange.fire({isVisible:t})}setActive(t){this.api._onDidActiveChange.fire({isActive:t})}layout(t,n){const[i,r]=this.orientation===re.HORIZONTAL?[t,n]:[n,t];super.layout(i,r)}init(t){super.init(t),this._priority=t.priority,t.minimumSize&&(this._minimumSize=t.minimumSize),t.maximumSize&&(this._maximumSize=t.maximumSize),t.snap&&(this._snap=t.snap)}toJSON(){const t=i=>i===Number.MAX_SAFE_INTEGER||i===Number.POSITIVE_INFINITY?void 0:i,n=i=>i<=0?void 0:i;return Object.assign(Object.assign({},super.toJSON()),{minimumSize:n(this.minimumSize),maximumSize:t(this.maximumSize)})}updateConstraints(){this.api._onDidConstraintsChange.fire({maximumSize:this._evaluatedMaximumSize,minimumSize:this._evaluatedMinimumSize})}}function pM(e,t){return new aM(e,t).api}function fM(e,t){const n=new uM(e,t);return new jy(n)}function mM(e,t){const n=new lM(e,t);return new Uy(n)}function gM(e,t){const n=new dM(e,t);return new ms(n)}/**
|
|
1411
1411
|
* dockview
|
|
1412
1412
|
* @version 5.2.0
|
|
1413
1413
|
* @link https://github.com/mathuo/dockview
|
|
@@ -2720,7 +2720,7 @@ Error generating stack: `+o.message+`
|
|
|
2720
2720
|
.dv-watermark {
|
|
2721
2721
|
display: flex;
|
|
2722
2722
|
height: 100%;
|
|
2723
|
-
}`;vM(wM);const nx=(e,t)=>{const[n,i]=ie.useState(),r=ie.useRef(e.componentProps);return ie.useImperativeHandle(t,()=>({update:o=>{r.current=Object.assign(Object.assign({},r.current),o),i(Date.now())}}),[]),ie.createElement(e.component,r.current)};nx.displayName="DockviewReactJsBridge";const bM=(()=>{let e=1;return{next:()=>`dockview_react_portal_key_${(e++).toString()}`}})(),yM=ie.createContext({});class dr{constructor(t,n,i,r,o){this.parent=t,this.portalStore=n,this.component=i,this.parameters=r,this.context=o,this._initialProps={},this.disposed=!1,this.createPortal()}update(t){if(this.disposed)throw new Error("invalid operation: resource is already disposed");this.componentInstance?this.componentInstance.update(t):this._initialProps=Object.assign(Object.assign({},this._initialProps),t)}createPortal(){if(this.disposed)throw new Error("invalid operation: resource is already disposed");if(!xM(this.component))throw new Error("Dockview: Only React.memo(...), React.ForwardRef(...) and functional components are accepted as components");const t=ie.createElement(ie.forwardRef(nx),{component:this.component,componentProps:this.parameters,ref:r=>{this.componentInstance=r,Object.keys(this._initialProps).length>0&&(this.componentInstance.update(this._initialProps),this._initialProps={})}}),n=this.context?ie.createElement(yM.Provider,{value:this.context},t):t,i=hC.createPortal(n,this.parent,bM.next());this.ref={portal:i,disposable:this.portalStore.addPortal(i)}}dispose(){var t;(t=this.ref)===null||t===void 0||t.disposable.dispose(),this.disposed=!0}}const pu=()=>{const[e,t]=ie.useState([]);ie.useDebugValue(`Portal count: ${e.length}`);const n=ie.useCallback(i=>{t(o=>[...o,i]);let r=!1;return je.from(()=>{if(r)throw new Error("invalid operation: resource already disposed");r=!0,t(o=>o.filter(s=>s!==i))})},[]);return[e,n]};function xM(e){return typeof e=="function"||!!(e!=null&&e.$$typeof)}class Og{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._onDidFocus=new B,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new B,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}focus(){}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{params:t.params,api:t.api,containerApi:t.containerApi})}update(t){var n;(n=this.part)===null||n===void 0||n.update({params:t.params})}layout(t,n){}dispose(){var t;this._onDidFocus.dispose(),this._onDidBlur.dispose(),(t=this.part)===null||t===void 0||t.dispose()}}class Rg{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}focus(){}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{params:t.params,api:t.api,containerApi:t.containerApi,tabLocation:t.tabLocation})}update(t){var n;(n=this.part)===null||n===void 0||n.update({params:t.params})}layout(t,n){}dispose(){var t;(t=this.part)===null||t===void 0||t.dispose()}}class Vg{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{group:t.group,containerApi:t.containerApi})}focus(){}update(t){var n,i,r;this.parameters&&(this.parameters.params=t.params),(n=this.part)===null||n===void 0||n.update({params:(r=(i=this.parameters)===null||i===void 0?void 0:i.params)!==null&&r!==void 0?r:{}})}layout(t,n){}dispose(){var t;(t=this.part)===null||t===void 0||t.dispose()}}class _M{get element(){return this._element}get part(){return this._part}constructor(t,n,i){this.component=t,this.reactPortalStore=n,this._group=i,this.mutableDisposable=new Je,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}init(t){this.mutableDisposable.value=new ce(this._group.model.onDidAddPanel(()=>{this.updatePanels()}),this._group.model.onDidRemovePanel(()=>{this.updatePanels()}),this._group.model.onDidActivePanelChange(()=>{this.updateActivePanel()}),t.api.onDidActiveChange(()=>{this.updateGroupActive()})),this._part=new dr(this.element,this.reactPortalStore,this.component,{api:t.api,containerApi:t.containerApi,panels:this._group.model.panels,activePanel:this._group.model.activePanel,isGroupActive:this._group.api.isActive,group:this._group,headerPosition:this._group.model.headerPosition})}dispose(){var t;this.mutableDisposable.dispose(),(t=this._part)===null||t===void 0||t.dispose()}update(t){var n;(n=this._part)===null||n===void 0||n.update(t.params)}updatePanels(){this.update({params:{panels:this._group.model.panels}})}updateActivePanel(){this.update({params:{activePanel:this._group.model.activePanel}})}updateGroupActive(){this.update({params:{isGroupActive:this._group.api.isActive}})}}function mr(e,t){return e?n=>new _M(e,t,n):void 0}const ga="props.defaultTabComponent";function kM(e){return jd.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const SM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};jd.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},jd.map(a=>e[a])),ie.useEffect(()=>{var a;if(!n.current)return;const l=(a=e.tabComponents)!==null&&a!==void 0?a:{};e.defaultTabComponent&&(l[ga]=e.defaultTabComponent);const u={createLeftHeaderActionComponent:mr(e.leftHeaderActionsComponent,{addPortal:o}),createRightHeaderActionComponent:mr(e.rightHeaderActionsComponent,{addPortal:o}),createPrefixHeaderActionComponent:mr(e.prefixHeaderActionsComponent,{addPortal:o}),createComponent:p=>new Og(p.id,e.components[p.name],{addPortal:o}),createTabComponent(p){return new Rg(p.id,l[p.name],{addPortal:o})},createWatermarkComponent:e.watermarkComponent?()=>new Vg("watermark",e.watermarkComponent,{addPortal:o}):void 0,defaultTabComponent:e.defaultTabComponent?ga:void 0},d=pM(n.current,Object.assign(Object.assign({},kM(e)),u)),{clientWidth:c,clientHeight:h}=n.current;return d.layout(c,h),e.onReady&&e.onReady({api:d}),i.current=d,()=>{i.current=void 0,d.dispose()}},[]),ie.useEffect(()=>{if(!i.current)return()=>{};const a=i.current.onDidDrop(l=>{e.onDidDrop&&e.onDidDrop(l)});return()=>{a.dispose()}},[e.onDidDrop]),ie.useEffect(()=>{if(!i.current)return()=>{};const a=i.current.onWillDrop(l=>{e.onWillDrop&&e.onWillDrop(l)});return()=>{a.dispose()}},[e.onWillDrop]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new Og(a.id,e.components[a.name],{addPortal:o})})},[e.components]),ie.useEffect(()=>{var a;if(!i.current)return;const l=(a=e.tabComponents)!==null&&a!==void 0?a:{};e.defaultTabComponent&&(l[ga]=e.defaultTabComponent),i.current.updateOptions({defaultTabComponent:e.defaultTabComponent?ga:void 0,createTabComponent(u){return new Rg(u.id,l[u.name],{addPortal:o})}})},[e.tabComponents,e.defaultTabComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createWatermarkComponent:e.watermarkComponent?()=>new Vg("watermark",e.watermarkComponent,{addPortal:o}):void 0})},[e.watermarkComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createRightHeaderActionComponent:mr(e.rightHeaderActionsComponent,{addPortal:o})})},[e.rightHeaderActionsComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createLeftHeaderActionComponent:mr(e.leftHeaderActionsComponent,{addPortal:o})})},[e.leftHeaderActionsComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createPrefixHeaderActionComponent:mr(e.prefixHeaderActionsComponent,{addPortal:o})})},[e.prefixHeaderActionsComponent]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});SM.displayName="DockviewComponent";class Fg extends hM{constructor(t,n,i,r){super(t,n),this.reactComponent=i,this.reactPortalStore=r}getComponent(){var t,n;return new dr(this.element,this.reactPortalStore,this.reactComponent,{params:(n=(t=this._params)===null||t===void 0?void 0:t.params)!==null&&n!==void 0?n:{},api:this.api,containerApi:new Wy(this._params.accessor)})}}function CM(e){return Fd.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const EM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};Fd.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},Fd.map(a=>e[a])),ie.useEffect(()=>{if(!n.current)return()=>{};const a={createComponent:c=>new Fg(c.id,c.name,e.components[c.name],{addPortal:o})},l=fM(n.current,Object.assign(Object.assign({},CM(e)),a)),{clientWidth:u,clientHeight:d}=n.current;return l.layout(u,d),e.onReady&&e.onReady({api:l}),i.current=l,()=>{i.current=void 0,l.dispose()}},[]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new Fg(a.id,a.name,e.components[a.name],{addPortal:o})})},[e.components]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});EM.displayName="SplitviewComponent";class Hg extends ex{constructor(t,n,i,r){super(t,n),this.reactComponent=i,this.reactPortalStore=r}getComponent(){var t,n;return new dr(this.element,this.reactPortalStore,this.reactComponent,{params:(n=(t=this._params)===null||t===void 0?void 0:t.params)!==null&&n!==void 0?n:{},api:this.api,containerApi:new jy(this._params.accessor)})}}function DM(e){return $d.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const zM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};$d.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},$d.map(a=>e[a])),ie.useEffect(()=>{if(!n.current)return()=>{};const a={createComponent:c=>new Hg(c.id,c.name,e.components[c.name],{addPortal:o})},l=mM(n.current,Object.assign(Object.assign({},DM(e)),a)),{clientWidth:u,clientHeight:d}=n.current;return l.layout(u,d),e.onReady&&e.onReady({api:l}),i.current=l,()=>{i.current=void 0,l.dispose()}},[]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new Hg(a.id,a.name,e.components[a.name],{addPortal:o})})},[e.components]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});zM.displayName="GridviewComponent";class va{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._element=document.createElement("div"),this._element.style.height="100%",this._element.style.width="100%"}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{params:t.params,api:t.api,title:t.title,containerApi:t.containerApi})}toJSON(){return{id:this.id}}update(t){var n;(n=this.part)===null||n===void 0||n.update(t.params)}dispose(){var t;(t=this.part)===null||t===void 0||t.dispose()}}function PM(e){return Wd.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const AM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};Wd.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},Wd.map(a=>e[a])),ie.useEffect(()=>{var a;if(!n.current)return()=>{};const l=(a=e.headerComponents)!==null&&a!==void 0?a:{},u={createComponent:p=>new va(p.id,e.components[p.name],{addPortal:o}),createHeaderComponent:p=>new va(p.id,l[p.name],{addPortal:o})},d=gM(n.current,Object.assign(Object.assign({},PM(e)),u)),{clientWidth:c,clientHeight:h}=n.current;return d.layout(c,h),e.onReady&&e.onReady({api:d}),i.current=d,()=>{i.current=void 0,d.dispose()}},[]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new va(a.id,e.components[a.name],{addPortal:o})})},[e.components]),ie.useEffect(()=>{var a;if(!i.current)return;const l=(a=e.headerComponents)!==null&&a!==void 0?a:{};i.current.updateOptions({createHeaderComponent:u=>new va(u.id,l[u.name],{addPortal:o})})},[e.headerComponents]),ie.useEffect(()=>{if(!i.current)return()=>{};const a=i.current.onDidDrop(l=>{e.onDidDrop&&e.onDidDrop(l)});return()=>{a.dispose()}},[e.onDidDrop]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});AM.displayName="PaneviewComponent";function Ye(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=Ye(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var IM={value:()=>{}};function fu(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Ga(n)}function Ga(e){this._=e}function NM(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Ga.prototype=fu.prototype={constructor:Ga,on:function(e,t){var n=this._,i=NM(e+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((r=(e=i[o]).type)&&(r=TM(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(r=(e=i[o]).type)n[r]=Gg(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Gg(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ga(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)}};function TM(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Gg(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=IM,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ud="http://www.w3.org/1999/xhtml";const Bg={svg:"http://www.w3.org/2000/svg",xhtml:Ud,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Bg.hasOwnProperty(t)?{space:Bg[t],local:e}:e}function MM(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ud&&t.documentElement.namespaceURI===Ud?t.createElement(e):t.createElementNS(n,e)}}function LM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ix(e){var t=mu(e);return(t.local?LM:MM)(t)}function OM(){}function Ip(e){return e==null?OM:function(){return this.querySelector(e)}}function RM(e){typeof e!="function"&&(e=Ip(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var o=t[r],s=o.length,a=i[r]=new Array(s),l,u,d=0;d<s;++d)(l=o[d])&&(u=e.call(l,l.__data__,d,o))&&("__data__"in l&&(u.__data__=l.__data__),a[d]=u);return new Lt(i,this._parents)}function VM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FM(){return[]}function rx(e){return e==null?FM:function(){return this.querySelectorAll(e)}}function HM(e){return function(){return VM(e.apply(this,arguments))}}function GM(e){typeof e=="function"?e=HM(e):e=rx(e);for(var t=this._groups,n=t.length,i=[],r=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(i.push(e.call(l,l.__data__,u,s)),r.push(l));return new Lt(i,r)}function ox(e){return function(){return this.matches(e)}}function sx(e){return function(t){return t.matches(e)}}var BM=Array.prototype.find;function $M(e){return function(){return BM.call(this.children,e)}}function WM(){return this.firstElementChild}function jM(e){return this.select(e==null?WM:$M(typeof e=="function"?e:sx(e)))}var UM=Array.prototype.filter;function YM(){return Array.from(this.children)}function XM(e){return function(){return UM.call(this.children,e)}}function ZM(e){return this.selectAll(e==null?YM:XM(typeof e=="function"?e:sx(e)))}function qM(e){typeof e!="function"&&(e=ox(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var o=t[r],s=o.length,a=i[r]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new Lt(i,this._parents)}function ax(e){return new Array(e.length)}function QM(){return new Lt(this._enter||this._groups.map(ax),this._parents)}function El(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}El.prototype={constructor:El,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function KM(e){return function(){return e}}function JM(e,t,n,i,r,o){for(var s=0,a,l=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],i[s]=a):n[s]=new El(e,o[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function eL(e,t,n,i,r,o,s){var a,l,u=new Map,d=t.length,c=o.length,h=new Array(d),p;for(a=0;a<d;++a)(l=t[a])&&(h[a]=p=s.call(l,l.__data__,a,t)+"",u.has(p)?r[a]=l:u.set(p,l));for(a=0;a<c;++a)p=s.call(e,o[a],a,o)+"",(l=u.get(p))?(i[a]=l,l.__data__=o[a],u.delete(p)):n[a]=new El(e,o[a]);for(a=0;a<d;++a)(l=t[a])&&u.get(h[a])===l&&(r[a]=l)}function tL(e){return e.__data__}function nL(e,t){if(!arguments.length)return Array.from(this,tL);var n=t?eL:JM,i=this._parents,r=this._groups;typeof e!="function"&&(e=KM(e));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var d=i[u],c=r[u],h=c.length,p=iL(e.call(d,d&&d.__data__,u,i)),f=p.length,v=a[u]=new Array(f),b=s[u]=new Array(f),m=l[u]=new Array(h);n(d,c,v,b,m,p,t);for(var w=0,g=0,y,k;w<f;++w)if(y=v[w]){for(w>=g&&(g=w+1);!(k=b[g])&&++g<f;);y._next=k||null}}return s=new Lt(s,i),s._enter=a,s._exit=l,s}function iL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rL(){return new Lt(this._exit||this._groups.map(ax),this._parents)}function oL(e,t,n){var i=this.enter(),r=this,o=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?o.remove():n(o),i&&r?i.merge(r).order():r}function sL(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var u=n[l],d=i[l],c=u.length,h=a[l]=new Array(c),p,f=0;f<c;++f)(p=u[f]||d[f])&&(h[f]=p);for(;l<r;++l)a[l]=n[l];return new Lt(a,this._parents)}function aL(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,o=i[r],s;--r>=0;)(s=i[r])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function lL(e){e||(e=uL);function t(c,h){return c&&h?e(c.__data__,h.__data__):!c-!h}for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s=n[o],a=s.length,l=r[o]=new Array(a),u,d=0;d<a;++d)(u=s[d])&&(l[d]=u);l.sort(t)}return new Lt(r,this._parents).order()}function uL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dL(){return Array.from(this)}function hL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null}function pL(){let e=0;for(const t of this)++e;return e}function fL(){return!this.node()}function mL(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],o=0,s=r.length,a;o<s;++o)(a=r[o])&&e.call(a,a.__data__,o,r);return this}function gL(e){return function(){this.removeAttribute(e)}}function vL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wL(e,t){return function(){this.setAttribute(e,t)}}function bL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function yL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _L(e,t){var n=mu(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?vL:gL:typeof t=="function"?n.local?xL:yL:n.local?bL:wL)(n,t))}function lx(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function kL(e){return function(){this.style.removeProperty(e)}}function SL(e,t,n){return function(){this.style.setProperty(e,t,n)}}function CL(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function EL(e,t,n){return arguments.length>1?this.each((t==null?kL:typeof t=="function"?CL:SL)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||lx(e).getComputedStyle(e,null).getPropertyValue(t)}function DL(e){return function(){delete this[e]}}function zL(e,t){return function(){this[e]=t}}function PL(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function AL(e,t){return arguments.length>1?this.each((t==null?DL:typeof t=="function"?PL:zL)(e,t)):this.node()[e]}function ux(e){return e.trim().split(/^|\s+/)}function Np(e){return e.classList||new cx(e)}function cx(e){this._node=e,this._names=ux(e.getAttribute("class")||"")}cx.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function dx(e,t){for(var n=Np(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function hx(e,t){for(var n=Np(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function IL(e){return function(){dx(this,e)}}function NL(e){return function(){hx(this,e)}}function TL(e,t){return function(){(t.apply(this,arguments)?dx:hx)(this,e)}}function ML(e,t){var n=ux(e+"");if(arguments.length<2){for(var i=Np(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?TL:t?IL:NL)(n,t))}function LL(){this.textContent=""}function OL(e){return function(){this.textContent=e}}function RL(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function VL(e){return arguments.length?this.each(e==null?LL:(typeof e=="function"?RL:OL)(e)):this.node().textContent}function FL(){this.innerHTML=""}function HL(e){return function(){this.innerHTML=e}}function GL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function BL(e){return arguments.length?this.each(e==null?FL:(typeof e=="function"?GL:HL)(e)):this.node().innerHTML}function $L(){this.nextSibling&&this.parentNode.appendChild(this)}function WL(){return this.each($L)}function jL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UL(){return this.each(jL)}function YL(e){var t=typeof e=="function"?e:ix(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function XL(){return null}function ZL(e,t){var n=typeof e=="function"?e:ix(e),i=t==null?XL:typeof t=="function"?t:Ip(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function qL(){var e=this.parentNode;e&&e.removeChild(this)}function QL(){return this.each(qL)}function KL(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function JL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eO(e){return this.select(e?JL:KL)}function tO(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nO(e){return function(t){e.call(this,t,this.__data__)}}function iO(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function rO(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,o;n<r;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++i]=o;++i?t.length=i:delete this.__on}}}function oO(e,t,n){return function(){var i=this.__on,r,o=nO(t);if(i){for(var s=0,a=i.length;s<a;++s)if((r=i[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=t;return}}this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},i?i.push(r):this.__on=[r]}}function sO(e,t,n){var i=iO(e+""),r,o=i.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,d;l<u;++l)for(r=0,d=a[l];r<o;++r)if((s=i[r]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?oO:rO,r=0;r<o;++r)this.each(a(i[r],t,n));return this}function px(e,t,n){var i=lx(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function aO(e,t){return function(){return px(this,e,t)}}function lO(e,t){return function(){return px(this,e,t.apply(this,arguments))}}function uO(e,t){return this.each((typeof t=="function"?lO:aO)(e,t))}function*cO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,o=i.length,s;r<o;++r)(s=i[r])&&(yield s)}var fx=[null];function Lt(e,t){this._groups=e,this._parents=t}function Os(){return new Lt([[document.documentElement]],fx)}function dO(){return this}Lt.prototype=Os.prototype={constructor:Lt,select:RM,selectAll:GM,selectChild:jM,selectChildren:ZM,filter:qM,data:nL,enter:QM,exit:rL,join:oL,merge:sL,selection:dO,order:aL,sort:lL,call:cL,nodes:dL,node:hL,size:pL,empty:fL,each:mL,attr:_L,style:EL,property:AL,classed:ML,text:VL,html:BL,raise:WL,lower:UL,append:YL,insert:ZL,remove:QL,clone:eO,datum:tO,on:sO,dispatch:uO,[Symbol.iterator]:cO};function At(e){return typeof e=="string"?new Lt([[document.querySelector(e)]],[document.documentElement]):new Lt([[e]],fx)}function hO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function en(e,t){if(e=hO(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const pO={passive:!1},gs={capture:!0,passive:!1};function bc(e){e.stopImmediatePropagation()}function Hr(e){e.preventDefault(),e.stopImmediatePropagation()}function mx(e){var t=e.document.documentElement,n=At(e).on("dragstart.drag",Hr,gs);"onselectstart"in t?n.on("selectstart.drag",Hr,gs):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function gx(e,t){var n=e.document.documentElement,i=At(e).on("dragstart.drag",null);t&&(i.on("click.drag",Hr,gs),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const wa=e=>()=>e;function Yd(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:o,x:s,y:a,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Yd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function fO(e){return!e.ctrlKey&&!e.button}function mO(){return this.parentNode}function gO(e,t){return t??{x:e.x,y:e.y}}function vO(){return navigator.maxTouchPoints||"ontouchstart"in this}function vx(){var e=fO,t=mO,n=gO,i=vO,r={},o=fu("start","drag","end"),s=0,a,l,u,d,c=0;function h(y){y.on("mousedown.drag",p).filter(i).on("touchstart.drag",b).on("touchmove.drag",m,pO).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(y,k){if(!(d||!e.call(this,y,k))){var _=g(this,t.call(this,y,k),y,k,"mouse");_&&(At(y.view).on("mousemove.drag",f,gs).on("mouseup.drag",v,gs),mx(y.view),bc(y),u=!1,a=y.clientX,l=y.clientY,_("start",y))}}function f(y){if(Hr(y),!u){var k=y.clientX-a,_=y.clientY-l;u=k*k+_*_>c}r.mouse("drag",y)}function v(y){At(y.view).on("mousemove.drag mouseup.drag",null),gx(y.view,u),Hr(y),r.mouse("end",y)}function b(y,k){if(e.call(this,y,k)){var _=y.changedTouches,E=t.call(this,y,k),S=_.length,T,C;for(T=0;T<S;++T)(C=g(this,E,y,k,_[T].identifier,_[T]))&&(bc(y),C("start",y,_[T]))}}function m(y){var k=y.changedTouches,_=k.length,E,S;for(E=0;E<_;++E)(S=r[k[E].identifier])&&(Hr(y),S("drag",y,k[E]))}function w(y){var k=y.changedTouches,_=k.length,E,S;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),E=0;E<_;++E)(S=r[k[E].identifier])&&(bc(y),S("end",y,k[E]))}function g(y,k,_,E,S,T){var C=o.copy(),I=en(T||_,k),L,V,D;if((D=n.call(y,new Yd("beforestart",{sourceEvent:_,target:h,identifier:S,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:C}),E))!=null)return L=D.x-I[0]||0,V=D.y-I[1]||0,function P(A,O,N){var M=I,x;switch(A){case"start":r[S]=P,x=s++;break;case"end":delete r[S],--s;case"drag":I=en(N||O,k),x=s;break}C.call(A,y,new Yd(A,{sourceEvent:O,subject:D,target:h,identifier:S,active:x,x:I[0]+L,y:I[1]+V,dx:I[0]-M[0],dy:I[1]-M[1],dispatch:C}),E)}}return h.filter=function(y){return arguments.length?(e=typeof y=="function"?y:wa(!!y),h):e},h.container=function(y){return arguments.length?(t=typeof y=="function"?y:wa(y),h):t},h.subject=function(y){return arguments.length?(n=typeof y=="function"?y:wa(y),h):n},h.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:wa(!!y),h):i},h.on=function(){var y=o.on.apply(o,arguments);return y===o?h:y},h.clickDistance=function(y){return arguments.length?(c=(y=+y)*y,h):Math.sqrt(c)},h}function Tp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wx(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Rs(){}var vs=.7,Dl=1/vs,Gr="\\s*([+-]?\\d+)\\s*",ws="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",En="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wO=/^#([0-9a-f]{3,8})$/,bO=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),yO=new RegExp(`^rgb\\(${En},${En},${En}\\)$`),xO=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${ws}\\)$`),_O=new RegExp(`^rgba\\(${En},${En},${En},${ws}\\)$`),kO=new RegExp(`^hsl\\(${ws},${En},${En}\\)$`),SO=new RegExp(`^hsla\\(${ws},${En},${En},${ws}\\)$`),$g={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Tp(Rs,ir,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wg,formatHex:Wg,formatHex8:CO,formatHsl:EO,formatRgb:jg,toString:jg});function Wg(){return this.rgb().formatHex()}function CO(){return this.rgb().formatHex8()}function EO(){return bx(this).formatHsl()}function jg(){return this.rgb().formatRgb()}function ir(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ug(t):n===3?new _t(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ba(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bO.exec(e))?new _t(t[1],t[2],t[3],1):(t=yO.exec(e))?new _t(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xO.exec(e))?ba(t[1],t[2],t[3],t[4]):(t=_O.exec(e))?ba(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kO.exec(e))?Zg(t[1],t[2]/100,t[3]/100,1):(t=SO.exec(e))?Zg(t[1],t[2]/100,t[3]/100,t[4]):$g.hasOwnProperty(e)?Ug($g[e]):e==="transparent"?new _t(NaN,NaN,NaN,0):null}function Ug(e){return new _t(e>>16&255,e>>8&255,e&255,1)}function ba(e,t,n,i){return i<=0&&(e=t=n=NaN),new _t(e,t,n,i)}function DO(e){return e instanceof Rs||(e=ir(e)),e?(e=e.rgb(),new _t(e.r,e.g,e.b,e.opacity)):new _t}function Xd(e,t,n,i){return arguments.length===1?DO(e):new _t(e,t,n,i??1)}function _t(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Tp(_t,Xd,wx(Rs,{brighter(e){return e=e==null?Dl:Math.pow(Dl,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _t(Zi(this.r),Zi(this.g),Zi(this.b),zl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yg,formatHex:Yg,formatHex8:zO,formatRgb:Xg,toString:Xg}));function Yg(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}`}function zO(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}${Wi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xg(){const e=zl(this.opacity);return`${e===1?"rgb(":"rgba("}${Zi(this.r)}, ${Zi(this.g)}, ${Zi(this.b)}${e===1?")":`, ${e})`}`}function zl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wi(e){return e=Zi(e),(e<16?"0":"")+e.toString(16)}function Zg(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new nn(e,t,n,i)}function bx(e){if(e instanceof nn)return new nn(e.h,e.s,e.l,e.opacity);if(e instanceof Rs||(e=ir(e)),!e)return new nn;if(e instanceof nn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(t===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new nn(s,a,l,e.opacity)}function PO(e,t,n,i){return arguments.length===1?bx(e):new nn(e,t,n,i??1)}function nn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Tp(nn,PO,wx(Rs,{brighter(e){return e=e==null?Dl:Math.pow(Dl,e),new nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new nn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new _t(yc(e>=240?e-240:e+120,r,i),yc(e,r,i),yc(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new nn(qg(this.h),ya(this.s),ya(this.l),zl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zl(this.opacity);return`${e===1?"hsl(":"hsla("}${qg(this.h)}, ${ya(this.s)*100}%, ${ya(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qg(e){return e=(e||0)%360,e<0?e+360:e}function ya(e){return Math.max(0,Math.min(1,e||0))}function yc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Mp=e=>()=>e;function AO(e,t){return function(n){return e+n*t}}function IO(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function NO(e){return(e=+e)==1?yx:function(t,n){return n-t?IO(t,n,e):Mp(isNaN(t)?n:t)}}function yx(e,t){var n=t-e;return n?AO(e,n):Mp(isNaN(e)?t:e)}const Pl=function e(t){var n=NO(t);function i(r,o){var s=n((r=Xd(r)).r,(o=Xd(o)).r),a=n(r.g,o.g),l=n(r.b,o.b),u=yx(r.opacity,o.opacity);return function(d){return r.r=s(d),r.g=a(d),r.b=l(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function TO(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=e[r]*(1-o)+t[r]*o;return i}}function MO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function LO(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=jo(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function OO(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function xn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function RO(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=jo(e[r],t[r]):i[r]=t[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var Zd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xc=new RegExp(Zd.source,"g");function VO(e){return function(){return e}}function FO(e){return function(t){return e(t)+""}}function xx(e,t){var n=Zd.lastIndex=xc.lastIndex=0,i,r,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(i=Zd.exec(e))&&(r=xc.exec(t));)(o=r.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:xn(i,r)})),n=xc.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?FO(l[0].x):VO(t):(t=l.length,function(u){for(var d=0,c;d<t;++d)a[(c=l[d]).i]=c.x(u);return a.join("")})}function jo(e,t){var n=typeof t,i;return t==null||n==="boolean"?Mp(t):(n==="number"?xn:n==="string"?(i=ir(t))?(t=i,Pl):xx:t instanceof ir?Pl:t instanceof Date?OO:MO(t)?TO:Array.isArray(t)?LO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RO:xn)(e,t)}var Qg=180/Math.PI,qd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _x(e,t,n,i,r,o){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),e*i<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*Qg,skewX:Math.atan(l)*Qg,scaleX:s,scaleY:a}}var xa;function HO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qd:_x(t.a,t.b,t.c,t.d,t.e,t.f)}function GO(e){return e==null||(xa||(xa=document.createElementNS("http://www.w3.org/2000/svg","g")),xa.setAttribute("transform",e),!(e=xa.transform.baseVal.consolidate()))?qd:(e=e.matrix,_x(e.a,e.b,e.c,e.d,e.e,e.f))}function kx(e,t,n,i){function r(u){return u.length?u.pop()+" ":""}function o(u,d,c,h,p,f){if(u!==c||d!==h){var v=p.push("translate(",null,t,null,n);f.push({i:v-4,x:xn(u,c)},{i:v-2,x:xn(d,h)})}else(c||h)&&p.push("translate("+c+t+h+n)}function s(u,d,c,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:c.push(r(c)+"rotate(",null,i)-2,x:xn(u,d)})):d&&c.push(r(c)+"rotate("+d+i)}function a(u,d,c,h){u!==d?h.push({i:c.push(r(c)+"skewX(",null,i)-2,x:xn(u,d)}):d&&c.push(r(c)+"skewX("+d+i)}function l(u,d,c,h,p,f){if(u!==c||d!==h){var v=p.push(r(p)+"scale(",null,",",null,")");f.push({i:v-4,x:xn(u,c)},{i:v-2,x:xn(d,h)})}else(c!==1||h!==1)&&p.push(r(p)+"scale("+c+","+h+")")}return function(u,d){var c=[],h=[];return u=e(u),d=e(d),o(u.translateX,u.translateY,d.translateX,d.translateY,c,h),s(u.rotate,d.rotate,c,h),a(u.skewX,d.skewX,c,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,c,h),u=d=null,function(p){for(var f=-1,v=h.length,b;++f<v;)c[(b=h[f]).i]=b.x(p);return c.join("")}}}var BO=kx(HO,"px, ","px)","deg)"),$O=kx(GO,", ",")",")"),WO=1e-12;function Kg(e){return((e=Math.exp(e))+1/e)/2}function jO(e){return((e=Math.exp(e))-1/e)/2}function UO(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ba=function e(t,n,i){function r(o,s){var a=o[0],l=o[1],u=o[2],d=s[0],c=s[1],h=s[2],p=d-a,f=c-l,v=p*p+f*f,b,m;if(v<WO)m=Math.log(h/u)/t,b=function(E){return[a+E*p,l+E*f,u*Math.exp(t*E*m)]};else{var w=Math.sqrt(v),g=(h*h-u*u+i*v)/(2*u*n*w),y=(h*h-u*u-i*v)/(2*h*n*w),k=Math.log(Math.sqrt(g*g+1)-g),_=Math.log(Math.sqrt(y*y+1)-y);m=(_-k)/t,b=function(E){var S=E*m,T=Kg(k),C=u/(n*w)*(T*UO(t*S+k)-jO(k));return[a+C*p,l+C*f,u*T/Kg(t*S+k)]}}return b.duration=m*1e3*t/Math.SQRT2,b}return r.rho=function(o){var s=Math.max(.001,+o),a=s*s,l=a*a;return e(s,a,l)},r}(Math.SQRT2,2,4);var Qr=0,Ao=0,So=0,Sx=1e3,Al,Io,Il=0,rr=0,gu=0,bs=typeof performance=="object"&&performance.now?performance:Date,Cx=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Lp(){return rr||(Cx(YO),rr=bs.now()+gu)}function YO(){rr=0}function Nl(){this._call=this._time=this._next=null}Nl.prototype=Ex.prototype={constructor:Nl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Lp():+n)+(t==null?0:+t),!this._next&&Io!==this&&(Io?Io._next=this:Al=this,Io=this),this._call=e,this._time=n,Qd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qd())}};function Ex(e,t,n){var i=new Nl;return i.restart(e,t,n),i}function XO(){Lp(),++Qr;for(var e=Al,t;e;)(t=rr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qr}function Jg(){rr=(Il=bs.now())+gu,Qr=Ao=0;try{XO()}finally{Qr=0,qO(),rr=0}}function ZO(){var e=bs.now(),t=e-Il;t>Sx&&(gu-=t,Il=e)}function qO(){for(var e,t=Al,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Al=n);Io=e,Qd(i)}function Qd(e){if(!Qr){Ao&&(Ao=clearTimeout(Ao));var t=e-rr;t>24?(e<1/0&&(Ao=setTimeout(Jg,e-bs.now()-gu)),So&&(So=clearInterval(So))):(So||(Il=bs.now(),So=setInterval(ZO,Sx)),Qr=1,Cx(Jg))}}function ev(e,t,n){var i=new Nl;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var QO=fu("start","end","cancel","interrupt"),KO=[],Dx=0,tv=1,Kd=2,$a=3,nv=4,Jd=5,Wa=6;function vu(e,t,n,i,r,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;JO(e,n,{name:t,index:i,group:r,on:QO,tween:KO,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Dx})}function Op(e,t){var n=pn(e,t);if(n.state>Dx)throw new Error("too late; already scheduled");return n}function An(e,t){var n=pn(e,t);if(n.state>$a)throw new Error("too late; already running");return n}function pn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function JO(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=Ex(o,0,n.time);function o(u){n.state=tv,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,c,h,p;if(n.state!==tv)return l();for(d in i)if(p=i[d],p.name===n.name){if(p.state===$a)return ev(s);p.state===nv?(p.state=Wa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[d]):+d<t&&(p.state=Wa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[d])}if(ev(function(){n.state===$a&&(n.state=nv,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Kd,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Kd){for(n.state=$a,r=new Array(h=n.tween.length),d=0,c=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=p);r.length=c+1}}function a(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Jd,1),c=-1,h=r.length;++c<h;)r[c].call(e,d);n.state===Jd&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Wa,n.timer.stop(),delete i[t];for(var u in i)return;delete e.__transition}}function ja(e,t){var n=e.__transition,i,r,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((i=n[s]).name!==t){o=!1;continue}r=i.state>Kd&&i.state<Jd,i.state=Wa,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[s]}o&&delete e.__transition}}function eR(e){return this.each(function(){ja(this,e)})}function tR(e,t){var n,i;return function(){var r=An(this,e),o=r.tween;if(o!==n){i=n=o;for(var s=0,a=i.length;s<a;++s)if(i[s].name===t){i=i.slice(),i.splice(s,1);break}}r.tween=i}}function nR(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var o=An(this,e),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:t,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===t){r[l]=a;break}l===u&&r.push(a)}o.tween=r}}function iR(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=pn(this.node(),n).tween,r=0,o=i.length,s;r<o;++r)if((s=i[r]).name===e)return s.value;return null}return this.each((t==null?tR:nR)(n,e,t))}function Rp(e,t,n){var i=e._id;return e.each(function(){var r=An(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return pn(r,i).value[t]}}function zx(e,t){var n;return(typeof t=="number"?xn:t instanceof ir?Pl:(n=ir(t))?(t=n,Pl):xx)(e,t)}function rR(e){return function(){this.removeAttribute(e)}}function oR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sR(e,t,n){var i,r=n+"",o;return function(){var s=this.getAttribute(e);return s===r?null:s===i?o:o=t(i=s,n)}}function aR(e,t,n){var i,r=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===i?o:o=t(i=s,n)}}function lR(e,t,n){var i,r,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===i&&l===r?o:(r=l,o=t(i=s,a)))}}function uR(e,t,n){var i,r,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===i&&l===r?o:(r=l,o=t(i=s,a)))}}function cR(e,t){var n=mu(e),i=n==="transform"?$O:zx;return this.attrTween(e,typeof t=="function"?(n.local?uR:lR)(n,i,Rp(this,"attr."+e,t)):t==null?(n.local?oR:rR)(n):(n.local?aR:sR)(n,i,t))}function dR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pR(e,t){var n,i;function r(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&hR(e,o)),n}return r._value=t,r}function fR(e,t){var n,i;function r(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&dR(e,o)),n}return r._value=t,r}function mR(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=mu(e);return this.tween(n,(i.local?pR:fR)(i,t))}function gR(e,t){return function(){Op(this,e).delay=+t.apply(this,arguments)}}function vR(e,t){return t=+t,function(){Op(this,e).delay=t}}function wR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gR:vR)(t,e)):pn(this.node(),t).delay}function bR(e,t){return function(){An(this,e).duration=+t.apply(this,arguments)}}function yR(e,t){return t=+t,function(){An(this,e).duration=t}}function xR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?bR:yR)(t,e)):pn(this.node(),t).duration}function _R(e,t){if(typeof t!="function")throw new Error;return function(){An(this,e).ease=t}}function kR(e){var t=this._id;return arguments.length?this.each(_R(t,e)):pn(this.node(),t).ease}function SR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;An(this,e).ease=n}}function CR(e){if(typeof e!="function")throw new Error;return this.each(SR(this._id,e))}function ER(e){typeof e!="function"&&(e=ox(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var o=t[r],s=o.length,a=i[r]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new jn(i,this._parents,this._name,this._id)}function DR(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l=t[a],u=n[a],d=l.length,c=s[a]=new Array(d),h,p=0;p<d;++p)(h=l[p]||u[p])&&(c[p]=h);for(;a<i;++a)s[a]=t[a];return new jn(s,this._parents,this._name,this._id)}function zR(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function PR(e,t,n){var i,r,o=zR(t)?Op:An;return function(){var s=o(this,e),a=s.on;a!==i&&(r=(i=a).copy()).on(t,n),s.on=r}}function AR(e,t){var n=this._id;return arguments.length<2?pn(this.node(),n).on.on(e):this.each(PR(n,e,t))}function IR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function NR(){return this.on("end.remove",IR(this._id))}function TR(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ip(e));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a=i[s],l=a.length,u=o[s]=new Array(l),d,c,h=0;h<l;++h)(d=a[h])&&(c=e.call(d,d.__data__,h,a))&&("__data__"in d&&(c.__data__=d.__data__),u[h]=c,vu(u[h],t,n,h,u,pn(d,n)));return new jn(o,this._parents,t,n)}function MR(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rx(e));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l=i[a],u=l.length,d,c=0;c<u;++c)if(d=l[c]){for(var h=e.call(d,d.__data__,c,l),p,f=pn(d,n),v=0,b=h.length;v<b;++v)(p=h[v])&&vu(p,t,n,v,h,f);o.push(h),s.push(d)}return new jn(o,s,t,n)}var LR=Os.prototype.constructor;function OR(){return new LR(this._groups,this._parents)}function RR(e,t){var n,i,r;return function(){var o=qr(this,e),s=(this.style.removeProperty(e),qr(this,e));return o===s?null:o===n&&s===i?r:r=t(n=o,i=s)}}function Px(e){return function(){this.style.removeProperty(e)}}function VR(e,t,n){var i,r=n+"",o;return function(){var s=qr(this,e);return s===r?null:s===i?o:o=t(i=s,n)}}function FR(e,t,n){var i,r,o;return function(){var s=qr(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),qr(this,e))),s===l?null:s===i&&l===r?o:(r=l,o=t(i=s,a))}}function HR(e,t){var n,i,r,o="style."+t,s="end."+o,a;return function(){var l=An(this,e),u=l.on,d=l.value[o]==null?a||(a=Px(t)):void 0;(u!==n||r!==d)&&(i=(n=u).copy()).on(s,r=d),l.on=i}}function GR(e,t,n){var i=(e+="")=="transform"?BO:zx;return t==null?this.styleTween(e,RR(e,i)).on("end.style."+e,Px(e)):typeof t=="function"?this.styleTween(e,FR(e,i,Rp(this,"style."+e,t))).each(HR(this._id,e)):this.styleTween(e,VR(e,i,t),n).on("end.style."+e,null)}function BR(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function $R(e,t,n){var i,r;function o(){var s=t.apply(this,arguments);return s!==r&&(i=(r=s)&&BR(e,s,n)),i}return o._value=t,o}function WR(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,$R(e,t,n??""))}function jR(e){return function(){this.textContent=e}}function UR(e){return function(){var t=e(this);this.textContent=t??""}}function YR(e){return this.tween("text",typeof e=="function"?UR(Rp(this,"text",e)):jR(e==null?"":e+""))}function XR(e){return function(t){this.textContent=e.call(this,t)}}function ZR(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&XR(r)),t}return i._value=e,i}function qR(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ZR(e))}function QR(){for(var e=this._name,t=this._id,n=Ax(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s=i[o],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var d=pn(l,t);vu(l,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new jn(i,this._parents,e,n)}function KR(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--r===0&&o()}};n.each(function(){var u=An(this,i),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),r===0&&o()})}var JR=0;function jn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Ax(){return++JR}var Tn=Os.prototype;jn.prototype={constructor:jn,select:TR,selectAll:MR,selectChild:Tn.selectChild,selectChildren:Tn.selectChildren,filter:ER,merge:DR,selection:OR,transition:QR,call:Tn.call,nodes:Tn.nodes,node:Tn.node,size:Tn.size,empty:Tn.empty,each:Tn.each,on:AR,attr:cR,attrTween:mR,style:GR,styleTween:WR,text:YR,textTween:qR,remove:NR,tween:iR,delay:wR,duration:xR,ease:kR,easeVarying:CR,end:KR,[Symbol.iterator]:Tn[Symbol.iterator]};function e5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var t5={time:null,delay:0,duration:250,ease:e5};function n5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function i5(e){var t,n;e instanceof jn?(t=e._id,e=e._name):(t=Ax(),(n=t5).time=Lp(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s=i[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&vu(l,e,t,u,s,n||n5(l,t));return new jn(i,this._parents,e,t)}Os.prototype.interrupt=eR;Os.prototype.transition=i5;const _a=e=>()=>e;function r5(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Fn(e,t,n){this.k=e,this.x=t,this.y=n}Fn.prototype={constructor:Fn,scale:function(e){return e===1?this:new Fn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Fn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wu=new Fn(1,0,0);Ix.prototype=Fn.prototype;function Ix(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wu;return e.__zoom}function _c(e){e.stopImmediatePropagation()}function Co(e){e.preventDefault(),e.stopImmediatePropagation()}function o5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function s5(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iv(){return this.__zoom||wu}function a5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function l5(){return navigator.maxTouchPoints||"ontouchstart"in this}function u5(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function Nx(){var e=o5,t=s5,n=u5,i=a5,r=l5,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ba,u=fu("start","zoom","end"),d,c,h,p=500,f=150,v=0,b=10;function m(D){D.property("__zoom",iv).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",C).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(D,P,A,O){var N=D.selection?D.selection():D;N.property("__zoom",iv),D!==N?k(D,P,A,O):N.interrupt().each(function(){_(this,arguments).event(O).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},m.scaleBy=function(D,P,A,O){m.scaleTo(D,function(){var N=this.__zoom.k,M=typeof P=="function"?P.apply(this,arguments):P;return N*M},A,O)},m.scaleTo=function(D,P,A,O){m.transform(D,function(){var N=t.apply(this,arguments),M=this.__zoom,x=A==null?y(N):typeof A=="function"?A.apply(this,arguments):A,F=M.invert(x),H=typeof P=="function"?P.apply(this,arguments):P;return n(g(w(M,H),x,F),N,s)},A,O)},m.translateBy=function(D,P,A,O){m.transform(D,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,O)},m.translateTo=function(D,P,A,O,N){m.transform(D,function(){var M=t.apply(this,arguments),x=this.__zoom,F=O==null?y(M):typeof O=="function"?O.apply(this,arguments):O;return n(wu.translate(F[0],F[1]).scale(x.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof A=="function"?-A.apply(this,arguments):-A),M,s)},O,N)};function w(D,P){return P=Math.max(o[0],Math.min(o[1],P)),P===D.k?D:new Fn(P,D.x,D.y)}function g(D,P,A){var O=P[0]-A[0]*D.k,N=P[1]-A[1]*D.k;return O===D.x&&N===D.y?D:new Fn(D.k,O,N)}function y(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function k(D,P,A,O){D.on("start.zoom",function(){_(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(O).end()}).tween("zoom",function(){var N=this,M=arguments,x=_(N,M).event(O),F=t.apply(N,M),H=A==null?y(F):typeof A=="function"?A.apply(N,M):A,z=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),X=N.__zoom,q=typeof P=="function"?P.apply(N,M):P,U=l(X.invert(H).concat(z/X.k),q.invert(H).concat(z/q.k));return function(K){if(K===1)K=q;else{var Y=U(K),Q=z/Y[2];K=new Fn(Q,H[0]-Y[0]*Q,H[1]-Y[1]*Q)}x.zoom(null,K)}})}function _(D,P,A){return!A&&D.__zooming||new E(D,P)}function E(D,P){this.that=D,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,P),this.taps=0}E.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,P){return this.mouse&&D!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var P=At(this.that).datum();u.call(D,this.that,new r5(D,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),P)}};function S(D,...P){if(!e.apply(this,arguments))return;var A=_(this,P).event(D),O=this.__zoom,N=Math.max(o[0],Math.min(o[1],O.k*Math.pow(2,i.apply(this,arguments)))),M=en(D);if(A.wheel)(A.mouse[0][0]!==M[0]||A.mouse[0][1]!==M[1])&&(A.mouse[1]=O.invert(A.mouse[0]=M)),clearTimeout(A.wheel);else{if(O.k===N)return;A.mouse=[M,O.invert(M)],ja(this),A.start()}Co(D),A.wheel=setTimeout(x,f),A.zoom("mouse",n(g(w(O,N),A.mouse[0],A.mouse[1]),A.extent,s));function x(){A.wheel=null,A.end()}}function T(D,...P){if(h||!e.apply(this,arguments))return;var A=D.currentTarget,O=_(this,P,!0).event(D),N=At(D.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",z,!0),M=en(D,A),x=D.clientX,F=D.clientY;mx(D.view),_c(D),O.mouse=[M,this.__zoom.invert(M)],ja(this),O.start();function H(X){if(Co(X),!O.moved){var q=X.clientX-x,U=X.clientY-F;O.moved=q*q+U*U>v}O.event(X).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=en(X,A),O.mouse[1]),O.extent,s))}function z(X){N.on("mousemove.zoom mouseup.zoom",null),gx(X.view,O.moved),Co(X),O.event(X).end()}}function C(D,...P){if(e.apply(this,arguments)){var A=this.__zoom,O=en(D.changedTouches?D.changedTouches[0]:D,this),N=A.invert(O),M=A.k*(D.shiftKey?.5:2),x=n(g(w(A,M),O,N),t.apply(this,P),s);Co(D),a>0?At(this).transition().duration(a).call(k,x,O,D):At(this).call(m.transform,x,O,D)}}function I(D,...P){if(e.apply(this,arguments)){var A=D.touches,O=A.length,N=_(this,P,D.changedTouches.length===O).event(D),M,x,F,H;for(_c(D),x=0;x<O;++x)F=A[x],H=en(F,this),H=[H,this.__zoom.invert(H),F.identifier],N.touch0?!N.touch1&&N.touch0[2]!==H[2]&&(N.touch1=H,N.taps=0):(N.touch0=H,M=!0,N.taps=1+!!d);d&&(d=clearTimeout(d)),M&&(N.taps<2&&(c=H[0],d=setTimeout(function(){d=null},p)),ja(this),N.start())}}function L(D,...P){if(this.__zooming){var A=_(this,P).event(D),O=D.changedTouches,N=O.length,M,x,F,H;for(Co(D),M=0;M<N;++M)x=O[M],F=en(x,this),A.touch0&&A.touch0[2]===x.identifier?A.touch0[0]=F:A.touch1&&A.touch1[2]===x.identifier&&(A.touch1[0]=F);if(x=A.that.__zoom,A.touch1){var z=A.touch0[0],X=A.touch0[1],q=A.touch1[0],U=A.touch1[1],K=(K=q[0]-z[0])*K+(K=q[1]-z[1])*K,Y=(Y=U[0]-X[0])*Y+(Y=U[1]-X[1])*Y;x=w(x,Math.sqrt(K/Y)),F=[(z[0]+q[0])/2,(z[1]+q[1])/2],H=[(X[0]+U[0])/2,(X[1]+U[1])/2]}else if(A.touch0)F=A.touch0[0],H=A.touch0[1];else return;A.zoom("touch",n(g(x,F,H),A.extent,s))}}function V(D,...P){if(this.__zooming){var A=_(this,P).event(D),O=D.changedTouches,N=O.length,M,x;for(_c(D),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),M=0;M<N;++M)x=O[M],A.touch0&&A.touch0[2]===x.identifier?delete A.touch0:A.touch1&&A.touch1[2]===x.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(x=en(x,this),Math.hypot(c[0]-x[0],c[1]-x[1])<b)){var F=At(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(D){return arguments.length?(i=typeof D=="function"?D:_a(+D),m):i},m.filter=function(D){return arguments.length?(e=typeof D=="function"?D:_a(!!D),m):e},m.touchable=function(D){return arguments.length?(r=typeof D=="function"?D:_a(!!D),m):r},m.extent=function(D){return arguments.length?(t=typeof D=="function"?D:_a([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),m):t},m.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],m):[o[0],o[1]]},m.translateExtent=function(D){return arguments.length?(s[0][0]=+D[0][0],s[1][0]=+D[1][0],s[0][1]=+D[0][1],s[1][1]=+D[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(D){return arguments.length?(n=D,m):n},m.duration=function(D){return arguments.length?(a=+D,m):a},m.interpolate=function(D){return arguments.length?(l=D,m):l},m.on=function(){var D=u.on.apply(u,arguments);return D===u?m:D},m.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,m):Math.sqrt(v)},m.tapDistance=function(D){return arguments.length?(b=+D,m):b},m}const zn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ys=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Tx=["Enter"," ","Escape"],Mx={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Kr;(function(e){e.Strict="strict",e.Loose="loose"})(Kr||(Kr={}));var qi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(qi||(qi={}));var xs;(function(e){e.Partial="partial",e.Full="full"})(xs||(xs={}));const Lx={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ai;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ai||(ai={}));var Tl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tl||(Tl={}));var ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ae||(ae={}));const rv={[ae.Left]:ae.Right,[ae.Right]:ae.Left,[ae.Top]:ae.Bottom,[ae.Bottom]:ae.Top};function Ox(e){return e===null?null:e?"valid":"invalid"}const Rx=e=>"id"in e&&"source"in e&&"target"in e,c5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Vp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vs=(e,t=[0,0])=>{const{width:n,height:i}=Xn(e),r=e.origin??t,o=n*r[0],s=i*r[1];return{x:e.position.x-o,y:e.position.y-s}},d5=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const o=typeof r=="string";let s=!t.nodeLookup&&!o?r:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(r):Vp(r)?r:t.nodeLookup.get(r.id));const a=s?Ml(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bu(i,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yu(n)},Fs=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=bu(n,Ml(r)),i=!0)}),i?yu(n):{x:0,y:0,width:0,height:0}},Fp=(e,t,[n,i,r]=[0,0,1],o=!1,s=!1)=>{const a={...Gs(t,[n,i,r]),width:t.width/r,height:t.height/r},l=[];for(const u of e.values()){const{measured:d,selectable:c=!0,hidden:h=!1}=u;if(s&&!c||h)continue;const p=d.width??u.width??u.initialWidth??null,f=d.height??u.height??u.initialHeight??null,v=_s(a,eo(u)),b=(p??0)*(f??0),m=o&&v>0;(!u.internals.handleBounds||m||v>=b||u.dragging)&&l.push(u)}return l},h5=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function p5(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function f5({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:o},s){if(e.size===0)return Promise.resolve(!0);const a=p5(e,s),l=Fs(a),u=Hp(l,t,n,(s==null?void 0:s.minZoom)??r,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await i.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Vx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:o}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??i;let c=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)o==null||o("005",zn.error005());else{const p=a.measured.width,f=a.measured.height;p&&f&&(c=[[l,u],[l+p,u+f]])}else a&&to(s.extent)&&(c=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);const h=to(c)?or(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(o==null||o("015",zn.error015())),{position:{x:h.x-l+(s.measured.width??0)*d[0],y:h.y-u+(s.measured.height??0)*d[1]},positionAbsolute:h}}async function m5({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const o=new Set(e.map(h=>h.id)),s=[];for(const h of n){if(h.deletable===!1)continue;const p=o.has(h.id),f=!p&&h.parentId&&s.find(v=>v.id===h.parentId);(p||f)&&s.push(h)}const a=new Set(t.map(h=>h.id)),l=i.filter(h=>h.deletable!==!1),d=h5(s,l);for(const h of l)a.has(h.id)&&!d.find(f=>f.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:s};const c=await r({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const Jr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),or=(e={x:0,y:0},t,n)=>({x:Jr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Jr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Fx(e,t,n){const{width:i,height:r}=Xn(n),{x:o,y:s}=n.internals.positionAbsolute;return or(e,[[o,s],[o+i,s+r]],t)}const ov=(e,t,n)=>e<t?Jr(Math.abs(e-t),1,t)/t:e>n?-Jr(Math.abs(e-n),1,t)/t:0,Hx=(e,t,n=15,i=40)=>{const r=ov(e.x,i,t.width-i)*n,o=ov(e.y,i,t.height-i)*n;return[r,o]},bu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),eh=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),yu=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),eo=(e,t=[0,0])=>{var r,o;const{x:n,y:i}=Vp(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Ml=(e,t=[0,0])=>{var r,o;const{x:n,y:i}=Vp(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},Gx=(e,t)=>yu(bu(eh(e),eh(t))),_s=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},sv=e=>on(e.width)&&on(e.height)&&on(e.x)&&on(e.y),on=e=>!isNaN(e)&&isFinite(e),g5=(e,t)=>{},Hs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Gs=({x:e,y:t},[n,i,r],o=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-i)/r};return o?Hs(a,s):a},Ll=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function gr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function v5(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=gr(e,n),r=gr(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=gr(e.top??e.y??0,n),r=gr(e.bottom??e.y??0,n),o=gr(e.left??e.x??0,t),s=gr(e.right??e.x??0,t);return{top:i,right:s,bottom:r,left:o,x:o+s,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function w5(e,t,n,i,r,o){const{x:s,y:a}=Ll(e,[t,n,i]),{x:l,y:u}=Ll({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-l,c=o-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(c)}}const Hp=(e,t,n,i,r,o)=>{const s=v5(o,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),d=Jr(u,i,r),c=e.x+e.width/2,h=e.y+e.height/2,p=t/2-c*d,f=n/2-h*d,v=w5(e,p,f,d,t,n),b={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:p-b.left+b.right,y:f-b.top+b.bottom,zoom:d}},ks=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function to(e){return e!=null&&e!=="parent"}function Xn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Bx(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function $x(e,t={width:0,height:0},n,i,r){const o={...e},s=i.get(n);if(s){const a=s.origin||r;o.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function av(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function b5(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function y5(e){return{...Mx,...e||{}}}function Uo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:o,y:s}=sn(e),a=Gs({x:o-((r==null?void 0:r.left)??0),y:s-((r==null?void 0:r.top)??0)},i),{x:l,y:u}=n?Hs(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const Gp=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wx=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},x5=["INPUT","SELECT","TEXTAREA"];function jx(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:x5.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ux=e=>"clientX"in e,sn=(e,t)=>{var o,s;const n=Ux(e),i=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,r=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},lv=(e,t,n,i,r)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/i,y:(a.top-n.top)/i,...Gp(s)}})};function Yx({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,u=t*.125+o*.375+a*.375+i*.125,d=Math.abs(l-e),c=Math.abs(u-t);return[l,u,d,c]}function ka(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function uv({pos:e,x1:t,y1:n,x2:i,y2:r,c:o}){switch(e){case ae.Left:return[t-ka(t-i,o),n];case ae.Right:return[t+ka(i-t,o),n];case ae.Top:return[t,n-ka(n-r,o)];case ae.Bottom:return[t,n+ka(r-n,o)]}}function Xx({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top,curvature:s=.25}){const[a,l]=uv({pos:n,x1:e,y1:t,x2:i,y2:r,c:s}),[u,d]=uv({pos:o,x1:i,y1:r,x2:e,y2:t,c:s}),[c,h,p,f]=Yx({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${i},${r}`,c,h,p,f]}function Zx({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,o=n<e?n+r:n-r,s=Math.abs(i-t)/2,a=i<t?i+s:i-s;return[o,a,r,s]}function _5({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:o="basic"}){if(o==="manual")return i;const s=r&&n?i+1e3:i,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function k5({sourceNode:e,targetNode:t,width:n,height:i,transform:r}){const o=bu(Ml(e),Ml(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return _s(s,yu(o))>0}const S5=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,C5=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),E5=(e,t,n={})=>{if(!e.source||!e.target)return t;const i=n.getEdgeId||S5;let r;return Rx(e)?r={...e}:r={...e,id:i(e)},C5(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function qx({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,o,s,a]=Zx({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,o,s,a]}const cv={[ae.Left]:{x:-1,y:0},[ae.Right]:{x:1,y:0},[ae.Top]:{x:0,y:-1},[ae.Bottom]:{x:0,y:1}},D5=({source:e,sourcePosition:t=ae.Bottom,target:n})=>t===ae.Left||t===ae.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},dv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function z5({source:e,sourcePosition:t=ae.Bottom,target:n,targetPosition:i=ae.Top,center:r,offset:o,stepPosition:s}){const a=cv[t],l=cv[i],u={x:e.x+a.x*o,y:e.y+a.y*o},d={x:n.x+l.x*o,y:n.y+l.y*o},c=D5({source:u,sourcePosition:t,target:d}),h=c.x!==0?"x":"y",p=c[h];let f=[],v,b;const m={x:0,y:0},w={x:0,y:0},[,,g,y]=Zx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[h]*l[h]===-1){h==="x"?(v=r.x??u.x+(d.x-u.x)*s,b=r.y??(u.y+d.y)/2):(v=r.x??(u.x+d.x)/2,b=r.y??u.y+(d.y-u.y)*s);const S=[{x:v,y:u.y},{x:v,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];a[h]===p?f=h==="x"?S:T:f=h==="x"?T:S}else{const S=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?f=a.x===p?T:S:f=a.y===p?S:T,t===i){const D=Math.abs(e[h]-n[h]);if(D<=o){const P=Math.min(o-1,o-D);a[h]===p?m[h]=(u[h]>e[h]?-1:1)*P:w[h]=(d[h]>n[h]?-1:1)*P}}if(t!==i){const D=h==="x"?"y":"x",P=a[h]===l[D],A=u[D]>d[D],O=u[D]<d[D];(a[h]===1&&(!P&&A||P&&O)||a[h]!==1&&(!P&&O||P&&A))&&(f=h==="x"?S:T)}const C={x:u.x+m.x,y:u.y+m.y},I={x:d.x+w.x,y:d.y+w.y},L=Math.max(Math.abs(C.x-f[0].x),Math.abs(I.x-f[0].x)),V=Math.max(Math.abs(C.y-f[0].y),Math.abs(I.y-f[0].y));L>=V?(v=(C.x+I.x)/2,b=f[0].y):(v=f[0].x,b=(C.y+I.y)/2)}const k={x:u.x+m.x,y:u.y+m.y},_={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==f[0].x||k.y!==f[0].y?[k]:[],...f,..._.x!==f[f.length-1].x||_.y!==f[f.length-1].y?[_]:[],n],v,b,g,y]}function P5(e,t,n,i){const r=Math.min(dv(e,t)/2,dv(t,n)/2,i),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${o+r*u},${s}Q ${o},${s} ${o},${s+r*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+r*l}Q ${o},${s} ${o+r*a},${s}`}function th({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:d=.5}){const[c,h,p,f,v]=z5({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:r},targetPosition:o,center:{x:a,y:l},offset:u,stepPosition:d});let b=`M${c[0].x} ${c[0].y}`;for(let m=1;m<c.length-1;m++)b+=P5(c[m-1],c[m],c[m+1],s);return b+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[b,h,p,f,v]}function hv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function A5(e){var c;const{sourceNode:t,targetNode:n}=e;if(!hv(t)||!hv(n))return null;const i=t.internals.handleBounds||pv(t.handles),r=n.internals.handleBounds||pv(n.handles),o=fv((i==null?void 0:i.source)??[],e.sourceHandle),s=fv(e.connectionMode===Kr.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!o||!s)return(c=e.onError)==null||c.call(e,"008",zn.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||ae.Bottom,l=(s==null?void 0:s.position)||ae.Top,u=sr(t,o,a),d=sr(n,s,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function pv(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function sr(e,t,n=ae.Left,i=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Xn(e);if(i)return{x:r+s/2,y:o+a/2};switch((t==null?void 0:t.position)??n){case ae.Top:return{x:r+s/2,y:o};case ae.Right:return{x:r+s,y:o+a/2};case ae.Bottom:return{x:r+s/2,y:o+a};case ae.Left:return{x:r,y:o+a/2}}}function fv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function nh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function I5(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const o=new Set;return e.reduce((s,a)=>([a.markerStart||i,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const u=nh(l,t);o.has(u)||(s.push({id:u,color:l.color||n,...l}),o.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Qx=1e3,N5=10,Bp={nodeOrigin:[0,0],nodeExtent:ys,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},T5={...Bp,checkEquality:!0};function $p(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function M5(e,t,n){const i=$p(Bp,n);for(const r of e.values())if(r.parentId)jp(r,e,t,i);else{const o=Vs(r,i.nodeOrigin),s=to(r.extent)?r.extent:i.nodeExtent,a=or(o,s,Xn(r));r.internals.positionAbsolute=a}}function L5(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const o={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(o):r.type==="target"&&i.push(o)}return{source:n,target:i}}function Wp(e){return e==="manual"}function ih(e,t,n,i={}){var d,c;const r=$p(T5,i),o={i:0},s=new Map(t),a=r!=null&&r.elevateNodesOnSelect&&!Wp(r.zIndexMode)?Qx:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=s.get(h.id);if(r.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const f=Vs(h,r.nodeOrigin),v=to(h.extent)?h.extent:r.nodeExtent,b=or(f,v,Xn(h));p={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(c=h.measured)==null?void 0:c.height},internals:{positionAbsolute:b,handleBounds:L5(h,p),z:Kx(h,a,r.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),h.parentId&&jp(p,t,n,i,o),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function O5(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function jp(e,t,n,i,r){const{elevateNodesOnSelect:o,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=$p(Bp,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}O5(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*N5),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const c=o&&!Wp(l)?Qx:0,{x:h,y:p,z:f}=R5(e,d,s,a,c,l),{positionAbsolute:v}=e.internals,b=h!==v.x||p!==v.y;(b||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:p}:v,z:f}})}function Kx(e,t,n){const i=on(e.zIndex)?e.zIndex:0;return Wp(n)?i:i+(e.selected?t:0)}function R5(e,t,n,i,r,o){const{x:s,y:a}=t.internals.positionAbsolute,l=Xn(e),u=Vs(e,n),d=to(e.extent)?or(u,e.extent,l):u;let c=or({x:s+d.x,y:a+d.y},i,l);e.extent==="parent"&&(c=Fx(c,l,t));const h=Kx(e,r,o),p=t.internals.z??0;return{x:c.x,y:c.y,z:p>=h?p+1:h}}function Up(e,t,n,i=[0,0]){var s;const r=[],o=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((s=o.get(a.parentId))==null?void 0:s.expandedRect)??eo(l),d=Gx(u,a.rect);o.set(a.parentId,{expandedRect:d,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},u)=>{var g;const d=l.internals.positionAbsolute,c=Xn(l),h=l.origin??i,p=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,f=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,v=Math.max(c.width,Math.round(a.width)),b=Math.max(c.height,Math.round(a.height)),m=(v-c.width)*h[0],w=(b-c.height)*h[1];(p>0||f>0||m||w)&&(r.push({id:u,type:"position",position:{x:l.position.x-p+m,y:l.position.y-f+w}}),(g=n.get(u))==null||g.forEach(y=>{e.some(k=>k.id===y.id)||r.push({id:y.id,type:"position",position:{x:y.position.x+p,y:y.position.y+f}})})),(c.width<a.width||c.height<a.height||p||f)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?h[0]*p-m:0),height:b+(f?h[1]*f-w:0)}})}),r}function V5(e,t,n,i,r,o,s){const a=i==null?void 0:i.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],d=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(d.transform),h=[];for(const p of e.values()){const f=t.get(p.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),l=!0;continue}const v=Gp(p.nodeElement),b=f.measured.width!==v.width||f.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!f.internals.handleBounds||p.force))){const w=p.nodeElement.getBoundingClientRect(),g=to(f.extent)?f.extent:o;let{positionAbsolute:y}=f.internals;f.parentId&&f.extent==="parent"?y=Fx(y,v,t.get(f.parentId)):g&&(y=or(y,g,v));const k={...f,measured:v,internals:{...f.internals,positionAbsolute:y,handleBounds:{source:lv("source",p.nodeElement,w,c,f.id),target:lv("target",p.nodeElement,w,c,f.id)}}};t.set(f.id,k),f.parentId&&jp(k,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,b&&(u.push({id:f.id,type:"dimensions",dimensions:v}),f.expandParent&&f.parentId&&h.push({id:f.id,parentId:f.parentId,rect:eo(k,r)}))}}if(h.length>0){const p=Up(h,t,n,r);u.push(...p)}return{changes:u,updatedInternals:l}}async function F5({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,o]],i),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function mv(e,t,n,i,r,o){let s=r;const a=i.get(s)||new Map;i.set(s,a.set(n,t)),s=`${r}-${e}`;const l=i.get(s)||new Map;if(i.set(s,l.set(n,t)),o){s=`${r}-${e}-${o}`;const u=i.get(s)||new Map;i.set(s,u.set(n,t))}}function Jx(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:o,sourceHandle:s=null,targetHandle:a=null}=i,l={edgeId:i.id,source:r,target:o,sourceHandle:s,targetHandle:a},u=`${r}-${s}--${o}-${a}`,d=`${o}-${a}--${r}-${s}`;mv("source",l,d,e,r,s),mv("target",l,u,e,o,a),t.set(i.id,i)}}function e_(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:e_(n,t):!1}function gv(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function H5(e,t,n,i){const r=new Map;for(const[o,s]of e)if((s.selected||s.id===i)&&(!s.parentId||!e_(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(o);a&&r.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function kc({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var s,a,l;const r=[];for(const[u,d]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&r.push({...c,position:d.position,dragging:i})}if(!e)return[r[0],r];const o=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((l=t.get(e))==null?void 0:l.position)||o.position,dragging:i}:r[0],r]}function G5({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const o={x:n-r.distance.x,y:i-r.distance.y},s=Hs(o,t);return{x:s.x-o.x,y:s.y-o.y}}function B5({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let o={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},d=null,c=!1,h=null,p=!1,f=!1,v=null;function b({noDragClassName:w,handleSelector:g,domNode:y,isSelectable:k,nodeId:_,nodeClickDistance:E=0}){h=At(y);function S({x:L,y:V}){const{nodeLookup:D,nodeExtent:P,snapGrid:A,snapToGrid:O,nodeOrigin:N,onNodeDrag:M,onSelectionDrag:x,onError:F,updateNodePositions:H}=t();o={x:L,y:V};let z=!1;const X=a.size>1,q=X&&P?eh(Fs(a)):null,U=X&&O?G5({dragItems:a,snapGrid:A,x:L,y:V}):null;for(const[K,Y]of a){if(!D.has(K))continue;let Q={x:L-Y.distance.x,y:V-Y.distance.y};O&&(Q=U?{x:Math.round(Q.x+U.x),y:Math.round(Q.y+U.y)}:Hs(Q,A));let de=null;if(X&&P&&!Y.extent&&q){const{positionAbsolute:oe}=Y.internals,ge=oe.x-q.x+P[0][0],Ee=oe.x+Y.measured.width-q.x2+P[1][0],ye=oe.y-q.y+P[0][1],Xe=oe.y+Y.measured.height-q.y2+P[1][1];de=[[ge,ye],[Ee,Xe]]}const{position:le,positionAbsolute:se}=Vx({nodeId:K,nextPosition:Q,nodeLookup:D,nodeExtent:de||P,nodeOrigin:N,onError:F});z=z||Y.position.x!==le.x||Y.position.y!==le.y,Y.position=le,Y.internals.positionAbsolute=se}if(f=f||z,!!z&&(H(a,!0),v&&(i||M||!_&&x))){const[K,Y]=kc({nodeId:_,dragItems:a,nodeLookup:D});i==null||i(v,a,K,Y),M==null||M(v,K,Y),_||x==null||x(v,Y)}}async function T(){if(!d)return;const{transform:L,panBy:V,autoPanSpeed:D,autoPanOnNodeDrag:P}=t();if(!P){l=!1,cancelAnimationFrame(s);return}const[A,O]=Hx(u,d,D);(A!==0||O!==0)&&(o.x=(o.x??0)-A/L[2],o.y=(o.y??0)-O/L[2],await V({x:A,y:O})&&S(o)),s=requestAnimationFrame(T)}function C(L){var X;const{nodeLookup:V,multiSelectionActive:D,nodesDraggable:P,transform:A,snapGrid:O,snapToGrid:N,selectNodesOnDrag:M,onNodeDragStart:x,onSelectionDragStart:F,unselectNodesAndEdges:H}=t();c=!0,(!M||!k)&&!D&&_&&((X=V.get(_))!=null&&X.selected||H()),k&&M&&_&&(e==null||e(_));const z=Uo(L.sourceEvent,{transform:A,snapGrid:O,snapToGrid:N,containerBounds:d});if(o=z,a=H5(V,P,z,_),a.size>0&&(n||x||!_&&F)){const[q,U]=kc({nodeId:_,dragItems:a,nodeLookup:V});n==null||n(L.sourceEvent,a,q,U),x==null||x(L.sourceEvent,q,U),_||F==null||F(L.sourceEvent,U)}}const I=vx().clickDistance(E).on("start",L=>{const{domNode:V,nodeDragThreshold:D,transform:P,snapGrid:A,snapToGrid:O}=t();d=(V==null?void 0:V.getBoundingClientRect())||null,p=!1,f=!1,v=L.sourceEvent,D===0&&C(L),o=Uo(L.sourceEvent,{transform:P,snapGrid:A,snapToGrid:O,containerBounds:d}),u=sn(L.sourceEvent,d)}).on("drag",L=>{const{autoPanOnNodeDrag:V,transform:D,snapGrid:P,snapToGrid:A,nodeDragThreshold:O,nodeLookup:N}=t(),M=Uo(L.sourceEvent,{transform:D,snapGrid:P,snapToGrid:A,containerBounds:d});if(v=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||_&&!N.has(_))&&(p=!0),!p){if(!l&&V&&c&&(l=!0,T()),!c){const x=sn(L.sourceEvent,d),F=x.x-u.x,H=x.y-u.y;Math.sqrt(F*F+H*H)>O&&C(L)}(o.x!==M.xSnapped||o.y!==M.ySnapped)&&a&&c&&(u=sn(L.sourceEvent,d),S(M))}}).on("end",L=>{if(!(!c||p)&&(l=!1,c=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:D,onNodeDragStop:P,onSelectionDragStop:A}=t();if(f&&(D(a,!1),f=!1),r||P||!_&&A){const[O,N]=kc({nodeId:_,dragItems:a,nodeLookup:V,dragging:!1});r==null||r(L.sourceEvent,a,O,N),P==null||P(L.sourceEvent,O,N),_||A==null||A(L.sourceEvent,N)}}}).filter(L=>{const V=L.target;return!L.button&&(!w||!gv(V,`.${w}`,y))&&(!g||gv(V,g,y))});h.call(I)}function m(){h==null||h.on(".drag",null)}return{update:b,destroy:m}}function $5(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())_s(r,eo(o))>0&&i.push(o);return i}const W5=250;function j5(e,t,n,i){var a,l;let r=[],o=1/0;const s=$5(e,n,t+W5);for(const u of s){const d=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of d){if(i.nodeId===c.nodeId&&i.type===c.type&&i.id===c.id)continue;const{x:h,y:p}=sr(u,c,c.position,!0),f=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));f>t||(f<o?(r=[{...c,x:h,y:p}],o=f):f===o&&r.push({...c,x:h,y:p}))}}if(!r.length)return null;if(r.length>1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function t_(e,t,n,i,r,o=!1){var u,d,c;const s=i.get(e);if(!s)return null;const a=r==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(h=>h.id===n):a==null?void 0:a[0])??null;return l&&o?{...l,...sr(s,l,l.position,!0)}:l}function n_(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function U5(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const i_=()=>!0;function Y5(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:c,panBy:h,cancelConnection:p,onConnectStart:f,onConnect:v,onConnectEnd:b,isValidConnection:m=i_,onReconnectEnd:w,updateConnection:g,getTransform:y,getFromHandle:k,autoPanSpeed:_,dragThreshold:E=1,handleDomNode:S}){const T=Wx(e.target);let C=0,I;const{x:L,y:V}=sn(e),D=n_(o,S),P=a==null?void 0:a.getBoundingClientRect();let A=!1;if(!P||!D)return;const O=t_(r,D,i,l,t);if(!O)return;let N=sn(e,P),M=!1,x=null,F=!1,H=null;function z(){if(!d||!P)return;const[le,se]=Hx(N,P,_);h({x:le,y:se}),C=requestAnimationFrame(z)}const X={...O,nodeId:r,type:D,position:O.position},q=l.get(r);let K={inProgress:!0,isValid:null,from:sr(q,X,ae.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:q,to:N,toHandle:null,toPosition:rv[X.position],toNode:null,pointer:N};function Y(){A=!0,g(K),f==null||f(e,{nodeId:r,handleId:i,handleType:D})}E===0&&Y();function Q(le){if(!A){const{x:Xe,y:fn}=sn(le),Vt=Xe-L,mn=fn-V;if(!(Vt*Vt+mn*mn>E*E))return;Y()}if(!k()||!X){de(le);return}const se=y();N=sn(le,P),I=j5(Gs(N,se,!1,[1,1]),n,l,X),M||(z(),M=!0);const oe=r_(le,{handle:I,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:s?"target":"source",isValidConnection:m,doc:T,lib:u,flowId:c,nodeLookup:l});H=oe.handleDomNode,x=oe.connection,F=U5(!!I,oe.isValid);const ge=l.get(r),Ee=ge?sr(ge,X,ae.Left,!0):K.from,ye={...K,from:Ee,isValid:F,to:oe.toHandle&&F?Ll({x:oe.toHandle.x,y:oe.toHandle.y},se):N,toHandle:oe.toHandle,toPosition:F&&oe.toHandle?oe.toHandle.position:rv[X.position],toNode:oe.toHandle?l.get(oe.toHandle.nodeId):null,pointer:N};g(ye),K=ye}function de(le){if(!("touches"in le&&le.touches.length>0)){if(A){(I||H)&&x&&F&&(v==null||v(x));const{inProgress:se,...oe}=K,ge={...oe,toPosition:K.toHandle?K.toPosition:null};b==null||b(le,ge),o&&(w==null||w(le,ge))}p(),cancelAnimationFrame(C),M=!1,F=!1,x=null,H=null,T.removeEventListener("mousemove",Q),T.removeEventListener("mouseup",de),T.removeEventListener("touchmove",Q),T.removeEventListener("touchend",de)}}T.addEventListener("mousemove",Q),T.addEventListener("mouseup",de),T.addEventListener("touchmove",Q),T.addEventListener("touchend",de)}function r_(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:o,doc:s,lib:a,flowId:l,isValidConnection:u=i_,nodeLookup:d}){const c=o==="target",h=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:f}=sn(e),v=s.elementFromPoint(p,f),b=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:h,m={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const w=n_(void 0,b),g=b.getAttribute("data-nodeid"),y=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!g||!w)return m;const E={source:c?g:i,sourceHandle:c?y:r,target:c?i:g,targetHandle:c?r:y};m.connection=E;const T=k&&_&&(n===Kr.Strict?c&&w==="source"||!c&&w==="target":g!==i||y!==r);m.isValid=T&&u(E),m.toHandle=t_(g,w,y,d,n,!0)}return m}const rh={onPointerDown:Y5,isValid:r_};function X5({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=At(e);function o({translateExtent:a,width:l,height:u,zoomStep:d=1,pannable:c=!0,zoomable:h=!0,inversePan:p=!1}){const f=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const y=n(),k=g.sourceEvent.ctrlKey&&ks()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,E=y[2]*Math.pow(2,_*k);t.scaleTo(E)};let v=[0,0];const b=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const y=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const k=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[k[0]-v[0],k[1]-v[1]];v=k;const E=i()*Math.max(y[2],Math.log(y[2]))*(p?-1:1),S={x:y[0]-_[0]*E,y:y[1]-_[1]*E},T=[[0,0],[l,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:y[2]},T,a)},w=Nx().on("start",b).on("zoom",c?m:null).on("zoom.wheel",h?f:null);r.call(w,{})}function s(){r.on("zoom",null)}return{update:o,destroy:s,pointer:en}}const xu=e=>({x:e.x,y:e.y,zoom:e.k}),Sc=({x:e,y:t,zoom:n})=>wu.translate(e,t).scale(n),Ir=(e,t)=>e.target.closest(`.${t}`),o_=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Z5=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Cc=(e,t=0,n=Z5,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},s_=e=>{const t=e.ctrlKey&&ks()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function q5({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Ir(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const b=en(d),m=s_(d),w=c*Math.pow(2,m);i.scaleTo(n,w,b,d);return}const h=d.deltaMode===1?20:1;let p=r===qi.Vertical?0:d.deltaX*h,f=r===qi.Horizontal?0:d.deltaY*h;!ks()&&d.shiftKey&&r!==qi.Vertical&&(p=d.deltaY*h,f=0),i.translateBy(n,-(p/c)*o,-(f/c)*o,{internal:!0});const v=xu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,v))}}function Q5({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const o=i.type==="wheel",s=!t&&o&&!i.ctrlKey,a=Ir(i,e);if(i.ctrlKey&&o&&a&&i.preventDefault(),s||a)return null;i.preventDefault(),n.call(this,i,r)}}function K5({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var o,s,a;if((o=i.sourceEvent)!=null&&o.internal)return;const r=xu(i.transform);e.mouseButton=((s=i.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((a=i.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function J5({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return o=>{var s,a;e.usedRightMouseButton=!!(n&&o_(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||i([o.transform.x,o.transform.y,o.transform.k]),r&&!((a=o.sourceEvent)!=null&&a.internal)&&(r==null||r(o.sourceEvent,xu(o.transform)))}}function e3({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:o}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&o_(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const l=xu(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(s.sourceEvent,l)},n?150:0)}}}function t3({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:d}){return c=>{var b;const h=e||t,p=n&&c.ctrlKey,f=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Ir(c,`${u}-flow__node`)||Ir(c,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!o&&!n||s||d&&!f||Ir(c,a)&&f||Ir(c,l)&&(!f||r&&f&&!e)||!n&&c.ctrlKey&&f)return!1;if(!n&&c.type==="touchstart"&&((b=c.touches)==null?void 0:b.length)>1)return c.preventDefault(),!1;if(!h&&!r&&!p&&f||!i&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(i)&&!i.includes(c.button)&&c.type==="mousedown")return!1;const v=Array.isArray(i)&&i.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||f)&&v}}function n3({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=Nx().scaleExtent([t,n]).translateExtent(i),h=At(e).call(c);w({x:r.x,y:r.y,zoom:Jr(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const p=h.on("wheel.zoom"),f=h.on("dblclick.zoom");c.wheelDelta(s_);function v(I,L){return h?new Promise(V=>{c==null||c.interpolate((L==null?void 0:L.interpolate)==="linear"?jo:Ba).transform(Cc(h,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function b({noWheelClassName:I,noPanClassName:L,onPaneContextMenu:V,userSelectionActive:D,panOnScroll:P,panOnDrag:A,panOnScrollMode:O,panOnScrollSpeed:N,preventScrolling:M,zoomOnPinch:x,zoomOnScroll:F,zoomOnDoubleClick:H,zoomActivationKeyPressed:z,lib:X,onTransformChange:q,connectionInProgress:U,paneClickDistance:K,selectionOnDrag:Y}){D&&!u.isZoomingOrPanning&&m();const Q=P&&!z&&!D;c.clickDistance(Y?1/0:!on(K)||K<0?0:K);const de=Q?q5({zoomPanValues:u,noWheelClassName:I,d3Selection:h,d3Zoom:c,panOnScrollMode:O,panOnScrollSpeed:N,zoomOnPinch:x,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:a}):Q5({noWheelClassName:I,preventScrolling:M,d3ZoomHandler:p});if(h.on("wheel.zoom",de,{passive:!1}),!D){const se=K5({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});c.on("start",se);const oe=J5({zoomPanValues:u,panOnDrag:A,onPaneContextMenu:!!V,onPanZoom:o,onTransformChange:q});c.on("zoom",oe);const ge=e3({zoomPanValues:u,panOnDrag:A,panOnScroll:P,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:l});c.on("end",ge)}const le=t3({zoomActivationKeyPressed:z,panOnDrag:A,zoomOnScroll:F,panOnScroll:P,zoomOnDoubleClick:H,zoomOnPinch:x,userSelectionActive:D,noPanClassName:L,noWheelClassName:I,lib:X,connectionInProgress:U});c.filter(le),H?h.on("dblclick.zoom",f):h.on("dblclick.zoom",null)}function m(){c.on("zoom",null)}async function w(I,L,V){const D=Sc(I),P=c==null?void 0:c.constrain()(D,L,V);return P&&await v(P),new Promise(A=>A(P))}async function g(I,L){const V=Sc(I);return await v(V,L),new Promise(D=>D(V))}function y(I){if(h){const L=Sc(I),V=h.property("__zoom");(V.k!==I.zoom||V.x!==I.x||V.y!==I.y)&&(c==null||c.transform(h,L,null,{sync:!0}))}}function k(){const I=h?Ix(h.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function _(I,L){return h?new Promise(V=>{c==null||c.interpolate((L==null?void 0:L.interpolate)==="linear"?jo:Ba).scaleTo(Cc(h,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function E(I,L){return h?new Promise(V=>{c==null||c.interpolate((L==null?void 0:L.interpolate)==="linear"?jo:Ba).scaleBy(Cc(h,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function S(I){c==null||c.scaleExtent(I)}function T(I){c==null||c.translateExtent(I)}function C(I){const L=!on(I)||I<0?0:I;c==null||c.clickDistance(L)}return{update:b,destroy:m,setViewport:g,setViewportConstrained:w,getViewport:k,scaleTo:_,scaleBy:E,setScaleExtent:S,setTranslateExtent:T,syncViewport:y,setClickDistance:C}}var no;(function(e){e.Line="line",e.Handle="handle"})(no||(no={}));function i3({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:o}){const s=e-t,a=n-i,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function vv(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function ti(e,t){return Math.max(0,t-e)}function ni(e,t){return Math.max(0,e-t)}function Sa(e,t,n){return Math.max(0,t-e,e-n)}function wv(e,t){return e?!t:t}function r3(e,t,n,i,r,o,s,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:c}=t,h=d&&c,{xSnapped:p,ySnapped:f}=n,{minWidth:v,maxWidth:b,minHeight:m,maxHeight:w}=i,{x:g,y,width:k,height:_,aspectRatio:E}=e;let S=Math.floor(d?p-e.pointerX:0),T=Math.floor(c?f-e.pointerY:0);const C=k+(l?-S:S),I=_+(u?-T:T),L=-o[0]*k,V=-o[1]*_;let D=Sa(C,v,b),P=Sa(I,m,w);if(s){let N=0,M=0;l&&S<0?N=ti(g+S+L,s[0][0]):!l&&S>0&&(N=ni(g+C+L,s[1][0])),u&&T<0?M=ti(y+T+V,s[0][1]):!u&&T>0&&(M=ni(y+I+V,s[1][1])),D=Math.max(D,N),P=Math.max(P,M)}if(a){let N=0,M=0;l&&S>0?N=ni(g+S,a[0][0]):!l&&S<0&&(N=ti(g+C,a[1][0])),u&&T>0?M=ni(y+T,a[0][1]):!u&&T<0&&(M=ti(y+I,a[1][1])),D=Math.max(D,N),P=Math.max(P,M)}if(r){if(d){const N=Sa(C/E,m,w)*E;if(D=Math.max(D,N),s){let M=0;!l&&!u||l&&!u&&h?M=ni(y+V+C/E,s[1][1])*E:M=ti(y+V+(l?S:-S)/E,s[0][1])*E,D=Math.max(D,M)}if(a){let M=0;!l&&!u||l&&!u&&h?M=ti(y+C/E,a[1][1])*E:M=ni(y+(l?S:-S)/E,a[0][1])*E,D=Math.max(D,M)}}if(c){const N=Sa(I*E,v,b)/E;if(P=Math.max(P,N),s){let M=0;!l&&!u||u&&!l&&h?M=ni(g+I*E+L,s[1][0])/E:M=ti(g+(u?T:-T)*E+L,s[0][0])/E,P=Math.max(P,M)}if(a){let M=0;!l&&!u||u&&!l&&h?M=ti(g+I*E,a[1][0])/E:M=ni(g+(u?T:-T)*E,a[0][0])/E,P=Math.max(P,M)}}}T=T+(T<0?P:-P),S=S+(S<0?D:-D),r&&(h?C>I*E?T=(wv(l,u)?-S:S)/E:S=(wv(l,u)?-T:T)*E:d?(T=S/E,u=l):(S=T*E,l=u));const A=l?g+S:g,O=u?y+T:y;return{width:k+(l?-S:S),height:_+(u?-T:T),x:o[0]*S*(l?-1:1)+A,y:o[1]*T*(u?-1:1)+O}}const a_={width:0,height:0,x:0,y:0},o3={...a_,pointerX:0,pointerY:0,aspectRatio:1};function s3(e){return[[0,0],[e.measured.width,e.measured.height]]}function a3(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,a=n[0]*o,l=n[1]*s;return[[i-a,r-l],[i+o-a,r+s-l]]}function l3({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const o=At(e);let s={controlDirection:vv("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:d,keepAspectRatio:c,resizeDirection:h,onResizeStart:p,onResize:f,onResizeEnd:v,shouldResize:b}){let m={...a_},w={...o3};s={boundaries:d,resizeDirection:h,keepAspectRatio:c,controlDirection:vv(u)};let g,y=null,k=[],_,E,S,T=!1;const C=vx().on("start",I=>{const{nodeLookup:L,transform:V,snapGrid:D,snapToGrid:P,nodeOrigin:A,paneDomNode:O}=n();if(g=L.get(t),!g)return;y=(O==null?void 0:O.getBoundingClientRect())??null;const{xSnapped:N,ySnapped:M}=Uo(I.sourceEvent,{transform:V,snapGrid:D,snapToGrid:P,containerBounds:y});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},w={...m,pointerX:N,pointerY:M,aspectRatio:m.width/m.height},_=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=L.get(g.parentId),E=_&&g.extent==="parent"?s3(_):void 0),k=[],S=void 0;for(const[x,F]of L)if(F.parentId===t&&(k.push({id:x,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const H=a3(F,g,F.origin??A);S?S=[[Math.min(H[0][0],S[0][0]),Math.min(H[0][1],S[0][1])],[Math.max(H[1][0],S[1][0]),Math.max(H[1][1],S[1][1])]]:S=H}p==null||p(I,{...m})}).on("drag",I=>{const{transform:L,snapGrid:V,snapToGrid:D,nodeOrigin:P}=n(),A=Uo(I.sourceEvent,{transform:L,snapGrid:V,snapToGrid:D,containerBounds:y}),O=[];if(!g)return;const{x:N,y:M,width:x,height:F}=m,H={},z=g.origin??P,{width:X,height:q,x:U,y:K}=r3(w,s.controlDirection,A,s.boundaries,s.keepAspectRatio,z,E,S),Y=X!==x,Q=q!==F,de=U!==N&&Y,le=K!==M&&Q;if(!de&&!le&&!Y&&!Q)return;if((de||le||z[0]===1||z[1]===1)&&(H.x=de?U:m.x,H.y=le?K:m.y,m.x=H.x,m.y=H.y,k.length>0)){const Ee=U-N,ye=K-M;for(const Xe of k)Xe.position={x:Xe.position.x-Ee+z[0]*(X-x),y:Xe.position.y-ye+z[1]*(q-F)},O.push(Xe)}if((Y||Q)&&(H.width=Y&&(!s.resizeDirection||s.resizeDirection==="horizontal")?X:m.width,H.height=Q&&(!s.resizeDirection||s.resizeDirection==="vertical")?q:m.height,m.width=H.width,m.height=H.height),_&&g.expandParent){const Ee=z[0]*(H.width??0);H.x&&H.x<Ee&&(m.x=Ee,w.x=w.x-(H.x-Ee));const ye=z[1]*(H.height??0);H.y&&H.y<ye&&(m.y=ye,w.y=w.y-(H.y-ye))}const se=i3({width:m.width,prevWidth:x,height:m.height,prevHeight:F,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),oe={...m,direction:se};(b==null?void 0:b(I,oe))!==!1&&(T=!0,f==null||f(I,oe),i(H,O))}).on("end",I=>{T&&(v==null||v(I,{...m}),r==null||r({...m}),T=!1)});o.call(C)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var l_={exports:{}},u_={},c_={exports:{}},d_={};/**
|
|
2723
|
+
}`;vM(wM);const ix=(e,t)=>{const[n,i]=ie.useState(),r=ie.useRef(e.componentProps);return ie.useImperativeHandle(t,()=>({update:o=>{r.current=Object.assign(Object.assign({},r.current),o),i(Date.now())}}),[]),ie.createElement(e.component,r.current)};ix.displayName="DockviewReactJsBridge";const bM=(()=>{let e=1;return{next:()=>`dockview_react_portal_key_${(e++).toString()}`}})(),yM=ie.createContext({});class dr{constructor(t,n,i,r,o){this.parent=t,this.portalStore=n,this.component=i,this.parameters=r,this.context=o,this._initialProps={},this.disposed=!1,this.createPortal()}update(t){if(this.disposed)throw new Error("invalid operation: resource is already disposed");this.componentInstance?this.componentInstance.update(t):this._initialProps=Object.assign(Object.assign({},this._initialProps),t)}createPortal(){if(this.disposed)throw new Error("invalid operation: resource is already disposed");if(!xM(this.component))throw new Error("Dockview: Only React.memo(...), React.ForwardRef(...) and functional components are accepted as components");const t=ie.createElement(ie.forwardRef(ix),{component:this.component,componentProps:this.parameters,ref:r=>{this.componentInstance=r,Object.keys(this._initialProps).length>0&&(this.componentInstance.update(this._initialProps),this._initialProps={})}}),n=this.context?ie.createElement(yM.Provider,{value:this.context},t):t,i=hC.createPortal(n,this.parent,bM.next());this.ref={portal:i,disposable:this.portalStore.addPortal(i)}}dispose(){var t;(t=this.ref)===null||t===void 0||t.disposable.dispose(),this.disposed=!0}}const pu=()=>{const[e,t]=ie.useState([]);ie.useDebugValue(`Portal count: ${e.length}`);const n=ie.useCallback(i=>{t(o=>[...o,i]);let r=!1;return je.from(()=>{if(r)throw new Error("invalid operation: resource already disposed");r=!0,t(o=>o.filter(s=>s!==i))})},[]);return[e,n]};function xM(e){return typeof e=="function"||!!(e!=null&&e.$$typeof)}class Rg{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._onDidFocus=new B,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new B,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}focus(){}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{params:t.params,api:t.api,containerApi:t.containerApi})}update(t){var n;(n=this.part)===null||n===void 0||n.update({params:t.params})}layout(t,n){}dispose(){var t;this._onDidFocus.dispose(),this._onDidBlur.dispose(),(t=this.part)===null||t===void 0||t.dispose()}}class Vg{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}focus(){}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{params:t.params,api:t.api,containerApi:t.containerApi,tabLocation:t.tabLocation})}update(t){var n;(n=this.part)===null||n===void 0||n.update({params:t.params})}layout(t,n){}dispose(){var t;(t=this.part)===null||t===void 0||t.dispose()}}class Fg{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{group:t.group,containerApi:t.containerApi})}focus(){}update(t){var n,i,r;this.parameters&&(this.parameters.params=t.params),(n=this.part)===null||n===void 0||n.update({params:(r=(i=this.parameters)===null||i===void 0?void 0:i.params)!==null&&r!==void 0?r:{}})}layout(t,n){}dispose(){var t;(t=this.part)===null||t===void 0||t.dispose()}}class _M{get element(){return this._element}get part(){return this._part}constructor(t,n,i){this.component=t,this.reactPortalStore=n,this._group=i,this.mutableDisposable=new Je,this._element=document.createElement("div"),this._element.className="dv-react-part",this._element.style.height="100%",this._element.style.width="100%"}init(t){this.mutableDisposable.value=new ce(this._group.model.onDidAddPanel(()=>{this.updatePanels()}),this._group.model.onDidRemovePanel(()=>{this.updatePanels()}),this._group.model.onDidActivePanelChange(()=>{this.updateActivePanel()}),t.api.onDidActiveChange(()=>{this.updateGroupActive()})),this._part=new dr(this.element,this.reactPortalStore,this.component,{api:t.api,containerApi:t.containerApi,panels:this._group.model.panels,activePanel:this._group.model.activePanel,isGroupActive:this._group.api.isActive,group:this._group,headerPosition:this._group.model.headerPosition})}dispose(){var t;this.mutableDisposable.dispose(),(t=this._part)===null||t===void 0||t.dispose()}update(t){var n;(n=this._part)===null||n===void 0||n.update(t.params)}updatePanels(){this.update({params:{panels:this._group.model.panels}})}updateActivePanel(){this.update({params:{activePanel:this._group.model.activePanel}})}updateGroupActive(){this.update({params:{isGroupActive:this._group.api.isActive}})}}function mr(e,t){return e?n=>new _M(e,t,n):void 0}const ga="props.defaultTabComponent";function kM(e){return jd.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const SM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};jd.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},jd.map(a=>e[a])),ie.useEffect(()=>{var a;if(!n.current)return;const l=(a=e.tabComponents)!==null&&a!==void 0?a:{};e.defaultTabComponent&&(l[ga]=e.defaultTabComponent);const u={createLeftHeaderActionComponent:mr(e.leftHeaderActionsComponent,{addPortal:o}),createRightHeaderActionComponent:mr(e.rightHeaderActionsComponent,{addPortal:o}),createPrefixHeaderActionComponent:mr(e.prefixHeaderActionsComponent,{addPortal:o}),createComponent:p=>new Rg(p.id,e.components[p.name],{addPortal:o}),createTabComponent(p){return new Vg(p.id,l[p.name],{addPortal:o})},createWatermarkComponent:e.watermarkComponent?()=>new Fg("watermark",e.watermarkComponent,{addPortal:o}):void 0,defaultTabComponent:e.defaultTabComponent?ga:void 0},d=pM(n.current,Object.assign(Object.assign({},kM(e)),u)),{clientWidth:c,clientHeight:h}=n.current;return d.layout(c,h),e.onReady&&e.onReady({api:d}),i.current=d,()=>{i.current=void 0,d.dispose()}},[]),ie.useEffect(()=>{if(!i.current)return()=>{};const a=i.current.onDidDrop(l=>{e.onDidDrop&&e.onDidDrop(l)});return()=>{a.dispose()}},[e.onDidDrop]),ie.useEffect(()=>{if(!i.current)return()=>{};const a=i.current.onWillDrop(l=>{e.onWillDrop&&e.onWillDrop(l)});return()=>{a.dispose()}},[e.onWillDrop]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new Rg(a.id,e.components[a.name],{addPortal:o})})},[e.components]),ie.useEffect(()=>{var a;if(!i.current)return;const l=(a=e.tabComponents)!==null&&a!==void 0?a:{};e.defaultTabComponent&&(l[ga]=e.defaultTabComponent),i.current.updateOptions({defaultTabComponent:e.defaultTabComponent?ga:void 0,createTabComponent(u){return new Vg(u.id,l[u.name],{addPortal:o})}})},[e.tabComponents,e.defaultTabComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createWatermarkComponent:e.watermarkComponent?()=>new Fg("watermark",e.watermarkComponent,{addPortal:o}):void 0})},[e.watermarkComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createRightHeaderActionComponent:mr(e.rightHeaderActionsComponent,{addPortal:o})})},[e.rightHeaderActionsComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createLeftHeaderActionComponent:mr(e.leftHeaderActionsComponent,{addPortal:o})})},[e.leftHeaderActionsComponent]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createPrefixHeaderActionComponent:mr(e.prefixHeaderActionsComponent,{addPortal:o})})},[e.prefixHeaderActionsComponent]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});SM.displayName="DockviewComponent";class Hg extends hM{constructor(t,n,i,r){super(t,n),this.reactComponent=i,this.reactPortalStore=r}getComponent(){var t,n;return new dr(this.element,this.reactPortalStore,this.reactComponent,{params:(n=(t=this._params)===null||t===void 0?void 0:t.params)!==null&&n!==void 0?n:{},api:this.api,containerApi:new jy(this._params.accessor)})}}function CM(e){return Fd.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const EM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};Fd.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},Fd.map(a=>e[a])),ie.useEffect(()=>{if(!n.current)return()=>{};const a={createComponent:c=>new Hg(c.id,c.name,e.components[c.name],{addPortal:o})},l=fM(n.current,Object.assign(Object.assign({},CM(e)),a)),{clientWidth:u,clientHeight:d}=n.current;return l.layout(u,d),e.onReady&&e.onReady({api:l}),i.current=l,()=>{i.current=void 0,l.dispose()}},[]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new Hg(a.id,a.name,e.components[a.name],{addPortal:o})})},[e.components]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});EM.displayName="SplitviewComponent";class Gg extends tx{constructor(t,n,i,r){super(t,n),this.reactComponent=i,this.reactPortalStore=r}getComponent(){var t,n;return new dr(this.element,this.reactPortalStore,this.reactComponent,{params:(n=(t=this._params)===null||t===void 0?void 0:t.params)!==null&&n!==void 0?n:{},api:this.api,containerApi:new Uy(this._params.accessor)})}}function DM(e){return $d.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const zM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};$d.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},$d.map(a=>e[a])),ie.useEffect(()=>{if(!n.current)return()=>{};const a={createComponent:c=>new Gg(c.id,c.name,e.components[c.name],{addPortal:o})},l=mM(n.current,Object.assign(Object.assign({},DM(e)),a)),{clientWidth:u,clientHeight:d}=n.current;return l.layout(u,d),e.onReady&&e.onReady({api:l}),i.current=l,()=>{i.current=void 0,l.dispose()}},[]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new Gg(a.id,a.name,e.components[a.name],{addPortal:o})})},[e.components]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});zM.displayName="GridviewComponent";class va{get element(){return this._element}constructor(t,n,i){this.id=t,this.component=n,this.reactPortalStore=i,this._element=document.createElement("div"),this._element.style.height="100%",this._element.style.width="100%"}init(t){this.part=new dr(this.element,this.reactPortalStore,this.component,{params:t.params,api:t.api,title:t.title,containerApi:t.containerApi})}toJSON(){return{id:this.id}}update(t){var n;(n=this.part)===null||n===void 0||n.update(t.params)}dispose(){var t;(t=this.part)===null||t===void 0||t.dispose()}}function PM(e){return Wd.reduce((n,i)=>(i in e&&(n[i]=e[i]),n),{})}const AM=ie.forwardRef((e,t)=>{const n=ie.useRef(null),i=ie.useRef(),[r,o]=pu();ie.useImperativeHandle(t,()=>n.current,[]);const s=ie.useRef({});return ie.useEffect(()=>{const a={};Wd.forEach(l=>{const u=l,d=e[u];u in e&&d!==s.current[u]&&(a[u]=d)}),i.current&&i.current.updateOptions(a),s.current=e},Wd.map(a=>e[a])),ie.useEffect(()=>{var a;if(!n.current)return()=>{};const l=(a=e.headerComponents)!==null&&a!==void 0?a:{},u={createComponent:p=>new va(p.id,e.components[p.name],{addPortal:o}),createHeaderComponent:p=>new va(p.id,l[p.name],{addPortal:o})},d=gM(n.current,Object.assign(Object.assign({},PM(e)),u)),{clientWidth:c,clientHeight:h}=n.current;return d.layout(c,h),e.onReady&&e.onReady({api:d}),i.current=d,()=>{i.current=void 0,d.dispose()}},[]),ie.useEffect(()=>{i.current&&i.current.updateOptions({createComponent:a=>new va(a.id,e.components[a.name],{addPortal:o})})},[e.components]),ie.useEffect(()=>{var a;if(!i.current)return;const l=(a=e.headerComponents)!==null&&a!==void 0?a:{};i.current.updateOptions({createHeaderComponent:u=>new va(u.id,l[u.name],{addPortal:o})})},[e.headerComponents]),ie.useEffect(()=>{if(!i.current)return()=>{};const a=i.current.onDidDrop(l=>{e.onDidDrop&&e.onDidDrop(l)});return()=>{a.dispose()}},[e.onDidDrop]),ie.createElement("div",{style:{height:"100%",width:"100%"},ref:n},r)});AM.displayName="PaneviewComponent";function Ye(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=Ye(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var IM={value:()=>{}};function fu(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Ga(n)}function Ga(e){this._=e}function NM(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Ga.prototype=fu.prototype={constructor:Ga,on:function(e,t){var n=this._,i=NM(e+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((r=(e=i[o]).type)&&(r=TM(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(r=(e=i[o]).type)n[r]=Bg(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Bg(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ga(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)}};function TM(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Bg(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=IM,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ud="http://www.w3.org/1999/xhtml";const $g={svg:"http://www.w3.org/2000/svg",xhtml:Ud,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),$g.hasOwnProperty(t)?{space:$g[t],local:e}:e}function MM(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ud&&t.documentElement.namespaceURI===Ud?t.createElement(e):t.createElementNS(n,e)}}function LM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rx(e){var t=mu(e);return(t.local?LM:MM)(t)}function OM(){}function Ip(e){return e==null?OM:function(){return this.querySelector(e)}}function RM(e){typeof e!="function"&&(e=Ip(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var o=t[r],s=o.length,a=i[r]=new Array(s),l,u,d=0;d<s;++d)(l=o[d])&&(u=e.call(l,l.__data__,d,o))&&("__data__"in l&&(u.__data__=l.__data__),a[d]=u);return new Lt(i,this._parents)}function VM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FM(){return[]}function ox(e){return e==null?FM:function(){return this.querySelectorAll(e)}}function HM(e){return function(){return VM(e.apply(this,arguments))}}function GM(e){typeof e=="function"?e=HM(e):e=ox(e);for(var t=this._groups,n=t.length,i=[],r=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(i.push(e.call(l,l.__data__,u,s)),r.push(l));return new Lt(i,r)}function sx(e){return function(){return this.matches(e)}}function ax(e){return function(t){return t.matches(e)}}var BM=Array.prototype.find;function $M(e){return function(){return BM.call(this.children,e)}}function WM(){return this.firstElementChild}function jM(e){return this.select(e==null?WM:$M(typeof e=="function"?e:ax(e)))}var UM=Array.prototype.filter;function YM(){return Array.from(this.children)}function XM(e){return function(){return UM.call(this.children,e)}}function ZM(e){return this.selectAll(e==null?YM:XM(typeof e=="function"?e:ax(e)))}function qM(e){typeof e!="function"&&(e=sx(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var o=t[r],s=o.length,a=i[r]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new Lt(i,this._parents)}function lx(e){return new Array(e.length)}function QM(){return new Lt(this._enter||this._groups.map(lx),this._parents)}function El(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}El.prototype={constructor:El,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function KM(e){return function(){return e}}function JM(e,t,n,i,r,o){for(var s=0,a,l=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],i[s]=a):n[s]=new El(e,o[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function eL(e,t,n,i,r,o,s){var a,l,u=new Map,d=t.length,c=o.length,h=new Array(d),p;for(a=0;a<d;++a)(l=t[a])&&(h[a]=p=s.call(l,l.__data__,a,t)+"",u.has(p)?r[a]=l:u.set(p,l));for(a=0;a<c;++a)p=s.call(e,o[a],a,o)+"",(l=u.get(p))?(i[a]=l,l.__data__=o[a],u.delete(p)):n[a]=new El(e,o[a]);for(a=0;a<d;++a)(l=t[a])&&u.get(h[a])===l&&(r[a]=l)}function tL(e){return e.__data__}function nL(e,t){if(!arguments.length)return Array.from(this,tL);var n=t?eL:JM,i=this._parents,r=this._groups;typeof e!="function"&&(e=KM(e));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var d=i[u],c=r[u],h=c.length,p=iL(e.call(d,d&&d.__data__,u,i)),f=p.length,v=a[u]=new Array(f),b=s[u]=new Array(f),m=l[u]=new Array(h);n(d,c,v,b,m,p,t);for(var w=0,g=0,y,k;w<f;++w)if(y=v[w]){for(w>=g&&(g=w+1);!(k=b[g])&&++g<f;);y._next=k||null}}return s=new Lt(s,i),s._enter=a,s._exit=l,s}function iL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rL(){return new Lt(this._exit||this._groups.map(lx),this._parents)}function oL(e,t,n){var i=this.enter(),r=this,o=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?o.remove():n(o),i&&r?i.merge(r).order():r}function sL(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var u=n[l],d=i[l],c=u.length,h=a[l]=new Array(c),p,f=0;f<c;++f)(p=u[f]||d[f])&&(h[f]=p);for(;l<r;++l)a[l]=n[l];return new Lt(a,this._parents)}function aL(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,o=i[r],s;--r>=0;)(s=i[r])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function lL(e){e||(e=uL);function t(c,h){return c&&h?e(c.__data__,h.__data__):!c-!h}for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s=n[o],a=s.length,l=r[o]=new Array(a),u,d=0;d<a;++d)(u=s[d])&&(l[d]=u);l.sort(t)}return new Lt(r,this._parents).order()}function uL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dL(){return Array.from(this)}function hL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null}function pL(){let e=0;for(const t of this)++e;return e}function fL(){return!this.node()}function mL(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],o=0,s=r.length,a;o<s;++o)(a=r[o])&&e.call(a,a.__data__,o,r);return this}function gL(e){return function(){this.removeAttribute(e)}}function vL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wL(e,t){return function(){this.setAttribute(e,t)}}function bL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function yL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _L(e,t){var n=mu(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?vL:gL:typeof t=="function"?n.local?xL:yL:n.local?bL:wL)(n,t))}function ux(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function kL(e){return function(){this.style.removeProperty(e)}}function SL(e,t,n){return function(){this.style.setProperty(e,t,n)}}function CL(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function EL(e,t,n){return arguments.length>1?this.each((t==null?kL:typeof t=="function"?CL:SL)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||ux(e).getComputedStyle(e,null).getPropertyValue(t)}function DL(e){return function(){delete this[e]}}function zL(e,t){return function(){this[e]=t}}function PL(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function AL(e,t){return arguments.length>1?this.each((t==null?DL:typeof t=="function"?PL:zL)(e,t)):this.node()[e]}function cx(e){return e.trim().split(/^|\s+/)}function Np(e){return e.classList||new dx(e)}function dx(e){this._node=e,this._names=cx(e.getAttribute("class")||"")}dx.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function hx(e,t){for(var n=Np(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function px(e,t){for(var n=Np(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function IL(e){return function(){hx(this,e)}}function NL(e){return function(){px(this,e)}}function TL(e,t){return function(){(t.apply(this,arguments)?hx:px)(this,e)}}function ML(e,t){var n=cx(e+"");if(arguments.length<2){for(var i=Np(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?TL:t?IL:NL)(n,t))}function LL(){this.textContent=""}function OL(e){return function(){this.textContent=e}}function RL(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function VL(e){return arguments.length?this.each(e==null?LL:(typeof e=="function"?RL:OL)(e)):this.node().textContent}function FL(){this.innerHTML=""}function HL(e){return function(){this.innerHTML=e}}function GL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function BL(e){return arguments.length?this.each(e==null?FL:(typeof e=="function"?GL:HL)(e)):this.node().innerHTML}function $L(){this.nextSibling&&this.parentNode.appendChild(this)}function WL(){return this.each($L)}function jL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UL(){return this.each(jL)}function YL(e){var t=typeof e=="function"?e:rx(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function XL(){return null}function ZL(e,t){var n=typeof e=="function"?e:rx(e),i=t==null?XL:typeof t=="function"?t:Ip(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function qL(){var e=this.parentNode;e&&e.removeChild(this)}function QL(){return this.each(qL)}function KL(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function JL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eO(e){return this.select(e?JL:KL)}function tO(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nO(e){return function(t){e.call(this,t,this.__data__)}}function iO(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function rO(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,o;n<r;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++i]=o;++i?t.length=i:delete this.__on}}}function oO(e,t,n){return function(){var i=this.__on,r,o=nO(t);if(i){for(var s=0,a=i.length;s<a;++s)if((r=i[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=t;return}}this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},i?i.push(r):this.__on=[r]}}function sO(e,t,n){var i=iO(e+""),r,o=i.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,d;l<u;++l)for(r=0,d=a[l];r<o;++r)if((s=i[r]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?oO:rO,r=0;r<o;++r)this.each(a(i[r],t,n));return this}function fx(e,t,n){var i=ux(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function aO(e,t){return function(){return fx(this,e,t)}}function lO(e,t){return function(){return fx(this,e,t.apply(this,arguments))}}function uO(e,t){return this.each((typeof t=="function"?lO:aO)(e,t))}function*cO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,o=i.length,s;r<o;++r)(s=i[r])&&(yield s)}var mx=[null];function Lt(e,t){this._groups=e,this._parents=t}function Os(){return new Lt([[document.documentElement]],mx)}function dO(){return this}Lt.prototype=Os.prototype={constructor:Lt,select:RM,selectAll:GM,selectChild:jM,selectChildren:ZM,filter:qM,data:nL,enter:QM,exit:rL,join:oL,merge:sL,selection:dO,order:aL,sort:lL,call:cL,nodes:dL,node:hL,size:pL,empty:fL,each:mL,attr:_L,style:EL,property:AL,classed:ML,text:VL,html:BL,raise:WL,lower:UL,append:YL,insert:ZL,remove:QL,clone:eO,datum:tO,on:sO,dispatch:uO,[Symbol.iterator]:cO};function At(e){return typeof e=="string"?new Lt([[document.querySelector(e)]],[document.documentElement]):new Lt([[e]],mx)}function hO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function en(e,t){if(e=hO(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const pO={passive:!1},gs={capture:!0,passive:!1};function bc(e){e.stopImmediatePropagation()}function Hr(e){e.preventDefault(),e.stopImmediatePropagation()}function gx(e){var t=e.document.documentElement,n=At(e).on("dragstart.drag",Hr,gs);"onselectstart"in t?n.on("selectstart.drag",Hr,gs):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function vx(e,t){var n=e.document.documentElement,i=At(e).on("dragstart.drag",null);t&&(i.on("click.drag",Hr,gs),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const wa=e=>()=>e;function Yd(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:o,x:s,y:a,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Yd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function fO(e){return!e.ctrlKey&&!e.button}function mO(){return this.parentNode}function gO(e,t){return t??{x:e.x,y:e.y}}function vO(){return navigator.maxTouchPoints||"ontouchstart"in this}function wx(){var e=fO,t=mO,n=gO,i=vO,r={},o=fu("start","drag","end"),s=0,a,l,u,d,c=0;function h(y){y.on("mousedown.drag",p).filter(i).on("touchstart.drag",b).on("touchmove.drag",m,pO).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(y,k){if(!(d||!e.call(this,y,k))){var _=g(this,t.call(this,y,k),y,k,"mouse");_&&(At(y.view).on("mousemove.drag",f,gs).on("mouseup.drag",v,gs),gx(y.view),bc(y),u=!1,a=y.clientX,l=y.clientY,_("start",y))}}function f(y){if(Hr(y),!u){var k=y.clientX-a,_=y.clientY-l;u=k*k+_*_>c}r.mouse("drag",y)}function v(y){At(y.view).on("mousemove.drag mouseup.drag",null),vx(y.view,u),Hr(y),r.mouse("end",y)}function b(y,k){if(e.call(this,y,k)){var _=y.changedTouches,E=t.call(this,y,k),S=_.length,T,C;for(T=0;T<S;++T)(C=g(this,E,y,k,_[T].identifier,_[T]))&&(bc(y),C("start",y,_[T]))}}function m(y){var k=y.changedTouches,_=k.length,E,S;for(E=0;E<_;++E)(S=r[k[E].identifier])&&(Hr(y),S("drag",y,k[E]))}function w(y){var k=y.changedTouches,_=k.length,E,S;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),E=0;E<_;++E)(S=r[k[E].identifier])&&(bc(y),S("end",y,k[E]))}function g(y,k,_,E,S,T){var C=o.copy(),I=en(T||_,k),L,V,D;if((D=n.call(y,new Yd("beforestart",{sourceEvent:_,target:h,identifier:S,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:C}),E))!=null)return L=D.x-I[0]||0,V=D.y-I[1]||0,function P(A,O,N){var M=I,x;switch(A){case"start":r[S]=P,x=s++;break;case"end":delete r[S],--s;case"drag":I=en(N||O,k),x=s;break}C.call(A,y,new Yd(A,{sourceEvent:O,subject:D,target:h,identifier:S,active:x,x:I[0]+L,y:I[1]+V,dx:I[0]-M[0],dy:I[1]-M[1],dispatch:C}),E)}}return h.filter=function(y){return arguments.length?(e=typeof y=="function"?y:wa(!!y),h):e},h.container=function(y){return arguments.length?(t=typeof y=="function"?y:wa(y),h):t},h.subject=function(y){return arguments.length?(n=typeof y=="function"?y:wa(y),h):n},h.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:wa(!!y),h):i},h.on=function(){var y=o.on.apply(o,arguments);return y===o?h:y},h.clickDistance=function(y){return arguments.length?(c=(y=+y)*y,h):Math.sqrt(c)},h}function Tp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bx(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Rs(){}var vs=.7,Dl=1/vs,Gr="\\s*([+-]?\\d+)\\s*",ws="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",En="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wO=/^#([0-9a-f]{3,8})$/,bO=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),yO=new RegExp(`^rgb\\(${En},${En},${En}\\)$`),xO=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${ws}\\)$`),_O=new RegExp(`^rgba\\(${En},${En},${En},${ws}\\)$`),kO=new RegExp(`^hsl\\(${ws},${En},${En}\\)$`),SO=new RegExp(`^hsla\\(${ws},${En},${En},${ws}\\)$`),Wg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Tp(Rs,ir,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jg,formatHex:jg,formatHex8:CO,formatHsl:EO,formatRgb:Ug,toString:Ug});function jg(){return this.rgb().formatHex()}function CO(){return this.rgb().formatHex8()}function EO(){return yx(this).formatHsl()}function Ug(){return this.rgb().formatRgb()}function ir(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Yg(t):n===3?new _t(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ba(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bO.exec(e))?new _t(t[1],t[2],t[3],1):(t=yO.exec(e))?new _t(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xO.exec(e))?ba(t[1],t[2],t[3],t[4]):(t=_O.exec(e))?ba(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kO.exec(e))?qg(t[1],t[2]/100,t[3]/100,1):(t=SO.exec(e))?qg(t[1],t[2]/100,t[3]/100,t[4]):Wg.hasOwnProperty(e)?Yg(Wg[e]):e==="transparent"?new _t(NaN,NaN,NaN,0):null}function Yg(e){return new _t(e>>16&255,e>>8&255,e&255,1)}function ba(e,t,n,i){return i<=0&&(e=t=n=NaN),new _t(e,t,n,i)}function DO(e){return e instanceof Rs||(e=ir(e)),e?(e=e.rgb(),new _t(e.r,e.g,e.b,e.opacity)):new _t}function Xd(e,t,n,i){return arguments.length===1?DO(e):new _t(e,t,n,i??1)}function _t(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Tp(_t,Xd,bx(Rs,{brighter(e){return e=e==null?Dl:Math.pow(Dl,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _t(Zi(this.r),Zi(this.g),Zi(this.b),zl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xg,formatHex:Xg,formatHex8:zO,formatRgb:Zg,toString:Zg}));function Xg(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}`}function zO(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}${Wi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zg(){const e=zl(this.opacity);return`${e===1?"rgb(":"rgba("}${Zi(this.r)}, ${Zi(this.g)}, ${Zi(this.b)}${e===1?")":`, ${e})`}`}function zl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wi(e){return e=Zi(e),(e<16?"0":"")+e.toString(16)}function qg(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new nn(e,t,n,i)}function yx(e){if(e instanceof nn)return new nn(e.h,e.s,e.l,e.opacity);if(e instanceof Rs||(e=ir(e)),!e)return new nn;if(e instanceof nn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(t===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new nn(s,a,l,e.opacity)}function PO(e,t,n,i){return arguments.length===1?yx(e):new nn(e,t,n,i??1)}function nn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Tp(nn,PO,bx(Rs,{brighter(e){return e=e==null?Dl:Math.pow(Dl,e),new nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new nn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new _t(yc(e>=240?e-240:e+120,r,i),yc(e,r,i),yc(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new nn(Qg(this.h),ya(this.s),ya(this.l),zl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zl(this.opacity);return`${e===1?"hsl(":"hsla("}${Qg(this.h)}, ${ya(this.s)*100}%, ${ya(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Qg(e){return e=(e||0)%360,e<0?e+360:e}function ya(e){return Math.max(0,Math.min(1,e||0))}function yc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Mp=e=>()=>e;function AO(e,t){return function(n){return e+n*t}}function IO(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function NO(e){return(e=+e)==1?xx:function(t,n){return n-t?IO(t,n,e):Mp(isNaN(t)?n:t)}}function xx(e,t){var n=t-e;return n?AO(e,n):Mp(isNaN(e)?t:e)}const Pl=function e(t){var n=NO(t);function i(r,o){var s=n((r=Xd(r)).r,(o=Xd(o)).r),a=n(r.g,o.g),l=n(r.b,o.b),u=xx(r.opacity,o.opacity);return function(d){return r.r=s(d),r.g=a(d),r.b=l(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function TO(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=e[r]*(1-o)+t[r]*o;return i}}function MO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function LO(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=jo(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function OO(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function xn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function RO(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=jo(e[r],t[r]):i[r]=t[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var Zd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xc=new RegExp(Zd.source,"g");function VO(e){return function(){return e}}function FO(e){return function(t){return e(t)+""}}function _x(e,t){var n=Zd.lastIndex=xc.lastIndex=0,i,r,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(i=Zd.exec(e))&&(r=xc.exec(t));)(o=r.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:xn(i,r)})),n=xc.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?FO(l[0].x):VO(t):(t=l.length,function(u){for(var d=0,c;d<t;++d)a[(c=l[d]).i]=c.x(u);return a.join("")})}function jo(e,t){var n=typeof t,i;return t==null||n==="boolean"?Mp(t):(n==="number"?xn:n==="string"?(i=ir(t))?(t=i,Pl):_x:t instanceof ir?Pl:t instanceof Date?OO:MO(t)?TO:Array.isArray(t)?LO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RO:xn)(e,t)}var Kg=180/Math.PI,qd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kx(e,t,n,i,r,o){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),e*i<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*Kg,skewX:Math.atan(l)*Kg,scaleX:s,scaleY:a}}var xa;function HO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qd:kx(t.a,t.b,t.c,t.d,t.e,t.f)}function GO(e){return e==null||(xa||(xa=document.createElementNS("http://www.w3.org/2000/svg","g")),xa.setAttribute("transform",e),!(e=xa.transform.baseVal.consolidate()))?qd:(e=e.matrix,kx(e.a,e.b,e.c,e.d,e.e,e.f))}function Sx(e,t,n,i){function r(u){return u.length?u.pop()+" ":""}function o(u,d,c,h,p,f){if(u!==c||d!==h){var v=p.push("translate(",null,t,null,n);f.push({i:v-4,x:xn(u,c)},{i:v-2,x:xn(d,h)})}else(c||h)&&p.push("translate("+c+t+h+n)}function s(u,d,c,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:c.push(r(c)+"rotate(",null,i)-2,x:xn(u,d)})):d&&c.push(r(c)+"rotate("+d+i)}function a(u,d,c,h){u!==d?h.push({i:c.push(r(c)+"skewX(",null,i)-2,x:xn(u,d)}):d&&c.push(r(c)+"skewX("+d+i)}function l(u,d,c,h,p,f){if(u!==c||d!==h){var v=p.push(r(p)+"scale(",null,",",null,")");f.push({i:v-4,x:xn(u,c)},{i:v-2,x:xn(d,h)})}else(c!==1||h!==1)&&p.push(r(p)+"scale("+c+","+h+")")}return function(u,d){var c=[],h=[];return u=e(u),d=e(d),o(u.translateX,u.translateY,d.translateX,d.translateY,c,h),s(u.rotate,d.rotate,c,h),a(u.skewX,d.skewX,c,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,c,h),u=d=null,function(p){for(var f=-1,v=h.length,b;++f<v;)c[(b=h[f]).i]=b.x(p);return c.join("")}}}var BO=Sx(HO,"px, ","px)","deg)"),$O=Sx(GO,", ",")",")"),WO=1e-12;function Jg(e){return((e=Math.exp(e))+1/e)/2}function jO(e){return((e=Math.exp(e))-1/e)/2}function UO(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ba=function e(t,n,i){function r(o,s){var a=o[0],l=o[1],u=o[2],d=s[0],c=s[1],h=s[2],p=d-a,f=c-l,v=p*p+f*f,b,m;if(v<WO)m=Math.log(h/u)/t,b=function(E){return[a+E*p,l+E*f,u*Math.exp(t*E*m)]};else{var w=Math.sqrt(v),g=(h*h-u*u+i*v)/(2*u*n*w),y=(h*h-u*u-i*v)/(2*h*n*w),k=Math.log(Math.sqrt(g*g+1)-g),_=Math.log(Math.sqrt(y*y+1)-y);m=(_-k)/t,b=function(E){var S=E*m,T=Jg(k),C=u/(n*w)*(T*UO(t*S+k)-jO(k));return[a+C*p,l+C*f,u*T/Jg(t*S+k)]}}return b.duration=m*1e3*t/Math.SQRT2,b}return r.rho=function(o){var s=Math.max(.001,+o),a=s*s,l=a*a;return e(s,a,l)},r}(Math.SQRT2,2,4);var Qr=0,Ao=0,So=0,Cx=1e3,Al,Io,Il=0,rr=0,gu=0,bs=typeof performance=="object"&&performance.now?performance:Date,Ex=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Lp(){return rr||(Ex(YO),rr=bs.now()+gu)}function YO(){rr=0}function Nl(){this._call=this._time=this._next=null}Nl.prototype=Dx.prototype={constructor:Nl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Lp():+n)+(t==null?0:+t),!this._next&&Io!==this&&(Io?Io._next=this:Al=this,Io=this),this._call=e,this._time=n,Qd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qd())}};function Dx(e,t,n){var i=new Nl;return i.restart(e,t,n),i}function XO(){Lp(),++Qr;for(var e=Al,t;e;)(t=rr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qr}function ev(){rr=(Il=bs.now())+gu,Qr=Ao=0;try{XO()}finally{Qr=0,qO(),rr=0}}function ZO(){var e=bs.now(),t=e-Il;t>Cx&&(gu-=t,Il=e)}function qO(){for(var e,t=Al,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Al=n);Io=e,Qd(i)}function Qd(e){if(!Qr){Ao&&(Ao=clearTimeout(Ao));var t=e-rr;t>24?(e<1/0&&(Ao=setTimeout(ev,e-bs.now()-gu)),So&&(So=clearInterval(So))):(So||(Il=bs.now(),So=setInterval(ZO,Cx)),Qr=1,Ex(ev))}}function tv(e,t,n){var i=new Nl;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var QO=fu("start","end","cancel","interrupt"),KO=[],zx=0,nv=1,Kd=2,$a=3,iv=4,Jd=5,Wa=6;function vu(e,t,n,i,r,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;JO(e,n,{name:t,index:i,group:r,on:QO,tween:KO,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:zx})}function Op(e,t){var n=pn(e,t);if(n.state>zx)throw new Error("too late; already scheduled");return n}function An(e,t){var n=pn(e,t);if(n.state>$a)throw new Error("too late; already running");return n}function pn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function JO(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=Dx(o,0,n.time);function o(u){n.state=nv,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,c,h,p;if(n.state!==nv)return l();for(d in i)if(p=i[d],p.name===n.name){if(p.state===$a)return tv(s);p.state===iv?(p.state=Wa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[d]):+d<t&&(p.state=Wa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[d])}if(tv(function(){n.state===$a&&(n.state=iv,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Kd,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Kd){for(n.state=$a,r=new Array(h=n.tween.length),d=0,c=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=p);r.length=c+1}}function a(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Jd,1),c=-1,h=r.length;++c<h;)r[c].call(e,d);n.state===Jd&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Wa,n.timer.stop(),delete i[t];for(var u in i)return;delete e.__transition}}function ja(e,t){var n=e.__transition,i,r,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((i=n[s]).name!==t){o=!1;continue}r=i.state>Kd&&i.state<Jd,i.state=Wa,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[s]}o&&delete e.__transition}}function eR(e){return this.each(function(){ja(this,e)})}function tR(e,t){var n,i;return function(){var r=An(this,e),o=r.tween;if(o!==n){i=n=o;for(var s=0,a=i.length;s<a;++s)if(i[s].name===t){i=i.slice(),i.splice(s,1);break}}r.tween=i}}function nR(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var o=An(this,e),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:t,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===t){r[l]=a;break}l===u&&r.push(a)}o.tween=r}}function iR(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=pn(this.node(),n).tween,r=0,o=i.length,s;r<o;++r)if((s=i[r]).name===e)return s.value;return null}return this.each((t==null?tR:nR)(n,e,t))}function Rp(e,t,n){var i=e._id;return e.each(function(){var r=An(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return pn(r,i).value[t]}}function Px(e,t){var n;return(typeof t=="number"?xn:t instanceof ir?Pl:(n=ir(t))?(t=n,Pl):_x)(e,t)}function rR(e){return function(){this.removeAttribute(e)}}function oR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sR(e,t,n){var i,r=n+"",o;return function(){var s=this.getAttribute(e);return s===r?null:s===i?o:o=t(i=s,n)}}function aR(e,t,n){var i,r=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===i?o:o=t(i=s,n)}}function lR(e,t,n){var i,r,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===i&&l===r?o:(r=l,o=t(i=s,a)))}}function uR(e,t,n){var i,r,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===i&&l===r?o:(r=l,o=t(i=s,a)))}}function cR(e,t){var n=mu(e),i=n==="transform"?$O:Px;return this.attrTween(e,typeof t=="function"?(n.local?uR:lR)(n,i,Rp(this,"attr."+e,t)):t==null?(n.local?oR:rR)(n):(n.local?aR:sR)(n,i,t))}function dR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pR(e,t){var n,i;function r(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&hR(e,o)),n}return r._value=t,r}function fR(e,t){var n,i;function r(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&dR(e,o)),n}return r._value=t,r}function mR(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=mu(e);return this.tween(n,(i.local?pR:fR)(i,t))}function gR(e,t){return function(){Op(this,e).delay=+t.apply(this,arguments)}}function vR(e,t){return t=+t,function(){Op(this,e).delay=t}}function wR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gR:vR)(t,e)):pn(this.node(),t).delay}function bR(e,t){return function(){An(this,e).duration=+t.apply(this,arguments)}}function yR(e,t){return t=+t,function(){An(this,e).duration=t}}function xR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?bR:yR)(t,e)):pn(this.node(),t).duration}function _R(e,t){if(typeof t!="function")throw new Error;return function(){An(this,e).ease=t}}function kR(e){var t=this._id;return arguments.length?this.each(_R(t,e)):pn(this.node(),t).ease}function SR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;An(this,e).ease=n}}function CR(e){if(typeof e!="function")throw new Error;return this.each(SR(this._id,e))}function ER(e){typeof e!="function"&&(e=sx(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var o=t[r],s=o.length,a=i[r]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new jn(i,this._parents,this._name,this._id)}function DR(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l=t[a],u=n[a],d=l.length,c=s[a]=new Array(d),h,p=0;p<d;++p)(h=l[p]||u[p])&&(c[p]=h);for(;a<i;++a)s[a]=t[a];return new jn(s,this._parents,this._name,this._id)}function zR(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function PR(e,t,n){var i,r,o=zR(t)?Op:An;return function(){var s=o(this,e),a=s.on;a!==i&&(r=(i=a).copy()).on(t,n),s.on=r}}function AR(e,t){var n=this._id;return arguments.length<2?pn(this.node(),n).on.on(e):this.each(PR(n,e,t))}function IR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function NR(){return this.on("end.remove",IR(this._id))}function TR(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ip(e));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a=i[s],l=a.length,u=o[s]=new Array(l),d,c,h=0;h<l;++h)(d=a[h])&&(c=e.call(d,d.__data__,h,a))&&("__data__"in d&&(c.__data__=d.__data__),u[h]=c,vu(u[h],t,n,h,u,pn(d,n)));return new jn(o,this._parents,t,n)}function MR(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ox(e));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l=i[a],u=l.length,d,c=0;c<u;++c)if(d=l[c]){for(var h=e.call(d,d.__data__,c,l),p,f=pn(d,n),v=0,b=h.length;v<b;++v)(p=h[v])&&vu(p,t,n,v,h,f);o.push(h),s.push(d)}return new jn(o,s,t,n)}var LR=Os.prototype.constructor;function OR(){return new LR(this._groups,this._parents)}function RR(e,t){var n,i,r;return function(){var o=qr(this,e),s=(this.style.removeProperty(e),qr(this,e));return o===s?null:o===n&&s===i?r:r=t(n=o,i=s)}}function Ax(e){return function(){this.style.removeProperty(e)}}function VR(e,t,n){var i,r=n+"",o;return function(){var s=qr(this,e);return s===r?null:s===i?o:o=t(i=s,n)}}function FR(e,t,n){var i,r,o;return function(){var s=qr(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),qr(this,e))),s===l?null:s===i&&l===r?o:(r=l,o=t(i=s,a))}}function HR(e,t){var n,i,r,o="style."+t,s="end."+o,a;return function(){var l=An(this,e),u=l.on,d=l.value[o]==null?a||(a=Ax(t)):void 0;(u!==n||r!==d)&&(i=(n=u).copy()).on(s,r=d),l.on=i}}function GR(e,t,n){var i=(e+="")=="transform"?BO:Px;return t==null?this.styleTween(e,RR(e,i)).on("end.style."+e,Ax(e)):typeof t=="function"?this.styleTween(e,FR(e,i,Rp(this,"style."+e,t))).each(HR(this._id,e)):this.styleTween(e,VR(e,i,t),n).on("end.style."+e,null)}function BR(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function $R(e,t,n){var i,r;function o(){var s=t.apply(this,arguments);return s!==r&&(i=(r=s)&&BR(e,s,n)),i}return o._value=t,o}function WR(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,$R(e,t,n??""))}function jR(e){return function(){this.textContent=e}}function UR(e){return function(){var t=e(this);this.textContent=t??""}}function YR(e){return this.tween("text",typeof e=="function"?UR(Rp(this,"text",e)):jR(e==null?"":e+""))}function XR(e){return function(t){this.textContent=e.call(this,t)}}function ZR(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&XR(r)),t}return i._value=e,i}function qR(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ZR(e))}function QR(){for(var e=this._name,t=this._id,n=Ix(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s=i[o],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var d=pn(l,t);vu(l,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new jn(i,this._parents,e,n)}function KR(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--r===0&&o()}};n.each(function(){var u=An(this,i),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),r===0&&o()})}var JR=0;function jn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Ix(){return++JR}var Tn=Os.prototype;jn.prototype={constructor:jn,select:TR,selectAll:MR,selectChild:Tn.selectChild,selectChildren:Tn.selectChildren,filter:ER,merge:DR,selection:OR,transition:QR,call:Tn.call,nodes:Tn.nodes,node:Tn.node,size:Tn.size,empty:Tn.empty,each:Tn.each,on:AR,attr:cR,attrTween:mR,style:GR,styleTween:WR,text:YR,textTween:qR,remove:NR,tween:iR,delay:wR,duration:xR,ease:kR,easeVarying:CR,end:KR,[Symbol.iterator]:Tn[Symbol.iterator]};function e5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var t5={time:null,delay:0,duration:250,ease:e5};function n5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function i5(e){var t,n;e instanceof jn?(t=e._id,e=e._name):(t=Ix(),(n=t5).time=Lp(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s=i[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&vu(l,e,t,u,s,n||n5(l,t));return new jn(i,this._parents,e,t)}Os.prototype.interrupt=eR;Os.prototype.transition=i5;const _a=e=>()=>e;function r5(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Fn(e,t,n){this.k=e,this.x=t,this.y=n}Fn.prototype={constructor:Fn,scale:function(e){return e===1?this:new Fn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Fn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wu=new Fn(1,0,0);Nx.prototype=Fn.prototype;function Nx(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wu;return e.__zoom}function _c(e){e.stopImmediatePropagation()}function Co(e){e.preventDefault(),e.stopImmediatePropagation()}function o5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function s5(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rv(){return this.__zoom||wu}function a5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function l5(){return navigator.maxTouchPoints||"ontouchstart"in this}function u5(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function Tx(){var e=o5,t=s5,n=u5,i=a5,r=l5,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ba,u=fu("start","zoom","end"),d,c,h,p=500,f=150,v=0,b=10;function m(D){D.property("__zoom",rv).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",C).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(D,P,A,O){var N=D.selection?D.selection():D;N.property("__zoom",rv),D!==N?k(D,P,A,O):N.interrupt().each(function(){_(this,arguments).event(O).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},m.scaleBy=function(D,P,A,O){m.scaleTo(D,function(){var N=this.__zoom.k,M=typeof P=="function"?P.apply(this,arguments):P;return N*M},A,O)},m.scaleTo=function(D,P,A,O){m.transform(D,function(){var N=t.apply(this,arguments),M=this.__zoom,x=A==null?y(N):typeof A=="function"?A.apply(this,arguments):A,F=M.invert(x),H=typeof P=="function"?P.apply(this,arguments):P;return n(g(w(M,H),x,F),N,s)},A,O)},m.translateBy=function(D,P,A,O){m.transform(D,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,O)},m.translateTo=function(D,P,A,O,N){m.transform(D,function(){var M=t.apply(this,arguments),x=this.__zoom,F=O==null?y(M):typeof O=="function"?O.apply(this,arguments):O;return n(wu.translate(F[0],F[1]).scale(x.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof A=="function"?-A.apply(this,arguments):-A),M,s)},O,N)};function w(D,P){return P=Math.max(o[0],Math.min(o[1],P)),P===D.k?D:new Fn(P,D.x,D.y)}function g(D,P,A){var O=P[0]-A[0]*D.k,N=P[1]-A[1]*D.k;return O===D.x&&N===D.y?D:new Fn(D.k,O,N)}function y(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function k(D,P,A,O){D.on("start.zoom",function(){_(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(O).end()}).tween("zoom",function(){var N=this,M=arguments,x=_(N,M).event(O),F=t.apply(N,M),H=A==null?y(F):typeof A=="function"?A.apply(N,M):A,z=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),X=N.__zoom,q=typeof P=="function"?P.apply(N,M):P,U=l(X.invert(H).concat(z/X.k),q.invert(H).concat(z/q.k));return function(K){if(K===1)K=q;else{var Y=U(K),Q=z/Y[2];K=new Fn(Q,H[0]-Y[0]*Q,H[1]-Y[1]*Q)}x.zoom(null,K)}})}function _(D,P,A){return!A&&D.__zooming||new E(D,P)}function E(D,P){this.that=D,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,P),this.taps=0}E.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,P){return this.mouse&&D!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var P=At(this.that).datum();u.call(D,this.that,new r5(D,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),P)}};function S(D,...P){if(!e.apply(this,arguments))return;var A=_(this,P).event(D),O=this.__zoom,N=Math.max(o[0],Math.min(o[1],O.k*Math.pow(2,i.apply(this,arguments)))),M=en(D);if(A.wheel)(A.mouse[0][0]!==M[0]||A.mouse[0][1]!==M[1])&&(A.mouse[1]=O.invert(A.mouse[0]=M)),clearTimeout(A.wheel);else{if(O.k===N)return;A.mouse=[M,O.invert(M)],ja(this),A.start()}Co(D),A.wheel=setTimeout(x,f),A.zoom("mouse",n(g(w(O,N),A.mouse[0],A.mouse[1]),A.extent,s));function x(){A.wheel=null,A.end()}}function T(D,...P){if(h||!e.apply(this,arguments))return;var A=D.currentTarget,O=_(this,P,!0).event(D),N=At(D.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",z,!0),M=en(D,A),x=D.clientX,F=D.clientY;gx(D.view),_c(D),O.mouse=[M,this.__zoom.invert(M)],ja(this),O.start();function H(X){if(Co(X),!O.moved){var q=X.clientX-x,U=X.clientY-F;O.moved=q*q+U*U>v}O.event(X).zoom("mouse",n(g(O.that.__zoom,O.mouse[0]=en(X,A),O.mouse[1]),O.extent,s))}function z(X){N.on("mousemove.zoom mouseup.zoom",null),vx(X.view,O.moved),Co(X),O.event(X).end()}}function C(D,...P){if(e.apply(this,arguments)){var A=this.__zoom,O=en(D.changedTouches?D.changedTouches[0]:D,this),N=A.invert(O),M=A.k*(D.shiftKey?.5:2),x=n(g(w(A,M),O,N),t.apply(this,P),s);Co(D),a>0?At(this).transition().duration(a).call(k,x,O,D):At(this).call(m.transform,x,O,D)}}function I(D,...P){if(e.apply(this,arguments)){var A=D.touches,O=A.length,N=_(this,P,D.changedTouches.length===O).event(D),M,x,F,H;for(_c(D),x=0;x<O;++x)F=A[x],H=en(F,this),H=[H,this.__zoom.invert(H),F.identifier],N.touch0?!N.touch1&&N.touch0[2]!==H[2]&&(N.touch1=H,N.taps=0):(N.touch0=H,M=!0,N.taps=1+!!d);d&&(d=clearTimeout(d)),M&&(N.taps<2&&(c=H[0],d=setTimeout(function(){d=null},p)),ja(this),N.start())}}function L(D,...P){if(this.__zooming){var A=_(this,P).event(D),O=D.changedTouches,N=O.length,M,x,F,H;for(Co(D),M=0;M<N;++M)x=O[M],F=en(x,this),A.touch0&&A.touch0[2]===x.identifier?A.touch0[0]=F:A.touch1&&A.touch1[2]===x.identifier&&(A.touch1[0]=F);if(x=A.that.__zoom,A.touch1){var z=A.touch0[0],X=A.touch0[1],q=A.touch1[0],U=A.touch1[1],K=(K=q[0]-z[0])*K+(K=q[1]-z[1])*K,Y=(Y=U[0]-X[0])*Y+(Y=U[1]-X[1])*Y;x=w(x,Math.sqrt(K/Y)),F=[(z[0]+q[0])/2,(z[1]+q[1])/2],H=[(X[0]+U[0])/2,(X[1]+U[1])/2]}else if(A.touch0)F=A.touch0[0],H=A.touch0[1];else return;A.zoom("touch",n(g(x,F,H),A.extent,s))}}function V(D,...P){if(this.__zooming){var A=_(this,P).event(D),O=D.changedTouches,N=O.length,M,x;for(_c(D),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),M=0;M<N;++M)x=O[M],A.touch0&&A.touch0[2]===x.identifier?delete A.touch0:A.touch1&&A.touch1[2]===x.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(x=en(x,this),Math.hypot(c[0]-x[0],c[1]-x[1])<b)){var F=At(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(D){return arguments.length?(i=typeof D=="function"?D:_a(+D),m):i},m.filter=function(D){return arguments.length?(e=typeof D=="function"?D:_a(!!D),m):e},m.touchable=function(D){return arguments.length?(r=typeof D=="function"?D:_a(!!D),m):r},m.extent=function(D){return arguments.length?(t=typeof D=="function"?D:_a([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),m):t},m.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],m):[o[0],o[1]]},m.translateExtent=function(D){return arguments.length?(s[0][0]=+D[0][0],s[1][0]=+D[1][0],s[0][1]=+D[0][1],s[1][1]=+D[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(D){return arguments.length?(n=D,m):n},m.duration=function(D){return arguments.length?(a=+D,m):a},m.interpolate=function(D){return arguments.length?(l=D,m):l},m.on=function(){var D=u.on.apply(u,arguments);return D===u?m:D},m.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,m):Math.sqrt(v)},m.tapDistance=function(D){return arguments.length?(b=+D,m):b},m}const zn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ys=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mx=["Enter"," ","Escape"],Lx={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Kr;(function(e){e.Strict="strict",e.Loose="loose"})(Kr||(Kr={}));var qi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(qi||(qi={}));var xs;(function(e){e.Partial="partial",e.Full="full"})(xs||(xs={}));const Ox={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ai;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ai||(ai={}));var Tl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tl||(Tl={}));var ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ae||(ae={}));const ov={[ae.Left]:ae.Right,[ae.Right]:ae.Left,[ae.Top]:ae.Bottom,[ae.Bottom]:ae.Top};function Rx(e){return e===null?null:e?"valid":"invalid"}const Vx=e=>"id"in e&&"source"in e&&"target"in e,c5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Vp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vs=(e,t=[0,0])=>{const{width:n,height:i}=Xn(e),r=e.origin??t,o=n*r[0],s=i*r[1];return{x:e.position.x-o,y:e.position.y-s}},d5=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const o=typeof r=="string";let s=!t.nodeLookup&&!o?r:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(r):Vp(r)?r:t.nodeLookup.get(r.id));const a=s?Ml(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bu(i,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yu(n)},Fs=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=bu(n,Ml(r)),i=!0)}),i?yu(n):{x:0,y:0,width:0,height:0}},Fp=(e,t,[n,i,r]=[0,0,1],o=!1,s=!1)=>{const a={...Gs(t,[n,i,r]),width:t.width/r,height:t.height/r},l=[];for(const u of e.values()){const{measured:d,selectable:c=!0,hidden:h=!1}=u;if(s&&!c||h)continue;const p=d.width??u.width??u.initialWidth??null,f=d.height??u.height??u.initialHeight??null,v=_s(a,eo(u)),b=(p??0)*(f??0),m=o&&v>0;(!u.internals.handleBounds||m||v>=b||u.dragging)&&l.push(u)}return l},h5=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function p5(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function f5({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:o},s){if(e.size===0)return Promise.resolve(!0);const a=p5(e,s),l=Fs(a),u=Hp(l,t,n,(s==null?void 0:s.minZoom)??r,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await i.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Fx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:o}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??i;let c=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)o==null||o("005",zn.error005());else{const p=a.measured.width,f=a.measured.height;p&&f&&(c=[[l,u],[l+p,u+f]])}else a&&to(s.extent)&&(c=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);const h=to(c)?or(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(o==null||o("015",zn.error015())),{position:{x:h.x-l+(s.measured.width??0)*d[0],y:h.y-u+(s.measured.height??0)*d[1]},positionAbsolute:h}}async function m5({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const o=new Set(e.map(h=>h.id)),s=[];for(const h of n){if(h.deletable===!1)continue;const p=o.has(h.id),f=!p&&h.parentId&&s.find(v=>v.id===h.parentId);(p||f)&&s.push(h)}const a=new Set(t.map(h=>h.id)),l=i.filter(h=>h.deletable!==!1),d=h5(s,l);for(const h of l)a.has(h.id)&&!d.find(f=>f.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:s};const c=await r({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const Jr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),or=(e={x:0,y:0},t,n)=>({x:Jr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Jr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Hx(e,t,n){const{width:i,height:r}=Xn(n),{x:o,y:s}=n.internals.positionAbsolute;return or(e,[[o,s],[o+i,s+r]],t)}const sv=(e,t,n)=>e<t?Jr(Math.abs(e-t),1,t)/t:e>n?-Jr(Math.abs(e-n),1,t)/t:0,Gx=(e,t,n=15,i=40)=>{const r=sv(e.x,i,t.width-i)*n,o=sv(e.y,i,t.height-i)*n;return[r,o]},bu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),eh=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),yu=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),eo=(e,t=[0,0])=>{var r,o;const{x:n,y:i}=Vp(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Ml=(e,t=[0,0])=>{var r,o;const{x:n,y:i}=Vp(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},Bx=(e,t)=>yu(bu(eh(e),eh(t))),_s=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},av=e=>on(e.width)&&on(e.height)&&on(e.x)&&on(e.y),on=e=>!isNaN(e)&&isFinite(e),g5=(e,t)=>{},Hs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Gs=({x:e,y:t},[n,i,r],o=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-i)/r};return o?Hs(a,s):a},Ll=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function gr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function v5(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=gr(e,n),r=gr(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=gr(e.top??e.y??0,n),r=gr(e.bottom??e.y??0,n),o=gr(e.left??e.x??0,t),s=gr(e.right??e.x??0,t);return{top:i,right:s,bottom:r,left:o,x:o+s,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function w5(e,t,n,i,r,o){const{x:s,y:a}=Ll(e,[t,n,i]),{x:l,y:u}=Ll({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-l,c=o-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(c)}}const Hp=(e,t,n,i,r,o)=>{const s=v5(o,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),d=Jr(u,i,r),c=e.x+e.width/2,h=e.y+e.height/2,p=t/2-c*d,f=n/2-h*d,v=w5(e,p,f,d,t,n),b={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:p-b.left+b.right,y:f-b.top+b.bottom,zoom:d}},ks=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function to(e){return e!=null&&e!=="parent"}function Xn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Gp(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function $x(e,t={width:0,height:0},n,i,r){const o={...e},s=i.get(n);if(s){const a=s.origin||r;o.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function lv(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function b5(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function y5(e){return{...Lx,...e||{}}}function Uo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:o,y:s}=sn(e),a=Gs({x:o-((r==null?void 0:r.left)??0),y:s-((r==null?void 0:r.top)??0)},i),{x:l,y:u}=n?Hs(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const Bp=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wx=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},x5=["INPUT","SELECT","TEXTAREA"];function jx(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:x5.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ux=e=>"clientX"in e,sn=(e,t)=>{var o,s;const n=Ux(e),i=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,r=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},uv=(e,t,n,i,r)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/i,y:(a.top-n.top)/i,...Bp(s)}})};function Yx({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,u=t*.125+o*.375+a*.375+i*.125,d=Math.abs(l-e),c=Math.abs(u-t);return[l,u,d,c]}function ka(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function cv({pos:e,x1:t,y1:n,x2:i,y2:r,c:o}){switch(e){case ae.Left:return[t-ka(t-i,o),n];case ae.Right:return[t+ka(i-t,o),n];case ae.Top:return[t,n-ka(n-r,o)];case ae.Bottom:return[t,n+ka(r-n,o)]}}function Xx({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top,curvature:s=.25}){const[a,l]=cv({pos:n,x1:e,y1:t,x2:i,y2:r,c:s}),[u,d]=cv({pos:o,x1:i,y1:r,x2:e,y2:t,c:s}),[c,h,p,f]=Yx({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${i},${r}`,c,h,p,f]}function Zx({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,o=n<e?n+r:n-r,s=Math.abs(i-t)/2,a=i<t?i+s:i-s;return[o,a,r,s]}function _5({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:o="basic"}){if(o==="manual")return i;const s=r&&n?i+1e3:i,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function k5({sourceNode:e,targetNode:t,width:n,height:i,transform:r}){const o=bu(Ml(e),Ml(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return _s(s,yu(o))>0}const S5=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,C5=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),E5=(e,t,n={})=>{if(!e.source||!e.target)return t;const i=n.getEdgeId||S5;let r;return Vx(e)?r={...e}:r={...e,id:i(e)},C5(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function qx({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,o,s,a]=Zx({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,o,s,a]}const dv={[ae.Left]:{x:-1,y:0},[ae.Right]:{x:1,y:0},[ae.Top]:{x:0,y:-1},[ae.Bottom]:{x:0,y:1}},D5=({source:e,sourcePosition:t=ae.Bottom,target:n})=>t===ae.Left||t===ae.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},hv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function z5({source:e,sourcePosition:t=ae.Bottom,target:n,targetPosition:i=ae.Top,center:r,offset:o,stepPosition:s}){const a=dv[t],l=dv[i],u={x:e.x+a.x*o,y:e.y+a.y*o},d={x:n.x+l.x*o,y:n.y+l.y*o},c=D5({source:u,sourcePosition:t,target:d}),h=c.x!==0?"x":"y",p=c[h];let f=[],v,b;const m={x:0,y:0},w={x:0,y:0},[,,g,y]=Zx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[h]*l[h]===-1){h==="x"?(v=r.x??u.x+(d.x-u.x)*s,b=r.y??(u.y+d.y)/2):(v=r.x??(u.x+d.x)/2,b=r.y??u.y+(d.y-u.y)*s);const S=[{x:v,y:u.y},{x:v,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];a[h]===p?f=h==="x"?S:T:f=h==="x"?T:S}else{const S=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?f=a.x===p?T:S:f=a.y===p?S:T,t===i){const D=Math.abs(e[h]-n[h]);if(D<=o){const P=Math.min(o-1,o-D);a[h]===p?m[h]=(u[h]>e[h]?-1:1)*P:w[h]=(d[h]>n[h]?-1:1)*P}}if(t!==i){const D=h==="x"?"y":"x",P=a[h]===l[D],A=u[D]>d[D],O=u[D]<d[D];(a[h]===1&&(!P&&A||P&&O)||a[h]!==1&&(!P&&O||P&&A))&&(f=h==="x"?S:T)}const C={x:u.x+m.x,y:u.y+m.y},I={x:d.x+w.x,y:d.y+w.y},L=Math.max(Math.abs(C.x-f[0].x),Math.abs(I.x-f[0].x)),V=Math.max(Math.abs(C.y-f[0].y),Math.abs(I.y-f[0].y));L>=V?(v=(C.x+I.x)/2,b=f[0].y):(v=f[0].x,b=(C.y+I.y)/2)}const k={x:u.x+m.x,y:u.y+m.y},_={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==f[0].x||k.y!==f[0].y?[k]:[],...f,..._.x!==f[f.length-1].x||_.y!==f[f.length-1].y?[_]:[],n],v,b,g,y]}function P5(e,t,n,i){const r=Math.min(hv(e,t)/2,hv(t,n)/2,i),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${o+r*u},${s}Q ${o},${s} ${o},${s+r*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+r*l}Q ${o},${s} ${o+r*a},${s}`}function th({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:d=.5}){const[c,h,p,f,v]=z5({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:r},targetPosition:o,center:{x:a,y:l},offset:u,stepPosition:d});let b=`M${c[0].x} ${c[0].y}`;for(let m=1;m<c.length-1;m++)b+=P5(c[m-1],c[m],c[m+1],s);return b+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[b,h,p,f,v]}function pv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function A5(e){var c;const{sourceNode:t,targetNode:n}=e;if(!pv(t)||!pv(n))return null;const i=t.internals.handleBounds||fv(t.handles),r=n.internals.handleBounds||fv(n.handles),o=mv((i==null?void 0:i.source)??[],e.sourceHandle),s=mv(e.connectionMode===Kr.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!o||!s)return(c=e.onError)==null||c.call(e,"008",zn.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||ae.Bottom,l=(s==null?void 0:s.position)||ae.Top,u=sr(t,o,a),d=sr(n,s,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function fv(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function sr(e,t,n=ae.Left,i=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Xn(e);if(i)return{x:r+s/2,y:o+a/2};switch((t==null?void 0:t.position)??n){case ae.Top:return{x:r+s/2,y:o};case ae.Right:return{x:r+s,y:o+a/2};case ae.Bottom:return{x:r+s/2,y:o+a};case ae.Left:return{x:r,y:o+a/2}}}function mv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function nh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function I5(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const o=new Set;return e.reduce((s,a)=>([a.markerStart||i,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const u=nh(l,t);o.has(u)||(s.push({id:u,color:l.color||n,...l}),o.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Qx=1e3,N5=10,$p={nodeOrigin:[0,0],nodeExtent:ys,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},T5={...$p,checkEquality:!0};function Wp(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function M5(e,t,n){const i=Wp($p,n);for(const r of e.values())if(r.parentId)Up(r,e,t,i);else{const o=Vs(r,i.nodeOrigin),s=to(r.extent)?r.extent:i.nodeExtent,a=or(o,s,Xn(r));r.internals.positionAbsolute=a}}function L5(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const o={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(o):r.type==="target"&&i.push(o)}return{source:n,target:i}}function jp(e){return e==="manual"}function ih(e,t,n,i={}){var d,c;const r=Wp(T5,i),o={i:0},s=new Map(t),a=r!=null&&r.elevateNodesOnSelect&&!jp(r.zIndexMode)?Qx:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=s.get(h.id);if(r.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const f=Vs(h,r.nodeOrigin),v=to(h.extent)?h.extent:r.nodeExtent,b=or(f,v,Xn(h));p={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(c=h.measured)==null?void 0:c.height},internals:{positionAbsolute:b,handleBounds:L5(h,p),z:Kx(h,a,r.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),h.parentId&&Up(p,t,n,i,o),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function O5(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Up(e,t,n,i,r){const{elevateNodesOnSelect:o,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Wp($p,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}O5(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*N5),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const c=o&&!jp(l)?Qx:0,{x:h,y:p,z:f}=R5(e,d,s,a,c,l),{positionAbsolute:v}=e.internals,b=h!==v.x||p!==v.y;(b||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:p}:v,z:f}})}function Kx(e,t,n){const i=on(e.zIndex)?e.zIndex:0;return jp(n)?i:i+(e.selected?t:0)}function R5(e,t,n,i,r,o){const{x:s,y:a}=t.internals.positionAbsolute,l=Xn(e),u=Vs(e,n),d=to(e.extent)?or(u,e.extent,l):u;let c=or({x:s+d.x,y:a+d.y},i,l);e.extent==="parent"&&(c=Hx(c,l,t));const h=Kx(e,r,o),p=t.internals.z??0;return{x:c.x,y:c.y,z:p>=h?p+1:h}}function Yp(e,t,n,i=[0,0]){var s;const r=[],o=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((s=o.get(a.parentId))==null?void 0:s.expandedRect)??eo(l),d=Bx(u,a.rect);o.set(a.parentId,{expandedRect:d,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},u)=>{var g;const d=l.internals.positionAbsolute,c=Xn(l),h=l.origin??i,p=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,f=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,v=Math.max(c.width,Math.round(a.width)),b=Math.max(c.height,Math.round(a.height)),m=(v-c.width)*h[0],w=(b-c.height)*h[1];(p>0||f>0||m||w)&&(r.push({id:u,type:"position",position:{x:l.position.x-p+m,y:l.position.y-f+w}}),(g=n.get(u))==null||g.forEach(y=>{e.some(k=>k.id===y.id)||r.push({id:y.id,type:"position",position:{x:y.position.x+p,y:y.position.y+f}})})),(c.width<a.width||c.height<a.height||p||f)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?h[0]*p-m:0),height:b+(f?h[1]*f-w:0)}})}),r}function V5(e,t,n,i,r,o,s){const a=i==null?void 0:i.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],d=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(d.transform),h=[];for(const p of e.values()){const f=t.get(p.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),l=!0;continue}const v=Bp(p.nodeElement),b=f.measured.width!==v.width||f.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!f.internals.handleBounds||p.force))){const w=p.nodeElement.getBoundingClientRect(),g=to(f.extent)?f.extent:o;let{positionAbsolute:y}=f.internals;f.parentId&&f.extent==="parent"?y=Hx(y,v,t.get(f.parentId)):g&&(y=or(y,g,v));const k={...f,measured:v,internals:{...f.internals,positionAbsolute:y,handleBounds:{source:uv("source",p.nodeElement,w,c,f.id),target:uv("target",p.nodeElement,w,c,f.id)}}};t.set(f.id,k),f.parentId&&Up(k,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,b&&(u.push({id:f.id,type:"dimensions",dimensions:v}),f.expandParent&&f.parentId&&h.push({id:f.id,parentId:f.parentId,rect:eo(k,r)}))}}if(h.length>0){const p=Yp(h,t,n,r);u.push(...p)}return{changes:u,updatedInternals:l}}async function F5({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,o]],i),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function gv(e,t,n,i,r,o){let s=r;const a=i.get(s)||new Map;i.set(s,a.set(n,t)),s=`${r}-${e}`;const l=i.get(s)||new Map;if(i.set(s,l.set(n,t)),o){s=`${r}-${e}-${o}`;const u=i.get(s)||new Map;i.set(s,u.set(n,t))}}function Jx(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:o,sourceHandle:s=null,targetHandle:a=null}=i,l={edgeId:i.id,source:r,target:o,sourceHandle:s,targetHandle:a},u=`${r}-${s}--${o}-${a}`,d=`${o}-${a}--${r}-${s}`;gv("source",l,d,e,r,s),gv("target",l,u,e,o,a),t.set(i.id,i)}}function e_(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:e_(n,t):!1}function vv(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function H5(e,t,n,i){const r=new Map;for(const[o,s]of e)if((s.selected||s.id===i)&&(!s.parentId||!e_(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(o);a&&r.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function kc({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var s,a,l;const r=[];for(const[u,d]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&r.push({...c,position:d.position,dragging:i})}if(!e)return[r[0],r];const o=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((l=t.get(e))==null?void 0:l.position)||o.position,dragging:i}:r[0],r]}function G5({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const o={x:n-r.distance.x,y:i-r.distance.y},s=Hs(o,t);return{x:s.x-o.x,y:s.y-o.y}}function B5({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let o={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},d=null,c=!1,h=null,p=!1,f=!1,v=null;function b({noDragClassName:w,handleSelector:g,domNode:y,isSelectable:k,nodeId:_,nodeClickDistance:E=0}){h=At(y);function S({x:L,y:V}){const{nodeLookup:D,nodeExtent:P,snapGrid:A,snapToGrid:O,nodeOrigin:N,onNodeDrag:M,onSelectionDrag:x,onError:F,updateNodePositions:H}=t();o={x:L,y:V};let z=!1;const X=a.size>1,q=X&&P?eh(Fs(a)):null,U=X&&O?G5({dragItems:a,snapGrid:A,x:L,y:V}):null;for(const[K,Y]of a){if(!D.has(K))continue;let Q={x:L-Y.distance.x,y:V-Y.distance.y};O&&(Q=U?{x:Math.round(Q.x+U.x),y:Math.round(Q.y+U.y)}:Hs(Q,A));let de=null;if(X&&P&&!Y.extent&&q){const{positionAbsolute:oe}=Y.internals,ge=oe.x-q.x+P[0][0],Ee=oe.x+Y.measured.width-q.x2+P[1][0],ye=oe.y-q.y+P[0][1],Xe=oe.y+Y.measured.height-q.y2+P[1][1];de=[[ge,ye],[Ee,Xe]]}const{position:le,positionAbsolute:se}=Fx({nodeId:K,nextPosition:Q,nodeLookup:D,nodeExtent:de||P,nodeOrigin:N,onError:F});z=z||Y.position.x!==le.x||Y.position.y!==le.y,Y.position=le,Y.internals.positionAbsolute=se}if(f=f||z,!!z&&(H(a,!0),v&&(i||M||!_&&x))){const[K,Y]=kc({nodeId:_,dragItems:a,nodeLookup:D});i==null||i(v,a,K,Y),M==null||M(v,K,Y),_||x==null||x(v,Y)}}async function T(){if(!d)return;const{transform:L,panBy:V,autoPanSpeed:D,autoPanOnNodeDrag:P}=t();if(!P){l=!1,cancelAnimationFrame(s);return}const[A,O]=Gx(u,d,D);(A!==0||O!==0)&&(o.x=(o.x??0)-A/L[2],o.y=(o.y??0)-O/L[2],await V({x:A,y:O})&&S(o)),s=requestAnimationFrame(T)}function C(L){var X;const{nodeLookup:V,multiSelectionActive:D,nodesDraggable:P,transform:A,snapGrid:O,snapToGrid:N,selectNodesOnDrag:M,onNodeDragStart:x,onSelectionDragStart:F,unselectNodesAndEdges:H}=t();c=!0,(!M||!k)&&!D&&_&&((X=V.get(_))!=null&&X.selected||H()),k&&M&&_&&(e==null||e(_));const z=Uo(L.sourceEvent,{transform:A,snapGrid:O,snapToGrid:N,containerBounds:d});if(o=z,a=H5(V,P,z,_),a.size>0&&(n||x||!_&&F)){const[q,U]=kc({nodeId:_,dragItems:a,nodeLookup:V});n==null||n(L.sourceEvent,a,q,U),x==null||x(L.sourceEvent,q,U),_||F==null||F(L.sourceEvent,U)}}const I=wx().clickDistance(E).on("start",L=>{const{domNode:V,nodeDragThreshold:D,transform:P,snapGrid:A,snapToGrid:O}=t();d=(V==null?void 0:V.getBoundingClientRect())||null,p=!1,f=!1,v=L.sourceEvent,D===0&&C(L),o=Uo(L.sourceEvent,{transform:P,snapGrid:A,snapToGrid:O,containerBounds:d}),u=sn(L.sourceEvent,d)}).on("drag",L=>{const{autoPanOnNodeDrag:V,transform:D,snapGrid:P,snapToGrid:A,nodeDragThreshold:O,nodeLookup:N}=t(),M=Uo(L.sourceEvent,{transform:D,snapGrid:P,snapToGrid:A,containerBounds:d});if(v=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||_&&!N.has(_))&&(p=!0),!p){if(!l&&V&&c&&(l=!0,T()),!c){const x=sn(L.sourceEvent,d),F=x.x-u.x,H=x.y-u.y;Math.sqrt(F*F+H*H)>O&&C(L)}(o.x!==M.xSnapped||o.y!==M.ySnapped)&&a&&c&&(u=sn(L.sourceEvent,d),S(M))}}).on("end",L=>{if(!(!c||p)&&(l=!1,c=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:D,onNodeDragStop:P,onSelectionDragStop:A}=t();if(f&&(D(a,!1),f=!1),r||P||!_&&A){const[O,N]=kc({nodeId:_,dragItems:a,nodeLookup:V,dragging:!1});r==null||r(L.sourceEvent,a,O,N),P==null||P(L.sourceEvent,O,N),_||A==null||A(L.sourceEvent,N)}}}).filter(L=>{const V=L.target;return!L.button&&(!w||!vv(V,`.${w}`,y))&&(!g||vv(V,g,y))});h.call(I)}function m(){h==null||h.on(".drag",null)}return{update:b,destroy:m}}function $5(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())_s(r,eo(o))>0&&i.push(o);return i}const W5=250;function j5(e,t,n,i){var a,l;let r=[],o=1/0;const s=$5(e,n,t+W5);for(const u of s){const d=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of d){if(i.nodeId===c.nodeId&&i.type===c.type&&i.id===c.id)continue;const{x:h,y:p}=sr(u,c,c.position,!0),f=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));f>t||(f<o?(r=[{...c,x:h,y:p}],o=f):f===o&&r.push({...c,x:h,y:p}))}}if(!r.length)return null;if(r.length>1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function t_(e,t,n,i,r,o=!1){var u,d,c;const s=i.get(e);if(!s)return null;const a=r==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(h=>h.id===n):a==null?void 0:a[0])??null;return l&&o?{...l,...sr(s,l,l.position,!0)}:l}function n_(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function U5(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const i_=()=>!0;function Y5(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:c,panBy:h,cancelConnection:p,onConnectStart:f,onConnect:v,onConnectEnd:b,isValidConnection:m=i_,onReconnectEnd:w,updateConnection:g,getTransform:y,getFromHandle:k,autoPanSpeed:_,dragThreshold:E=1,handleDomNode:S}){const T=Wx(e.target);let C=0,I;const{x:L,y:V}=sn(e),D=n_(o,S),P=a==null?void 0:a.getBoundingClientRect();let A=!1;if(!P||!D)return;const O=t_(r,D,i,l,t);if(!O)return;let N=sn(e,P),M=!1,x=null,F=!1,H=null;function z(){if(!d||!P)return;const[le,se]=Gx(N,P,_);h({x:le,y:se}),C=requestAnimationFrame(z)}const X={...O,nodeId:r,type:D,position:O.position},q=l.get(r);let K={inProgress:!0,isValid:null,from:sr(q,X,ae.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:q,to:N,toHandle:null,toPosition:ov[X.position],toNode:null,pointer:N};function Y(){A=!0,g(K),f==null||f(e,{nodeId:r,handleId:i,handleType:D})}E===0&&Y();function Q(le){if(!A){const{x:Xe,y:fn}=sn(le),Vt=Xe-L,mn=fn-V;if(!(Vt*Vt+mn*mn>E*E))return;Y()}if(!k()||!X){de(le);return}const se=y();N=sn(le,P),I=j5(Gs(N,se,!1,[1,1]),n,l,X),M||(z(),M=!0);const oe=r_(le,{handle:I,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:s?"target":"source",isValidConnection:m,doc:T,lib:u,flowId:c,nodeLookup:l});H=oe.handleDomNode,x=oe.connection,F=U5(!!I,oe.isValid);const ge=l.get(r),Ee=ge?sr(ge,X,ae.Left,!0):K.from,ye={...K,from:Ee,isValid:F,to:oe.toHandle&&F?Ll({x:oe.toHandle.x,y:oe.toHandle.y},se):N,toHandle:oe.toHandle,toPosition:F&&oe.toHandle?oe.toHandle.position:ov[X.position],toNode:oe.toHandle?l.get(oe.toHandle.nodeId):null,pointer:N};g(ye),K=ye}function de(le){if(!("touches"in le&&le.touches.length>0)){if(A){(I||H)&&x&&F&&(v==null||v(x));const{inProgress:se,...oe}=K,ge={...oe,toPosition:K.toHandle?K.toPosition:null};b==null||b(le,ge),o&&(w==null||w(le,ge))}p(),cancelAnimationFrame(C),M=!1,F=!1,x=null,H=null,T.removeEventListener("mousemove",Q),T.removeEventListener("mouseup",de),T.removeEventListener("touchmove",Q),T.removeEventListener("touchend",de)}}T.addEventListener("mousemove",Q),T.addEventListener("mouseup",de),T.addEventListener("touchmove",Q),T.addEventListener("touchend",de)}function r_(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:o,doc:s,lib:a,flowId:l,isValidConnection:u=i_,nodeLookup:d}){const c=o==="target",h=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:f}=sn(e),v=s.elementFromPoint(p,f),b=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:h,m={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const w=n_(void 0,b),g=b.getAttribute("data-nodeid"),y=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!g||!w)return m;const E={source:c?g:i,sourceHandle:c?y:r,target:c?i:g,targetHandle:c?r:y};m.connection=E;const T=k&&_&&(n===Kr.Strict?c&&w==="source"||!c&&w==="target":g!==i||y!==r);m.isValid=T&&u(E),m.toHandle=t_(g,w,y,d,n,!0)}return m}const rh={onPointerDown:Y5,isValid:r_};function X5({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=At(e);function o({translateExtent:a,width:l,height:u,zoomStep:d=1,pannable:c=!0,zoomable:h=!0,inversePan:p=!1}){const f=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const y=n(),k=g.sourceEvent.ctrlKey&&ks()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,E=y[2]*Math.pow(2,_*k);t.scaleTo(E)};let v=[0,0];const b=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const y=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const k=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[k[0]-v[0],k[1]-v[1]];v=k;const E=i()*Math.max(y[2],Math.log(y[2]))*(p?-1:1),S={x:y[0]-_[0]*E,y:y[1]-_[1]*E},T=[[0,0],[l,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:y[2]},T,a)},w=Tx().on("start",b).on("zoom",c?m:null).on("zoom.wheel",h?f:null);r.call(w,{})}function s(){r.on("zoom",null)}return{update:o,destroy:s,pointer:en}}const xu=e=>({x:e.x,y:e.y,zoom:e.k}),Sc=({x:e,y:t,zoom:n})=>wu.translate(e,t).scale(n),Ir=(e,t)=>e.target.closest(`.${t}`),o_=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Z5=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Cc=(e,t=0,n=Z5,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},s_=e=>{const t=e.ctrlKey&&ks()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function q5({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Ir(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const b=en(d),m=s_(d),w=c*Math.pow(2,m);i.scaleTo(n,w,b,d);return}const h=d.deltaMode===1?20:1;let p=r===qi.Vertical?0:d.deltaX*h,f=r===qi.Horizontal?0:d.deltaY*h;!ks()&&d.shiftKey&&r!==qi.Vertical&&(p=d.deltaY*h,f=0),i.translateBy(n,-(p/c)*o,-(f/c)*o,{internal:!0});const v=xu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,v))}}function Q5({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const o=i.type==="wheel",s=!t&&o&&!i.ctrlKey,a=Ir(i,e);if(i.ctrlKey&&o&&a&&i.preventDefault(),s||a)return null;i.preventDefault(),n.call(this,i,r)}}function K5({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var o,s,a;if((o=i.sourceEvent)!=null&&o.internal)return;const r=xu(i.transform);e.mouseButton=((s=i.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((a=i.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function J5({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return o=>{var s,a;e.usedRightMouseButton=!!(n&&o_(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||i([o.transform.x,o.transform.y,o.transform.k]),r&&!((a=o.sourceEvent)!=null&&a.internal)&&(r==null||r(o.sourceEvent,xu(o.transform)))}}function e3({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:o}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&o_(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const l=xu(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(s.sourceEvent,l)},n?150:0)}}}function t3({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:d}){return c=>{var b;const h=e||t,p=n&&c.ctrlKey,f=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Ir(c,`${u}-flow__node`)||Ir(c,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!o&&!n||s||d&&!f||Ir(c,a)&&f||Ir(c,l)&&(!f||r&&f&&!e)||!n&&c.ctrlKey&&f)return!1;if(!n&&c.type==="touchstart"&&((b=c.touches)==null?void 0:b.length)>1)return c.preventDefault(),!1;if(!h&&!r&&!p&&f||!i&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(i)&&!i.includes(c.button)&&c.type==="mousedown")return!1;const v=Array.isArray(i)&&i.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||f)&&v}}function n3({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=Tx().scaleExtent([t,n]).translateExtent(i),h=At(e).call(c);w({x:r.x,y:r.y,zoom:Jr(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const p=h.on("wheel.zoom"),f=h.on("dblclick.zoom");c.wheelDelta(s_);function v(I,L){return h?new Promise(V=>{c==null||c.interpolate((L==null?void 0:L.interpolate)==="linear"?jo:Ba).transform(Cc(h,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function b({noWheelClassName:I,noPanClassName:L,onPaneContextMenu:V,userSelectionActive:D,panOnScroll:P,panOnDrag:A,panOnScrollMode:O,panOnScrollSpeed:N,preventScrolling:M,zoomOnPinch:x,zoomOnScroll:F,zoomOnDoubleClick:H,zoomActivationKeyPressed:z,lib:X,onTransformChange:q,connectionInProgress:U,paneClickDistance:K,selectionOnDrag:Y}){D&&!u.isZoomingOrPanning&&m();const Q=P&&!z&&!D;c.clickDistance(Y?1/0:!on(K)||K<0?0:K);const de=Q?q5({zoomPanValues:u,noWheelClassName:I,d3Selection:h,d3Zoom:c,panOnScrollMode:O,panOnScrollSpeed:N,zoomOnPinch:x,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:a}):Q5({noWheelClassName:I,preventScrolling:M,d3ZoomHandler:p});if(h.on("wheel.zoom",de,{passive:!1}),!D){const se=K5({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});c.on("start",se);const oe=J5({zoomPanValues:u,panOnDrag:A,onPaneContextMenu:!!V,onPanZoom:o,onTransformChange:q});c.on("zoom",oe);const ge=e3({zoomPanValues:u,panOnDrag:A,panOnScroll:P,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:l});c.on("end",ge)}const le=t3({zoomActivationKeyPressed:z,panOnDrag:A,zoomOnScroll:F,panOnScroll:P,zoomOnDoubleClick:H,zoomOnPinch:x,userSelectionActive:D,noPanClassName:L,noWheelClassName:I,lib:X,connectionInProgress:U});c.filter(le),H?h.on("dblclick.zoom",f):h.on("dblclick.zoom",null)}function m(){c.on("zoom",null)}async function w(I,L,V){const D=Sc(I),P=c==null?void 0:c.constrain()(D,L,V);return P&&await v(P),new Promise(A=>A(P))}async function g(I,L){const V=Sc(I);return await v(V,L),new Promise(D=>D(V))}function y(I){if(h){const L=Sc(I),V=h.property("__zoom");(V.k!==I.zoom||V.x!==I.x||V.y!==I.y)&&(c==null||c.transform(h,L,null,{sync:!0}))}}function k(){const I=h?Nx(h.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function _(I,L){return h?new Promise(V=>{c==null||c.interpolate((L==null?void 0:L.interpolate)==="linear"?jo:Ba).scaleTo(Cc(h,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function E(I,L){return h?new Promise(V=>{c==null||c.interpolate((L==null?void 0:L.interpolate)==="linear"?jo:Ba).scaleBy(Cc(h,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>V(!0)),I)}):Promise.resolve(!1)}function S(I){c==null||c.scaleExtent(I)}function T(I){c==null||c.translateExtent(I)}function C(I){const L=!on(I)||I<0?0:I;c==null||c.clickDistance(L)}return{update:b,destroy:m,setViewport:g,setViewportConstrained:w,getViewport:k,scaleTo:_,scaleBy:E,setScaleExtent:S,setTranslateExtent:T,syncViewport:y,setClickDistance:C}}var no;(function(e){e.Line="line",e.Handle="handle"})(no||(no={}));function i3({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:o}){const s=e-t,a=n-i,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function wv(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function ti(e,t){return Math.max(0,t-e)}function ni(e,t){return Math.max(0,e-t)}function Sa(e,t,n){return Math.max(0,t-e,e-n)}function bv(e,t){return e?!t:t}function r3(e,t,n,i,r,o,s,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:c}=t,h=d&&c,{xSnapped:p,ySnapped:f}=n,{minWidth:v,maxWidth:b,minHeight:m,maxHeight:w}=i,{x:g,y,width:k,height:_,aspectRatio:E}=e;let S=Math.floor(d?p-e.pointerX:0),T=Math.floor(c?f-e.pointerY:0);const C=k+(l?-S:S),I=_+(u?-T:T),L=-o[0]*k,V=-o[1]*_;let D=Sa(C,v,b),P=Sa(I,m,w);if(s){let N=0,M=0;l&&S<0?N=ti(g+S+L,s[0][0]):!l&&S>0&&(N=ni(g+C+L,s[1][0])),u&&T<0?M=ti(y+T+V,s[0][1]):!u&&T>0&&(M=ni(y+I+V,s[1][1])),D=Math.max(D,N),P=Math.max(P,M)}if(a){let N=0,M=0;l&&S>0?N=ni(g+S,a[0][0]):!l&&S<0&&(N=ti(g+C,a[1][0])),u&&T>0?M=ni(y+T,a[0][1]):!u&&T<0&&(M=ti(y+I,a[1][1])),D=Math.max(D,N),P=Math.max(P,M)}if(r){if(d){const N=Sa(C/E,m,w)*E;if(D=Math.max(D,N),s){let M=0;!l&&!u||l&&!u&&h?M=ni(y+V+C/E,s[1][1])*E:M=ti(y+V+(l?S:-S)/E,s[0][1])*E,D=Math.max(D,M)}if(a){let M=0;!l&&!u||l&&!u&&h?M=ti(y+C/E,a[1][1])*E:M=ni(y+(l?S:-S)/E,a[0][1])*E,D=Math.max(D,M)}}if(c){const N=Sa(I*E,v,b)/E;if(P=Math.max(P,N),s){let M=0;!l&&!u||u&&!l&&h?M=ni(g+I*E+L,s[1][0])/E:M=ti(g+(u?T:-T)*E+L,s[0][0])/E,P=Math.max(P,M)}if(a){let M=0;!l&&!u||u&&!l&&h?M=ti(g+I*E,a[1][0])/E:M=ni(g+(u?T:-T)*E,a[0][0])/E,P=Math.max(P,M)}}}T=T+(T<0?P:-P),S=S+(S<0?D:-D),r&&(h?C>I*E?T=(bv(l,u)?-S:S)/E:S=(bv(l,u)?-T:T)*E:d?(T=S/E,u=l):(S=T*E,l=u));const A=l?g+S:g,O=u?y+T:y;return{width:k+(l?-S:S),height:_+(u?-T:T),x:o[0]*S*(l?-1:1)+A,y:o[1]*T*(u?-1:1)+O}}const a_={width:0,height:0,x:0,y:0},o3={...a_,pointerX:0,pointerY:0,aspectRatio:1};function s3(e){return[[0,0],[e.measured.width,e.measured.height]]}function a3(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,a=n[0]*o,l=n[1]*s;return[[i-a,r-l],[i+o-a,r+s-l]]}function l3({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const o=At(e);let s={controlDirection:wv("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:d,keepAspectRatio:c,resizeDirection:h,onResizeStart:p,onResize:f,onResizeEnd:v,shouldResize:b}){let m={...a_},w={...o3};s={boundaries:d,resizeDirection:h,keepAspectRatio:c,controlDirection:wv(u)};let g,y=null,k=[],_,E,S,T=!1;const C=wx().on("start",I=>{const{nodeLookup:L,transform:V,snapGrid:D,snapToGrid:P,nodeOrigin:A,paneDomNode:O}=n();if(g=L.get(t),!g)return;y=(O==null?void 0:O.getBoundingClientRect())??null;const{xSnapped:N,ySnapped:M}=Uo(I.sourceEvent,{transform:V,snapGrid:D,snapToGrid:P,containerBounds:y});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},w={...m,pointerX:N,pointerY:M,aspectRatio:m.width/m.height},_=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=L.get(g.parentId),E=_&&g.extent==="parent"?s3(_):void 0),k=[],S=void 0;for(const[x,F]of L)if(F.parentId===t&&(k.push({id:x,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const H=a3(F,g,F.origin??A);S?S=[[Math.min(H[0][0],S[0][0]),Math.min(H[0][1],S[0][1])],[Math.max(H[1][0],S[1][0]),Math.max(H[1][1],S[1][1])]]:S=H}p==null||p(I,{...m})}).on("drag",I=>{const{transform:L,snapGrid:V,snapToGrid:D,nodeOrigin:P}=n(),A=Uo(I.sourceEvent,{transform:L,snapGrid:V,snapToGrid:D,containerBounds:y}),O=[];if(!g)return;const{x:N,y:M,width:x,height:F}=m,H={},z=g.origin??P,{width:X,height:q,x:U,y:K}=r3(w,s.controlDirection,A,s.boundaries,s.keepAspectRatio,z,E,S),Y=X!==x,Q=q!==F,de=U!==N&&Y,le=K!==M&&Q;if(!de&&!le&&!Y&&!Q)return;if((de||le||z[0]===1||z[1]===1)&&(H.x=de?U:m.x,H.y=le?K:m.y,m.x=H.x,m.y=H.y,k.length>0)){const Ee=U-N,ye=K-M;for(const Xe of k)Xe.position={x:Xe.position.x-Ee+z[0]*(X-x),y:Xe.position.y-ye+z[1]*(q-F)},O.push(Xe)}if((Y||Q)&&(H.width=Y&&(!s.resizeDirection||s.resizeDirection==="horizontal")?X:m.width,H.height=Q&&(!s.resizeDirection||s.resizeDirection==="vertical")?q:m.height,m.width=H.width,m.height=H.height),_&&g.expandParent){const Ee=z[0]*(H.width??0);H.x&&H.x<Ee&&(m.x=Ee,w.x=w.x-(H.x-Ee));const ye=z[1]*(H.height??0);H.y&&H.y<ye&&(m.y=ye,w.y=w.y-(H.y-ye))}const se=i3({width:m.width,prevWidth:x,height:m.height,prevHeight:F,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),oe={...m,direction:se};(b==null?void 0:b(I,oe))!==!1&&(T=!0,f==null||f(I,oe),i(H,O))}).on("end",I=>{T&&(v==null||v(I,{...m}),r==null||r({...m}),T=!1)});o.call(C)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var l_={exports:{}},u_={},c_={exports:{}},d_={};/**
|
|
2724
2724
|
* @license React
|
|
2725
2725
|
* use-sync-external-store-shim.production.js
|
|
2726
2726
|
*
|
|
@@ -2736,10 +2736,10 @@ Error generating stack: `+o.message+`
|
|
|
2736
2736
|
*
|
|
2737
2737
|
* This source code is licensed under the MIT license found in the
|
|
2738
2738
|
* LICENSE file in the root directory of this source tree.
|
|
2739
|
-
*/var _u=R,b3=w3;function y3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var x3=typeof Object.is=="function"?Object.is:y3,_3=b3.useSyncExternalStore,k3=_u.useRef,S3=_u.useEffect,C3=_u.useMemo,E3=_u.useDebugValue;u_.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var o=k3(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=C3(function(){function l(p){if(!u){if(u=!0,d=p,p=i(p),r!==void 0&&s.hasValue){var f=s.value;if(r(f,p))return c=f}return c=p}if(f=c,x3(d,p))return f;var v=i(p);return r!==void 0&&r(f,v)?(d=p,f):(d=p,c=v)}var u=!1,d,c,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,i,r]);var a=_3(e,o[0],o[1]);return S3(function(){s.hasValue=!0,s.value=a},[a]),E3(a),a};l_.exports=u_;var D3=l_.exports;const z3=Cs(D3),P3={},
|
|
2739
|
+
*/var _u=R,b3=w3;function y3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var x3=typeof Object.is=="function"?Object.is:y3,_3=b3.useSyncExternalStore,k3=_u.useRef,S3=_u.useEffect,C3=_u.useMemo,E3=_u.useDebugValue;u_.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var o=k3(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=C3(function(){function l(p){if(!u){if(u=!0,d=p,p=i(p),r!==void 0&&s.hasValue){var f=s.value;if(r(f,p))return c=f}return c=p}if(f=c,x3(d,p))return f;var v=i(p);return r!==void 0&&r(f,v)?(d=p,f):(d=p,c=v)}var u=!1,d,c,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,i,r]);var a=_3(e,o[0],o[1]);return S3(function(){s.hasValue=!0,s.value=a},[a]),E3(a),a};l_.exports=u_;var D3=l_.exports;const z3=Cs(D3),P3={},yv=e=>{let t;const n=new Set,i=(d,c)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=c??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(f=>f(t,p))}},r=()=>t,l={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(P3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,l);return l},A3=e=>e?yv(e):yv,{useDebugValue:I3}=ie,{useSyncExternalStoreWithSelector:N3}=z3,T3=e=>e;function h_(e,t=T3,n){const i=N3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return I3(i),i}const xv=(e,t)=>{const n=A3(e),i=(r,o=t)=>h_(n,r,o);return Object.assign(i,n),i},M3=(e,t)=>e?xv(e,t):xv;function Me(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const ku=R.createContext(null),L3=ku.Provider,p_=zn.error001();function xe(e,t){const n=R.useContext(ku);if(n===null)throw new Error(p_);return h_(n,e,t)}function Le(){const e=R.useContext(ku);if(e===null)throw new Error(p_);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const _v={display:"none"},O3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},f_="react-flow__node-desc",m_="react-flow__edge-desc",R3="react-flow__aria-live",V3=e=>e.ariaLiveMessage,F3=e=>e.ariaLabelConfig;function H3({rfId:e}){const t=xe(V3);return G.jsx("div",{id:`${R3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:O3,children:t})}function G3({rfId:e,disableKeyboardA11y:t}){const n=xe(F3);return G.jsxs(G.Fragment,{children:[G.jsx("div",{id:`${f_}-${e}`,style:_v,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),G.jsx("div",{id:`${m_}-${e}`,style:_v,children:n["edge.a11yDescription.default"]}),!t&&G.jsx(H3,{rfId:e})]})}const Su=R.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},o)=>{const s=`${e}`.split("-");return G.jsx("div",{className:Ye(["react-flow__panel",n,...s]),style:i,ref:o,...r,children:t})});Su.displayName="Panel";function B3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:G.jsx(Su,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:G.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $3=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},Ca=e=>e.id;function W3(e,t){return Me(e.selectedNodes.map(Ca),t.selectedNodes.map(Ca))&&Me(e.selectedEdges.map(Ca),t.selectedEdges.map(Ca))}function j3({onSelectionChange:e}){const t=Le(),{selectedNodes:n,selectedEdges:i}=xe($3,W3);return R.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(o=>o(r))},[n,i,e]),null}const U3=e=>!!e.onSelectionChangeHandlers;function Y3({onSelectionChange:e}){const t=xe(U3);return e||t?G.jsx(j3,{onSelectionChange:e}):null}const oh=typeof window<"u"?R.useLayoutEffect:R.useEffect,g_=[0,0],X3={x:0,y:0,zoom:1},Z3=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],kv=[...Z3,"rfId"],q3=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Sv={translateExtent:ys,nodeOrigin:g_,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Q3(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:o,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=xe(q3,Me),u=Le();oh(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Sv,a()}),[]);const d=R.useRef(Sv);return oh(()=>{for(const c of kv){const h=e[c],p=d.current[c];h!==p&&(typeof e[c]>"u"||(c==="nodes"?t(h):c==="edges"?n(h):c==="minZoom"?i(h):c==="maxZoom"?r(h):c==="translateExtent"?o(h):c==="nodeExtent"?s(h):c==="ariaLabelConfig"?u.setState({ariaLabelConfig:y5(h)}):c==="fitView"?u.setState({fitViewQueued:h}):c==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[c]:h})))}d.current=e},kv.map(c=>e[c])),null}function Cv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K3(e){var i;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const r=Cv(),o=()=>n(r!=null&&r.matches?"dark":"light");return o(),r==null||r.addEventListener("change",o),()=>{r==null||r.removeEventListener("change",o)}},[e]),t!==null?t:(i=Cv())!=null&&i.matches?"dark":"light"}const Ev=typeof document<"u"?document:null;function Ss(e=null,t={target:Ev,actInsideInputWithModifier:!0}){const[n,i]=R.useState(!1),r=R.useRef(!1),o=R.useRef(new Set([])),[s,a]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
2740
2740
|
`).replace(`
|
|
2741
2741
|
|
|
2742
2742
|
`,`
|
|
2743
2743
|
+`).split(`
|
|
2744
|
-
`)),d=u.reduce((c,h)=>c.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(t==null?void 0:t.target)??Cv,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var b,m;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&jx(p))return!1;const v=Dv(p.code,a);if(o.current.add(p[v]),Ev(s,o.current,!1)){const w=((m=(b=p.composedPath)==null?void 0:b.call(p))==null?void 0:m[0])||p.target,g=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!g)&&p.preventDefault(),i(!0)}},c=p=>{const f=Dv(p.code,a);Ev(s,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(p[f]),p.key==="Meta"&&o.current.clear(),r.current=!1},h=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Ev(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function Dv(e,t){return t.includes(e)?"code":"key"}const J3=()=>{const e=Le();return R.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:o,maxZoom:s,panZoom:a}=e.getState(),l=Hp(t,i,r,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:o,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},d=n.snapGrid??r,c=n.snapToGrid??o;return Gs(u,i,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:o}=i.getBoundingClientRect(),s=Ll(t,n);return{x:s.x+r,y:s.y+o}}}),[])};function v_(e,t){const n=[],i=new Map,r=[];for(const o of e)if(o.type==="add"){r.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const s=i.get(o.id);s?s.push(o):i.set(o.id,[o])}for(const o of t){const s=i.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...o};for(const l of s)e4(l,a);n.push(a)}return r.length&&r.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function e4(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function t4(e,t){return v_(e,t)}function n4(e,t){return v_(e,t)}function Fi(e,t){return{id:e,type:"select",selected:t}}function Nr(e,t=new Set,n=!1){const i=[];for(const[r,o]of e){const s=t.has(r);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),i.push(Fi(o.id,s)))}return i}function zv({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const a=t.get(s.id),l=((r=a==null?void 0:a.internals)==null?void 0:r.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)i.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Pv(e){return{id:e.id,type:"remove"}}const Av=e=>c5(e),i4=e=>Rx(e);function w_(e){return R.forwardRef(e)}function Iv(e){const[t,n]=R.useState(BigInt(0)),[i]=R.useState(()=>r4(()=>n(r=>r+BigInt(1))));return oh(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function r4(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const b_=R.createContext(null);function o4({children:e}){const t=Le(),n=R.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:f}=t.getState();let v=l;for(const m of a)v=typeof m=="function"?m(v):m;let b=zv({items:v,lookup:h});for(const m of f.values())b=m(b);d&&u(v),b.length>0?c==null||c(b):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:w,setNodes:g}=t.getState();m&&g(w)})},[]),i=Iv(n),r=R.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:h}=t.getState();let p=l;for(const f of a)p=typeof f=="function"?f(p):f;d?u(p):c&&c(zv({items:p,lookup:h}))},[]),o=Iv(r),s=R.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return G.jsx(b_.Provider,{value:s,children:e})}function s4(){const e=R.useContext(b_);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const a4=e=>!!e.panZoom;function Yp(){const e=J3(),t=Le(),n=s4(),i=_e(a4),r=R.useMemo(()=>{const o=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},l=c=>{var m,w;const{nodeLookup:h,nodeOrigin:p}=t.getState(),f=Av(c)?c:h.get(c.id),v=f.parentId?$x(f.position,f.measured,f.parentId,h,p):f.position,b={...f,position:v,width:((m=f.measured)==null?void 0:m.width)??f.width,height:((w=f.measured)==null?void 0:w.height)??f.height};return eo(b)},u=(c,h,p={replace:!1})=>{s(f=>f.map(v=>{if(v.id===c){const b=typeof h=="function"?h(v):h;return p.replace&&Av(b)?b:{...v,...b}}return v}))},d=(c,h,p={replace:!1})=>{a(f=>f.map(v=>{if(v.id===c){const b=typeof h=="function"?h(v):h;return p.replace&&i4(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var h;return(h=o(c))==null?void 0:h.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(h=>({...h}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const h=Array.isArray(c)?c:[c];n.nodeQueue.push(p=>[...p,...h])},addEdges:c=>{const h=Array.isArray(c)?c:[c];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:c=[],edges:h=[],transform:p}=t.getState(),[f,v,b]=p;return{nodes:c.map(m=>({...m})),edges:h.map(m=>({...m})),viewport:{x:f,y:v,zoom:b}}},deleteElements:async({nodes:c=[],edges:h=[]})=>{const{nodes:p,edges:f,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:m,triggerEdgeChanges:w,onDelete:g,onBeforeDelete:y}=t.getState(),{nodes:k,edges:_}=await m5({nodesToRemove:c,edgesToRemove:h,nodes:p,edges:f,onBeforeDelete:y}),E=_.length>0,S=k.length>0;if(E){const T=_.map(Pv);b==null||b(_),w(T)}if(S){const T=k.map(Pv);v==null||v(k),m(T)}return(S||E)&&(g==null||g({nodes:k,edges:_})),{deletedNodes:k,deletedEdges:_}},getIntersectingNodes:(c,h=!0,p)=>{const f=sv(c),v=f?c:l(c),b=p!==void 0;return v?(p||t.getState().nodes).filter(m=>{const w=t.getState().nodeLookup.get(m.id);if(w&&!f&&(m.id===c.id||!w.internals.positionAbsolute))return!1;const g=eo(b?m:w),y=_s(g,v);return h&&y>0||y>=g.width*g.height||y>=v.width*v.height}):[]},isNodeIntersecting:(c,h,p=!0)=>{const v=sv(c)?c:l(c);if(!v)return!1;const b=_s(v,h);return p&&b>0||b>=h.width*h.height||b>=v.width*v.height},updateNode:u,updateNodeData:(c,h,p={replace:!1})=>{u(c,f=>{const v=typeof h=="function"?h(f):h;return p.replace?{...f,data:v}:{...f,data:{...f.data,...v}}},p)},updateEdge:d,updateEdgeData:(c,h,p={replace:!1})=>{d(c,f=>{const v=typeof h=="function"?h(f):h;return p.replace?{...f,data:v}:{...f,data:{...f.data,...v}}},p)},getNodesBounds:c=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return d5(c,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:c,id:h,nodeId:p})=>{var f;return Array.from(((f=t.getState().connectionLookup.get(`${p}-${c}${h?`-${h}`:""}`))==null?void 0:f.values())??[])},getNodeConnections:({type:c,handleId:h,nodeId:p})=>{var f;return Array.from(((f=t.getState().connectionLookup.get(`${p}${c?h?`-${c}-${h}`:`-${c}`:""}`))==null?void 0:f.values())??[])},fitView:async c=>{const h=t.getState().fitViewResolver??b5();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return R.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const Nv=e=>e.selected,l4=typeof window<"u"?window:void 0;function u4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Le(),{deleteElements:i}=Yp(),r=Ss(e,{actInsideInputWithModifier:!1}),o=Ss(t,{target:l4});R.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();i({nodes:a.filter(Nv),edges:s.filter(Nv)}),n.setState({nodesSelectionActive:!1})}},[r]),R.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function c4(e){const t=Le();R.useEffect(()=>{const n=()=>{var r,o,s,a;if(!e.current||!(((o=(r=e.current).checkVisibility)==null?void 0:o.call(r))??!0))return!1;const i=Gp(e.current);(i.height===0||i.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",zn.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const Cu={position:"absolute",width:"100%",height:"100%",top:0,left:0},d4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function h4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:o=qi.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:h,preventScrolling:p=!0,children:f,noWheelClassName:v,noPanClassName:b,onViewportChange:m,isControlledViewport:w,paneClickDistance:g,selectionOnDrag:y}){const k=Le(),_=R.useRef(null),{userSelectionActive:E,lib:S,connectionInProgress:T}=_e(d4,Me),C=Ss(h),I=R.useRef();c4(_);const L=R.useCallback(V=>{m==null||m({x:V[0],y:V[1],zoom:V[2]}),w||k.setState({transform:V})},[m,w]);return R.useEffect(()=>{if(_.current){I.current=n3({domNode:_.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:l,onDraggingChange:A=>k.setState(O=>O.paneDragging===A?O:{paneDragging:A}),onPanZoomStart:(A,O)=>{const{onViewportChangeStart:N,onMoveStart:M}=k.getState();M==null||M(A,O),N==null||N(O)},onPanZoom:(A,O)=>{const{onViewportChange:N,onMove:M}=k.getState();M==null||M(A,O),N==null||N(O)},onPanZoomEnd:(A,O)=>{const{onViewportChangeEnd:N,onMoveEnd:M}=k.getState();M==null||M(A,O),N==null||N(O)}});const{x:V,y:D,zoom:P}=I.current.getViewport();return k.setState({panZoom:I.current,transform:[V,D,P],domNode:_.current.closest(".react-flow")}),()=>{var A;(A=I.current)==null||A.destroy()}}},[]),R.useEffect(()=>{var V;(V=I.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:C,preventScrolling:p,noPanClassName:b,userSelectionActive:E,noWheelClassName:v,lib:S,onTransformChange:L,connectionInProgress:T,selectionOnDrag:y,paneClickDistance:g})},[e,t,n,i,r,o,s,a,C,p,b,E,v,S,L,T,y,g]),G.jsx("div",{className:"react-flow__renderer",ref:_,style:Cu,children:f})}const p4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f4(){const{userSelectionActive:e,userSelectionRect:t}=_e(p4,Me);return e&&t?G.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Dc=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},m4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function g4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xs.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:h,onPaneMouseLeave:p,children:f}){const v=Le(),{userSelectionActive:b,elementsSelectable:m,dragging:w,connectionInProgress:g}=_e(m4,Me),y=m&&(e||b),k=R.useRef(null),_=R.useRef(),E=R.useRef(new Set),S=R.useRef(new Set),T=R.useRef(!1),C=N=>{if(T.current||g){T.current=!1;return}l==null||l(N),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},I=N=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){N.preventDefault();return}u==null||u(N)},L=d?N=>d(N):void 0,V=N=>{T.current&&(N.stopPropagation(),T.current=!1)},D=N=>{var q,U;const{domNode:M}=v.getState();if(_.current=M==null?void 0:M.getBoundingClientRect(),!_.current)return;const x=N.target===k.current;if(!x&&!!N.target.closest(".nokey")||!e||!(o&&x||t)||N.button!==0||!N.isPrimary)return;(U=(q=N.target)==null?void 0:q.setPointerCapture)==null||U.call(q,N.pointerId),T.current=!1;const{x:z,y:X}=sn(N.nativeEvent,_.current);v.setState({userSelectionRect:{width:0,height:0,startX:z,startY:X,x:z,y:X}}),x||(N.stopPropagation(),N.preventDefault())},P=N=>{const{userSelectionRect:M,transform:x,nodeLookup:F,edgeLookup:H,connectionLookup:z,triggerNodeChanges:X,triggerEdgeChanges:q,defaultEdgeOptions:U,resetSelectedElements:K}=v.getState();if(!_.current||!M)return;const{x:Y,y:Q}=sn(N.nativeEvent,_.current),{startX:de,startY:le}=M;if(!T.current){const ye=t?0:r;if(Math.hypot(Y-de,Q-le)<=ye)return;K(),s==null||s(N)}T.current=!0;const se={startX:de,startY:le,x:Y<de?Y:de,y:Q<le?Q:le,width:Math.abs(Y-de),height:Math.abs(Q-le)},oe=E.current,ge=S.current;E.current=new Set(Fp(F,se,x,n===xs.Partial,!0).map(ye=>ye.id)),S.current=new Set;const Ee=(U==null?void 0:U.selectable)??!0;for(const ye of E.current){const Xe=z.get(ye);if(Xe)for(const{edgeId:fn}of Xe.values()){const Vt=H.get(fn);Vt&&(Vt.selectable??Ee)&&S.current.add(fn)}}if(!av(oe,E.current)){const ye=Nr(F,E.current,!0);X(ye)}if(!av(ge,S.current)){const ye=Nr(H,S.current);q(ye)}v.setState({userSelectionRect:se,userSelectionActive:!0,nodesSelectionActive:!1})},A=N=>{var M,x;N.button===0&&((x=(M=N.target)==null?void 0:M.releasePointerCapture)==null||x.call(M,N.pointerId),!b&&N.target===k.current&&v.getState().userSelectionRect&&(C==null||C(N)),v.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(a==null||a(N),v.setState({nodesSelectionActive:E.current.size>0})))},O=i===!0||Array.isArray(i)&&i.includes(0);return G.jsxs("div",{className:Ye(["react-flow__pane",{draggable:O,dragging:w,selection:e}]),onClick:y?void 0:Dc(C,k),onContextMenu:Dc(I,k),onWheel:Dc(L,k),onPointerEnter:y?void 0:c,onPointerMove:y?P:h,onPointerUp:y?A:void 0,onPointerDownCapture:y?D:void 0,onClickCapture:y?V:void 0,onPointerLeave:p,ref:k,style:Cu,children:[f,G.jsx(f4,{})]})}function sh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",zn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function y_({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:o,nodeClickDistance:s}){const a=Le(),[l,u]=R.useState(!1),d=R.useRef();return R.useEffect(()=>{d.current=B5({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{sh({id:c,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:o,nodeId:r,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,i,t,o,e,r,s]),l}const v4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function x_(){const e=Le();return R.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,h=v4(s),p=r?o[0]:5,f=r?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*f*n.factor;for(const[,m]of u){if(!h(m))continue;let w={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+b};r&&(w=Hs(w,o));const{position:g,positionAbsolute:y}=Vx({nodeId:m.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:a});m.position=g,m.internals.positionAbsolute=y,c.set(m.id,m)}l(c)},[])}const Xp=R.createContext(null),w4=Xp.Provider;Xp.Consumer;const __=()=>R.useContext(Xp),b4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),y4=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:o,connection:s}=i,{fromHandle:a,toHandle:l,isValid:u}=s,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:o===Kr.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:d&&u}};function x4({type:e="source",position:t=ae.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:c,...h},p){var P,A;const f=s||null,v=e==="target",b=Le(),m=__(),{connectOnClick:w,noPanClassName:g,rfId:y}=_e(b4,Me),{connectingFrom:k,connectingTo:_,clickConnecting:E,isPossibleEndHandle:S,connectionInProcess:T,clickConnectionInProcess:C,valid:I}=_e(y4(m,f,e),Me);m||(A=(P=b.getState()).onError)==null||A.call(P,"010",zn.error010());const L=O=>{const{defaultEdgeOptions:N,onConnect:M,hasDefaultEdges:x}=b.getState(),F={...N,...O};if(x){const{edges:H,setEdges:z}=b.getState();z(E5(F,H))}M==null||M(F),a==null||a(F)},V=O=>{if(!m)return;const N=Ux(O.nativeEvent);if(r&&(N&&O.button===0||!N)){const M=b.getState();rh.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:f,nodeId:m,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...x)=>{var F,H;return(H=(F=b.getState()).onConnectEnd)==null?void 0:H.call(F,...x)},updateConnection:M.updateConnection,onConnect:L,isValidConnection:n||((...x)=>{var F,H;return((H=(F=b.getState()).isValidConnection)==null?void 0:H.call(F,...x))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}N?d==null||d(O):c==null||c(O)},D=O=>{const{onClickConnectStart:N,onClickConnectEnd:M,connectionClickStartHandle:x,connectionMode:F,isValidConnection:H,lib:z,rfId:X,nodeLookup:q,connection:U}=b.getState();if(!m||!x&&!r)return;if(!x){N==null||N(O.nativeEvent,{nodeId:m,handleId:f,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:m,type:e,id:f}});return}const K=Wx(O.target),Y=n||H,{connection:Q,isValid:de}=rh.isValid(O.nativeEvent,{handle:{nodeId:m,id:f,type:e},connectionMode:F,fromNodeId:x.nodeId,fromHandleId:x.id||null,fromType:x.type,isValidConnection:Y,flowId:X,doc:K,lib:z,nodeLookup:q});de&&Q&&L(Q);const le=structuredClone(U);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,M==null||M(O,le),b.setState({connectionClickStartHandle:null})};return G.jsx("div",{"data-handleid":f,"data-nodeid":m,"data-handlepos":t,"data-id":`${y}-${m}-${f}-${e}`,className:Ye(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!v,target:v,connectable:i,connectablestart:r,connectableend:o,clickconnecting:E,connectingfrom:k,connectingto:_,valid:I,connectionindicator:i&&(!T||S)&&(T||C?o:r)}]),onMouseDown:V,onTouchStart:V,onClick:w?D:void 0,ref:p,...h,children:l})}const Ol=R.memo(w_(x4));function _4({data:e,isConnectable:t,sourcePosition:n=ae.Bottom}){return G.jsxs(G.Fragment,{children:[e==null?void 0:e.label,G.jsx(Ol,{type:"source",position:n,isConnectable:t})]})}function k4({data:e,isConnectable:t,targetPosition:n=ae.Top,sourcePosition:i=ae.Bottom}){return G.jsxs(G.Fragment,{children:[G.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,G.jsx(Ol,{type:"source",position:i,isConnectable:t})]})}function S4(){return null}function C4({data:e,isConnectable:t,targetPosition:n=ae.Top}){return G.jsxs(G.Fragment,{children:[G.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Rl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Tv={input:_4,default:k4,output:C4,group:S4};function E4(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const D4=e=>{const{width:t,height:n,x:i,y:r}=Fs(e.nodeLookup,{filter:o=>!!o.selected});return{width:on(t)?t:null,height:on(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function z4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Le(),{width:r,height:o,transformString:s,userSelectionActive:a}=_e(D4,Me),l=x_(),u=R.useRef(null);R.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!a&&r!==null&&o!==null;if(y_({nodeRef:u,disabled:!d}),!d)return null;const c=e?p=>{const f=i.getState().nodes.filter(v=>v.selected);e(p,f)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Rl,p.key)&&(p.preventDefault(),l({direction:Rl[p.key],factor:p.shiftKey?4:1}))};return G.jsx("div",{className:Ye(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:G.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:o}})})}const Mv=typeof window<"u"?window:void 0,P4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function k_({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:f,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:g,panOnScroll:y,panOnScrollSpeed:k,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:S,defaultViewport:T,translateExtent:C,minZoom:I,maxZoom:L,preventScrolling:V,onSelectionContextMenu:D,noWheelClassName:P,noPanClassName:A,disableKeyboardA11y:O,onViewportChange:N,isControlledViewport:M}){const{nodesSelectionActive:x,userSelectionActive:F}=_e(P4,Me),H=Ss(u,{target:Mv}),z=Ss(v,{target:Mv}),X=z||S,q=z||y,U=d&&X!==!0,K=H||F||U;return u4({deleteKeyCode:l,multiSelectionKeyCode:f}),G.jsx(h4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:g,panOnScroll:q,panOnScrollSpeed:k,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:!H&&X,defaultViewport:T,translateExtent:C,minZoom:I,maxZoom:L,zoomActivationKeyCode:b,preventScrolling:V,noWheelClassName:P,noPanClassName:A,onViewportChange:N,isControlledViewport:M,paneClickDistance:a,selectionOnDrag:U,children:G.jsxs(g4,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:X,isSelecting:!!K,selectionMode:c,selectionKeyPressed:H,paneClickDistance:a,selectionOnDrag:U,children:[e,x&&G.jsx(z4,{onSelectionContextMenu:D,noPanClassName:A,disableKeyboardA11y:O})]})})}k_.displayName="FlowRenderer";const A4=R.memo(k_),I4=e=>t=>e?Fp(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function N4(e){return _e(R.useCallback(I4(e),[e]),Me)}const T4=e=>e.updateNodeInternals;function M4(){const e=_e(T4),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const o=r.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:r.target,force:!0})}),e(i)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function L4({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Le(),o=R.useRef(null),s=R.useRef(null),a=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(t),d=n&&!!e.internals.handleBounds;return R.useEffect(()=>{o.current&&!e.hidden&&(!d||s.current!==o.current)&&(s.current&&(i==null||i.unobserve(s.current)),i==null||i.observe(o.current),s.current=o.current)},[d,e.hidden]),R.useEffect(()=>()=>{s.current&&(i==null||i.unobserve(s.current),s.current=null)},[]),R.useEffect(()=>{if(o.current){const c=u.current!==t,h=a.current!==e.sourcePosition,p=l.current!==e.targetPosition;(c||h||p)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function O4({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:f,rfId:v,nodeTypes:b,nodeClickDistance:m,onError:w}){const{node:g,internals:y,isParent:k}=_e(Y=>{const Q=Y.nodeLookup.get(e),de=Y.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:de}},Me);let _=g.type||"default",E=(b==null?void 0:b[_])||Tv[_];E===void 0&&(w==null||w("003",zn.error003(_)),_="default",E=(b==null?void 0:b.default)||Tv.default);const S=!!(g.draggable||a&&typeof g.draggable>"u"),T=!!(g.selectable||l&&typeof g.selectable>"u"),C=!!(g.connectable||u&&typeof g.connectable>"u"),I=!!(g.focusable||d&&typeof g.focusable>"u"),L=Le(),V=Bx(g),D=L4({node:g,nodeType:_,hasDimensions:V,resizeObserver:c}),P=y_({nodeRef:D,disabled:g.hidden||!S,noDragClassName:h,handleSelector:g.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:m}),A=x_();if(g.hidden)return null;const O=Xn(g),N=E4(g),M=T||S||t||n||i||r,x=n?Y=>n(Y,{...y.userNode}):void 0,F=i?Y=>i(Y,{...y.userNode}):void 0,H=r?Y=>r(Y,{...y.userNode}):void 0,z=o?Y=>o(Y,{...y.userNode}):void 0,X=s?Y=>s(Y,{...y.userNode}):void 0,q=Y=>{const{selectNodesOnDrag:Q,nodeDragThreshold:de}=L.getState();T&&(!Q||!S||de>0)&&sh({id:e,store:L,nodeRef:D}),t&&t(Y,{...y.userNode})},U=Y=>{if(!(jx(Y.nativeEvent)||f)){if(Tx.includes(Y.key)&&T){const Q=Y.key==="Escape";sh({id:e,store:L,unselect:Q,nodeRef:D})}else if(S&&g.selected&&Object.prototype.hasOwnProperty.call(Rl,Y.key)){Y.preventDefault();const{ariaLabelConfig:Q}=L.getState();L.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:Y.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),A({direction:Rl[Y.key],factor:Y.shiftKey?4:1})}}},K=()=>{var ge;if(f||!((ge=D.current)!=null&&ge.matches(":focus-visible")))return;const{transform:Y,width:Q,height:de,autoPanOnNodeFocus:le,setCenter:se}=L.getState();if(!le)return;Fp(new Map([[e,g]]),{x:0,y:0,width:Q,height:de},Y,!0).length>0||se(g.position.x+O.width/2,g.position.y+O.height/2,{zoom:Y[2]})};return G.jsx("div",{className:Ye(["react-flow__node",`react-flow__node-${_}`,{[p]:S},g.className,{selected:g.selected,selectable:T,parent:k,draggable:S,dragging:P}]),ref:D,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:V?"visible":"hidden",...g.style,...N},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:x,onMouseMove:F,onMouseLeave:H,onContextMenu:z,onClick:q,onDoubleClick:X,onKeyDown:I?U:void 0,tabIndex:I?0:void 0,onFocus:I?K:void 0,role:g.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":f?void 0:`${f_}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:G.jsx(w4,{value:e,children:G.jsx(E,{id:e,data:g.data,type:_,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:g.selected??!1,selectable:T,draggable:S,deletable:g.deletable??!0,isConnectable:C,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:P,dragHandle:g.dragHandle,zIndex:y.z,parentId:g.parentId,...O})})})}var R4=R.memo(O4);const V4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function S_(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:o}=_e(V4,Me),s=N4(e.onlyRenderVisibleElements),a=M4();return G.jsx("div",{className:"react-flow__nodes",style:Cu,children:s.map(l=>G.jsx(R4,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}S_.displayName="NodeRenderer";const F4=R.memo(S_);function H4(e){return _e(R.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const o=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);o&&s&&k5({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Me)}const G4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return G.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},B4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return G.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Lv={[Tl.Arrow]:G4,[Tl.ArrowClosed]:B4};function $4(e){const t=Le();return R.useMemo(()=>{var r,o;return Object.prototype.hasOwnProperty.call(Lv,e)?Lv[e]:((o=(r=t.getState()).onError)==null||o.call(r,"009",zn.error009(e)),null)},[e])}const W4=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=$4(t);return l?G.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:G.jsx(l,{color:n,strokeWidth:s})}):null},C_=({defaultColor:e,rfId:t})=>{const n=_e(o=>o.edges),i=_e(o=>o.defaultEdgeOptions),r=R.useMemo(()=>I5(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?G.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:G.jsx("defs",{children:r.map(o=>G.jsx(W4,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};C_.displayName="MarkerDefinitions";var j4=R.memo(C_);function E_({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d}){const[c,h]=R.useState({x:1,y:0,width:0,height:0}),p=Ye(["react-flow__edge-textwrapper",u]),f=R.useRef(null);return R.useEffect(()=>{if(f.current){const v=f.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?G.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:p,visibility:c.width?"visible":"hidden",...d,children:[r&&G.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),G.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:f,style:i,children:n}),l]}):null}E_.displayName="EdgeText";const U4=R.memo(E_);function Eu({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return G.jsxs(G.Fragment,{children:[G.jsx("path",{...d,d:e,fill:"none",className:Ye(["react-flow__edge-path",d.className])}),u?G.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&on(t)&&on(n)?G.jsx(U4,{x:t,y:n,label:i,labelStyle:r,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Ov({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===ae.Left||e===ae.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function D_({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top}){const[s,a]=Ov({pos:n,x1:e,y1:t,x2:i,y2:r}),[l,u]=Ov({pos:o,x1:i,y1:r,x2:e,y2:t}),[d,c,h,p]=Yx({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${i},${r}`,d,c,h,p]}function z_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:m})=>{const[w,g,y]=D_({sourceX:n,sourceY:i,sourcePosition:s,targetX:r,targetY:o,targetPosition:a}),k=e.isInternal?void 0:t;return G.jsx(Eu,{id:k,path:w,labelX:g,labelY:y,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:m})})}const Y4=z_({isInternal:!1}),P_=z_({isInternal:!0});Y4.displayName="SimpleBezierEdge";P_.displayName="SimpleBezierEdgeInternal";function A_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,sourcePosition:p=ae.Bottom,targetPosition:f=ae.Top,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:w})=>{const[g,y,k]=th({sourceX:n,sourceY:i,sourcePosition:p,targetX:r,targetY:o,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),_=e.isInternal?void 0:t;return G.jsx(Eu,{id:_,path:g,labelX:y,labelY:k,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:v,markerStart:b,interactionWidth:w})})}const I_=A_({isInternal:!1}),N_=A_({isInternal:!0});I_.displayName="SmoothStepEdge";N_.displayName="SmoothStepEdgeInternal";function T_(e){return R.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return G.jsx(I_,{...n,id:i,pathOptions:R.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const X4=T_({isInternal:!1}),M_=T_({isInternal:!0});X4.displayName="StepEdge";M_.displayName="StepEdgeInternal";function L_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:p,markerStart:f,interactionWidth:v})=>{const[b,m,w]=qx({sourceX:n,sourceY:i,targetX:r,targetY:o}),g=e.isInternal?void 0:t;return G.jsx(Eu,{id:g,path:b,labelX:m,labelY:w,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:p,markerStart:f,interactionWidth:v})})}const Z4=L_({isInternal:!1}),O_=L_({isInternal:!0});Z4.displayName="StraightEdge";O_.displayName="StraightEdgeInternal";function R_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,sourcePosition:s=ae.Bottom,targetPosition:a=ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:w})=>{const[g,y,k]=Xx({sourceX:n,sourceY:i,sourcePosition:s,targetX:r,targetY:o,targetPosition:a,curvature:m==null?void 0:m.curvature}),_=e.isInternal?void 0:t;return G.jsx(Eu,{id:_,path:g,labelX:y,labelY:k,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:w})})}const q4=R_({isInternal:!1}),V_=R_({isInternal:!0});q4.displayName="BezierEdge";V_.displayName="BezierEdgeInternal";const Rv={default:V_,straight:O_,step:M_,smoothstep:N_,simplebezier:P_},Vv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Q4=(e,t,n)=>n===ae.Left?e-t:n===ae.Right?e+t:e,K4=(e,t,n)=>n===ae.Top?e-t:n===ae.Bottom?e+t:e,Fv="react-flow__edgeupdater";function Hv({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:o,onMouseOut:s,type:a}){return G.jsx("circle",{onMouseDown:r,onMouseEnter:o,onMouseOut:s,className:Ye([Fv,`${Fv}-${a}`]),cx:Q4(t,i,e),cy:K4(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function J4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:o,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:h,setUpdateHover:p}){const f=Le(),v=(y,k)=>{if(y.button!==0)return;const{autoPanOnConnect:_,domNode:E,connectionMode:S,connectionRadius:T,lib:C,onConnectStart:I,cancelConnection:L,nodeLookup:V,rfId:D,panBy:P,updateConnection:A}=f.getState(),O=k.type==="target",N=(F,H)=>{h(!1),c==null||c(F,n,k.type,H)},M=F=>u==null?void 0:u(n,F),x=(F,H)=>{h(!0),d==null||d(y,n,k.type),I==null||I(F,H)};rh.onPointerDown(y.nativeEvent,{autoPanOnConnect:_,connectionMode:S,connectionRadius:T,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:V,isTarget:O,edgeUpdaterType:k.type,lib:C,flowId:D,cancelConnection:L,panBy:P,isValidConnection:(...F)=>{var H,z;return((z=(H=f.getState()).isValidConnection)==null?void 0:z.call(H,...F))??!0},onConnect:M,onConnectStart:x,onConnectEnd:(...F)=>{var H,z;return(z=(H=f.getState()).onConnectEnd)==null?void 0:z.call(H,...F)},onReconnectEnd:N,updateConnection:A,getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,dragThreshold:f.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},b=y=>v(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=y=>v(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>p(!0),g=()=>p(!1);return G.jsxs(G.Fragment,{children:[(e===!0||e==="source")&&G.jsx(Hv,{position:a,centerX:i,centerY:r,radius:t,onMouseDown:b,onMouseEnter:w,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&G.jsx(Hv,{position:l,centerX:o,centerY:s,radius:t,onMouseDown:m,onMouseEnter:w,onMouseOut:g,type:"target"})]})}function eV({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:p,rfId:f,edgeTypes:v,noPanClassName:b,onError:m,disableKeyboardA11y:w}){let g=_e(se=>se.edgeLookup.get(e));const y=_e(se=>se.defaultEdgeOptions);g=y?{...y,...g}:g;let k=g.type||"default",_=(v==null?void 0:v[k])||Rv[k];_===void 0&&(m==null||m("011",zn.error011(k)),k="default",_=(v==null?void 0:v.default)||Rv.default);const E=!!(g.focusable||t&&typeof g.focusable>"u"),S=typeof c<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),T=!!(g.selectable||i&&typeof g.selectable>"u"),C=R.useRef(null),[I,L]=R.useState(!1),[V,D]=R.useState(!1),P=Le(),{zIndex:A,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H}=_e(R.useCallback(se=>{const oe=se.nodeLookup.get(g.source),ge=se.nodeLookup.get(g.target);if(!oe||!ge)return{zIndex:g.zIndex,...Vv};const Ee=A5({id:e,sourceNode:oe,targetNode:ge,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:se.connectionMode,onError:m});return{zIndex:_5({selected:g.selected,zIndex:g.zIndex,sourceNode:oe,targetNode:ge,elevateOnSelect:se.elevateEdgesOnSelect,zIndexMode:se.zIndexMode}),...Ee||Vv}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),Me),z=R.useMemo(()=>g.markerStart?`url('#${nh(g.markerStart,f)}')`:void 0,[g.markerStart,f]),X=R.useMemo(()=>g.markerEnd?`url('#${nh(g.markerEnd,f)}')`:void 0,[g.markerEnd,f]);if(g.hidden||O===null||N===null||M===null||x===null)return null;const q=se=>{var ye;const{addSelectedEdges:oe,unselectNodesAndEdges:ge,multiSelectionActive:Ee}=P.getState();T&&(P.setState({nodesSelectionActive:!1}),g.selected&&Ee?(ge({nodes:[],edges:[g]}),(ye=C.current)==null||ye.blur()):oe([e])),r&&r(se,g)},U=o?se=>{o(se,{...g})}:void 0,K=s?se=>{s(se,{...g})}:void 0,Y=a?se=>{a(se,{...g})}:void 0,Q=l?se=>{l(se,{...g})}:void 0,de=u?se=>{u(se,{...g})}:void 0,le=se=>{var oe;if(!w&&Tx.includes(se.key)&&T){const{unselectNodesAndEdges:ge,addSelectedEdges:Ee}=P.getState();se.key==="Escape"?((oe=C.current)==null||oe.blur(),ge({edges:[g]})):Ee([e])}};return G.jsx("svg",{style:{zIndex:A},children:G.jsxs("g",{className:Ye(["react-flow__edge",`react-flow__edge-${k}`,g.className,b,{selected:g.selected,animated:g.animated,inactive:!T&&!r,updating:I,selectable:T}]),onClick:q,onDoubleClick:U,onContextMenu:K,onMouseEnter:Y,onMouseMove:Q,onMouseLeave:de,onKeyDown:E?le:void 0,tabIndex:E?0:void 0,role:g.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":E?`${m_}-${f}`:void 0,ref:C,...g.domAttributes,children:[!V&&G.jsx(_,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:T,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:z,markerEnd:X,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),S&&G.jsx(J4,{edge:g,isReconnectable:S,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:p,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H,setUpdateHover:L,setReconnecting:D})]})})}var tV=R.memo(eV);const nV=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function F_({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:f,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:m,elementsSelectable:w,onError:g}=_e(nV,Me),y=H4(t);return G.jsxs("div",{className:"react-flow__edges",children:[G.jsx(j4,{defaultColor:e,rfId:n}),y.map(k=>G.jsx(tV,{id:k,edgesFocusable:b,edgesReconnectable:m,elementsSelectable:w,noPanClassName:r,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:f,rfId:n,onError:g,edgeTypes:i,disableKeyboardA11y:v},k))]})}F_.displayName="EdgeRenderer";const iV=R.memo(F_),rV=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oV({children:e}){const t=_e(rV);return G.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function sV(e){const t=Yp(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const aV=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function lV(e){const t=_e(aV),n=Le();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uV(e){return e.connection.inProgress?{...e.connection,to:Gs(e.connection.to,e.transform)}:{...e.connection}}function cV(e){return uV}function dV(e){const t=cV();return _e(t,Me)}const hV=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pV({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:o,height:s,isValid:a,inProgress:l}=_e(hV,Me);return!(o&&r&&l)?null:G.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:G.jsx("g",{className:Ye(["react-flow__connection",Ox(a)]),children:G.jsx(H_,{style:t,type:n,CustomComponent:i,isValid:a})})})}const H_=({style:e,type:t=ai.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:o,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:d,toHandle:c,toPosition:h,pointer:p}=dV();if(!r)return;if(n)return G.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:Ox(i),toNode:d,toHandle:c,pointer:p});let f="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case ai.Bezier:[f]=Xx(v);break;case ai.SimpleBezier:[f]=D_(v);break;case ai.Step:[f]=th({...v,borderRadius:0});break;case ai.SmoothStep:[f]=th(v);break;default:[f]=qx(v)}return G.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};H_.displayName="ConnectionLine";const fV={};function Gv(e=fV){R.useRef(e),Le(),R.useEffect(()=>{},[e])}function mV(){Le(),R.useRef(!1),R.useEffect(()=>{},[])}function G_({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:h,onSelectionEnd:p,connectionLineType:f,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:m,selectionKeyCode:w,selectionOnDrag:g,selectionMode:y,multiSelectionKeyCode:k,panActivationKeyCode:_,zoomActivationKeyCode:E,deleteKeyCode:S,onlyRenderVisibleElements:T,elementsSelectable:C,defaultViewport:I,translateExtent:L,minZoom:V,maxZoom:D,preventScrolling:P,defaultMarkerColor:A,zoomOnScroll:O,zoomOnPinch:N,panOnScroll:M,panOnScrollSpeed:x,panOnScrollMode:F,zoomOnDoubleClick:H,panOnDrag:z,onPaneClick:X,onPaneMouseEnter:q,onPaneMouseMove:U,onPaneMouseLeave:K,onPaneScroll:Y,onPaneContextMenu:Q,paneClickDistance:de,nodeClickDistance:le,onEdgeContextMenu:se,onEdgeMouseEnter:oe,onEdgeMouseMove:ge,onEdgeMouseLeave:Ee,reconnectRadius:ye,onReconnect:Xe,onReconnectStart:fn,onReconnectEnd:Vt,noDragClassName:mn,noWheelClassName:Pi,noPanClassName:Ai,disableKeyboardA11y:Ii,nodeExtent:co,rfId:hr,viewport:$,onViewportChange:Z}){return Gv(e),Gv(t),mV(),sV(n),lV($),G.jsx(A4,{onPaneClick:X,onPaneMouseEnter:q,onPaneMouseMove:U,onPaneMouseLeave:K,onPaneContextMenu:Q,onPaneScroll:Y,paneClickDistance:de,deleteKeyCode:S,selectionKeyCode:w,selectionOnDrag:g,selectionMode:y,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:_,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:O,zoomOnPinch:N,zoomOnDoubleClick:H,panOnScroll:M,panOnScrollSpeed:x,panOnScrollMode:F,panOnDrag:z,defaultViewport:I,translateExtent:L,minZoom:V,maxZoom:D,onSelectionContextMenu:c,preventScrolling:P,noDragClassName:mn,noWheelClassName:Pi,noPanClassName:Ai,disableKeyboardA11y:Ii,onViewportChange:Z,isControlledViewport:!!$,children:G.jsxs(oV,{children:[G.jsx(iV,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Xe,onReconnectStart:fn,onReconnectEnd:Vt,onlyRenderVisibleElements:T,onEdgeContextMenu:se,onEdgeMouseEnter:oe,onEdgeMouseMove:ge,onEdgeMouseLeave:Ee,reconnectRadius:ye,defaultMarkerColor:A,noPanClassName:Ai,disableKeyboardA11y:Ii,rfId:hr}),G.jsx(pV,{style:v,type:f,component:b,containerStyle:m}),G.jsx("div",{className:"react-flow__edgelabel-renderer"}),G.jsx(F4,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:le,onlyRenderVisibleElements:T,noPanClassName:Ai,noDragClassName:mn,disableKeyboardA11y:Ii,nodeExtent:co,rfId:hr}),G.jsx("div",{className:"react-flow__viewport-portal"})]})})}G_.displayName="GraphView";const gV=R.memo(G_),Bv=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:h="basic"}={})=>{const p=new Map,f=new Map,v=new Map,b=new Map,m=i??t??[],w=n??e??[],g=d??[0,0],y=c??ys;Jx(v,b,m);const{nodesInitialized:k}=ih(w,p,f,{nodeOrigin:g,nodeExtent:y,zIndexMode:h});let _=[0,0,1];if(s&&r&&o){const E=Fs(p,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:S,y:T,zoom:C}=Hp(E,r,o,l,u,(a==null?void 0:a.padding)??.1);_=[S,T,C]}return{rfId:"1",width:r??0,height:o??0,transform:_,nodes:w,nodesInitialized:k,nodeLookup:p,parentLookup:f,edges:m,edgeLookup:b,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:ys,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Kr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Lx},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:g5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Mx,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},vV=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h})=>M3((p,f)=>{async function v(){const{nodeLookup:b,panZoom:m,fitViewOptions:w,fitViewResolver:g,width:y,height:k,minZoom:_,maxZoom:E}=f();m&&(await f5({nodes:b,width:y,height:k,panZoom:m,minZoom:_,maxZoom:E},w),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...Bv({nodes:e,edges:t,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:b=>{const{nodeLookup:m,parentLookup:w,nodeOrigin:g,elevateNodesOnSelect:y,fitViewQueued:k,zIndexMode:_,nodesSelectionActive:E}=f(),{nodesInitialized:S,hasSelectedNodes:T}=ih(b,m,w,{nodeOrigin:g,nodeExtent:c,elevateNodesOnSelect:y,checkEquality:!0,zIndexMode:_}),C=E&&T;k&&S?(v(),p({nodes:b,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:C})):p({nodes:b,nodesInitialized:S,nodesSelectionActive:C})},setEdges:b=>{const{connectionLookup:m,edgeLookup:w}=f();Jx(m,w,b),p({edges:b})},setDefaultNodesAndEdges:(b,m)=>{if(b){const{setNodes:w}=f();w(b),p({hasDefaultNodes:!0})}if(m){const{setEdges:w}=f();w(m),p({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:m,nodeLookup:w,parentLookup:g,domNode:y,nodeOrigin:k,nodeExtent:_,debug:E,fitViewQueued:S,zIndexMode:T}=f(),{changes:C,updatedInternals:I}=V5(b,w,g,y,k,_,T);I&&(M5(w,g,{nodeOrigin:k,nodeExtent:_,zIndexMode:T}),S?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(C==null?void 0:C.length)>0&&(E&&console.log("React Flow: trigger node changes",C),m==null||m(C)))},updateNodePositions:(b,m=!1)=>{const w=[];let g=[];const{nodeLookup:y,triggerNodeChanges:k,connection:_,updateConnection:E,onNodesChangeMiddlewareMap:S}=f();for(const[T,C]of b){const I=y.get(T),L=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(C!=null&&C.position)),V={id:T,type:"position",position:L?{x:Math.max(0,C.position.x),y:Math.max(0,C.position.y)}:C.position,dragging:m};if(I&&_.inProgress&&_.fromNode.id===I.id){const D=sr(I,_.fromHandle,ae.Left,!0);E({..._,from:D})}L&&I.parentId&&w.push({id:T,parentId:I.parentId,rect:{...C.internals.positionAbsolute,width:C.measured.width??0,height:C.measured.height??0}}),g.push(V)}if(w.length>0){const{parentLookup:T,nodeOrigin:C}=f(),I=Up(w,y,T,C);g.push(...I)}for(const T of S.values())g=T(g);k(g)},triggerNodeChanges:b=>{const{onNodesChange:m,setNodes:w,nodes:g,hasDefaultNodes:y,debug:k}=f();if(b!=null&&b.length){if(y){const _=t4(b,g);w(_)}k&&console.log("React Flow: trigger node changes",b),m==null||m(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:m,setEdges:w,edges:g,hasDefaultEdges:y,debug:k}=f();if(b!=null&&b.length){if(y){const _=n4(b,g);w(_)}k&&console.log("React Flow: trigger edge changes",b),m==null||m(b)}},addSelectedNodes:b=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:g,triggerNodeChanges:y,triggerEdgeChanges:k}=f();if(m){const _=b.map(E=>Fi(E,!0));y(_);return}y(Nr(g,new Set([...b]),!0)),k(Nr(w))},addSelectedEdges:b=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:g,triggerNodeChanges:y,triggerEdgeChanges:k}=f();if(m){const _=b.map(E=>Fi(E,!0));k(_);return}k(Nr(w,new Set([...b]))),y(Nr(g,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:m}={})=>{const{edges:w,nodes:g,nodeLookup:y,triggerNodeChanges:k,triggerEdgeChanges:_}=f(),E=b||g,S=m||w,T=[];for(const I of E){if(!I.selected)continue;const L=y.get(I.id);L&&(L.selected=!1),T.push(Fi(I.id,!1))}const C=[];for(const I of S)I.selected&&C.push(Fi(I.id,!1));k(T),_(C)},setMinZoom:b=>{const{panZoom:m,maxZoom:w}=f();m==null||m.setScaleExtent([b,w]),p({minZoom:b})},setMaxZoom:b=>{const{panZoom:m,minZoom:w}=f();m==null||m.setScaleExtent([w,b]),p({maxZoom:b})},setTranslateExtent:b=>{var m;(m=f().panZoom)==null||m.setTranslateExtent(b),p({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:m,triggerNodeChanges:w,triggerEdgeChanges:g,elementsSelectable:y}=f();if(!y)return;const k=m.reduce((E,S)=>S.selected?[...E,Fi(S.id,!1)]:E,[]),_=b.reduce((E,S)=>S.selected?[...E,Fi(S.id,!1)]:E,[]);w(k),g(_)},setNodeExtent:b=>{const{nodes:m,nodeLookup:w,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:k,nodeExtent:_,zIndexMode:E}=f();b[0][0]===_[0][0]&&b[0][1]===_[0][1]&&b[1][0]===_[1][0]&&b[1][1]===_[1][1]||(ih(m,w,g,{nodeOrigin:y,nodeExtent:b,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),p({nodeExtent:b}))},panBy:b=>{const{transform:m,width:w,height:g,panZoom:y,translateExtent:k}=f();return F5({delta:b,panZoom:y,transform:m,translateExtent:k,width:w,height:g})},setCenter:async(b,m,w)=>{const{width:g,height:y,maxZoom:k,panZoom:_}=f();if(!_)return Promise.resolve(!1);const E=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await _.setViewport({x:g/2-b*E,y:y/2-m*E,zoom:E},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...Lx}})},updateConnection:b=>{p({connection:b})},reset:()=>p({...Bv()})}},Object.is);function wV({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:o,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h,children:p}){const[f]=R.useState(()=>vV({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:c,zIndexMode:h}));return G.jsx(L3,{value:f,children:G.jsx(o4,{children:p})})}function bV({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:o,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:p}){return R.useContext(ku)?G.jsx(G.Fragment,{children:e}):G.jsx(wV,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:o,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:p,children:e})}const yV={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function xV({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:h,onConnect:p,onConnectStart:f,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,onNodeMouseEnter:w,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:_,onNodeDragStart:E,onNodeDrag:S,onNodeDragStop:T,onNodesDelete:C,onEdgesDelete:I,onDelete:L,onSelectionChange:V,onSelectionDragStart:D,onSelectionDrag:P,onSelectionDragStop:A,onSelectionContextMenu:O,onSelectionStart:N,onSelectionEnd:M,onBeforeDelete:x,connectionMode:F,connectionLineType:H=ai.Bezier,connectionLineStyle:z,connectionLineComponent:X,connectionLineContainerStyle:q,deleteKeyCode:U="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:Y=!1,selectionMode:Q=xs.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:le=ks()?"Meta":"Control",zoomActivationKeyCode:se=ks()?"Meta":"Control",snapToGrid:oe,snapGrid:ge,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ye,nodesDraggable:Xe,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:mn,nodeOrigin:Pi=g_,edgesFocusable:Ai,edgesReconnectable:Ii,elementsSelectable:co=!0,defaultViewport:hr=X3,minZoom:$=.5,maxZoom:Z=2,translateExtent:he=ys,preventScrolling:ve=!0,nodeExtent:Se,defaultMarkerColor:Dt="#b1b1b7",zoomOnScroll:In=!0,zoomOnPinch:Xt=!0,panOnScroll:Ni=!1,panOnScrollSpeed:Ti=.5,panOnScrollMode:pt=qi.Free,zoomOnDoubleClick:Zn=!0,panOnDrag:Zt=!0,onPaneClick:j_,onPaneMouseEnter:U_,onPaneMouseMove:Y_,onPaneMouseLeave:X_,onPaneScroll:Z_,onPaneContextMenu:q_,paneClickDistance:Q_=1,nodeClickDistance:K_=0,children:J_,onReconnect:e1,onReconnectStart:t1,onReconnectEnd:n1,onEdgeContextMenu:i1,onEdgeDoubleClick:r1,onEdgeMouseEnter:o1,onEdgeMouseMove:s1,onEdgeMouseLeave:a1,reconnectRadius:l1=10,onNodesChange:u1,onEdgesChange:c1,noDragClassName:d1="nodrag",noWheelClassName:h1="nowheel",noPanClassName:Zp="nopan",fitView:qp,fitViewOptions:Qp,connectOnClick:p1,attributionPosition:f1,proOptions:m1,defaultEdgeOptions:g1,elevateNodesOnSelect:v1=!0,elevateEdgesOnSelect:w1=!1,disableKeyboardA11y:Kp=!1,autoPanOnConnect:b1,autoPanOnNodeDrag:y1,autoPanSpeed:x1,connectionRadius:_1,isValidConnection:k1,onError:S1,style:C1,id:Jp,nodeDragThreshold:E1,connectionDragThreshold:D1,viewport:z1,onViewportChange:P1,width:A1,height:I1,colorMode:N1="light",debug:T1,onScroll:Bs,ariaLabelConfig:M1,zIndexMode:ef="basic",...L1},O1){const Du=Jp||"1",R1=K3(N1),V1=R.useCallback(tf=>{tf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Bs==null||Bs(tf)},[Bs]);return G.jsx("div",{"data-testid":"rf__wrapper",...L1,onScroll:V1,style:{...C1,...yV},ref:O1,className:Ye(["react-flow",r,R1]),id:Jp,role:"application",children:G.jsxs(bV,{nodes:e,edges:t,width:A1,height:I1,fitView:qp,fitViewOptions:Qp,minZoom:$,maxZoom:Z,nodeOrigin:Pi,nodeExtent:Se,zIndexMode:ef,children:[G.jsx(Q3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:p,onConnectStart:f,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,nodesDraggable:Xe,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:mn,edgesFocusable:Ai,edgesReconnectable:Ii,elementsSelectable:co,elevateNodesOnSelect:v1,elevateEdgesOnSelect:w1,minZoom:$,maxZoom:Z,nodeExtent:Se,onNodesChange:u1,onEdgesChange:c1,snapToGrid:oe,snapGrid:ge,connectionMode:F,translateExtent:he,connectOnClick:p1,defaultEdgeOptions:g1,fitView:qp,fitViewOptions:Qp,onNodesDelete:C,onEdgesDelete:I,onDelete:L,onNodeDragStart:E,onNodeDrag:S,onNodeDragStop:T,onSelectionDrag:P,onSelectionDragStart:D,onSelectionDragStop:A,onMove:d,onMoveStart:c,onMoveEnd:h,noPanClassName:Zp,nodeOrigin:Pi,rfId:Du,autoPanOnConnect:b1,autoPanOnNodeDrag:y1,autoPanSpeed:x1,onError:S1,connectionRadius:_1,isValidConnection:k1,selectNodesOnDrag:ye,nodeDragThreshold:E1,connectionDragThreshold:D1,onBeforeDelete:x,debug:T1,ariaLabelConfig:M1,zIndexMode:ef}),G.jsx(gV,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:_,nodeTypes:o,edgeTypes:s,connectionLineType:H,connectionLineStyle:z,connectionLineComponent:X,connectionLineContainerStyle:q,selectionKeyCode:K,selectionOnDrag:Y,selectionMode:Q,deleteKeyCode:U,multiSelectionKeyCode:le,panActivationKeyCode:de,zoomActivationKeyCode:se,onlyRenderVisibleElements:Ee,defaultViewport:hr,translateExtent:he,minZoom:$,maxZoom:Z,preventScrolling:ve,zoomOnScroll:In,zoomOnPinch:Xt,zoomOnDoubleClick:Zn,panOnScroll:Ni,panOnScrollSpeed:Ti,panOnScrollMode:pt,panOnDrag:Zt,onPaneClick:j_,onPaneMouseEnter:U_,onPaneMouseMove:Y_,onPaneMouseLeave:X_,onPaneScroll:Z_,onPaneContextMenu:q_,paneClickDistance:Q_,nodeClickDistance:K_,onSelectionContextMenu:O,onSelectionStart:N,onSelectionEnd:M,onReconnect:e1,onReconnectStart:t1,onReconnectEnd:n1,onEdgeContextMenu:i1,onEdgeDoubleClick:r1,onEdgeMouseEnter:o1,onEdgeMouseMove:s1,onEdgeMouseLeave:a1,reconnectRadius:l1,defaultMarkerColor:Dt,noDragClassName:d1,noWheelClassName:h1,noPanClassName:Zp,rfId:Du,disableKeyboardA11y:Kp,nodeExtent:Se,viewport:z1,onViewportChange:P1}),G.jsx(Y3,{onSelectionChange:V}),J_,G.jsx(B3,{proOptions:m1,position:f1}),G.jsx(G3,{rfId:Du,disableKeyboardA11y:Kp})]})})}var a8=w_(xV);function _V({dimensions:e,lineWidth:t,variant:n,className:i}){return G.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ye(["react-flow__background-pattern",n,i])})}function kV({radius:e,className:t}){return G.jsx("circle",{cx:e,cy:e,r:e,className:Ye(["react-flow__background-pattern","dots",t])})}var yi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(yi||(yi={}));const SV={[yi.Dots]:1,[yi.Lines]:1,[yi.Cross]:6},CV=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function B_({id:e,variant:t=yi.Dots,gap:n=20,size:i,lineWidth:r=1,offset:o=0,color:s,bgColor:a,style:l,className:u,patternClassName:d}){const c=R.useRef(null),{transform:h,patternId:p}=_e(CV,Me),f=i||SV[t],v=t===yi.Dots,b=t===yi.Cross,m=Array.isArray(n)?n:[n,n],w=[m[0]*h[2]||1,m[1]*h[2]||1],g=f*h[2],y=Array.isArray(o)?o:[o,o],k=b?[g,g]:w,_=[y[0]*h[2]||1+k[0]/2,y[1]*h[2]||1+k[1]/2],E=`${p}${e||""}`;return G.jsxs("svg",{className:Ye(["react-flow__background",u]),style:{...l,...Cu,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[G.jsx("pattern",{id:E,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?G.jsx(kV,{radius:g/2,className:d}):G.jsx(_V,{dimensions:k,lineWidth:r,variant:t,className:d})}),G.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}B_.displayName="Background";const l8=R.memo(B_);function EV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:G.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function DV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:G.jsx("path",{d:"M0 0h32v4.2H0z"})})}function zV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:G.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function PV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function AV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ea({children:e,className:t,...n}){return G.jsx("button",{type:"button",className:Ye(["react-flow__controls-button",t]),...n,children:e})}const IV=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $_({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:d,position:c="bottom-left",orientation:h="vertical","aria-label":p}){const f=Le(),{isInteractive:v,minZoomReached:b,maxZoomReached:m,ariaLabelConfig:w}=_e(IV,Me),{zoomIn:g,zoomOut:y,fitView:k}=Yp(),_=()=>{g(),o==null||o()},E=()=>{y(),s==null||s()},S=()=>{k(r),a==null||a()},T=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},C=h==="horizontal"?"horizontal":"vertical";return G.jsxs(Su,{className:Ye(["react-flow__controls",C,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":p??w["controls.ariaLabel"],children:[t&&G.jsxs(G.Fragment,{children:[G.jsx(Ea,{onClick:_,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:m,children:G.jsx(EV,{})}),G.jsx(Ea,{onClick:E,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:b,children:G.jsx(DV,{})})]}),n&&G.jsx(Ea,{className:"react-flow__controls-fitview",onClick:S,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:G.jsx(zV,{})}),i&&G.jsx(Ea,{className:"react-flow__controls-interactive",onClick:T,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:v?G.jsx(AV,{}):G.jsx(PV,{})}),d]})}$_.displayName="Controls";const u8=R.memo($_);function NV({id:e,x:t,y:n,width:i,height:r,style:o,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:d,shapeRendering:c,selected:h,onClick:p}){const{background:f,backgroundColor:v}=o||{},b=s||f||v;return G.jsx("rect",{className:Ye(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:b,stroke:a,strokeWidth:l},shapeRendering:c,onClick:p?m=>p(m,e):void 0})}const TV=R.memo(NV),MV=e=>e.nodes.map(t=>t.id),zc=e=>e instanceof Function?e:()=>e;function LV({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:o=TV,onClick:s}){const a=_e(MV,Me),l=zc(t),u=zc(e),d=zc(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return G.jsx(G.Fragment,{children:a.map(h=>G.jsx(RV,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:o,onClick:s,shapeRendering:c},h))})}function OV({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:d,y:c,width:h,height:p}=_e(f=>{const v=f.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const b=v.internals.userNode,{x:m,y:w}=v.internals.positionAbsolute,{width:g,height:y}=Xn(b);return{node:b,x:m,y:w,width:g,height:y}},Me);return!u||u.hidden||!Bx(u)?null:G.jsx(a,{x:d,y:c,width:h,height:p,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:o,shapeRendering:s,onClick:l,id:u.id})}const RV=R.memo(OV);var VV=R.memo(LV);const FV=200,HV=150,GV=e=>!e.hidden,BV=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Gx(Fs(e.nodeLookup,{filter:GV}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},$V="react-flow__minimap-desc";function W_({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:h="bottom-right",onClick:p,onNodeClick:f,pannable:v=!1,zoomable:b=!1,ariaLabel:m,inversePan:w,zoomStep:g=1,offsetScale:y=5}){const k=Le(),_=R.useRef(null),{boundingRect:E,viewBB:S,rfId:T,panZoom:C,translateExtent:I,flowWidth:L,flowHeight:V,ariaLabelConfig:D}=_e(BV,Me),P=(e==null?void 0:e.width)??FV,A=(e==null?void 0:e.height)??HV,O=E.width/P,N=E.height/A,M=Math.max(O,N),x=M*P,F=M*A,H=y*M,z=E.x-(x-E.width)/2-H,X=E.y-(F-E.height)/2-H,q=x+H*2,U=F+H*2,K=`${$V}-${T}`,Y=R.useRef(0),Q=R.useRef();Y.current=M,R.useEffect(()=>{if(_.current&&C)return Q.current=X5({domNode:_.current,panZoom:C,getTransform:()=>k.getState().transform,getViewScale:()=>Y.current}),()=>{var oe;(oe=Q.current)==null||oe.destroy()}},[C]),R.useEffect(()=>{var oe;(oe=Q.current)==null||oe.update({translateExtent:I,width:L,height:V,inversePan:w,pannable:v,zoomStep:g,zoomable:b})},[v,b,w,g,I,L,V]);const de=p?oe=>{var ye;const[ge,Ee]=((ye=Q.current)==null?void 0:ye.pointer(oe))||[0,0];p(oe,{x:ge,y:Ee})}:void 0,le=f?R.useCallback((oe,ge)=>{const Ee=k.getState().nodeLookup.get(ge).internals.userNode;f(oe,Ee)},[]):void 0,se=m??D["minimap.ariaLabel"];return G.jsx(Su,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*M:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ye(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:G.jsxs("svg",{width:P,height:A,viewBox:`${z} ${X} ${q} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:_,onClick:de,children:[se&&G.jsx("title",{id:K,children:se}),G.jsx(VV,{onClick:le,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),G.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-H},${X-H}h${q+H*2}v${U+H*2}h${-q-H*2}z
|
|
2745
|
-
M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W_.displayName="MiniMap";const
|
|
2744
|
+
`)),d=u.reduce((c,h)=>c.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(t==null?void 0:t.target)??Ev,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var b,m;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&jx(p))return!1;const v=zv(p.code,a);if(o.current.add(p[v]),Dv(s,o.current,!1)){const w=((m=(b=p.composedPath)==null?void 0:b.call(p))==null?void 0:m[0])||p.target,g=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!g)&&p.preventDefault(),i(!0)}},c=p=>{const f=zv(p.code,a);Dv(s,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(p[f]),p.key==="Meta"&&o.current.clear(),r.current=!1},h=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Dv(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function zv(e,t){return t.includes(e)?"code":"key"}const J3=()=>{const e=Le();return R.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:o,maxZoom:s,panZoom:a}=e.getState(),l=Hp(t,i,r,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:o,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},d=n.snapGrid??r,c=n.snapToGrid??o;return Gs(u,i,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:o}=i.getBoundingClientRect(),s=Ll(t,n);return{x:s.x+r,y:s.y+o}}}),[])};function v_(e,t){const n=[],i=new Map,r=[];for(const o of e)if(o.type==="add"){r.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const s=i.get(o.id);s?s.push(o):i.set(o.id,[o])}for(const o of t){const s=i.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...o};for(const l of s)e4(l,a);n.push(a)}return r.length&&r.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function e4(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function t4(e,t){return v_(e,t)}function n4(e,t){return v_(e,t)}function Fi(e,t){return{id:e,type:"select",selected:t}}function Nr(e,t=new Set,n=!1){const i=[];for(const[r,o]of e){const s=t.has(r);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),i.push(Fi(o.id,s)))}return i}function Pv({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const a=t.get(s.id),l=((r=a==null?void 0:a.internals)==null?void 0:r.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)i.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Av(e){return{id:e.id,type:"remove"}}const Iv=e=>c5(e),i4=e=>Vx(e);function w_(e){return R.forwardRef(e)}function Nv(e){const[t,n]=R.useState(BigInt(0)),[i]=R.useState(()=>r4(()=>n(r=>r+BigInt(1))));return oh(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function r4(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const b_=R.createContext(null);function o4({children:e}){const t=Le(),n=R.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:f}=t.getState();let v=l;for(const m of a)v=typeof m=="function"?m(v):m;let b=Pv({items:v,lookup:h});for(const m of f.values())b=m(b);d&&u(v),b.length>0?c==null||c(b):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:w,setNodes:g}=t.getState();m&&g(w)})},[]),i=Nv(n),r=R.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:h}=t.getState();let p=l;for(const f of a)p=typeof f=="function"?f(p):f;d?u(p):c&&c(Pv({items:p,lookup:h}))},[]),o=Nv(r),s=R.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return G.jsx(b_.Provider,{value:s,children:e})}function s4(){const e=R.useContext(b_);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const a4=e=>!!e.panZoom;function Xp(){const e=J3(),t=Le(),n=s4(),i=xe(a4),r=R.useMemo(()=>{const o=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},l=c=>{var m,w;const{nodeLookup:h,nodeOrigin:p}=t.getState(),f=Iv(c)?c:h.get(c.id),v=f.parentId?$x(f.position,f.measured,f.parentId,h,p):f.position,b={...f,position:v,width:((m=f.measured)==null?void 0:m.width)??f.width,height:((w=f.measured)==null?void 0:w.height)??f.height};return eo(b)},u=(c,h,p={replace:!1})=>{s(f=>f.map(v=>{if(v.id===c){const b=typeof h=="function"?h(v):h;return p.replace&&Iv(b)?b:{...v,...b}}return v}))},d=(c,h,p={replace:!1})=>{a(f=>f.map(v=>{if(v.id===c){const b=typeof h=="function"?h(v):h;return p.replace&&i4(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var h;return(h=o(c))==null?void 0:h.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(h=>({...h}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const h=Array.isArray(c)?c:[c];n.nodeQueue.push(p=>[...p,...h])},addEdges:c=>{const h=Array.isArray(c)?c:[c];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:c=[],edges:h=[],transform:p}=t.getState(),[f,v,b]=p;return{nodes:c.map(m=>({...m})),edges:h.map(m=>({...m})),viewport:{x:f,y:v,zoom:b}}},deleteElements:async({nodes:c=[],edges:h=[]})=>{const{nodes:p,edges:f,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:m,triggerEdgeChanges:w,onDelete:g,onBeforeDelete:y}=t.getState(),{nodes:k,edges:_}=await m5({nodesToRemove:c,edgesToRemove:h,nodes:p,edges:f,onBeforeDelete:y}),E=_.length>0,S=k.length>0;if(E){const T=_.map(Av);b==null||b(_),w(T)}if(S){const T=k.map(Av);v==null||v(k),m(T)}return(S||E)&&(g==null||g({nodes:k,edges:_})),{deletedNodes:k,deletedEdges:_}},getIntersectingNodes:(c,h=!0,p)=>{const f=av(c),v=f?c:l(c),b=p!==void 0;return v?(p||t.getState().nodes).filter(m=>{const w=t.getState().nodeLookup.get(m.id);if(w&&!f&&(m.id===c.id||!w.internals.positionAbsolute))return!1;const g=eo(b?m:w),y=_s(g,v);return h&&y>0||y>=g.width*g.height||y>=v.width*v.height}):[]},isNodeIntersecting:(c,h,p=!0)=>{const v=av(c)?c:l(c);if(!v)return!1;const b=_s(v,h);return p&&b>0||b>=h.width*h.height||b>=v.width*v.height},updateNode:u,updateNodeData:(c,h,p={replace:!1})=>{u(c,f=>{const v=typeof h=="function"?h(f):h;return p.replace?{...f,data:v}:{...f,data:{...f.data,...v}}},p)},updateEdge:d,updateEdgeData:(c,h,p={replace:!1})=>{d(c,f=>{const v=typeof h=="function"?h(f):h;return p.replace?{...f,data:v}:{...f,data:{...f.data,...v}}},p)},getNodesBounds:c=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return d5(c,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:c,id:h,nodeId:p})=>{var f;return Array.from(((f=t.getState().connectionLookup.get(`${p}-${c}${h?`-${h}`:""}`))==null?void 0:f.values())??[])},getNodeConnections:({type:c,handleId:h,nodeId:p})=>{var f;return Array.from(((f=t.getState().connectionLookup.get(`${p}${c?h?`-${c}-${h}`:`-${c}`:""}`))==null?void 0:f.values())??[])},fitView:async c=>{const h=t.getState().fitViewResolver??b5();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return R.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const Tv=e=>e.selected,l4=typeof window<"u"?window:void 0;function u4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Le(),{deleteElements:i}=Xp(),r=Ss(e,{actInsideInputWithModifier:!1}),o=Ss(t,{target:l4});R.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();i({nodes:a.filter(Tv),edges:s.filter(Tv)}),n.setState({nodesSelectionActive:!1})}},[r]),R.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function c4(e){const t=Le();R.useEffect(()=>{const n=()=>{var r,o,s,a;if(!e.current||!(((o=(r=e.current).checkVisibility)==null?void 0:o.call(r))??!0))return!1;const i=Bp(e.current);(i.height===0||i.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",zn.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const Cu={position:"absolute",width:"100%",height:"100%",top:0,left:0},d4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function h4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:o=qi.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:h,preventScrolling:p=!0,children:f,noWheelClassName:v,noPanClassName:b,onViewportChange:m,isControlledViewport:w,paneClickDistance:g,selectionOnDrag:y}){const k=Le(),_=R.useRef(null),{userSelectionActive:E,lib:S,connectionInProgress:T}=xe(d4,Me),C=Ss(h),I=R.useRef();c4(_);const L=R.useCallback(V=>{m==null||m({x:V[0],y:V[1],zoom:V[2]}),w||k.setState({transform:V})},[m,w]);return R.useEffect(()=>{if(_.current){I.current=n3({domNode:_.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:l,onDraggingChange:A=>k.setState(O=>O.paneDragging===A?O:{paneDragging:A}),onPanZoomStart:(A,O)=>{const{onViewportChangeStart:N,onMoveStart:M}=k.getState();M==null||M(A,O),N==null||N(O)},onPanZoom:(A,O)=>{const{onViewportChange:N,onMove:M}=k.getState();M==null||M(A,O),N==null||N(O)},onPanZoomEnd:(A,O)=>{const{onViewportChangeEnd:N,onMoveEnd:M}=k.getState();M==null||M(A,O),N==null||N(O)}});const{x:V,y:D,zoom:P}=I.current.getViewport();return k.setState({panZoom:I.current,transform:[V,D,P],domNode:_.current.closest(".react-flow")}),()=>{var A;(A=I.current)==null||A.destroy()}}},[]),R.useEffect(()=>{var V;(V=I.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:C,preventScrolling:p,noPanClassName:b,userSelectionActive:E,noWheelClassName:v,lib:S,onTransformChange:L,connectionInProgress:T,selectionOnDrag:y,paneClickDistance:g})},[e,t,n,i,r,o,s,a,C,p,b,E,v,S,L,T,y,g]),G.jsx("div",{className:"react-flow__renderer",ref:_,style:Cu,children:f})}const p4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f4(){const{userSelectionActive:e,userSelectionRect:t}=xe(p4,Me);return e&&t?G.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Dc=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},m4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function g4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xs.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:h,onPaneMouseLeave:p,children:f}){const v=Le(),{userSelectionActive:b,elementsSelectable:m,dragging:w,connectionInProgress:g}=xe(m4,Me),y=m&&(e||b),k=R.useRef(null),_=R.useRef(),E=R.useRef(new Set),S=R.useRef(new Set),T=R.useRef(!1),C=N=>{if(T.current||g){T.current=!1;return}l==null||l(N),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},I=N=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){N.preventDefault();return}u==null||u(N)},L=d?N=>d(N):void 0,V=N=>{T.current&&(N.stopPropagation(),T.current=!1)},D=N=>{var q,U;const{domNode:M}=v.getState();if(_.current=M==null?void 0:M.getBoundingClientRect(),!_.current)return;const x=N.target===k.current;if(!x&&!!N.target.closest(".nokey")||!e||!(o&&x||t)||N.button!==0||!N.isPrimary)return;(U=(q=N.target)==null?void 0:q.setPointerCapture)==null||U.call(q,N.pointerId),T.current=!1;const{x:z,y:X}=sn(N.nativeEvent,_.current);v.setState({userSelectionRect:{width:0,height:0,startX:z,startY:X,x:z,y:X}}),x||(N.stopPropagation(),N.preventDefault())},P=N=>{const{userSelectionRect:M,transform:x,nodeLookup:F,edgeLookup:H,connectionLookup:z,triggerNodeChanges:X,triggerEdgeChanges:q,defaultEdgeOptions:U,resetSelectedElements:K}=v.getState();if(!_.current||!M)return;const{x:Y,y:Q}=sn(N.nativeEvent,_.current),{startX:de,startY:le}=M;if(!T.current){const ye=t?0:r;if(Math.hypot(Y-de,Q-le)<=ye)return;K(),s==null||s(N)}T.current=!0;const se={startX:de,startY:le,x:Y<de?Y:de,y:Q<le?Q:le,width:Math.abs(Y-de),height:Math.abs(Q-le)},oe=E.current,ge=S.current;E.current=new Set(Fp(F,se,x,n===xs.Partial,!0).map(ye=>ye.id)),S.current=new Set;const Ee=(U==null?void 0:U.selectable)??!0;for(const ye of E.current){const Xe=z.get(ye);if(Xe)for(const{edgeId:fn}of Xe.values()){const Vt=H.get(fn);Vt&&(Vt.selectable??Ee)&&S.current.add(fn)}}if(!lv(oe,E.current)){const ye=Nr(F,E.current,!0);X(ye)}if(!lv(ge,S.current)){const ye=Nr(H,S.current);q(ye)}v.setState({userSelectionRect:se,userSelectionActive:!0,nodesSelectionActive:!1})},A=N=>{var M,x;N.button===0&&((x=(M=N.target)==null?void 0:M.releasePointerCapture)==null||x.call(M,N.pointerId),!b&&N.target===k.current&&v.getState().userSelectionRect&&(C==null||C(N)),v.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(a==null||a(N),v.setState({nodesSelectionActive:E.current.size>0})))},O=i===!0||Array.isArray(i)&&i.includes(0);return G.jsxs("div",{className:Ye(["react-flow__pane",{draggable:O,dragging:w,selection:e}]),onClick:y?void 0:Dc(C,k),onContextMenu:Dc(I,k),onWheel:Dc(L,k),onPointerEnter:y?void 0:c,onPointerMove:y?P:h,onPointerUp:y?A:void 0,onPointerDownCapture:y?D:void 0,onClickCapture:y?V:void 0,onPointerLeave:p,ref:k,style:Cu,children:[f,G.jsx(f4,{})]})}function sh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",zn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function y_({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:o,nodeClickDistance:s}){const a=Le(),[l,u]=R.useState(!1),d=R.useRef();return R.useEffect(()=>{d.current=B5({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{sh({id:c,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:o,nodeId:r,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,i,t,o,e,r,s]),l}const v4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function x_(){const e=Le();return R.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,h=v4(s),p=r?o[0]:5,f=r?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*f*n.factor;for(const[,m]of u){if(!h(m))continue;let w={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+b};r&&(w=Hs(w,o));const{position:g,positionAbsolute:y}=Fx({nodeId:m.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:a});m.position=g,m.internals.positionAbsolute=y,c.set(m.id,m)}l(c)},[])}const Zp=R.createContext(null),w4=Zp.Provider;Zp.Consumer;const __=()=>R.useContext(Zp),b4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),y4=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:o,connection:s}=i,{fromHandle:a,toHandle:l,isValid:u}=s,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:o===Kr.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:d&&u}};function x4({type:e="source",position:t=ae.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:c,...h},p){var P,A;const f=s||null,v=e==="target",b=Le(),m=__(),{connectOnClick:w,noPanClassName:g,rfId:y}=xe(b4,Me),{connectingFrom:k,connectingTo:_,clickConnecting:E,isPossibleEndHandle:S,connectionInProcess:T,clickConnectionInProcess:C,valid:I}=xe(y4(m,f,e),Me);m||(A=(P=b.getState()).onError)==null||A.call(P,"010",zn.error010());const L=O=>{const{defaultEdgeOptions:N,onConnect:M,hasDefaultEdges:x}=b.getState(),F={...N,...O};if(x){const{edges:H,setEdges:z}=b.getState();z(E5(F,H))}M==null||M(F),a==null||a(F)},V=O=>{if(!m)return;const N=Ux(O.nativeEvent);if(r&&(N&&O.button===0||!N)){const M=b.getState();rh.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:f,nodeId:m,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...x)=>{var F,H;return(H=(F=b.getState()).onConnectEnd)==null?void 0:H.call(F,...x)},updateConnection:M.updateConnection,onConnect:L,isValidConnection:n||((...x)=>{var F,H;return((H=(F=b.getState()).isValidConnection)==null?void 0:H.call(F,...x))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}N?d==null||d(O):c==null||c(O)},D=O=>{const{onClickConnectStart:N,onClickConnectEnd:M,connectionClickStartHandle:x,connectionMode:F,isValidConnection:H,lib:z,rfId:X,nodeLookup:q,connection:U}=b.getState();if(!m||!x&&!r)return;if(!x){N==null||N(O.nativeEvent,{nodeId:m,handleId:f,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:m,type:e,id:f}});return}const K=Wx(O.target),Y=n||H,{connection:Q,isValid:de}=rh.isValid(O.nativeEvent,{handle:{nodeId:m,id:f,type:e},connectionMode:F,fromNodeId:x.nodeId,fromHandleId:x.id||null,fromType:x.type,isValidConnection:Y,flowId:X,doc:K,lib:z,nodeLookup:q});de&&Q&&L(Q);const le=structuredClone(U);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,M==null||M(O,le),b.setState({connectionClickStartHandle:null})};return G.jsx("div",{"data-handleid":f,"data-nodeid":m,"data-handlepos":t,"data-id":`${y}-${m}-${f}-${e}`,className:Ye(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!v,target:v,connectable:i,connectablestart:r,connectableend:o,clickconnecting:E,connectingfrom:k,connectingto:_,valid:I,connectionindicator:i&&(!T||S)&&(T||C?o:r)}]),onMouseDown:V,onTouchStart:V,onClick:w?D:void 0,ref:p,...h,children:l})}const Ol=R.memo(w_(x4));function _4({data:e,isConnectable:t,sourcePosition:n=ae.Bottom}){return G.jsxs(G.Fragment,{children:[e==null?void 0:e.label,G.jsx(Ol,{type:"source",position:n,isConnectable:t})]})}function k4({data:e,isConnectable:t,targetPosition:n=ae.Top,sourcePosition:i=ae.Bottom}){return G.jsxs(G.Fragment,{children:[G.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,G.jsx(Ol,{type:"source",position:i,isConnectable:t})]})}function S4(){return null}function C4({data:e,isConnectable:t,targetPosition:n=ae.Top}){return G.jsxs(G.Fragment,{children:[G.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Rl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Mv={input:_4,default:k4,output:C4,group:S4};function E4(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const D4=e=>{const{width:t,height:n,x:i,y:r}=Fs(e.nodeLookup,{filter:o=>!!o.selected});return{width:on(t)?t:null,height:on(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function z4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Le(),{width:r,height:o,transformString:s,userSelectionActive:a}=xe(D4,Me),l=x_(),u=R.useRef(null);R.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!a&&r!==null&&o!==null;if(y_({nodeRef:u,disabled:!d}),!d)return null;const c=e?p=>{const f=i.getState().nodes.filter(v=>v.selected);e(p,f)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Rl,p.key)&&(p.preventDefault(),l({direction:Rl[p.key],factor:p.shiftKey?4:1}))};return G.jsx("div",{className:Ye(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:G.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:o}})})}const Lv=typeof window<"u"?window:void 0,P4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function k_({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:f,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:g,panOnScroll:y,panOnScrollSpeed:k,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:S,defaultViewport:T,translateExtent:C,minZoom:I,maxZoom:L,preventScrolling:V,onSelectionContextMenu:D,noWheelClassName:P,noPanClassName:A,disableKeyboardA11y:O,onViewportChange:N,isControlledViewport:M}){const{nodesSelectionActive:x,userSelectionActive:F}=xe(P4,Me),H=Ss(u,{target:Lv}),z=Ss(v,{target:Lv}),X=z||S,q=z||y,U=d&&X!==!0,K=H||F||U;return u4({deleteKeyCode:l,multiSelectionKeyCode:f}),G.jsx(h4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:g,panOnScroll:q,panOnScrollSpeed:k,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:!H&&X,defaultViewport:T,translateExtent:C,minZoom:I,maxZoom:L,zoomActivationKeyCode:b,preventScrolling:V,noWheelClassName:P,noPanClassName:A,onViewportChange:N,isControlledViewport:M,paneClickDistance:a,selectionOnDrag:U,children:G.jsxs(g4,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:X,isSelecting:!!K,selectionMode:c,selectionKeyPressed:H,paneClickDistance:a,selectionOnDrag:U,children:[e,x&&G.jsx(z4,{onSelectionContextMenu:D,noPanClassName:A,disableKeyboardA11y:O})]})})}k_.displayName="FlowRenderer";const A4=R.memo(k_),I4=e=>t=>e?Fp(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function N4(e){return xe(R.useCallback(I4(e),[e]),Me)}const T4=e=>e.updateNodeInternals;function M4(){const e=xe(T4),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const o=r.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:r.target,force:!0})}),e(i)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function L4({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Le(),o=R.useRef(null),s=R.useRef(null),a=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(t),d=n&&!!e.internals.handleBounds;return R.useEffect(()=>{o.current&&!e.hidden&&(!d||s.current!==o.current)&&(s.current&&(i==null||i.unobserve(s.current)),i==null||i.observe(o.current),s.current=o.current)},[d,e.hidden]),R.useEffect(()=>()=>{s.current&&(i==null||i.unobserve(s.current),s.current=null)},[]),R.useEffect(()=>{if(o.current){const c=u.current!==t,h=a.current!==e.sourcePosition,p=l.current!==e.targetPosition;(c||h||p)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function O4({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:f,rfId:v,nodeTypes:b,nodeClickDistance:m,onError:w}){const{node:g,internals:y,isParent:k}=xe(Y=>{const Q=Y.nodeLookup.get(e),de=Y.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:de}},Me);let _=g.type||"default",E=(b==null?void 0:b[_])||Mv[_];E===void 0&&(w==null||w("003",zn.error003(_)),_="default",E=(b==null?void 0:b.default)||Mv.default);const S=!!(g.draggable||a&&typeof g.draggable>"u"),T=!!(g.selectable||l&&typeof g.selectable>"u"),C=!!(g.connectable||u&&typeof g.connectable>"u"),I=!!(g.focusable||d&&typeof g.focusable>"u"),L=Le(),V=Gp(g),D=L4({node:g,nodeType:_,hasDimensions:V,resizeObserver:c}),P=y_({nodeRef:D,disabled:g.hidden||!S,noDragClassName:h,handleSelector:g.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:m}),A=x_();if(g.hidden)return null;const O=Xn(g),N=E4(g),M=T||S||t||n||i||r,x=n?Y=>n(Y,{...y.userNode}):void 0,F=i?Y=>i(Y,{...y.userNode}):void 0,H=r?Y=>r(Y,{...y.userNode}):void 0,z=o?Y=>o(Y,{...y.userNode}):void 0,X=s?Y=>s(Y,{...y.userNode}):void 0,q=Y=>{const{selectNodesOnDrag:Q,nodeDragThreshold:de}=L.getState();T&&(!Q||!S||de>0)&&sh({id:e,store:L,nodeRef:D}),t&&t(Y,{...y.userNode})},U=Y=>{if(!(jx(Y.nativeEvent)||f)){if(Mx.includes(Y.key)&&T){const Q=Y.key==="Escape";sh({id:e,store:L,unselect:Q,nodeRef:D})}else if(S&&g.selected&&Object.prototype.hasOwnProperty.call(Rl,Y.key)){Y.preventDefault();const{ariaLabelConfig:Q}=L.getState();L.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:Y.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),A({direction:Rl[Y.key],factor:Y.shiftKey?4:1})}}},K=()=>{var ge;if(f||!((ge=D.current)!=null&&ge.matches(":focus-visible")))return;const{transform:Y,width:Q,height:de,autoPanOnNodeFocus:le,setCenter:se}=L.getState();if(!le)return;Fp(new Map([[e,g]]),{x:0,y:0,width:Q,height:de},Y,!0).length>0||se(g.position.x+O.width/2,g.position.y+O.height/2,{zoom:Y[2]})};return G.jsx("div",{className:Ye(["react-flow__node",`react-flow__node-${_}`,{[p]:S},g.className,{selected:g.selected,selectable:T,parent:k,draggable:S,dragging:P}]),ref:D,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:V?"visible":"hidden",...g.style,...N},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:x,onMouseMove:F,onMouseLeave:H,onContextMenu:z,onClick:q,onDoubleClick:X,onKeyDown:I?U:void 0,tabIndex:I?0:void 0,onFocus:I?K:void 0,role:g.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":f?void 0:`${f_}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:G.jsx(w4,{value:e,children:G.jsx(E,{id:e,data:g.data,type:_,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:g.selected??!1,selectable:T,draggable:S,deletable:g.deletable??!0,isConnectable:C,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:P,dragHandle:g.dragHandle,zIndex:y.z,parentId:g.parentId,...O})})})}var R4=R.memo(O4);const V4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function S_(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:o}=xe(V4,Me),s=N4(e.onlyRenderVisibleElements),a=M4();return G.jsx("div",{className:"react-flow__nodes",style:Cu,children:s.map(l=>G.jsx(R4,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}S_.displayName="NodeRenderer";const F4=R.memo(S_);function H4(e){return xe(R.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const o=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);o&&s&&k5({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Me)}const G4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return G.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},B4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return G.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ov={[Tl.Arrow]:G4,[Tl.ArrowClosed]:B4};function $4(e){const t=Le();return R.useMemo(()=>{var r,o;return Object.prototype.hasOwnProperty.call(Ov,e)?Ov[e]:((o=(r=t.getState()).onError)==null||o.call(r,"009",zn.error009(e)),null)},[e])}const W4=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=$4(t);return l?G.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:G.jsx(l,{color:n,strokeWidth:s})}):null},C_=({defaultColor:e,rfId:t})=>{const n=xe(o=>o.edges),i=xe(o=>o.defaultEdgeOptions),r=R.useMemo(()=>I5(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?G.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:G.jsx("defs",{children:r.map(o=>G.jsx(W4,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};C_.displayName="MarkerDefinitions";var j4=R.memo(C_);function E_({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d}){const[c,h]=R.useState({x:1,y:0,width:0,height:0}),p=Ye(["react-flow__edge-textwrapper",u]),f=R.useRef(null);return R.useEffect(()=>{if(f.current){const v=f.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?G.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:p,visibility:c.width?"visible":"hidden",...d,children:[r&&G.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),G.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:f,style:i,children:n}),l]}):null}E_.displayName="EdgeText";const U4=R.memo(E_);function Eu({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return G.jsxs(G.Fragment,{children:[G.jsx("path",{...d,d:e,fill:"none",className:Ye(["react-flow__edge-path",d.className])}),u?G.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&on(t)&&on(n)?G.jsx(U4,{x:t,y:n,label:i,labelStyle:r,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Rv({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===ae.Left||e===ae.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function D_({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top}){const[s,a]=Rv({pos:n,x1:e,y1:t,x2:i,y2:r}),[l,u]=Rv({pos:o,x1:i,y1:r,x2:e,y2:t}),[d,c,h,p]=Yx({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${i},${r}`,d,c,h,p]}function z_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:m})=>{const[w,g,y]=D_({sourceX:n,sourceY:i,sourcePosition:s,targetX:r,targetY:o,targetPosition:a}),k=e.isInternal?void 0:t;return G.jsx(Eu,{id:k,path:w,labelX:g,labelY:y,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:m})})}const Y4=z_({isInternal:!1}),P_=z_({isInternal:!0});Y4.displayName="SimpleBezierEdge";P_.displayName="SimpleBezierEdgeInternal";function A_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,sourcePosition:p=ae.Bottom,targetPosition:f=ae.Top,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:w})=>{const[g,y,k]=th({sourceX:n,sourceY:i,sourcePosition:p,targetX:r,targetY:o,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),_=e.isInternal?void 0:t;return G.jsx(Eu,{id:_,path:g,labelX:y,labelY:k,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:v,markerStart:b,interactionWidth:w})})}const I_=A_({isInternal:!1}),N_=A_({isInternal:!0});I_.displayName="SmoothStepEdge";N_.displayName="SmoothStepEdgeInternal";function T_(e){return R.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return G.jsx(I_,{...n,id:i,pathOptions:R.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const X4=T_({isInternal:!1}),M_=T_({isInternal:!0});X4.displayName="StepEdge";M_.displayName="StepEdgeInternal";function L_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:p,markerStart:f,interactionWidth:v})=>{const[b,m,w]=qx({sourceX:n,sourceY:i,targetX:r,targetY:o}),g=e.isInternal?void 0:t;return G.jsx(Eu,{id:g,path:b,labelX:m,labelY:w,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:p,markerStart:f,interactionWidth:v})})}const Z4=L_({isInternal:!1}),O_=L_({isInternal:!0});Z4.displayName="StraightEdge";O_.displayName="StraightEdgeInternal";function R_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,sourcePosition:s=ae.Bottom,targetPosition:a=ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:w})=>{const[g,y,k]=Xx({sourceX:n,sourceY:i,sourcePosition:s,targetX:r,targetY:o,targetPosition:a,curvature:m==null?void 0:m.curvature}),_=e.isInternal?void 0:t;return G.jsx(Eu,{id:_,path:g,labelX:y,labelY:k,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:w})})}const q4=R_({isInternal:!1}),V_=R_({isInternal:!0});q4.displayName="BezierEdge";V_.displayName="BezierEdgeInternal";const Vv={default:V_,straight:O_,step:M_,smoothstep:N_,simplebezier:P_},Fv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Q4=(e,t,n)=>n===ae.Left?e-t:n===ae.Right?e+t:e,K4=(e,t,n)=>n===ae.Top?e-t:n===ae.Bottom?e+t:e,Hv="react-flow__edgeupdater";function Gv({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:o,onMouseOut:s,type:a}){return G.jsx("circle",{onMouseDown:r,onMouseEnter:o,onMouseOut:s,className:Ye([Hv,`${Hv}-${a}`]),cx:Q4(t,i,e),cy:K4(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function J4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:o,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:h,setUpdateHover:p}){const f=Le(),v=(y,k)=>{if(y.button!==0)return;const{autoPanOnConnect:_,domNode:E,connectionMode:S,connectionRadius:T,lib:C,onConnectStart:I,cancelConnection:L,nodeLookup:V,rfId:D,panBy:P,updateConnection:A}=f.getState(),O=k.type==="target",N=(F,H)=>{h(!1),c==null||c(F,n,k.type,H)},M=F=>u==null?void 0:u(n,F),x=(F,H)=>{h(!0),d==null||d(y,n,k.type),I==null||I(F,H)};rh.onPointerDown(y.nativeEvent,{autoPanOnConnect:_,connectionMode:S,connectionRadius:T,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:V,isTarget:O,edgeUpdaterType:k.type,lib:C,flowId:D,cancelConnection:L,panBy:P,isValidConnection:(...F)=>{var H,z;return((z=(H=f.getState()).isValidConnection)==null?void 0:z.call(H,...F))??!0},onConnect:M,onConnectStart:x,onConnectEnd:(...F)=>{var H,z;return(z=(H=f.getState()).onConnectEnd)==null?void 0:z.call(H,...F)},onReconnectEnd:N,updateConnection:A,getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,dragThreshold:f.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},b=y=>v(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=y=>v(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>p(!0),g=()=>p(!1);return G.jsxs(G.Fragment,{children:[(e===!0||e==="source")&&G.jsx(Gv,{position:a,centerX:i,centerY:r,radius:t,onMouseDown:b,onMouseEnter:w,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&G.jsx(Gv,{position:l,centerX:o,centerY:s,radius:t,onMouseDown:m,onMouseEnter:w,onMouseOut:g,type:"target"})]})}function eV({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:p,rfId:f,edgeTypes:v,noPanClassName:b,onError:m,disableKeyboardA11y:w}){let g=xe(se=>se.edgeLookup.get(e));const y=xe(se=>se.defaultEdgeOptions);g=y?{...y,...g}:g;let k=g.type||"default",_=(v==null?void 0:v[k])||Vv[k];_===void 0&&(m==null||m("011",zn.error011(k)),k="default",_=(v==null?void 0:v.default)||Vv.default);const E=!!(g.focusable||t&&typeof g.focusable>"u"),S=typeof c<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),T=!!(g.selectable||i&&typeof g.selectable>"u"),C=R.useRef(null),[I,L]=R.useState(!1),[V,D]=R.useState(!1),P=Le(),{zIndex:A,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H}=xe(R.useCallback(se=>{const oe=se.nodeLookup.get(g.source),ge=se.nodeLookup.get(g.target);if(!oe||!ge)return{zIndex:g.zIndex,...Fv};const Ee=A5({id:e,sourceNode:oe,targetNode:ge,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:se.connectionMode,onError:m});return{zIndex:_5({selected:g.selected,zIndex:g.zIndex,sourceNode:oe,targetNode:ge,elevateOnSelect:se.elevateEdgesOnSelect,zIndexMode:se.zIndexMode}),...Ee||Fv}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),Me),z=R.useMemo(()=>g.markerStart?`url('#${nh(g.markerStart,f)}')`:void 0,[g.markerStart,f]),X=R.useMemo(()=>g.markerEnd?`url('#${nh(g.markerEnd,f)}')`:void 0,[g.markerEnd,f]);if(g.hidden||O===null||N===null||M===null||x===null)return null;const q=se=>{var ye;const{addSelectedEdges:oe,unselectNodesAndEdges:ge,multiSelectionActive:Ee}=P.getState();T&&(P.setState({nodesSelectionActive:!1}),g.selected&&Ee?(ge({nodes:[],edges:[g]}),(ye=C.current)==null||ye.blur()):oe([e])),r&&r(se,g)},U=o?se=>{o(se,{...g})}:void 0,K=s?se=>{s(se,{...g})}:void 0,Y=a?se=>{a(se,{...g})}:void 0,Q=l?se=>{l(se,{...g})}:void 0,de=u?se=>{u(se,{...g})}:void 0,le=se=>{var oe;if(!w&&Mx.includes(se.key)&&T){const{unselectNodesAndEdges:ge,addSelectedEdges:Ee}=P.getState();se.key==="Escape"?((oe=C.current)==null||oe.blur(),ge({edges:[g]})):Ee([e])}};return G.jsx("svg",{style:{zIndex:A},children:G.jsxs("g",{className:Ye(["react-flow__edge",`react-flow__edge-${k}`,g.className,b,{selected:g.selected,animated:g.animated,inactive:!T&&!r,updating:I,selectable:T}]),onClick:q,onDoubleClick:U,onContextMenu:K,onMouseEnter:Y,onMouseMove:Q,onMouseLeave:de,onKeyDown:E?le:void 0,tabIndex:E?0:void 0,role:g.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":E?`${m_}-${f}`:void 0,ref:C,...g.domAttributes,children:[!V&&G.jsx(_,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:T,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:z,markerEnd:X,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),S&&G.jsx(J4,{edge:g,isReconnectable:S,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:p,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H,setUpdateHover:L,setReconnecting:D})]})})}var tV=R.memo(eV);const nV=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function F_({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:f,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:m,elementsSelectable:w,onError:g}=xe(nV,Me),y=H4(t);return G.jsxs("div",{className:"react-flow__edges",children:[G.jsx(j4,{defaultColor:e,rfId:n}),y.map(k=>G.jsx(tV,{id:k,edgesFocusable:b,edgesReconnectable:m,elementsSelectable:w,noPanClassName:r,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:f,rfId:n,onError:g,edgeTypes:i,disableKeyboardA11y:v},k))]})}F_.displayName="EdgeRenderer";const iV=R.memo(F_),rV=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oV({children:e}){const t=xe(rV);return G.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function sV(e){const t=Xp(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const aV=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function lV(e){const t=xe(aV),n=Le();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uV(e){return e.connection.inProgress?{...e.connection,to:Gs(e.connection.to,e.transform)}:{...e.connection}}function cV(e){return uV}function dV(e){const t=cV();return xe(t,Me)}const hV=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pV({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:o,height:s,isValid:a,inProgress:l}=xe(hV,Me);return!(o&&r&&l)?null:G.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:G.jsx("g",{className:Ye(["react-flow__connection",Rx(a)]),children:G.jsx(H_,{style:t,type:n,CustomComponent:i,isValid:a})})})}const H_=({style:e,type:t=ai.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:o,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:d,toHandle:c,toPosition:h,pointer:p}=dV();if(!r)return;if(n)return G.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:Rx(i),toNode:d,toHandle:c,pointer:p});let f="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case ai.Bezier:[f]=Xx(v);break;case ai.SimpleBezier:[f]=D_(v);break;case ai.Step:[f]=th({...v,borderRadius:0});break;case ai.SmoothStep:[f]=th(v);break;default:[f]=qx(v)}return G.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};H_.displayName="ConnectionLine";const fV={};function Bv(e=fV){R.useRef(e),Le(),R.useEffect(()=>{},[e])}function mV(){Le(),R.useRef(!1),R.useEffect(()=>{},[])}function G_({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:h,onSelectionEnd:p,connectionLineType:f,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:m,selectionKeyCode:w,selectionOnDrag:g,selectionMode:y,multiSelectionKeyCode:k,panActivationKeyCode:_,zoomActivationKeyCode:E,deleteKeyCode:S,onlyRenderVisibleElements:T,elementsSelectable:C,defaultViewport:I,translateExtent:L,minZoom:V,maxZoom:D,preventScrolling:P,defaultMarkerColor:A,zoomOnScroll:O,zoomOnPinch:N,panOnScroll:M,panOnScrollSpeed:x,panOnScrollMode:F,zoomOnDoubleClick:H,panOnDrag:z,onPaneClick:X,onPaneMouseEnter:q,onPaneMouseMove:U,onPaneMouseLeave:K,onPaneScroll:Y,onPaneContextMenu:Q,paneClickDistance:de,nodeClickDistance:le,onEdgeContextMenu:se,onEdgeMouseEnter:oe,onEdgeMouseMove:ge,onEdgeMouseLeave:Ee,reconnectRadius:ye,onReconnect:Xe,onReconnectStart:fn,onReconnectEnd:Vt,noDragClassName:mn,noWheelClassName:Pi,noPanClassName:Ai,disableKeyboardA11y:Ii,nodeExtent:co,rfId:hr,viewport:$,onViewportChange:Z}){return Bv(e),Bv(t),mV(),sV(n),lV($),G.jsx(A4,{onPaneClick:X,onPaneMouseEnter:q,onPaneMouseMove:U,onPaneMouseLeave:K,onPaneContextMenu:Q,onPaneScroll:Y,paneClickDistance:de,deleteKeyCode:S,selectionKeyCode:w,selectionOnDrag:g,selectionMode:y,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:_,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:O,zoomOnPinch:N,zoomOnDoubleClick:H,panOnScroll:M,panOnScrollSpeed:x,panOnScrollMode:F,panOnDrag:z,defaultViewport:I,translateExtent:L,minZoom:V,maxZoom:D,onSelectionContextMenu:c,preventScrolling:P,noDragClassName:mn,noWheelClassName:Pi,noPanClassName:Ai,disableKeyboardA11y:Ii,onViewportChange:Z,isControlledViewport:!!$,children:G.jsxs(oV,{children:[G.jsx(iV,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Xe,onReconnectStart:fn,onReconnectEnd:Vt,onlyRenderVisibleElements:T,onEdgeContextMenu:se,onEdgeMouseEnter:oe,onEdgeMouseMove:ge,onEdgeMouseLeave:Ee,reconnectRadius:ye,defaultMarkerColor:A,noPanClassName:Ai,disableKeyboardA11y:Ii,rfId:hr}),G.jsx(pV,{style:v,type:f,component:b,containerStyle:m}),G.jsx("div",{className:"react-flow__edgelabel-renderer"}),G.jsx(F4,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:le,onlyRenderVisibleElements:T,noPanClassName:Ai,noDragClassName:mn,disableKeyboardA11y:Ii,nodeExtent:co,rfId:hr}),G.jsx("div",{className:"react-flow__viewport-portal"})]})})}G_.displayName="GraphView";const gV=R.memo(G_),$v=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:h="basic"}={})=>{const p=new Map,f=new Map,v=new Map,b=new Map,m=i??t??[],w=n??e??[],g=d??[0,0],y=c??ys;Jx(v,b,m);const{nodesInitialized:k}=ih(w,p,f,{nodeOrigin:g,nodeExtent:y,zIndexMode:h});let _=[0,0,1];if(s&&r&&o){const E=Fs(p,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:S,y:T,zoom:C}=Hp(E,r,o,l,u,(a==null?void 0:a.padding)??.1);_=[S,T,C]}return{rfId:"1",width:r??0,height:o??0,transform:_,nodes:w,nodesInitialized:k,nodeLookup:p,parentLookup:f,edges:m,edgeLookup:b,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:ys,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Kr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Ox},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:g5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Lx,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},vV=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h})=>M3((p,f)=>{async function v(){const{nodeLookup:b,panZoom:m,fitViewOptions:w,fitViewResolver:g,width:y,height:k,minZoom:_,maxZoom:E}=f();m&&(await f5({nodes:b,width:y,height:k,panZoom:m,minZoom:_,maxZoom:E},w),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...$v({nodes:e,edges:t,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:b=>{const{nodeLookup:m,parentLookup:w,nodeOrigin:g,elevateNodesOnSelect:y,fitViewQueued:k,zIndexMode:_,nodesSelectionActive:E}=f(),{nodesInitialized:S,hasSelectedNodes:T}=ih(b,m,w,{nodeOrigin:g,nodeExtent:c,elevateNodesOnSelect:y,checkEquality:!0,zIndexMode:_}),C=E&&T;k&&S?(v(),p({nodes:b,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:C})):p({nodes:b,nodesInitialized:S,nodesSelectionActive:C})},setEdges:b=>{const{connectionLookup:m,edgeLookup:w}=f();Jx(m,w,b),p({edges:b})},setDefaultNodesAndEdges:(b,m)=>{if(b){const{setNodes:w}=f();w(b),p({hasDefaultNodes:!0})}if(m){const{setEdges:w}=f();w(m),p({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:m,nodeLookup:w,parentLookup:g,domNode:y,nodeOrigin:k,nodeExtent:_,debug:E,fitViewQueued:S,zIndexMode:T}=f(),{changes:C,updatedInternals:I}=V5(b,w,g,y,k,_,T);I&&(M5(w,g,{nodeOrigin:k,nodeExtent:_,zIndexMode:T}),S?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(C==null?void 0:C.length)>0&&(E&&console.log("React Flow: trigger node changes",C),m==null||m(C)))},updateNodePositions:(b,m=!1)=>{const w=[];let g=[];const{nodeLookup:y,triggerNodeChanges:k,connection:_,updateConnection:E,onNodesChangeMiddlewareMap:S}=f();for(const[T,C]of b){const I=y.get(T),L=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(C!=null&&C.position)),V={id:T,type:"position",position:L?{x:Math.max(0,C.position.x),y:Math.max(0,C.position.y)}:C.position,dragging:m};if(I&&_.inProgress&&_.fromNode.id===I.id){const D=sr(I,_.fromHandle,ae.Left,!0);E({..._,from:D})}L&&I.parentId&&w.push({id:T,parentId:I.parentId,rect:{...C.internals.positionAbsolute,width:C.measured.width??0,height:C.measured.height??0}}),g.push(V)}if(w.length>0){const{parentLookup:T,nodeOrigin:C}=f(),I=Yp(w,y,T,C);g.push(...I)}for(const T of S.values())g=T(g);k(g)},triggerNodeChanges:b=>{const{onNodesChange:m,setNodes:w,nodes:g,hasDefaultNodes:y,debug:k}=f();if(b!=null&&b.length){if(y){const _=t4(b,g);w(_)}k&&console.log("React Flow: trigger node changes",b),m==null||m(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:m,setEdges:w,edges:g,hasDefaultEdges:y,debug:k}=f();if(b!=null&&b.length){if(y){const _=n4(b,g);w(_)}k&&console.log("React Flow: trigger edge changes",b),m==null||m(b)}},addSelectedNodes:b=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:g,triggerNodeChanges:y,triggerEdgeChanges:k}=f();if(m){const _=b.map(E=>Fi(E,!0));y(_);return}y(Nr(g,new Set([...b]),!0)),k(Nr(w))},addSelectedEdges:b=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:g,triggerNodeChanges:y,triggerEdgeChanges:k}=f();if(m){const _=b.map(E=>Fi(E,!0));k(_);return}k(Nr(w,new Set([...b]))),y(Nr(g,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:m}={})=>{const{edges:w,nodes:g,nodeLookup:y,triggerNodeChanges:k,triggerEdgeChanges:_}=f(),E=b||g,S=m||w,T=[];for(const I of E){if(!I.selected)continue;const L=y.get(I.id);L&&(L.selected=!1),T.push(Fi(I.id,!1))}const C=[];for(const I of S)I.selected&&C.push(Fi(I.id,!1));k(T),_(C)},setMinZoom:b=>{const{panZoom:m,maxZoom:w}=f();m==null||m.setScaleExtent([b,w]),p({minZoom:b})},setMaxZoom:b=>{const{panZoom:m,minZoom:w}=f();m==null||m.setScaleExtent([w,b]),p({maxZoom:b})},setTranslateExtent:b=>{var m;(m=f().panZoom)==null||m.setTranslateExtent(b),p({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:m,triggerNodeChanges:w,triggerEdgeChanges:g,elementsSelectable:y}=f();if(!y)return;const k=m.reduce((E,S)=>S.selected?[...E,Fi(S.id,!1)]:E,[]),_=b.reduce((E,S)=>S.selected?[...E,Fi(S.id,!1)]:E,[]);w(k),g(_)},setNodeExtent:b=>{const{nodes:m,nodeLookup:w,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:k,nodeExtent:_,zIndexMode:E}=f();b[0][0]===_[0][0]&&b[0][1]===_[0][1]&&b[1][0]===_[1][0]&&b[1][1]===_[1][1]||(ih(m,w,g,{nodeOrigin:y,nodeExtent:b,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),p({nodeExtent:b}))},panBy:b=>{const{transform:m,width:w,height:g,panZoom:y,translateExtent:k}=f();return F5({delta:b,panZoom:y,transform:m,translateExtent:k,width:w,height:g})},setCenter:async(b,m,w)=>{const{width:g,height:y,maxZoom:k,panZoom:_}=f();if(!_)return Promise.resolve(!1);const E=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await _.setViewport({x:g/2-b*E,y:y/2-m*E,zoom:E},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...Ox}})},updateConnection:b=>{p({connection:b})},reset:()=>p({...$v()})}},Object.is);function wV({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:o,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h,children:p}){const[f]=R.useState(()=>vV({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:c,zIndexMode:h}));return G.jsx(L3,{value:f,children:G.jsx(o4,{children:p})})}function bV({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:o,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:p}){return R.useContext(ku)?G.jsx(G.Fragment,{children:e}):G.jsx(wV,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:o,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:p,children:e})}const yV={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function xV({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:h,onConnect:p,onConnectStart:f,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,onNodeMouseEnter:w,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:_,onNodeDragStart:E,onNodeDrag:S,onNodeDragStop:T,onNodesDelete:C,onEdgesDelete:I,onDelete:L,onSelectionChange:V,onSelectionDragStart:D,onSelectionDrag:P,onSelectionDragStop:A,onSelectionContextMenu:O,onSelectionStart:N,onSelectionEnd:M,onBeforeDelete:x,connectionMode:F,connectionLineType:H=ai.Bezier,connectionLineStyle:z,connectionLineComponent:X,connectionLineContainerStyle:q,deleteKeyCode:U="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:Y=!1,selectionMode:Q=xs.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:le=ks()?"Meta":"Control",zoomActivationKeyCode:se=ks()?"Meta":"Control",snapToGrid:oe,snapGrid:ge,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ye,nodesDraggable:Xe,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:mn,nodeOrigin:Pi=g_,edgesFocusable:Ai,edgesReconnectable:Ii,elementsSelectable:co=!0,defaultViewport:hr=X3,minZoom:$=.5,maxZoom:Z=2,translateExtent:he=ys,preventScrolling:ve=!0,nodeExtent:Se,defaultMarkerColor:Dt="#b1b1b7",zoomOnScroll:In=!0,zoomOnPinch:Xt=!0,panOnScroll:Ni=!1,panOnScrollSpeed:Ti=.5,panOnScrollMode:pt=qi.Free,zoomOnDoubleClick:Zn=!0,panOnDrag:Zt=!0,onPaneClick:j_,onPaneMouseEnter:U_,onPaneMouseMove:Y_,onPaneMouseLeave:X_,onPaneScroll:Z_,onPaneContextMenu:q_,paneClickDistance:Q_=1,nodeClickDistance:K_=0,children:J_,onReconnect:e1,onReconnectStart:t1,onReconnectEnd:n1,onEdgeContextMenu:i1,onEdgeDoubleClick:r1,onEdgeMouseEnter:o1,onEdgeMouseMove:s1,onEdgeMouseLeave:a1,reconnectRadius:l1=10,onNodesChange:u1,onEdgesChange:c1,noDragClassName:d1="nodrag",noWheelClassName:h1="nowheel",noPanClassName:qp="nopan",fitView:Qp,fitViewOptions:Kp,connectOnClick:p1,attributionPosition:f1,proOptions:m1,defaultEdgeOptions:g1,elevateNodesOnSelect:v1=!0,elevateEdgesOnSelect:w1=!1,disableKeyboardA11y:Jp=!1,autoPanOnConnect:b1,autoPanOnNodeDrag:y1,autoPanSpeed:x1,connectionRadius:_1,isValidConnection:k1,onError:S1,style:C1,id:ef,nodeDragThreshold:E1,connectionDragThreshold:D1,viewport:z1,onViewportChange:P1,width:A1,height:I1,colorMode:N1="light",debug:T1,onScroll:Bs,ariaLabelConfig:M1,zIndexMode:tf="basic",...L1},O1){const Du=ef||"1",R1=K3(N1),V1=R.useCallback(nf=>{nf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Bs==null||Bs(nf)},[Bs]);return G.jsx("div",{"data-testid":"rf__wrapper",...L1,onScroll:V1,style:{...C1,...yV},ref:O1,className:Ye(["react-flow",r,R1]),id:ef,role:"application",children:G.jsxs(bV,{nodes:e,edges:t,width:A1,height:I1,fitView:Qp,fitViewOptions:Kp,minZoom:$,maxZoom:Z,nodeOrigin:Pi,nodeExtent:Se,zIndexMode:tf,children:[G.jsx(Q3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:p,onConnectStart:f,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,nodesDraggable:Xe,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:mn,edgesFocusable:Ai,edgesReconnectable:Ii,elementsSelectable:co,elevateNodesOnSelect:v1,elevateEdgesOnSelect:w1,minZoom:$,maxZoom:Z,nodeExtent:Se,onNodesChange:u1,onEdgesChange:c1,snapToGrid:oe,snapGrid:ge,connectionMode:F,translateExtent:he,connectOnClick:p1,defaultEdgeOptions:g1,fitView:Qp,fitViewOptions:Kp,onNodesDelete:C,onEdgesDelete:I,onDelete:L,onNodeDragStart:E,onNodeDrag:S,onNodeDragStop:T,onSelectionDrag:P,onSelectionDragStart:D,onSelectionDragStop:A,onMove:d,onMoveStart:c,onMoveEnd:h,noPanClassName:qp,nodeOrigin:Pi,rfId:Du,autoPanOnConnect:b1,autoPanOnNodeDrag:y1,autoPanSpeed:x1,onError:S1,connectionRadius:_1,isValidConnection:k1,selectNodesOnDrag:ye,nodeDragThreshold:E1,connectionDragThreshold:D1,onBeforeDelete:x,debug:T1,ariaLabelConfig:M1,zIndexMode:tf}),G.jsx(gV,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:_,nodeTypes:o,edgeTypes:s,connectionLineType:H,connectionLineStyle:z,connectionLineComponent:X,connectionLineContainerStyle:q,selectionKeyCode:K,selectionOnDrag:Y,selectionMode:Q,deleteKeyCode:U,multiSelectionKeyCode:le,panActivationKeyCode:de,zoomActivationKeyCode:se,onlyRenderVisibleElements:Ee,defaultViewport:hr,translateExtent:he,minZoom:$,maxZoom:Z,preventScrolling:ve,zoomOnScroll:In,zoomOnPinch:Xt,zoomOnDoubleClick:Zn,panOnScroll:Ni,panOnScrollSpeed:Ti,panOnScrollMode:pt,panOnDrag:Zt,onPaneClick:j_,onPaneMouseEnter:U_,onPaneMouseMove:Y_,onPaneMouseLeave:X_,onPaneScroll:Z_,onPaneContextMenu:q_,paneClickDistance:Q_,nodeClickDistance:K_,onSelectionContextMenu:O,onSelectionStart:N,onSelectionEnd:M,onReconnect:e1,onReconnectStart:t1,onReconnectEnd:n1,onEdgeContextMenu:i1,onEdgeDoubleClick:r1,onEdgeMouseEnter:o1,onEdgeMouseMove:s1,onEdgeMouseLeave:a1,reconnectRadius:l1,defaultMarkerColor:Dt,noDragClassName:d1,noWheelClassName:h1,noPanClassName:qp,rfId:Du,disableKeyboardA11y:Jp,nodeExtent:Se,viewport:z1,onViewportChange:P1}),G.jsx(Y3,{onSelectionChange:V}),J_,G.jsx(B3,{proOptions:m1,position:f1}),G.jsx(G3,{rfId:Du,disableKeyboardA11y:Jp})]})})}var l8=w_(xV);const _V=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!Gp(n.userNode))return!1;return!0};function u8(e={includeHiddenNodes:!1}){return xe(_V(e))}function kV({dimensions:e,lineWidth:t,variant:n,className:i}){return G.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ye(["react-flow__background-pattern",n,i])})}function SV({radius:e,className:t}){return G.jsx("circle",{cx:e,cy:e,r:e,className:Ye(["react-flow__background-pattern","dots",t])})}var yi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(yi||(yi={}));const CV={[yi.Dots]:1,[yi.Lines]:1,[yi.Cross]:6},EV=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function B_({id:e,variant:t=yi.Dots,gap:n=20,size:i,lineWidth:r=1,offset:o=0,color:s,bgColor:a,style:l,className:u,patternClassName:d}){const c=R.useRef(null),{transform:h,patternId:p}=xe(EV,Me),f=i||CV[t],v=t===yi.Dots,b=t===yi.Cross,m=Array.isArray(n)?n:[n,n],w=[m[0]*h[2]||1,m[1]*h[2]||1],g=f*h[2],y=Array.isArray(o)?o:[o,o],k=b?[g,g]:w,_=[y[0]*h[2]||1+k[0]/2,y[1]*h[2]||1+k[1]/2],E=`${p}${e||""}`;return G.jsxs("svg",{className:Ye(["react-flow__background",u]),style:{...l,...Cu,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[G.jsx("pattern",{id:E,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?G.jsx(SV,{radius:g/2,className:d}):G.jsx(kV,{dimensions:k,lineWidth:r,variant:t,className:d})}),G.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}B_.displayName="Background";const c8=R.memo(B_);function DV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:G.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:G.jsx("path",{d:"M0 0h32v4.2H0z"})})}function PV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:G.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function AV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function IV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ea({children:e,className:t,...n}){return G.jsx("button",{type:"button",className:Ye(["react-flow__controls-button",t]),...n,children:e})}const NV=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $_({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:d,position:c="bottom-left",orientation:h="vertical","aria-label":p}){const f=Le(),{isInteractive:v,minZoomReached:b,maxZoomReached:m,ariaLabelConfig:w}=xe(NV,Me),{zoomIn:g,zoomOut:y,fitView:k}=Xp(),_=()=>{g(),o==null||o()},E=()=>{y(),s==null||s()},S=()=>{k(r),a==null||a()},T=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},C=h==="horizontal"?"horizontal":"vertical";return G.jsxs(Su,{className:Ye(["react-flow__controls",C,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":p??w["controls.ariaLabel"],children:[t&&G.jsxs(G.Fragment,{children:[G.jsx(Ea,{onClick:_,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:m,children:G.jsx(DV,{})}),G.jsx(Ea,{onClick:E,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:b,children:G.jsx(zV,{})})]}),n&&G.jsx(Ea,{className:"react-flow__controls-fitview",onClick:S,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:G.jsx(PV,{})}),i&&G.jsx(Ea,{className:"react-flow__controls-interactive",onClick:T,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:v?G.jsx(IV,{}):G.jsx(AV,{})}),d]})}$_.displayName="Controls";const d8=R.memo($_);function TV({id:e,x:t,y:n,width:i,height:r,style:o,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:d,shapeRendering:c,selected:h,onClick:p}){const{background:f,backgroundColor:v}=o||{},b=s||f||v;return G.jsx("rect",{className:Ye(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:b,stroke:a,strokeWidth:l},shapeRendering:c,onClick:p?m=>p(m,e):void 0})}const MV=R.memo(TV),LV=e=>e.nodes.map(t=>t.id),zc=e=>e instanceof Function?e:()=>e;function OV({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:o=MV,onClick:s}){const a=xe(LV,Me),l=zc(t),u=zc(e),d=zc(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return G.jsx(G.Fragment,{children:a.map(h=>G.jsx(VV,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:o,onClick:s,shapeRendering:c},h))})}function RV({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:d,y:c,width:h,height:p}=xe(f=>{const v=f.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const b=v.internals.userNode,{x:m,y:w}=v.internals.positionAbsolute,{width:g,height:y}=Xn(b);return{node:b,x:m,y:w,width:g,height:y}},Me);return!u||u.hidden||!Gp(u)?null:G.jsx(a,{x:d,y:c,width:h,height:p,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:o,shapeRendering:s,onClick:l,id:u.id})}const VV=R.memo(RV);var FV=R.memo(OV);const HV=200,GV=150,BV=e=>!e.hidden,$V=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Bx(Fs(e.nodeLookup,{filter:BV}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},WV="react-flow__minimap-desc";function W_({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:h="bottom-right",onClick:p,onNodeClick:f,pannable:v=!1,zoomable:b=!1,ariaLabel:m,inversePan:w,zoomStep:g=1,offsetScale:y=5}){const k=Le(),_=R.useRef(null),{boundingRect:E,viewBB:S,rfId:T,panZoom:C,translateExtent:I,flowWidth:L,flowHeight:V,ariaLabelConfig:D}=xe($V,Me),P=(e==null?void 0:e.width)??HV,A=(e==null?void 0:e.height)??GV,O=E.width/P,N=E.height/A,M=Math.max(O,N),x=M*P,F=M*A,H=y*M,z=E.x-(x-E.width)/2-H,X=E.y-(F-E.height)/2-H,q=x+H*2,U=F+H*2,K=`${WV}-${T}`,Y=R.useRef(0),Q=R.useRef();Y.current=M,R.useEffect(()=>{if(_.current&&C)return Q.current=X5({domNode:_.current,panZoom:C,getTransform:()=>k.getState().transform,getViewScale:()=>Y.current}),()=>{var oe;(oe=Q.current)==null||oe.destroy()}},[C]),R.useEffect(()=>{var oe;(oe=Q.current)==null||oe.update({translateExtent:I,width:L,height:V,inversePan:w,pannable:v,zoomStep:g,zoomable:b})},[v,b,w,g,I,L,V]);const de=p?oe=>{var ye;const[ge,Ee]=((ye=Q.current)==null?void 0:ye.pointer(oe))||[0,0];p(oe,{x:ge,y:Ee})}:void 0,le=f?R.useCallback((oe,ge)=>{const Ee=k.getState().nodeLookup.get(ge).internals.userNode;f(oe,Ee)},[]):void 0,se=m??D["minimap.ariaLabel"];return G.jsx(Su,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*M:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ye(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:G.jsxs("svg",{width:P,height:A,viewBox:`${z} ${X} ${q} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:_,onClick:de,children:[se&&G.jsx("title",{id:K,children:se}),G.jsx(FV,{onClick:le,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),G.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-H},${X-H}h${q+H*2}v${U+H*2}h${-q-H*2}z
|
|
2745
|
+
M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W_.displayName="MiniMap";const h8=R.memo(W_),jV=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,UV={[no.Line]:"right",[no.Handle]:"bottom-right"};function YV({nodeId:e,position:t,variant:n=no.Handle,className:i,style:r=void 0,children:o,color:s,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:h,autoScale:p=!0,shouldResize:f,onResizeStart:v,onResize:b,onResizeEnd:m}){const w=__(),g=typeof e=="string"?e:w,y=Le(),k=R.useRef(null),_=n===no.Handle,E=xe(R.useCallback(jV(_&&p),[_,p]),Me),S=R.useRef(null),T=t??UV[n];R.useEffect(()=>{if(!(!k.current||!g))return S.current||(S.current=l3({domNode:k.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:I,transform:L,snapGrid:V,snapToGrid:D,nodeOrigin:P,domNode:A}=y.getState();return{nodeLookup:I,transform:L,snapGrid:V,snapToGrid:D,nodeOrigin:P,paneDomNode:A}},onChange:(I,L)=>{const{triggerNodeChanges:V,nodeLookup:D,parentLookup:P,nodeOrigin:A}=y.getState(),O=[],N={x:I.x,y:I.y},M=D.get(g);if(M&&M.expandParent&&M.parentId){const x=M.origin??A,F=I.width??M.measured.width??0,H=I.height??M.measured.height??0,z={id:M.id,parentId:M.parentId,rect:{width:F,height:H,...$x({x:I.x??M.position.x,y:I.y??M.position.y},{width:F,height:H},M.parentId,D,x)}},X=Yp([z],D,P,A);O.push(...X),N.x=I.x?Math.max(x[0]*F,I.x):void 0,N.y=I.y?Math.max(x[1]*H,I.y):void 0}if(N.x!==void 0&&N.y!==void 0){const x={id:g,type:"position",position:{...N}};O.push(x)}if(I.width!==void 0&&I.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};O.push(F)}for(const x of L){const F={...x,type:"position"};O.push(F)}V(O)},onEnd:({width:I,height:L})=>{const V={id:g,type:"dimensions",resizing:!1,dimensions:{width:I,height:L}};y.getState().triggerNodeChanges([V])}})),S.current.update({controlPosition:T,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:c,resizeDirection:h,onResizeStart:v,onResize:b,onResizeEnd:m,shouldResize:f}),()=>{var I;(I=S.current)==null||I.destroy()}},[T,a,l,u,d,c,v,b,m,f]);const C=T.split("-");return G.jsx("div",{className:Ye(["react-flow__resize-control","nodrag",...C,n,i]),ref:k,style:{...r,scale:E,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:o})}R.memo(YV);export{c8 as B,d8 as C,SM as D,Ol as H,XV as M,t8 as N,ae as P,ie as R,ZV as a,qV as b,QV as c,nb as d,KV as e,a8 as f,s8 as g,h8 as h,l8 as i,G as j,yi as k,Tl as l,u8 as m,Xp as n,lu as o,r8 as p,e8 as q,R as r,i8 as s,JV as t,Ty as u,n8 as v,FN as w,pC as x};
|