datool 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/client-dist/assets/index-CU3ksvkv.js +164 -0
- package/client-dist/assets/index-Rn9jSaAz.css +1 -0
- package/client-dist/index.html +2 -2
- package/package.json +1 -1
- package/src/client/App.tsx +11 -40
- package/src/client/components/data-table-cell.tsx +19 -6
- package/src/client/components/data-table.tsx +490 -85
- package/src/node/config.ts +22 -0
- package/src/shared/types.ts +4 -0
- package/client-dist/assets/index-DUkIilaZ.css +0 -1
- package/client-dist/assets/index-OdNyDkx7.js +0 -164
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
function SO(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function y1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gh={exports:{}},Kl={};var Eb;function xO(){if(Eb)return Kl;Eb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,l){var a=null;if(l!==void 0&&(a=""+l),o.key!==void 0&&(a=""+o.key),"key"in o){l={};for(var c in o)c!=="key"&&(l[c]=o[c])}else l=o;return o=l.ref,{$$typeof:t,type:r,key:a,ref:o!==void 0?o:null,props:l}}return Kl.Fragment=e,Kl.jsx=n,Kl.jsxs=n,Kl}var Rb;function wO(){return Rb||(Rb=1,Gh.exports=xO()),Gh.exports}var R=wO(),qh={exports:{}},Re={};var Tb;function CO(){if(Tb)return Re;Tb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function E(N,F,X){this.props=N,this.context=F,this.refs=C,this.updater=X||S}E.prototype.isReactComponent={},E.prototype.setState=function(N,F){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,F,"setState")},E.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function A(){}A.prototype=E.prototype;function O(N,F,X){this.props=N,this.context=F,this.refs=C,this.updater=X||S}var D=O.prototype=new A;D.constructor=O,x(D,E.prototype),D.isPureReactComponent=!0;var z=Array.isArray;function L(){}var _={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function Q(N,F,X){var ne=X.ref;return{$$typeof:t,type:N,key:F,ref:ne!==void 0?ne:null,props:X}}function ue(N,F){return Q(N.type,F,N.props)}function se(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function le(N){var F={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(X){return F[X]})}var xe=/\/+/g;function ie(N,F){return typeof N=="object"&&N!==null&&N.key!=null?le(""+N.key):F.toString(36)}function ve(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(F){N.status==="pending"&&(N.status="fulfilled",N.value=F)},function(F){N.status==="pending"&&(N.status="rejected",N.reason=F)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function V(N,F,X,ne,oe){var fe=typeof N;(fe==="undefined"||fe==="boolean")&&(N=null);var me=!1;if(N===null)me=!0;else switch(fe){case"bigint":case"string":case"number":me=!0;break;case"object":switch(N.$$typeof){case t:case e:me=!0;break;case p:return me=N._init,V(me(N._payload),F,X,ne,oe)}}if(me)return oe=oe(N),me=ne===""?"."+ie(N,0):ne,z(oe)?(X="",me!=null&&(X=me.replace(xe,"$&/")+"/"),V(oe,F,X,"",function(it){return it})):oe!=null&&(se(oe)&&(oe=ue(oe,X+(oe.key==null||N&&N.key===oe.key?"":(""+oe.key).replace(xe,"$&/")+"/")+me)),F.push(oe)),1;me=0;var De=ne===""?".":ne+":";if(z(N))for(var ye=0;ye<N.length;ye++)ne=N[ye],fe=De+ie(ne,ye),me+=V(ne,F,X,fe,oe);else if(ye=b(N),typeof ye=="function")for(N=ye.call(N),ye=0;!(ne=N.next()).done;)ne=ne.value,fe=De+ie(ne,ye++),me+=V(ne,F,X,fe,oe);else if(fe==="object"){if(typeof N.then=="function")return V(ve(N),F,X,ne,oe);throw F=String(N),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return me}function Z(N,F,X){if(N==null)return N;var ne=[],oe=0;return V(N,ne,"","",function(fe){return F.call(X,fe,oe++)}),ne}function U(N){if(N._status===-1){var F=N._result;F=F(),F.then(function(X){(N._status===0||N._status===-1)&&(N._status=1,N._result=X)},function(X){(N._status===0||N._status===-1)&&(N._status=2,N._result=X)}),N._status===-1&&(N._status=0,N._result=F)}if(N._status===1)return N._result.default;throw N._result}var q=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},K={map:Z,forEach:function(N,F,X){Z(N,function(){F.apply(this,arguments)},X)},count:function(N){var F=0;return Z(N,function(){F++}),F},toArray:function(N){return Z(N,function(F){return F})||[]},only:function(N){if(!se(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Re.Activity=g,Re.Children=K,Re.Component=E,Re.Fragment=n,Re.Profiler=o,Re.PureComponent=O,Re.StrictMode=r,Re.Suspense=d,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Re.__COMPILER_RUNTIME={__proto__:null,c:function(N){return _.H.useMemoCache(N)}},Re.cache=function(N){return function(){return N.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(N,F,X){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ne=x({},N.props),oe=N.key;if(F!=null)for(fe in F.key!==void 0&&(oe=""+F.key),F)!I.call(F,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&F.ref===void 0||(ne[fe]=F[fe]);var fe=arguments.length-2;if(fe===1)ne.children=X;else if(1<fe){for(var me=Array(fe),De=0;De<fe;De++)me[De]=arguments[De+2];ne.children=me}return Q(N.type,oe,ne)},Re.createContext=function(N){return N={$$typeof:a,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Re.createElement=function(N,F,X){var ne,oe={},fe=null;if(F!=null)for(ne in F.key!==void 0&&(fe=""+F.key),F)I.call(F,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(oe[ne]=F[ne]);var me=arguments.length-2;if(me===1)oe.children=X;else if(1<me){for(var De=Array(me),ye=0;ye<me;ye++)De[ye]=arguments[ye+2];oe.children=De}if(N&&N.defaultProps)for(ne in me=N.defaultProps,me)oe[ne]===void 0&&(oe[ne]=me[ne]);return Q(N,fe,oe)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(N){return{$$typeof:c,render:N}},Re.isValidElement=se,Re.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:U}},Re.memo=function(N,F){return{$$typeof:h,type:N,compare:F===void 0?null:F}},Re.startTransition=function(N){var F=_.T,X={};_.T=X;try{var ne=N(),oe=_.S;oe!==null&&oe(X,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(L,q)}catch(fe){q(fe)}finally{F!==null&&X.types!==null&&(F.types=X.types),_.T=F}},Re.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Re.use=function(N){return _.H.use(N)},Re.useActionState=function(N,F,X){return _.H.useActionState(N,F,X)},Re.useCallback=function(N,F){return _.H.useCallback(N,F)},Re.useContext=function(N){return _.H.useContext(N)},Re.useDebugValue=function(){},Re.useDeferredValue=function(N,F){return _.H.useDeferredValue(N,F)},Re.useEffect=function(N,F){return _.H.useEffect(N,F)},Re.useEffectEvent=function(N){return _.H.useEffectEvent(N)},Re.useId=function(){return _.H.useId()},Re.useImperativeHandle=function(N,F,X){return _.H.useImperativeHandle(N,F,X)},Re.useInsertionEffect=function(N,F){return _.H.useInsertionEffect(N,F)},Re.useLayoutEffect=function(N,F){return _.H.useLayoutEffect(N,F)},Re.useMemo=function(N,F){return _.H.useMemo(N,F)},Re.useOptimistic=function(N,F){return _.H.useOptimistic(N,F)},Re.useReducer=function(N,F,X){return _.H.useReducer(N,F,X)},Re.useRef=function(N){return _.H.useRef(N)},Re.useState=function(N){return _.H.useState(N)},Re.useSyncExternalStore=function(N,F,X){return _.H.useSyncExternalStore(N,F,X)},Re.useTransition=function(){return _.H.useTransition()},Re.version="19.2.4",Re}var Ab;function Ra(){return Ab||(Ab=1,qh.exports=CO()),qh.exports}var M=Ra();const tn=y1(M),v1=SO({__proto__:null,default:tn},[M]);var Kh={exports:{}},Yl={},Yh={exports:{}},Xh={};var Ob;function MO(){return Ob||(Ob=1,(function(t){function e(V,Z){var U=V.length;V.push(Z);e:for(;0<U;){var q=U-1>>>1,K=V[q];if(0<o(K,Z))V[q]=Z,V[U]=K,U=q;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var Z=V[0],U=V.pop();if(U!==Z){V[0]=U;e:for(var q=0,K=V.length,N=K>>>1;q<N;){var F=2*(q+1)-1,X=V[F],ne=F+1,oe=V[ne];if(0>o(X,U))ne<K&&0>o(oe,X)?(V[q]=oe,V[ne]=U,q=ne):(V[q]=X,V[F]=U,q=F);else if(ne<K&&0>o(oe,U))V[q]=oe,V[ne]=U,q=ne;else break e}}return Z}function o(V,Z){var U=V.sortIndex-Z.sortIndex;return U!==0?U:V.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var d=[],h=[],p=1,g=null,v=3,b=!1,S=!1,x=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function D(V){for(var Z=n(h);Z!==null;){if(Z.callback===null)r(h);else if(Z.startTime<=V)r(h),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=n(h)}}function z(V){if(x=!1,D(V),!S)if(n(d)!==null)S=!0,L||(L=!0,le());else{var Z=n(h);Z!==null&&ve(z,Z.startTime-V)}}var L=!1,_=-1,I=5,Q=-1;function ue(){return C?!0:!(t.unstable_now()-Q<I)}function se(){if(C=!1,L){var V=t.unstable_now();Q=V;var Z=!0;try{e:{S=!1,x&&(x=!1,A(_),_=-1),b=!0;var U=v;try{t:{for(D(V),g=n(d);g!==null&&!(g.expirationTime>V&&ue());){var q=g.callback;if(typeof q=="function"){g.callback=null,v=g.priorityLevel;var K=q(g.expirationTime<=V);if(V=t.unstable_now(),typeof K=="function"){g.callback=K,D(V),Z=!0;break t}g===n(d)&&r(d),D(V)}else r(d);g=n(d)}if(g!==null)Z=!0;else{var N=n(h);N!==null&&ve(z,N.startTime-V),Z=!1}}break e}finally{g=null,v=U,b=!1}Z=void 0}}finally{Z?le():L=!1}}}var le;if(typeof O=="function")le=function(){O(se)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,ie=xe.port2;xe.port1.onmessage=se,le=function(){ie.postMessage(null)}}else le=function(){E(se,0)};function ve(V,Z){_=E(function(){V(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(V){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var U=v;v=Z;try{return V()}finally{v=U}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(V,Z){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var U=v;v=V;try{return Z()}finally{v=U}},t.unstable_scheduleCallback=function(V,Z,U){var q=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?q+U:q):U=q,V){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=U+K,V={id:p++,callback:Z,priorityLevel:V,startTime:U,expirationTime:K,sortIndex:-1},U>q?(V.sortIndex=U,e(h,V),n(d)===null&&V===n(h)&&(x?(A(_),_=-1):x=!0,ve(z,U-q))):(V.sortIndex=K,e(d,V),S||b||(S=!0,L||(L=!0,le()))),V},t.unstable_shouldYield=ue,t.unstable_wrapCallback=function(V){var Z=v;return function(){var U=v;v=Z;try{return V.apply(this,arguments)}finally{v=U}}}})(Xh)),Xh}var kb;function EO(){return kb||(kb=1,Yh.exports=MO()),Yh.exports}var Jh={exports:{}},Pt={};var Nb;function RO(){if(Nb)return Pt;Nb=1;var t=Ra();function e(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(d,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:d,containerInfo:h,implementation:p}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Pt.createPortal=function(d,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return l(d,h,null,p)},Pt.flushSync=function(d){var h=a.T,p=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=h,r.p=p,r.d.f()}},Pt.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},Pt.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Pt.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Pt.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},Pt.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(d,p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Pt.preloadModule=function(d,h){if(typeof d=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},Pt.requestFormReset=function(d){r.d.r(d)},Pt.unstable_batchedUpdates=function(d,h){return d(h)},Pt.useFormState=function(d,h,p){return a.H.useFormState(d,h,p)},Pt.useFormStatus=function(){return a.H.useHostTransitionStatus()},Pt.version="19.2.4",Pt}var Db;function b1(){if(Db)return Jh.exports;Db=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Jh.exports=RO(),Jh.exports}var _b;function TO(){if(_b)return Yl;_b=1;var t=EO(),e=Ra(),n=b1();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function a(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(l(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,f=s;;){var m=u.return;if(m===null)break;var y=m.alternate;if(y===null){if(f=m.return,f!==null){u=f;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===u)return d(m),i;if(y===f)return d(m),s;y=y.sibling}throw Error(r(188))}if(u.return!==f.return)u=m,f=y;else{for(var w=!1,T=m.child;T;){if(T===u){w=!0,u=m,f=y;break}if(T===f){w=!0,f=m,u=y;break}T=T.sibling}if(!w){for(T=y.child;T;){if(T===u){w=!0,u=y,f=m;break}if(T===f){w=!0,f=y,u=m;break}T=T.sibling}if(!w)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function le(i){return i===null||typeof i!="object"?null:(i=se&&i[se]||i["@@iterator"],typeof i=="function"?i:null)}var xe=Symbol.for("react.client.reference");function ie(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===xe?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case z:return"Suspense";case L:return"SuspenseList";case Q:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case O:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case D:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case _:return s=i.displayName||null,s!==null?s:ie(i.type)||"Memo";case I:s=i._payload,i=i._init;try{return ie(i(s))}catch{}}return null}var ve=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},q=[],K=-1;function N(i){return{current:i}}function F(i){0>K||(i.current=q[K],q[K]=null,K--)}function X(i,s){K++,q[K]=i.current,i.current=s}var ne=N(null),oe=N(null),fe=N(null),me=N(null);function De(i,s){switch(X(fe,s),X(oe,i),X(ne,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Yv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Yv(s),i=Xv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}F(ne),X(ne,i)}function ye(){F(ne),F(oe),F(fe)}function it(i){i.memoizedState!==null&&X(me,i);var s=ne.current,u=Xv(s,i.type);s!==u&&(X(oe,i),X(ne,u))}function wt(i){oe.current===i&&(F(ne),F(oe)),me.current===i&&(F(me),Hl._currentValue=U)}var Ft,Ct;function on(i){if(Ft===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);Ft=s&&s[1]||"",Ct=-1<u.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ft+i+Ct}var Ji=!1;function Qi(i,s){if(!i||Ji)return"";Ji=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(s){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(G){var H=G}Reflect.construct(i,[],W)}else{try{W.call()}catch(G){H=G}i.call(W.prototype)}}else{try{throw Error()}catch(G){H=G}(W=i())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(G){if(G&&H&&typeof G.stack=="string")return[G.stack,H.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),w=y[0],T=y[1];if(w&&T){var k=w.split(`
|
|
4
|
+
`),$=T.split(`
|
|
5
|
+
`);for(m=f=0;f<k.length&&!k[f].includes("DetermineComponentFrameRoot");)f++;for(;m<$.length&&!$[m].includes("DetermineComponentFrameRoot");)m++;if(f===k.length||m===$.length)for(f=k.length-1,m=$.length-1;1<=f&&0<=m&&k[f]!==$[m];)m--;for(;1<=f&&0<=m;f--,m--)if(k[f]!==$[m]){if(f!==1||m!==1)do if(f--,m--,0>m||k[f]!==$[m]){var Y=`
|
|
6
|
+
`+k[f].replace(" at new "," at ");return i.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",i.displayName)),Y}while(1<=f&&0<=m);break}}}finally{Ji=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?on(u):""}function rr(i,s){switch(i.tag){case 26:case 27:case 5:return on(i.type);case 16:return on("Lazy");case 13:return i.child!==s&&s!==null?on("Suspense Fallback"):on("Suspense");case 19:return on("SuspenseList");case 0:case 15:return Qi(i.type,!1);case 11:return Qi(i.type.render,!1);case 1:return Qi(i.type,!0);case 31:return on("Activity");default:return""}}function qn(i){try{var s="",u=null;do s+=rr(i,u),u=i,i=i.return;while(i);return s}catch(f){return`
|
|
7
|
+
Error generating stack: `+f.message+`
|
|
8
|
+
`+f.stack}}var Zr=Object.prototype.hasOwnProperty,mn=t.unstable_scheduleCallback,Zi=t.unstable_cancelCallback,Wi=t.unstable_shouldYield,yr=t.unstable_requestPaint,Qt=t.unstable_now,tl=t.unstable_getCurrentPriorityLevel,gn=t.unstable_ImmediatePriority,nl=t.unstable_UserBlockingPriority,eo=t.unstable_NormalPriority,La=t.unstable_LowPriority,rl=t.unstable_IdlePriority,jf=t.log,Ba=t.unstable_setDisableYieldValue,to=null,Zt=null;function ir(i){if(typeof jf=="function"&&Ba(i),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(to,i)}catch{}}var Wt=Math.clz32?Math.clz32:vr,If=Math.log,Kn=Math.LN2;function vr(i){return i>>>=0,i===0?32:31-(If(i)/Kn|0)|0}var Wr=256,no=262144,ro=4194304;function Rt(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function br(i,s,u){var f=i.pendingLanes;if(f===0)return 0;var m=0,y=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var T=f&134217727;return T!==0?(f=T&~y,f!==0?m=Rt(f):(w&=T,w!==0?m=Rt(w):u||(u=T&~i,u!==0&&(m=Rt(u))))):(T=f&~y,T!==0?m=Rt(T):w!==0?m=Rt(w):u||(u=f&~i,u!==0&&(m=Rt(u)))),m===0?0:s!==0&&s!==m&&(s&y)===0&&(y=m&-m,u=s&-s,y>=u||y===32&&(u&4194048)!==0)?s:m}function or(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Lf(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Va(){var i=ro;return ro<<=1,(ro&62914560)===0&&(ro=4194304),i}function Sr(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function ei(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Fa(i,s,u,f,m,y){var w=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var T=i.entanglements,k=i.expirationTimes,$=i.hiddenUpdates;for(u=w&~u;0<u;){var Y=31-Wt(u),W=1<<Y;T[Y]=0,k[Y]=-1;var H=$[Y];if(H!==null)for($[Y]=null,Y=0;Y<H.length;Y++){var G=H[Y];G!==null&&(G.lane&=-536870913)}u&=~W}f!==0&&Go(i,f,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~s))}function Go(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var f=31-Wt(s);i.entangledLanes|=s,i.entanglements[f]=i.entanglements[f]|1073741824|u&261930}function xr(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var f=31-Wt(u),m=1<<f;m&s|i[f]&s&&(i[f]|=s),u&=~m}}function il(i,s){var u=s&-s;return u=(u&42)!==0?1:ti(u),(u&(i.suspendedLanes|s))!==0?0:u}function ti(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ol(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Pa(){var i=Z.p;return i!==0?i:(i=window.event,i===void 0?32:vb(i.type))}function $a(i,s){var u=Z.p;try{return Z.p=i,s()}finally{Z.p=u}}var re=Math.random().toString(36).slice(2),ee="__reactFiber$"+re,ce="__reactProps$"+re,Oe="__reactContainer$"+re,Ye="__reactEvents$"+re,Ze="__reactListeners$"+re,pt="__reactHandles$"+re,ft="__reactResources$"+re,ni="__reactMarker$"+re;function io(i){delete i[ee],delete i[ce],delete i[Ye],delete i[Ze],delete i[pt]}function wr(i){var s=i[ee];if(s)return s;for(var u=i.parentNode;u;){if(s=u[Oe]||u[ee]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=nb(i);i!==null;){if(u=i[ee])return u;i=nb(i)}return s}i=u,u=i.parentNode}return null}function Pe(i){if(i=i[ee]||i[Oe]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function yn(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function sn(i){var s=i[ft];return s||(s=i[ft]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function tt(i){i[ni]=!0}var Ha=new Set,Ua={};function oo(i,s){qo(i,s),qo(i+"Capture",s)}function qo(i,s){for(Ua[i]=s,i=0;i<s.length;i++)Ha.add(s[i])}var fT=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Bg={},Vg={};function dT(i){return Zr.call(Vg,i)?!0:Zr.call(Bg,i)?!1:fT.test(i)?Vg[i]=!0:(Bg[i]=!0,!1)}function Ga(i,s,u){if(dT(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var f=s.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function qa(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function Cr(i,s,u,f){if(f===null)i.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+f)}}function kn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Fg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function hT(i,s,u){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var m=f.get,y=f.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return m.call(this)},set:function(w){u=""+w,y.call(this,w)}}),Object.defineProperty(i,s,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Bf(i){if(!i._valueTracker){var s=Fg(i)?"checked":"value";i._valueTracker=hT(i,s,""+i[s])}}function Pg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),f="";return i&&(f=Fg(i)?i.checked?"true":"false":i.value),i=f,i!==u?(s.setValue(i),!0):!1}function Ka(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var pT=/[\n"\\]/g;function Nn(i){return i.replace(pT,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Vf(i,s,u,f,m,y,w,T){i.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.type=w:i.removeAttribute("type"),s!=null?w==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+kn(s)):i.value!==""+kn(s)&&(i.value=""+kn(s)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),s!=null?Ff(i,w,kn(s)):u!=null?Ff(i,w,kn(u)):f!=null&&i.removeAttribute("value"),m==null&&y!=null&&(i.defaultChecked=!!y),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.name=""+kn(T):i.removeAttribute("name")}function $g(i,s,u,f,m,y,w,T){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),s!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Bf(i);return}u=u!=null?""+kn(u):"",s=s!=null?""+kn(s):u,T||s===i.value||(i.value=s),i.defaultValue=s}f=f??m,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=T?i.checked:!!f,i.defaultChecked=!!f,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),Bf(i)}function Ff(i,s,u){s==="number"&&Ka(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Ko(i,s,u,f){if(i=i.options,s){s={};for(var m=0;m<u.length;m++)s["$"+u[m]]=!0;for(u=0;u<i.length;u++)m=s.hasOwnProperty("$"+i[u].value),i[u].selected!==m&&(i[u].selected=m),m&&f&&(i[u].defaultSelected=!0)}else{for(u=""+kn(u),s=null,m=0;m<i.length;m++){if(i[m].value===u){i[m].selected=!0,f&&(i[m].defaultSelected=!0);return}s!==null||i[m].disabled||(s=i[m])}s!==null&&(s.selected=!0)}}function Hg(i,s,u){if(s!=null&&(s=""+kn(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+kn(u):""}function Ug(i,s,u,f){if(s==null){if(f!=null){if(u!=null)throw Error(r(92));if(ve(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),s=u}u=kn(s),i.defaultValue=u,f=i.textContent,f===u&&f!==""&&f!==null&&(i.value=f),Bf(i)}function Yo(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var mT=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Gg(i,s,u){var f=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":f?i.setProperty(s,u):typeof u!="number"||u===0||mT.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function qg(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||s!=null&&s.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var m in s)f=s[m],s.hasOwnProperty(m)&&u[m]!==f&&Gg(i,m,f)}else for(var y in s)s.hasOwnProperty(y)&&Gg(i,y,s[y])}function Pf(i){if(i.indexOf("-")===-1)return!1;switch(i){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 gT=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yT=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ya(i){return yT.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Mr(){}var $f=null;function Hf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Xo=null,Jo=null;function Kg(i){var s=Pe(i);if(s&&(i=s.stateNode)){var u=i[ce]||null;e:switch(i=s.stateNode,s.type){case"input":if(Vf(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Nn(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var f=u[s];if(f!==i&&f.form===i.form){var m=f[ce]||null;if(!m)throw Error(r(90));Vf(f,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(s=0;s<u.length;s++)f=u[s],f.form===i.form&&Pg(f)}break e;case"textarea":Hg(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Ko(i,!!u.multiple,s,!1)}}}var Uf=!1;function Yg(i,s,u){if(Uf)return i(s,u);Uf=!0;try{var f=i(s);return f}finally{if(Uf=!1,(Xo!==null||Jo!==null)&&(ju(),Xo&&(s=Xo,i=Jo,Jo=Xo=null,Kg(s),i)))for(s=0;s<i.length;s++)Kg(i[s])}}function sl(i,s){var u=i.stateNode;if(u===null)return null;var f=u[ce]||null;if(f===null)return null;u=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var Er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gf=!1;if(Er)try{var ll={};Object.defineProperty(ll,"passive",{get:function(){Gf=!0}}),window.addEventListener("test",ll,ll),window.removeEventListener("test",ll,ll)}catch{Gf=!1}var ri=null,qf=null,Xa=null;function Xg(){if(Xa)return Xa;var i,s=qf,u=s.length,f,m="value"in ri?ri.value:ri.textContent,y=m.length;for(i=0;i<u&&s[i]===m[i];i++);var w=u-i;for(f=1;f<=w&&s[u-f]===m[y-f];f++);return Xa=m.slice(i,1<f?1-f:void 0)}function Ja(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Qa(){return!0}function Jg(){return!1}function ln(i){function s(u,f,m,y,w){this._reactName=u,this._targetInst=m,this.type=f,this.nativeEvent=y,this.target=w,this.currentTarget=null;for(var T in i)i.hasOwnProperty(T)&&(u=i[T],this[T]=u?u(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Qa:Jg,this.isPropagationStopped=Jg,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Qa)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Qa)},persist:function(){},isPersistent:Qa}),s}var so={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Za=ln(so),al=g({},so,{view:0,detail:0}),vT=ln(al),Kf,Yf,ul,Wa=g({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ul&&(ul&&i.type==="mousemove"?(Kf=i.screenX-ul.screenX,Yf=i.screenY-ul.screenY):Yf=Kf=0,ul=i),Kf)},movementY:function(i){return"movementY"in i?i.movementY:Yf}}),Qg=ln(Wa),bT=g({},Wa,{dataTransfer:0}),ST=ln(bT),xT=g({},al,{relatedTarget:0}),Xf=ln(xT),wT=g({},so,{animationName:0,elapsedTime:0,pseudoElement:0}),CT=ln(wT),MT=g({},so,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),ET=ln(MT),RT=g({},so,{data:0}),Zg=ln(RT),TT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AT={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"},OT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kT(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=OT[i])?!!s[i]:!1}function Jf(){return kT}var NT=g({},al,{key:function(i){if(i.key){var s=TT[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Ja(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?AT[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jf,charCode:function(i){return i.type==="keypress"?Ja(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ja(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),DT=ln(NT),_T=g({},Wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wg=ln(_T),zT=g({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jf}),jT=ln(zT),IT=g({},so,{propertyName:0,elapsedTime:0,pseudoElement:0}),LT=ln(IT),BT=g({},Wa,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),VT=ln(BT),FT=g({},so,{newState:0,oldState:0}),PT=ln(FT),$T=[9,13,27,32],Qf=Er&&"CompositionEvent"in window,cl=null;Er&&"documentMode"in document&&(cl=document.documentMode);var HT=Er&&"TextEvent"in window&&!cl,ey=Er&&(!Qf||cl&&8<cl&&11>=cl),ty=" ",ny=!1;function ry(i,s){switch(i){case"keyup":return $T.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iy(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Qo=!1;function UT(i,s){switch(i){case"compositionend":return iy(s);case"keypress":return s.which!==32?null:(ny=!0,ty);case"textInput":return i=s.data,i===ty&&ny?null:i;default:return null}}function GT(i,s){if(Qo)return i==="compositionend"||!Qf&&ry(i,s)?(i=Xg(),Xa=qf=ri=null,Qo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ey&&s.locale!=="ko"?null:s.data;default:return null}}var qT={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 oy(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!qT[i.type]:s==="textarea"}function sy(i,s,u,f){Xo?Jo?Jo.push(f):Jo=[f]:Xo=f,s=$u(s,"onChange"),0<s.length&&(u=new Za("onChange","change",null,u,f),i.push({event:u,listeners:s}))}var fl=null,dl=null;function KT(i){$v(i,0)}function eu(i){var s=yn(i);if(Pg(s))return i}function ly(i,s){if(i==="change")return s}var ay=!1;if(Er){var Zf;if(Er){var Wf="oninput"in document;if(!Wf){var uy=document.createElement("div");uy.setAttribute("oninput","return;"),Wf=typeof uy.oninput=="function"}Zf=Wf}else Zf=!1;ay=Zf&&(!document.documentMode||9<document.documentMode)}function cy(){fl&&(fl.detachEvent("onpropertychange",fy),dl=fl=null)}function fy(i){if(i.propertyName==="value"&&eu(dl)){var s=[];sy(s,dl,i,Hf(i)),Yg(KT,s)}}function YT(i,s,u){i==="focusin"?(cy(),fl=s,dl=u,fl.attachEvent("onpropertychange",fy)):i==="focusout"&&cy()}function XT(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return eu(dl)}function JT(i,s){if(i==="click")return eu(s)}function QT(i,s){if(i==="input"||i==="change")return eu(s)}function ZT(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var vn=typeof Object.is=="function"?Object.is:ZT;function hl(i,s){if(vn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),f=Object.keys(s);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var m=u[f];if(!Zr.call(s,m)||!vn(i[m],s[m]))return!1}return!0}function dy(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function hy(i,s){var u=dy(i);i=0;for(var f;u;){if(u.nodeType===3){if(f=i+u.textContent.length,i<=s&&f>=s)return{node:u,offset:s-i};i=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=dy(u)}}function py(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?py(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function my(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Ka(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=Ka(i.document)}return s}function ed(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var WT=Er&&"documentMode"in document&&11>=document.documentMode,Zo=null,td=null,pl=null,nd=!1;function gy(i,s,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;nd||Zo==null||Zo!==Ka(f)||(f=Zo,"selectionStart"in f&&ed(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),pl&&hl(pl,f)||(pl=f,f=$u(td,"onSelect"),0<f.length&&(s=new Za("onSelect","select",null,s,u),i.push({event:s,listeners:f}),s.target=Zo)))}function lo(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var Wo={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionrun:lo("Transition","TransitionRun"),transitionstart:lo("Transition","TransitionStart"),transitioncancel:lo("Transition","TransitionCancel"),transitionend:lo("Transition","TransitionEnd")},rd={},yy={};Er&&(yy=document.createElement("div").style,"AnimationEvent"in window||(delete Wo.animationend.animation,delete Wo.animationiteration.animation,delete Wo.animationstart.animation),"TransitionEvent"in window||delete Wo.transitionend.transition);function ao(i){if(rd[i])return rd[i];if(!Wo[i])return i;var s=Wo[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in yy)return rd[i]=s[u];return i}var vy=ao("animationend"),by=ao("animationiteration"),Sy=ao("animationstart"),eA=ao("transitionrun"),tA=ao("transitionstart"),nA=ao("transitioncancel"),xy=ao("transitionend"),wy=new Map,id="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");id.push("scrollEnd");function Yn(i,s){wy.set(i,s),oo(s,[i])}var tu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Dn=[],es=0,od=0;function nu(){for(var i=es,s=od=es=0;s<i;){var u=Dn[s];Dn[s++]=null;var f=Dn[s];Dn[s++]=null;var m=Dn[s];Dn[s++]=null;var y=Dn[s];if(Dn[s++]=null,f!==null&&m!==null){var w=f.pending;w===null?m.next=m:(m.next=w.next,w.next=m),f.pending=m}y!==0&&Cy(u,m,y)}}function ru(i,s,u,f){Dn[es++]=i,Dn[es++]=s,Dn[es++]=u,Dn[es++]=f,od|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function sd(i,s,u,f){return ru(i,s,u,f),iu(i)}function uo(i,s){return ru(i,null,null,s),iu(i)}function Cy(i,s,u){i.lanes|=u;var f=i.alternate;f!==null&&(f.lanes|=u);for(var m=!1,y=i.return;y!==null;)y.childLanes|=u,f=y.alternate,f!==null&&(f.childLanes|=u),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(m=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,m&&s!==null&&(m=31-Wt(u),i=y.hiddenUpdates,f=i[m],f===null?i[m]=[s]:f.push(s),s.lane=u|536870912),y):null}function iu(i){if(50<Il)throw Il=0,mh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var ts={};function rA(i,s,u,f){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(i,s,u,f){return new rA(i,s,u,f)}function ld(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Rr(i,s){var u=i.alternate;return u===null?(u=bn(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function My(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function ou(i,s,u,f,m,y){var w=0;if(f=i,typeof i=="function")ld(i)&&(w=1);else if(typeof i=="string")w=aO(i,u,ne.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Q:return i=bn(31,u,s,m),i.elementType=Q,i.lanes=y,i;case x:return co(u.children,m,y,s);case C:w=8,m|=24;break;case E:return i=bn(12,u,s,m|2),i.elementType=E,i.lanes=y,i;case z:return i=bn(13,u,s,m),i.elementType=z,i.lanes=y,i;case L:return i=bn(19,u,s,m),i.elementType=L,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case O:w=10;break e;case A:w=9;break e;case D:w=11;break e;case _:w=14;break e;case I:w=16,f=null;break e}w=29,u=Error(r(130,i===null?"null":typeof i,"")),f=null}return s=bn(w,u,s,m),s.elementType=i,s.type=f,s.lanes=y,s}function co(i,s,u,f){return i=bn(7,i,f,s),i.lanes=u,i}function ad(i,s,u){return i=bn(6,i,null,s),i.lanes=u,i}function Ey(i){var s=bn(18,null,null,0);return s.stateNode=i,s}function ud(i,s,u){return s=bn(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ry=new WeakMap;function _n(i,s){if(typeof i=="object"&&i!==null){var u=Ry.get(i);return u!==void 0?u:(s={value:i,source:s,stack:qn(s)},Ry.set(i,s),s)}return{value:i,source:s,stack:qn(s)}}var ns=[],rs=0,su=null,ml=0,zn=[],jn=0,ii=null,sr=1,lr="";function Tr(i,s){ns[rs++]=ml,ns[rs++]=su,su=i,ml=s}function Ty(i,s,u){zn[jn++]=sr,zn[jn++]=lr,zn[jn++]=ii,ii=i;var f=sr;i=lr;var m=32-Wt(f)-1;f&=~(1<<m),u+=1;var y=32-Wt(s)+m;if(30<y){var w=m-m%5;y=(f&(1<<w)-1).toString(32),f>>=w,m-=w,sr=1<<32-Wt(s)+m|u<<m|f,lr=y+i}else sr=1<<y|u<<m|f,lr=i}function cd(i){i.return!==null&&(Tr(i,1),Ty(i,1,0))}function fd(i){for(;i===su;)su=ns[--rs],ns[rs]=null,ml=ns[--rs],ns[rs]=null;for(;i===ii;)ii=zn[--jn],zn[jn]=null,lr=zn[--jn],zn[jn]=null,sr=zn[--jn],zn[jn]=null}function Ay(i,s){zn[jn++]=sr,zn[jn++]=lr,zn[jn++]=ii,sr=s.id,lr=s.overflow,ii=i}var Dt=null,nt=null,Fe=!1,oi=null,In=!1,dd=Error(r(519));function si(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gl(_n(s,i)),dd}function Oy(i){var s=i.stateNode,u=i.type,f=i.memoizedProps;switch(s[ee]=i,s[ce]=f,u){case"dialog":Le("cancel",s),Le("close",s);break;case"iframe":case"object":case"embed":Le("load",s);break;case"video":case"audio":for(u=0;u<Bl.length;u++)Le(Bl[u],s);break;case"source":Le("error",s);break;case"img":case"image":case"link":Le("error",s),Le("load",s);break;case"details":Le("toggle",s);break;case"input":Le("invalid",s),$g(s,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Le("invalid",s);break;case"textarea":Le("invalid",s),Ug(s,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||f.suppressHydrationWarning===!0||qv(s.textContent,u)?(f.popover!=null&&(Le("beforetoggle",s),Le("toggle",s)),f.onScroll!=null&&Le("scroll",s),f.onScrollEnd!=null&&Le("scrollend",s),f.onClick!=null&&(s.onclick=Mr),s=!0):s=!1,s||si(i,!0)}function ky(i){for(Dt=i.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:In=!1;return;case 27:case 3:In=!0;return;default:Dt=Dt.return}}function is(i){if(i!==Dt)return!1;if(!Fe)return ky(i),Fe=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||kh(i.type,i.memoizedProps)),u=!u),u&&nt&&si(i),ky(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));nt=tb(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));nt=tb(i)}else s===27?(s=nt,Si(i.type)?(i=jh,jh=null,nt=i):nt=s):nt=Dt?Bn(i.stateNode.nextSibling):null;return!0}function fo(){nt=Dt=null,Fe=!1}function hd(){var i=oi;return i!==null&&(fn===null?fn=i:fn.push.apply(fn,i),oi=null),i}function gl(i){oi===null?oi=[i]:oi.push(i)}var pd=N(null),ho=null,Ar=null;function li(i,s,u){X(pd,s._currentValue),s._currentValue=u}function Or(i){i._currentValue=pd.current,F(pd)}function md(i,s,u){for(;i!==null;){var f=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),i===u)break;i=i.return}}function gd(i,s,u,f){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var y=m.dependencies;if(y!==null){var w=m.child;y=y.firstContext;e:for(;y!==null;){var T=y;y=m;for(var k=0;k<s.length;k++)if(T.context===s[k]){y.lanes|=u,T=y.alternate,T!==null&&(T.lanes|=u),md(y.return,u,i),f||(w=null);break e}y=T.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=u,y=w.alternate,y!==null&&(y.lanes|=u),md(w,u,i),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===i){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function ss(i,s,u,f){i=null;for(var m=s,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var T=m.type;vn(m.pendingProps.value,w.value)||(i!==null?i.push(T):i=[T])}}else if(m===me.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Hl):i=[Hl])}m=m.return}i!==null&&gd(s,i,u,f),s.flags|=262144}function lu(i){for(i=i.firstContext;i!==null;){if(!vn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function po(i){ho=i,Ar=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function _t(i){return Ny(ho,i)}function au(i,s){return ho===null&&po(i),Ny(i,s)}function Ny(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Ar===null){if(i===null)throw Error(r(308));Ar=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ar=Ar.next=s;return u}var iA=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,f){i.push(f)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},oA=t.unstable_scheduleCallback,sA=t.unstable_NormalPriority,mt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yd(){return{controller:new iA,data:new Map,refCount:0}}function yl(i){i.refCount--,i.refCount===0&&oA(sA,function(){i.controller.abort()})}var vl=null,vd=0,ls=0,as=null;function lA(i,s){if(vl===null){var u=vl=[];vd=0,ls=xh(),as={status:"pending",value:void 0,then:function(f){u.push(f)}}}return vd++,s.then(Dy,Dy),s}function Dy(){if(--vd===0&&vl!==null){as!==null&&(as.status="fulfilled");var i=vl;vl=null,ls=0,as=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function aA(i,s){var u=[],f={status:"pending",value:null,reason:null,then:function(m){u.push(m)}};return i.then(function(){f.status="fulfilled",f.value=s;for(var m=0;m<u.length;m++)(0,u[m])(s)},function(m){for(f.status="rejected",f.reason=m,m=0;m<u.length;m++)(0,u[m])(void 0)}),f}var _y=V.S;V.S=function(i,s){gv=Qt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&lA(i,s),_y!==null&&_y(i,s)};var mo=N(null);function bd(){var i=mo.current;return i!==null?i:We.pooledCache}function uu(i,s){s===null?X(mo,mo.current):X(mo,s.pool)}function zy(){var i=bd();return i===null?null:{parent:mt._currentValue,pool:i}}var us=Error(r(460)),Sd=Error(r(474)),cu=Error(r(542)),fu={then:function(){}};function jy(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Iy(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(Mr,Mr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,By(i),i;default:if(typeof s.status=="string")s.then(Mr,Mr);else{if(i=We,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(f){if(s.status==="pending"){var m=s;m.status="fulfilled",m.value=f}},function(f){if(s.status==="pending"){var m=s;m.status="rejected",m.reason=f}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,By(i),i}throw yo=s,us}}function go(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(yo=u,us):u}}var yo=null;function Ly(){if(yo===null)throw Error(r(459));var i=yo;return yo=null,i}function By(i){if(i===us||i===cu)throw Error(r(483))}var cs=null,bl=0;function du(i){var s=bl;return bl+=1,cs===null&&(cs=[]),Iy(cs,i,s)}function Sl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function hu(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Vy(i){function s(B,j){if(i){var P=B.deletions;P===null?(B.deletions=[j],B.flags|=16):P.push(j)}}function u(B,j){if(!i)return null;for(;j!==null;)s(B,j),j=j.sibling;return null}function f(B){for(var j=new Map;B!==null;)B.key!==null?j.set(B.key,B):j.set(B.index,B),B=B.sibling;return j}function m(B,j){return B=Rr(B,j),B.index=0,B.sibling=null,B}function y(B,j,P){return B.index=P,i?(P=B.alternate,P!==null?(P=P.index,P<j?(B.flags|=67108866,j):P):(B.flags|=67108866,j)):(B.flags|=1048576,j)}function w(B){return i&&B.alternate===null&&(B.flags|=67108866),B}function T(B,j,P,J){return j===null||j.tag!==6?(j=ad(P,B.mode,J),j.return=B,j):(j=m(j,P),j.return=B,j)}function k(B,j,P,J){var Se=P.type;return Se===x?Y(B,j,P.props.children,J,P.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===I&&go(Se)===j.type)?(j=m(j,P.props),Sl(j,P),j.return=B,j):(j=ou(P.type,P.key,P.props,null,B.mode,J),Sl(j,P),j.return=B,j)}function $(B,j,P,J){return j===null||j.tag!==4||j.stateNode.containerInfo!==P.containerInfo||j.stateNode.implementation!==P.implementation?(j=ud(P,B.mode,J),j.return=B,j):(j=m(j,P.children||[]),j.return=B,j)}function Y(B,j,P,J,Se){return j===null||j.tag!==7?(j=co(P,B.mode,J,Se),j.return=B,j):(j=m(j,P),j.return=B,j)}function W(B,j,P){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=ad(""+j,B.mode,P),j.return=B,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case b:return P=ou(j.type,j.key,j.props,null,B.mode,P),Sl(P,j),P.return=B,P;case S:return j=ud(j,B.mode,P),j.return=B,j;case I:return j=go(j),W(B,j,P)}if(ve(j)||le(j))return j=co(j,B.mode,P,null),j.return=B,j;if(typeof j.then=="function")return W(B,du(j),P);if(j.$$typeof===O)return W(B,au(B,j),P);hu(B,j)}return null}function H(B,j,P,J){var Se=j!==null?j.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return Se!==null?null:T(B,j,""+P,J);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case b:return P.key===Se?k(B,j,P,J):null;case S:return P.key===Se?$(B,j,P,J):null;case I:return P=go(P),H(B,j,P,J)}if(ve(P)||le(P))return Se!==null?null:Y(B,j,P,J,null);if(typeof P.then=="function")return H(B,j,du(P),J);if(P.$$typeof===O)return H(B,j,au(B,P),J);hu(B,P)}return null}function G(B,j,P,J,Se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return B=B.get(P)||null,T(j,B,""+J,Se);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return B=B.get(J.key===null?P:J.key)||null,k(j,B,J,Se);case S:return B=B.get(J.key===null?P:J.key)||null,$(j,B,J,Se);case I:return J=go(J),G(B,j,P,J,Se)}if(ve(J)||le(J))return B=B.get(P)||null,Y(j,B,J,Se,null);if(typeof J.then=="function")return G(B,j,P,du(J),Se);if(J.$$typeof===O)return G(B,j,P,au(j,J),Se);hu(j,J)}return null}function de(B,j,P,J){for(var Se=null,$e=null,ge=j,ke=j=0,Ve=null;ge!==null&&ke<P.length;ke++){ge.index>ke?(Ve=ge,ge=null):Ve=ge.sibling;var He=H(B,ge,P[ke],J);if(He===null){ge===null&&(ge=Ve);break}i&&ge&&He.alternate===null&&s(B,ge),j=y(He,j,ke),$e===null?Se=He:$e.sibling=He,$e=He,ge=Ve}if(ke===P.length)return u(B,ge),Fe&&Tr(B,ke),Se;if(ge===null){for(;ke<P.length;ke++)ge=W(B,P[ke],J),ge!==null&&(j=y(ge,j,ke),$e===null?Se=ge:$e.sibling=ge,$e=ge);return Fe&&Tr(B,ke),Se}for(ge=f(ge);ke<P.length;ke++)Ve=G(ge,B,ke,P[ke],J),Ve!==null&&(i&&Ve.alternate!==null&&ge.delete(Ve.key===null?ke:Ve.key),j=y(Ve,j,ke),$e===null?Se=Ve:$e.sibling=Ve,$e=Ve);return i&&ge.forEach(function(Ei){return s(B,Ei)}),Fe&&Tr(B,ke),Se}function Ce(B,j,P,J){if(P==null)throw Error(r(151));for(var Se=null,$e=null,ge=j,ke=j=0,Ve=null,He=P.next();ge!==null&&!He.done;ke++,He=P.next()){ge.index>ke?(Ve=ge,ge=null):Ve=ge.sibling;var Ei=H(B,ge,He.value,J);if(Ei===null){ge===null&&(ge=Ve);break}i&&ge&&Ei.alternate===null&&s(B,ge),j=y(Ei,j,ke),$e===null?Se=Ei:$e.sibling=Ei,$e=Ei,ge=Ve}if(He.done)return u(B,ge),Fe&&Tr(B,ke),Se;if(ge===null){for(;!He.done;ke++,He=P.next())He=W(B,He.value,J),He!==null&&(j=y(He,j,ke),$e===null?Se=He:$e.sibling=He,$e=He);return Fe&&Tr(B,ke),Se}for(ge=f(ge);!He.done;ke++,He=P.next())He=G(ge,B,ke,He.value,J),He!==null&&(i&&He.alternate!==null&&ge.delete(He.key===null?ke:He.key),j=y(He,j,ke),$e===null?Se=He:$e.sibling=He,$e=He);return i&&ge.forEach(function(bO){return s(B,bO)}),Fe&&Tr(B,ke),Se}function Qe(B,j,P,J){if(typeof P=="object"&&P!==null&&P.type===x&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case b:e:{for(var Se=P.key;j!==null;){if(j.key===Se){if(Se=P.type,Se===x){if(j.tag===7){u(B,j.sibling),J=m(j,P.props.children),J.return=B,B=J;break e}}else if(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===I&&go(Se)===j.type){u(B,j.sibling),J=m(j,P.props),Sl(J,P),J.return=B,B=J;break e}u(B,j);break}else s(B,j);j=j.sibling}P.type===x?(J=co(P.props.children,B.mode,J,P.key),J.return=B,B=J):(J=ou(P.type,P.key,P.props,null,B.mode,J),Sl(J,P),J.return=B,B=J)}return w(B);case S:e:{for(Se=P.key;j!==null;){if(j.key===Se)if(j.tag===4&&j.stateNode.containerInfo===P.containerInfo&&j.stateNode.implementation===P.implementation){u(B,j.sibling),J=m(j,P.children||[]),J.return=B,B=J;break e}else{u(B,j);break}else s(B,j);j=j.sibling}J=ud(P,B.mode,J),J.return=B,B=J}return w(B);case I:return P=go(P),Qe(B,j,P,J)}if(ve(P))return de(B,j,P,J);if(le(P)){if(Se=le(P),typeof Se!="function")throw Error(r(150));return P=Se.call(P),Ce(B,j,P,J)}if(typeof P.then=="function")return Qe(B,j,du(P),J);if(P.$$typeof===O)return Qe(B,j,au(B,P),J);hu(B,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,j!==null&&j.tag===6?(u(B,j.sibling),J=m(j,P),J.return=B,B=J):(u(B,j),J=ad(P,B.mode,J),J.return=B,B=J),w(B)):u(B,j)}return function(B,j,P,J){try{bl=0;var Se=Qe(B,j,P,J);return cs=null,Se}catch(ge){if(ge===us||ge===cu)throw ge;var $e=bn(29,ge,null,B.mode);return $e.lanes=J,$e.return=B,$e}}}var vo=Vy(!0),Fy=Vy(!1),ai=!1;function xd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wd(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function ui(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ci(i,s,u){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(Ge&2)!==0){var m=f.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),f.pending=s,s=iu(i),Cy(i,null,u),s}return ru(i,f,s,u),iu(i)}function xl(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,xr(i,u)}}function Cd(i,s){var u=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=s:y=y.next=s}else m=y=s;u={baseState:f.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var Md=!1;function wl(){if(Md){var i=as;if(i!==null)throw i}}function Cl(i,s,u,f){Md=!1;var m=i.updateQueue;ai=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,T=m.shared.pending;if(T!==null){m.shared.pending=null;var k=T,$=k.next;k.next=null,w===null?y=$:w.next=$,w=k;var Y=i.alternate;Y!==null&&(Y=Y.updateQueue,T=Y.lastBaseUpdate,T!==w&&(T===null?Y.firstBaseUpdate=$:T.next=$,Y.lastBaseUpdate=k))}if(y!==null){var W=m.baseState;w=0,Y=$=k=null,T=y;do{var H=T.lane&-536870913,G=H!==T.lane;if(G?(Be&H)===H:(f&H)===H){H!==0&&H===ls&&(Md=!0),Y!==null&&(Y=Y.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var de=i,Ce=T;H=s;var Qe=u;switch(Ce.tag){case 1:if(de=Ce.payload,typeof de=="function"){W=de.call(Qe,W,H);break e}W=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Ce.payload,H=typeof de=="function"?de.call(Qe,W,H):de,H==null)break e;W=g({},W,H);break e;case 2:ai=!0}}H=T.callback,H!==null&&(i.flags|=64,G&&(i.flags|=8192),G=m.callbacks,G===null?m.callbacks=[H]:G.push(H))}else G={lane:H,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Y===null?($=Y=G,k=W):Y=Y.next=G,w|=H;if(T=T.next,T===null){if(T=m.shared.pending,T===null)break;G=T,T=G.next,G.next=null,m.lastBaseUpdate=G,m.shared.pending=null}}while(!0);Y===null&&(k=W),m.baseState=k,m.firstBaseUpdate=$,m.lastBaseUpdate=Y,y===null&&(m.shared.lanes=0),mi|=w,i.lanes=w,i.memoizedState=W}}function Py(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function $y(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Py(u[i],s)}var fs=N(null),pu=N(0);function Hy(i,s){i=Br,X(pu,i),X(fs,s),Br=i|s.baseLanes}function Ed(){X(pu,Br),X(fs,fs.current)}function Rd(){Br=pu.current,F(fs),F(pu)}var Sn=N(null),Ln=null;function fi(i){var s=i.alternate;X(dt,dt.current&1),X(Sn,i),Ln===null&&(s===null||fs.current!==null||s.memoizedState!==null)&&(Ln=i)}function Td(i){X(dt,dt.current),X(Sn,i),Ln===null&&(Ln=i)}function Uy(i){i.tag===22?(X(dt,dt.current),X(Sn,i),Ln===null&&(Ln=i)):di()}function di(){X(dt,dt.current),X(Sn,Sn.current)}function xn(i){F(Sn),Ln===i&&(Ln=null),F(dt)}var dt=N(0);function mu(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||_h(u)||zh(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var kr=0,Te=null,Xe=null,gt=null,gu=!1,ds=!1,bo=!1,yu=0,Ml=0,hs=null,uA=0;function at(){throw Error(r(321))}function Ad(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!vn(i[u],s[u]))return!1;return!0}function Od(i,s,u,f,m,y){return kr=y,Te=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,V.H=i===null||i.memoizedState===null?T0:Ud,bo=!1,y=u(f,m),bo=!1,ds&&(y=qy(s,u,f,m)),Gy(i),y}function Gy(i){V.H=Tl;var s=Xe!==null&&Xe.next!==null;if(kr=0,gt=Xe=Te=null,gu=!1,Ml=0,hs=null,s)throw Error(r(300));i===null||yt||(i=i.dependencies,i!==null&&lu(i)&&(yt=!0))}function qy(i,s,u,f){Te=i;var m=0;do{if(ds&&(hs=null),Ml=0,ds=!1,25<=m)throw Error(r(301));if(m+=1,gt=Xe=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}V.H=A0,y=s(u,f)}while(ds);return y}function cA(){var i=V.H,s=i.useState()[0];return s=typeof s.then=="function"?El(s):s,i=i.useState()[0],(Xe!==null?Xe.memoizedState:null)!==i&&(Te.flags|=1024),s}function kd(){var i=yu!==0;return yu=0,i}function Nd(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Dd(i){if(gu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}gu=!1}kr=0,gt=Xe=Te=null,ds=!1,Ml=yu=0,hs=null}function en(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Te.memoizedState=gt=i:gt=gt.next=i,gt}function ht(){if(Xe===null){var i=Te.alternate;i=i!==null?i.memoizedState:null}else i=Xe.next;var s=gt===null?Te.memoizedState:gt.next;if(s!==null)gt=s,Xe=i;else{if(i===null)throw Te.alternate===null?Error(r(467)):Error(r(310));Xe=i,i={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},gt===null?Te.memoizedState=gt=i:gt=gt.next=i}return gt}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function El(i){var s=Ml;return Ml+=1,hs===null&&(hs=[]),i=Iy(hs,i,s),s=Te,(gt===null?s.memoizedState:gt.next)===null&&(s=s.alternate,V.H=s===null||s.memoizedState===null?T0:Ud),i}function bu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return El(i);if(i.$$typeof===O)return _t(i)}throw Error(r(438,String(i)))}function _d(i){var s=null,u=Te.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var f=Te.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(s={data:f.data.map(function(m){return m.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=vu(),Te.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),f=0;f<i;f++)u[f]=ue;return s.index++,u}function Nr(i,s){return typeof s=="function"?s(i):s}function Su(i){var s=ht();return zd(s,Xe,i)}function zd(i,s,u){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var m=i.baseQueue,y=f.pending;if(y!==null){if(m!==null){var w=m.next;m.next=y.next,y.next=w}s.baseQueue=m=y,f.pending=null}if(y=i.baseState,m===null)i.memoizedState=y;else{s=m.next;var T=w=null,k=null,$=s,Y=!1;do{var W=$.lane&-536870913;if(W!==$.lane?(Be&W)===W:(kr&W)===W){var H=$.revertLane;if(H===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),W===ls&&(Y=!0);else if((kr&H)===H){$=$.next,H===ls&&(Y=!0);continue}else W={lane:0,revertLane:$.revertLane,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},k===null?(T=k=W,w=y):k=k.next=W,Te.lanes|=H,mi|=H;W=$.action,bo&&u(y,W),y=$.hasEagerState?$.eagerState:u(y,W)}else H={lane:W,revertLane:$.revertLane,gesture:$.gesture,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},k===null?(T=k=H,w=y):k=k.next=H,Te.lanes|=W,mi|=W;$=$.next}while($!==null&&$!==s);if(k===null?w=y:k.next=T,!vn(y,i.memoizedState)&&(yt=!0,Y&&(u=as,u!==null)))throw u;i.memoizedState=y,i.baseState=w,i.baseQueue=k,f.lastRenderedState=y}return m===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function jd(i){var s=ht(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var f=u.dispatch,m=u.pending,y=s.memoizedState;if(m!==null){u.pending=null;var w=m=m.next;do y=i(y,w.action),w=w.next;while(w!==m);vn(y,s.memoizedState)||(yt=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,f]}function Ky(i,s,u){var f=Te,m=ht(),y=Fe;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=s();var w=!vn((Xe||m).memoizedState,u);if(w&&(m.memoizedState=u,yt=!0),m=m.queue,Bd(Jy.bind(null,f,m,i),[i]),m.getSnapshot!==s||w||gt!==null&>.memoizedState.tag&1){if(f.flags|=2048,ps(9,{destroy:void 0},Xy.bind(null,f,m,u,s),null),We===null)throw Error(r(349));y||(kr&127)!==0||Yy(f,s,u)}return u}function Yy(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=Te.updateQueue,s===null?(s=vu(),Te.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function Xy(i,s,u,f){s.value=u,s.getSnapshot=f,Qy(s)&&Zy(i)}function Jy(i,s,u){return u(function(){Qy(s)&&Zy(i)})}function Qy(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!vn(i,u)}catch{return!0}}function Zy(i){var s=uo(i,2);s!==null&&dn(s,i,2)}function Id(i){var s=en();if(typeof i=="function"){var u=i;if(i=u(),bo){ir(!0);try{u()}finally{ir(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:i},s}function Wy(i,s,u,f){return i.baseState=u,zd(i,Xe,typeof f=="function"?f:Nr)}function fA(i,s,u,f,m){if(Cu(i))throw Error(r(485));if(i=s.action,i!==null){var y={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){y.listeners.push(w)}};V.T!==null?u(!0):y.isTransition=!1,f(y),u=s.pending,u===null?(y.next=s.pending=y,e0(s,y)):(y.next=u.next,s.pending=u.next=y)}}function e0(i,s){var u=s.action,f=s.payload,m=i.state;if(s.isTransition){var y=V.T,w={};V.T=w;try{var T=u(m,f),k=V.S;k!==null&&k(w,T),t0(i,s,T)}catch($){Ld(i,s,$)}finally{y!==null&&w.types!==null&&(y.types=w.types),V.T=y}}else try{y=u(m,f),t0(i,s,y)}catch($){Ld(i,s,$)}}function t0(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){n0(i,s,f)},function(f){return Ld(i,s,f)}):n0(i,s,u)}function n0(i,s,u){s.status="fulfilled",s.value=u,r0(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,e0(i,u)))}function Ld(i,s,u){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do s.status="rejected",s.reason=u,r0(s),s=s.next;while(s!==f)}i.action=null}function r0(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function i0(i,s){return s}function o0(i,s){if(Fe){var u=We.formState;if(u!==null){e:{var f=Te;if(Fe){if(nt){t:{for(var m=nt,y=In;m.nodeType!==8;){if(!y){m=null;break t}if(m=Bn(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){nt=Bn(m.nextSibling),f=m.data==="F!";break e}}si(f)}f=!1}f&&(s=u[0])}}return u=en(),u.memoizedState=u.baseState=s,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i0,lastRenderedState:s},u.queue=f,u=M0.bind(null,Te,f),f.dispatch=u,f=Id(!1),y=Hd.bind(null,Te,!1,f.queue),f=en(),m={state:s,dispatch:null,action:i,pending:null},f.queue=m,u=fA.bind(null,Te,m,y,u),m.dispatch=u,f.memoizedState=i,[s,u,!1]}function s0(i){var s=ht();return l0(s,Xe,i)}function l0(i,s,u){if(s=zd(i,s,i0)[0],i=Su(Nr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var f=El(s)}catch(w){throw w===us?cu:w}else f=s;s=ht();var m=s.queue,y=m.dispatch;return u!==s.memoizedState&&(Te.flags|=2048,ps(9,{destroy:void 0},dA.bind(null,m,u),null)),[f,y,i]}function dA(i,s){i.action=s}function a0(i){var s=ht(),u=Xe;if(u!==null)return l0(s,u,i);ht(),s=s.memoizedState,u=ht();var f=u.queue.dispatch;return u.memoizedState=i,[s,f,!1]}function ps(i,s,u,f){return i={tag:i,create:u,deps:f,inst:s,next:null},s=Te.updateQueue,s===null&&(s=vu(),Te.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(f=u.next,u.next=i,i.next=f,s.lastEffect=i),i}function u0(){return ht().memoizedState}function xu(i,s,u,f){var m=en();Te.flags|=i,m.memoizedState=ps(1|s,{destroy:void 0},u,f===void 0?null:f)}function wu(i,s,u,f){var m=ht();f=f===void 0?null:f;var y=m.memoizedState.inst;Xe!==null&&f!==null&&Ad(f,Xe.memoizedState.deps)?m.memoizedState=ps(s,y,u,f):(Te.flags|=i,m.memoizedState=ps(1|s,y,u,f))}function c0(i,s){xu(8390656,8,i,s)}function Bd(i,s){wu(2048,8,i,s)}function hA(i){Te.flags|=4;var s=Te.updateQueue;if(s===null)s=vu(),Te.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function f0(i){var s=ht().memoizedState;return hA({ref:s,nextImpl:i}),function(){if((Ge&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function d0(i,s){return wu(4,2,i,s)}function h0(i,s){return wu(4,4,i,s)}function p0(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function m0(i,s,u){u=u!=null?u.concat([i]):null,wu(4,4,p0.bind(null,s,i),u)}function Vd(){}function g0(i,s){var u=ht();s=s===void 0?null:s;var f=u.memoizedState;return s!==null&&Ad(s,f[1])?f[0]:(u.memoizedState=[i,s],i)}function y0(i,s){var u=ht();s=s===void 0?null:s;var f=u.memoizedState;if(s!==null&&Ad(s,f[1]))return f[0];if(f=i(),bo){ir(!0);try{i()}finally{ir(!1)}}return u.memoizedState=[f,s],f}function Fd(i,s,u){return u===void 0||(kr&1073741824)!==0&&(Be&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=vv(),Te.lanes|=i,mi|=i,u)}function v0(i,s,u,f){return vn(u,s)?u:fs.current!==null?(i=Fd(i,u,f),vn(i,s)||(yt=!0),i):(kr&42)===0||(kr&1073741824)!==0&&(Be&261930)===0?(yt=!0,i.memoizedState=u):(i=vv(),Te.lanes|=i,mi|=i,s)}function b0(i,s,u,f,m){var y=Z.p;Z.p=y!==0&&8>y?y:8;var w=V.T,T={};V.T=T,Hd(i,!1,s,u);try{var k=m(),$=V.S;if($!==null&&$(T,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var Y=aA(k,f);Rl(i,s,Y,Mn(i))}else Rl(i,s,f,Mn(i))}catch(W){Rl(i,s,{then:function(){},status:"rejected",reason:W},Mn())}finally{Z.p=y,w!==null&&T.types!==null&&(w.types=T.types),V.T=w}}function pA(){}function Pd(i,s,u,f){if(i.tag!==5)throw Error(r(476));var m=S0(i).queue;b0(i,m,s,U,u===null?pA:function(){return x0(i),u(f)})}function S0(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:U},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function x0(i){var s=S0(i);s.next===null&&(s=i.alternate.memoizedState),Rl(i,s.next.queue,{},Mn())}function $d(){return _t(Hl)}function w0(){return ht().memoizedState}function C0(){return ht().memoizedState}function mA(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Mn();i=ui(u);var f=ci(s,i,u);f!==null&&(dn(f,s,u),xl(f,s,u)),s={cache:yd()},i.payload=s;return}s=s.return}}function gA(i,s,u){var f=Mn();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Cu(i)?E0(s,u):(u=sd(i,s,u,f),u!==null&&(dn(u,i,f),R0(u,s,f)))}function M0(i,s,u){var f=Mn();Rl(i,s,u,f)}function Rl(i,s,u,f){var m={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Cu(i))E0(s,m);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var w=s.lastRenderedState,T=y(w,u);if(m.hasEagerState=!0,m.eagerState=T,vn(T,w))return ru(i,s,m,0),We===null&&nu(),!1}catch{}if(u=sd(i,s,m,f),u!==null)return dn(u,i,f),R0(u,s,f),!0}return!1}function Hd(i,s,u,f){if(f={lane:2,revertLane:xh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Cu(i)){if(s)throw Error(r(479))}else s=sd(i,u,f,2),s!==null&&dn(s,i,2)}function Cu(i){var s=i.alternate;return i===Te||s!==null&&s===Te}function E0(i,s){ds=gu=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function R0(i,s,u){if((u&4194048)!==0){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,xr(i,u)}}var Tl={readContext:_t,use:bu,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Tl.useEffectEvent=at;var T0={readContext:_t,use:bu,useCallback:function(i,s){return en().memoizedState=[i,s===void 0?null:s],i},useContext:_t,useEffect:c0,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,xu(4194308,4,p0.bind(null,s,i),u)},useLayoutEffect:function(i,s){return xu(4194308,4,i,s)},useInsertionEffect:function(i,s){xu(4,2,i,s)},useMemo:function(i,s){var u=en();s=s===void 0?null:s;var f=i();if(bo){ir(!0);try{i()}finally{ir(!1)}}return u.memoizedState=[f,s],f},useReducer:function(i,s,u){var f=en();if(u!==void 0){var m=u(s);if(bo){ir(!0);try{u(s)}finally{ir(!1)}}}else m=s;return f.memoizedState=f.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},f.queue=i,i=i.dispatch=gA.bind(null,Te,i),[f.memoizedState,i]},useRef:function(i){var s=en();return i={current:i},s.memoizedState=i},useState:function(i){i=Id(i);var s=i.queue,u=M0.bind(null,Te,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Vd,useDeferredValue:function(i,s){var u=en();return Fd(u,i,s)},useTransition:function(){var i=Id(!1);return i=b0.bind(null,Te,i.queue,!0,!1),en().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var f=Te,m=en();if(Fe){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),We===null)throw Error(r(349));(Be&127)!==0||Yy(f,s,u)}m.memoizedState=u;var y={value:u,getSnapshot:s};return m.queue=y,c0(Jy.bind(null,f,y,i),[i]),f.flags|=2048,ps(9,{destroy:void 0},Xy.bind(null,f,y,u,s),null),u},useId:function(){var i=en(),s=We.identifierPrefix;if(Fe){var u=lr,f=sr;u=(f&~(1<<32-Wt(f)-1)).toString(32)+u,s="_"+s+"R_"+u,u=yu++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=uA++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:$d,useFormState:o0,useActionState:o0,useOptimistic:function(i){var s=en();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Hd.bind(null,Te,!0,u),u.dispatch=s,[i,s]},useMemoCache:_d,useCacheRefresh:function(){return en().memoizedState=mA.bind(null,Te)},useEffectEvent:function(i){var s=en(),u={impl:i};return s.memoizedState=u,function(){if((Ge&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Ud={readContext:_t,use:bu,useCallback:g0,useContext:_t,useEffect:Bd,useImperativeHandle:m0,useInsertionEffect:d0,useLayoutEffect:h0,useMemo:y0,useReducer:Su,useRef:u0,useState:function(){return Su(Nr)},useDebugValue:Vd,useDeferredValue:function(i,s){var u=ht();return v0(u,Xe.memoizedState,i,s)},useTransition:function(){var i=Su(Nr)[0],s=ht().memoizedState;return[typeof i=="boolean"?i:El(i),s]},useSyncExternalStore:Ky,useId:w0,useHostTransitionStatus:$d,useFormState:s0,useActionState:s0,useOptimistic:function(i,s){var u=ht();return Wy(u,Xe,i,s)},useMemoCache:_d,useCacheRefresh:C0};Ud.useEffectEvent=f0;var A0={readContext:_t,use:bu,useCallback:g0,useContext:_t,useEffect:Bd,useImperativeHandle:m0,useInsertionEffect:d0,useLayoutEffect:h0,useMemo:y0,useReducer:jd,useRef:u0,useState:function(){return jd(Nr)},useDebugValue:Vd,useDeferredValue:function(i,s){var u=ht();return Xe===null?Fd(u,i,s):v0(u,Xe.memoizedState,i,s)},useTransition:function(){var i=jd(Nr)[0],s=ht().memoizedState;return[typeof i=="boolean"?i:El(i),s]},useSyncExternalStore:Ky,useId:w0,useHostTransitionStatus:$d,useFormState:a0,useActionState:a0,useOptimistic:function(i,s){var u=ht();return Xe!==null?Wy(u,Xe,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:_d,useCacheRefresh:C0};A0.useEffectEvent=f0;function Gd(i,s,u,f){s=i.memoizedState,u=u(f,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var qd={enqueueSetState:function(i,s,u){i=i._reactInternals;var f=Mn(),m=ui(f);m.payload=s,u!=null&&(m.callback=u),s=ci(i,m,f),s!==null&&(dn(s,i,f),xl(s,i,f))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var f=Mn(),m=ui(f);m.tag=1,m.payload=s,u!=null&&(m.callback=u),s=ci(i,m,f),s!==null&&(dn(s,i,f),xl(s,i,f))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Mn(),f=ui(u);f.tag=2,s!=null&&(f.callback=s),s=ci(i,f,u),s!==null&&(dn(s,i,u),xl(s,i,u))}};function O0(i,s,u,f,m,y,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,y,w):s.prototype&&s.prototype.isPureReactComponent?!hl(u,f)||!hl(m,y):!0}function k0(i,s,u,f){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,f),s.state!==i&&qd.enqueueReplaceState(s,s.state,null)}function So(i,s){var u=s;if("ref"in s){u={};for(var f in s)f!=="ref"&&(u[f]=s[f])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var m in i)u[m]===void 0&&(u[m]=i[m])}return u}function N0(i){tu(i)}function D0(i){console.error(i)}function _0(i){tu(i)}function Mu(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(f){setTimeout(function(){throw f})}}function z0(i,s,u){try{var f=i.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Kd(i,s,u){return u=ui(u),u.tag=3,u.payload={element:null},u.callback=function(){Mu(i,s)},u}function j0(i){return i=ui(i),i.tag=3,i}function I0(i,s,u,f){var m=u.type.getDerivedStateFromError;if(typeof m=="function"){var y=f.value;i.payload=function(){return m(y)},i.callback=function(){z0(s,u,f)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){z0(s,u,f),typeof m!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var T=f.stack;this.componentDidCatch(f.value,{componentStack:T!==null?T:""})})}function yA(i,s,u,f,m){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(s=u.alternate,s!==null&&ss(s,u,m,!0),u=Sn.current,u!==null){switch(u.tag){case 31:case 13:return Ln===null?Iu():u.alternate===null&&ut===0&&(ut=3),u.flags&=-257,u.flags|=65536,u.lanes=m,f===fu?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([f]):s.add(f),vh(i,f,m)),!1;case 22:return u.flags|=65536,f===fu?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([f]):u.add(f)),vh(i,f,m)),!1}throw Error(r(435,u.tag))}return vh(i,f,m),Iu(),!1}if(Fe)return s=Sn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=m,f!==dd&&(i=Error(r(422),{cause:f}),gl(_n(i,u)))):(f!==dd&&(s=Error(r(423),{cause:f}),gl(_n(s,u))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,f=_n(f,u),m=Kd(i.stateNode,f,m),Cd(i,m),ut!==4&&(ut=2)),!1;var y=Error(r(520),{cause:f});if(y=_n(y,u),jl===null?jl=[y]:jl.push(y),ut!==4&&(ut=2),s===null)return!0;f=_n(f,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=m&-m,u.lanes|=i,i=Kd(u.stateNode,f,i),Cd(u,i),!1;case 1:if(s=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(gi===null||!gi.has(y))))return u.flags|=65536,m&=-m,u.lanes|=m,m=j0(m),I0(m,i,u,f),Cd(u,m),!1}u=u.return}while(u!==null);return!1}var Yd=Error(r(461)),yt=!1;function zt(i,s,u,f){s.child=i===null?Fy(s,null,u,f):vo(s,i.child,u,f)}function L0(i,s,u,f,m){u=u.render;var y=s.ref;if("ref"in f){var w={};for(var T in f)T!=="ref"&&(w[T]=f[T])}else w=f;return po(s),f=Od(i,s,u,w,y,m),T=kd(),i!==null&&!yt?(Nd(i,s,m),Dr(i,s,m)):(Fe&&T&&cd(s),s.flags|=1,zt(i,s,f,m),s.child)}function B0(i,s,u,f,m){if(i===null){var y=u.type;return typeof y=="function"&&!ld(y)&&y.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=y,V0(i,s,y,f,m)):(i=ou(u.type,null,f,s,s.mode,m),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!nh(i,m)){var w=y.memoizedProps;if(u=u.compare,u=u!==null?u:hl,u(w,f)&&i.ref===s.ref)return Dr(i,s,m)}return s.flags|=1,i=Rr(y,f),i.ref=s.ref,i.return=s,s.child=i}function V0(i,s,u,f,m){if(i!==null){var y=i.memoizedProps;if(hl(y,f)&&i.ref===s.ref)if(yt=!1,s.pendingProps=f=y,nh(i,m))(i.flags&131072)!==0&&(yt=!0);else return s.lanes=i.lanes,Dr(i,s,m)}return Xd(i,s,u,f,m)}function F0(i,s,u,f){var m=f.children,y=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|u:u,i!==null){for(f=s.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;f=m&~y}else f=0,s.child=null;return P0(i,s,y,u,f)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&uu(s,y!==null?y.cachePool:null),y!==null?Hy(s,y):Ed(),Uy(s);else return f=s.lanes=536870912,P0(i,s,y!==null?y.baseLanes|u:u,u,f)}else y!==null?(uu(s,y.cachePool),Hy(s,y),di(),s.memoizedState=null):(i!==null&&uu(s,null),Ed(),di());return zt(i,s,m,u),s.child}function Al(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function P0(i,s,u,f,m){var y=bd();return y=y===null?null:{parent:mt._currentValue,pool:y},s.memoizedState={baseLanes:u,cachePool:y},i!==null&&uu(s,null),Ed(),Uy(s),i!==null&&ss(i,s,f,!0),s.childLanes=m,null}function Eu(i,s){return s=Tu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function $0(i,s,u){return vo(s,i.child,null,u),i=Eu(s,s.pendingProps),i.flags|=2,xn(s),s.memoizedState=null,i}function vA(i,s,u){var f=s.pendingProps,m=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Fe){if(f.mode==="hidden")return i=Eu(s,f),s.lanes=536870912,Al(null,i);if(Td(s),(i=nt)?(i=eb(i,In),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:ii!==null?{id:sr,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},u=Ey(i),u.return=s,s.child=u,Dt=s,nt=null)):i=null,i===null)throw si(s);return s.lanes=536870912,null}return Eu(s,f)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(Td(s),m)if(s.flags&256)s.flags&=-257,s=$0(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(yt||ss(i,s,u,!1),m=(u&i.childLanes)!==0,yt||m){if(f=We,f!==null&&(w=il(f,u),w!==0&&w!==y.retryLane))throw y.retryLane=w,uo(i,w),dn(f,i,w),Yd;Iu(),s=$0(i,s,u)}else i=y.treeContext,nt=Bn(w.nextSibling),Dt=s,Fe=!0,oi=null,In=!1,i!==null&&Ay(s,i),s=Eu(s,f),s.flags|=4096;return s}return i=Rr(i.child,{mode:f.mode,children:f.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Ru(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function Xd(i,s,u,f,m){return po(s),u=Od(i,s,u,f,void 0,m),f=kd(),i!==null&&!yt?(Nd(i,s,m),Dr(i,s,m)):(Fe&&f&&cd(s),s.flags|=1,zt(i,s,u,m),s.child)}function H0(i,s,u,f,m,y){return po(s),s.updateQueue=null,u=qy(s,f,u,m),Gy(i),f=kd(),i!==null&&!yt?(Nd(i,s,y),Dr(i,s,y)):(Fe&&f&&cd(s),s.flags|=1,zt(i,s,u,y),s.child)}function U0(i,s,u,f,m){if(po(s),s.stateNode===null){var y=ts,w=u.contextType;typeof w=="object"&&w!==null&&(y=_t(w)),y=new u(f,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=qd,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=f,y.state=s.memoizedState,y.refs={},xd(s),w=u.contextType,y.context=typeof w=="object"&&w!==null?_t(w):ts,y.state=s.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(Gd(s,u,w,f),y.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(w=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),w!==y.state&&qd.enqueueReplaceState(y,y.state,null),Cl(s,f,y,m),wl(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),f=!0}else if(i===null){y=s.stateNode;var T=s.memoizedProps,k=So(u,T);y.props=k;var $=y.context,Y=u.contextType;w=ts,typeof Y=="object"&&Y!==null&&(w=_t(Y));var W=u.getDerivedStateFromProps;Y=typeof W=="function"||typeof y.getSnapshotBeforeUpdate=="function",T=s.pendingProps!==T,Y||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T||$!==w)&&k0(s,y,f,w),ai=!1;var H=s.memoizedState;y.state=H,Cl(s,f,y,m),wl(),$=s.memoizedState,T||H!==$||ai?(typeof W=="function"&&(Gd(s,u,W,f),$=s.memoizedState),(k=ai||O0(s,u,k,f,H,$,w))?(Y||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=$),y.props=f,y.state=$,y.context=w,f=k):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{y=s.stateNode,wd(i,s),w=s.memoizedProps,Y=So(u,w),y.props=Y,W=s.pendingProps,H=y.context,$=u.contextType,k=ts,typeof $=="object"&&$!==null&&(k=_t($)),T=u.getDerivedStateFromProps,($=typeof T=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==W||H!==k)&&k0(s,y,f,k),ai=!1,H=s.memoizedState,y.state=H,Cl(s,f,y,m),wl();var G=s.memoizedState;w!==W||H!==G||ai||i!==null&&i.dependencies!==null&&lu(i.dependencies)?(typeof T=="function"&&(Gd(s,u,T,f),G=s.memoizedState),(Y=ai||O0(s,u,Y,f,H,G,k)||i!==null&&i.dependencies!==null&&lu(i.dependencies))?($||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,G,k),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,G,k)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=G),y.props=f,y.state=G,y.context=k,f=Y):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=1024),f=!1)}return y=f,Ru(i,s),f=(s.flags&128)!==0,y||f?(y=s.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,i!==null&&f?(s.child=vo(s,i.child,null,m),s.child=vo(s,null,u,m)):zt(i,s,u,m),s.memoizedState=y.state,i=s.child):i=Dr(i,s,m),i}function G0(i,s,u,f){return fo(),s.flags|=256,zt(i,s,u,f),s.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qd(i){return{baseLanes:i,cachePool:zy()}}function Zd(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Cn),i}function q0(i,s,u){var f=s.pendingProps,m=!1,y=(s.flags&128)!==0,w;if((w=y)||(w=i!==null&&i.memoizedState===null?!1:(dt.current&2)!==0),w&&(m=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,i===null){if(Fe){if(m?fi(s):di(),(i=nt)?(i=eb(i,In),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:ii!==null?{id:sr,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},u=Ey(i),u.return=s,s.child=u,Dt=s,nt=null)):i=null,i===null)throw si(s);return zh(i)?s.lanes=32:s.lanes=536870912,null}var T=f.children;return f=f.fallback,m?(di(),m=s.mode,T=Tu({mode:"hidden",children:T},m),f=co(f,m,u,null),T.return=s,f.return=s,T.sibling=f,s.child=T,f=s.child,f.memoizedState=Qd(u),f.childLanes=Zd(i,w,u),s.memoizedState=Jd,Al(null,f)):(fi(s),Wd(s,T))}var k=i.memoizedState;if(k!==null&&(T=k.dehydrated,T!==null)){if(y)s.flags&256?(fi(s),s.flags&=-257,s=eh(i,s,u)):s.memoizedState!==null?(di(),s.child=i.child,s.flags|=128,s=null):(di(),T=f.fallback,m=s.mode,f=Tu({mode:"visible",children:f.children},m),T=co(T,m,u,null),T.flags|=2,f.return=s,T.return=s,f.sibling=T,s.child=f,vo(s,i.child,null,u),f=s.child,f.memoizedState=Qd(u),f.childLanes=Zd(i,w,u),s.memoizedState=Jd,s=Al(null,f));else if(fi(s),zh(T)){if(w=T.nextSibling&&T.nextSibling.dataset,w)var $=w.dgst;w=$,f=Error(r(419)),f.stack="",f.digest=w,gl({value:f,source:null,stack:null}),s=eh(i,s,u)}else if(yt||ss(i,s,u,!1),w=(u&i.childLanes)!==0,yt||w){if(w=We,w!==null&&(f=il(w,u),f!==0&&f!==k.retryLane))throw k.retryLane=f,uo(i,f),dn(w,i,f),Yd;_h(T)||Iu(),s=eh(i,s,u)}else _h(T)?(s.flags|=192,s.child=i.child,s=null):(i=k.treeContext,nt=Bn(T.nextSibling),Dt=s,Fe=!0,oi=null,In=!1,i!==null&&Ay(s,i),s=Wd(s,f.children),s.flags|=4096);return s}return m?(di(),T=f.fallback,m=s.mode,k=i.child,$=k.sibling,f=Rr(k,{mode:"hidden",children:f.children}),f.subtreeFlags=k.subtreeFlags&65011712,$!==null?T=Rr($,T):(T=co(T,m,u,null),T.flags|=2),T.return=s,f.return=s,f.sibling=T,s.child=f,Al(null,f),f=s.child,T=i.child.memoizedState,T===null?T=Qd(u):(m=T.cachePool,m!==null?(k=mt._currentValue,m=m.parent!==k?{parent:k,pool:k}:m):m=zy(),T={baseLanes:T.baseLanes|u,cachePool:m}),f.memoizedState=T,f.childLanes=Zd(i,w,u),s.memoizedState=Jd,Al(i.child,f)):(fi(s),u=i.child,i=u.sibling,u=Rr(u,{mode:"visible",children:f.children}),u.return=s,u.sibling=null,i!==null&&(w=s.deletions,w===null?(s.deletions=[i],s.flags|=16):w.push(i)),s.child=u,s.memoizedState=null,u)}function Wd(i,s){return s=Tu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Tu(i,s){return i=bn(22,i,null,s),i.lanes=0,i}function eh(i,s,u){return vo(s,i.child,null,u),i=Wd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function K0(i,s,u){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),md(i.return,s,u)}function th(i,s,u,f,m,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:m,treeForkCount:y}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=u,w.tailMode=m,w.treeForkCount=y)}function Y0(i,s,u){var f=s.pendingProps,m=f.revealOrder,y=f.tail;f=f.children;var w=dt.current,T=(w&2)!==0;if(T?(w=w&1|2,s.flags|=128):w&=1,X(dt,w),zt(i,s,f,u),f=Fe?ml:0,!T&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&K0(i,u,s);else if(i.tag===19)K0(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(m){case"forwards":for(u=s.child,m=null;u!==null;)i=u.alternate,i!==null&&mu(i)===null&&(m=u),u=u.sibling;u=m,u===null?(m=s.child,s.child=null):(m=u.sibling,u.sibling=null),th(s,!1,m,u,y,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,m=s.child,s.child=null;m!==null;){if(i=m.alternate,i!==null&&mu(i)===null){s.child=m;break}i=m.sibling,m.sibling=u,u=m,m=i}th(s,!0,u,null,y,f);break;case"together":th(s,!1,null,null,void 0,f);break;default:s.memoizedState=null}return s.child}function Dr(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),mi|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(ss(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=Rr(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=Rr(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function nh(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&lu(i)))}function bA(i,s,u){switch(s.tag){case 3:De(s,s.stateNode.containerInfo),li(s,mt,i.memoizedState.cache),fo();break;case 27:case 5:it(s);break;case 4:De(s,s.stateNode.containerInfo);break;case 10:li(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Td(s),null;break;case 13:var f=s.memoizedState;if(f!==null)return f.dehydrated!==null?(fi(s),s.flags|=128,null):(u&s.child.childLanes)!==0?q0(i,s,u):(fi(s),i=Dr(i,s,u),i!==null?i.sibling:null);fi(s);break;case 19:var m=(i.flags&128)!==0;if(f=(u&s.childLanes)!==0,f||(ss(i,s,u,!1),f=(u&s.childLanes)!==0),m){if(f)return Y0(i,s,u);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),X(dt,dt.current),f)break;return null;case 22:return s.lanes=0,F0(i,s,u,s.pendingProps);case 24:li(s,mt,i.memoizedState.cache)}return Dr(i,s,u)}function X0(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)yt=!0;else{if(!nh(i,u)&&(s.flags&128)===0)return yt=!1,bA(i,s,u);yt=(i.flags&131072)!==0}else yt=!1,Fe&&(s.flags&1048576)!==0&&Ty(s,ml,s.index);switch(s.lanes=0,s.tag){case 16:e:{var f=s.pendingProps;if(i=go(s.elementType),s.type=i,typeof i=="function")ld(i)?(f=So(i,f),s.tag=1,s=U0(null,s,i,f,u)):(s.tag=0,s=Xd(null,s,i,f,u));else{if(i!=null){var m=i.$$typeof;if(m===D){s.tag=11,s=L0(null,s,i,f,u);break e}else if(m===_){s.tag=14,s=B0(null,s,i,f,u);break e}}throw s=ie(i)||i,Error(r(306,s,""))}}return s;case 0:return Xd(i,s,s.type,s.pendingProps,u);case 1:return f=s.type,m=So(f,s.pendingProps),U0(i,s,f,m,u);case 3:e:{if(De(s,s.stateNode.containerInfo),i===null)throw Error(r(387));f=s.pendingProps;var y=s.memoizedState;m=y.element,wd(i,s),Cl(s,f,null,u);var w=s.memoizedState;if(f=w.cache,li(s,mt,f),f!==y.cache&&gd(s,[mt],u,!0),wl(),f=w.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:w.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=G0(i,s,f,u);break e}else if(f!==m){m=_n(Error(r(424)),s),gl(m),s=G0(i,s,f,u);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,nt=Bn(i.firstChild),Dt=s,Fe=!0,oi=null,In=!0,u=Fy(s,null,f,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(fo(),f===m){s=Dr(i,s,u);break e}zt(i,s,f,u)}s=s.child}return s;case 26:return Ru(i,s),i===null?(u=sb(s.type,null,s.pendingProps,null))?s.memoizedState=u:Fe||(u=s.type,i=s.pendingProps,f=Hu(fe.current).createElement(u),f[ee]=s,f[ce]=i,jt(f,u,i),tt(f),s.stateNode=f):s.memoizedState=sb(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return it(s),i===null&&Fe&&(f=s.stateNode=rb(s.type,s.pendingProps,fe.current),Dt=s,In=!0,m=nt,Si(s.type)?(jh=m,nt=Bn(f.firstChild)):nt=m),zt(i,s,s.pendingProps.children,u),Ru(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Fe&&((m=f=nt)&&(f=XA(f,s.type,s.pendingProps,In),f!==null?(s.stateNode=f,Dt=s,nt=Bn(f.firstChild),In=!1,m=!0):m=!1),m||si(s)),it(s),m=s.type,y=s.pendingProps,w=i!==null?i.memoizedProps:null,f=y.children,kh(m,y)?f=null:w!==null&&kh(m,w)&&(s.flags|=32),s.memoizedState!==null&&(m=Od(i,s,cA,null,null,u),Hl._currentValue=m),Ru(i,s),zt(i,s,f,u),s.child;case 6:return i===null&&Fe&&((i=u=nt)&&(u=JA(u,s.pendingProps,In),u!==null?(s.stateNode=u,Dt=s,nt=null,i=!0):i=!1),i||si(s)),null;case 13:return q0(i,s,u);case 4:return De(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=vo(s,null,f,u):zt(i,s,f,u),s.child;case 11:return L0(i,s,s.type,s.pendingProps,u);case 7:return zt(i,s,s.pendingProps,u),s.child;case 8:return zt(i,s,s.pendingProps.children,u),s.child;case 12:return zt(i,s,s.pendingProps.children,u),s.child;case 10:return f=s.pendingProps,li(s,s.type,f.value),zt(i,s,f.children,u),s.child;case 9:return m=s.type._context,f=s.pendingProps.children,po(s),m=_t(m),f=f(m),s.flags|=1,zt(i,s,f,u),s.child;case 14:return B0(i,s,s.type,s.pendingProps,u);case 15:return V0(i,s,s.type,s.pendingProps,u);case 19:return Y0(i,s,u);case 31:return vA(i,s,u);case 22:return F0(i,s,u,s.pendingProps);case 24:return po(s),f=_t(mt),i===null?(m=bd(),m===null&&(m=We,y=yd(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=u),m=y),s.memoizedState={parent:f,cache:m},xd(s),li(s,mt,m)):((i.lanes&u)!==0&&(wd(i,s),Cl(s,null,null,u),wl()),m=i.memoizedState,y=s.memoizedState,m.parent!==f?(m={parent:f,cache:f},s.memoizedState=m,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=m),li(s,mt,f)):(f=y.cache,li(s,mt,f),f!==m.cache&&gd(s,[mt],u,!0))),zt(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function _r(i){i.flags|=4}function rh(i,s,u,f,m){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(wv())i.flags|=8192;else throw yo=fu,Sd}else i.flags&=-16777217}function J0(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!fb(s))if(wv())i.flags|=8192;else throw yo=fu,Sd}function Au(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Va():536870912,i.lanes|=s,vs|=s)}function Ol(i,s){if(!Fe)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function rt(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,f=0;if(s)for(var m=i.child;m!==null;)u|=m.lanes|m.childLanes,f|=m.subtreeFlags&65011712,f|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)u|=m.lanes|m.childLanes,f|=m.subtreeFlags,f|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=f,i.childLanes=u,s}function SA(i,s,u){var f=s.pendingProps;switch(fd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(s),null;case 1:return rt(s),null;case 3:return u=s.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),s.memoizedState.cache!==f&&(s.flags|=2048),Or(mt),ye(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(is(s)?_r(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,hd())),rt(s),null;case 26:var m=s.type,y=s.memoizedState;return i===null?(_r(s),y!==null?(rt(s),J0(s,y)):(rt(s),rh(s,m,null,f,u))):y?y!==i.memoizedState?(_r(s),rt(s),J0(s,y)):(rt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==f&&_r(s),rt(s),rh(s,m,i,f,u)),null;case 27:if(wt(s),u=fe.current,m=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==f&&_r(s);else{if(!f){if(s.stateNode===null)throw Error(r(166));return rt(s),null}i=ne.current,is(s)?Oy(s):(i=rb(m,f,u),s.stateNode=i,_r(s))}return rt(s),null;case 5:if(wt(s),m=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==f&&_r(s);else{if(!f){if(s.stateNode===null)throw Error(r(166));return rt(s),null}if(y=ne.current,is(s))Oy(s);else{var w=Hu(fe.current);switch(y){case 1:y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=w.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?w.createElement("select",{is:f.is}):w.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?w.createElement(m,{is:f.is}):w.createElement(m)}}y[ee]=s,y[ce]=f;e:for(w=s.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===s)break e;for(;w.sibling===null;){if(w.return===null||w.return===s)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}s.stateNode=y;e:switch(jt(y,m,f),m){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&_r(s)}}return rt(s),rh(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==f&&_r(s);else{if(typeof f!="string"&&s.stateNode===null)throw Error(r(166));if(i=fe.current,is(s)){if(i=s.stateNode,u=s.memoizedProps,f=null,m=Dt,m!==null)switch(m.tag){case 27:case 5:f=m.memoizedProps}i[ee]=s,i=!!(i.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||qv(i.nodeValue,u)),i||si(s,!0)}else i=Hu(i).createTextNode(f),i[ee]=s,s.stateNode=i}return rt(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(f=is(s),u!==null){if(i===null){if(!f)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[ee]=s}else fo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;rt(s),i=!1}else u=hd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return rt(s),null;case 13:if(f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=is(s),f!==null&&f.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[ee]=s}else fo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;rt(s),m=!1}else m=hd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=u,s):(u=f!==null,i=i!==null&&i.memoizedState!==null,u&&(f=s.child,m=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(m=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==m&&(f.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Au(s,s.updateQueue),rt(s),null);case 4:return ye(),i===null&&Eh(s.stateNode.containerInfo),rt(s),null;case 10:return Or(s.type),rt(s),null;case 19:if(F(dt),f=s.memoizedState,f===null)return rt(s),null;if(m=(s.flags&128)!==0,y=f.rendering,y===null)if(m)Ol(f,!1);else{if(ut!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=mu(i),y!==null){for(s.flags|=128,Ol(f,!1),i=y.updateQueue,s.updateQueue=i,Au(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)My(u,i),u=u.sibling;return X(dt,dt.current&1|2),Fe&&Tr(s,f.treeForkCount),s.child}i=i.sibling}f.tail!==null&&Qt()>_u&&(s.flags|=128,m=!0,Ol(f,!1),s.lanes=4194304)}else{if(!m)if(i=mu(y),i!==null){if(s.flags|=128,m=!0,i=i.updateQueue,s.updateQueue=i,Au(s,i),Ol(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Fe)return rt(s),null}else 2*Qt()-f.renderingStartTime>_u&&u!==536870912&&(s.flags|=128,m=!0,Ol(f,!1),s.lanes=4194304);f.isBackwards?(y.sibling=s.child,s.child=y):(i=f.last,i!==null?i.sibling=y:s.child=y,f.last=y)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=Qt(),i.sibling=null,u=dt.current,X(dt,m?u&1|2:u&1),Fe&&Tr(s,f.treeForkCount),i):(rt(s),null);case 22:case 23:return xn(s),Rd(),f=s.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(s.flags|=8192):f&&(s.flags|=8192),f?(u&536870912)!==0&&(s.flags&128)===0&&(rt(s),s.subtreeFlags&6&&(s.flags|=8192)):rt(s),u=s.updateQueue,u!==null&&Au(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048),i!==null&&F(mo),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Or(mt),rt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function xA(i,s){switch(fd(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Or(mt),ye(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return wt(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));fo()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));fo()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return F(dt),null;case 4:return ye(),null;case 10:return Or(s.type),null;case 22:case 23:return xn(s),Rd(),i!==null&&F(mo),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Or(mt),null;case 25:return null;default:return null}}function Q0(i,s){switch(fd(s),s.tag){case 3:Or(mt),ye();break;case 26:case 27:case 5:wt(s);break;case 4:ye();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:F(dt);break;case 10:Or(s.type);break;case 22:case 23:xn(s),Rd(),i!==null&&F(mo);break;case 24:Or(mt)}}function kl(i,s){try{var u=s.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var m=f.next;u=m;do{if((u.tag&i)===i){f=void 0;var y=u.create,w=u.inst;f=y(),w.destroy=f}u=u.next}while(u!==m)}}catch(T){Ke(s,s.return,T)}}function hi(i,s,u){try{var f=s.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var y=m.next;f=y;do{if((f.tag&i)===i){var w=f.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,m=s;var k=u,$=T;try{$()}catch(Y){Ke(m,k,Y)}}}f=f.next}while(f!==y)}}catch(Y){Ke(s,s.return,Y)}}function Z0(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{$y(s,u)}catch(f){Ke(i,i.return,f)}}}function W0(i,s,u){u.props=So(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(f){Ke(i,s,f)}}function Nl(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof u=="function"?i.refCleanup=u(f):u.current=f}}catch(m){Ke(i,s,m)}}function ar(i,s){var u=i.ref,f=i.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(m){Ke(i,s,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){Ke(i,s,m)}else u.current=null}function ev(i){var s=i.type,u=i.memoizedProps,f=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(m){Ke(i,i.return,m)}}function ih(i,s,u){try{var f=i.stateNode;HA(f,i.type,u,s),f[ce]=s}catch(m){Ke(i,i.return,m)}}function tv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Si(i.type)||i.tag===4}function oh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||tv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Si(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function sh(i,s,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Mr));else if(f!==4&&(f===27&&Si(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(sh(i,s,u),i=i.sibling;i!==null;)sh(i,s,u),i=i.sibling}function Ou(i,s,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(f!==4&&(f===27&&Si(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Ou(i,s,u),i=i.sibling;i!==null;)Ou(i,s,u),i=i.sibling}function nv(i){var s=i.stateNode,u=i.memoizedProps;try{for(var f=i.type,m=s.attributes;m.length;)s.removeAttributeNode(m[0]);jt(s,f,u),s[ee]=i,s[ce]=u}catch(y){Ke(i,i.return,y)}}var zr=!1,vt=!1,lh=!1,rv=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function wA(i,s){if(i=i.containerInfo,Ah=Ju,i=my(i),ed(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var m=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,T=-1,k=-1,$=0,Y=0,W=i,H=null;t:for(;;){for(var G;W!==u||m!==0&&W.nodeType!==3||(T=w+m),W!==y||f!==0&&W.nodeType!==3||(k=w+f),W.nodeType===3&&(w+=W.nodeValue.length),(G=W.firstChild)!==null;)H=W,W=G;for(;;){if(W===i)break t;if(H===u&&++$===m&&(T=w),H===y&&++Y===f&&(k=w),(G=W.nextSibling)!==null)break;W=H,H=W.parentNode}W=G}u=T===-1||k===-1?null:{start:T,end:k}}else u=null}u=u||{start:0,end:0}}else u=null;for(Oh={focusedElem:i,selectionRange:u},Ju=!1,Tt=s;Tt!==null;)if(s=Tt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Tt=i;else for(;Tt!==null;){switch(s=Tt,y=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)m=i[u],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,u=s,m=y.memoizedProps,y=y.memoizedState,f=u.stateNode;try{var de=So(u.type,m);i=f.getSnapshotBeforeUpdate(de,y),f.__reactInternalSnapshotBeforeUpdate=i}catch(Ce){Ke(u,u.return,Ce)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Dh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Dh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Tt=i;break}Tt=s.return}}function iv(i,s,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:Ir(i,u),f&4&&kl(5,u);break;case 1:if(Ir(i,u),f&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(w){Ke(u,u.return,w)}else{var m=So(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(m,s,i.__reactInternalSnapshotBeforeUpdate)}catch(w){Ke(u,u.return,w)}}f&64&&Z0(u),f&512&&Nl(u,u.return);break;case 3:if(Ir(i,u),f&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{$y(i,s)}catch(w){Ke(u,u.return,w)}}break;case 27:s===null&&f&4&&nv(u);case 26:case 5:Ir(i,u),s===null&&f&4&&ev(u),f&512&&Nl(u,u.return);break;case 12:Ir(i,u);break;case 31:Ir(i,u),f&4&&lv(i,u);break;case 13:Ir(i,u),f&4&&av(i,u),f&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=NA.bind(null,u),QA(i,u))));break;case 22:if(f=u.memoizedState!==null||zr,!f){s=s!==null&&s.memoizedState!==null||vt,m=zr;var y=vt;zr=f,(vt=s)&&!y?Lr(i,u,(u.subtreeFlags&8772)!==0):Ir(i,u),zr=m,vt=y}break;case 30:break;default:Ir(i,u)}}function ov(i){var s=i.alternate;s!==null&&(i.alternate=null,ov(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&io(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var ot=null,an=!1;function jr(i,s,u){for(u=u.child;u!==null;)sv(i,s,u),u=u.sibling}function sv(i,s,u){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(to,u)}catch{}switch(u.tag){case 26:vt||ar(u,s),jr(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:vt||ar(u,s);var f=ot,m=an;Si(u.type)&&(ot=u.stateNode,an=!1),jr(i,s,u),Fl(u.stateNode),ot=f,an=m;break;case 5:vt||ar(u,s);case 6:if(f=ot,m=an,ot=null,jr(i,s,u),ot=f,an=m,ot!==null)if(an)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(u.stateNode)}catch(y){Ke(u,s,y)}else try{ot.removeChild(u.stateNode)}catch(y){Ke(u,s,y)}break;case 18:ot!==null&&(an?(i=ot,Zv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Rs(i)):Zv(ot,u.stateNode));break;case 4:f=ot,m=an,ot=u.stateNode.containerInfo,an=!0,jr(i,s,u),ot=f,an=m;break;case 0:case 11:case 14:case 15:hi(2,u,s),vt||hi(4,u,s),jr(i,s,u);break;case 1:vt||(ar(u,s),f=u.stateNode,typeof f.componentWillUnmount=="function"&&W0(u,s,f)),jr(i,s,u);break;case 21:jr(i,s,u);break;case 22:vt=(f=vt)||u.memoizedState!==null,jr(i,s,u),vt=f;break;default:jr(i,s,u)}}function lv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Rs(i)}catch(u){Ke(s,s.return,u)}}}function av(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Rs(i)}catch(u){Ke(s,s.return,u)}}function CA(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new rv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new rv),s;default:throw Error(r(435,i.tag))}}function ku(i,s){var u=CA(i);s.forEach(function(f){if(!u.has(f)){u.add(f);var m=DA.bind(null,i,f);f.then(m,m)}})}function un(i,s){var u=s.deletions;if(u!==null)for(var f=0;f<u.length;f++){var m=u[f],y=i,w=s,T=w;e:for(;T!==null;){switch(T.tag){case 27:if(Si(T.type)){ot=T.stateNode,an=!1;break e}break;case 5:ot=T.stateNode,an=!1;break e;case 3:case 4:ot=T.stateNode.containerInfo,an=!0;break e}T=T.return}if(ot===null)throw Error(r(160));sv(y,w,m),ot=null,an=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)uv(s,i),s=s.sibling}var Xn=null;function uv(i,s){var u=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),cn(i),f&4&&(hi(3,i,i.return),kl(3,i),hi(5,i,i.return));break;case 1:un(s,i),cn(i),f&512&&(vt||u===null||ar(u,u.return)),f&64&&zr&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var m=Xn;if(un(s,i),cn(i),f&512&&(vt||u===null||ar(u,u.return)),f&4){var y=u!==null?u.memoizedState:null;if(f=i.memoizedState,u===null)if(f===null)if(i.stateNode===null){e:{f=i.type,u=i.memoizedProps,m=m.ownerDocument||m;t:switch(f){case"title":y=m.getElementsByTagName("title")[0],(!y||y[ni]||y[ee]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(f),m.head.insertBefore(y,m.querySelector("head > title"))),jt(y,f,u),y[ee]=i,tt(y),f=y;break e;case"link":var w=ub("link","href",m).get(f+(u.href||""));if(w){for(var T=0;T<w.length;T++)if(y=w[T],y.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){w.splice(T,1);break t}}y=m.createElement(f),jt(y,f,u),m.head.appendChild(y);break;case"meta":if(w=ub("meta","content",m).get(f+(u.content||""))){for(T=0;T<w.length;T++)if(y=w[T],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){w.splice(T,1);break t}}y=m.createElement(f),jt(y,f,u),m.head.appendChild(y);break;default:throw Error(r(468,f))}y[ee]=i,tt(y),f=y}i.stateNode=f}else cb(m,i.type,i.stateNode);else i.stateNode=ab(m,f,i.memoizedProps);else y!==f?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,f===null?cb(m,i.type,i.stateNode):ab(m,f,i.memoizedProps)):f===null&&i.stateNode!==null&&ih(i,i.memoizedProps,u.memoizedProps)}break;case 27:un(s,i),cn(i),f&512&&(vt||u===null||ar(u,u.return)),u!==null&&f&4&&ih(i,i.memoizedProps,u.memoizedProps);break;case 5:if(un(s,i),cn(i),f&512&&(vt||u===null||ar(u,u.return)),i.flags&32){m=i.stateNode;try{Yo(m,"")}catch(de){Ke(i,i.return,de)}}f&4&&i.stateNode!=null&&(m=i.memoizedProps,ih(i,m,u!==null?u.memoizedProps:m)),f&1024&&(lh=!0);break;case 6:if(un(s,i),cn(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,u=i.stateNode;try{u.nodeValue=f}catch(de){Ke(i,i.return,de)}}break;case 3:if(qu=null,m=Xn,Xn=Uu(s.containerInfo),un(s,i),Xn=m,cn(i),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Rs(s.containerInfo)}catch(de){Ke(i,i.return,de)}lh&&(lh=!1,cv(i));break;case 4:f=Xn,Xn=Uu(i.stateNode.containerInfo),un(s,i),cn(i),Xn=f;break;case 12:un(s,i),cn(i);break;case 31:un(s,i),cn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,ku(i,f)));break;case 13:un(s,i),cn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Du=Qt()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,ku(i,f)));break;case 22:m=i.memoizedState!==null;var k=u!==null&&u.memoizedState!==null,$=zr,Y=vt;if(zr=$||m,vt=Y||k,un(s,i),vt=Y,zr=$,cn(i),f&8192)e:for(s=i.stateNode,s._visibility=m?s._visibility&-2:s._visibility|1,m&&(u===null||k||zr||vt||xo(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){k=u=s;try{if(y=k.stateNode,m)w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{T=k.stateNode;var W=k.memoizedProps.style,H=W!=null&&W.hasOwnProperty("display")?W.display:null;T.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(de){Ke(k,k.return,de)}}}else if(s.tag===6){if(u===null){k=s;try{k.stateNode.nodeValue=m?"":k.memoizedProps}catch(de){Ke(k,k.return,de)}}}else if(s.tag===18){if(u===null){k=s;try{var G=k.stateNode;m?Wv(G,!0):Wv(k.stateNode,!1)}catch(de){Ke(k,k.return,de)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}f&4&&(f=i.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,ku(i,u))));break;case 19:un(s,i),cn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,ku(i,f)));break;case 30:break;case 21:break;default:un(s,i),cn(i)}}function cn(i){var s=i.flags;if(s&2){try{for(var u,f=i.return;f!==null;){if(tv(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var m=u.stateNode,y=oh(i);Ou(i,y,m);break;case 5:var w=u.stateNode;u.flags&32&&(Yo(w,""),u.flags&=-33);var T=oh(i);Ou(i,T,w);break;case 3:case 4:var k=u.stateNode.containerInfo,$=oh(i);sh(i,$,k);break;default:throw Error(r(161))}}catch(Y){Ke(i,i.return,Y)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function cv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;cv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ir(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)iv(i,s.alternate,s),s=s.sibling}function xo(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:hi(4,s,s.return),xo(s);break;case 1:ar(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&W0(s,s.return,u),xo(s);break;case 27:Fl(s.stateNode);case 26:case 5:ar(s,s.return),xo(s);break;case 22:s.memoizedState===null&&xo(s);break;case 30:xo(s);break;default:xo(s)}i=i.sibling}}function Lr(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var f=s.alternate,m=i,y=s,w=y.flags;switch(y.tag){case 0:case 11:case 15:Lr(m,y,u),kl(4,y);break;case 1:if(Lr(m,y,u),f=y,m=f.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch($){Ke(f,f.return,$)}if(f=y,m=f.updateQueue,m!==null){var T=f.stateNode;try{var k=m.shared.hiddenCallbacks;if(k!==null)for(m.shared.hiddenCallbacks=null,m=0;m<k.length;m++)Py(k[m],T)}catch($){Ke(f,f.return,$)}}u&&w&64&&Z0(y),Nl(y,y.return);break;case 27:nv(y);case 26:case 5:Lr(m,y,u),u&&f===null&&w&4&&ev(y),Nl(y,y.return);break;case 12:Lr(m,y,u);break;case 31:Lr(m,y,u),u&&w&4&&lv(m,y);break;case 13:Lr(m,y,u),u&&w&4&&av(m,y);break;case 22:y.memoizedState===null&&Lr(m,y,u),Nl(y,y.return);break;case 30:break;default:Lr(m,y,u)}s=s.sibling}}function ah(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&yl(u))}function uh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&yl(i))}function Jn(i,s,u,f){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)fv(i,s,u,f),s=s.sibling}function fv(i,s,u,f){var m=s.flags;switch(s.tag){case 0:case 11:case 15:Jn(i,s,u,f),m&2048&&kl(9,s);break;case 1:Jn(i,s,u,f);break;case 3:Jn(i,s,u,f),m&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&yl(i)));break;case 12:if(m&2048){Jn(i,s,u,f),i=s.stateNode;try{var y=s.memoizedProps,w=y.id,T=y.onPostCommit;typeof T=="function"&&T(w,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(k){Ke(s,s.return,k)}}else Jn(i,s,u,f);break;case 31:Jn(i,s,u,f);break;case 13:Jn(i,s,u,f);break;case 23:break;case 22:y=s.stateNode,w=s.alternate,s.memoizedState!==null?y._visibility&2?Jn(i,s,u,f):Dl(i,s):y._visibility&2?Jn(i,s,u,f):(y._visibility|=2,ms(i,s,u,f,(s.subtreeFlags&10256)!==0||!1)),m&2048&&ah(w,s);break;case 24:Jn(i,s,u,f),m&2048&&uh(s.alternate,s);break;default:Jn(i,s,u,f)}}function ms(i,s,u,f,m){for(m=m&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=i,w=s,T=u,k=f,$=w.flags;switch(w.tag){case 0:case 11:case 15:ms(y,w,T,k,m),kl(8,w);break;case 23:break;case 22:var Y=w.stateNode;w.memoizedState!==null?Y._visibility&2?ms(y,w,T,k,m):Dl(y,w):(Y._visibility|=2,ms(y,w,T,k,m)),m&&$&2048&&ah(w.alternate,w);break;case 24:ms(y,w,T,k,m),m&&$&2048&&uh(w.alternate,w);break;default:ms(y,w,T,k,m)}s=s.sibling}}function Dl(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,f=s,m=f.flags;switch(f.tag){case 22:Dl(u,f),m&2048&&ah(f.alternate,f);break;case 24:Dl(u,f),m&2048&&uh(f.alternate,f);break;default:Dl(u,f)}s=s.sibling}}var _l=8192;function gs(i,s,u){if(i.subtreeFlags&_l)for(i=i.child;i!==null;)dv(i,s,u),i=i.sibling}function dv(i,s,u){switch(i.tag){case 26:gs(i,s,u),i.flags&_l&&i.memoizedState!==null&&uO(u,Xn,i.memoizedState,i.memoizedProps);break;case 5:gs(i,s,u);break;case 3:case 4:var f=Xn;Xn=Uu(i.stateNode.containerInfo),gs(i,s,u),Xn=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=_l,_l=16777216,gs(i,s,u),_l=f):gs(i,s,u));break;default:gs(i,s,u)}}function hv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function zl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var f=s[u];Tt=f,mv(f,i)}hv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pv(i),i=i.sibling}function pv(i){switch(i.tag){case 0:case 11:case 15:zl(i),i.flags&2048&&hi(9,i,i.return);break;case 3:zl(i);break;case 12:zl(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Nu(i)):zl(i);break;default:zl(i)}}function Nu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var f=s[u];Tt=f,mv(f,i)}hv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:hi(8,s,s.return),Nu(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Nu(s));break;default:Nu(s)}i=i.sibling}}function mv(i,s){for(;Tt!==null;){var u=Tt;switch(u.tag){case 0:case 11:case 15:hi(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:yl(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Tt=f;else e:for(u=i;Tt!==null;){f=Tt;var m=f.sibling,y=f.return;if(ov(f),f===u){Tt=null;break e}if(m!==null){m.return=y,Tt=m;break e}Tt=y}}}var MA={getCacheForType:function(i){var s=_t(mt),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return _t(mt).controller.signal}},EA=typeof WeakMap=="function"?WeakMap:Map,Ge=0,We=null,Ie=null,Be=0,qe=0,wn=null,pi=!1,ys=!1,ch=!1,Br=0,ut=0,mi=0,wo=0,fh=0,Cn=0,vs=0,jl=null,fn=null,dh=!1,Du=0,gv=0,_u=1/0,zu=null,gi=null,Mt=0,yi=null,bs=null,Vr=0,hh=0,ph=null,yv=null,Il=0,mh=null;function Mn(){return(Ge&2)!==0&&Be!==0?Be&-Be:V.T!==null?xh():Pa()}function vv(){if(Cn===0)if((Be&536870912)===0||Fe){var i=no;no<<=1,(no&3932160)===0&&(no=262144),Cn=i}else Cn=536870912;return i=Sn.current,i!==null&&(i.flags|=32),Cn}function dn(i,s,u){(i===We&&(qe===2||qe===9)||i.cancelPendingCommit!==null)&&(Ss(i,0),vi(i,Be,Cn,!1)),ei(i,u),((Ge&2)===0||i!==We)&&(i===We&&((Ge&2)===0&&(wo|=u),ut===4&&vi(i,Be,Cn,!1)),ur(i))}function bv(i,s,u){if((Ge&6)!==0)throw Error(r(327));var f=!u&&(s&127)===0&&(s&i.expiredLanes)===0||or(i,s),m=f?AA(i,s):yh(i,s,!0),y=f;do{if(m===0){ys&&!f&&vi(i,s,0,!1);break}else{if(u=i.current.alternate,y&&!RA(u)){m=yh(i,s,!1),y=!1;continue}if(m===2){if(y=s,i.errorRecoveryDisabledLanes&y)var w=0;else w=i.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){s=w;e:{var T=i;m=jl;var k=T.current.memoizedState.isDehydrated;if(k&&(Ss(T,w).flags|=256),w=yh(T,w,!1),w!==2){if(ch&&!k){T.errorRecoveryDisabledLanes|=y,wo|=y,m=4;break e}y=fn,fn=m,y!==null&&(fn===null?fn=y:fn.push.apply(fn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){Ss(i,0),vi(i,s,0,!0);break}e:{switch(f=i,y=m,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:vi(f,s,Cn,!pi);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(m=Du+300-Qt(),10<m)){if(vi(f,s,Cn,!pi),br(f,0,!0)!==0)break e;Vr=s,f.timeoutHandle=Jv(Sv.bind(null,f,u,fn,zu,dh,s,Cn,wo,vs,pi,y,"Throttled",-0,0),m);break e}Sv(f,u,fn,zu,dh,s,Cn,wo,vs,pi,y,null,-0,0)}}break}while(!0);ur(i)}function Sv(i,s,u,f,m,y,w,T,k,$,Y,W,H,G){if(i.timeoutHandle=-1,W=s.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mr},dv(s,y,W);var de=(y&62914560)===y?Du-Qt():(y&4194048)===y?gv-Qt():0;if(de=cO(W,de),de!==null){Vr=y,i.cancelPendingCommit=de(Av.bind(null,i,s,y,u,f,m,w,T,k,Y,W,null,H,G)),vi(i,y,w,!$);return}}Av(i,s,y,u,f,m,w,T,k)}function RA(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var m=u[f],y=m.getSnapshot;m=m.value;try{if(!vn(y(),m))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function vi(i,s,u,f){s&=~fh,s&=~wo,i.suspendedLanes|=s,i.pingedLanes&=~s,f&&(i.warmLanes|=s),f=i.expirationTimes;for(var m=s;0<m;){var y=31-Wt(m),w=1<<y;f[y]=-1,m&=~w}u!==0&&Go(i,u,s)}function ju(){return(Ge&6)===0?(Ll(0),!1):!0}function gh(){if(Ie!==null){if(qe===0)var i=Ie.return;else i=Ie,Ar=ho=null,Dd(i),cs=null,bl=0,i=Ie;for(;i!==null;)Q0(i.alternate,i),i=i.return;Ie=null}}function Ss(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,qA(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Vr=0,gh(),We=i,Ie=u=Rr(i.current,null),Be=s,qe=0,wn=null,pi=!1,ys=or(i,s),ch=!1,vs=Cn=fh=wo=mi=ut=0,fn=jl=null,dh=!1,(s&8)!==0&&(s|=s&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=s;0<f;){var m=31-Wt(f),y=1<<m;s|=i[m],f&=~y}return Br=s,nu(),u}function xv(i,s){Te=null,V.H=Tl,s===us||s===cu?(s=Ly(),qe=3):s===Sd?(s=Ly(),qe=4):qe=s===Yd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,wn=s,Ie===null&&(ut=1,Mu(i,_n(s,i.current)))}function wv(){var i=Sn.current;return i===null?!0:(Be&4194048)===Be?Ln===null:(Be&62914560)===Be||(Be&536870912)!==0?i===Ln:!1}function Cv(){var i=V.H;return V.H=Tl,i===null?Tl:i}function Mv(){var i=V.A;return V.A=MA,i}function Iu(){ut=4,pi||(Be&4194048)!==Be&&Sn.current!==null||(ys=!0),(mi&134217727)===0&&(wo&134217727)===0||We===null||vi(We,Be,Cn,!1)}function yh(i,s,u){var f=Ge;Ge|=2;var m=Cv(),y=Mv();(We!==i||Be!==s)&&(zu=null,Ss(i,s)),s=!1;var w=ut;e:do try{if(qe!==0&&Ie!==null){var T=Ie,k=wn;switch(qe){case 8:gh(),w=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(s=!0);var $=qe;if(qe=0,wn=null,xs(i,T,k,$),u&&ys){w=0;break e}break;default:$=qe,qe=0,wn=null,xs(i,T,k,$)}}TA(),w=ut;break}catch(Y){xv(i,Y)}while(!0);return s&&i.shellSuspendCounter++,Ar=ho=null,Ge=f,V.H=m,V.A=y,Ie===null&&(We=null,Be=0,nu()),w}function TA(){for(;Ie!==null;)Ev(Ie)}function AA(i,s){var u=Ge;Ge|=2;var f=Cv(),m=Mv();We!==i||Be!==s?(zu=null,_u=Qt()+500,Ss(i,s)):ys=or(i,s);e:do try{if(qe!==0&&Ie!==null){s=Ie;var y=wn;t:switch(qe){case 1:qe=0,wn=null,xs(i,s,y,1);break;case 2:case 9:if(jy(y)){qe=0,wn=null,Rv(s);break}s=function(){qe!==2&&qe!==9||We!==i||(qe=7),ur(i)},y.then(s,s);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:jy(y)?(qe=0,wn=null,Rv(s)):(qe=0,wn=null,xs(i,s,y,7));break;case 5:var w=null;switch(Ie.tag){case 26:w=Ie.memoizedState;case 5:case 27:var T=Ie;if(w?fb(w):T.stateNode.complete){qe=0,wn=null;var k=T.sibling;if(k!==null)Ie=k;else{var $=T.return;$!==null?(Ie=$,Lu($)):Ie=null}break t}}qe=0,wn=null,xs(i,s,y,5);break;case 6:qe=0,wn=null,xs(i,s,y,6);break;case 8:gh(),ut=6;break e;default:throw Error(r(462))}}OA();break}catch(Y){xv(i,Y)}while(!0);return Ar=ho=null,V.H=f,V.A=m,Ge=u,Ie!==null?0:(We=null,Be=0,nu(),ut)}function OA(){for(;Ie!==null&&!Wi();)Ev(Ie)}function Ev(i){var s=X0(i.alternate,i,Br);i.memoizedProps=i.pendingProps,s===null?Lu(i):Ie=s}function Rv(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=H0(u,s,s.pendingProps,s.type,void 0,Be);break;case 11:s=H0(u,s,s.pendingProps,s.type.render,s.ref,Be);break;case 5:Dd(s);default:Q0(u,s),s=Ie=My(s,Br),s=X0(u,s,Br)}i.memoizedProps=i.pendingProps,s===null?Lu(i):Ie=s}function xs(i,s,u,f){Ar=ho=null,Dd(s),cs=null,bl=0;var m=s.return;try{if(yA(i,m,s,u,Be)){ut=1,Mu(i,_n(u,i.current)),Ie=null;return}}catch(y){if(m!==null)throw Ie=m,y;ut=1,Mu(i,_n(u,i.current)),Ie=null;return}s.flags&32768?(Fe||f===1?i=!0:ys||(Be&536870912)!==0?i=!1:(pi=i=!0,(f===2||f===9||f===3||f===6)&&(f=Sn.current,f!==null&&f.tag===13&&(f.flags|=16384))),Tv(s,i)):Lu(s)}function Lu(i){var s=i;do{if((s.flags&32768)!==0){Tv(s,pi);return}i=s.return;var u=SA(s.alternate,s,Br);if(u!==null){Ie=u;return}if(s=s.sibling,s!==null){Ie=s;return}Ie=s=i}while(s!==null);ut===0&&(ut=5)}function Tv(i,s){do{var u=xA(i.alternate,i);if(u!==null){u.flags&=32767,Ie=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Ie=i;return}Ie=i=u}while(i!==null);ut=6,Ie=null}function Av(i,s,u,f,m,y,w,T,k){i.cancelPendingCommit=null;do Bu();while(Mt!==0);if((Ge&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=od,Fa(i,u,y,w,T,k),i===We&&(Ie=We=null,Be=0),bs=s,yi=i,Vr=u,hh=y,ph=m,yv=f,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,_A(eo,function(){return _v(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||f){f=V.T,V.T=null,m=Z.p,Z.p=2,w=Ge,Ge|=4;try{wA(i,s,u)}finally{Ge=w,Z.p=m,V.T=f}}Mt=1,Ov(),kv(),Nv()}}function Ov(){if(Mt===1){Mt=0;var i=yi,s=bs,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=V.T,V.T=null;var f=Z.p;Z.p=2;var m=Ge;Ge|=4;try{uv(s,i);var y=Oh,w=my(i.containerInfo),T=y.focusedElem,k=y.selectionRange;if(w!==T&&T&&T.ownerDocument&&py(T.ownerDocument.documentElement,T)){if(k!==null&&ed(T)){var $=k.start,Y=k.end;if(Y===void 0&&(Y=$),"selectionStart"in T)T.selectionStart=$,T.selectionEnd=Math.min(Y,T.value.length);else{var W=T.ownerDocument||document,H=W&&W.defaultView||window;if(H.getSelection){var G=H.getSelection(),de=T.textContent.length,Ce=Math.min(k.start,de),Qe=k.end===void 0?Ce:Math.min(k.end,de);!G.extend&&Ce>Qe&&(w=Qe,Qe=Ce,Ce=w);var B=hy(T,Ce),j=hy(T,Qe);if(B&&j&&(G.rangeCount!==1||G.anchorNode!==B.node||G.anchorOffset!==B.offset||G.focusNode!==j.node||G.focusOffset!==j.offset)){var P=W.createRange();P.setStart(B.node,B.offset),G.removeAllRanges(),Ce>Qe?(G.addRange(P),G.extend(j.node,j.offset)):(P.setEnd(j.node,j.offset),G.addRange(P))}}}}for(W=[],G=T;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<W.length;T++){var J=W[T];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Ju=!!Ah,Oh=Ah=null}finally{Ge=m,Z.p=f,V.T=u}}i.current=s,Mt=2}}function kv(){if(Mt===2){Mt=0;var i=yi,s=bs,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=V.T,V.T=null;var f=Z.p;Z.p=2;var m=Ge;Ge|=4;try{iv(i,s.alternate,s)}finally{Ge=m,Z.p=f,V.T=u}}Mt=3}}function Nv(){if(Mt===4||Mt===3){Mt=0,yr();var i=yi,s=bs,u=Vr,f=yv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Mt=5:(Mt=0,bs=yi=null,Dv(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(gi=null),ol(u),s=s.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(to,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=V.T,m=Z.p,Z.p=2,V.T=null;try{for(var y=i.onRecoverableError,w=0;w<f.length;w++){var T=f[w];y(T.value,{componentStack:T.stack})}}finally{V.T=s,Z.p=m}}(Vr&3)!==0&&Bu(),ur(i),m=i.pendingLanes,(u&261930)!==0&&(m&42)!==0?i===mh?Il++:(Il=0,mh=i):Il=0,Ll(0)}}function Dv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,yl(s)))}function Bu(){return Ov(),kv(),Nv(),_v()}function _v(){if(Mt!==5)return!1;var i=yi,s=hh;hh=0;var u=ol(Vr),f=V.T,m=Z.p;try{Z.p=32>u?32:u,V.T=null,u=ph,ph=null;var y=yi,w=Vr;if(Mt=0,bs=yi=null,Vr=0,(Ge&6)!==0)throw Error(r(331));var T=Ge;if(Ge|=4,pv(y.current),fv(y,y.current,w,u),Ge=T,Ll(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(to,y)}catch{}return!0}finally{Z.p=m,V.T=f,Dv(i,s)}}function zv(i,s,u){s=_n(u,s),s=Kd(i.stateNode,s,2),i=ci(i,s,2),i!==null&&(ei(i,2),ur(i))}function Ke(i,s,u){if(i.tag===3)zv(i,i,u);else for(;s!==null;){if(s.tag===3){zv(s,i,u);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(gi===null||!gi.has(f))){i=_n(u,i),u=j0(2),f=ci(s,u,2),f!==null&&(I0(u,f,s,i),ei(f,2),ur(f));break}}s=s.return}}function vh(i,s,u){var f=i.pingCache;if(f===null){f=i.pingCache=new EA;var m=new Set;f.set(s,m)}else m=f.get(s),m===void 0&&(m=new Set,f.set(s,m));m.has(u)||(ch=!0,m.add(u),i=kA.bind(null,i,s,u),s.then(i,i))}function kA(i,s,u){var f=i.pingCache;f!==null&&f.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,We===i&&(Be&u)===u&&(ut===4||ut===3&&(Be&62914560)===Be&&300>Qt()-Du?(Ge&2)===0&&Ss(i,0):fh|=u,vs===Be&&(vs=0)),ur(i)}function jv(i,s){s===0&&(s=Va()),i=uo(i,s),i!==null&&(ei(i,s),ur(i))}function NA(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),jv(i,u)}function DA(i,s){var u=0;switch(i.tag){case 31:case 13:var f=i.stateNode,m=i.memoizedState;m!==null&&(u=m.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(s),jv(i,u)}function _A(i,s){return mn(i,s)}var Vu=null,ws=null,bh=!1,Fu=!1,Sh=!1,bi=0;function ur(i){i!==ws&&i.next===null&&(ws===null?Vu=ws=i:ws=ws.next=i),Fu=!0,bh||(bh=!0,jA())}function Ll(i,s){if(!Sh&&Fu){Sh=!0;do for(var u=!1,f=Vu;f!==null;){if(i!==0){var m=f.pendingLanes;if(m===0)var y=0;else{var w=f.suspendedLanes,T=f.pingedLanes;y=(1<<31-Wt(42|i)+1)-1,y&=m&~(w&~T),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,Vv(f,y))}else y=Be,y=br(f,f===We?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||or(f,y)||(u=!0,Vv(f,y));f=f.next}while(u);Sh=!1}}function zA(){Iv()}function Iv(){Fu=bh=!1;var i=0;bi!==0&&GA()&&(i=bi);for(var s=Qt(),u=null,f=Vu;f!==null;){var m=f.next,y=Lv(f,s);y===0?(f.next=null,u===null?Vu=m:u.next=m,m===null&&(ws=u)):(u=f,(i!==0||(y&3)!==0)&&(Fu=!0)),f=m}Mt!==0&&Mt!==5||Ll(i),bi!==0&&(bi=0)}function Lv(i,s){for(var u=i.suspendedLanes,f=i.pingedLanes,m=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var w=31-Wt(y),T=1<<w,k=m[w];k===-1?((T&u)===0||(T&f)!==0)&&(m[w]=Lf(T,s)):k<=s&&(i.expiredLanes|=T),y&=~T}if(s=We,u=Be,u=br(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,u===0||i===s&&(qe===2||qe===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&Zi(f),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||or(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(f!==null&&Zi(f),ol(u)){case 2:case 8:u=nl;break;case 32:u=eo;break;case 268435456:u=rl;break;default:u=eo}return f=Bv.bind(null,i),u=mn(u,f),i.callbackPriority=s,i.callbackNode=u,s}return f!==null&&f!==null&&Zi(f),i.callbackPriority=2,i.callbackNode=null,2}function Bv(i,s){if(Mt!==0&&Mt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Bu()&&i.callbackNode!==u)return null;var f=Be;return f=br(i,i===We?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(bv(i,f,s),Lv(i,Qt()),i.callbackNode!=null&&i.callbackNode===u?Bv.bind(null,i):null)}function Vv(i,s){if(Bu())return null;bv(i,s,!0)}function jA(){KA(function(){(Ge&6)!==0?mn(gn,zA):Iv()})}function xh(){if(bi===0){var i=ls;i===0&&(i=Wr,Wr<<=1,(Wr&261888)===0&&(Wr=256)),bi=i}return bi}function Fv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ya(""+i)}function Pv(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function IA(i,s,u,f,m){if(s==="submit"&&u&&u.stateNode===m){var y=Fv((m[ce]||null).action),w=f.submitter;w&&(s=(s=w[ce]||null)?Fv(s.formAction):w.getAttribute("formAction"),s!==null&&(y=s,w=null));var T=new Za("action","action",null,f,m);i.push({event:T,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(bi!==0){var k=w?Pv(m,w):new FormData(m);Pd(u,{pending:!0,data:k,method:m.method,action:y},null,k)}}else typeof y=="function"&&(T.preventDefault(),k=w?Pv(m,w):new FormData(m),Pd(u,{pending:!0,data:k,method:m.method,action:y},y,k))},currentTarget:m}]})}}for(var wh=0;wh<id.length;wh++){var Ch=id[wh],LA=Ch.toLowerCase(),BA=Ch[0].toUpperCase()+Ch.slice(1);Yn(LA,"on"+BA)}Yn(vy,"onAnimationEnd"),Yn(by,"onAnimationIteration"),Yn(Sy,"onAnimationStart"),Yn("dblclick","onDoubleClick"),Yn("focusin","onFocus"),Yn("focusout","onBlur"),Yn(eA,"onTransitionRun"),Yn(tA,"onTransitionStart"),Yn(nA,"onTransitionCancel"),Yn(xy,"onTransitionEnd"),qo("onMouseEnter",["mouseout","mouseover"]),qo("onMouseLeave",["mouseout","mouseover"]),qo("onPointerEnter",["pointerout","pointerover"]),qo("onPointerLeave",["pointerout","pointerover"]),oo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oo("onBeforeInput",["compositionend","keypress","textInput","paste"]),oo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="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(" "),VA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bl));function $v(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var f=i[u],m=f.event;f=f.listeners;e:{var y=void 0;if(s)for(var w=f.length-1;0<=w;w--){var T=f[w],k=T.instance,$=T.currentTarget;if(T=T.listener,k!==y&&m.isPropagationStopped())break e;y=T,m.currentTarget=$;try{y(m)}catch(Y){tu(Y)}m.currentTarget=null,y=k}else for(w=0;w<f.length;w++){if(T=f[w],k=T.instance,$=T.currentTarget,T=T.listener,k!==y&&m.isPropagationStopped())break e;y=T,m.currentTarget=$;try{y(m)}catch(Y){tu(Y)}m.currentTarget=null,y=k}}}}function Le(i,s){var u=s[Ye];u===void 0&&(u=s[Ye]=new Set);var f=i+"__bubble";u.has(f)||(Hv(s,i,2,!1),u.add(f))}function Mh(i,s,u){var f=0;s&&(f|=4),Hv(u,i,f,s)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Eh(i){if(!i[Pu]){i[Pu]=!0,Ha.forEach(function(u){u!=="selectionchange"&&(VA.has(u)||Mh(u,!1,i),Mh(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Pu]||(s[Pu]=!0,Mh("selectionchange",!1,s))}}function Hv(i,s,u,f){switch(vb(s)){case 2:var m=hO;break;case 8:m=pO;break;default:m=Fh}u=m.bind(null,s,u,i),m=void 0,!Gf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),f?m!==void 0?i.addEventListener(s,u,{capture:!0,passive:m}):i.addEventListener(s,u,!0):m!==void 0?i.addEventListener(s,u,{passive:m}):i.addEventListener(s,u,!1)}function Rh(i,s,u,f,m){var y=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var w=f.tag;if(w===3||w===4){var T=f.stateNode.containerInfo;if(T===m)break;if(w===4)for(w=f.return;w!==null;){var k=w.tag;if((k===3||k===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;T!==null;){if(w=wr(T),w===null)return;if(k=w.tag,k===5||k===6||k===26||k===27){f=y=w;continue e}T=T.parentNode}}f=f.return}Yg(function(){var $=y,Y=Hf(u),W=[];e:{var H=wy.get(i);if(H!==void 0){var G=Za,de=i;switch(i){case"keypress":if(Ja(u)===0)break e;case"keydown":case"keyup":G=DT;break;case"focusin":de="focus",G=Xf;break;case"focusout":de="blur",G=Xf;break;case"beforeblur":case"afterblur":G=Xf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=Qg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=ST;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=jT;break;case vy:case by:case Sy:G=CT;break;case xy:G=LT;break;case"scroll":case"scrollend":G=vT;break;case"wheel":G=VT;break;case"copy":case"cut":case"paste":G=ET;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=Wg;break;case"toggle":case"beforetoggle":G=PT}var Ce=(s&4)!==0,Qe=!Ce&&(i==="scroll"||i==="scrollend"),B=Ce?H!==null?H+"Capture":null:H;Ce=[];for(var j=$,P;j!==null;){var J=j;if(P=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||P===null||B===null||(J=sl(j,B),J!=null&&Ce.push(Vl(j,J,P))),Qe)break;j=j.return}0<Ce.length&&(H=new G(H,de,null,u,Y),W.push({event:H,listeners:Ce}))}}if((s&7)===0){e:{if(H=i==="mouseover"||i==="pointerover",G=i==="mouseout"||i==="pointerout",H&&u!==$f&&(de=u.relatedTarget||u.fromElement)&&(wr(de)||de[Oe]))break e;if((G||H)&&(H=Y.window===Y?Y:(H=Y.ownerDocument)?H.defaultView||H.parentWindow:window,G?(de=u.relatedTarget||u.toElement,G=$,de=de?wr(de):null,de!==null&&(Qe=l(de),Ce=de.tag,de!==Qe||Ce!==5&&Ce!==27&&Ce!==6)&&(de=null)):(G=null,de=$),G!==de)){if(Ce=Qg,J="onMouseLeave",B="onMouseEnter",j="mouse",(i==="pointerout"||i==="pointerover")&&(Ce=Wg,J="onPointerLeave",B="onPointerEnter",j="pointer"),Qe=G==null?H:yn(G),P=de==null?H:yn(de),H=new Ce(J,j+"leave",G,u,Y),H.target=Qe,H.relatedTarget=P,J=null,wr(Y)===$&&(Ce=new Ce(B,j+"enter",de,u,Y),Ce.target=P,Ce.relatedTarget=Qe,J=Ce),Qe=J,G&&de)t:{for(Ce=FA,B=G,j=de,P=0,J=B;J;J=Ce(J))P++;J=0;for(var Se=j;Se;Se=Ce(Se))J++;for(;0<P-J;)B=Ce(B),P--;for(;0<J-P;)j=Ce(j),J--;for(;P--;){if(B===j||j!==null&&B===j.alternate){Ce=B;break t}B=Ce(B),j=Ce(j)}Ce=null}else Ce=null;G!==null&&Uv(W,H,G,Ce,!1),de!==null&&Qe!==null&&Uv(W,Qe,de,Ce,!0)}}e:{if(H=$?yn($):window,G=H.nodeName&&H.nodeName.toLowerCase(),G==="select"||G==="input"&&H.type==="file")var $e=ly;else if(oy(H))if(ay)$e=QT;else{$e=XT;var ge=YT}else G=H.nodeName,!G||G.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?$&&Pf($.elementType)&&($e=ly):$e=JT;if($e&&($e=$e(i,$))){sy(W,$e,u,Y);break e}ge&&ge(i,H,$),i==="focusout"&&$&&H.type==="number"&&$.memoizedProps.value!=null&&Ff(H,"number",H.value)}switch(ge=$?yn($):window,i){case"focusin":(oy(ge)||ge.contentEditable==="true")&&(Zo=ge,td=$,pl=null);break;case"focusout":pl=td=Zo=null;break;case"mousedown":nd=!0;break;case"contextmenu":case"mouseup":case"dragend":nd=!1,gy(W,u,Y);break;case"selectionchange":if(WT)break;case"keydown":case"keyup":gy(W,u,Y)}var ke;if(Qf)e:{switch(i){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Qo?ry(i,u)&&(Ve="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Ve="onCompositionStart");Ve&&(ey&&u.locale!=="ko"&&(Qo||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Qo&&(ke=Xg()):(ri=Y,qf="value"in ri?ri.value:ri.textContent,Qo=!0)),ge=$u($,Ve),0<ge.length&&(Ve=new Zg(Ve,i,null,u,Y),W.push({event:Ve,listeners:ge}),ke?Ve.data=ke:(ke=iy(u),ke!==null&&(Ve.data=ke)))),(ke=HT?UT(i,u):GT(i,u))&&(Ve=$u($,"onBeforeInput"),0<Ve.length&&(ge=new Zg("onBeforeInput","beforeinput",null,u,Y),W.push({event:ge,listeners:Ve}),ge.data=ke)),IA(W,i,$,u,Y)}$v(W,s)})}function Vl(i,s,u){return{instance:i,listener:s,currentTarget:u}}function $u(i,s){for(var u=s+"Capture",f=[];i!==null;){var m=i,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=sl(i,u),m!=null&&f.unshift(Vl(i,m,y)),m=sl(i,s),m!=null&&f.push(Vl(i,m,y))),i.tag===3)return f;i=i.return}return[]}function FA(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Uv(i,s,u,f,m){for(var y=s._reactName,w=[];u!==null&&u!==f;){var T=u,k=T.alternate,$=T.stateNode;if(T=T.tag,k!==null&&k===f)break;T!==5&&T!==26&&T!==27||$===null||(k=$,m?($=sl(u,y),$!=null&&w.unshift(Vl(u,$,k))):m||($=sl(u,y),$!=null&&w.push(Vl(u,$,k)))),u=u.return}w.length!==0&&i.push({event:s,listeners:w})}var PA=/\r\n?/g,$A=/\u0000|\uFFFD/g;function Gv(i){return(typeof i=="string"?i:""+i).replace(PA,`
|
|
9
|
+
`).replace($A,"")}function qv(i,s){return s=Gv(s),Gv(i)===s}function Je(i,s,u,f,m,y){switch(u){case"children":typeof f=="string"?s==="body"||s==="textarea"&&f===""||Yo(i,f):(typeof f=="number"||typeof f=="bigint")&&s!=="body"&&Yo(i,""+f);break;case"className":qa(i,"class",f);break;case"tabIndex":qa(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":qa(i,u,f);break;case"style":qg(i,f,y);break;case"data":if(s!=="object"){qa(i,"data",f);break}case"src":case"href":if(f===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(u);break}f=Ya(""+f),i.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(u==="formAction"?(s!=="input"&&Je(i,s,"name",m.name,m,null),Je(i,s,"formEncType",m.formEncType,m,null),Je(i,s,"formMethod",m.formMethod,m,null),Je(i,s,"formTarget",m.formTarget,m,null)):(Je(i,s,"encType",m.encType,m,null),Je(i,s,"method",m.method,m,null),Je(i,s,"target",m.target,m,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(u);break}f=Ya(""+f),i.setAttribute(u,f);break;case"onClick":f!=null&&(i.onclick=Mr);break;case"onScroll":f!=null&&Le("scroll",i);break;case"onScrollEnd":f!=null&&Le("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}u=Ya(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,""+f):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":f===!0?i.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,f):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(u,f):i.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(u):i.setAttribute(u,f);break;case"popover":Le("beforetoggle",i),Le("toggle",i),Ga(i,"popover",f);break;case"xlinkActuate":Cr(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Cr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Cr(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Cr(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Cr(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Cr(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Cr(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Cr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Cr(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ga(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gT.get(u)||u,Ga(i,u,f))}}function Th(i,s,u,f,m,y){switch(u){case"style":qg(i,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof f=="string"?Yo(i,f):(typeof f=="number"||typeof f=="bigint")&&Yo(i,""+f);break;case"onScroll":f!=null&&Le("scroll",i);break;case"onScrollEnd":f!=null&&Le("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Mr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ua.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(m=u.endsWith("Capture"),s=u.slice(2,m?u.length-7:void 0),y=i[ce]||null,y=y!=null?y[u]:null,typeof y=="function"&&i.removeEventListener(s,y,m),typeof f=="function")){typeof y!="function"&&y!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,f,m);break e}u in i?i[u]=f:f===!0?i.setAttribute(u,""):Ga(i,u,f)}}}function jt(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",i),Le("load",i);var f=!1,m=!1,y;for(y in u)if(u.hasOwnProperty(y)){var w=u[y];if(w!=null)switch(y){case"src":f=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Je(i,s,y,w,u,null)}}m&&Je(i,s,"srcSet",u.srcSet,u,null),f&&Je(i,s,"src",u.src,u,null);return;case"input":Le("invalid",i);var T=y=w=m=null,k=null,$=null;for(f in u)if(u.hasOwnProperty(f)){var Y=u[f];if(Y!=null)switch(f){case"name":m=Y;break;case"type":w=Y;break;case"checked":k=Y;break;case"defaultChecked":$=Y;break;case"value":y=Y;break;case"defaultValue":T=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,s));break;default:Je(i,s,f,Y,u,null)}}$g(i,y,T,k,$,w,m,!1);return;case"select":Le("invalid",i),f=w=y=null;for(m in u)if(u.hasOwnProperty(m)&&(T=u[m],T!=null))switch(m){case"value":y=T;break;case"defaultValue":w=T;break;case"multiple":f=T;default:Je(i,s,m,T,u,null)}s=y,u=w,i.multiple=!!f,s!=null?Ko(i,!!f,s,!1):u!=null&&Ko(i,!!f,u,!0);return;case"textarea":Le("invalid",i),y=m=f=null;for(w in u)if(u.hasOwnProperty(w)&&(T=u[w],T!=null))switch(w){case"value":f=T;break;case"defaultValue":m=T;break;case"children":y=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:Je(i,s,w,T,u,null)}Ug(i,f,m,y);return;case"option":for(k in u)u.hasOwnProperty(k)&&(f=u[k],f!=null)&&(k==="selected"?i.selected=f&&typeof f!="function"&&typeof f!="symbol":Je(i,s,k,f,u,null));return;case"dialog":Le("beforetoggle",i),Le("toggle",i),Le("cancel",i),Le("close",i);break;case"iframe":case"object":Le("load",i);break;case"video":case"audio":for(f=0;f<Bl.length;f++)Le(Bl[f],i);break;case"image":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"embed":case"source":case"link":Le("error",i),Le("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for($ in u)if(u.hasOwnProperty($)&&(f=u[$],f!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Je(i,s,$,f,u,null)}return;default:if(Pf(s)){for(Y in u)u.hasOwnProperty(Y)&&(f=u[Y],f!==void 0&&Th(i,s,Y,f,u,void 0));return}}for(T in u)u.hasOwnProperty(T)&&(f=u[T],f!=null&&Je(i,s,T,f,u,null))}function HA(i,s,u,f){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,w=null,T=null,k=null,$=null,Y=null;for(G in u){var W=u[G];if(u.hasOwnProperty(G)&&W!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":k=W;default:f.hasOwnProperty(G)||Je(i,s,G,null,f,W)}}for(var H in f){var G=f[H];if(W=u[H],f.hasOwnProperty(H)&&(G!=null||W!=null))switch(H){case"type":y=G;break;case"name":m=G;break;case"checked":$=G;break;case"defaultChecked":Y=G;break;case"value":w=G;break;case"defaultValue":T=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,s));break;default:G!==W&&Je(i,s,H,G,f,W)}}Vf(i,w,T,k,$,Y,y,m);return;case"select":G=w=T=H=null;for(y in u)if(k=u[y],u.hasOwnProperty(y)&&k!=null)switch(y){case"value":break;case"multiple":G=k;default:f.hasOwnProperty(y)||Je(i,s,y,null,f,k)}for(m in f)if(y=f[m],k=u[m],f.hasOwnProperty(m)&&(y!=null||k!=null))switch(m){case"value":H=y;break;case"defaultValue":T=y;break;case"multiple":w=y;default:y!==k&&Je(i,s,m,y,f,k)}s=T,u=w,f=G,H!=null?Ko(i,!!u,H,!1):!!f!=!!u&&(s!=null?Ko(i,!!u,s,!0):Ko(i,!!u,u?[]:"",!1));return;case"textarea":G=H=null;for(T in u)if(m=u[T],u.hasOwnProperty(T)&&m!=null&&!f.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Je(i,s,T,null,f,m)}for(w in f)if(m=f[w],y=u[w],f.hasOwnProperty(w)&&(m!=null||y!=null))switch(w){case"value":H=m;break;case"defaultValue":G=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==y&&Je(i,s,w,m,f,y)}Hg(i,H,G);return;case"option":for(var de in u)H=u[de],u.hasOwnProperty(de)&&H!=null&&!f.hasOwnProperty(de)&&(de==="selected"?i.selected=!1:Je(i,s,de,null,f,H));for(k in f)H=f[k],G=u[k],f.hasOwnProperty(k)&&H!==G&&(H!=null||G!=null)&&(k==="selected"?i.selected=H&&typeof H!="function"&&typeof H!="symbol":Je(i,s,k,H,f,G));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in u)H=u[Ce],u.hasOwnProperty(Ce)&&H!=null&&!f.hasOwnProperty(Ce)&&Je(i,s,Ce,null,f,H);for($ in f)if(H=f[$],G=u[$],f.hasOwnProperty($)&&H!==G&&(H!=null||G!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(137,s));break;default:Je(i,s,$,H,f,G)}return;default:if(Pf(s)){for(var Qe in u)H=u[Qe],u.hasOwnProperty(Qe)&&H!==void 0&&!f.hasOwnProperty(Qe)&&Th(i,s,Qe,void 0,f,H);for(Y in f)H=f[Y],G=u[Y],!f.hasOwnProperty(Y)||H===G||H===void 0&&G===void 0||Th(i,s,Y,H,f,G);return}}for(var B in u)H=u[B],u.hasOwnProperty(B)&&H!=null&&!f.hasOwnProperty(B)&&Je(i,s,B,null,f,H);for(W in f)H=f[W],G=u[W],!f.hasOwnProperty(W)||H===G||H==null&&G==null||Je(i,s,W,H,f,G)}function Kv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UA(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var m=u[f],y=m.transferSize,w=m.initiatorType,T=m.duration;if(y&&T&&Kv(w)){for(w=0,T=m.responseEnd,f+=1;f<u.length;f++){var k=u[f],$=k.startTime;if($>T)break;var Y=k.transferSize,W=k.initiatorType;Y&&Kv(W)&&(k=k.responseEnd,w+=Y*(k<T?1:(T-$)/(k-$)))}if(--f,s+=8*(y+w)/(m.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Ah=null,Oh=null;function Hu(i){return i.nodeType===9?i:i.ownerDocument}function Yv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function kh(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Nh=null;function GA(){var i=window.event;return i&&i.type==="popstate"?i===Nh?!1:(Nh=i,!0):(Nh=null,!1)}var Jv=typeof setTimeout=="function"?setTimeout:void 0,qA=typeof clearTimeout=="function"?clearTimeout:void 0,Qv=typeof Promise=="function"?Promise:void 0,KA=typeof queueMicrotask=="function"?queueMicrotask:typeof Qv<"u"?function(i){return Qv.resolve(null).then(i).catch(YA)}:Jv;function YA(i){setTimeout(function(){throw i})}function Si(i){return i==="head"}function Zv(i,s){var u=s,f=0;do{var m=u.nextSibling;if(i.removeChild(u),m&&m.nodeType===8)if(u=m.data,u==="/$"||u==="/&"){if(f===0){i.removeChild(m),Rs(s);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")Fl(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Fl(u);for(var y=u.firstChild;y;){var w=y.nextSibling,T=y.nodeName;y[ni]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&y.rel.toLowerCase()==="stylesheet"||u.removeChild(y),y=w}}else u==="body"&&Fl(i.ownerDocument.body);u=m}while(u);Rs(s)}function Wv(i,s){var u=i;i=0;do{var f=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=f}while(u)}function Dh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Dh(u),io(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function XA(i,s,u,f){for(;i.nodeType===1;){var m=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[ni])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Bn(i.nextSibling),i===null)break}return null}function JA(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Bn(i.nextSibling),i===null))return null;return i}function eb(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Bn(i.nextSibling),i===null))return null;return i}function _h(i){return i.data==="$?"||i.data==="$~"}function zh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function QA(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var f=function(){s(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Bn(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var jh=null;function tb(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return Bn(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function nb(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function rb(i,s,u){switch(s=Hu(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Fl(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);io(i)}var Vn=new Map,ib=new Set;function Uu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Fr=Z.d;Z.d={f:ZA,r:WA,D:eO,C:tO,L:nO,m:rO,X:oO,S:iO,M:sO};function ZA(){var i=Fr.f(),s=ju();return i||s}function WA(i){var s=Pe(i);s!==null&&s.tag===5&&s.type==="form"?x0(s):Fr.r(i)}var Cs=typeof document>"u"?null:document;function ob(i,s,u){var f=Cs;if(f&&typeof s=="string"&&s){var m=Nn(s);m='link[rel="'+i+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),ib.has(m)||(ib.add(m),i={rel:i,crossOrigin:u,href:s},f.querySelector(m)===null&&(s=f.createElement("link"),jt(s,"link",i),tt(s),f.head.appendChild(s)))}}function eO(i){Fr.D(i),ob("dns-prefetch",i,null)}function tO(i,s){Fr.C(i,s),ob("preconnect",i,s)}function nO(i,s,u){Fr.L(i,s,u);var f=Cs;if(f&&i&&s){var m='link[rel="preload"][as="'+Nn(s)+'"]';s==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+Nn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+Nn(u.imageSizes)+'"]')):m+='[href="'+Nn(i)+'"]';var y=m;switch(s){case"style":y=Ms(i);break;case"script":y=Es(i)}Vn.has(y)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),Vn.set(y,i),f.querySelector(m)!==null||s==="style"&&f.querySelector(Pl(y))||s==="script"&&f.querySelector($l(y))||(s=f.createElement("link"),jt(s,"link",i),tt(s),f.head.appendChild(s)))}}function rO(i,s){Fr.m(i,s);var u=Cs;if(u&&i){var f=s&&typeof s.as=="string"?s.as:"script",m='link[rel="modulepreload"][as="'+Nn(f)+'"][href="'+Nn(i)+'"]',y=m;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Es(i)}if(!Vn.has(y)&&(i=g({rel:"modulepreload",href:i},s),Vn.set(y,i),u.querySelector(m)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector($l(y)))return}f=u.createElement("link"),jt(f,"link",i),tt(f),u.head.appendChild(f)}}}function iO(i,s,u){Fr.S(i,s,u);var f=Cs;if(f&&i){var m=sn(f).hoistableStyles,y=Ms(i);s=s||"default";var w=m.get(y);if(!w){var T={loading:0,preload:null};if(w=f.querySelector(Pl(y)))T.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=Vn.get(y))&&Ih(i,u);var k=w=f.createElement("link");tt(k),jt(k,"link",i),k._p=new Promise(function($,Y){k.onload=$,k.onerror=Y}),k.addEventListener("load",function(){T.loading|=1}),k.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Gu(w,s,f)}w={type:"stylesheet",instance:w,count:1,state:T},m.set(y,w)}}}function oO(i,s){Fr.X(i,s);var u=Cs;if(u&&i){var f=sn(u).hoistableScripts,m=Es(i),y=f.get(m);y||(y=u.querySelector($l(m)),y||(i=g({src:i,async:!0},s),(s=Vn.get(m))&&Lh(i,s),y=u.createElement("script"),tt(y),jt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function sO(i,s){Fr.M(i,s);var u=Cs;if(u&&i){var f=sn(u).hoistableScripts,m=Es(i),y=f.get(m);y||(y=u.querySelector($l(m)),y||(i=g({src:i,async:!0,type:"module"},s),(s=Vn.get(m))&&Lh(i,s),y=u.createElement("script"),tt(y),jt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function sb(i,s,u,f){var m=(m=fe.current)?Uu(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Ms(u.href),u=sn(m).hoistableStyles,f=u.get(s),f||(f={type:"style",instance:null,count:0,state:null},u.set(s,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Ms(u.href);var y=sn(m).hoistableStyles,w=y.get(i);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,w),(y=m.querySelector(Pl(i)))&&!y._p&&(w.instance=y,w.state.loading=5),Vn.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Vn.set(i,u),y||lO(m,i,u,w.state))),s&&f===null)throw Error(r(528,""));return w}if(s&&f!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Es(u),u=sn(m).hoistableScripts,f=u.get(s),f||(f={type:"script",instance:null,count:0,state:null},u.set(s,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ms(i){return'href="'+Nn(i)+'"'}function Pl(i){return'link[rel="stylesheet"]['+i+"]"}function lb(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function lO(i,s,u,f){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?f.loading=1:(s=i.createElement("link"),f.preload=s,s.addEventListener("load",function(){return f.loading|=1}),s.addEventListener("error",function(){return f.loading|=2}),jt(s,"link",u),tt(s),i.head.appendChild(s))}function Es(i){return'[src="'+Nn(i)+'"]'}function $l(i){return"script[async]"+i}function ab(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var f=i.querySelector('style[data-href~="'+Nn(u.href)+'"]');if(f)return s.instance=f,tt(f),f;var m=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),tt(f),jt(f,"style",m),Gu(f,u.precedence,i),s.instance=f;case"stylesheet":m=Ms(u.href);var y=i.querySelector(Pl(m));if(y)return s.state.loading|=4,s.instance=y,tt(y),y;f=lb(u),(m=Vn.get(m))&&Ih(f,m),y=(i.ownerDocument||i).createElement("link"),tt(y);var w=y;return w._p=new Promise(function(T,k){w.onload=T,w.onerror=k}),jt(y,"link",f),s.state.loading|=4,Gu(y,u.precedence,i),s.instance=y;case"script":return y=Es(u.src),(m=i.querySelector($l(y)))?(s.instance=m,tt(m),m):(f=u,(m=Vn.get(y))&&(f=g({},u),Lh(f,m)),i=i.ownerDocument||i,m=i.createElement("script"),tt(m),jt(m,"link",f),i.head.appendChild(m),s.instance=m);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(f=s.instance,s.state.loading|=4,Gu(f,u.precedence,i));return s.instance}function Gu(i,s,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=f.length?f[f.length-1]:null,y=m,w=0;w<f.length;w++){var T=f[w];if(T.dataset.precedence===s)y=T;else if(y!==m)break}y?y.parentNode.insertBefore(i,y.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Ih(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Lh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var qu=null;function ub(i,s,u){if(qu===null){var f=new Map,m=qu=new Map;m.set(u,f)}else m=qu,f=m.get(u),f||(f=new Map,m.set(u,f));if(f.has(i))return f;for(f.set(i,null),u=u.getElementsByTagName(i),m=0;m<u.length;m++){var y=u[m];if(!(y[ni]||y[ee]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var w=y.getAttribute(s)||"";w=i+w;var T=f.get(w);T?T.push(y):f.set(w,[y])}}return f}function cb(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function aO(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function fb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function uO(i,s,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=Ms(f.href),y=s.querySelector(Pl(m));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ku.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=y,tt(y);return}y=s.ownerDocument||s,f=lb(f),(m=Vn.get(m))&&Ih(f,m),y=y.createElement("link"),tt(y);var w=y;w._p=new Promise(function(T,k){w.onload=T,w.onerror=k}),jt(y,"link",f),u.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Ku.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Bh=0;function cO(i,s){return i.stylesheets&&i.count===0&&Xu(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var f=setTimeout(function(){if(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Bh===0&&(Bh=62500*UA());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Bh?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(m)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Yu=null;function Xu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Yu=new Map,s.forEach(fO,i),Yu=null,Ku.call(i))}function fO(i,s){if(!(s.state.loading&4)){var u=Yu.get(i);if(u)var f=u.get(null);else{u=new Map,Yu.set(i,u);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var w=m[y];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(u.set(w.dataset.precedence,w),f=w)}f&&u.set(null,f)}m=s.instance,w=m.getAttribute("data-precedence"),y=u.get(w)||f,y===f&&u.set(null,m),u.set(w,m),this.count++,f=Ku.bind(this),m.addEventListener("load",f),m.addEventListener("error",f),y?y.parentNode.insertBefore(m,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),s.state.loading|=4}}var Hl={$$typeof:O,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function dO(i,s,u,f,m,y,w,T,k){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sr(0),this.hiddenUpdates=Sr(null),this.identifierPrefix=f,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function db(i,s,u,f,m,y,w,T,k,$,Y,W){return i=new dO(i,s,u,w,k,$,Y,W,T),s=1,y===!0&&(s|=24),y=bn(3,null,null,s),i.current=y,y.stateNode=i,s=yd(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:f,isDehydrated:u,cache:s},xd(y),i}function hb(i){return i?(i=ts,i):ts}function pb(i,s,u,f,m,y){m=hb(m),f.context===null?f.context=m:f.pendingContext=m,f=ui(s),f.payload={element:u},y=y===void 0?null:y,y!==null&&(f.callback=y),u=ci(i,f,s),u!==null&&(dn(u,i,s),xl(u,i,s))}function mb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Vh(i,s){mb(i,s),(i=i.alternate)&&mb(i,s)}function gb(i){if(i.tag===13||i.tag===31){var s=uo(i,67108864);s!==null&&dn(s,i,67108864),Vh(i,67108864)}}function yb(i){if(i.tag===13||i.tag===31){var s=Mn();s=ti(s);var u=uo(i,s);u!==null&&dn(u,i,s),Vh(i,s)}}var Ju=!0;function hO(i,s,u,f){var m=V.T;V.T=null;var y=Z.p;try{Z.p=2,Fh(i,s,u,f)}finally{Z.p=y,V.T=m}}function pO(i,s,u,f){var m=V.T;V.T=null;var y=Z.p;try{Z.p=8,Fh(i,s,u,f)}finally{Z.p=y,V.T=m}}function Fh(i,s,u,f){if(Ju){var m=Ph(f);if(m===null)Rh(i,s,f,Qu,u),bb(i,f);else if(gO(m,i,s,u,f))f.stopPropagation();else if(bb(i,f),s&4&&-1<mO.indexOf(i)){for(;m!==null;){var y=Pe(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=Rt(y.pendingLanes);if(w!==0){var T=y;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var k=1<<31-Wt(w);T.entanglements[1]|=k,w&=~k}ur(y),(Ge&6)===0&&(_u=Qt()+500,Ll(0))}}break;case 31:case 13:T=uo(y,2),T!==null&&dn(T,y,2),ju(),Vh(y,2)}if(y=Ph(f),y===null&&Rh(i,s,f,Qu,u),y===m)break;m=y}m!==null&&f.stopPropagation()}else Rh(i,s,f,null,u)}}function Ph(i){return i=Hf(i),$h(i)}var Qu=null;function $h(i){if(Qu=null,i=wr(i),i!==null){var s=l(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=a(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Qu=i,null}function vb(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(tl()){case gn:return 2;case nl:return 8;case eo:case La:return 32;case rl:return 268435456;default:return 32}default:return 32}}var Hh=!1,xi=null,wi=null,Ci=null,Ul=new Map,Gl=new Map,Mi=[],mO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function bb(i,s){switch(i){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":Ci=null;break;case"pointerover":case"pointerout":Ul.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(s.pointerId)}}function ql(i,s,u,f,m,y){return i===null||i.nativeEvent!==y?(i={blockedOn:s,domEventName:u,eventSystemFlags:f,nativeEvent:y,targetContainers:[m]},s!==null&&(s=Pe(s),s!==null&&gb(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),i)}function gO(i,s,u,f,m){switch(s){case"focusin":return xi=ql(xi,i,s,u,f,m),!0;case"dragenter":return wi=ql(wi,i,s,u,f,m),!0;case"mouseover":return Ci=ql(Ci,i,s,u,f,m),!0;case"pointerover":var y=m.pointerId;return Ul.set(y,ql(Ul.get(y)||null,i,s,u,f,m)),!0;case"gotpointercapture":return y=m.pointerId,Gl.set(y,ql(Gl.get(y)||null,i,s,u,f,m)),!0}return!1}function Sb(i){var s=wr(i.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=a(u),s!==null){i.blockedOn=s,$a(i.priority,function(){yb(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,$a(i.priority,function(){yb(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Zu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Ph(i.nativeEvent);if(u===null){u=i.nativeEvent;var f=new u.constructor(u.type,u);$f=f,u.target.dispatchEvent(f),$f=null}else return s=Pe(u),s!==null&&gb(s),i.blockedOn=u,!1;s.shift()}return!0}function xb(i,s,u){Zu(i)&&u.delete(s)}function yO(){Hh=!1,xi!==null&&Zu(xi)&&(xi=null),wi!==null&&Zu(wi)&&(wi=null),Ci!==null&&Zu(Ci)&&(Ci=null),Ul.forEach(xb),Gl.forEach(xb)}function Wu(i,s){i.blockedOn===s&&(i.blockedOn=null,Hh||(Hh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,yO)))}var ec=null;function wb(i){ec!==i&&(ec=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ec===i&&(ec=null);for(var s=0;s<i.length;s+=3){var u=i[s],f=i[s+1],m=i[s+2];if(typeof f!="function"){if($h(f||u)===null)continue;break}var y=Pe(u);y!==null&&(i.splice(s,3),s-=3,Pd(y,{pending:!0,data:m,method:u.method,action:f},f,m))}}))}function Rs(i){function s(k){return Wu(k,i)}xi!==null&&Wu(xi,i),wi!==null&&Wu(wi,i),Ci!==null&&Wu(Ci,i),Ul.forEach(s),Gl.forEach(s);for(var u=0;u<Mi.length;u++){var f=Mi[u];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Mi.length&&(u=Mi[0],u.blockedOn===null);)Sb(u),u.blockedOn===null&&Mi.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var m=u[f],y=u[f+1],w=m[ce]||null;if(typeof y=="function")w||wb(u);else if(w){var T=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[ce]||null)T=w.formAction;else if($h(m)!==null)continue}else T=w.action;typeof T=="function"?u[f+1]=T:(u.splice(f,3),f-=3),wb(u)}}}function Cb(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function s(){m!==null&&(m(),m=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),m!==null&&(m(),m=null)}}}function Uh(i){this._internalRoot=i}tc.prototype.render=Uh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,f=Mn();pb(u,f,i,s,null,null)},tc.prototype.unmount=Uh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;pb(i.current,2,null,i,null,null),ju(),s[Oe]=null}};function tc(i){this._internalRoot=i}tc.prototype.unstable_scheduleHydration=function(i){if(i){var s=Pa();i={blockedOn:null,target:i,priority:s};for(var u=0;u<Mi.length&&s!==0&&s<Mi[u].priority;u++);Mi.splice(u,0,i),u===0&&Sb(i)}};var Mb=e.version;if(Mb!=="19.2.4")throw Error(r(527,Mb,"19.2.4"));Z.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var vO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{to=nc.inject(vO),Zt=nc}catch{}}return Yl.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,f="",m=N0,y=D0,w=_0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError)),s=db(i,1,!1,null,null,u,f,null,m,y,w,Cb),i[Oe]=s.current,Eh(i),new Uh(s)},Yl.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var f=!1,m="",y=N0,w=D0,T=_0,k=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(T=u.onRecoverableError),u.formState!==void 0&&(k=u.formState)),s=db(i,1,!0,s,u??null,f,m,k,y,w,T,Cb),s.context=hb(null),u=s.current,f=Mn(),f=ti(f),m=ui(f),m.callback=null,ci(u,m,f),u=f,s.current.lanes=u,ei(s,u),ur(s),i[Oe]=s.current,Eh(i),new tc(s)},Yl.version="19.2.4",Yl}var zb;function AO(){if(zb)return Kh.exports;zb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Kh.exports=TO(),Kh.exports}var OO=AO();const S1=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();const kO=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const NO=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());const jb=t=>{const e=NO(t);return e.charAt(0).toUpperCase()+e.slice(1)};var DO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const _O=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const zO=M.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:a,...c},d)=>M.createElement("svg",{ref:d,...DO,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:S1("lucide",o),...!l&&!_O(c)&&{"aria-hidden":"true"},...c},[...a.map(([h,p])=>M.createElement(h,p)),...Array.isArray(l)?l:[l]]));const Ue=(t,e)=>{const n=M.forwardRef(({className:r,...o},l)=>M.createElement(zO,{ref:l,iconNode:e,className:S1(`lucide-${kO(jb(t))}`,`lucide-${t}`,r),...o}));return n.displayName=jb(t),n};const jO=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],IO=Ue("arrow-down",jO);const LO=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],BO=Ue("arrow-up",LO);const VO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],FO=Ue("ban",VO);const PO=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],$O=Ue("braces",PO);const HO=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],UO=Ue("calendar-days",HO);const GO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Js=Ue("check",GO);const qO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],x1=Ue("chevron-down",qO);const KO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dm=Ue("chevron-right",KO);const YO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],_m=Ue("circle-alert",YO);const XO=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],JO=Ue("circle-play",XO);const QO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],ZO=Ue("circle-stop",QO);const WO=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],w1=Ue("copy",WO);const ek=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Yp=Ue("download",ek);const tk=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],nk=Ue("ellipsis",tk);const rk=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ik=Ue("external-link",rk);const ok=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],C1=Ue("funnel",ok);const sk=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],lk=Ue("hash",sk);const ak=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],uk=Ue("info",ak);const ck=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],fk=Ue("layout-grid",ck);const dk=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],hk=Ue("list-filter",dk);const pk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],af=Ue("loader-circle",pk);const mk=[["path",{d:"M5 12h14",key:"1ays0h"}]],gk=Ue("minus",mk);const yk=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],M1=Ue("moon",yk);const vk=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],bk=Ue("play",vk);const Sk=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],xk=Ue("refresh-ccw",Sk);const wk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],zm=Ue("search",wk);const Ck=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],E1=Ue("settings-2",Ck);const Mk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ib=Ue("square-check",Mk);const Ek=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],R1=Ue("sun",Ek);const Rk=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Tk=Ue("trash-2",Rk);const Ak=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Ok=Ue("type",Ak);const kk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jm=Ue("x",kk);function $n(t,e){return typeof t=="function"?t(e):t}function On(t,e){return n=>{e.setState(r=>({...r,[t]:$n(n,r[t])}))}}function uf(t){return t instanceof Function}function Nk(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function T1(t,e){const n=[],r=o=>{o.forEach(l=>{n.push(l);const a=e(l);a!=null&&a.length&&r(a)})};return r(t),n}function Me(t,e,n){let r=[],o;return l=>{let a;n.key&&n.debug&&(a=Date.now());const c=t(l);if(!(c.length!==r.length||c.some((p,g)=>r[g]!==p)))return o;r=c;let h;if(n.key&&n.debug&&(h=Date.now()),o=e(...c),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-h)*100)/100,v=g/16,b=(S,x)=>{for(S=String(S);S.length<x;)S=" "+S;return S};console.info(`%c⏱ ${b(g,5)} /${b(p,5)} ms`,`
|
|
10
|
+
font-size: .6rem;
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return o}}function Ee(t,e,n,r){return{debug:()=>{var o;return(o=t?.debugAll)!=null?o:t[e]},key:!1,onChange:r}}function Dk(t,e,n,r){const o=()=>{var a;return(a=l.getValue())!=null?a:t.options.renderFallbackValue},l={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:o,getContext:Me(()=>[t,n,e,l],(a,c,d,h)=>({table:a,column:c,row:d,cell:h,getValue:h.getValue,renderValue:h.renderValue}),Ee(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(l,n,e,t)},{}),l}function _k(t,e,n,r){var o,l;const c={...t._getDefaultColumnDef(),...e},d=c.accessorKey;let h=(o=(l=c.id)!=null?l:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,p;if(c.accessorFn?p=c.accessorFn:d&&(d.includes(".")?p=v=>{let b=v;for(const x of d.split(".")){var S;b=(S=b)==null?void 0:S[x]}return b}:p=v=>v[c.accessorKey]),!h)throw new Error;let g={id:`${String(h)}`,accessorFn:p,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:Me(()=>[!0],()=>{var v;return[g,...(v=g.columns)==null?void 0:v.flatMap(b=>b.getFlatColumns())]},Ee(t.options,"debugColumns")),getLeafColumns:Me(()=>[t._getOrderColumnsFn()],v=>{var b;if((b=g.columns)!=null&&b.length){let S=g.columns.flatMap(x=>x.getLeafColumns());return v(S)}return[g]},Ee(t.options,"debugColumns"))};for(const v of t._features)v.createColumn==null||v.createColumn(g,t);return g}const $t="debugHeaders";function Lb(t,e,n){var r;let l={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),a.push(d)};return c(l),a},getContext:()=>({table:t,header:l,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(l,t)}),l}const zk={createTable:t=>{t.getHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>{var l,a;const c=(l=r?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?l:[],d=(a=o?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?a:[],h=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return rc(e,[...c,...h,...d],t)},Ee(t.options,$t)),t.getCenterHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(o!=null&&o.includes(l.id))),rc(e,n,t,"center")),Ee(t.options,$t)),t.getLeftHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var o;const l=(o=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return rc(e,l,t,"left")},Ee(t.options,$t)),t.getRightHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var o;const l=(o=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return rc(e,l,t,"right")},Ee(t.options,$t)),t.getFooterGroups=Me(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getLeftFooterGroups=Me(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getCenterFooterGroups=Me(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getRightFooterGroups=Me(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getFlatHeaders=Me(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getLeftFlatHeaders=Me(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getCenterFlatHeaders=Me(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getRightFlatHeaders=Me(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getCenterLeafHeaders=Me(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ee(t.options,$t)),t.getLeftLeafHeaders=Me(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ee(t.options,$t)),t.getRightLeafHeaders=Me(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ee(t.options,$t)),t.getLeafHeaders=Me(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var o,l,a,c,d,h;return[...(o=(l=e[0])==null?void 0:l.headers)!=null?o:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},Ee(t.options,$t))}};function rc(t,e,n,r){var o,l;let a=0;const c=function(v,b){b===void 0&&(b=1),a=Math.max(a,b),v.filter(S=>S.getIsVisible()).forEach(S=>{var x;(x=S.columns)!=null&&x.length&&c(S.columns,b+1)},0)};c(t);let d=[];const h=(v,b)=>{const S={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},x=[];v.forEach(C=>{const E=[...x].reverse()[0],A=C.column.depth===S.depth;let O,D=!1;if(A&&C.column.parent?O=C.column.parent:(O=C.column,D=!0),E&&E?.column===O)E.subHeaders.push(C);else{const z=Lb(n,O,{id:[r,b,O.id,C?.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${x.filter(L=>L.column===O).length}`:void 0,depth:b,index:x.length});z.subHeaders.push(C),x.push(z)}S.headers.push(C),C.headerGroup=S}),d.push(S),b>0&&h(x,b-1)},p=e.map((v,b)=>Lb(n,v,{depth:a,index:b}));h(p,a-1),d.reverse();const g=v=>v.filter(S=>S.column.getIsVisible()).map(S=>{let x=0,C=0,E=[0];S.subHeaders&&S.subHeaders.length?(E=[],g(S.subHeaders).forEach(O=>{let{colSpan:D,rowSpan:z}=O;x+=D,E.push(z)})):x=1;const A=Math.min(...E);return C=C+A,S.colSpan=x,S.rowSpan=C,{colSpan:x,rowSpan:C}});return g((o=(l=d[0])==null?void 0:l.headers)!=null?o:[]),d}const cf=(t,e,n,r,o,l,a)=>{let c={id:e,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const h=t.getColumn(d);if(h!=null&&h.accessorFn)return c._valuesCache[d]=h.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const h=t.getColumn(d);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=h.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var h;return(h=c.getValue(d))!=null?h:t.options.renderFallbackValue},subRows:l??[],getLeafRows:()=>T1(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?t.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],h=c;for(;;){const p=h.getParentRow();if(!p)break;d.push(p),h=p}return d.reverse()},getAllCells:Me(()=>[t.getAllLeafColumns()],d=>d.map(h=>Dk(t,c,h,h.id)),Ee(t.options,"debugRows")),_getAllCellsByColumnId:Me(()=>[c.getAllCells()],d=>d.reduce((h,p)=>(h[p.column.id]=p,h),{}),Ee(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const h=t._features[d];h==null||h.createRow==null||h.createRow(c,t)}return c},jk={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},A1=(t,e,n)=>{var r,o;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};A1.autoRemove=t=>Wn(t);const O1=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};O1.autoRemove=t=>Wn(t);const k1=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};k1.autoRemove=t=>Wn(t);const N1=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};N1.autoRemove=t=>Wn(t);const D1=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});D1.autoRemove=t=>Wn(t)||!(t!=null&&t.length);const _1=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});_1.autoRemove=t=>Wn(t)||!(t!=null&&t.length);const z1=(t,e,n)=>t.getValue(e)===n;z1.autoRemove=t=>Wn(t);const j1=(t,e,n)=>t.getValue(e)==n;j1.autoRemove=t=>Wn(t);const Im=(t,e,n)=>{let[r,o]=n;const l=t.getValue(e);return l>=r&&l<=o};Im.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,o=typeof n!="number"?parseFloat(n):n,l=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(l>a){const c=l;l=a,a=c}return[l,a]};Im.autoRemove=t=>Wn(t)||Wn(t[0])&&Wn(t[1]);const Hr={includesString:A1,includesStringSensitive:O1,equalsString:k1,arrIncludes:N1,arrIncludesAll:D1,arrIncludesSome:_1,equals:z1,weakEquals:j1,inNumberRange:Im};function Wn(t){return t==null||t===""}const Ik={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:On("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);return typeof r=="string"?Hr.includesString:typeof r=="number"?Hr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Hr.equals:Array.isArray(r)?Hr.arrIncludes:Hr.weakEquals},t.getFilterFn=()=>{var n,r;return uf(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Hr[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,o;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const o=t.getFilterFn(),l=r?.find(p=>p.id===t.id),a=$n(n,l?l.value:void 0);if(Bb(o,a,t)){var c;return(c=r?.filter(p=>p.id!==t.id))!=null?c:[]}const d={id:t.id,value:a};if(l){var h;return(h=r?.map(p=>p.id===t.id?d:p))!=null?h:[]}return r!=null&&r.length?[...r,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=o=>{var l;return(l=$n(e,o))==null?void 0:l.filter(a=>{const c=n.find(d=>d.id===a.id);if(c){const d=c.getFilterFn();if(Bb(d,a.value,c))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function Bb(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Lk=(t,e,n)=>n.reduce((r,o)=>{const l=o.getValue(t);return r+(typeof l=="number"?l:0)},0),Bk=(t,e,n)=>{let r;return n.forEach(o=>{const l=o.getValue(t);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},Vk=(t,e,n)=>{let r;return n.forEach(o=>{const l=o.getValue(t);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},Fk=(t,e,n)=>{let r,o;return n.forEach(l=>{const a=l.getValue(t);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},Pk=(t,e)=>{let n=0,r=0;if(e.forEach(o=>{let l=o.getValue(t);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},$k=(t,e)=>{if(!e.length)return;const n=e.map(l=>l.getValue(t));if(!Nk(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((l,a)=>l-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},Hk=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Uk=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,Gk=(t,e)=>e.length,Qh={sum:Lk,min:Bk,max:Vk,extent:Fk,mean:Pk,median:$k,unique:Hk,uniqueCount:Uk,count:Gk},qk={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:On("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);if(typeof r=="number")return Qh.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Qh.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return uf(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:Qh[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var o;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Kk(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(l=>!e.includes(l.id));return n==="remove"?r:[...e.map(l=>t.find(a=>a.id===l)).filter(Boolean),...r]}const Yk={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:On("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Me(n=>[oa(e,n)],n=>n.findIndex(r=>r.id===t.id),Ee(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=oa(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=oa(e,n);return((r=o[o.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Me(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>o=>{let l=[];if(!(e!=null&&e.length))l=o;else{const a=[...e],c=[...o];for(;c.length&&a.length;){const d=a.shift(),h=c.findIndex(p=>p.id===d);h>-1&&l.push(c.splice(h,1)[0])}l=[...l,...c]}return Kk(l,n,r)},Ee(t.options,"debugTable"))}},Zh=()=>({left:[],right:[]}),Xk={getInitialState:t=>({columnPinning:Zh(),...t}),getDefaultOptions:t=>({onColumnPinningChange:On("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(o=>o.id).filter(Boolean);e.setColumnPinning(o=>{var l,a;if(n==="right"){var c,d;return{left:((c=o?.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((d=o?.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var h,p;return{left:[...((h=o?.left)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((p=o?.right)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((l=o?.left)!=null?l:[]).filter(g=>!(r!=null&&r.includes(g))),right:((a=o?.right)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var o,l,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((l=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?l:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(c=>c.id),{left:r,right:o}=e.getState().columnPinning,l=n.some(c=>r?.includes(c)),a=n.some(c=>o?.includes(c));return l?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();return o?(n=(r=e.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Me(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const l=[...r??[],...o??[]];return n.filter(a=>!l.includes(a.column.id))},Ee(e.options,"debugRows")),t.getLeftVisibleCells=Me(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(a=>a.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),Ee(e.options,"debugRows")),t.getRightVisibleCells=Me(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(a=>a.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),Ee(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Zh():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Zh())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var o,l;return!!((o=r.left)!=null&&o.length||(l=r.right)!=null&&l.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=Me(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ee(t.options,"debugColumns")),t.getRightLeafColumns=Me(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ee(t.options,"debugColumns")),t.getCenterLeafColumns=Me(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const o=[...n??[],...r??[]];return e.filter(l=>!o.includes(l.id))},Ee(t.options,"debugColumns"))}};function Jk(t){return t||(typeof document<"u"?document:null)}const ic={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Wh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Qk={getDefaultColumnDef:()=>ic,getInitialState:t=>({columnSizing:{},columnSizingInfo:Wh(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:On("columnSizing",t),onColumnSizingInfoChange:On("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,o;const l=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:ic.minSize,(r=l??t.columnDef.size)!=null?r:ic.size),(o=t.columnDef.maxSize)!=null?o:ic.maxSize)},t.getStart=Me(n=>[n,oa(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,l)=>o+l.getSize(),0),Ee(e.options,"debugColumns")),t.getAfter=Me(n=>[n,oa(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,l)=>o+l.getSize(),0),Ee(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...o}=n;return o})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var l;n+=(l=o.column.getSize())!=null?l:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),o=r?.getCanResize();return l=>{if(!r||!o||(l.persist==null||l.persist(),ep(l)&&l.touches&&l.touches.length>1))return;const a=t.getSize(),c=t?t.getLeafHeaders().map(E=>[E.column.id,E.column.getSize()]):[[r.id,r.getSize()]],d=ep(l)?Math.round(l.touches[0].clientX):l.clientX,h={},p=(E,A)=>{typeof A=="number"&&(e.setColumnSizingInfo(O=>{var D,z;const L=e.options.columnResizeDirection==="rtl"?-1:1,_=(A-((D=O?.startOffset)!=null?D:0))*L,I=Math.max(_/((z=O?.startSize)!=null?z:0),-.999999);return O.columnSizingStart.forEach(Q=>{let[ue,se]=Q;h[ue]=Math.round(Math.max(se+se*I,0)*100)/100}),{...O,deltaOffset:_,deltaPercentage:I}}),(e.options.columnResizeMode==="onChange"||E==="end")&&e.setColumnSizing(O=>({...O,...h})))},g=E=>p("move",E),v=E=>{p("end",E),e.setColumnSizingInfo(A=>({...A,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=Jk(n),S={moveHandler:E=>g(E.clientX),upHandler:E=>{b?.removeEventListener("mousemove",S.moveHandler),b?.removeEventListener("mouseup",S.upHandler),v(E.clientX)}},x={moveHandler:E=>(E.cancelable&&(E.preventDefault(),E.stopPropagation()),g(E.touches[0].clientX),!1),upHandler:E=>{var A;b?.removeEventListener("touchmove",x.moveHandler),b?.removeEventListener("touchend",x.upHandler),E.cancelable&&(E.preventDefault(),E.stopPropagation()),v((A=E.touches[0])==null?void 0:A.clientX)}},C=Zk()?{passive:!1}:!1;ep(l)?(b?.addEventListener("touchmove",x.moveHandler,C),b?.addEventListener("touchend",x.upHandler,C)):(b?.addEventListener("mousemove",S.moveHandler,C),b?.addEventListener("mouseup",S.upHandler,C)),e.setColumnSizingInfo(E=>({...E,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Wh():(n=t.initialState.columnSizingInfo)!=null?n:Wh())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0}}};let oc=null;function Zk(){if(typeof oc=="boolean")return oc;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return oc=t,oc}function ep(t){return t.type==="touchstart"}const Wk={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:On("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const o=t.columns;return(n=o.length?o.some(l=>l.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Me(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ee(e.options,"debugRows")),t.getVisibleCells=Me(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Ee(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>Me(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),Ee(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((o,l)=>({...o,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function oa(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const eN={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},tN={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:On("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,o,l;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&((l=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?l:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Hr.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return uf(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Hr[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},nN={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:On("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var o,l;t.setExpanded(r?{}:(o=(l=t.initialState)==null?void 0:l.expanded)!=null?o:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(l=>{const a=l.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var o;const l=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(o=n)!=null?o:!l,!l&&n)return{...a,[t.id]:!0};if(l&&!n){const{[t.id]:c,...d}=a;return d}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r?.[t.id])},t.getCanExpand=()=>{var n,r,o;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((o=t.subRows)!=null&&o.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Xp=0,Jp=10,tp=()=>({pageIndex:Xp,pageSize:Jp}),rN={getInitialState:t=>({...t,pagination:{...tp(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:On("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const o=l=>$n(r,l);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?tp():(o=t.initialState.pagination)!=null?o:tp())},t.setPageIndex=r=>{t.setPagination(o=>{let l=$n(r,o.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return l=Math.max(0,Math.min(l,a)),{...o,pageIndex:l}})},t.resetPageIndex=r=>{var o,l;t.setPageIndex(r?Xp:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Xp)},t.resetPageSize=r=>{var o,l;t.setPageSize(r?Jp:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Jp)},t.setPageSize=r=>{t.setPagination(o=>{const l=Math.max(1,$n(r,o.pageSize)),a=o.pageSize*o.pageIndex,c=Math.floor(a/l);return{...o,pageIndex:c,pageSize:l}})},t.setPageCount=r=>t.setPagination(o=>{var l;let a=$n(r,(l=t.options.pageCount)!=null?l:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),t.getPageOptions=Me(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((l,a)=>a)),o},Ee(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,o=t.getPageCount();return o===-1?!0:o===0?!1:r<o-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},np=()=>({top:[],bottom:[]}),iN={getInitialState:t=>({rowPinning:np(),...t}),getDefaultOptions:t=>({onRowPinningChange:On("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,o)=>{const l=r?t.getLeafRows().map(d=>{let{id:h}=d;return h}):[],a=o?t.getParentRows().map(d=>{let{id:h}=d;return h}):[],c=new Set([...a,t.id,...l]);e.setRowPinning(d=>{var h,p;if(n==="bottom"){var g,v;return{top:((g=d?.top)!=null?g:[]).filter(x=>!(c!=null&&c.has(x))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)]}}if(n==="top"){var b,S;return{top:[...((b=d?.top)!=null?b:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)],bottom:((S=d?.bottom)!=null?S:[]).filter(x=>!(c!=null&&c.has(x)))}}return{top:((h=d?.top)!=null?h:[]).filter(x=>!(c!=null&&c.has(x))),bottom:((p=d?.bottom)!=null?p:[]).filter(x=>!(c!=null&&c.has(x)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=e.options;return typeof r=="function"?r(t):(n=r??o)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:o}=e.getState().rowPinning,l=n.some(c=>r?.includes(c)),a=n.some(c=>o?.includes(c));return l?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();if(!o)return-1;const l=(n=o==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=l?.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?np():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:np())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var o,l;return!!((o=r.top)!=null&&o.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var o;return((o=t.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const c=t.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>e.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=Me(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Ee(t.options,"debugRows")),t.getBottomRows=Me(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Ee(t.options,"debugRows")),t.getCenterRows=Me(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const o=new Set([...n??[],...r??[]]);return e.filter(l=>!o.has(l.id))},Ee(t.options,"debugRows"))}},oN={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:On("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},o=t.getPreGroupedRowModel().flatRows;return e?o.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):o.forEach(l=>{delete r[l.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),o={...n};return t.getRowModel().rows.forEach(l=>{Qp(o,l.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Me(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?rp(t,n):{rows:[],flatRows:[],rowsById:{}},Ee(t.options,"debugTable")),t.getFilteredSelectedRowModel=Me(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?rp(t,n):{rows:[],flatRows:[],rowsById:{}},Ee(t.options,"debugTable")),t.getGroupedSelectedRowModel=Me(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?rp(t,n):{rows:[],flatRows:[],rowsById:{}},Ee(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(o=>!n[o.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const o=t.getIsSelected();e.setRowSelection(l=>{var a;if(n=typeof n<"u"?n:!o,t.getCanSelect()&&o===n)return l;const c={...l};return Qp(c,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),c})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Lm(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Zp(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Zp(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var o;n&&t.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Qp=(t,e,n,r,o)=>{var l;const a=o.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(c=>delete t[c]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(l=a.subRows)!=null&&l.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>Qp(t,c.id,n,r,o))};function rp(t,e){const n=t.getState().rowSelection,r=[],o={},l=function(a,c){return a.map(d=>{var h;const p=Lm(d,n);if(p&&(r.push(d),o[d.id]=d),(h=d.subRows)!=null&&h.length&&(d={...d,subRows:l(d.subRows)}),p)return d}).filter(Boolean)};return{rows:l(e.rows),flatRows:r,rowsById:o}}function Lm(t,e){var n;return(n=e[t.id])!=null?n:!1}function Zp(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let o=!0,l=!1;return t.subRows.forEach(a=>{if(!(l&&!o)&&(a.getCanSelect()&&(Lm(a,e)?l=!0:o=!1),a.subRows&&a.subRows.length)){const c=Zp(a,e);c==="all"?l=!0:(c==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Wp=/([0-9]+)/gm,sN=(t,e,n)=>I1(Pi(t.getValue(n)).toLowerCase(),Pi(e.getValue(n)).toLowerCase()),lN=(t,e,n)=>I1(Pi(t.getValue(n)),Pi(e.getValue(n))),aN=(t,e,n)=>Bm(Pi(t.getValue(n)).toLowerCase(),Pi(e.getValue(n)).toLowerCase()),uN=(t,e,n)=>Bm(Pi(t.getValue(n)),Pi(e.getValue(n))),cN=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},fN=(t,e,n)=>Bm(t.getValue(n),e.getValue(n));function Bm(t,e){return t===e?0:t>e?1:-1}function Pi(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function I1(t,e){const n=t.split(Wp).filter(Boolean),r=e.split(Wp).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),l=r.shift(),a=parseInt(o,10),c=parseInt(l,10),d=[a,c].sort();if(isNaN(d[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const Xl={alphanumeric:sN,alphanumericCaseSensitive:lN,text:aN,textCaseSensitive:uN,datetime:cN,basic:fN},dN={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:On("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const l=o?.getValue(t.id);if(Object.prototype.toString.call(l)==="[object Date]")return Xl.datetime;if(typeof l=="string"&&(r=!0,l.split(Wp).length>1))return Xl.alphanumeric}return r?Xl.text:Xl.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return uf(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Xl[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),l=typeof n<"u"&&n!==null;e.setSorting(a=>{const c=a?.find(b=>b.id===t.id),d=a?.findIndex(b=>b.id===t.id);let h=[],p,g=l?n:o==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?c?p="toggle":p="add":a!=null&&a.length&&d!==a.length-1?p="replace":c?p="toggle":p="replace",p==="toggle"&&(l||o||(p="remove")),p==="add"){var v;h=[...a,{id:t.id,desc:g}],h.splice(0,h.length-((v=e.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else p==="toggle"?h=a.map(b=>b.id===t.id?{...b,desc:g}:b):p==="remove"?h=a.filter(b=>b.id!==t.id):h=[{id:t.id,desc:g}];return h})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,o;const l=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==l&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(o=e.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":l},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(o=>o.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},hN=[zk,Wk,Yk,Xk,jk,Ik,eN,tN,dN,qk,nN,rN,iN,oN,Qk];function pN(t){var e,n;const r=[...hN,...(e=t._features)!=null?e:[]];let o={_features:r};const l=o._features.reduce((v,b)=>Object.assign(v,b.getDefaultOptions==null?void 0:b.getDefaultOptions(o)),{}),a=v=>o.options.mergeOptions?o.options.mergeOptions(l,v):{...l,...v};let d={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(v=>{var b;d=(b=v.getInitialState==null?void 0:v.getInitialState(d))!=null?b:d});const h=[];let p=!1;const g={_features:r,options:{...l,...t},initialState:d,_queue:v=>{h.push(v),p||(p=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();p=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{o.setState(o.initialState)},setOptions:v=>{const b=$n(v,o.options);o.options=a(b)},getState:()=>o.options.state,setState:v=>{o.options.onStateChange==null||o.options.onStateChange(v)},_getRowId:(v,b,S)=>{var x;return(x=o.options.getRowId==null?void 0:o.options.getRowId(v,b,S))!=null?x:`${S?[S.id,b].join("."):b}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(v,b)=>{let S=(b?o.getPrePaginationRowModel():o.getRowModel()).rowsById[v];if(!S&&(S=o.getCoreRowModel().rowsById[v],!S))throw new Error;return S},_getDefaultColumnDef:Me(()=>[o.options.defaultColumn],v=>{var b;return v=(b=v)!=null?b:{},{header:S=>{const x=S.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:S=>{var x,C;return(x=(C=S.renderValue())==null||C.toString==null?void 0:C.toString())!=null?x:null},...o._features.reduce((S,x)=>Object.assign(S,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...v}},Ee(t,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Me(()=>[o._getColumnDefs()],v=>{const b=function(S,x,C){return C===void 0&&(C=0),S.map(E=>{const A=_k(o,E,C,x),O=E;return A.columns=O.columns?b(O.columns,A,C+1):[],A})};return b(v)},Ee(t,"debugColumns")),getAllFlatColumns:Me(()=>[o.getAllColumns()],v=>v.flatMap(b=>b.getFlatColumns()),Ee(t,"debugColumns")),_getAllFlatColumnsById:Me(()=>[o.getAllFlatColumns()],v=>v.reduce((b,S)=>(b[S.id]=S,b),{}),Ee(t,"debugColumns")),getAllLeafColumns:Me(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(v,b)=>{let S=v.flatMap(x=>x.getLeafColumns());return b(S)},Ee(t,"debugColumns")),getColumn:v=>o._getAllFlatColumnsById()[v]};Object.assign(o,g);for(let v=0;v<o._features.length;v++){const b=o._features[v];b==null||b.createTable==null||b.createTable(o)}return o}function mN(){return t=>Me(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,l,a){l===void 0&&(l=0);const c=[];for(let h=0;h<o.length;h++){const p=cf(t,t._getRowId(o[h],h,a),o[h],h,l,void 0,a?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,c.push(p),t.options.getSubRows){var d;p.originalSubRows=t.options.getSubRows(o[h],h),(d=p.originalSubRows)!=null&&d.length&&(p.subRows=r(p.originalSubRows,l+1,p))}}return c};return n.rows=r(e),n},Ee(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function gN(){return t=>Me(()=>[t.getState().expanded,t.getPreExpandedRowModel(),t.options.paginateExpandedRows],(e,n,r)=>!n.rows.length||e!==!0&&!Object.keys(e??{}).length||!r?n:yN(n),Ee(t.options,"debugTable"))}function yN(t){const e=[],n=r=>{var o;e.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function vN(t,e,n){return n.options.filterFromLeafRows?bN(t,e,n):SN(t,e,n)}function bN(t,e,n){var r;const o=[],l={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const p=[];for(let v=0;v<d.length;v++){var g;let b=d[v];const S=cf(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(S.columnFilters=b.columnFilters,(g=b.subRows)!=null&&g.length&&h<a){if(S.subRows=c(b.subRows,h+1),b=S,e(b)&&!S.subRows.length){p.push(b),l[b.id]=b,o.push(b);continue}if(e(b)||S.subRows.length){p.push(b),l[b.id]=b,o.push(b);continue}}else b=S,e(b)&&(p.push(b),l[b.id]=b,o.push(b))}return p};return{rows:c(t),flatRows:o,rowsById:l}}function SN(t,e,n){var r;const o=[],l={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const p=[];for(let v=0;v<d.length;v++){let b=d[v];if(e(b)){var g;if((g=b.subRows)!=null&&g.length&&h<a){const x=cf(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);x.subRows=c(b.subRows,h+1),b=x}p.push(b),o.push(b),l[b.id]=b}}return p};return{rows:c(t),flatRows:o,rowsById:l}}function xN(){return t=>Me(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<e.flatRows.length;v++)e.flatRows[v].columnFilters={},e.flatRows[v].columnFiltersMeta={};return e}const o=[],l=[];(n??[]).forEach(v=>{var b;const S=t.getColumn(v.id);if(!S)return;const x=S.getFilterFn();x&&o.push({id:v.id,filterFn:x,resolvedValue:(b=x.resolveFilterValue==null?void 0:x.resolveFilterValue(v.value))!=null?b:v.value})});const a=(n??[]).map(v=>v.id),c=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&c&&d.length&&(a.push("__global__"),d.forEach(v=>{var b;l.push({id:v.id,filterFn:c,resolvedValue:(b=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?b:r})}));let h,p;for(let v=0;v<e.flatRows.length;v++){const b=e.flatRows[v];if(b.columnFilters={},o.length)for(let S=0;S<o.length;S++){h=o[S];const x=h.id;b.columnFilters[x]=h.filterFn(b,x,h.resolvedValue,C=>{b.columnFiltersMeta[x]=C})}if(l.length){for(let S=0;S<l.length;S++){p=l[S];const x=p.id;if(p.filterFn(b,x,p.resolvedValue,C=>{b.columnFiltersMeta[x]=C})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const g=v=>{for(let b=0;b<a.length;b++)if(v.columnFilters[a[b]]===!1)return!1;return!0};return vN(e.rows,g,t)},Ee(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function wN(){return t=>Me(()=>[t.getState().grouping,t.getPreGroupedRowModel()],(e,n)=>{if(!n.rows.length||!e.length)return n.rows.forEach(d=>{d.depth=0,d.parentId=void 0}),n;const r=e.filter(d=>t.getColumn(d)),o=[],l={},a=function(d,h,p){if(h===void 0&&(h=0),h>=r.length)return d.map(S=>(S.depth=h,o.push(S),l[S.id]=S,S.subRows&&(S.subRows=a(S.subRows,h+1,S.id)),S));const g=r[h],v=CN(d,g);return Array.from(v.entries()).map((S,x)=>{let[C,E]=S,A=`${g}:${C}`;A=p?`${p}>${A}`:A;const O=a(E,h+1,A);O.forEach(L=>{L.parentId=A});const D=h?T1(E,L=>L.subRows):E,z=cf(t,A,D[0].original,x,h,void 0,p);return Object.assign(z,{groupingColumnId:g,groupingValue:C,subRows:O,leafRows:D,getValue:L=>{if(r.includes(L)){if(z._valuesCache.hasOwnProperty(L))return z._valuesCache[L];if(E[0]){var _;z._valuesCache[L]=(_=E[0].getValue(L))!=null?_:void 0}return z._valuesCache[L]}if(z._groupingValuesCache.hasOwnProperty(L))return z._groupingValuesCache[L];const I=t.getColumn(L),Q=I?.getAggregationFn();if(Q)return z._groupingValuesCache[L]=Q(L,D,E),z._groupingValuesCache[L]}}),O.forEach(L=>{o.push(L),l[L.id]=L}),z})},c=a(n.rows,0);return c.forEach(d=>{o.push(d),l[d.id]=d}),{rows:c,flatRows:o,rowsById:l}},Ee(t.options,"debugTable","getGroupedRowModel",()=>{t._queue(()=>{t._autoResetExpanded(),t._autoResetPageIndex()})}))}function CN(t,e){const n=new Map;return t.reduce((r,o)=>{const l=`${o.getGroupingValue(e)}`,a=r.get(l);return a?a.push(o):r.set(l,[o]),r},n)}function MN(){return t=>Me(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,o=[],l=r.filter(d=>{var h;return(h=t.getColumn(d.id))==null?void 0:h.getCanSort()}),a={};l.forEach(d=>{const h=t.getColumn(d.id);h&&(a[d.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const c=d=>{const h=d.map(p=>({...p}));return h.sort((p,g)=>{for(let b=0;b<l.length;b+=1){var v;const S=l[b],x=a[S.id],C=x.sortUndefined,E=(v=S?.desc)!=null?v:!1;let A=0;if(C){const O=p.getValue(S.id),D=g.getValue(S.id),z=O===void 0,L=D===void 0;if(z||L){if(C==="first")return z?-1:1;if(C==="last")return z?1:-1;A=z&&L?0:z?C:-C}}if(A===0&&(A=x.sortingFn(p,g,S.id)),A!==0)return E&&(A*=-1),x.invertSorting&&(A*=-1),A}return p.index-g.index}),h.forEach(p=>{var g;o.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=c(p.subRows))}),h};return{rows:c(n.rows),flatRows:o,rowsById:n.rowsById}},Ee(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function em(t,e){return t?EN(t)?M.createElement(t,e):t:null}function EN(t){return RN(t)||typeof t=="function"||TN(t)}function RN(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function TN(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function AN(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=M.useState(()=>({current:pN(e)})),[r,o]=M.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...t,state:{...r,...t.state},onStateChange:a=>{o(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}var Ta=b1();const L1=y1(Ta);function Ts(t,e,n){let r=n.initialDeps??[],o,l=!0;function a(){var c,d,h;let p;n.key&&((c=n.debug)!=null&&c.call(n))&&(p=Date.now());const g=t();if(!(g.length!==r.length||g.some((S,x)=>r[x]!==S)))return o;r=g;let b;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(b=Date.now()),o=e(...g),n.key&&((h=n.debug)!=null&&h.call(n))){const S=Math.round((Date.now()-p)*100)/100,x=Math.round((Date.now()-b)*100)/100,C=x/16,E=(A,O)=>{for(A=String(A);A.length<O;)A=" "+A;return A};console.info(`%c⏱ ${E(x,5)} /${E(S,5)} ms`,`
|
|
13
|
+
font-size: .6rem;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(o),l=!1,o}return a.updateDeps=c=>{r=c},a}function Vb(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const ON=(t,e)=>Math.abs(t-e)<1.01,kN=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},Fb=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},NN=t=>t,DN=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},_N=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=a=>{const{width:c,height:d}=a;e({width:Math.round(c),height:Math.round(d)})};if(o(Fb(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(a=>{const c=()=>{const d=a[0];if(d?.borderBoxSize){const h=d.borderBoxSize[0];if(h){o({width:h.inlineSize,height:h.blockSize});return}}o(Fb(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},Pb={passive:!0},$b=typeof window>"u"?!0:"onscrollend"in window,zN=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const l=t.options.useScrollendEvent&&$b?()=>{}:kN(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),a=p=>()=>{const{horizontal:g,isRtl:v}=t.options;o=g?n.scrollLeft*(v&&-1||1):n.scrollTop,l(),e(o,p)},c=a(!0),d=a(!1);n.addEventListener("scroll",c,Pb);const h=t.options.useScrollendEvent&&$b;return h&&n.addEventListener("scrollend",d,Pb),()=>{n.removeEventListener("scroll",c),h&&n.removeEventListener("scrollend",d)}},jN=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},IN=(t,{adjustments:e=0,behavior:n},r)=>{var o,l;const a=t+e;(l=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class LN{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const a=()=>{const c=l.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var l;return(l=r())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=r())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:NN,rangeExtractor:DN,onChange:()=>{},measureElement:jN,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Ts(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,l=new Map;for(let a=r-1;a>=0;a--){const c=n[a];if(o.has(c.lane))continue;const d=l.get(c.lane);if(d==null||c.end>d.end?l.set(c.lane,c):c.end<d.end&&o.set(c.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=Ts(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:a,lanes:c}),{key:!1}),this.getMeasurements=Ts(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:a,lanes:c},d)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const v of this.laneAssignments.keys())v>=n&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const h=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,h),g=new Array(c).fill(void 0);for(let v=0;v<h;v++){const b=p[v];b&&(g[b.lane]=v)}for(let v=h;v<n;v++){const b=l(v),S=this.laneAssignments.get(v);let x,C;if(S!==void 0&&this.options.lanes>1){x=S;const D=g[x],z=D!==void 0?p[D]:void 0;C=z?z.end+this.options.gap:r+o}else{const D=this.options.lanes===1?p[v-1]:this.getFurthestMeasurement(p,v);C=D?D.end+this.options.gap:r+o,x=D?D.lane:v%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(v,x)}const E=d.get(b),A=typeof E=="number"?E:this.options.estimateSize(v),O=C+A;p[v]={index:v,start:C,size:A,end:O,key:b,lane:x},g[x]=v}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ts(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,l)=>this.range=n.length>0&&r>0?BN({measurements:n,outerSize:r,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ts(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,l,a)=>l===null||a===null?[]:n({startIndex:l,endIndex:a,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,o-l),c=Math.min(this.options.count-1,o+l);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),l=this.elementsCache.get(o);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o;const l=this.measurementsCache[n];if(!l)return;const a=this.itemSizeCache.get(l.key)??l.size,c=r-a;c!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,c,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.getVirtualItems=Ts(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let l=0,a=n.length;l<a;l++){const c=n[l],d=r[c];o.push(d)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Vb(r[B1(0,r.length-1,o=>Vb(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+l?"end":"start"),r==="center"?n+=(o-l)/2:r==="end"&&(n-=l);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=l+o-this.options.scrollPaddingEnd)r="end";else if(a.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const c=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:a,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.getOffsetForIndex(n,r);if(!l)return;const[a,c]=l,d=this.now();this.scrollState={index:n,align:c,behavior:o,startedAt:d,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,l=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const l=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&l.some(c=>c===null);){const c=r[a];l[c.lane]===null&&(l[c.lane]=c.end),a--}o=Math.max(...l.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,l=1,a=o!==this.scrollState.lastTargetOffset;if(!a&&ON(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const B1=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,l=n(o);if(l<r)t=o+1;else if(l>r)e=o-1;else return o}return t>0?t-1:0};function BN({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1,l=d=>t[d].start;if(t.length<=r)return{startIndex:0,endIndex:o};let a=B1(0,o,l,n),c=a;if(r===1)for(;c<o&&t[c].end<n+e;)c++;else if(r>1){const d=Array(r).fill(0);for(;c<o&&d.some(p=>p<n+e);){const p=t[c];d[p.lane]=p.end,c++}const h=Array(r).fill(n+e);for(;a>=0&&h.some(p=>p>=n);){const p=t[a];h[p.lane]=p.start,a--}a=Math.max(0,a-a%r),c=Math.min(o,c+(r-1-c%r))}return{startIndex:a,endIndex:c}}const Hb=typeof document<"u"?M.useLayoutEffect:M.useEffect;function VN({useFlushSync:t=!0,...e}){const n=M.useReducer(()=>({}),{})[1],r={...e,onChange:(l,a)=>{var c;t&&a?Ta.flushSync(n):n(),(c=e.onChange)==null||c.call(e,l,a)}},[o]=M.useState(()=>new LN(r));return o.setOptions(r),Hb(()=>o._didMount(),[]),Hb(()=>o._willUpdate()),o}function FN(t){return VN({observeElementRect:_N,observeElementOffset:zN,scrollToFn:IN,...t})}const Mc=["emerald","purple","sky","pink","red","zinc","lime","violet","fuchsia","teal","amber","rose","orange","cyan","indigo","yellow","green","coral","blue","stone"];function V1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=V1(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function F1(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=V1(t))&&(r&&(r+=" "),r+=e);return r}const PN=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},$N=(t,e)=>({classGroupId:t,validator:e}),P1=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Dc="-",Ub=[],HN="arbitrary..",UN=t=>{const e=qN(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return GN(a);const c=a.split(Dc),d=c[0]===""&&c.length>1?1:0;return $1(c,d,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const d=r[a],h=n[a];return d?h?PN(h,d):d:h||Ub}return n[a]||Ub}}},$1=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const h=$1(t,e+1,l);if(h)return h}const a=n.validators;if(a===null)return;const c=e===0?t.join(Dc):t.slice(e).join(Dc),d=a.length;for(let h=0;h<d;h++){const p=a[h];if(p.validator(c))return p.classGroupId}},GN=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?HN+r:void 0})(),qN=t=>{const{theme:e,classGroups:n}=t;return KN(n,e)},KN=(t,e)=>{const n=P1();for(const r in t){const o=t[r];Vm(o,n,r,e)}return n},Vm=(t,e,n,r)=>{const o=t.length;for(let l=0;l<o;l++){const a=t[l];YN(a,e,n,r)}},YN=(t,e,n,r)=>{if(typeof t=="string"){XN(t,e,n);return}if(typeof t=="function"){JN(t,e,n,r);return}QN(t,e,n,r)},XN=(t,e,n)=>{const r=t===""?e:H1(e,t);r.classGroupId=n},JN=(t,e,n,r)=>{if(ZN(t)){Vm(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push($N(n,t))},QN=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let a=0;a<l;a++){const[c,d]=o[a];Vm(d,H1(e,c),n,r)}},H1=(t,e)=>{let n=t;const r=e.split(Dc),o=r.length;for(let l=0;l<o;l++){const a=r[l];let c=n.nextPart.get(a);c||(c=P1(),n.nextPart.set(a,c)),n=c}return n},ZN=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,WN=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(l,a)=>{n[l]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=r[l])!==void 0)return o(l,a),a},set(l,a){l in n?n[l]=a:o(l,a)}}},tm="!",Gb=":",eD=[],qb=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),tD=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const l=[];let a=0,c=0,d=0,h;const p=o.length;for(let x=0;x<p;x++){const C=o[x];if(a===0&&c===0){if(C===Gb){l.push(o.slice(d,x)),d=x+1;continue}if(C==="/"){h=x;continue}}C==="["?a++:C==="]"?a--:C==="("?c++:C===")"&&c--}const g=l.length===0?o:o.slice(d);let v=g,b=!1;g.endsWith(tm)?(v=g.slice(0,-1),b=!0):g.startsWith(tm)&&(v=g.slice(1),b=!0);const S=h&&h>d?h-d:void 0;return qb(l,b,v,S)};if(e){const o=e+Gb,l=r;r=a=>a.startsWith(o)?l(a.slice(o.length)):qb(eD,!1,a,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},nD=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l<n.length;l++){const a=n[l],c=a[0]==="[",d=e.has(a);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},rD=t=>({cache:WN(t.cacheSize),parseClassName:tD(t),sortModifiers:nD(t),...UN(t)}),iD=/\s+/,oD=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,a=[],c=t.trim().split(iD);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:x}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!x,E=r(C?S.substring(0,x):S);if(!E){if(!C){d=p+(d.length>0?" "+d:d);continue}if(E=r(S),!E){d=p+(d.length>0?" "+d:d);continue}C=!1}const A=v.length===0?"":v.length===1?v[0]:l(v).join(":"),O=b?A+tm:A,D=O+E;if(a.indexOf(D)>-1)continue;a.push(D);const z=o(E,C);for(let L=0;L<z.length;++L){const _=z[L];a.push(O+_)}d=p+(d.length>0?" "+d:d)}return d},sD=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=U1(n))&&(o&&(o+=" "),o+=r);return o},U1=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=U1(t[r]))&&(n&&(n+=" "),n+=e);return n},lD=(t,...e)=>{let n,r,o,l;const a=d=>{const h=e.reduce((p,g)=>g(p),t());return n=rD(h),r=n.cache.get,o=n.cache.set,l=c,c(d)},c=d=>{const h=r(d);if(h)return h;const p=oD(d,n);return o(d,p),p};return l=a,(...d)=>l(sD(...d))},aD=[],Et=t=>{const e=n=>n[t]||aD;return e.isThemeGetter=!0,e},G1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fD=/\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$/,dD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ri=t=>uD.test(t),_e=t=>!!t&&!Number.isNaN(Number(t)),Ti=t=>!!t&&Number.isInteger(Number(t)),ip=t=>t.endsWith("%")&&_e(t.slice(0,-1)),Pr=t=>cD.test(t),K1=()=>!0,mD=t=>fD.test(t)&&!dD.test(t),Fm=()=>!1,gD=t=>hD.test(t),yD=t=>pD.test(t),vD=t=>!he(t)&&!pe(t),bD=t=>qi(t,J1,Fm),he=t=>G1.test(t),Co=t=>qi(t,Q1,mD),Kb=t=>qi(t,TD,_e),SD=t=>qi(t,W1,K1),xD=t=>qi(t,Z1,Fm),Yb=t=>qi(t,Y1,Fm),wD=t=>qi(t,X1,yD),sc=t=>qi(t,ew,gD),pe=t=>q1.test(t),Jl=t=>Fo(t,Q1),CD=t=>Fo(t,Z1),Xb=t=>Fo(t,Y1),MD=t=>Fo(t,J1),ED=t=>Fo(t,X1),lc=t=>Fo(t,ew,!0),RD=t=>Fo(t,W1,!0),qi=(t,e,n)=>{const r=G1.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Fo=(t,e,n=!1)=>{const r=q1.exec(t);return r?r[1]?e(r[1]):n:!1},Y1=t=>t==="position"||t==="percentage",X1=t=>t==="image"||t==="url",J1=t=>t==="length"||t==="size"||t==="bg-size",Q1=t=>t==="length",TD=t=>t==="number",Z1=t=>t==="family-name",W1=t=>t==="number"||t==="weight",ew=t=>t==="shadow",AD=()=>{const t=Et("color"),e=Et("font"),n=Et("text"),r=Et("font-weight"),o=Et("tracking"),l=Et("leading"),a=Et("breakpoint"),c=Et("container"),d=Et("spacing"),h=Et("radius"),p=Et("shadow"),g=Et("inset-shadow"),v=Et("text-shadow"),b=Et("drop-shadow"),S=Et("blur"),x=Et("perspective"),C=Et("aspect"),E=Et("ease"),A=Et("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...D(),pe,he],L=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],I=()=>[pe,he,d],Q=()=>[Ri,"full","auto",...I()],ue=()=>[Ti,"none","subgrid",pe,he],se=()=>["auto",{span:["full",Ti,pe,he]},Ti,pe,he],le=()=>[Ti,"auto",pe,he],xe=()=>["auto","min","max","fr",pe,he],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ve=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...I()],Z=()=>[Ri,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],U=()=>[Ri,"screen","full","dvw","lvw","svw","min","max","fit",...I()],q=()=>[Ri,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],K=()=>[t,pe,he],N=()=>[...D(),Xb,Yb,{position:[pe,he]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",MD,bD,{size:[pe,he]}],ne=()=>[ip,Jl,Co],oe=()=>["","none","full",h,pe,he],fe=()=>["",_e,Jl,Co],me=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[_e,ip,Xb,Yb],it=()=>["","none",S,pe,he],wt=()=>["none",_e,pe,he],Ft=()=>["none",_e,pe,he],Ct=()=>[_e,pe,he],on=()=>[Ri,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pr],breakpoint:[Pr],color:[K1],container:[Pr],"drop-shadow":[Pr],ease:["in","out","in-out"],font:[vD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pr],shadow:[Pr],spacing:["px",_e],text:[Pr],"text-shadow":[Pr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ri,he,pe,C]}],container:["container"],columns:[{columns:[_e,he,pe,c]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:z()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[Ti,"auto",pe,he]}],basis:[{basis:[Ri,"full","auto",c,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Ri,"auto","initial","none",he]}],grow:[{grow:["",_e,pe,he]}],shrink:[{shrink:["",_e,pe,he]}],order:[{order:[Ti,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":xe()}],"auto-rows":[{"auto-rows":xe()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...ve(),"normal"]}],"justify-self":[{"justify-self":["auto",...ve()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...ve(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ve(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ve(),"baseline"]}],"place-self":[{"place-self":["auto",...ve()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[c,"screen",...Z()]}],"min-w":[{"min-w":[c,"screen","none",...Z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Jl,Co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,RD,SD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ip,he]}],"font-family":[{font:[CD,xD,e]}],"font-features":[{"font-features":[he]}],"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:[o,pe,he]}],"line-clamp":[{"line-clamp":[_e,"none",pe,Kb]}],leading:[{leading:[l,...I()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",pe,Co]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[_e,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ti,pe,he],radial:["",pe,he],conic:[Ti,pe,he]},ED,wD]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-bs":[{"border-bs":K()}],"border-color-be":[{"border-be":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,pe,he]}],"outline-w":[{outline:["",_e,Jl,Co]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",p,lc,sc]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",g,lc,sc]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[_e,Co]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",v,lc,sc]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[_e,pe,he]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:it()}],brightness:[{brightness:[_e,pe,he]}],contrast:[{contrast:[_e,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",b,lc,sc]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",_e,pe,he]}],"hue-rotate":[{"hue-rotate":[_e,pe,he]}],invert:[{invert:["",_e,pe,he]}],saturate:[{saturate:[_e,pe,he]}],sepia:[{sepia:["",_e,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":it()}],"backdrop-brightness":[{"backdrop-brightness":[_e,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[_e,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",_e,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[_e,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[_e,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",pe,he]}],ease:[{ease:["linear","initial",E,pe,he]}],delay:[{delay:[_e,pe,he]}],animate:[{animate:["none",A,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,pe,he]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:wt()}],"rotate-x":[{"rotate-x":wt()}],"rotate-y":[{"rotate-y":wt()}],"rotate-z":[{"rotate-z":wt()}],scale:[{scale:Ft()}],"scale-x":[{"scale-x":Ft()}],"scale-y":[{"scale-y":Ft()}],"scale-z":[{"scale-z":Ft()}],"scale-3d":["scale-3d"],skew:[{skew:Ct()}],"skew-x":[{"skew-x":Ct()}],"skew-y":[{"skew-y":Ct()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:on()}],"translate-x":[{"translate-x":on()}],"translate-y":[{"translate-y":on()}],"translate-z":[{"translate-z":on()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"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",pe,he]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",pe,he]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[_e,Jl,Co,Kb]}],stroke:[{stroke:["none",...K()]}],"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"]}},OD=lD(AD);function Ne(...t){return OD(F1(t))}const op={amber:"bg-amber-50/90 text-amber-700 dark:bg-amber-400/10 dark:text-amber-200",blue:"bg-blue-50/90 text-blue-700 dark:bg-blue-400/10 dark:text-blue-200",coral:"bg-rose-50/90 text-rose-700 dark:bg-rose-400/10 dark:text-rose-200",cyan:"bg-cyan-50/90 text-cyan-700 dark:bg-cyan-400/10 dark:text-cyan-200",emerald:"bg-emerald-50/90 text-emerald-700 dark:bg-emerald-400/10 dark:text-emerald-200",fuchsia:"bg-fuchsia-50/90 text-fuchsia-700 dark:bg-fuchsia-400/10 dark:text-fuchsia-200",green:"bg-green-50/90 text-green-700 dark:bg-green-400/10 dark:text-green-200",indigo:"bg-indigo-50/90 text-indigo-700 dark:bg-indigo-400/10 dark:text-indigo-200",lime:"bg-lime-50/90 text-lime-700 dark:bg-lime-400/10 dark:text-lime-200",orange:"bg-orange-50/90 text-orange-700 dark:bg-orange-400/10 dark:text-orange-200",pink:"bg-pink-50/90 text-pink-700 dark:bg-pink-400/10 dark:text-pink-200",purple:"bg-purple-50/90 text-purple-700 dark:bg-purple-400/10 dark:text-purple-200",red:"bg-red-50/90 text-red-700 dark:bg-red-400/10 dark:text-red-200",rose:"bg-rose-50/90 text-rose-700 dark:bg-rose-400/10 dark:text-rose-200",sky:"bg-sky-50/90 text-sky-700 dark:bg-sky-400/10 dark:text-sky-200",stone:"bg-stone-50/95 text-stone-700 dark:bg-white/5 dark:text-stone-100",teal:"bg-teal-50/90 text-teal-700 dark:bg-teal-400/10 dark:text-teal-200",violet:"bg-violet-50/90 text-violet-700 dark:bg-violet-400/10 dark:text-violet-200",yellow:"bg-yellow-50/90 text-yellow-700 dark:bg-yellow-400/10 dark:text-yellow-200",zinc:"bg-zinc-50/95 text-zinc-700 dark:bg-white/5 dark:text-zinc-100"};function _c(t){return t.trim().toUpperCase()}function kD(t){let e=0;for(const n of t)e=e*31+n.charCodeAt(0)>>>0;return e%Mc.length}function ND(t,e){if(!e)return null;const n=_c(t);for(const[r,o]of Object.entries(e))if(o&&_c(r)===n)return o;return null}function DD(t,e,n){const r=_c(t),o=ND(t,n);if(o)return op[o];const l=e?.findIndex(a=>_c(a)===r)??-1;return l>=0?op[Mc[l%Mc.length]]:op[Mc[kD(r)]]}function _D({className:t,colors:e,options:n,value:r}){return R.jsx("span",{className:Ne("inline-flex max-w-full items-center rounded-md px-2 py-1 text-sm leading-none font-medium whitespace-nowrap shadow-[0_1px_2px_rgba(15,23,42,0.04)] dark:shadow-none",DD(r,n,e),t),title:r,children:R.jsx("span",{className:"truncate",children:r})})}function zD(t="left"){switch(t){case"center":return"justify-center text-center";case"right":return"justify-end text-right";default:return"justify-start text-left"}}function jD(t,e){const n=t instanceof Date?t:new Date(t);return Number.isNaN(n.getTime())?String(t):new Intl.DateTimeFormat(void 0,e??{dateStyle:"medium"}).format(n)}function ID(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function Pm(t,e,n){return t==null||t===""?R.jsx("span",{className:"text-muted-foreground",children:"-"}):e==="enum"?R.jsx(_D,{colors:n?.enumColors,options:n?.enumOptions,value:String(t)}):e==="boolean"||typeof t=="boolean"?R.jsx("span",{className:Ne("inline-flex min-w-16 items-center justify-center rounded-full border px-2 py-1 text-[11px] font-medium",t?"border-border bg-accent text-accent-foreground":"border-border bg-muted text-muted-foreground"),children:t?"True":"False"}):e==="number"||typeof t=="number"?ID(Number(t)):e==="date"||t instanceof Date?jD(t,n?.dateFormat):Array.isArray(t)||typeof t=="object"?R.jsx("code",{className:"rounded bg-muted px-1.5 py-1 font-mono text-[11px] text-muted-foreground",children:JSON.stringify(t)}):String(t)}function LD(t,e){const n=Array.from(new Set(e.map(l=>l.trim()).filter(Boolean))).sort((l,a)=>a.length-l.length);if(n.length===0)return[t];const r=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"gi");return t.split(r).map((l,a)=>n.some(d=>l.toLowerCase()===d.toLowerCase())?R.jsx("mark",{className:"rounded-sm bg-primary/20 ring-2 ring-primary/20 dark:bg-primary/50 dark:text-white dark:ring-primary/80",children:l},`${l}-${a}`):R.jsx(M.Fragment,{children:l},`${l}-${a}`))}function BD(t,e,n){const r=LD(t,e);if(M.isValidElement(n)){const o=n;if(typeof o.props.children=="string")return M.cloneElement(o,void 0,r)}return R.jsx("span",{className:"whitespace-pre-wrap",children:r})}function Jb({checked:t,indeterminate:e,onCheckedChange:n,ariaLabel:r}){const o=M.useRef(null);return M.useEffect(()=>{o.current&&(o.current.indeterminate=!!e&&!t)},[t,e]),R.jsxs("label",{className:"inline-flex cursor-pointer items-center justify-center",children:[R.jsx("input",{ref:o,"aria-label":r,checked:t,className:"peer sr-only",onChange:l=>n(l.target.checked),type:"checkbox"}),R.jsxs("span",{className:Ne("flex size-5 items-center justify-center rounded-[6px] border border-border bg-background text-primary-foreground shadow-xs transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring/50",(t||e)&&"border-primary bg-primary"),children:[e&&!t?R.jsx(gk,{className:"size-3.5"}):null,t?R.jsx(Js,{className:"size-3.5"}):null]})]})}function VD({cell:t,dateFormat:e,highlightTerms:n=[],paddingLeft:r,paddingRight:o}){const l=t.column.columnDef.meta??{},a=t.getValue(),c=em(t.column.columnDef.cell,t.getContext()),d=l.sticky==="left",h=l.kind==="selection",p=l.truncate??!0,v=l.kind==="text"&&l.highlightMatches!==!1&&typeof a=="string"&&n.length>0?BD(a,n,c):c??Pm(a,l.kind,{dateFormat:e,enumColors:l.enumColors,enumOptions:l.enumOptions});return R.jsx("td",{"data-sticky-cell":d?"true":"false",className:Ne("flex shrink-0 border-b border-border px-2 py-1.5 align-middle text-sm text-foreground",zD(l.align),d&&"sticky left-0 z-10 border-r border-r-border bg-card",l.cellClassName),style:{paddingLeft:r,paddingRight:o,width:t.column.getSize()},children:R.jsx("div",{className:Ne(h?"flex w-full items-center justify-center":p?"min-w-0 truncate":"w-full min-w-0 break-words whitespace-normal"),children:v})})}const FD={text:Ok,enum:hk,number:lk,boolean:Ib,date:UO,json:$O,selection:Ib};function fa({kind:t,...e}){const n=FD[t];return R.jsx(n,{...e})}function PD(t){return/\d{4}-\d{2}-\d{2}/.test(t)?!Number.isNaN(Date.parse(t)):!1}function $D(t){const e=t.find(n=>n!=null);return e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="number"?"number":typeof e=="string"&&PD(e)?"date":e&&typeof e=="object"?"json":"text"}function HD(t="left"){switch(t){case"center":return"justify-center text-center";case"right":return"justify-end text-right";default:return"justify-start text-left"}}function UD({sorted:t}){return t==="asc"?R.jsx(BO,{className:"size-3.5 text-foreground"}):t==="desc"?R.jsx(IO,{className:"size-3.5 text-foreground"}):null}function GD({header:t,highlightEnabled:e=!1,onToggleHighlight:n,paddingLeft:r,paddingRight:o,scrollContainerRef:l}){const a=t.column.columnDef.meta??{},c=t.column.getIsSorted(),d=t.column.getCanSort(),h=HD(a.align),p=a.sticky==="left";return R.jsxs("th",{className:Ne("relative flex shrink-0 border-b border-gray-300 bg-background py-2 align-middle text-xs font-medium tracking-wide text-muted-foreground uppercase dark:border-border",p&&"sticky left-0 z-20 border-r border-r-border bg-background",a.headerClassName),style:{width:t.getSize()},children:[t.isPlaceholder?null:d?R.jsx("div",{className:"flex w-full min-w-0 items-center gap-2",children:R.jsxs("button",{className:Ne("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1 transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none",h),onClick:t.column.getToggleSortingHandler(),style:{paddingLeft:r,paddingRight:o},type:"button",children:[a.kind&&a.kind!=="selection"?R.jsx(fa,{className:"size-3.5 shrink-0 text-muted-foreground",kind:a.kind}):null,R.jsx("span",{className:"truncate font-medium text-foreground normal-case",children:em(t.column.columnDef.header,t.getContext())}),R.jsx(UD,{sorted:c})]})}):R.jsxs("div",{className:Ne("flex w-full min-w-0 items-center gap-1 px-0.5 py-1",h),style:{paddingLeft:r,paddingRight:o},children:[a.kind&&a.kind!=="selection"?R.jsx(fa,{className:"size-3.5 shrink-0 text-muted-foreground",kind:a.kind}):null,R.jsx("span",{className:"truncate font-medium text-foreground normal-case",children:em(t.column.columnDef.header,t.getContext())}),a.kind==="text"&&n?R.jsx("button",{className:Ne("inline-flex size-5 items-center justify-center rounded-sm border",e?"border-border bg-accent text-accent-foreground":"border-transparent text-muted-foreground"),onClick:n,type:"button",children:R.jsx(zm,{className:"size-3"})}):null]}),t.column.getCanResize()?R.jsx(qD,{header:t,scrollContainerRef:l}):null]})}function qD({header:t,scrollContainerRef:e}){const n=t.column.getIsResizing(),r=M.useRef(null),[o,l]=M.useState(null),a=n?`translateX(${t.getContext().table.getState().columnSizingInfo.deltaOffset??0}px)`:"";return M.useLayoutEffect(()=>{if(!n||!r.current||!e.current){l(null);return}const c=()=>{if(!r.current||!e.current)return;const d=r.current.getBoundingClientRect(),h=e.current.getBoundingClientRect();l({bottom:Math.max(window.innerHeight-h.bottom,0),left:d.left,top:h.top})};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n,e]),R.jsxs(R.Fragment,{children:[n&&o?Ta.createPortal(R.jsx("div",{className:"pointer-events-none fixed z-[100] w-1 animate-in cursor-col-resize bg-border transition-colors duration-75 zoom-in-50",style:{bottom:o.bottom,left:o.left,top:o.top,transform:a}}),document.body):null,R.jsx("div",{ref:r,className:Ne("absolute top-0 right-[-2px] z-[100] h-full w-1 cursor-col-resize touch-none rounded-full bg-border opacity-0 transition-opacity select-none hover:opacity-100",n&&"opacity-100"),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler()})]})}const Qb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Zb=F1,$m=(t,e)=>n=>{var r;if(e?.variants==null)return Zb(t,n?.class,n?.className);const{variants:o,defaultVariants:l}=e,a=Object.keys(o).map(h=>{const p=n?.[h],g=l?.[h];if(p===null)return null;const v=Qb(p)||Qb(g);return o[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),d=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...b}=p;return Object.entries(b).every(S=>{let[x,C]=S;return Array.isArray(C)?C.includes({...l,...c}[x]):{...l,...c}[x]===C})?[...h,g,v]:h},[]);return Zb(t,a,d,n?.class,n?.className)};function Wb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ff(...t){return e=>{let n=!1;const r=t.map(o=>{const l=Wb(o,e);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():Wb(t[o],null)}}}}function pn(...t){return M.useCallback(ff(...t),t)}function da(t){const e=YD(t),n=M.forwardRef((r,o)=>{const{children:l,...a}=r,c=M.Children.toArray(l),d=c.find(JD);if(d){const h=d.props.children,p=c.map(g=>g===d?M.Children.count(h)>1?M.Children.only(null):M.isValidElement(h)?h.props.children:null:g);return R.jsx(e,{...a,ref:o,children:M.isValidElement(h)?M.cloneElement(h,void 0,p):null})}return R.jsx(e,{...a,ref:o,children:l})});return n.displayName=`${t}.Slot`,n}var KD=da("Slot");function YD(t){const e=M.forwardRef((n,r)=>{const{children:o,...l}=n;if(M.isValidElement(o)){const a=ZD(o),c=QD(l,o.props);return o.type!==M.Fragment&&(c.ref=r?ff(r,a):a),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var XD=Symbol("radix.slottable");function JD(t){return M.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===XD}function QD(t,e){const n={...e};for(const r in e){const o=t[r],l=e[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...c)=>{const d=l(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...t,...n}}function ZD(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var WD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qt=WD.reduce((t,e)=>{const n=da(`Primitive.${e}`),r=M.forwardRef((o,l)=>{const{asChild:a,...c}=o,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(d,{...c,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function tw(t,e){t&&Ta.flushSync(()=>t.dispatchEvent(e))}function Qs(t,e=[]){let n=[];function r(l,a){const c=M.createContext(a),d=n.length;n=[...n,a];const h=g=>{const{scope:v,children:b,...S}=g,x=v?.[t]?.[d]||c,C=M.useMemo(()=>S,Object.values(S));return R.jsx(x.Provider,{value:C,children:b})};h.displayName=l+"Provider";function p(g,v){const b=v?.[t]?.[d]||c,S=M.useContext(b);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[h,p]}const o=()=>{const l=n.map(a=>M.createContext(a));return function(c){const d=c?.[t]||l;return M.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return o.scopeName=t,[r,e_(o,...e)]}function e_(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const a=r.reduce((c,{useScope:d,scopeName:h})=>{const g=d(l)[`__scope${h}`];return{...c,...g}},{});return M.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function nw(t){const e=t+"CollectionProvider",[n,r]=Qs(e),[o,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:C,children:E}=x,A=tn.useRef(null),O=tn.useRef(new Map).current;return R.jsx(o,{scope:C,itemMap:O,collectionRef:A,children:E})};a.displayName=e;const c=t+"CollectionSlot",d=da(c),h=tn.forwardRef((x,C)=>{const{scope:E,children:A}=x,O=l(c,E),D=pn(C,O.collectionRef);return R.jsx(d,{ref:D,children:A})});h.displayName=c;const p=t+"CollectionItemSlot",g="data-radix-collection-item",v=da(p),b=tn.forwardRef((x,C)=>{const{scope:E,children:A,...O}=x,D=tn.useRef(null),z=pn(C,D),L=l(p,E);return tn.useEffect(()=>(L.itemMap.set(D,{ref:D,...O}),()=>{L.itemMap.delete(D)})),R.jsx(v,{[g]:"",ref:z,children:A})});b.displayName=p;function S(x){const C=l(t+"CollectionConsumer",x);return tn.useCallback(()=>{const A=C.collectionRef.current;if(!A)return[];const O=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((L,_)=>O.indexOf(L.ref.current)-O.indexOf(_.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:h,ItemSlot:b},S,r]}function je(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}var $i=globalThis?.document?M.useLayoutEffect:()=>{},t_=v1[" useInsertionEffect ".trim().toString()]||$i;function df({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,l,a]=n_({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:o;{const p=M.useRef(t!==void 0);M.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const h=M.useCallback(p=>{if(c){const g=r_(p)?p(t):p;g!==t&&a.current?.(g)}else l(p)},[c,t,l,a]);return[d,h]}function n_({defaultProp:t,onChange:e}){const[n,r]=M.useState(t),o=M.useRef(n),l=M.useRef(e);return t_(()=>{l.current=e},[e]),M.useEffect(()=>{o.current!==n&&(l.current?.(n),o.current=n)},[n,o]),[n,r,l]}function r_(t){return typeof t=="function"}function i_(t,e){return M.useReducer((n,r)=>e[n][r]??n,t)}var Aa=t=>{const{present:e,children:n}=t,r=o_(e),o=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),l=pn(r.ref,s_(o));return typeof n=="function"||r.isPresent?M.cloneElement(o,{ref:l}):null};Aa.displayName="Presence";function o_(t){const[e,n]=M.useState(),r=M.useRef(null),o=M.useRef(t),l=M.useRef("none"),a=t?"mounted":"unmounted",[c,d]=i_(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const h=ac(r.current);l.current=c==="mounted"?h:"none"},[c]),$i(()=>{const h=r.current,p=o.current;if(p!==t){const v=l.current,b=ac(h);t?d("MOUNT"):b==="none"||h?.display==="none"?d("UNMOUNT"):d(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),$i(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=b=>{const x=ac(r.current).includes(CSS.escape(b.animationName));if(b.target===e&&x&&(d("ANIMATION_END"),!o.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},v=b=>{b.target===e&&(l.current=ac(r.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:M.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function ac(t){return t?.animationName||"none"}function s_(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var l_=v1[" useId ".trim().toString()]||(()=>{}),a_=0;function ha(t){const[e,n]=M.useState(l_());return $i(()=>{n(r=>r??String(a_++))},[t]),t||(e?`radix-${e}`:"")}var u_=M.createContext(void 0);function rw(t){const e=M.useContext(u_);return t||e||"ltr"}function er(t){const e=M.useRef(t);return M.useEffect(()=>{e.current=t}),M.useMemo(()=>(...n)=>e.current?.(...n),[])}function c_(t,e=globalThis?.document){const n=er(t);M.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var f_="DismissableLayer",nm="dismissableLayer.update",d_="dismissableLayer.pointerDownOutside",h_="dismissableLayer.focusOutside",eS,iw=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ow=M.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:a,onDismiss:c,...d}=t,h=M.useContext(iw),[p,g]=M.useState(null),v=p?.ownerDocument??globalThis?.document,[,b]=M.useState({}),S=pn(e,_=>g(_)),x=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=x.indexOf(C),A=p?x.indexOf(p):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,D=A>=E,z=g_(_=>{const I=_.target,Q=[...h.branches].some(ue=>ue.contains(I));!D||Q||(o?.(_),a?.(_),_.defaultPrevented||c?.())},v),L=y_(_=>{const I=_.target;[...h.branches].some(ue=>ue.contains(I))||(l?.(_),a?.(_),_.defaultPrevented||c?.())},v);return c_(_=>{A===h.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},v),M.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(eS=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),tS(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=eS)}},[p,v,n,h]),M.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),tS())},[p,h]),M.useEffect(()=>{const _=()=>b({});return document.addEventListener(nm,_),()=>document.removeEventListener(nm,_)},[]),R.jsx(qt.div,{...d,ref:S,style:{pointerEvents:O?D?"auto":"none":void 0,...t.style},onFocusCapture:je(t.onFocusCapture,L.onFocusCapture),onBlurCapture:je(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:je(t.onPointerDownCapture,z.onPointerDownCapture)})});ow.displayName=f_;var p_="DismissableLayerBranch",m_=M.forwardRef((t,e)=>{const n=M.useContext(iw),r=M.useRef(null),o=pn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),R.jsx(qt.div,{...t,ref:o})});m_.displayName=p_;function g_(t,e=globalThis?.document){const n=er(t),r=M.useRef(!1),o=M.useRef(()=>{});return M.useEffect(()=>{const l=c=>{if(c.target&&!r.current){let d=function(){sw(d_,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=d,e.addEventListener("click",o.current,{once:!0})):d()}else e.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",l),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function y_(t,e=globalThis?.document){const n=er(t),r=M.useRef(!1);return M.useEffect(()=>{const o=l=>{l.target&&!r.current&&sw(h_,n,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tS(){const t=new CustomEvent(nm);document.dispatchEvent(t)}function sw(t,e,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?tw(o,l):o.dispatchEvent(l)}var sp="focusScope.autoFocusOnMount",lp="focusScope.autoFocusOnUnmount",nS={bubbles:!1,cancelable:!0},v_="FocusScope",lw=M.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...a}=t,[c,d]=M.useState(null),h=er(o),p=er(l),g=M.useRef(null),v=pn(e,x=>d(x)),b=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let x=function(O){if(b.paused||!c)return;const D=O.target;c.contains(D)?g.current=D:Ai(g.current,{select:!0})},C=function(O){if(b.paused||!c)return;const D=O.relatedTarget;D!==null&&(c.contains(D)||Ai(g.current,{select:!0}))},E=function(O){if(document.activeElement===document.body)for(const z of O)z.removedNodes.length>0&&Ai(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const A=new MutationObserver(E);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),A.disconnect()}}},[r,c,b.paused]),M.useEffect(()=>{if(c){iS.add(b);const x=document.activeElement;if(!c.contains(x)){const E=new CustomEvent(sp,nS);c.addEventListener(sp,h),c.dispatchEvent(E),E.defaultPrevented||(b_(M_(aw(c)),{select:!0}),document.activeElement===x&&Ai(c))}return()=>{c.removeEventListener(sp,h),setTimeout(()=>{const E=new CustomEvent(lp,nS);c.addEventListener(lp,p),c.dispatchEvent(E),E.defaultPrevented||Ai(x??document.body,{select:!0}),c.removeEventListener(lp,p),iS.remove(b)},0)}}},[c,h,p,b]);const S=M.useCallback(x=>{if(!n&&!r||b.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(C&&E){const A=x.currentTarget,[O,D]=S_(A);O&&D?!x.shiftKey&&E===D?(x.preventDefault(),n&&Ai(O,{select:!0})):x.shiftKey&&E===O&&(x.preventDefault(),n&&Ai(D,{select:!0})):E===A&&x.preventDefault()}},[n,r,b.paused]);return R.jsx(qt.div,{tabIndex:-1,...a,ref:v,onKeyDown:S})});lw.displayName=v_;function b_(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ai(r,{select:e}),document.activeElement!==n)return}function S_(t){const e=aw(t),n=rS(e,t),r=rS(e.reverse(),t);return[n,r]}function aw(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function rS(t,e){for(const n of t)if(!x_(n,{upTo:e}))return n}function x_(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function w_(t){return t instanceof HTMLInputElement&&"select"in t}function Ai(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&w_(t)&&e&&t.select()}}var iS=C_();function C_(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=oS(t,e),t.unshift(e)},remove(e){t=oS(t,e),t[0]?.resume()}}}function oS(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function M_(t){return t.filter(e=>e.tagName!=="A")}var E_="Portal",uw=M.forwardRef((t,e)=>{const{container:n,...r}=t,[o,l]=M.useState(!1);$i(()=>l(!0),[]);const a=n||o&&globalThis?.document?.body;return a?L1.createPortal(R.jsx(qt.div,{...r,ref:e}),a):null});uw.displayName=E_;var ap=0;function R_(){M.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sS()),document.body.insertAdjacentElement("beforeend",t[1]??sS()),ap++,()=>{ap===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ap--}},[])}function sS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var fr=function(){return fr=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},fr.apply(this,arguments)};function cw(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function T_(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,l;r<o;r++)(l||!(r in e))&&(l||(l=Array.prototype.slice.call(e,0,r)),l[r]=e[r]);return t.concat(l||Array.prototype.slice.call(e))}var Ec="right-scroll-bar-position",Rc="width-before-scroll-bar",A_="with-scroll-bars-hidden",O_="--removed-body-scroll-bar-size";function up(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function k_(t,e){var n=M.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var N_=typeof window<"u"?M.useLayoutEffect:M.useEffect,lS=new WeakMap;function D_(t,e){var n=k_(null,function(r){return t.forEach(function(o){return up(o,r)})});return N_(function(){var r=lS.get(n);if(r){var o=new Set(r),l=new Set(t),a=n.current;o.forEach(function(c){l.has(c)||up(c,null)}),l.forEach(function(c){o.has(c)||up(c,a)})}lS.set(n,t)},[t]),n}function __(t){return t}function z_(t,e){e===void 0&&(e=__);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(l){var a=e(l,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var d=function(){var p=a;a=[],p.forEach(l)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(p){a.push(p),h()},filter:function(p){return a=a.filter(p),n}}}};return o}function j_(t){t===void 0&&(t={});var e=z_(null);return e.options=fr({async:!0,ssr:!1},t),e}var fw=function(t){var e=t.sideCar,n=cw(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return M.createElement(r,fr({},n))};fw.isSideCarExport=!0;function I_(t,e){return t.useMedium(e),fw}var dw=j_(),cp=function(){},hf=M.forwardRef(function(t,e){var n=M.useRef(null),r=M.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),o=r[0],l=r[1],a=t.forwardProps,c=t.children,d=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,v=t.sideCar,b=t.noRelative,S=t.noIsolation,x=t.inert,C=t.allowPinchZoom,E=t.as,A=E===void 0?"div":E,O=t.gapMode,D=cw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=v,L=D_([n,e]),_=fr(fr({},D),o);return M.createElement(M.Fragment,null,p&&M.createElement(z,{sideCar:dw,removeScrollBar:h,shards:g,noRelative:b,noIsolation:S,inert:x,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:O}),a?M.cloneElement(M.Children.only(c),fr(fr({},_),{ref:L})):M.createElement(A,fr({},_,{className:d,ref:L}),c))});hf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hf.classNames={fullWidth:Rc,zeroRight:Ec};var L_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=L_();return e&&t.setAttribute("nonce",e),t}function V_(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function F_(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var P_=function(){var t=0,e=null;return{add:function(n){t==0&&(e=B_())&&(V_(e,n),F_(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},$_=function(){var t=P_();return function(e,n){M.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},hw=function(){var t=$_(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},H_={left:0,top:0,right:0,gap:0},fp=function(t){return parseInt(t||"",10)||0},U_=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[fp(n),fp(r),fp(o)]},G_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return H_;var e=U_(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},q_=hw(),Vs="data-scroll-locked",K_=function(t,e,n,r){var o=t.left,l=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
16
|
+
.`.concat(A_,` {
|
|
17
|
+
overflow: hidden `).concat(r,`;
|
|
18
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
19
|
+
}
|
|
20
|
+
body[`).concat(Vs,`] {
|
|
21
|
+
overflow: hidden `).concat(r,`;
|
|
22
|
+
overscroll-behavior: contain;
|
|
23
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
24
|
+
padding-left: `.concat(o,`px;
|
|
25
|
+
padding-top: `).concat(l,`px;
|
|
26
|
+
padding-right: `).concat(a,`px;
|
|
27
|
+
margin-left:0;
|
|
28
|
+
margin-top:0;
|
|
29
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
30
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(Ec,` {
|
|
34
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(Rc,` {
|
|
38
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(Ec," .").concat(Ec,` {
|
|
42
|
+
right: 0 `).concat(r,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.`).concat(Rc," .").concat(Rc,` {
|
|
46
|
+
margin-right: 0 `).concat(r,`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
body[`).concat(Vs,`] {
|
|
50
|
+
`).concat(O_,": ").concat(c,`px;
|
|
51
|
+
}
|
|
52
|
+
`)},aS=function(){var t=parseInt(document.body.getAttribute(Vs)||"0",10);return isFinite(t)?t:0},Y_=function(){M.useEffect(function(){return document.body.setAttribute(Vs,(aS()+1).toString()),function(){var t=aS()-1;t<=0?document.body.removeAttribute(Vs):document.body.setAttribute(Vs,t.toString())}},[])},X_=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;Y_();var l=M.useMemo(function(){return G_(o)},[o]);return M.createElement(q_,{styles:K_(l,!e,o,n?"":"!important")})},rm=!1;if(typeof window<"u")try{var uc=Object.defineProperty({},"passive",{get:function(){return rm=!0,!0}});window.addEventListener("test",uc,uc),window.removeEventListener("test",uc,uc)}catch{rm=!1}var As=rm?{passive:!1}:!1,J_=function(t){return t.tagName==="TEXTAREA"},pw=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!J_(t)&&n[e]==="visible")},Q_=function(t){return pw(t,"overflowY")},Z_=function(t){return pw(t,"overflowX")},uS=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mw(t,r);if(o){var l=gw(t,r),a=l[1],c=l[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},W_=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},e2=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},mw=function(t,e){return t==="v"?Q_(e):Z_(e)},gw=function(t,e){return t==="v"?W_(e):e2(e)},t2=function(t,e){return t==="h"&&e==="rtl"?-1:1},n2=function(t,e,n,r,o){var l=t2(t,window.getComputedStyle(e).direction),a=l*r,c=n.target,d=e.contains(c),h=!1,p=a>0,g=0,v=0;do{if(!c)break;var b=gw(t,c),S=b[0],x=b[1],C=b[2],E=x-C-l*S;(S||E)&&mw(t,c)&&(g+=E,v+=S);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},cc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},cS=function(t){return[t.deltaX,t.deltaY]},fS=function(t){return t&&"current"in t?t.current:t},r2=function(t,e){return t[0]===e[0]&&t[1]===e[1]},i2=function(t){return`
|
|
53
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
54
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
55
|
+
`)},o2=0,Os=[];function s2(t){var e=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),o=M.useState(o2++)[0],l=M.useState(hw)[0],a=M.useRef(t);M.useEffect(function(){a.current=t},[t]),M.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var x=T_([t.lockRef.current],(t.shards||[]).map(fS),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=M.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var E=cc(x),A=n.current,O="deltaX"in x?x.deltaX:A[0]-E[0],D="deltaY"in x?x.deltaY:A[1]-E[1],z,L=x.target,_=Math.abs(O)>Math.abs(D)?"h":"v";if("touches"in x&&_==="h"&&L.type==="range")return!1;var I=window.getSelection(),Q=I&&I.anchorNode,ue=Q?Q===L||Q.contains(L):!1;if(ue)return!1;var se=uS(_,L);if(!se)return!0;if(se?z=_:(z=_==="v"?"h":"v",se=uS(_,L)),!se)return!1;if(!r.current&&"changedTouches"in x&&(O||D)&&(r.current=z),!z)return!0;var le=r.current||z;return n2(le,C,x,le==="h"?O:D)},[]),d=M.useCallback(function(x){var C=x;if(!(!Os.length||Os[Os.length-1]!==l)){var E="deltaY"in C?cS(C):cc(C),A=e.current.filter(function(z){return z.name===C.type&&(z.target===C.target||C.target===z.shadowParent)&&r2(z.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var O=(a.current.shards||[]).map(fS).filter(Boolean).filter(function(z){return z.contains(C.target)}),D=O.length>0?c(C,O[0]):!a.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),h=M.useCallback(function(x,C,E,A){var O={name:x,delta:C,target:E,should:A,shadowParent:l2(E)};e.current.push(O),setTimeout(function(){e.current=e.current.filter(function(D){return D!==O})},1)},[]),p=M.useCallback(function(x){n.current=cc(x),r.current=void 0},[]),g=M.useCallback(function(x){h(x.type,cS(x),x.target,c(x,t.lockRef.current))},[]),v=M.useCallback(function(x){h(x.type,cc(x),x.target,c(x,t.lockRef.current))},[]);M.useEffect(function(){return Os.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",d,As),document.addEventListener("touchmove",d,As),document.addEventListener("touchstart",p,As),function(){Os=Os.filter(function(x){return x!==l}),document.removeEventListener("wheel",d,As),document.removeEventListener("touchmove",d,As),document.removeEventListener("touchstart",p,As)}},[]);var b=t.removeScrollBar,S=t.inert;return M.createElement(M.Fragment,null,S?M.createElement(l,{styles:i2(o)}):null,b?M.createElement(X_,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function l2(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const a2=I_(dw,s2);var yw=M.forwardRef(function(t,e){return M.createElement(hf,fr({},t,{ref:e,sideCar:a2}))});yw.classNames=hf.classNames;var u2=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ks=new WeakMap,fc=new WeakMap,dc={},dp=0,vw=function(t){return t&&(t.host||vw(t.parentNode))},c2=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=vw(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},f2=function(t,e,n,r){var o=c2(e,Array.isArray(t)?t:[t]);dc[n]||(dc[n]=new WeakMap);var l=dc[n],a=[],c=new Set,d=new Set(o),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};o.forEach(h);var p=function(g){!g||d.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))p(v);else try{var b=v.getAttribute(r),S=b!==null&&b!=="false",x=(ks.get(v)||0)+1,C=(l.get(v)||0)+1;ks.set(v,x),l.set(v,C),a.push(v),x===1&&S&&fc.set(v,!0),C===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return p(e),c.clear(),dp++,function(){a.forEach(function(g){var v=ks.get(g)-1,b=l.get(g)-1;ks.set(g,v),l.set(g,b),v||(fc.has(g)||g.removeAttribute(r),fc.delete(g)),b||g.removeAttribute(n)}),dp--,dp||(ks=new WeakMap,ks=new WeakMap,fc=new WeakMap,dc={})}},d2=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=u2(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),f2(r,o,n,"aria-hidden")):function(){return null}},hp={exports:{}},pp={};var dS;function h2(){if(dS)return pp;dS=1;var t=Ra();function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,a=t.useDebugValue;function c(g,v){var b=v(),S=r({inst:{value:b,getSnapshot:v}}),x=S[0].inst,C=S[1];return l(function(){x.value=b,x.getSnapshot=v,d(x)&&C({inst:x})},[g,b,v]),o(function(){return d(x)&&C({inst:x}),g(function(){d(x)&&C({inst:x})})},[g]),a(b),b}function d(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!n(g,b)}catch{return!0}}function h(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return pp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,pp}var hS;function bw(){return hS||(hS=1,hp.exports=h2()),hp.exports}var Sw=bw();function p2(t){const[e,n]=M.useState(void 0);return $i(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let a,c;if("borderBoxSize"in l){const d=l.borderBoxSize,h=Array.isArray(d)?d[0]:d;a=h.inlineSize,c=h.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const m2=["top","right","bottom","left"],Hi=Math.min,En=Math.max,zc=Math.round,hc=Math.floor,hr=t=>({x:t,y:t}),g2={left:"right",right:"left",bottom:"top",top:"bottom"};function im(t,e,n){return En(t,Hi(e,n))}function Yr(t,e){return typeof t=="function"?t(e):t}function Xr(t){return t.split("-")[0]}function Zs(t){return t.split("-")[1]}function Hm(t){return t==="x"?"y":"x"}function Um(t){return t==="y"?"height":"width"}function dr(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Gm(t){return Hm(dr(t))}function y2(t,e,n){n===void 0&&(n=!1);const r=Zs(t),o=Gm(t),l=Um(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(a=jc(a)),[a,jc(a)]}function v2(t){const e=jc(t);return[om(t),e,om(e)]}function om(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const pS=["left","right"],mS=["right","left"],b2=["top","bottom"],S2=["bottom","top"];function x2(t,e,n){switch(t){case"top":case"bottom":return n?e?mS:pS:e?pS:mS;case"left":case"right":return e?b2:S2;default:return[]}}function w2(t,e,n,r){const o=Zs(t);let l=x2(Xr(t),n==="start",r);return o&&(l=l.map(a=>a+"-"+o),e&&(l=l.concat(l.map(om)))),l}function jc(t){const e=Xr(t);return g2[e]+t.slice(e.length)}function C2(t){return{top:0,right:0,bottom:0,left:0,...t}}function xw(t){return typeof t!="number"?C2(t):{top:t,right:t,bottom:t,left:t}}function Ic(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function gS(t,e,n){let{reference:r,floating:o}=t;const l=dr(e),a=Gm(e),c=Um(a),d=Xr(e),h=l==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,v=r[c]/2-o[c]/2;let b;switch(d){case"top":b={x:p,y:r.y-o.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Zs(e)){case"start":b[a]-=v*(n&&h?-1:1);break;case"end":b[a]+=v*(n&&h?-1:1);break}return b}async function M2(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:l,rects:a,elements:c,strategy:d}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=Yr(e,t),S=xw(b),C=c[v?g==="floating"?"reference":"floating":g],E=Ic(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(c.floating)),boundary:h,rootBoundary:p,strategy:d})),A=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c.floating)),D=await(l.isElement==null?void 0:l.isElement(O))?await(l.getScale==null?void 0:l.getScale(O))||{x:1,y:1}:{x:1,y:1},z=Ic(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:O,strategy:d}):A);return{top:(E.top-z.top+S.top)/D.y,bottom:(z.bottom-E.bottom+S.bottom)/D.y,left:(E.left-z.left+S.left)/D.x,right:(z.right-E.right+S.right)/D.x}}const E2=50,R2=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:M2},d=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=gS(h,r,d),v=r,b=0;const S={};for(let x=0;x<l.length;x++){const C=l[x];if(!C)continue;const{name:E,fn:A}=C,{x:O,y:D,data:z,reset:L}=await A({x:p,y:g,initialPlacement:r,placement:v,strategy:o,middlewareData:S,rects:h,platform:c,elements:{reference:t,floating:e}});p=O??p,g=D??g,S[E]={...S[E],...z},L&&b<E2&&(b++,typeof L=="object"&&(L.placement&&(v=L.placement),L.rects&&(h=L.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):L.rects),{x:p,y:g}=gS(h,v,d)),x=-1)}return{x:p,y:g,placement:v,strategy:o,middlewareData:S}},T2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:l,platform:a,elements:c,middlewareData:d}=e,{element:h,padding:p=0}=Yr(t,e)||{};if(h==null)return{};const g=xw(p),v={x:n,y:r},b=Gm(o),S=Um(b),x=await a.getDimensions(h),C=b==="y",E=C?"top":"left",A=C?"bottom":"right",O=C?"clientHeight":"clientWidth",D=l.reference[S]+l.reference[b]-v[b]-l.floating[S],z=v[b]-l.reference[b],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let _=L?L[O]:0;(!_||!await(a.isElement==null?void 0:a.isElement(L)))&&(_=c.floating[O]||l.floating[S]);const I=D/2-z/2,Q=_/2-x[S]/2-1,ue=Hi(g[E],Q),se=Hi(g[A],Q),le=ue,xe=_-x[S]-se,ie=_/2-x[S]/2+I,ve=im(le,ie,xe),V=!d.arrow&&Zs(o)!=null&&ie!==ve&&l.reference[S]/2-(ie<le?ue:se)-x[S]/2<0,Z=V?ie<le?ie-le:ie-xe:0;return{[b]:v[b]+Z,data:{[b]:ve,centerOffset:ie-ve-Z,...V&&{alignmentOffset:Z}},reset:V}}}),A2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:l,rects:a,initialPlacement:c,platform:d,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...C}=Yr(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const E=Xr(o),A=dr(c),O=Xr(c)===c,D=await(d.isRTL==null?void 0:d.isRTL(h.floating)),z=v||(O||!x?[jc(c)]:v2(c)),L=S!=="none";!v&&L&&z.push(...w2(c,x,S,D));const _=[c,...z],I=await d.detectOverflow(e,C),Q=[];let ue=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&Q.push(I[E]),g){const ie=y2(o,a,D);Q.push(I[ie[0]],I[ie[1]])}if(ue=[...ue,{placement:o,overflows:Q}],!Q.every(ie=>ie<=0)){var se,le;const ie=(((se=l.flip)==null?void 0:se.index)||0)+1,ve=_[ie];if(ve&&(!(g==="alignment"?A!==dr(ve):!1)||ue.every(U=>dr(U.placement)===A?U.overflows[0]>0:!0)))return{data:{index:ie,overflows:ue},reset:{placement:ve}};let V=(le=ue.filter(Z=>Z.overflows[0]<=0).sort((Z,U)=>Z.overflows[1]-U.overflows[1])[0])==null?void 0:le.placement;if(!V)switch(b){case"bestFit":{var xe;const Z=(xe=ue.filter(U=>{if(L){const q=dr(U.placement);return q===A||q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,K)=>q+K,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:xe[0];Z&&(V=Z);break}case"initialPlacement":V=c;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function yS(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function vS(t){return m2.some(e=>t[e]>=0)}const O2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...l}=Yr(t,e);switch(o){case"referenceHidden":{const a=await r.detectOverflow(e,{...l,elementContext:"reference"}),c=yS(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:vS(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...l,altBoundary:!0}),c=yS(a,n.floating);return{data:{escapedOffsets:c,escaped:vS(c)}}}default:return{}}}}},ww=new Set(["left","top"]);async function k2(t,e){const{placement:n,platform:r,elements:o}=t,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Xr(n),c=Zs(n),d=dr(n)==="y",h=ww.has(a)?-1:1,p=l&&d?-1:1,g=Yr(e,t);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof S=="number"&&(b=c==="end"?S*-1:S),d?{x:b*p,y:v*h}:{x:v*h,y:b*p}}const N2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:l,placement:a,middlewareData:c}=e,d=await k2(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:l+d.y,data:{...d,placement:a}}}}},D2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:l}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:A,y:O}=E;return{x:A,y:O}}},...h}=Yr(t,e),p={x:n,y:r},g=await l.detectOverflow(e,h),v=dr(Xr(o)),b=Hm(v);let S=p[b],x=p[v];if(a){const E=b==="y"?"top":"left",A=b==="y"?"bottom":"right",O=S+g[E],D=S-g[A];S=im(O,S,D)}if(c){const E=v==="y"?"top":"left",A=v==="y"?"bottom":"right",O=x+g[E],D=x-g[A];x=im(O,x,D)}const C=d.fn({...e,[b]:S,[v]:x});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:a,[v]:c}}}}}},_2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:l,middlewareData:a}=e,{offset:c=0,mainAxis:d=!0,crossAxis:h=!0}=Yr(t,e),p={x:n,y:r},g=dr(o),v=Hm(g);let b=p[v],S=p[g];const x=Yr(c,e),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const O=v==="y"?"height":"width",D=l.reference[v]-l.floating[O]+C.mainAxis,z=l.reference[v]+l.reference[O]-C.mainAxis;b<D?b=D:b>z&&(b=z)}if(h){var E,A;const O=v==="y"?"width":"height",D=ww.has(Xr(o)),z=l.reference[g]-l.floating[O]+(D&&((E=a.offset)==null?void 0:E[g])||0)+(D?0:C.crossAxis),L=l.reference[g]+l.reference[O]+(D?0:((A=a.offset)==null?void 0:A[g])||0)-(D?C.crossAxis:0);S<z?S=z:S>L&&(S=L)}return{[v]:b,[g]:S}}}},z2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:l,platform:a,elements:c}=e,{apply:d=()=>{},...h}=Yr(t,e),p=await a.detectOverflow(e,h),g=Xr(o),v=Zs(o),b=dr(o)==="y",{width:S,height:x}=l.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=g,C=v==="end"?"top":"bottom");const A=x-p.top-p.bottom,O=S-p.left-p.right,D=Hi(x-p[C],A),z=Hi(S-p[E],O),L=!e.middlewareData.shift;let _=D,I=z;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=O),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=A),L&&!v){const ue=En(p.left,0),se=En(p.right,0),le=En(p.top,0),xe=En(p.bottom,0);b?I=S-2*(ue!==0||se!==0?ue+se:En(p.left,p.right)):_=x-2*(le!==0||xe!==0?le+xe:En(p.top,p.bottom))}await d({...e,availableWidth:I,availableHeight:_});const Q=await a.getDimensions(c.floating);return S!==Q.width||x!==Q.height?{reset:{rects:!0}}:{}}}};function pf(){return typeof window<"u"}function Ws(t){return Cw(t)?(t.nodeName||"").toLowerCase():"#document"}function Tn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function gr(t){var e;return(e=(Cw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Cw(t){return pf()?t instanceof Node||t instanceof Tn(t).Node:!1}function tr(t){return pf()?t instanceof Element||t instanceof Tn(t).Element:!1}function Jr(t){return pf()?t instanceof HTMLElement||t instanceof Tn(t).HTMLElement:!1}function bS(t){return!pf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tn(t).ShadowRoot}function Oa(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=nr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function j2(t){return/^(table|td|th)$/.test(Ws(t))}function mf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const I2=/transform|translate|scale|rotate|perspective|filter/,L2=/paint|layout|strict|content/,Mo=t=>!!t&&t!=="none";let mp;function qm(t){const e=tr(t)?nr(t):t;return Mo(e.transform)||Mo(e.translate)||Mo(e.scale)||Mo(e.rotate)||Mo(e.perspective)||!Km()&&(Mo(e.backdropFilter)||Mo(e.filter))||I2.test(e.willChange||"")||L2.test(e.contain||"")}function B2(t){let e=Ui(t);for(;Jr(e)&&!Us(e);){if(qm(e))return e;if(mf(e))return null;e=Ui(e)}return null}function Km(){return mp==null&&(mp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),mp}function Us(t){return/^(html|body|#document)$/.test(Ws(t))}function nr(t){return Tn(t).getComputedStyle(t)}function gf(t){return tr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ui(t){if(Ws(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bS(t)&&t.host||gr(t);return bS(e)?e.host:e}function Mw(t){const e=Ui(t);return Us(e)?t.ownerDocument?t.ownerDocument.body:t.body:Jr(e)&&Oa(e)?e:Mw(e)}function pa(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Mw(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),a=Tn(o);if(l){const c=sm(a);return e.concat(a,a.visualViewport||[],Oa(o)?o:[],c&&n?pa(c):[])}else return e.concat(o,pa(o,[],n))}function sm(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ew(t){const e=nr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Jr(t),l=o?t.offsetWidth:n,a=o?t.offsetHeight:r,c=zc(n)!==l||zc(r)!==a;return c&&(n=l,r=a),{width:n,height:r,$:c}}function Ym(t){return tr(t)?t:t.contextElement}function Fs(t){const e=Ym(t);if(!Jr(e))return hr(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=Ew(e);let a=(l?zc(n.width):n.width)/r,c=(l?zc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const V2=hr(0);function Rw(t){const e=Tn(t);return!Km()||!e.visualViewport?V2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function F2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Tn(t)?!1:e}function jo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=Ym(t);let a=hr(1);e&&(r?tr(r)&&(a=Fs(r)):a=Fs(t));const c=F2(l,n,r)?Rw(l):hr(0);let d=(o.left+c.x)/a.x,h=(o.top+c.y)/a.y,p=o.width/a.x,g=o.height/a.y;if(l){const v=Tn(l),b=r&&tr(r)?Tn(r):r;let S=v,x=sm(S);for(;x&&r&&b!==S;){const C=Fs(x),E=x.getBoundingClientRect(),A=nr(x),O=E.left+(x.clientLeft+parseFloat(A.paddingLeft))*C.x,D=E.top+(x.clientTop+parseFloat(A.paddingTop))*C.y;d*=C.x,h*=C.y,p*=C.x,g*=C.y,d+=O,h+=D,S=Tn(x),x=sm(S)}}return Ic({width:p,height:g,x:d,y:h})}function yf(t,e){const n=gf(t).scrollLeft;return e?e.left+n:jo(gr(t)).left+n}function Tw(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-yf(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function P2(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",a=gr(r),c=e?mf(e.floating):!1;if(r===a||c&&l)return n;let d={scrollLeft:0,scrollTop:0},h=hr(1);const p=hr(0),g=Jr(r);if((g||!g&&!l)&&((Ws(r)!=="body"||Oa(a))&&(d=gf(r)),g)){const b=jo(r);h=Fs(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const v=a&&!g&&!l?Tw(a,d):hr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+v.x,y:n.y*h.y-d.scrollTop*h.y+p.y+v.y}}function $2(t){return Array.from(t.getClientRects())}function H2(t){const e=gr(t),n=gf(t),r=t.ownerDocument.body,o=En(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=En(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+yf(t);const c=-n.scrollTop;return nr(r).direction==="rtl"&&(a+=En(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:a,y:c}}const SS=25;function U2(t,e){const n=Tn(t),r=gr(t),o=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,c=0,d=0;if(o){l=o.width,a=o.height;const p=Km();(!p||p&&e==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const h=yf(r);if(h<=0){const p=r.ownerDocument,g=p.body,v=getComputedStyle(g),b=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-b);S<=SS&&(l-=S)}else h<=SS&&(l+=h);return{width:l,height:a,x:c,y:d}}function G2(t,e){const n=jo(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=Jr(t)?Fs(t):hr(1),a=t.clientWidth*l.x,c=t.clientHeight*l.y,d=o*l.x,h=r*l.y;return{width:a,height:c,x:d,y:h}}function xS(t,e,n){let r;if(e==="viewport")r=U2(t,n);else if(e==="document")r=H2(gr(t));else if(tr(e))r=G2(e,n);else{const o=Rw(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Ic(r)}function Aw(t,e){const n=Ui(t);return n===e||!tr(n)||Us(n)?!1:nr(n).position==="fixed"||Aw(n,e)}function q2(t,e){const n=e.get(t);if(n)return n;let r=pa(t,[],!1).filter(c=>tr(c)&&Ws(c)!=="body"),o=null;const l=nr(t).position==="fixed";let a=l?Ui(t):t;for(;tr(a)&&!Us(a);){const c=nr(a),d=qm(a);!d&&c.position==="fixed"&&(o=null),(l?!d&&!o:!d&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Oa(a)&&!d&&Aw(t,a))?r=r.filter(p=>p!==a):o=c,a=Ui(a)}return e.set(t,r),r}function K2(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const a=[...n==="clippingAncestors"?mf(e)?[]:q2(e,this._c):[].concat(n),r],c=xS(e,a[0],o);let d=c.top,h=c.right,p=c.bottom,g=c.left;for(let v=1;v<a.length;v++){const b=xS(e,a[v],o);d=En(b.top,d),h=Hi(b.right,h),p=Hi(b.bottom,p),g=En(b.left,g)}return{width:h-g,height:p-d,x:g,y:d}}function Y2(t){const{width:e,height:n}=Ew(t);return{width:e,height:n}}function X2(t,e,n){const r=Jr(e),o=gr(e),l=n==="fixed",a=jo(t,!0,l,e);let c={scrollLeft:0,scrollTop:0};const d=hr(0);function h(){d.x=yf(o)}if(r||!r&&!l)if((Ws(e)!=="body"||Oa(o))&&(c=gf(e)),r){const b=jo(e,!0,l,e);d.x=b.x+e.clientLeft,d.y=b.y+e.clientTop}else o&&h();l&&!r&&o&&h();const p=o&&!r&&!l?Tw(o,c):hr(0),g=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:g,y:v,width:a.width,height:a.height}}function gp(t){return nr(t).position==="static"}function wS(t,e){if(!Jr(t)||nr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return gr(t)===n&&(n=n.ownerDocument.body),n}function Ow(t,e){const n=Tn(t);if(mf(t))return n;if(!Jr(t)){let o=Ui(t);for(;o&&!Us(o);){if(tr(o)&&!gp(o))return o;o=Ui(o)}return n}let r=wS(t,e);for(;r&&j2(r)&&gp(r);)r=wS(r,e);return r&&Us(r)&&gp(r)&&!qm(r)?n:r||B2(t)||n}const J2=async function(t){const e=this.getOffsetParent||Ow,n=this.getDimensions,r=await n(t.floating);return{reference:X2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Q2(t){return nr(t).direction==="rtl"}const Z2={convertOffsetParentRelativeRectToViewportRelativeRect:P2,getDocumentElement:gr,getClippingRect:K2,getOffsetParent:Ow,getElementRects:J2,getClientRects:$2,getDimensions:Y2,getScale:Fs,isElement:tr,isRTL:Q2};function kw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function W2(t,e){let n=null,r;const o=gr(t);function l(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),l();const h=t.getBoundingClientRect(),{left:p,top:g,width:v,height:b}=h;if(c||e(),!v||!b)return;const S=hc(g),x=hc(o.clientWidth-(p+v)),C=hc(o.clientHeight-(g+b)),E=hc(p),O={rootMargin:-S+"px "+-x+"px "+-C+"px "+-E+"px",threshold:En(0,Hi(1,d))||1};let D=!0;function z(L){const _=L[0].intersectionRatio;if(_!==d){if(!D)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!kw(h,t.getBoundingClientRect())&&a(),D=!1}try{n=new IntersectionObserver(z,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(z,O)}n.observe(t)}return a(!0),l}function ez(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=Ym(t),p=o||l?[...h?pa(h):[],...e?pa(e):[]]:[];p.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),l&&E.addEventListener("resize",n)});const g=h&&c?W2(h,n):null;let v=-1,b=null;a&&(b=new ResizeObserver(E=>{let[A]=E;A&&A.target===h&&b&&e&&(b.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var O;(O=b)==null||O.observe(e)})),n()}),h&&!d&&b.observe(h),e&&b.observe(e));let S,x=d?jo(t):null;d&&C();function C(){const E=jo(t);x&&!kw(x,E)&&n(),x=E,S=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(A=>{o&&A.removeEventListener("scroll",n),l&&A.removeEventListener("resize",n)}),g?.(),(E=b)==null||E.disconnect(),b=null,d&&cancelAnimationFrame(S)}}const tz=N2,nz=D2,rz=A2,iz=z2,oz=O2,CS=T2,sz=_2,lz=(t,e,n)=>{const r=new Map,o={platform:Z2,...n},l={...o.platform,_c:r};return R2(t,e,{...o,platform:l})};var az=typeof document<"u",uz=function(){},Tc=az?M.useLayoutEffect:uz;function Lc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Lc(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&t.$$typeof)&&!Lc(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function Nw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function MS(t,e){const n=Nw(t);return Math.round(e*n)/n}function yp(t){const e=M.useRef(t);return Tc(()=>{e.current=t}),e}function cz(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:d,open:h}=t,[p,g]=M.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,b]=M.useState(r);Lc(v,r)||b(r);const[S,x]=M.useState(null),[C,E]=M.useState(null),A=M.useCallback(U=>{U!==L.current&&(L.current=U,x(U))},[]),O=M.useCallback(U=>{U!==_.current&&(_.current=U,E(U))},[]),D=l||S,z=a||C,L=M.useRef(null),_=M.useRef(null),I=M.useRef(p),Q=d!=null,ue=yp(d),se=yp(o),le=yp(h),xe=M.useCallback(()=>{if(!L.current||!_.current)return;const U={placement:e,strategy:n,middleware:v};se.current&&(U.platform=se.current),lz(L.current,_.current,U).then(q=>{const K={...q,isPositioned:le.current!==!1};ie.current&&!Lc(I.current,K)&&(I.current=K,Ta.flushSync(()=>{g(K)}))})},[v,e,n,se,le]);Tc(()=>{h===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[h]);const ie=M.useRef(!1);Tc(()=>(ie.current=!0,()=>{ie.current=!1}),[]),Tc(()=>{if(D&&(L.current=D),z&&(_.current=z),D&&z){if(ue.current)return ue.current(D,z,xe);xe()}},[D,z,xe,ue,Q]);const ve=M.useMemo(()=>({reference:L,floating:_,setReference:A,setFloating:O}),[A,O]),V=M.useMemo(()=>({reference:D,floating:z}),[D,z]),Z=M.useMemo(()=>{const U={position:n,left:0,top:0};if(!V.floating)return U;const q=MS(V.floating,p.x),K=MS(V.floating,p.y);return c?{...U,transform:"translate("+q+"px, "+K+"px)",...Nw(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:K}},[n,c,V.floating,p.x,p.y]);return M.useMemo(()=>({...p,update:xe,refs:ve,elements:V,floatingStyles:Z}),[p,xe,ve,V,Z])}const fz=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?CS({element:r.current,padding:o}).fn(n):{}:r?CS({element:r,padding:o}).fn(n):{}}}},dz=(t,e)=>{const n=tz(t);return{name:n.name,fn:n.fn,options:[t,e]}},hz=(t,e)=>{const n=nz(t);return{name:n.name,fn:n.fn,options:[t,e]}},pz=(t,e)=>({fn:sz(t).fn,options:[t,e]}),mz=(t,e)=>{const n=rz(t);return{name:n.name,fn:n.fn,options:[t,e]}},gz=(t,e)=>{const n=iz(t);return{name:n.name,fn:n.fn,options:[t,e]}},yz=(t,e)=>{const n=oz(t);return{name:n.name,fn:n.fn,options:[t,e]}},vz=(t,e)=>{const n=fz(t);return{name:n.name,fn:n.fn,options:[t,e]}};var bz="Arrow",Dw=M.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...l}=t;return R.jsx(qt.svg,{...l,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:R.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dw.displayName=bz;var Sz=Dw,Xm="Popper",[_w,zw]=Qs(Xm),[xz,jw]=_w(Xm),Iw=t=>{const{__scopePopper:e,children:n}=t,[r,o]=M.useState(null);return R.jsx(xz,{scope:e,anchor:r,onAnchorChange:o,children:n})};Iw.displayName=Xm;var Lw="PopperAnchor",Bw=M.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,l=jw(Lw,n),a=M.useRef(null),c=pn(e,a),d=M.useRef(null);return M.useEffect(()=>{const h=d.current;d.current=r?.current||a.current,h!==d.current&&l.onAnchorChange(d.current)}),r?null:R.jsx(qt.div,{...o,ref:c})});Bw.displayName=Lw;var Jm="PopperContent",[wz,Cz]=_w(Jm),Vw=M.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:S,...x}=t,C=jw(Jm,n),[E,A]=M.useState(null),O=pn(e,me=>A(me)),[D,z]=M.useState(null),L=p2(D),_=L?.width??0,I=L?.height??0,Q=r+(l!=="center"?"-"+l:""),ue=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},se=Array.isArray(h)?h:[h],le=se.length>0,xe={padding:ue,boundary:se.filter(Ez),altBoundary:le},{refs:ie,floatingStyles:ve,placement:V,isPositioned:Z,middlewareData:U}=cz({strategy:"fixed",placement:Q,whileElementsMounted:(...me)=>ez(...me,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[dz({mainAxis:o+I,alignmentAxis:a}),d&&hz({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?pz():void 0,...xe}),d&&mz({...xe}),gz({...xe,apply:({elements:me,rects:De,availableWidth:ye,availableHeight:it})=>{const{width:wt,height:Ft}=De.reference,Ct=me.floating.style;Ct.setProperty("--radix-popper-available-width",`${ye}px`),Ct.setProperty("--radix-popper-available-height",`${it}px`),Ct.setProperty("--radix-popper-anchor-width",`${wt}px`),Ct.setProperty("--radix-popper-anchor-height",`${Ft}px`)}}),D&&vz({element:D,padding:c}),Rz({arrowWidth:_,arrowHeight:I}),v&&yz({strategy:"referenceHidden",...xe})]}),[q,K]=$w(V),N=er(S);$i(()=>{Z&&N?.()},[Z,N]);const F=U.arrow?.x,X=U.arrow?.y,ne=U.arrow?.centerOffset!==0,[oe,fe]=M.useState();return $i(()=>{E&&fe(window.getComputedStyle(E).zIndex)},[E]),R.jsx("div",{ref:ie.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:Z?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:R.jsx(wz,{scope:n,placedSide:q,onArrowChange:z,arrowX:F,arrowY:X,shouldHideArrow:ne,children:R.jsx(qt.div,{"data-side":q,"data-align":K,...x,ref:O,style:{...x.style,animation:Z?void 0:"none"}})})})});Vw.displayName=Jm;var Fw="PopperArrow",Mz={top:"bottom",right:"left",bottom:"top",left:"right"},Pw=M.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,l=Cz(Fw,r),a=Mz[l.placedSide];return R.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:R.jsx(Sz,{...o,ref:n,style:{...o.style,display:"block"}})})});Pw.displayName=Fw;function Ez(t){return t!==null}var Rz=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:o}=e,a=o.arrow?.centerOffset!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[h,p]=$w(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(o.arrow?.x??0)+c/2,b=(o.arrow?.y??0)+d/2;let S="",x="";return h==="bottom"?(S=a?g:`${v}px`,x=`${-d}px`):h==="top"?(S=a?g:`${v}px`,x=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,x=a?g:`${b}px`):h==="left"&&(S=`${r.floating.width+d}px`,x=a?g:`${b}px`),{data:{x:S,y:x}}}});function $w(t){const[e,n="center"]=t.split("-");return[e,n]}var Hw=Iw,Tz=Bw,Az=Vw,Oz=Pw,vp="rovingFocusGroup.onEntryFocus",kz={bubbles:!1,cancelable:!0},ka="RovingFocusGroup",[lm,Uw,Nz]=nw(ka),[Dz,Gw]=Qs(ka,[Nz]),[_z,zz]=Dz(ka),qw=M.forwardRef((t,e)=>R.jsx(lm.Provider,{scope:t.__scopeRovingFocusGroup,children:R.jsx(lm.Slot,{scope:t.__scopeRovingFocusGroup,children:R.jsx(jz,{...t,ref:e})})}));qw.displayName=ka;var jz=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,v=M.useRef(null),b=pn(e,v),S=rw(l),[x,C]=df({prop:a,defaultProp:c??null,onChange:d,caller:ka}),[E,A]=M.useState(!1),O=er(h),D=Uw(n),z=M.useRef(!1),[L,_]=M.useState(0);return M.useEffect(()=>{const I=v.current;if(I)return I.addEventListener(vp,O),()=>I.removeEventListener(vp,O)},[O]),R.jsx(_z,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:x,onItemFocus:M.useCallback(I=>C(I),[C]),onItemShiftTab:M.useCallback(()=>A(!0),[]),onFocusableItemAdd:M.useCallback(()=>_(I=>I+1),[]),onFocusableItemRemove:M.useCallback(()=>_(I=>I-1),[]),children:R.jsx(qt.div,{tabIndex:E||L===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...t.style},onMouseDown:je(t.onMouseDown,()=>{z.current=!0}),onFocus:je(t.onFocus,I=>{const Q=!z.current;if(I.target===I.currentTarget&&Q&&!E){const ue=new CustomEvent(vp,kz);if(I.currentTarget.dispatchEvent(ue),!ue.defaultPrevented){const se=D().filter(V=>V.focusable),le=se.find(V=>V.active),xe=se.find(V=>V.id===x),ve=[le,xe,...se].filter(Boolean).map(V=>V.ref.current);Xw(ve,p)}}z.current=!1}),onBlur:je(t.onBlur,()=>A(!1))})})}),Kw="RovingFocusGroupItem",Yw=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:a,...c}=t,d=ha(),h=l||d,p=zz(Kw,n),g=p.currentTabStopId===h,v=Uw(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:x}=p;return M.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),R.jsx(lm.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:R.jsx(qt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:je(t.onMouseDown,C=>{r?p.onItemFocus(h):C.preventDefault()}),onFocus:je(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:je(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=Bz(C,p.orientation,p.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let O=v().filter(D=>D.focusable).map(D=>D.ref.current);if(E==="last")O.reverse();else if(E==="prev"||E==="next"){E==="prev"&&O.reverse();const D=O.indexOf(C.currentTarget);O=p.loop?Vz(O,D+1):O.slice(D+1)}setTimeout(()=>Xw(O))}}),children:typeof a=="function"?a({isCurrentTabStop:g,hasTabStop:x!=null}):a})})});Yw.displayName=Kw;var Iz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lz(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Bz(t,e,n){const r=Lz(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Iz[r]}function Xw(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Vz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Fz=qw,Pz=Yw,am=["Enter"," "],$z=["ArrowDown","PageUp","Home"],Jw=["ArrowUp","PageDown","End"],Hz=[...$z,...Jw],Uz={ltr:[...am,"ArrowRight"],rtl:[...am,"ArrowLeft"]},Gz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Na="Menu",[ma,qz,Kz]=nw(Na),[Po,vf]=Qs(Na,[Kz,zw,Gw]),Da=zw(),Qw=Gw(),[Zw,Ki]=Po(Na),[Yz,_a]=Po(Na),Ww=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:l,modal:a=!0}=t,c=Da(e),[d,h]=M.useState(null),p=M.useRef(!1),g=er(l),v=rw(o);return M.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),R.jsx(Hw,{...c,children:R.jsx(Zw,{scope:e,open:n,onOpenChange:g,content:d,onContentChange:h,children:R.jsx(Yz,{scope:e,onClose:M.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:a,children:r})})})};Ww.displayName=Na;var Xz="MenuAnchor",Qm=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Da(n);return R.jsx(Tz,{...o,...r,ref:e})});Qm.displayName=Xz;var Zm="MenuPortal",[Jz,eC]=Po(Zm,{forceMount:void 0}),tC=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,l=Ki(Zm,e);return R.jsx(Jz,{scope:e,forceMount:n,children:R.jsx(Aa,{present:n||l.open,children:R.jsx(uw,{asChild:!0,container:o,children:r})})})};tC.displayName=Zm;var Hn="MenuContent",[Qz,Wm]=Po(Hn),nC=M.forwardRef((t,e)=>{const n=eC(Hn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Ki(Hn,t.__scopeMenu),a=_a(Hn,t.__scopeMenu);return R.jsx(ma.Provider,{scope:t.__scopeMenu,children:R.jsx(Aa,{present:r||l.open,children:R.jsx(ma.Slot,{scope:t.__scopeMenu,children:a.modal?R.jsx(Zz,{...o,ref:e}):R.jsx(Wz,{...o,ref:e})})})})}),Zz=M.forwardRef((t,e)=>{const n=Ki(Hn,t.__scopeMenu),r=M.useRef(null),o=pn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return d2(l)},[]),R.jsx(eg,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Wz=M.forwardRef((t,e)=>{const n=Ki(Hn,t.__scopeMenu);return R.jsx(eg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ej=da("MenuContent.ScrollLock"),eg=M.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:b,disableOutsideScroll:S,...x}=t,C=Ki(Hn,n),E=_a(Hn,n),A=Da(n),O=Qw(n),D=qz(n),[z,L]=M.useState(null),_=M.useRef(null),I=pn(e,_,C.onContentChange),Q=M.useRef(0),ue=M.useRef(""),se=M.useRef(0),le=M.useRef(null),xe=M.useRef("right"),ie=M.useRef(0),ve=S?yw:M.Fragment,V=S?{as:ej,allowPinchZoom:!0}:void 0,Z=q=>{const K=ue.current+q,N=D().filter(me=>!me.disabled),F=document.activeElement,X=N.find(me=>me.ref.current===F)?.textValue,ne=N.map(me=>me.textValue),oe=dj(ne,K,X),fe=N.find(me=>me.textValue===oe)?.ref.current;(function me(De){ue.current=De,window.clearTimeout(Q.current),De!==""&&(Q.current=window.setTimeout(()=>me(""),1e3))})(K),fe&&setTimeout(()=>fe.focus())};M.useEffect(()=>()=>window.clearTimeout(Q.current),[]),R_();const U=M.useCallback(q=>xe.current===le.current?.side&&pj(q,le.current?.area),[]);return R.jsx(Qz,{scope:n,searchRef:ue,onItemEnter:M.useCallback(q=>{U(q)&&q.preventDefault()},[U]),onItemLeave:M.useCallback(q=>{U(q)||(_.current?.focus(),L(null))},[U]),onTriggerLeave:M.useCallback(q=>{U(q)&&q.preventDefault()},[U]),pointerGraceTimerRef:se,onPointerGraceIntentChange:M.useCallback(q=>{le.current=q},[]),children:R.jsx(ve,{...V,children:R.jsx(lw,{asChild:!0,trapped:o,onMountAutoFocus:je(l,q=>{q.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:R.jsx(ow,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:b,children:R.jsx(Fz,{asChild:!0,...O,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:z,onCurrentTabStopIdChange:L,onEntryFocus:je(d,q=>{E.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:R.jsx(Az,{role:"menu","aria-orientation":"vertical","data-state":bC(C.open),"data-radix-menu-content":"",dir:E.dir,...A,...x,ref:I,style:{outline:"none",...x.style},onKeyDown:je(x.onKeyDown,q=>{const N=q.target.closest("[data-radix-menu-content]")===q.currentTarget,F=q.ctrlKey||q.altKey||q.metaKey,X=q.key.length===1;N&&(q.key==="Tab"&&q.preventDefault(),!F&&X&&Z(q.key));const ne=_.current;if(q.target!==ne||!Hz.includes(q.key))return;q.preventDefault();const fe=D().filter(me=>!me.disabled).map(me=>me.ref.current);Jw.includes(q.key)&&fe.reverse(),cj(fe)}),onBlur:je(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(Q.current),ue.current="")}),onPointerMove:je(t.onPointerMove,ga(q=>{const K=q.target,N=ie.current!==q.clientX;if(q.currentTarget.contains(K)&&N){const F=q.clientX>ie.current?"right":"left";xe.current=F,ie.current=q.clientX}}))})})})})})})});nC.displayName=Hn;var tj="MenuGroup",tg=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return R.jsx(qt.div,{role:"group",...r,ref:e})});tg.displayName=tj;var nj="MenuLabel",rC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return R.jsx(qt.div,{...r,ref:e})});rC.displayName=nj;var Bc="MenuItem",ES="menu.itemSelect",bf=M.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,l=M.useRef(null),a=_a(Bc,t.__scopeMenu),c=Wm(Bc,t.__scopeMenu),d=pn(e,l),h=M.useRef(!1),p=()=>{const g=l.current;if(!n&&g){const v=new CustomEvent(ES,{bubbles:!0,cancelable:!0});g.addEventListener(ES,b=>r?.(b),{once:!0}),tw(g,v),v.defaultPrevented?h.current=!1:a.onClose()}};return R.jsx(iC,{...o,ref:d,disabled:n,onClick:je(t.onClick,p),onPointerDown:g=>{t.onPointerDown?.(g),h.current=!0},onPointerUp:je(t.onPointerUp,g=>{h.current||g.currentTarget?.click()}),onKeyDown:je(t.onKeyDown,g=>{const v=c.searchRef.current!=="";n||v&&g.key===" "||am.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});bf.displayName=Bc;var iC=M.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=t,a=Wm(Bc,n),c=Qw(n),d=M.useRef(null),h=pn(e,d),[p,g]=M.useState(!1),[v,b]=M.useState("");return M.useEffect(()=>{const S=d.current;S&&b((S.textContent??"").trim())},[l.children]),R.jsx(ma.ItemSlot,{scope:n,disabled:r,textValue:o??v,children:R.jsx(Pz,{asChild:!0,...c,focusable:!r,children:R.jsx(qt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:je(t.onPointerMove,ga(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(t.onPointerLeave,ga(S=>a.onItemLeave(S))),onFocus:je(t.onFocus,()=>g(!0)),onBlur:je(t.onBlur,()=>g(!1))})})})}),rj="MenuCheckboxItem",oC=M.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return R.jsx(cC,{scope:t.__scopeMenu,checked:n,children:R.jsx(bf,{role:"menuitemcheckbox","aria-checked":Vc(n)?"mixed":n,...o,ref:e,"data-state":ig(n),onSelect:je(o.onSelect,()=>r?.(Vc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});oC.displayName=rj;var sC="MenuRadioGroup",[ij,oj]=Po(sC,{value:void 0,onValueChange:()=>{}}),lC=M.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,l=er(r);return R.jsx(ij,{scope:t.__scopeMenu,value:n,onValueChange:l,children:R.jsx(tg,{...o,ref:e})})});lC.displayName=sC;var aC="MenuRadioItem",uC=M.forwardRef((t,e)=>{const{value:n,...r}=t,o=oj(aC,t.__scopeMenu),l=n===o.value;return R.jsx(cC,{scope:t.__scopeMenu,checked:l,children:R.jsx(bf,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":ig(l),onSelect:je(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});uC.displayName=aC;var ng="MenuItemIndicator",[cC,sj]=Po(ng,{checked:!1}),fC=M.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,l=sj(ng,n);return R.jsx(Aa,{present:r||Vc(l.checked)||l.checked===!0,children:R.jsx(qt.span,{...o,ref:e,"data-state":ig(l.checked)})})});fC.displayName=ng;var lj="MenuSeparator",dC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return R.jsx(qt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});dC.displayName=lj;var aj="MenuArrow",hC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Da(n);return R.jsx(Oz,{...o,...r,ref:e})});hC.displayName=aj;var rg="MenuSub",[uj,pC]=Po(rg),mC=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,l=Ki(rg,e),a=Da(e),[c,d]=M.useState(null),[h,p]=M.useState(null),g=er(o);return M.useEffect(()=>(l.open===!1&&g(!1),()=>g(!1)),[l.open,g]),R.jsx(Hw,{...a,children:R.jsx(Zw,{scope:e,open:r,onOpenChange:g,content:h,onContentChange:p,children:R.jsx(uj,{scope:e,contentId:ha(),triggerId:ha(),trigger:c,onTriggerChange:d,children:n})})})};mC.displayName=rg;var ea="MenuSubTrigger",gC=M.forwardRef((t,e)=>{const n=Ki(ea,t.__scopeMenu),r=_a(ea,t.__scopeMenu),o=pC(ea,t.__scopeMenu),l=Wm(ea,t.__scopeMenu),a=M.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=l,h={__scopeMenu:t.__scopeMenu},p=M.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return M.useEffect(()=>p,[p]),M.useEffect(()=>{const g=c.current;return()=>{window.clearTimeout(g),d(null)}},[c,d]),R.jsx(Qm,{asChild:!0,...h,children:R.jsx(iC,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":bC(n.open),...t,ref:ff(e,o.onTriggerChange),onClick:g=>{t.onClick?.(g),!(t.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(t.onPointerMove,ga(g=>{l.onItemEnter(g),!g.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:je(t.onPointerLeave,ga(g=>{p();const v=n.content?.getBoundingClientRect();if(v){const b=n.content?.dataset.side,S=b==="right",x=S?-5:5,C=v[S?"left":"right"],E=v[S?"right":"left"];l.onPointerGraceIntentChange({area:[{x:g.clientX+x,y:g.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(g),g.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:je(t.onKeyDown,g=>{const v=l.searchRef.current!=="";t.disabled||v&&g.key===" "||Uz[r.dir].includes(g.key)&&(n.onOpenChange(!0),n.content?.focus(),g.preventDefault())})})})});gC.displayName=ea;var yC="MenuSubContent",vC=M.forwardRef((t,e)=>{const n=eC(Hn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Ki(Hn,t.__scopeMenu),a=_a(Hn,t.__scopeMenu),c=pC(yC,t.__scopeMenu),d=M.useRef(null),h=pn(e,d);return R.jsx(ma.Provider,{scope:t.__scopeMenu,children:R.jsx(Aa,{present:r||l.open,children:R.jsx(ma.Slot,{scope:t.__scopeMenu,children:R.jsx(eg,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:je(t.onFocusOutside,p=>{p.target!==c.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:je(t.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:je(t.onKeyDown,p=>{const g=p.currentTarget.contains(p.target),v=Gz[a.dir].includes(p.key);g&&v&&(l.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});vC.displayName=yC;function bC(t){return t?"open":"closed"}function Vc(t){return t==="indeterminate"}function ig(t){return Vc(t)?"indeterminate":t?"checked":"unchecked"}function cj(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function fj(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function dj(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let a=fj(t,Math.max(l,0));o.length===1&&(a=a.filter(h=>h!==n));const d=a.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function hj(t,e){const{x:n,y:r}=t;let o=!1;for(let l=0,a=e.length-1;l<e.length;a=l++){const c=e[l],d=e[a],h=c.x,p=c.y,g=d.x,v=d.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(o=!o)}return o}function pj(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hj(n,e)}function ga(t){return e=>e.pointerType==="mouse"?t(e):void 0}var SC=Ww,xC=Qm,wC=tC,CC=nC,MC=tg,EC=rC,RC=bf,TC=oC,AC=lC,OC=uC,kC=fC,NC=dC,DC=hC,_C=mC,zC=gC,jC=vC,og="ContextMenu",[mj]=Qs(og,[vf]),Kt=vf(),[gj,IC]=mj(og),LC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:l=!0}=t,[a,c]=M.useState(!1),d=Kt(e),h=er(r),p=M.useCallback(g=>{c(g),h(g)},[h]);return R.jsx(gj,{scope:e,open:a,onOpenChange:p,modal:l,children:R.jsx(SC,{...d,dir:o,open:a,onOpenChange:p,modal:l,children:n})})};LC.displayName=og;var BC="ContextMenuTrigger",VC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,l=IC(BC,n),a=Kt(n),c=M.useRef({x:0,y:0}),d=M.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),h=M.useRef(0),p=M.useCallback(()=>window.clearTimeout(h.current),[]),g=v=>{c.current={x:v.clientX,y:v.clientY},l.onOpenChange(!0)};return M.useEffect(()=>p,[p]),M.useEffect(()=>{r&&p()},[r,p]),R.jsxs(R.Fragment,{children:[R.jsx(xC,{...a,virtualRef:d}),R.jsx(qt.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:je(t.onContextMenu,v=>{p(),g(v),v.preventDefault()}),onPointerDown:r?t.onPointerDown:je(t.onPointerDown,pc(v=>{p(),h.current=window.setTimeout(()=>g(v),700)})),onPointerMove:r?t.onPointerMove:je(t.onPointerMove,pc(p)),onPointerCancel:r?t.onPointerCancel:je(t.onPointerCancel,pc(p)),onPointerUp:r?t.onPointerUp:je(t.onPointerUp,pc(p))})]})});VC.displayName=BC;var yj="ContextMenuPortal",FC=t=>{const{__scopeContextMenu:e,...n}=t,r=Kt(e);return R.jsx(wC,{...r,...n})};FC.displayName=yj;var PC="ContextMenuContent",$C=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=IC(PC,n),l=Kt(n),a=M.useRef(!1);return R.jsx(CC,{...l,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$C.displayName=PC;var vj="ContextMenuGroup",bj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(MC,{...o,...r,ref:e})});bj.displayName=vj;var Sj="ContextMenuLabel",HC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(EC,{...o,...r,ref:e})});HC.displayName=Sj;var xj="ContextMenuItem",UC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(RC,{...o,...r,ref:e})});UC.displayName=xj;var wj="ContextMenuCheckboxItem",Cj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(TC,{...o,...r,ref:e})});Cj.displayName=wj;var Mj="ContextMenuRadioGroup",Ej=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(AC,{...o,...r,ref:e})});Ej.displayName=Mj;var Rj="ContextMenuRadioItem",Tj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(OC,{...o,...r,ref:e})});Tj.displayName=Rj;var Aj="ContextMenuItemIndicator",Oj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(kC,{...o,...r,ref:e})});Oj.displayName=Aj;var kj="ContextMenuSeparator",GC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(NC,{...o,...r,ref:e})});GC.displayName=kj;var Nj="ContextMenuArrow",Dj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(DC,{...o,...r,ref:e})});Dj.displayName=Nj;var qC="ContextMenuSub",KC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:l}=t,a=Kt(e),[c,d]=df({prop:o,defaultProp:l??!1,onChange:r,caller:qC});return R.jsx(_C,{...a,open:c,onOpenChange:d,children:n})};KC.displayName=qC;var _j="ContextMenuSubTrigger",YC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(zC,{...o,...r,ref:e})});YC.displayName=_j;var zj="ContextMenuSubContent",XC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return R.jsx(jC,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});XC.displayName=zj;function pc(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var jj=LC,Ij=VC,Lj=FC,Bj=$C,Vj=HC,Fj=UC,Pj=GC,$j=KC,Hj=YC,Uj=XC,Sf="DropdownMenu",[Gj]=Qs(Sf,[vf]),Yt=vf(),[qj,JC]=Gj(Sf),QC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:a,modal:c=!0}=t,d=Yt(e),h=M.useRef(null),[p,g]=df({prop:o,defaultProp:l??!1,onChange:a,caller:Sf});return R.jsx(qj,{scope:e,triggerId:ha(),triggerRef:h,contentId:ha(),open:p,onOpenChange:g,onOpenToggle:M.useCallback(()=>g(v=>!v),[g]),modal:c,children:R.jsx(SC,{...d,open:p,onOpenChange:g,dir:r,modal:c,children:n})})};QC.displayName=Sf;var ZC="DropdownMenuTrigger",WC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,l=JC(ZC,n),a=Yt(n);return R.jsx(xC,{asChild:!0,...a,children:R.jsx(qt.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:ff(e,l.triggerRef),onPointerDown:je(t.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(l.onOpenToggle(),l.open||c.preventDefault())}),onKeyDown:je(t.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&l.onOpenToggle(),c.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});WC.displayName=ZC;var Kj="DropdownMenuPortal",eM=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Yt(e);return R.jsx(wC,{...r,...n})};eM.displayName=Kj;var tM="DropdownMenuContent",nM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=JC(tM,n),l=Yt(n),a=M.useRef(!1);return R.jsx(CC,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:e,onCloseAutoFocus:je(t.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:je(t.onInteractOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,p=d.button===2||h;(!o.modal||p)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nM.displayName=tM;var Yj="DropdownMenuGroup",Xj=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(MC,{...o,...r,ref:e})});Xj.displayName=Yj;var Jj="DropdownMenuLabel",rM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(EC,{...o,...r,ref:e})});rM.displayName=Jj;var Qj="DropdownMenuItem",iM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(RC,{...o,...r,ref:e})});iM.displayName=Qj;var Zj="DropdownMenuCheckboxItem",oM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(TC,{...o,...r,ref:e})});oM.displayName=Zj;var Wj="DropdownMenuRadioGroup",sM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(AC,{...o,...r,ref:e})});sM.displayName=Wj;var e3="DropdownMenuRadioItem",lM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(OC,{...o,...r,ref:e})});lM.displayName=e3;var t3="DropdownMenuItemIndicator",aM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(kC,{...o,...r,ref:e})});aM.displayName=t3;var n3="DropdownMenuSeparator",uM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(NC,{...o,...r,ref:e})});uM.displayName=n3;var r3="DropdownMenuArrow",i3=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(DC,{...o,...r,ref:e})});i3.displayName=r3;var o3=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:l}=t,a=Yt(e),[c,d]=df({prop:r,defaultProp:l??!1,onChange:o,caller:"DropdownMenuSub"});return R.jsx(_C,{...a,open:c,onOpenChange:d,children:n})},s3="DropdownMenuSubTrigger",cM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(zC,{...o,...r,ref:e})});cM.displayName=s3;var l3="DropdownMenuSubContent",fM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return R.jsx(jC,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fM.displayName=l3;var a3=QC,u3=WC,c3=eM,f3=nM,d3=rM,h3=iM,p3=oM,m3=sM,g3=lM,dM=aM,y3=uM,v3=o3,b3=cM,S3=fM;const x3=$m("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",xl:"h-10 gap-1 px-3 text-sm/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-5",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4","icon-xl":"size-10 [&_svg:not([class*='size-'])]:size-5"}},defaultVariants:{variant:"default",size:"default"}});function Ps({className:t,variant:e="default",size:n="default",asChild:r=!1,...o}){const l=r?KD:"button";return R.jsx(l,{"data-slot":"button","data-variant":e,"data-size":n,className:Ne(x3({variant:e,size:n,className:t})),...o})}function w3({...t}){return R.jsx(jj,{"data-slot":"context-menu",...t})}function C3({className:t,...e}){return R.jsx(Ij,{"data-slot":"context-menu-trigger",className:Ne("select-none",t),...e})}function M3({...t}){return R.jsx($j,{"data-slot":"context-menu-sub",...t})}function E3({className:t,...e}){return R.jsx(Lj,{children:R.jsx(Bj,{"data-slot":"context-menu-content",className:Ne("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})})}function R3({className:t,inset:e,variant:n="default",...r}){return R.jsx(Fj,{"data-slot":"context-menu-item","data-inset":e,"data-variant":n,className:Ne("group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function T3({className:t,inset:e,children:n,...r}){return R.jsxs(Hj,{"data-slot":"context-menu-sub-trigger","data-inset":e,className:Ne("flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[n,R.jsx(Dm,{className:"ml-auto"})]})}function A3({className:t,...e}){return R.jsx(Uj,{"data-slot":"context-menu-sub-content",className:Ne("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})}function O3({className:t,inset:e,...n}){return R.jsx(Vj,{"data-slot":"context-menu-label","data-inset":e,className:Ne("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",t),...n})}function k3({className:t,...e}){return R.jsx(Pj,{"data-slot":"context-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border/50",t),...e})}function N3({className:t,...e}){return R.jsx("span",{"data-slot":"context-menu-shortcut",className:Ne("ml-auto text-[0.625rem] tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",t),...e})}function D3(t,e){return{...t,mode:e}}function hM(t,e){const n=t.match(/^([a-zA-Z0-9_.-]+)(:|>|<|\.)(.*)$/);if(!n)return null;const[,r,o,l]=n;return{field:e.find(a=>a.id===r),fieldId:r,fragment:l,operator:o}}function _3(t,e){switch(t.kind){case"date":case"number":return e===":"||e===">"||e==="<";case"json":return e===":"||e===".";default:return e===":"}}function pM(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function sg(t){const e=[];let n=-1,r=!1,o=!1;for(let l=0;l<t.length;l+=1){const a=t[l];if(n===-1){if(/\s/.test(a))continue;n=l}if(o){o=!1;continue}if(a==="\\"){o=!0;continue}if(a==='"'){r=!r;continue}!r&&/\s/.test(a)&&(e.push({end:l,start:n,token:t.slice(n,l)}),n=-1)}return n!==-1&&e.push({end:t.length,start:n,token:t.slice(n)}),e}function mM(t){return sg(t).map(e=>e.token)}function RS(t){return t.replace(/\\(["\\])/g,"$1")}function gM(t){const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?RS(e.slice(1,-1)):RS(e)}function yM(t){return!t||/[\s"]/u.test(t)?`"${t.replace(/["\\]/g,"\\$&")}"`:t}function TS(t){const e=t.trim().toLowerCase();if(!e)return null;if(e==="today"){const o=new Date;return new Date(o.getFullYear(),o.getMonth(),o.getDate())}const n=e.match(/^-(\d+)d$/);if(n){const o=Number(n[1]);return new Date(Date.now()-o*24*60*60*1e3)}const r=Date.parse(t);return Number.isNaN(r)?null:new Date(r)}function z3(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function j3(t,e,n,r){const o=e.getValue(t),l=pM(o);if(!r.trim())return!0;if(e.kind==="enum")return l.toLowerCase()===r.trim().toLowerCase();if(e.kind==="number"){const a=Number(o),c=Number(r);return Number.isNaN(a)||Number.isNaN(c)?l.toLowerCase().includes(r.trim().toLowerCase()):n===">"?a>c:n==="<"?a<c:a===c}if(e.kind==="date"){const a=n===":"?r.match(/^([<>])(.*)$/):null,c=a?a[1]:n,d=a?a[2]:r,h=TS(l),p=TS(d);return!h||!p?l.toLowerCase().includes(r.trim().toLowerCase()):c===">"?h>p:c==="<"?h<p:z3(h,p)}return l.toLowerCase().includes(r.trim().toLowerCase())}function I3(t,e,n){return n.every(r=>j3(t,e,r.operator,r.value))}function AS(t){return t.flatMap(e=>{switch(e.kind){case"date":return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"},{id:`${e.id}-gt`,group:"filters",insertText:`${e.id}>`,keepOpen:!0,label:`${e.id}>`,mode:"append"},{id:`${e.id}-lt`,group:"filters",insertText:`${e.id}<`,keepOpen:!0,label:`${e.id}<`,mode:"append"}];case"number":return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"},{id:`${e.id}-gt`,group:"filters",insertText:`${e.id}>`,keepOpen:!0,label:`${e.id}>`,mode:"append"},{id:`${e.id}-lt`,group:"filters",insertText:`${e.id}<`,keepOpen:!0,label:`${e.id}<`,mode:"append"}];case"json":return[{id:`${e.id}-dot`,group:"filters",insertText:`${e.id}.`,keepOpen:!0,label:`${e.id}.`,mode:"append"},{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"}];default:return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"}]}})}function vM(t,e,n){const r=sg(t).find(d=>e>=d.start&&e<=d.end),o=r?.start??e,l=r?.end??e,a=r?.token??"",c=hM(a,n);return c?{end:l,field:c.field,fragment:c.fragment,operator:c.operator,start:o,token:a}:{end:l,fragment:a,start:o,token:a}}function L3(t,e){const n=[];for(const{end:r,start:o,token:l}of sg(t)){const a=hM(l,e);a?.field&&_3(a.field,a.operator)&&n.push({end:r,fieldId:a.field.id,operator:a.operator,start:o,token:l})}return n}function B3(t,e,n){const r=vM(t,e,n),o=r.fragment.trim().length>0,l=t?[{group:"input",id:"input-value",insertText:t,label:t,mode:"replace-whole"}]:[];if(!r.field||!r.operator){const c=AS(n),d=r.fragment.trim()?c.filter(h=>h.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):c;return o?[...l,...d.map(h=>D3(h,"replace-token"))]:[...l,...d]}if(r.field.kind==="enum"&&r.operator===":"){const c=gM(r.fragment).toLowerCase();if(c&&(r.field.options??[]).some(h=>h.toLowerCase()===c))return l;const d=(r.field.options??[]).filter(h=>h.toLowerCase().includes(c)).map(h=>({group:"values",id:`${r.field?.id}-${h}`,insertText:`${r.field?.id}:${yM(h)}`,label:h,mode:"replace-token"}));return[...l,...d]}if(r.field.kind==="date"){const c=r.field.sample??new Date().toISOString(),d=[{group:"values",id:`${r.field.id}-today`,insertText:`${r.field.id}${r.operator}today`,label:"today",mode:"replace-token"},{group:"values",id:`${r.field.id}-7d`,insertText:`${r.field.id}${r.operator}-7d`,label:"-7d",mode:"replace-token"},{group:"values",id:`${r.field.id}-sample`,insertText:`${r.field.id}${r.operator}${c}`,label:c,mode:"replace-token"}];r.operator===":"&&(d[1]={group:"values",id:`${r.field.id}-7d`,insertText:`${r.field.id}:>-7d`,label:">-7d",mode:"replace-token"},d[2]={group:"values",id:`${r.field.id}-sample`,insertText:`${r.field.id}:>${c}`,label:`>${c}`,mode:"replace-token"});const h=r.fragment.trim()?d.filter(p=>p.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):d;return[...l,...h]}const a=AS([r.field]).filter(c=>c.label.toLowerCase().includes(r.token.trim().toLowerCase()));return[...l,...a]}function V3(t,e,n,r){const o=vM(t,e,n),l=r.mode==="replace-whole"?r.insertText:r.mode==="append"?`${t.trimEnd()}${t.trim()?" ":""}${r.insertText}`:`${t.slice(0,o.start)}${r.insertText}${t.slice(o.end)}`,a=r.mode==="append"?l.length:r.mode==="replace-whole"?r.insertText.length:o.start+r.insertText.length;return{keepOpen:!!r.keepOpen,value:l,selectionStart:a}}function bM(t,e){const n=t.trim();if(!n)return{columnFilters:[],globalFilter:""};const r=mM(n),o=new Map,l=[];return r.forEach(a=>{const c=a.match(/^([a-zA-Z0-9_.-]+)(:|>|<)(.*)$/);if(!c){l.push(a);return}const[,d,h,p]=c,g=e.find(b=>b.id===d);if(!g){l.push(a);return}const v=o.get(g.id)??[];v.push({operator:h,value:gM(p)}),o.set(g.id,v)}),{columnFilters:Array.from(o.entries()).map(([a,c])=>({id:a,value:c})),globalFilter:l.join(" ")}}function F3(t,e,n){const r=bM(t,n),o=n.find(c=>c.id===e),l=r.globalFilter.split(/\s+/).filter(Boolean);if(!o||o.kind!=="text")return l;const a=r.columnFilters.find(c=>c.id===e)?.value.filter(c=>c.operator===":"&&c.value.trim()).map(c=>c.value.trim())??[];return[...l,...a]}function P3(t,e){return Array.from(new Set(t.map(n=>pM(e(n)).trim()).filter(Boolean)))}function $3(t){return t==null?new Date().toISOString():t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function H3(t){return e=>{if(t.accessorFn)return t.accessorFn(e);if(t.accessorKey)return e[t.accessorKey]}}function U3(t){switch(t.kind){case"date":return"date";case"enum":return"enum";case"json":return"json";case"number":return"number";default:return"text"}}function SM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function G3(t,e,n={}){const r=e.at(-1);return t.map((o,l)=>{const a=SM(o,l),c=H3(o),d=U3(o);return d==="enum"?{getValue:c,id:a,kind:d,options:o.enumOptions??n.fieldOptions?.[a]??P3(e,c)}:d==="date"?{getValue:c,id:a,kind:d,sample:$3(r?c(r):new Date().toISOString())}:{getValue:c,id:a,kind:d}})}function q3(t,e){const n=new Map(e.map(r=>[r.id,r]));return t.map((r,o)=>{const l=SM(r,o),a=n.get(l);return!a||r.filterFn?r:{...r,filterFn:((c,d,h)=>{const p=Array.isArray(h)?h:[];return I3(c.original,a,p)})}})}function um(t){return`${t}:search`}function cm(t){return`${t}-search`}function OS(t,e){return typeof window>"u"?"":e==="url"?new URL(window.location.href).searchParams.get(cm(t))??"":window.localStorage.getItem(um(t))??""}function K3(t,e,n){if(!(typeof window>"u")){if(e==="url"){const r=new URL(window.location.href);n.trim()?r.searchParams.set(cm(t),n):r.searchParams.delete(cm(t)),window.history.replaceState(window.history.state,"",r);return}if(n){window.localStorage.setItem(um(t),n);return}window.localStorage.removeItem(um(t))}}const xM="datatable:",Y3="datatable-",wM=M.createContext(null);function xf(){return M.useContext(wM)}function X3(){const t=xf();if(!t)throw new Error("useDataTableContext must be used inside DataTableProvider.");return t}function J3({children:t,columns:e,data:n,fieldOptions:r,id:o,onSearchChange:l,persistSearch:a=!1,search:c,searchPersistence:d,statePersistence:h,...p}){const g=d??(a?"localStorage":"none"),v=c!==void 0,[b,S]=M.useState(()=>g==="none"?"":OS(o,g)),x=c??b,C=M.useCallback(L=>{v||S(L),l?.(L)},[v,l]);M.useEffect(()=>{if(v||g==="none"){S("");return}S(OS(o,g))},[o,v,g]),M.useEffect(()=>{v||g==="none"||K3(o,g,b)},[o,v,g,b]);const E=M.useMemo(()=>G3(e,n,{fieldOptions:r}),[e,n,r]),A=M.useMemo(()=>bM(x,E),[x,E]),O=M.useMemo(()=>q3(e,E),[e,E]),D=M.useMemo(()=>({...p,columnFilters:A.columnFilters,columns:O,data:n,globalFilter:A.globalFilter,highlightQuery:x,id:o,resolveColumnHighlightTerms:(L,_)=>F3(_,L,E),statePersistence:h??(g==="none"?"none":g)}),[n,o,A.columnFilters,A.globalFilter,O,g,x,E,h,p]),z=M.useMemo(()=>({search:x,searchFields:E,setSearch:C,tableProps:D}),[C,x,D,E]);return R.jsx(wM.Provider,{value:z,children:t})}function fm(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function Q3(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function dm(t){return`${Y3}${t}`}function Z3(t){return(t.sorting?.length??0)===0&&(t.grouping?.length??0)===0&&(t.columnFilters?.length??0)===0&&Object.keys(t.highlightedColumns??{}).length===0&&Object.keys(t.columnVisibility??{}).length===0&&Object.keys(t.columnSizing??{}).length===0&&!t.globalFilter}function bp(t,e){if(typeof window>"u")return{};try{if(e==="none")return{};const n=e==="url"?new URL(window.location.href).searchParams.get(dm(t)):window.localStorage.getItem(`${xM}${t}`);return n?JSON.parse(n):{}}catch{return{}}}function W3(t,e,n){if(!(typeof window>"u")&&e!=="none"){if(e==="url"){const r=new URL(window.location.href);Z3(n)?r.searchParams.delete(dm(t)):r.searchParams.set(dm(t),JSON.stringify(n)),window.history.replaceState(window.history.state,"",r);return}window.localStorage.setItem(`${xM}${t}`,JSON.stringify(n))}}function eI(t){return t==="number"?"right":t==="boolean"||t==="selection"?"center":"left"}function kS(t){switch(t){case"boolean":case"selection":return 76;case"number":return 132;case"date":return 168;case"json":return 240;default:return 220}}function tI(t){if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.getTime();if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"){const e=Date.parse(t);return Number.isNaN(e)?null:e}return null}function nI(t,e){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(const o of e){const l=tI(o.getValue(t));l!==null&&(n=Math.min(n,l),r=Math.max(r,l))}return n===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY?null:{durationMs:Math.max(0,r-n),endMs:r,startMs:n}}function rI(t){return t!==null&&typeof t=="object"&&"durationMs"in t&&"endMs"in t&&"startMs"in t}function NS(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function iI(t){const e=Math.max(0,Math.floor(t/1e3)),n=Math.floor(e/86400),r=Math.floor(e%86400/3600),o=Math.floor(e%3600/60),l=e%60;return[n>0?`${n}d`:null,r>0?`${r}h`:null,o>0?`${o}m`:null,l>0||e===0?`${l}s`:null].filter(Boolean).join(" ")}function DS(t){return typeof t.columnDef.header=="string"?t.columnDef.header:fm(t.id)}function oI(t,e){const n=e*16;return typeof t=="number"?t+n:typeof t=="string"?`calc(${t} + ${n}px)`:n}function CM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function sI(t,e,n,r,o,l){const a=Object.keys(t[0]??{}).map(p=>({accessorKey:p,header:fm(p)})),d=(e&&e.length>0?e:a).map((p,g)=>{const v=CM(p,g),b=t.slice(0,25).map(C=>p.accessorFn?p.accessorFn(C):p.accessorKey?C[p.accessorKey]:void 0),S=p.kind??$D(b),x={align:p.align??eI(S),cellClassName:p.cellClassName,enumColors:S==="enum"?p.enumColors:void 0,enumOptions:S==="enum"?p.enumOptions:void 0,headerClassName:p.headerClassName,highlightMatches:p.highlightMatches??S==="text",kind:S,truncate:p.truncate??!0};return{accessorFn:p.accessorFn,accessorKey:p.accessorKey,aggregatedCell:p.aggregatedCell,aggregationFn:p.aggregationFn??(S==="date"?nI:S==="number"?"sum":void 0),cell:({getValue:C,row:E})=>p.cell?p.cell({row:E.original,value:C()}):Pm(C(),S,{dateFormat:n,enumColors:S==="enum"?p.enumColors:void 0,enumOptions:S==="enum"?p.enumOptions:void 0}),enableGlobalFilter:p.enableFiltering??!0,enableGrouping:p.enableGrouping??!0,filterFn:p.filterFn,enableHiding:p.enableHiding??!0,enableResizing:p.enableResizing??!0,enableSorting:p.enableSorting??!0,getGroupingValue:p.getGroupingValue,header:p.header??fm(v),id:v,maxSize:p.maxWidth??420,meta:x,minSize:p.minWidth??Math.min(kS(S),120),size:p.width??kS(S)}});if(!r)return o?[...d,{cell:()=>null,enableGrouping:!1,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:"Actions",id:"__actions",maxSize:l??280,meta:{align:"right",truncate:!1},minSize:Math.min(l??180,180),size:l??220}]:d;const h=[{cell:({row:p})=>R.jsx("div",{className:"flex items-center justify-center",children:p.getCanSelect()?R.jsx(Jb,{ariaLabel:`Select row ${p.index+1}`,checked:p.getIsSelected(),onCheckedChange:g=>p.toggleSelected(g)}):null}),enableGrouping:!1,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:({table:p})=>R.jsx("div",{className:"flex items-center justify-center",children:R.jsx(Jb,{ariaLabel:"Select all visible rows",checked:p.getIsAllPageRowsSelected(),indeterminate:p.getIsSomePageRowsSelected(),onCheckedChange:g=>p.toggleAllPageRowsSelected(g)})}),id:"__select",maxSize:56,meta:{align:"center",kind:"selection",sticky:"left",truncate:!1},minSize:56,size:56},...d];return o?[...h,{cell:()=>null,enableGrouping:!1,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:"Actions",id:"__actions",maxSize:l??280,meta:{align:"right",truncate:!1},minSize:Math.min(l??180,180),size:l??220}]:h}const lI=(t,e,n)=>{const r=String(n??"").trim().toLowerCase();return r?Q3(t.getValue(e)).toLowerCase().includes(r):!0};function _S(t){return t instanceof Element&&!!t.closest(["a","button","input","label","select","summary","textarea","[contenteditable=true]","[data-no-row-select=true]",'[role="button"]','[role="link"]','[role="menuitem"]'].join(","))}function aI(t){return t instanceof Element&&!!t.closest(["a","button","input","select","textarea","[contenteditable=true]",'[role="button"]','[role="combobox"]','[role="dialog"]','[role="menu"]','[role="menuitem"]','[role="searchbox"]','[role="textbox"]'].join(","))}function uI(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.original):[e.original]:[e.original]}function cI(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.id):[e.id]:[e.id]}function fI(t,e,n){return{actionRowIds:cI(t,e,n),actionRows:uI(t,e,n),anchorRow:e.original,anchorRowId:e.id,selectedRowIds:n.map(r=>r.id),selectedRows:n.map(r=>r.original)}}function lg(t,e){return typeof t=="function"?t(e):!!t}function MM(t,e){return typeof t.label=="function"?t.label(e):t.label}function Fc(t){return t.button===void 0||t.button===!1?null:t.button}function EM(t,e){return`${t.id}:${e.actionRowIds.join(",")}`}function RM(t){if(typeof t=="string")return t;if(t&&typeof t=="object"&&"message"in t&&(typeof t.message=="string"||t.message===void 0))return t.message}function TM(t){return t.some(e=>{if(e.scope==="selection")return!0;const n=Array.isArray(e.items)?e.items:void 0;return n?TM(n):!1})}function AM(t){return t.reduce((e,n)=>{const r=Fc(n)!==null?e+1:e,o=Array.isArray(n.items)?n.items:void 0;return o?r+AM(o):r},0)}function dI(t,e,n,r){const o=typeof t.items=="function"?t.items(e):t.items;return OM(o??[],n,r)}function OM(t,e,n){return t.flatMap(r=>{const o=fI(r,e,n);if(lg(r.hidden,o))return[];const l=dI(r,o,e,n);return r.items&&l.length===0?[]:[{action:r,context:o,items:l}]})}function kM({resolvedAction:t,setStatus:e,statuses:n}){const{action:r,context:o,items:l}=t,a=MM(r,o),c=lg(r.disabled,o),d=EM(r,o),h=n[d],p=Fc(r),g=M.useCallback(async()=>{if(r.onSelect){e(d,{state:"loading"});try{const S=await r.onSelect(o);e(d,{message:RM(S),state:"success"},2500)}catch(S){e(d,{message:S instanceof Error?S.message:String(S),state:"error"},4e3)}}},[r,o,e,d]),v=h?.state==="loading"?af:h?.state==="success"?Js:h?.state==="error"?_m:r.icon,b=h?.state==="loading";return l.length>0?R.jsxs(M3,{children:[R.jsxs(T3,{disabled:c||b,children:[v?R.jsx(v,{className:"size-3.5"}):null,R.jsx("span",{className:"truncate",children:a})]}),R.jsx(A3,{className:"w-72",children:l.map(S=>R.jsx(kM,{resolvedAction:S,setStatus:e,statuses:n},S.action.id))})]}):R.jsxs(R3,{disabled:c||b,onSelect:()=>{g()},title:h?.message,variant:r.variant??(p==="destructive"||typeof p=="object"&&p?.variant==="destructive"?"destructive":"default"),children:[v?R.jsx(v,{className:Ne("size-3.5",b&&"animate-spin")}):null,R.jsx("span",{className:"truncate",children:a}),r.shortcut?R.jsx(N3,{children:r.shortcut}):null]})}function hI({resolvedActions:t,setStatus:e,statuses:n}){const r=t.filter(o=>o.items.length===0&&Fc(o.action)!==null);return r.length===0?null:R.jsx("div",{className:"flex w-full justify-end gap-1.5","data-no-row-select":"true",children:r.map(o=>{const{action:l,context:a}=o,c=Fc(l),d=MM(l,a),h=EM(l,a),p=n[h],g=lg(l.disabled,a)||p?.state==="loading",v=p?.state==="loading"?af:p?.state==="success"?Js:p?.state==="error"?_m:l.icon,b=c&&typeof c=="object"&&c.label?c.label:d,S=p?.state==="error"?"destructive":typeof c=="string"?c:c&&typeof c=="object"?c.variant??"outline":"outline",x=c&&typeof c=="object"&&c.size?c.size:"sm",C=c&&typeof c=="object"?c.className:void 0;return R.jsxs(Ps,{"aria-busy":p?.state==="loading",className:C,disabled:g,onClick:()=>{const E=l.onSelect;E&&(async()=>{e(h,{state:"loading"});try{const A=await E(a);e(h,{message:RM(A),state:"success"},2500)}catch(A){e(h,{message:A instanceof Error?A.message:String(A),state:"error"},4e3)}})()},size:x,title:p?.message,type:"button",variant:S,children:[v?R.jsx(v,{className:Ne("size-3.5",p?.state==="loading"&&"animate-spin")}):null,b]},h)})})}function zS({label:t,value:e}){return R.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/80 px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:[R.jsx("span",{className:"text-foreground",children:e}),R.jsx("span",{children:t})]})}function pI({autoScrollToBottom:t=!1,autoScrollToBottomThreshold:e=96,columnFilters:n,columnVisibility:r,columns:o,data:l,dateFormat:a,edgeHorizontalPadding:c="16px",enableRowSelection:d=!1,filterPlaceholder:h="Search across visible columns",globalFilter:p,grouping:g,getRowId:v,height:b=620,highlightQuery:S="",id:x,onColumnFiltersChange:C,onColumnVisibilityChange:E,onGlobalFilterChange:A,onGroupingChange:O,resolveColumnHighlightTerms:D,rowActions:z,rowClassName:L,rowStyle:_,rowHeight:I=48,statePersistence:Q="localStorage"}){const ue=xf(),se=M.useMemo(()=>bp(x,Q),[x,Q]),[le,xe]=M.useState(()=>se.sorting??[]),[ie,ve]=M.useState(()=>se.columnSizing??{}),[V,Z]=M.useState(()=>se.columnVisibility??{}),[U,q]=M.useState(()=>se.highlightedColumns??{}),[K,N]=M.useState(()=>se.columnFilters??[]),[F,X]=M.useState(()=>se.grouping??[]),[ne,oe]=M.useState({}),[fe,me]=M.useState({}),De=M.useRef({}),ye=M.useRef(null),it=M.useRef(null),wt=M.useRef(null),[Ft,Ct]=M.useState(!1),[on,Ji]=M.useState(()=>se.globalFilter??""),Qi=M.useDeferredValue(on),rr=n!==void 0,qn=r!==void 0,Zr=p!==void 0,mn=g!==void 0,Zi=n??K,Wi=r??V,yr=g??F,Qt=z?TM(z):!1,tl=z?AM(z):0,gn=d||Qt,nl=d,eo=tl>0,La=M.useMemo(()=>Math.max(160,Math.min(320,tl*96)),[tl]),rl=M.useMemo(()=>{if(!o||o.length===0)return o;const re=new Map((ue?.searchFields??[]).filter(ee=>ee.kind==="enum").map(ee=>[ee.id,ee.options??[]]));return o.map((ee,ce)=>{if(ee.kind!=="enum"||ee.enumOptions?.length)return ee;const Oe=re.get(CM(ee,ce));return!Oe||Oe.length===0?ee:{...ee,enumOptions:Oe}})},[o,ue?.searchFields]),jf=M.useMemo(()=>sI(l,rl,a,nl,eo,La),[rl,l,a,La,eo,nl]),Ba=M.useCallback((re,ee,ce)=>{const Oe=De.current[re];Oe&&(window.clearTimeout(Oe),delete De.current[re]),me(Ye=>({...Ye,[re]:ee})),ce&&(De.current[re]=window.setTimeout(()=>{me(Ye=>{const Ze={...Ye};return delete Ze[re],Ze}),delete De.current[re]},ce))},[]),to=M.useCallback(re=>{ve(ee=>$n(re,ee))},[]),Zt=M.useCallback(re=>{const ee=$n(re,Zi);rr||N(ee),C?.(ee)},[rr,C,Zi]),ir=M.useCallback(re=>{const ee=$n(re,Wi);qn||Z(ee),E?.(ee)},[qn,E,Wi]),Wt=M.useCallback(re=>{const ee=$n(re,yr);mn||X(ee),O?.(ee)},[mn,O,yr]),If=M.useMemo(()=>yr.length>0?!0:{},[yr.length]),Kn=AN({columnResizeMode:"onChange",columns:jf,data:l,enableColumnResizing:!0,enableGrouping:!0,enableRowSelection:gn?re=>!re.getIsGrouped():!1,enableSubRowSelection:!1,getCoreRowModel:mN(),getExpandedRowModel:gN(),getFilteredRowModel:xN(),getGroupedRowModel:wN(),getRowId:v,getSortedRowModel:MN(),groupedColumnMode:!1,globalFilterFn:lI,onColumnFiltersChange:Zt,onColumnSizingChange:to,onColumnVisibilityChange:ir,onGroupingChange:Wt,onRowSelectionChange:oe,onSortingChange:xe,state:{columnFilters:Zi,columnSizing:ie,columnVisibility:Wi,expanded:If,globalFilter:Qi.trim(),grouping:yr,rowSelection:ne,sorting:le}}),vr=M.useRef(null),Wr=M.useRef(!0),no=M.useRef(!1),ro=M.useRef(0),Rt=Kn.getRowModel().rows,br=M.useMemo(()=>Rt.filter(re=>re.getCanSelect()),[Rt]),or=Kn.getSelectedRowModel().rows,Lf=typeof b=="number"?b:0,Va=M.useRef(t?Math.max(Rt.length*I-Lf,0):0),Sr=FN({count:Rt.length,estimateSize:()=>I,getScrollElement:()=>vr.current,initialOffset:Va.current,overscan:12}),ei=Sr.getVirtualItems();l.length,Rt.length,or.length,M.useEffect(()=>()=>{for(const re of Object.values(De.current))window.clearTimeout(re)},[]),M.useEffect(()=>{if(rr)return;const re=bp(x,Q);xe(re.sorting??[]),ve(re.columnSizing??{}),qn||Z(re.columnVisibility??{}),q(re.highlightedColumns??{}),N(re.columnFilters??[]),mn||X(re.grouping??[]),Ji(re.globalFilter??""),oe({}),it.current=null,wt.current=null,Ct(!1),ye.current=null;for(const ee of Object.values(De.current))window.clearTimeout(ee);De.current={},me({})},[x,rr,qn,mn,Q]),M.useEffect(()=>{rr&&N(n)},[n,rr]),M.useEffect(()=>{qn&&Z(r)},[r,qn]),M.useEffect(()=>{mn&&X(g)},[g,mn]),M.useEffect(()=>{Zr&&Ji(p)},[p,Zr]),M.useEffect(()=>{if(typeof window>"u"||Q!=="url")return;const re=()=>{const ee=bp(x,"url");xe(ee.sorting??[]),ve(ee.columnSizing??{}),qn||Z(ee.columnVisibility??{}),q(ee.highlightedColumns??{}),N(ee.columnFilters??[]),mn||X(ee.grouping??[]),Ji(ee.globalFilter??""),oe({}),it.current=null,wt.current=null,Ct(!1),ye.current=null};return window.addEventListener("popstate",re),()=>window.removeEventListener("popstate",re)},[x,qn,mn,Q]),M.useEffect(()=>{Zr||rr||W3(x,Q,{columnFilters:K,columnSizing:ie,highlightedColumns:U,columnVisibility:Wi,globalFilter:Qi.trim(),grouping:yr,sorting:le})},[K,ie,Qi,U,x,rr,Zr,mn,Wi,yr,le,Q]),M.useEffect(()=>{const re=vr.current;if(!t||!re)return;const ee=()=>{const ce=re.scrollHeight-re.scrollTop-re.clientHeight;Wr.current=ce<=e};return ee(),re.addEventListener("scroll",ee,{passive:!0}),()=>{re.removeEventListener("scroll",ee)}},[t,e]),M.useLayoutEffect(()=>{const re=vr.current,ee=ro.current;ro.current=l.length;const ce=()=>{Rt.length!==0&&(Sr.scrollToIndex(Rt.length-1,{align:"end"}),re?.scrollTo({top:re.scrollHeight}))},Oe=()=>{const Ye=[],Ze=pt=>{if(ce(),pt<=0)return;const ft=window.requestAnimationFrame(()=>Ze(pt-1));Ye.push(ft)};return Ze(4),()=>{for(const pt of Ye)window.cancelAnimationFrame(pt)}};if(t&&re&&!no.current&&Rt.length>0)return no.current=!0,Wr.current=!0,Oe();if(!(!t||!re||l.length<=ee||!Wr.current))return Oe()},[t,l.length,Sr,Rt.length]);const Fa=M.useCallback(()=>{oe({}),it.current=null,wt.current=null,Ct(!1),ye.current=null},[]),Go=M.useCallback((re,ee)=>U[re]??!!ee.highlightMatches,[U]),xr=M.useCallback((re,ee,ce={})=>{const Oe=br.findIndex(ft=>ft.id===re),Ye=br.findIndex(ft=>ft.id===ee);if(Oe===-1||Ye===-1)return;const[Ze,pt]=Oe<=Ye?[Oe,Ye]:[Ye,Oe];oe({...ce,...Object.fromEntries(br.slice(Ze,pt+1).map(ft=>[ft.id,!0]))})},[br]),il=M.useCallback(re=>{ye.current=re,oe({[re]:!0})},[]),ti=M.useCallback((re,ee)=>{if(!it.current)return;const ce=vr.current;if(!ce)return;const Oe=document.elementFromPoint(re,ee)?.closest("tr[data-row-id]"),Ye=Array.from(ce.querySelectorAll("tr[data-row-id]")),Ze=Oe?.dataset.rowId??(ee<ce.getBoundingClientRect().top?Ye[0]?.dataset.rowId:ee>ce.getBoundingClientRect().bottom?Ye.at(-1)?.dataset.rowId:void 0);if(!Ze)return;const{anchorId:pt,baseSelection:ft}=it.current;xr(pt,Ze,ft)},[xr]),ol=M.useCallback((re,ee)=>{if(re.button!==0||!gn||!ee.getCanSelect()||_S(re.target))return;re.preventDefault(),wt.current={clientX:re.clientX,clientY:re.clientY};const ce=ee.id,Oe=re.metaKey||re.ctrlKey,Ye=Kn.getState().rowSelection;if(re.shiftKey){const Ze=ye.current??ce;ye.current=Ze,it.current={anchorId:Ze,baseSelection:{}},Ct(!0),xr(Ze,ce);return}if(Oe){const Ze={...Ye};Ze[ce]?delete Ze[ce]:Ze[ce]=!0,ye.current=ce,it.current={anchorId:ce,baseSelection:Ze},Ct(!0),oe(Ze);return}ye.current=ce,it.current={anchorId:ce,baseSelection:{}},Ct(!0),oe({[ce]:!0})},[gn,xr,Kn]),Pa=M.useCallback((re,ee)=>{if(!gn||!ee.getCanSelect()||re.buttons!==1||_S(re.target)||!it.current)return;const{anchorId:ce,baseSelection:Oe}=it.current;xr(ce,ee.id,Oe)},[gn,xr]),$a=M.useCallback(re=>{if(!(!gn||!re.getCanSelect())){if(re.getIsSelected()){ye.current=re.id;return}il(re.id)}},[gn,il]);return M.useEffect(()=>{if(!Ft)return;const re=ce=>{wt.current={clientX:ce.clientX,clientY:ce.clientY},ti(ce.clientX,ce.clientY)},ee=()=>{it.current=null,wt.current=null,Ct(!1)};return window.addEventListener("mousemove",re),window.addEventListener("mouseup",ee),()=>{window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",ee)}},[Ft,ti]),M.useEffect(()=>{if(!Ft)return;let re=0;const ee=()=>{const ce=vr.current,Oe=wt.current;if(ce&&Oe){const{top:Ye,bottom:Ze}=ce.getBoundingClientRect(),pt=48;let ft=0;if(Oe.clientY<Ye+pt?ft=-Math.ceil((Ye+pt-Oe.clientY)/6):Oe.clientY>Ze-pt&&(ft=Math.ceil((Oe.clientY-(Ze-pt))/6)),ft!==0){const io=Math.max(-28,Math.min(28,ft));ce.scrollTop+=io,ti(Oe.clientX,Oe.clientY)}}re=window.requestAnimationFrame(ee)};return re=window.requestAnimationFrame(ee),()=>{window.cancelAnimationFrame(re)}},[Ft,ti]),M.useEffect(()=>{if(!gn)return;const re=ee=>{ee.key!=="Escape"||Object.keys(ne).length===0||aI(ee.target)||Fa()};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[gn,Fa,ne]),R.jsx("section",{className:"flex min-h-0 flex-col overflow-hidden border-t border-border bg-card text-card-foreground shadow-sm",style:{height:b},children:R.jsx("div",{className:Ne("min-h-0 flex-1 overflow-auto pb-4",Ft&&"select-none"),ref:vr,style:{scrollbarGutter:"stable"},children:R.jsxs("table",{className:"grid w-full border-separate border-spacing-0",role:"grid",children:[R.jsx("thead",{className:"sticky top-0 z-20 grid",children:Kn.getHeaderGroups().map(re=>R.jsx("tr",{className:"flex w-full",style:{width:Kn.getTotalSize()},children:re.headers.map((ee,ce)=>R.jsx(GD,{header:ee,highlightEnabled:Go(ee.column.id,ee.column.columnDef.meta??{}),onToggleHighlight:()=>q(Oe=>({...Oe,[ee.column.id]:!Go(ee.column.id,ee.column.columnDef.meta??{})})),paddingLeft:ce===0?c:void 0,paddingRight:ce===re.headers.length-1?c:void 0,scrollContainerRef:vr},ee.id))},re.id))}),R.jsx("tbody",{className:"relative grid",style:{height:Sr.getTotalSize()},children:ei.length===0?R.jsx("tr",{className:"absolute inset-x-0 top-0 flex h-full items-center justify-center",children:R.jsx("td",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:"No rows match the current filters."})}):ei.map(re=>{const ee=Rt[re.index],ce=ee.getIsGrouped(),Oe=ce?[]:OM(z??[],ee,or),Ye=ee.getIsSelected(),Ze=ee.getVisibleCells(),pt=ee.groupingColumnId?Kn.getColumn(ee.groupingColumnId):void 0,ft=pt?.columnDef.meta,ni=pt?Pm(ee.groupingValue,ft?.kind,{dateFormat:a,enumColors:ft?.enumColors,enumOptions:ft?.enumOptions}):null,io=ce?Ze.flatMap(Pe=>{const yn=Pe.column.columnDef.meta??{},sn=Pe.getValue(),tt=DS(Pe.column);return yn.kind==="date"&&rI(sn)?[{label:`${tt} span`,value:iI(sn.durationMs)}]:yn.kind==="number"&&typeof sn=="number"?[{label:`${tt} sum`,value:NS(sn)}]:[]}):[],wr=R.jsx("tr",{"aria-selected":Ye,className:Ne("absolute left-0 flex w-full transition-colors",ce?"bg-transparent":"bg-card",gn&&ee.getCanSelect()&&"cursor-pointer",!ce&&L?.(ee.original),!ce&&Ye&&"bg-primary/10 before:absolute before:-top-px before:left-0 before:h-px before:w-full before:bg-primary before:content-[''] after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-primary after:content-['']"),"data-index":re.index,"data-row-id":ee.id,"data-state":!ce&&Ye?"selected":void 0,onContextMenu:ce?void 0:()=>$a(ee),onMouseDown:ce?void 0:Pe=>ol(Pe,ee),onMouseEnter:ce?void 0:Pe=>Pa(Pe,ee),ref:Pe=>{Pe&&Sr.measureElement(Pe)},style:{...ce?void 0:_?.(ee.original),minHeight:ce?Math.max(I,44):I,transform:`translateY(${re.start}px)`,width:Kn.getTotalSize()},children:ce?R.jsx("td",{className:"flex shrink-0 items-center border-y border-border/70 px-2 py-2 align-middle text-xs text-muted-foreground",style:{background:"var(--color-table-gap, color-mix(in oklab, var(--color-muted) 84%, transparent))",paddingLeft:oI(c,ee.depth),paddingRight:c,width:Kn.getTotalSize()},children:R.jsxs("div",{className:"flex w-full min-w-0 flex-wrap items-center gap-2",children:[ee.getCanExpand()?R.jsx("button",{"aria-label":ee.getIsExpanded()?"Collapse group":"Expand group",className:"inline-flex size-6 items-center justify-center rounded-md border border-border/70 bg-background/80 text-foreground transition-colors hover:bg-background",onClick:()=>ee.toggleExpanded(),type:"button",children:ee.getIsExpanded()?R.jsx(x1,{className:"size-3.5"}):R.jsx(Dm,{className:"size-3.5"})}):null,pt?R.jsxs("span",{className:"inline-flex items-center gap-2 text-xs",children:[R.jsx("span",{className:"font-medium text-foreground",children:DS(pt)}),R.jsx("span",{className:"min-w-0 truncate text-foreground",children:ni})]}):R.jsx("span",{className:"font-medium text-foreground",children:"Group"}),R.jsx(zS,{label:"rows",value:NS(ee.getLeafRows().length)}),io.map(Pe=>R.jsx(zS,{label:Pe.label,value:Pe.value},`${ee.id}-${Pe.label}`))]})}):ee.getVisibleCells().map((Pe,yn,sn)=>{const tt=Pe.column.columnDef.meta??{},Ha=Pe.column.id==="__actions",Ua=tt.kind==="text"&&D&&Go(Pe.column.id,tt)?D(Pe.column.id,S):[];return Ha?R.jsx("td",{className:Ne("flex shrink-0 border-b border-border px-2 py-1.5 align-middle text-sm text-foreground justify-end text-right",tt.cellClassName),style:{paddingLeft:yn===0?c:void 0,paddingRight:yn===sn.length-1?c:void 0,width:Pe.column.getSize()},children:R.jsx("div",{className:"w-full min-w-0",children:R.jsx(hI,{resolvedActions:Oe,setStatus:Ba,statuses:fe})})},Pe.id):R.jsx(VD,{cell:Pe,dateFormat:a,highlightTerms:Ua,paddingLeft:yn===0?c:void 0,paddingRight:yn===sn.length-1?c:void 0},Pe.id)})},ee.id);return Oe.length===0?wr:R.jsxs(w3,{children:[R.jsx(C3,{asChild:!0,children:wr}),R.jsxs(E3,{className:"w-64",children:[Oe.map(Pe=>R.jsx(kM,{resolvedAction:Pe,setStatus:Ba,statuses:fe},Pe.action.id)),R.jsx(k3,{}),R.jsx(O3,{children:Ye&&or.length>1?`${or.length} selected rows`:"Row actions"})]})]},ee.id)})})]})})})}function mI(t={}){const e=xf(),n=e?{...e.tableProps,...t}:t;if(n.data===void 0||n.id===void 0)throw new Error("DataTable must be used inside DataTableProvider or receive data and id props.");return R.jsx(pI,{...n})}function NM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function wf(t,e){return e.includes(".")?e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t):t[e]}function gI(t){return t.includes(".")}function It(t){this.content=t}It.prototype={constructor:It,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),l=r.content.slice();return o==-1?l.push(n||t,e):(l[o+1]=e,n&&(l[o]=n)),new It(l)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new It(n)},addToStart:function(t,e){return new It([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new It(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),l=r.find(t);return o.splice(l==-1?o.length:l,0,e,n),new It(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=It.from(t),t.size?new It(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=It.from(t),t.size?new It(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=It.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};It.from=function(t){if(t instanceof It)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new It(e)};function DM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),l=e.child(r);if(o==l){n+=o.nodeSize;continue}if(!o.sameMarkup(l))return n;if(o.isText&&o.text!=l.text){for(let a=0;o.text[a]==l.text[a];a++)n++;return n}if(o.content.size||l.content.size){let a=DM(o.content,l.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function _M(t,e,n,r){for(let o=t.childCount,l=e.childCount;;){if(o==0||l==0)return o==l?null:{a:n,b:r};let a=t.child(--o),c=e.child(--l),d=a.nodeSize;if(a==c){n-=d,r-=d;continue}if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){let h=0,p=Math.min(a.text.length,c.text.length);for(;h<p&&a.text[a.text.length-h-1]==c.text[c.text.length-h-1];)h++,n--,r--;return{a:n,b:r}}if(a.content.size||c.content.size){let h=_M(a.content,c.content,n-1,r-1);if(h)return h}n-=d,r-=d}}class te{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,l){for(let a=0,c=0;c<n;a++){let d=this.content[a],h=c+d.nodeSize;if(h>e&&r(d,o+c,l||null,a)!==!1&&d.content.size){let p=c+1;d.nodesBetween(Math.max(0,e-p),Math.min(d.content.size,n-p),r,o+p)}c=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let l="",a=!0;return this.nodesBetween(e,n,(c,d)=>{let h=c.isText?c.text.slice(Math.max(e,d)-d,n-d):c.isLeaf?o?typeof o=="function"?o(c):o:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&h||c.isTextblock)&&r&&(a?a=!1:l+=r),l+=h},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),l=1);l<e.content.length;l++)o.push(e.content[l]);return new te(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let l=0,a=0;a<n;l++){let c=this.content[l],d=a+c.nodeSize;d>e&&((a<e||d>n)&&(c.isText?c=c.cut(Math.max(0,e-a),Math.min(c.text.length,n-a)):c=c.cut(Math.max(0,e-a-1),Math.min(c.content.size,n-a-1))),r.push(c),o+=c.nodeSize),a=d}return new te(r,o)}cutByIndex(e,n){return e==n?te.empty:e==0&&n==this.content.length?this:new te(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new te(o,l)}addToStart(e){return new te([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new te(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return DM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return _M(this,e,n,r)}findIndex(e){if(e==0)return mc(0,e);if(e==this.size)return mc(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),l=r+o.nodeSize;if(l>=e)return l==e?mc(n+1,l):mc(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return te.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new te(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return te.empty;let n,r=0;for(let o=0;o<e.length;o++){let l=e[o];r+=l.nodeSize,o&&l.isText&&e[o-1].sameMarkup(l)?(n||(n=e.slice(0,o)),n[n.length-1]=l.withText(n[n.length-1].text+l.text)):n&&n.push(l)}return new te(n||e,r)}static from(e){if(!e)return te.empty;if(e instanceof te)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new te([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}te.empty=new te([],0);const Sp={index:0,offset:0};function mc(t,e){return Sp.index=t,Sp.offset=e,Sp}function Pc(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Pc(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Pc(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let et=class hm{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let l=e[o];if(this.eq(l))return e;if(this.type.excludes(l.type))n||(n=e.slice(0,o));else{if(l.type.excludes(this.type))return e;!r&&l.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Pc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hm.none;if(e instanceof hm)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};et.none=[];class $c extends Error{}class ae{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=jM(this.content,e+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ae(zM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ae.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(te.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)o++;return new ae(e,r,o)}}ae.empty=new ae(te.empty,0,0);function zM(t,e,n){let{index:r,offset:o}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:c}=t.findIndex(n);if(o==e||l.isText){if(c!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(zM(l.content,e-o-1,n-o-1)))}function jM(t,e,n,r){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=jM(a.content,e-l-1,n,a);return c&&t.replaceChild(o,a.copy(c))}function yI(t,e,n){if(n.openStart>t.depth)throw new $c("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new $c("Inconsistent open depths");return IM(t,e,n,0)}function IM(t,e,n,r){let o=t.index(r),l=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=IM(t,e,n,r+1);return l.copy(l.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,c=a.content;return No(a,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=vI(n,t);return No(l,BM(t,a,c,e,r))}else return No(l,Hc(t,e,r))}function LM(t,e){if(!e.type.compatibleContent(t.type))throw new $c("Cannot join "+e.type.name+" onto "+t.type.name)}function pm(t,e,n){let r=t.node(n);return LM(r,e.node(n)),r}function ko(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function sa(t,e,n,r){let o=(e||t).node(n),l=0,a=e?e.index(n):o.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(ko(t.nodeAfter,r),l++));for(let c=l;c<a;c++)ko(o.child(c),r);e&&e.depth==n&&e.textOffset&&ko(e.nodeBefore,r)}function No(t,e){return t.type.checkContent(e),t.copy(e)}function BM(t,e,n,r,o){let l=t.depth>o&&pm(t,e,o+1),a=r.depth>o&&pm(n,r,o+1),c=[];return sa(null,t,o,c),l&&a&&e.index(o)==n.index(o)?(LM(l,a),ko(No(l,BM(t,e,n,r,o+1)),c)):(l&&ko(No(l,Hc(t,e,o+1)),c),sa(e,n,o,c),a&&ko(No(a,Hc(n,r,o+1)),c)),sa(r,null,o,c),new te(c)}function Hc(t,e,n){let r=[];if(sa(null,t,n,r),t.depth>n){let o=pm(t,e,n+1);ko(No(o,Hc(t,e,n+1)),r)}return sa(e,null,n,r),new te(r)}function vI(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)o=e.node(l).copy(te.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class ya{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let l=0;l<e;l++)o+=r.child(l).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return et.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let c=r;r=o,o=c}let l=r.marks;for(var a=0;a<l.length;a++)l[a].type.spec.inclusive===!1&&(!o||!l[a].isInSet(o.marks))&&(l=l[a--].removeFromSet(l));return l}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var l=0;l<r.length;l++)r[l].type.spec.inclusive===!1&&(!o||!r[l].isInSet(o.marks))&&(r=r[l--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Uc(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,l=n;for(let a=e;;){let{index:c,offset:d}=a.content.findIndex(l),h=l-d;if(r.push(a,c,o+d),!h||(a=a.child(c),a.isText))break;l=h-1,o+=d+1}return new ya(n,r,l)}static resolveCached(e,n){let r=jS.get(e);if(r)for(let l=0;l<r.elts.length;l++){let a=r.elts[l];if(a.pos==n)return a}else jS.set(e,r=new bI);let o=r.elts[r.i]=ya.resolve(e,n);return r.i=(r.i+1)%SI,o}}class bI{constructor(){this.elts=[],this.i=0}}const SI=12,jS=new WeakMap;class Uc{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const xI=Object.create(null);let Ii=class mm{constructor(e,n,r,o=et.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||te.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Pc(this.attrs,n||e.defaultAttrs||xI)&&et.sameSet(this.marks,r||et.none)}copy(e=null){return e==this.content?this:new mm(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new mm(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ae.empty;let o=this.resolve(e),l=this.resolve(n),a=r?0:o.sharedDepth(n),c=o.start(a),h=o.node(a).content.cut(o.pos-c,l.pos-c);return new ae(h,o.depth-a,l.depth-a)}replace(e,n,r){return yI(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return ya.resolveCached(this,e)}resolveNoCache(e){return ya.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),VM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=te.empty,o=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,l),c=a&&a.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let d=o;d<l;d++)if(!this.type.allowsMarks(r.child(d).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let l=this.contentMatchAt(e).matchType(r),a=l&&l.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=et.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!et.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=te.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,o,r);return l.type.checkAttrs(l.attrs),l}};Ii.prototype.text=void 0;class Gc extends Ii{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):VM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Gc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Gc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function VM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Io{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new wI(e,n);if(r.next==null)return Io.empty;let o=FM(r);r.next&&r.err("Unexpected trailing text");let l=OI(AI(o));return kI(l,r),l}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let l=n;o&&l<r;l++)o=o.matchType(e.child(l).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function l(a,c){let d=a.matchFragment(e,r);if(d&&(!n||d.validEnd))return te.from(c.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:g}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&o.indexOf(g)==-1){o.push(g);let v=l(g,c.concat(p));if(v)return v}}return null}return l(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),l=o.match;if(l.matchType(e)){let a=[];for(let c=o;c.type;c=c.via)a.push(c.type);return a.reverse()}for(let a=0;a<l.next.length;a++){let{type:c,next:d}=l.next[a];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!o.type||d.validEnd)&&(r.push({match:c.contentMatch,type:c,via:o}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let l=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)l+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return l}).join(`
|
|
56
|
+
`)}}Io.empty=new Io(!0);class wI{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function FM(t){let e=[];do e.push(CI(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function CI(t){let e=[];do e.push(MI(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function MI(t){let e=TI(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=EI(t,e);else break;return e}function IS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function EI(t,e){let n=IS(t),r=n;return t.eat(",")&&(t.next!="}"?r=IS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function RI(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let l in n){let a=n[l];a.isInGroup(e)&&o.push(a)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function TI(t){if(t.eat("(")){let e=FM(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=RI(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function AI(t){let e=[[]];return o(l(t,0),n()),e;function n(){return e.push([])-1}function r(a,c,d){let h={term:d,to:c};return e[a].push(h),h}function o(a,c){a.forEach(d=>d.to=c)}function l(a,c){if(a.type=="choice")return a.exprs.reduce((d,h)=>d.concat(l(h,c)),[]);if(a.type=="seq")for(let d=0;;d++){let h=l(a.exprs[d],c);if(d==a.exprs.length-1)return h;o(h,c=n())}else if(a.type=="star"){let d=n();return r(c,d),o(l(a.expr,d),d),[r(d)]}else if(a.type=="plus"){let d=n();return o(l(a.expr,c),d),o(l(a.expr,d),d),[r(d)]}else{if(a.type=="opt")return[r(c)].concat(l(a.expr,c));if(a.type=="range"){let d=c;for(let h=0;h<a.min;h++){let p=n();o(l(a.expr,d),p),d=p}if(a.max==-1)o(l(a.expr,d),d);else for(let h=a.min;h<a.max;h++){let p=n();r(d,p),o(l(a.expr,d),p),d=p}return[r(d)]}else{if(a.type=="name")return[r(c,void 0,a.value)];throw new Error("Unknown expr type")}}}}function PM(t,e){return e-t}function LS(t,e){let n=[];return r(e),n.sort(PM);function r(o){let l=t[o];if(l.length==1&&!l[0].term)return r(l[0].to);n.push(o);for(let a=0;a<l.length;a++){let{term:c,to:d}=l[a];!c&&n.indexOf(d)==-1&&r(d)}}}function OI(t){let e=Object.create(null);return n(LS(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:c,to:d})=>{if(!c)return;let h;for(let p=0;p<o.length;p++)o[p][0]==c&&(h=o[p][1]);LS(t,d).forEach(p=>{h||o.push([c,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let l=e[r.join(",")]=new Io(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let c=o[a][1].sort(PM);l.next.push({type:o[a][0],next:e[c.join(",")]||n(c)})}return l}}function kI(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],l=!o.validEnd,a=[];for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];a.push(d.name),l&&!(d.isText||d.hasRequiredAttrs())&&(l=!1),r.indexOf(h)==-1&&r.push(h)}l&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $M(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function HM(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let l=t[r];if(l.hasDefault)o=l.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function UM(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let l=t[o];l.validate&&l.validate(e[o])}}function GM(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new DI(t,r,e[r]);return n}let BS=class qM{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=GM(e,r.attrs),this.defaultAttrs=$M(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Io.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:HM(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ii(this,this.computeAttrs(e),te.from(n),et.setFrom(r))}createChecked(e=null,n,r){return n=te.from(n),this.checkContent(n),new Ii(this,this.computeAttrs(e),n,et.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=te.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),l=o&&o.fillBefore(te.empty,!0);return l?new Ii(this,e,n.append(l),et.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){UM(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:et.none:e}static compile(e,n){let r=Object.create(null);e.forEach((l,a)=>r[l]=new qM(l,n,a));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let l in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function NI(t,e,n){let r=n.split("|");return o=>{let l=o===null?"null":typeof o;if(r.indexOf(l)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${l}`)}}class DI{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?NI(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Cf{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=GM(e,o.attrs),this.excluded=null;let l=$M(this.attrs);this.instance=l?new et(this,l):null}create(e=null){return!e&&this.instance?this.instance:new et(this,HM(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((l,a)=>r[l]=new Cf(l,o++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){UM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class KM{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=It.from(e.nodes),n.marks=It.from(e.marks||{}),this.nodes=BS.compile(this.spec.nodes,this),this.marks=Cf.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let l=this.nodes[o],a=l.spec.content||"",c=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=Io.parse(a,this.nodes)),l.inlineContent=l.contentMatch.inlineContent,l.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!l.isInline||!l.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=l}l.markSet=c=="_"?null:c?VS(this,c.split(" ")):c==""||!l.inlineContent?[]:null}for(let o in this.marks){let l=this.marks[o],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:VS(this,a.split(" "))}this.nodeFromJSON=o=>Ii.fromJSON(this,o),this.markFromJSON=o=>et.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof BS){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Gc(r,r.defaultAttrs,e,et.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function VS(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],l=t.marks[o],a=l;if(l)n.push(l);else for(let c in t.marks){let d=t.marks[c];(o=="_"||d.spec.group&&d.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=d)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function _I(t){return t.tag!=null}function zI(t){return t.style!=null}class Li{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(_I(o))this.tags.push(o);else if(zI(o)){let l=/[^=]*/.exec(o.style)[0];r.indexOf(l)<0&&r.push(l),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let l=e.nodes[o.node];return l.contentMatch.matchType(l)})}parse(e,n={}){let r=new PS(this,n,!1);return r.addAll(e,et.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new PS(this,n,!0);return r.addAll(e,et.none,n.from,n.to),ae.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let l=this.tags[o];if(LI(e,l.tag)&&(l.namespace===void 0||e.namespaceURI==l.namespace)&&(!l.context||n.matchesContext(l.context))){if(l.getAttrs){let a=l.getAttrs(e);if(a===!1)continue;l.attrs=a||void 0}return l}}}matchStyle(e,n,r,o){for(let l=o?this.styles.indexOf(o)+1:0;l<this.styles.length;l++){let a=this.styles[l],c=a.style;if(!(c.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=n))){if(a.getAttrs){let d=a.getAttrs(n);if(d===!1)continue;a.attrs=d||void 0}return a}}}static schemaRules(e){let n=[];function r(o){let l=o.priority==null?50:o.priority,a=0;for(;a<n.length;a++){let c=n[a];if((c.priority==null?50:c.priority)<l)break}n.splice(a,0,o)}for(let o in e.marks){let l=e.marks[o].spec.parseDOM;l&&l.forEach(a=>{r(a=$S(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in e.nodes){let l=e.nodes[o].spec.parseDOM;l&&l.forEach(a=>{r(a=$S(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Li(e,Li.schemaRules(e)))}}const YM={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},jI={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},XM={ol:!0,ul:!0},va=1,gm=2,la=4;function FS(t,e,n){return e!=null?(e?va:0)|(e==="full"?gm:0):t&&t.whitespace=="pre"?va|gm:n&~la}class gc{constructor(e,n,r,o,l,a){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=et.none,this.match=l||(a&la?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(te.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&va)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let l=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-o[0].length))}}let n=te.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(te.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!YM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class PS{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,l,a=FS(null,n.preserveWhitespace,0)|(r?la:0);o?l=new gc(o.type,o.attrs,et.none,!0,n.topMatch||o.type.contentMatch,a):r?l=new gc(null,null,et.none,!0,null,a):l=new gc(e.schema.topNodeType,null,et.none,!0,null,a),this.nodes=[l],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,l=o.options&gm?"full":this.localPreserveWS||(o.options&va)>0,{schema:a}=this.parser;if(l==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(l)if(l==="full")r=r.replace(/\r\n?/g,`
|
|
57
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let c=r.split(/\r?\n|\r/);for(let d=0;d<c.length;d++)d&&this.insertNode(a.linebreakReplacement.create(),n,!0),c[d]&&this.insertNode(a.text(c[d]),n,!/\S/.test(c[d]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let c=o.content[o.content.length-1],d=e.previousSibling;(!c||d&&d.nodeName=="BR"||c.isText&&/[ \t\r\n\u000c]$/.test(c.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),c;XM.hasOwnProperty(a)&&this.parser.normalizeLists&&II(e);let d=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(d?d.ignore:jI.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!d||d.skip||d.closeParent){d&&d.closeParent?this.open=Math.max(0,this.open-1):d&&d.skip.nodeType&&(e=d.skip);let h,p=this.needsBlock;if(YM.hasOwnProperty(a))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),h=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let g=d&&d.skip?n:this.readStyles(e,n);g&&this.addAll(e,g),h&&this.sync(l),this.needsBlock=p}else{let h=this.readStyles(e,n);h&&this.addElementByRule(e,d,h,d.consuming===!1?c:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
58
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let l=this.parser.matchedStyles[o],a=r.getPropertyValue(l);if(a)for(let c=void 0;;){let d=this.parser.matchStyle(l,a,this,c);if(!d)break;if(d.ignore)return null;if(d.clearMark?n=n.filter(h=>!d.clearMark(h)):n=n.concat(this.parser.schema.marks[d.mark].create(d.attrs)),d.consuming===!1)c=d;else break}}return n}addElementByRule(e,n,r,o){let l,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let d=this.enter(a,n.attrs||null,r,n.preserveWhitespace);d&&(l=!0,r=d)}else{let d=this.parser.schema.marks[n.mark];r=r.concat(d.create(n.attrs))}let c=this.top;if(a&&a.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(d=>this.insertNode(d,r,!1));else{let d=e;typeof n.contentElement=="string"?d=e.querySelector(n.contentElement):typeof n.contentElement=="function"?d=n.contentElement(e):n.contentElement&&(d=n.contentElement),this.findAround(e,d,!0),this.addAll(d,r),this.findAround(e,d,!1)}l&&this.sync(c)&&this.open--}addAll(e,n,r,o){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,c=o==null?null:e.childNodes[o];a!=c;a=a.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(a,n);this.findAtPoint(e,l)}findPlace(e,n,r){let o,l;for(let a=this.open,c=0;a>=0;a--){let d=this.nodes[a],h=d.findWrapping(e);if(h&&(!o||o.length>h.length+c)&&(o=h,l=d,!h.length))break;if(d.solid){if(r)break;c+=2}}if(!o)return null;this.sync(l);for(let a=0;a<o.length;a++)n=this.enterInner(o[a],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let l=this.textblockFromContext();l&&(n=this.enterInner(l,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let l=this.top;l.match&&(l.match=l.match.matchType(e.type));let a=et.none;for(let c of o.concat(e.marks))(l.type?l.type.allowsMarkType(c.type):HS(c.type,e.type))&&(a=c.addToSet(a));return l.content.push(e.mark(a)),!0}return!1}enter(e,n,r,o){let l=this.findPlace(e.create(n),r,!1);return l&&(l=this.enterInner(e,n,r,!0,o)),l}enterInner(e,n,r,o=!1,l){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let c=FS(e,l,a.options);a.options&la&&a.content.length==0&&(c|=la);let d=et.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):HS(h.type,e))?(d=h.addToSet(d),!1):!0),this.nodes.push(new gc(e,n,d,o,null,c)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=va)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),l=-(r?r.depth+1:0)+(o?0:1),a=(c,d)=>{for(;c>=0;c--){let h=n[c];if(h==""){if(c==n.length-1||c==0)continue;for(;d>=l;d--)if(a(c-1,d))return!0;return!1}else{let p=d>0||d==0&&o?this.nodes[d].type:r&&d>=l?r.node(d-l).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;d--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function II(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&XM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function LI(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function $S(t){let e={};for(let n in t)e[n]=t[n];return e}function HS(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let l=[],a=c=>{l.push(c);for(let d=0;d<c.edgeCount;d++){let{type:h,next:p}=c.edge(d);if(h==e||l.indexOf(p)<0&&a(p))return!0}};if(a(o.contentMatch))return!0}}class $o{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=xp(n).createDocumentFragment());let o=r,l=[];return e.forEach(a=>{if(l.length||a.marks.length){let c=0,d=0;for(;c<l.length&&d<a.marks.length;){let h=a.marks[d];if(!this.marks[h.type.name]){d++;continue}if(!h.eq(l[c][0])||h.type.spec.spanning===!1)break;c++,d++}for(;c<l.length;)o=l.pop()[1];for(;d<a.marks.length;){let h=a.marks[d++],p=this.serializeMark(h,a.isInline,n);p&&(l.push([h,o]),o.appendChild(p.dom),o=p.contentDOM||p.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Ac(xp(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let l=this.serializeMark(e.marks[o],e.isInline,n);l&&((l.contentDOM||l.dom).appendChild(r),r=l.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ac(xp(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Ac(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new $o(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=US(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return US(e.marks)}}function US(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function xp(t){return t.document||window.document}const GS=new WeakMap;function BI(t){let e=GS.get(t);return e===void 0&&GS.set(t,e=VI(t)),e}function VI(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ac(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],l;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(l=BI(r))&&l.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let c,d=n?t.createElementNS(n,o):t.createElement(o),h=e[1],p=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){p=2;for(let g in h)if(h[g]!=null){let v=g.indexOf(" ");v>0?d.setAttributeNS(g.slice(0,v),g.slice(v+1),h[g]):g=="style"&&d.style?d.style.cssText=h[g]:d.setAttribute(g,h[g])}}for(let g=p;g<e.length;g++){let v=e[g];if(v===0){if(g<e.length-1||g>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}else{let{dom:b,contentDOM:S}=Ac(t,v,n,r);if(d.appendChild(b),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:d,contentDOM:c}}const JM=65535,QM=Math.pow(2,16);function FI(t,e){return t+e*QM}function qS(t){return t&JM}function PI(t){return(t-(t&JM))/QM}const ZM=1,WM=2,Oc=4,eE=8;class ym{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&eE)>0}get deletedBefore(){return(this.delInfo&(ZM|Oc))>0}get deletedAfter(){return(this.delInfo&(WM|Oc))>0}get deletedAcross(){return(this.delInfo&Oc)>0}}class Rn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Rn.empty)return Rn.empty}recover(e){let n=0,r=qS(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+PI(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,l=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?o:0);if(d>e)break;let h=this.ranges[c+l],p=this.ranges[c+a],g=d+h;if(e<=g){let v=h?e==d?-1:e==g?1:n:n,b=d+o+(v<0?0:p);if(r)return b;let S=e==(n<0?d:g)?null:FI(c/3,e-d),x=e==d?WM:e==g?ZM:Oc;return(n<0?e!=d:e!=g)&&(x|=eE),new ym(b,x,S)}o+=p-h}return r?e+o:new ym(e+o,0,null)}touches(e,n){let r=0,o=qS(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?r:0);if(d>e)break;let h=this.ranges[c+l],p=d+h;if(e<=p&&c==o*3)return!0;r+=this.ranges[c+a]-h}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,l=0;o<this.ranges.length;o+=3){let a=this.ranges[o],c=a-(this.inverted?l:0),d=a+(this.inverted?0:l),h=this.ranges[o+n],p=this.ranges[o+r];e(c,c+h,d,d+p),l+=p-h}}invert(){return new Rn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Rn.empty:new Rn(e<0?[0,-e,0]:[0,0,e])}}Rn.empty=new Rn([]);class ba{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ba(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new ba;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let l=this.from;l<this.to;l++){let a=this._maps[l],c=a.mapResult(e,n);if(c.recover!=null){let d=this.getMirror(l);if(d!=null&&d>l&&d<this.to){l=d,e=this._maps[d].recover(c.recover);continue}}o|=c.delInfo,e=c.pos}return r?e:new ym(e,o,null)}}const wp=Object.create(null);class Xt{getMap(){return Rn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=wp[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in wp)throw new RangeError("Duplicate use of step JSON ID "+e);return wp[e]=n,n.prototype.jsonID=e,n}}class bt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new bt(e,null)}static fail(e){return new bt(null,e)}static fromReplace(e,n,r,o){try{return bt.ok(e.replace(n,r,o))}catch(l){if(l instanceof $c)return bt.fail(l.message);throw l}}}function ag(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let l=t.child(o);l.content.size&&(l=l.copy(ag(l.content,e,l))),l.isInline&&(l=e(l,n,o)),r.push(l)}return te.fromArray(r)}class _i extends Xt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),l=new ae(ag(n.content,(a,c)=>!a.isAtom||!c.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return bt.fromReplace(e,this.from,this.to,l)}invert(){return new Zn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new _i(n.pos,r.pos,this.mark)}merge(e){return e instanceof _i&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _i(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _i(n.from,n.to,e.markFromJSON(n.mark))}}Xt.jsonID("addMark",_i);class Zn extends Xt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ae(ag(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return bt.fromReplace(e,this.from,this.to,r)}invert(){return new _i(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Zn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Zn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Zn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Zn(n.from,n.to,e.markFromJSON(n.mark))}}Xt.jsonID("removeMark",Zn);class zi extends Xt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return bt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return bt.fromReplace(e,this.pos,this.pos+1,new ae(te.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new zi(this.pos,n.marks[o]);return new zi(this.pos,this.mark)}}return new Lo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new zi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new zi(n.pos,e.markFromJSON(n.mark))}}Xt.jsonID("addNodeMark",zi);class Lo extends Xt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return bt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return bt.fromReplace(e,this.pos,this.pos+1,new ae(te.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new zi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Lo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Lo(n.pos,e.markFromJSON(n.mark))}}Xt.jsonID("removeNodeMark",Lo);class At extends Xt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&vm(e,this.from,this.to)?bt.fail("Structure replace would overwrite content"):bt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Rn([this.from,this.to-this.from,this.slice.size])}invert(e){return new At(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new At(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof At)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ae.empty:new ae(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new At(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ae.empty:new ae(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new At(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new At(n.from,n.to,ae.fromJSON(e,n.slice),!!n.structure)}}Xt.jsonID("replace",At);class Ot extends Xt{constructor(e,n,r,o,l,a,c=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=l,this.insert=a,this.structure=c}apply(e){if(this.structure&&(vm(e,this.from,this.gapFrom)||vm(e,this.gapTo,this.to)))return bt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return bt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?bt.fromReplace(e,this.from,this.to,r):bt.fail("Content does not fit in gap")}getMap(){return new Rn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ot(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),l=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||l>r.pos?null:new Ot(n.pos,r.pos,o,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ot(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(e,n.slice),n.insert,!!n.structure)}}Xt.jsonID("replaceAround",Ot);function vm(t,e,n){let r=t.resolve(e),o=n-e,l=r.depth;for(;o>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,o--;if(o>0){let a=r.node(l).maybeChild(r.indexAfter(l));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function $I(t,e,n,r){let o=[],l=[],a,c;t.doc.nodesBetween(e,n,(d,h,p)=>{if(!d.isInline)return;let g=d.marks;if(!r.isInSet(g)&&p.type.allowsMarkType(r.type)){let v=Math.max(h,e),b=Math.min(h+d.nodeSize,n),S=r.addToSet(g);for(let x=0;x<g.length;x++)g[x].isInSet(S)||(a&&a.to==v&&a.mark.eq(g[x])?a.to=b:o.push(a=new Zn(v,b,g[x])));c&&c.to==v?c.to=b:l.push(c=new _i(v,b,r))}}),o.forEach(d=>t.step(d)),l.forEach(d=>t.step(d))}function HI(t,e,n,r){let o=[],l=0;t.doc.nodesBetween(e,n,(a,c)=>{if(!a.isInline)return;l++;let d=null;if(r instanceof Cf){let h=a.marks,p;for(;p=r.isInSet(h);)(d||(d=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(d=[r]):d=a.marks;if(d&&d.length){let h=Math.min(c+a.nodeSize,n);for(let p=0;p<d.length;p++){let g=d[p],v;for(let b=0;b<o.length;b++){let S=o[b];S.step==l-1&&g.eq(o[b].style)&&(v=S)}v?(v.to=h,v.step=l):o.push({style:g,from:Math.max(c,e),to:h,step:l})}}}),o.forEach(a=>t.step(new Zn(a.from,a.to,a.style)))}function ug(t,e,n,r=n.contentMatch,o=!0){let l=t.doc.nodeAt(e),a=[],c=e+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,g=r.matchType(h.type);if(!g)a.push(new At(c,p,ae.empty));else{r=g;for(let v=0;v<h.marks.length;v++)n.allowsMarkType(h.marks[v].type)||t.step(new Zn(c,p,h.marks[v]));if(o&&h.isText&&n.whitespace!="pre"){let v,b=/\r?\n|\r/g,S;for(;v=b.exec(h.text);)S||(S=new ae(te.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new At(c+v.index,c+v.index+v[0].length,S))}}c=p}if(!r.validEnd){let d=r.fillBefore(te.empty,!0);t.replace(c,c,new ae(d,0,0))}for(let d=a.length-1;d>=0;d--)t.step(a[d])}function UI(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function el(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,l=0;;--r){let a=t.$from.node(r),c=t.$from.index(r)+o,d=t.$to.indexAfter(r)-l;if(r<t.depth&&a.canReplace(c,d,n))return r;if(r==0||a.type.spec.isolating||!UI(a,c,d))break;c&&(o=1),d<a.childCount&&(l=1)}return null}function GI(t,e,n){let{$from:r,$to:o,depth:l}=e,a=r.before(l+1),c=o.after(l+1),d=a,h=c,p=te.empty,g=0;for(let S=l,x=!1;S>n;S--)x||r.index(S)>0?(x=!0,p=te.from(r.node(S).copy(p)),g++):d--;let v=te.empty,b=0;for(let S=l,x=!1;S>n;S--)x||o.after(S+1)<o.end(S)?(x=!0,v=te.from(o.node(S).copy(v)),b++):h++;t.step(new Ot(d,h,a,c,new ae(p.append(v),g,b),p.size-g,!0))}function tE(t,e,n=null,r=t){let o=qI(t,e),l=o&&KI(r,e);return l?o.map(KS).concat({type:e,attrs:n}).concat(l.map(KS)):null}function KS(t){return{type:t,attrs:null}}function qI(t,e){let{parent:n,startIndex:r,endIndex:o}=t,l=n.contentMatchAt(r).findWrapping(e);if(!l)return null;let a=l.length?l[0]:e;return n.canReplaceWith(r,o,a)?l:null}function KI(t,e){let{parent:n,startIndex:r,endIndex:o}=t,l=n.child(r),a=e.contentMatch.findWrapping(l.type);if(!a)return null;let d=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;d&&h<o;h++)d=d.matchType(n.child(h).type);return!d||!d.validEnd?null:a}function YI(t,e,n){let r=te.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let c=n[a].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=te.from(n[a].type.create(n[a].attrs,r))}let o=e.start,l=e.end;t.step(new Ot(o,l,o,l,new ae(r,0,0),n.length,!0))}function XI(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(e,n,(a,c)=>{let d=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,d)&&JI(t.doc,t.mapping.slice(l).map(c),r)){let h=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!S?h=!1:!b&&S&&(h=!0)}h===!1&&rE(t,a,c,l),ug(t,t.mapping.slice(l).map(c,1),r,void 0,h===null);let p=t.mapping.slice(l),g=p.map(c,1),v=p.map(c+a.nodeSize,1);return t.step(new Ot(g,v,g+1,v-1,new ae(te.from(r.create(d,null,a.marks)),0,0),1,!0)),h===!0&&nE(t,a,c,l),!1}})}function nE(t,e,n,r){e.forEach((o,l)=>{if(o.isText){let a,c=/\r?\n|\r/g;for(;a=c.exec(o.text);){let d=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(d,d+1,e.type.schema.linebreakReplacement.create())}}})}function rE(t,e,n,r){e.forEach((o,l)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+l);t.replaceWith(a,a+1,e.type.schema.text(`
|
|
59
|
+
`))}})}function JI(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function QI(t,e,n,r,o){let l=t.doc.nodeAt(e);if(!l)throw new RangeError("No node at given position");n||(n=l.type);let a=n.create(r,null,o||l.marks);if(l.isLeaf)return t.replaceWith(e,e+l.nodeSize,a);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ot(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new ae(te.from(a),0,0),1,!0))}function qr(t,e,n=1,r){let o=t.resolve(e),l=o.depth-n,a=r&&r[r.length-1]||o.parent;if(l<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let h=o.depth-1,p=n-2;h>l;h--,p--){let g=o.node(h),v=o.index(h);if(g.type.spec.isolating)return!1;let b=g.content.cutByIndex(v,g.childCount),S=r&&r[p+1];S&&(b=b.replaceChild(0,S.type.create(S.attrs)));let x=r&&r[p]||g;if(!g.canReplace(v+1,g.childCount)||!x.type.validContent(b))return!1}let c=o.indexAfter(l),d=r&&r[0];return o.node(l).canReplaceWith(c,c,d?d.type:o.node(l+1).type)}function ZI(t,e,n=1,r){let o=t.doc.resolve(e),l=te.empty,a=te.empty;for(let c=o.depth,d=o.depth-n,h=n-1;c>d;c--,h--){l=te.from(o.node(c).copy(l));let p=r&&r[h];a=te.from(p?p.type.create(p.attrs,a):o.node(c).copy(a))}t.step(new At(e,e,new ae(l.append(a),n,n),!0))}function Ho(t,e){let n=t.resolve(e),r=n.index();return iE(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function WI(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let l=e.child(o),a=l.type==r?t.type.schema.nodes.text:l.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(l.marks))return!1}return n.validEnd}function iE(t,e){return!!(t&&e&&!t.isLeaf&&WI(t,e))}function Mf(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let l,a,c=r.index(o);if(o==r.depth?(l=r.nodeBefore,a=r.nodeAfter):n>0?(l=r.node(o+1),c++,a=r.node(o).maybeChild(c)):(l=r.node(o).maybeChild(c-1),a=r.node(o+1)),l&&!l.isTextblock&&iE(l,a)&&r.node(o).canReplace(c,c+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function eL(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,l=t.doc.resolve(e-n),a=l.node().type;if(o&&a.inlineContent){let p=a.whitespace=="pre",g=!!a.contentMatch.matchType(o);p&&!g?r=!1:!p&&g&&(r=!0)}let c=t.steps.length;if(r===!1){let p=t.doc.resolve(e+n);rE(t,p.node(),p.before(),c)}a.inlineContent&&ug(t,e+n-1,a,l.node().contentMatchAt(l.index()),r==null);let d=t.mapping.slice(c),h=d.map(e-n);if(t.step(new At(h,d.map(e+n,-1),ae.empty,!0)),r===!0){let p=t.doc.resolve(h);nE(t,p.node(),p.before(),t.steps.length)}return t}function tL(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let l=r.index(o);if(r.node(o).canReplaceWith(l,l,n))return r.before(o+1);if(l>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let l=r.indexAfter(o);if(r.node(o).canReplaceWith(l,l,n))return r.after(o+1);if(l<r.node(o).childCount)return null}return null}function oE(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let l=0;l<n.openStart;l++)o=o.firstChild.content;for(let l=1;l<=(n.openStart==0&&n.size?2:1);l++)for(let a=r.depth;a>=0;a--){let c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,d=r.index(a)+(c>0?1:0),h=r.node(a),p=!1;if(l==1)p=h.canReplace(d,d,o);else{let g=h.contentMatchAt(d).findWrapping(o.firstChild.type);p=g&&h.canReplaceWith(d,d,g[0])}if(p)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function Ef(t,e,n=e,r=ae.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),l=t.resolve(n);return sE(o,l,r)?new At(e,n,r):new nL(o,l,r).fit()}function sE(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class nL{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=te.empty;for(let o=0;o<=e.depth;o++){let l=e.node(o);this.frontier.push({type:l.type,match:l.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=te.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let l=this.placed,a=r.depth,c=o.depth;for(;a&&c&&l.childCount==1;)l=l.firstChild.content,a--,c--;let d=new ae(l,a,c);return e>-1?new Ot(r.pos,e,this.$to.pos,this.$to.end(),d,n):d.size||r.pos!=this.$to.pos?new At(r.pos,o.pos,d):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let l=n.firstChild;if(n.childCount>1&&(o=0),l.type.spec.isolating&&o<=r){e=r;break}n=l.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,l=null;r?(l=Cp(this.unplaced.content,r-1).firstChild,o=l.content):o=this.unplaced.content;let a=o.firstChild;for(let c=this.depth;c>=0;c--){let{type:d,match:h}=this.frontier[c],p,g=null;if(n==1&&(a?h.matchType(a.type)||(g=h.fillBefore(te.from(a),!1)):l&&d.compatibleContent(l.type)))return{sliceDepth:r,frontierDepth:c,parent:l,inject:g};if(n==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:c,parent:l,wrap:p};if(l&&h.matchType(l.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Cp(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ae(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Cp(e,n);if(o.childCount<=1&&n>0){let l=e.size-n<=n+o.size;this.unplaced=new ae(ta(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new ae(ta(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:l}){for(;this.depth>n;)this.closeFrontierNode();if(l)for(let x=0;x<l.length;x++)this.openFrontierNode(l[x]);let a=this.unplaced,c=r?r.content:a.content,d=a.openStart-e,h=0,p=[],{match:g,type:v}=this.frontier[n];if(o){for(let x=0;x<o.childCount;x++)p.push(o.child(x));g=g.matchFragment(o)}let b=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let x=c.child(h),C=g.matchType(x.type);if(!C)break;h++,(h>1||d==0||x.content.size)&&(g=C,p.push(lE(x.mark(v.allowedMarks(x.marks)),h==1?d:0,h==c.childCount?b:-1)))}let S=h==c.childCount;S||(b=-1),this.placed=na(this.placed,n,te.from(p)),this.frontier[n].match=g,S&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,C=c;x<b;x++){let E=C.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),C=E.content}this.unplaced=S?e==0?ae.empty:new ae(ta(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new ae(ta(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Mp(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],l=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=Mp(e,n,o,r,l);if(a){for(let c=n-1;c>=0;c--){let{match:d,type:h}=this.frontier[c],p=Mp(e,c,h,d,!0);if(!p||p.childCount)continue e}return{depth:n,fit:a,move:l?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=na(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),l=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,l)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=na(this.placed,this.depth,te.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(te.empty,!0);n.childCount&&(this.placed=na(this.placed,this.frontier.length,n))}}function ta(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ta(t.firstChild.content,e-1,n)))}function na(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(na(t.lastChild.content,e-1,n)))}function Cp(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function lE(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,lE(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(te.empty,!0)))),t.copy(r)}function Mp(t,e,n,r,o){let l=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==l.childCount&&!n.compatibleContent(l.type))return null;let c=r.fillBefore(l.content,!0,a);return c&&!rL(n,l.content,a)?c:null}function rL(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function iL(t){return t.spec.defining||t.spec.definingForContent}function oL(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),l=t.doc.resolve(n);if(sE(o,l,r))return t.step(new At(e,n,r));let a=uE(o,l);a[a.length-1]==0&&a.pop();let c=-(o.depth+1);a.unshift(c);for(let v=o.depth,b=o.pos-1;v>0;v--,b--){let S=o.node(v).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(v)>-1?c=v:o.before(v)==b&&a.splice(1,0,-v)}let d=a.indexOf(c),h=[],p=r.openStart;for(let v=r.content,b=0;;b++){let S=v.firstChild;if(h.push(S),b==r.openStart)break;v=S.content}for(let v=p-1;v>=0;v--){let b=h[v],S=iL(b.type);if(S&&!b.sameMarkup(o.node(Math.abs(c)-1)))p=v;else if(S||!b.type.isTextblock)break}for(let v=r.openStart;v>=0;v--){let b=(v+p+1)%(r.openStart+1),S=h[b];if(S)for(let x=0;x<a.length;x++){let C=a[(x+d)%a.length],E=!0;C<0&&(E=!1,C=-C);let A=o.node(C-1),O=o.index(C-1);if(A.canReplaceWith(O,O,S.type,S.marks))return t.replace(o.before(C),E?l.after(C):n,new ae(aE(r.content,0,r.openStart,b),b,r.openEnd))}}let g=t.steps.length;for(let v=a.length-1;v>=0&&(t.replace(e,n,r),!(t.steps.length>g));v--){let b=a[v];b<0||(e=o.before(b),n=l.after(b))}}function aE(t,e,n,r,o){if(e<n){let l=t.firstChild;t=t.replaceChild(0,l.copy(aE(l.content,e+1,n,r,l)))}if(e>r){let l=o.contentMatchAt(0),a=l.fillBefore(t).append(t);t=a.append(l.matchFragment(a).fillBefore(te.empty,!0))}return t}function sL(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=tL(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ae(te.from(r),0,0))}function lL(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),l=uE(r,o);for(let a=0;a<l.length;a++){let c=l[a],d=a==l.length-1;if(d&&c==0||r.node(c).type.contentMatch.validEnd)return t.delete(r.start(c),o.end(c));if(c>0&&(d||r.node(c-1).canReplace(r.index(c-1),o.indexAfter(c-1))))return t.delete(r.before(c),o.after(c))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function uE(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let l=t.start(o);if(l<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(l==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==l-1)&&n.push(o)}return n}class $s extends Xt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return bt.fail("No node at attribute step's position");let r=Object.create(null);for(let l in n.attrs)r[l]=n.attrs[l];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return bt.fromReplace(e,this.pos,this.pos+1,new ae(te.from(o),0,n.isLeaf?0:1))}getMap(){return Rn.empty}invert(e){return new $s(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $s(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $s(n.pos,n.attr,n.value)}}Xt.jsonID("attr",$s);class Sa extends Xt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return bt.ok(r)}getMap(){return Rn.empty}invert(e){return new Sa(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Sa(n.attr,n.value)}}Xt.jsonID("docAttr",Sa);let Gs=class extends Error{};Gs=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Gs.prototype=Object.create(Error.prototype);Gs.prototype.constructor=Gs;Gs.prototype.name="TransformError";class cE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ba}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Gs(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),n=o.map(n,-1)),o.forEach((l,a,c,d)=>{e=Math.min(e,c),n=Math.max(n,d)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ae.empty){let o=Ef(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ae(te.from(r),0,0))}delete(e,n){return this.replace(e,n,ae.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return oL(this,e,n,r),this}replaceRangeWith(e,n,r){return sL(this,e,n,r),this}deleteRange(e,n){return lL(this,e,n),this}lift(e,n){return GI(this,e,n),this}join(e,n=1){return eL(this,e,n),this}wrap(e,n){return YI(this,e,n),this}setBlockType(e,n=e,r,o=null){return XI(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return QI(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new $s(e,n,r)),this}setDocAttribute(e,n){return this.step(new Sa(e,n)),this}addNodeMark(e,n){return this.step(new zi(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof et)n.isInSet(r.marks)&&this.step(new Lo(e,n));else{let o=r.marks,l,a=[];for(;l=n.isInSet(o);)a.push(new Lo(e,l)),o=l.removeFromSet(o);for(let c=a.length-1;c>=0;c--)this.step(a[c])}return this}split(e,n=1,r){return ZI(this,e,n,r),this}addMark(e,n,r){return $I(this,e,n,r),this}removeMark(e,n,r){return HI(this,e,n,r),this}clearIncompatible(e,n,r){return ug(this,e,n,r),this}}const Ep=Object.create(null);class ze{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new aL(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ae.empty){let r=n.content.lastChild,o=null;for(let c=0;c<n.openEnd;c++)o=r,r=r.lastChild;let l=e.steps.length,a=this.ranges;for(let c=0;c<a.length;c++){let{$from:d,$to:h}=a[c],p=e.mapping.slice(l);e.replaceRange(p.map(d.pos),p.map(h.pos),c?ae.empty:n),c==0&&JS(e,l,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],d=e.mapping.slice(r),h=d.map(a.pos),p=d.map(c.pos);l?e.deleteRange(h,p):(e.replaceRangeWith(h,p,n),JS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Ae(e):zs(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let l=e.depth-1;l>=0;l--){let a=n<0?zs(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):zs(e.node(0),e.node(l),e.after(l+1),e.index(l)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new An(e.node(0))}static atStart(e){return zs(e,e,0,0,1)||new An(e)}static atEnd(e){return zs(e,e,e.content.size,e.childCount,-1)||new An(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ep[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ep)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ep[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ae.between(this.$anchor,this.$head).getBookmark()}}ze.prototype.visible=!0;class aL{constructor(e,n){this.$from=e,this.$to=n}}let YS=!1;function XS(t){!YS&&!t.parent.inlineContent&&(YS=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ae extends ze{constructor(e,n=e){XS(e),XS(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ze.near(r);let o=e.resolve(n.map(this.anchor));return new Ae(o.parent.inlineContent?o:r,r)}replace(e,n=ae.empty){if(super.replace(e,n),n==ae.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ae&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Rf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ae(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let l=ze.findFrom(n,r,!0)||ze.findFrom(n,-r,!0);if(l)n=l.$head;else return ze.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(ze.findFrom(e,-r,!0)||ze.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Ae(e,n)}}ze.jsonID("text",Ae);class Rf{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Rf(e.map(this.anchor),e.map(this.head))}resolve(e){return Ae.between(e.resolve(this.anchor),e.resolve(this.head))}}class we extends ze{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),l=e.resolve(o);return r?ze.near(l):new we(l)}content(){return new ae(te.from(this.node),0,0)}eq(e){return e instanceof we&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new cg(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new we(e.resolve(n.anchor))}static create(e,n){return new we(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}we.prototype.visible=!1;ze.jsonID("node",we);class cg{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Rf(r,r):new cg(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&we.isSelectable(r)?new we(n):ze.near(n)}}class An extends ze{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ae.empty){if(n==ae.empty){e.delete(0,e.doc.content.size);let r=ze.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new An(e)}map(e){return new An(e)}eq(e){return e instanceof An}getBookmark(){return uL}}ze.jsonID("all",An);const uL={map(){return this},resolve(t){return new An(t)}};function zs(t,e,n,r,o,l=!1){if(e.inlineContent)return Ae.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let c=e.child(a);if(c.isAtom){if(!l&&we.isSelectable(c))return we.create(t,n-(o<0?c.nodeSize:0))}else{let d=zs(t,c,n+o,o<0?c.childCount:0,o,l);if(d)return d}n+=c.nodeSize*o}return null}function JS(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof At||o instanceof Ot))return;let l=t.mapping.maps[r],a;l.forEach((c,d,h,p)=>{a==null&&(a=p)}),t.setSelection(ze.near(t.doc.resolve(a),n))}const QS=1,yc=2,ZS=4;class cL extends cE{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|QS)&~yc,this.storedMarks=null,this}get selectionSet(){return(this.updated&QS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=yc,this}ensureMarks(e){return et.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&yc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~yc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||et.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let l=this.storedMarks;if(!l){let a=this.doc.resolve(n);l=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,l)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ze.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ZS,this}get scrolledIntoView(){return(this.updated&ZS)>0}}function WS(t,e){return!e||!t?t:t.bind(e)}class ra{constructor(e,n,r){this.name=e,this.init=WS(n.init,r),this.apply=WS(n.apply,r)}}const fL=[new ra("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ra("selection",{init(t,e){return t.selection||ze.atStart(e.doc)},apply(t){return t.selection}}),new ra("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ra("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Rp{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fL.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ra(r.key,r.spec.state,r))})}}class Ls{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let l=!1;for(let a=0;a<this.config.plugins.length;a++){let c=this.config.plugins[a];if(c.spec.appendTransaction){let d=o?o[a].n:0,h=o?o[a].state:this,p=d<n.length&&c.spec.appendTransaction.call(c,d?n.slice(d):n,h,r);if(p&&r.filterTransaction(p,a)){if(p.setMeta("appendedTransaction",e),!o){o=[];for(let g=0;g<this.config.plugins.length;g++)o.push(g<a?{state:r,n:n.length}:{state:this,n:0})}n.push(p),r=r.applyInner(p),l=!0}o&&(o[a]={state:r,n:n.length})}}if(!l)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ls(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let l=r[o];n[l.name]=l.apply(e,this[l.name],this,n)}return n}get tr(){return new cL(this)}static create(e){let n=new Rp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ls(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Rp(this.schema,e.plugins),r=n.fields,o=new Ls(n);for(let l=0;l<r.length;l++){let a=r[l].name;o[a]=this.hasOwnProperty(a)?this[a]:r[l].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],l=o.spec.state;l&&l.toJSON&&(n[r]=l.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Rp(e.schema,e.plugins),l=new Ls(o);return o.fields.forEach(a=>{if(a.name=="doc")l.doc=Ii.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=ze.fromJSON(l.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(l.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let c in r){let d=r[c],h=d.spec.state;if(d.key==a.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(n,c)){l[a.name]=h.fromJSON.call(d,e,n[c],l);return}}l[a.name]=a.init(e,l)}}),l}}function fE(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=fE(o,e,{})),n[r]=o}return n}class St{constructor(e){this.spec=e,this.props={},e.props&&fE(e.props,this,this.props),this.key=e.key?e.key.key:dE("plugin")}getState(e){return e[this.key]}}const Tp=Object.create(null);function dE(t){return t in Tp?t+"$"+ ++Tp[t]:(Tp[t]=0,t+"$")}class Jt{constructor(e="key"){this.key=dE(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const fg=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function hE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const pE=(t,e,n)=>{let r=hE(t,n);if(!r)return!1;let o=dg(r);if(!o){let a=r.blockRange(),c=a&&el(a);return c==null?!1:(e&&e(t.tr.lift(a,c).scrollIntoView()),!0)}let l=o.nodeBefore;if(CE(t,o,e,-1))return!0;if(r.parent.content.size==0&&(qs(l,"end")||we.isSelectable(l)))for(let a=r.depth;;a--){let c=Ef(t.doc,r.before(a),r.after(a),ae.empty);if(c&&c.slice.size<c.to-c.from){if(e){let d=t.tr.step(c);d.setSelection(qs(l,"end")?ze.findFrom(d.doc.resolve(d.mapping.map(o.pos,-1)),-1):we.create(d.doc,o.pos-l.nodeSize)),e(d.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return l.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-l.nodeSize,o.pos).scrollIntoView()),!0):!1},dL=(t,e,n)=>{let r=hE(t,n);if(!r)return!1;let o=dg(r);return o?mE(t,o,e):!1},hL=(t,e,n)=>{let r=yE(t,n);if(!r)return!1;let o=hg(r);return o?mE(t,o,e):!1};function mE(t,e,n){let r=e.nodeBefore,o=r,l=e.pos-1;for(;!o.isTextblock;l--){if(o.type.spec.isolating)return!1;let p=o.lastChild;if(!p)return!1;o=p}let a=e.nodeAfter,c=a,d=e.pos+1;for(;!c.isTextblock;d++){if(c.type.spec.isolating)return!1;let p=c.firstChild;if(!p)return!1;c=p}let h=Ef(t.doc,l,d,ae.empty);if(!h||h.from!=l||h instanceof At&&h.slice.size>=d-l)return!1;if(n){let p=t.tr.step(h);p.setSelection(Ae.create(p.doc,l)),n(p.scrollIntoView())}return!0}function qs(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const gE=(t,e,n)=>{let{$head:r,empty:o}=t.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;l=dg(r)}let a=l&&l.nodeBefore;return!a||!we.isSelectable(a)?!1:(e&&e(t.tr.setSelection(we.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)};function dg(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function yE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const vE=(t,e,n)=>{let r=yE(t,n);if(!r)return!1;let o=hg(r);if(!o)return!1;let l=o.nodeAfter;if(CE(t,o,e,1))return!0;if(r.parent.content.size==0&&(qs(l,"start")||we.isSelectable(l))){let a=Ef(t.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(qs(l,"start")?ze.findFrom(c.doc.resolve(c.mapping.map(o.pos)),1):we.create(c.doc,c.mapping.map(o.pos))),e(c.scrollIntoView())}return!0}}return l.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+l.nodeSize).scrollIntoView()),!0):!1},bE=(t,e,n)=>{let{$head:r,empty:o}=t.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;l=hg(r)}let a=l&&l.nodeAfter;return!a||!we.isSelectable(a)?!1:(e&&e(t.tr.setSelection(we.create(t.doc,l.pos)).scrollIntoView()),!0)};function hg(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const pL=(t,e)=>{let n=t.selection,r=n instanceof we,o;if(r){if(n.node.isTextblock||!Ho(t.doc,n.from))return!1;o=n.from}else if(o=Mf(t.doc,n.from,-1),o==null)return!1;if(e){let l=t.tr.join(o);r&&l.setSelection(we.create(l.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},mL=(t,e)=>{let n=t.selection,r;if(n instanceof we){if(n.node.isTextblock||!Ho(t.doc,n.to))return!1;r=n.to}else if(r=Mf(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},gL=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),l=o&&el(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)},SE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
60
|
+
`).scrollIntoView()),!0)};function pg(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const yL=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),l=n.indexAfter(-1),a=pg(o.contentMatchAt(l));if(!a||!o.canReplaceWith(l,l,a))return!1;if(e){let c=n.after(),d=t.tr.replaceWith(c,c,a.createAndFill());d.setSelection(ze.near(d.doc.resolve(c),1)),e(d.scrollIntoView())}return!0},xE=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof An||r.parent.inlineContent||o.parent.inlineContent)return!1;let l=pg(o.parent.contentMatchAt(o.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,c=t.tr.insert(a,l.createAndFill());c.setSelection(Ae.create(c.doc,a+1)),e(c.scrollIntoView())}return!0},wE=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(qr(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),o=r&&el(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function vL(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof we&&e.selection.node.isBlock)return!r.parentOffset||!qr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,c,d=!1,h=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){d=r.end(b)==r.pos+(r.depth-b),h=r.start(b)==r.pos-(r.depth-b),c=pg(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),l.unshift(d&&c?{type:c}:null),a=b;break}else{if(b==1)return!1;l.unshift(null)}let p=e.tr;(e.selection instanceof Ae||e.selection instanceof An)&&p.deleteSelection();let g=p.mapping.map(r.pos),v=qr(p.doc,g,l.length,l);if(v||(l[0]=c?{type:c}:null,v=qr(p.doc,g,l.length,l)),!v)return!1;if(p.split(g,l.length,l),!d&&h&&r.node(a).type!=c){let b=p.mapping.map(r.before(a)),S=p.doc.resolve(b);c&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,c)&&p.setNodeMarkup(p.mapping.map(r.before(a)),c)}return n&&n(p.scrollIntoView()),!0}}const bL=vL(),SL=(t,e)=>{let{$from:n,to:r}=t.selection,o,l=n.sharedDepth(r);return l==0?!1:(o=n.before(l),e&&e(t.tr.setSelection(we.create(t.doc,o))),!0)};function xL(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,l=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(o.isTextblock||Ho(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function CE(t,e,n,r){let o=e.nodeBefore,l=e.nodeAfter,a,c,d=o.type.spec.isolating||l.type.spec.isolating;if(!d&&xL(t,e,n))return!0;let h=!d&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(c=o.contentMatchAt(o.childCount)).findWrapping(l.type))&&c.matchType(a[0]||l.type).validEnd){if(n){let b=e.pos+l.nodeSize,S=te.empty;for(let E=a.length-1;E>=0;E--)S=te.from(a[E].create(null,S));S=te.from(o.copy(S));let x=t.tr.step(new Ot(e.pos-1,b,e.pos,b,new ae(S,1,0),a.length,!0)),C=x.doc.resolve(b+2*a.length);C.nodeAfter&&C.nodeAfter.type==o.type&&Ho(x.doc,C.pos)&&x.join(C.pos),n(x.scrollIntoView())}return!0}let p=l.type.spec.isolating||r>0&&d?null:ze.findFrom(e,1),g=p&&p.$from.blockRange(p.$to),v=g&&el(g);if(v!=null&&v>=e.depth)return n&&n(t.tr.lift(g,v).scrollIntoView()),!0;if(h&&qs(l,"start",!0)&&qs(o,"end")){let b=o,S=[];for(;S.push(b),!b.isTextblock;)b=b.lastChild;let x=l,C=1;for(;!x.isTextblock;x=x.firstChild)C++;if(b.canReplace(b.childCount,b.childCount,x.content)){if(n){let E=te.empty;for(let O=S.length-1;O>=0;O--)E=te.from(S[O].copy(E));let A=t.tr.step(new Ot(e.pos-S.length,e.pos+l.nodeSize,e.pos+C,e.pos+l.nodeSize-C,new ae(E,S.length,0),0,!0));n(A.scrollIntoView())}return!0}}return!1}function ME(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,l=o.depth;for(;o.node(l).isInline;){if(!l)return!1;l--}return o.node(l).isTextblock?(n&&n(e.tr.setSelection(Ae.create(e.doc,t<0?o.start(l):o.end(l)))),!0):!1}}const wL=ME(-1),CL=ME(1);function ML(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l),c=a&&tE(a,t,e);return c?(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0):!1}}function ex(t,e=null){return function(n,r){let o=!1;for(let l=0;l<n.selection.ranges.length&&!o;l++){let{$from:{pos:a},$to:{pos:c}}=n.selection.ranges[l];n.doc.nodesBetween(a,c,(d,h)=>{if(o)return!1;if(!(!d.isTextblock||d.hasMarkup(t,e)))if(d.type==t)o=!0;else{let p=n.doc.resolve(h),g=p.index();o=p.parent.canReplaceWith(g,g+1,t)}})}if(!o)return!1;if(r){let l=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:c},$to:{pos:d}}=n.selection.ranges[a];l.setBlockType(c,d,t,e)}r(l.scrollIntoView())}return!0}}function mg(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}mg(fg,pE,gE);mg(fg,vE,bE);mg(SE,xE,wE,bL);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function EL(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l);if(!a)return!1;let c=r?n.tr:null;return RL(c,a,t,e)?(r&&r(c.scrollIntoView()),!0):!1}}function RL(t,e,n,r=null){let o=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let d=a.resolve(e.start-2);l=new Uc(d,d,e.depth),e.endIndex<e.parent.childCount&&(e=new Uc(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let c=tE(l,n,r,e);return c?(t&&TL(t,e,c,o,n),!0):!1}function TL(t,e,n,r,o){let l=te.empty;for(let p=n.length-1;p>=0;p--)l=te.from(n[p].type.create(n[p].attrs,l));t.step(new Ot(e.start-(r?2:0),e.end,e.start,e.end,new ae(l,0,0),n.length,!0));let a=0;for(let p=0;p<n.length;p++)n[p].type==o&&(a=p+1);let c=n.length-a,d=e.start+n.length-(r?2:0),h=e.parent;for(let p=e.startIndex,g=e.endIndex,v=!0;p<g;p++,v=!1)!v&&qr(t.doc,d,c)&&(t.split(d,c),d+=2*c),d+=h.child(p).nodeSize;return t}function AL(t){return function(e,n){let{$from:r,$to:o}=e.selection,l=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return l?n?r.node(l.depth-1).type==t?OL(e,n,t,l):kL(e,n,l):!0:!1}}function OL(t,e,n,r){let o=t.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(o.step(new Ot(l-1,a,l,a,new ae(te.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Uc(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const c=el(r);if(c==null)return!1;o.lift(r,c);let d=o.doc.resolve(o.mapping.map(l,-1)-1);return Ho(o.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&o.join(d.pos),e(o.scrollIntoView()),!0}function kL(t,e,n){let r=t.tr,o=n.parent;for(let b=n.end,S=n.endIndex-1,x=n.startIndex;S>x;S--)b-=o.child(S).nodeSize,r.delete(b-1,b+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=n.startIndex==0,d=n.endIndex==o.childCount,h=l.node(-1),p=l.index(-1);if(!h.canReplace(p+(c?0:1),p+1,a.content.append(d?te.empty:te.from(o))))return!1;let g=l.pos,v=g+a.nodeSize;return r.step(new Ot(g-(c?1:0),v+(d?1:0),g+1,v-1,new ae((c?te.empty:te.from(o.copy(te.empty))).append(d?te.empty:te.from(o.copy(te.empty))),c?0:1,d?0:1),c?0:1)),e(r.scrollIntoView()),!0}function NL(t){return function(e,n){let{$from:r,$to:o}=e.selection,l=r.blockRange(o,h=>h.childCount>0&&h.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(a==0)return!1;let c=l.parent,d=c.child(a-1);if(d.type!=t)return!1;if(n){let h=d.lastChild&&d.lastChild.type==c.type,p=te.from(h?t.create():null),g=new ae(te.from(t.create(null,te.from(c.type.create(null,p)))),h?3:1,0),v=l.start,b=l.end;n(e.tr.step(new Ot(v-(h?3:1),b,v,b,g,1,!0)).scrollIntoView())}return!0}}const Lt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ks=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let bm=null;const Ur=function(t,e,n){let r=bm||(bm=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},DL=function(){bm=null},Bo=function(t,e,n,r){return n&&(tx(t,e,n,r,-1)||tx(t,e,n,r,1))},_L=/^(img|br|input|textarea|hr)$/i;function tx(t,e,n,r,o){for(var l;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Pn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||za(t)||_L.test(t.nodeName)||t.contentEditable=="false")return!1;e=Lt(t)+(o<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((l=a.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)e+=o;else return!1;else t=a,e=o<0?Pn(t):0}else return!1}}function Pn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zL(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Pn(t)}else if(t.parentNode&&!za(t))e=Lt(t),t=t.parentNode;else return null}}function jL(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!za(t))e=Lt(t)+1,t=t.parentNode;else return null}}function IL(t,e,n){for(let r=e==0,o=e==Pn(t);r||o;){if(t==n)return!0;let l=Lt(t);if(t=t.parentNode,!t)return!1;r=r&&l==0,o=o&&l==Pn(t)}}function za(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tf=function(t){return t.focusNode&&Bo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Eo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function LL(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function BL(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Pn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Pn(r.startContainer),r.startOffset)}}}const pr=typeof navigator<"u"?navigator:null,nx=typeof document<"u"?document:null,Yi=pr&&pr.userAgent||"",Sm=/Edge\/(\d+)/.exec(Yi),EE=/MSIE \d/.exec(Yi),xm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yi),hn=!!(EE||xm||Sm),Bi=EE?document.documentMode:xm?+xm[1]:Sm?+Sm[1]:0,Un=!hn&&/gecko\/(\d+)/i.test(Yi);Un&&+(/Firefox\/(\d+)/.exec(Yi)||[0,0])[1];const wm=!hn&&/Chrome\/(\d+)/.exec(Yi),Vt=!!wm,RE=wm?+wm[1]:0,Gt=!hn&&!!pr&&/Apple Computer/.test(pr.vendor),Ys=Gt&&(/Mobile\/\w+/.test(Yi)||!!pr&&pr.maxTouchPoints>2),Fn=Ys||(pr?/Mac/.test(pr.platform):!1),TE=pr?/Win/.test(pr.platform):!1,Gr=/Android \d/.test(Yi),ja=!!nx&&"webkitFontSmoothing"in nx.documentElement.style,VL=ja?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function FL(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function $r(t,e){return typeof t=="number"?t:t[e]}function PL(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function rx(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,l=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=Ks(a);continue}let c=a,d=c==l.body,h=d?FL(l):PL(c),p=0,g=0;if(e.top<h.top+$r(r,"top")?g=-(h.top-e.top+$r(o,"top")):e.bottom>h.bottom-$r(r,"bottom")&&(g=e.bottom-e.top>h.bottom-h.top?e.top+$r(o,"top")-h.top:e.bottom-h.bottom+$r(o,"bottom")),e.left<h.left+$r(r,"left")?p=-(h.left-e.left+$r(o,"left")):e.right>h.right-$r(r,"right")&&(p=e.right-h.right+$r(o,"right")),p||g)if(d)l.defaultView.scrollBy(p,g);else{let b=c.scrollLeft,S=c.scrollTop;g&&(c.scrollTop+=g),p&&(c.scrollLeft+=p);let x=c.scrollLeft-b,C=c.scrollTop-S;e={left:e.left-x,top:e.top-C,right:e.right-x,bottom:e.bottom-C}}let v=d?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(v))break;a=v=="absolute"?a.offsetParent:Ks(a)}}function $L(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let l=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let c=t.root.elementFromPoint(l,a);if(!c||c==t.dom||!t.dom.contains(c))continue;let d=c.getBoundingClientRect();if(d.top>=n-20){r=c,o=d.top;break}}return{refDOM:r,refTop:o,stack:AE(t.dom)}}function AE(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Ks(r));return e}function HL({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;OE(n,r==0?0:r-e)}function OE(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:l}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=l&&(r.scrollLeft=l)}}let Ns=null;function UL(t){if(t.setActive)return t.setActive();if(Ns)return t.focus(Ns);let e=AE(t);t.focus(Ns==null?{get preventScroll(){return Ns={preventScroll:!0},!0}}:void 0),Ns||(Ns=!1,OE(e,0))}function kE(t,e){let n,r=2e8,o,l=0,a=e.top,c=e.top,d,h;for(let p=t.firstChild,g=0;p;p=p.nextSibling,g++){let v;if(p.nodeType==1)v=p.getClientRects();else if(p.nodeType==3)v=Ur(p).getClientRects();else continue;for(let b=0;b<v.length;b++){let S=v[b];if(S.top<=a&&S.bottom>=c){a=Math.max(S.bottom,a),c=Math.min(S.top,c);let x=S.left>e.left?S.left-e.left:S.right<e.left?e.left-S.right:0;if(x<r){n=p,r=x,o=x&&n.nodeType==3?{left:S.right<e.left?S.right:S.left,top:e.top}:e,p.nodeType==1&&x&&(l=g+(e.left>=(S.left+S.right)/2?1:0));continue}}else S.top>e.top&&!d&&S.left<=e.left&&S.right>=e.left&&(d=p,h={left:Math.max(S.left,Math.min(S.right,e.left)),top:S.top});!n&&(e.left>=S.right&&e.top>=S.top||e.left>=S.left&&e.top>=S.bottom)&&(l=g+1)}}return!n&&d&&(n=d,o=h,r=0),n&&n.nodeType==3?GL(n,o):!n||r&&n.nodeType==1?{node:t,offset:l}:kE(n,o)}function GL(t,e){let n=t.nodeValue.length,r=document.createRange(),o;for(let l=0;l<n;l++){r.setEnd(t,l+1),r.setStart(t,l);let a=Oi(r,1);if(a.top!=a.bottom&&gg(e,a)){o={node:t,offset:l+(e.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function gg(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function qL(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function KL(t,e,n){let{node:r,offset:o}=kE(e,n),l=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();l=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,l)}function YL(t,e,n,r){let o=-1;for(let l=e,a=!1;l!=t.dom;){let c=t.docView.nearestDesc(l,!0),d;if(!c)return null;if(c.dom.nodeType==1&&(c.node.isBlock&&c.parent||!c.contentDOM)&&((d=c.dom.getBoundingClientRect()).width||d.height)&&(c.node.isBlock&&c.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(c.dom.nodeName)&&(!a&&d.left>r.left||d.top>r.top?o=c.posBefore:(!a&&d.right<r.left||d.bottom<r.top)&&(o=c.posAfter),a=!0),!c.contentDOM&&o<0&&!c.node.isText))return(c.node.isBlock?r.top<(d.top+d.bottom)/2:r.left<(d.left+d.right)/2)?c.posBefore:c.posAfter;l=c.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function NE(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),l=o;;){let a=t.childNodes[l];if(a.nodeType==1){let c=a.getClientRects();for(let d=0;d<c.length;d++){let h=c[d];if(gg(e,h))return NE(a,e,h)}}if((l=(l+1)%r)==o)break}return t}function XL(t,e){let n=t.dom.ownerDocument,r,o=0,l=BL(n,e.left,e.top);l&&({node:r,offset:o}=l);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),c;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let h=t.dom.getBoundingClientRect();if(!gg(e,h)||(a=NE(t.dom,e,h),!a))return null}if(Gt)for(let h=a;r&&h;h=Ks(h))h.draggable&&(r=void 0);if(a=qL(a,e),r){if(Un&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let p=r.childNodes[o],g;p.nodeName=="IMG"&&(g=p.getBoundingClientRect()).right<=e.left&&g.bottom>e.top&&o++}let h;ja&&o&&r.nodeType==1&&(h=r.childNodes[o-1]).nodeType==1&&h.contentEditable=="false"&&h.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(c=YL(t,r,o,e))}c==null&&(c=KL(t,a,e));let d=t.docView.nearestDesc(a,!0);return{pos:c,inside:d?d.posAtStart-d.border:-1}}function ix(t){return t.top<t.bottom||t.left<t.right}function Oi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(ix(r))return r}return Array.prototype.find.call(n,ix)||t.getBoundingClientRect()}const JL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function DE(t,e,n){let{node:r,offset:o,atom:l}=t.docView.domFromPos(e,n<0?-1:1),a=ja||Un;if(r.nodeType==3)if(a&&(JL.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let d=Oi(Ur(r,o,o),n);if(Un&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let h=Oi(Ur(r,o-1,o-1),-1);if(h.top==d.top){let p=Oi(Ur(r,o,o+1),-1);if(p.top!=d.top)return Ql(p,p.left<h.left)}}return d}else{let d=o,h=o,p=n<0?1:-1;return n<0&&!o?(h++,p=-1):n>=0&&o==r.nodeValue.length?(d--,p=1):n<0?d--:h++,Ql(Oi(Ur(r,d,h),p),p<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&o&&(n<0||o==Pn(r))){let d=r.childNodes[o-1];if(d.nodeType==1)return Ap(d.getBoundingClientRect(),!1)}if(l==null&&o<Pn(r)){let d=r.childNodes[o];if(d.nodeType==1)return Ap(d.getBoundingClientRect(),!0)}return Ap(r.getBoundingClientRect(),n>=0)}if(l==null&&o&&(n<0||o==Pn(r))){let d=r.childNodes[o-1],h=d.nodeType==3?Ur(d,Pn(d)-(a?0:1)):d.nodeType==1&&(d.nodeName!="BR"||!d.nextSibling)?d:null;if(h)return Ql(Oi(h,1),!1)}if(l==null&&o<Pn(r)){let d=r.childNodes[o];for(;d.pmViewDesc&&d.pmViewDesc.ignoreForCoords;)d=d.nextSibling;let h=d?d.nodeType==3?Ur(d,0,a?0:1):d.nodeType==1?d:null:null;if(h)return Ql(Oi(h,-1),!0)}return Ql(Oi(r.nodeType==3?Ur(r):r,-n),n>=0)}function Ql(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ap(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function _E(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function QL(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return _E(t,e,()=>{let{node:l}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let c=t.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let a=DE(t,o.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else if(c.nodeType==3)d=Ur(c,0,c.nodeValue.length).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.bottom>p.top+1&&(n=="up"?a.top-p.top>(p.bottom-a.top)*2:p.bottom-a.bottom>(a.bottom-p.top)*2))return!1}}return!0})}const ZL=/[\u0590-\u08ac]/;function WL(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,l=!o,a=o==r.parent.content.size,c=t.domSelection();return c?!ZL.test(r.parent.textContent)||!c.modify?n=="left"||n=="backward"?l:a:_E(t,e,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:g}=t.domSelectionRange(),v=c.caretBidiLevel;c.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:S,focusOffset:x}=t.domSelectionRange(),C=S&&!b.contains(S.nodeType==1?S:S.parentNode)||d==S&&h==x;try{c.collapse(p,g),d&&(d!=p||h!=g)&&c.extend&&c.extend(d,h)}catch{}return v!=null&&(c.caretBidiLevel=v),C}):r.pos==r.start()||r.pos==r.end()}let ox=null,sx=null,lx=!1;function eB(t,e,n){return ox==e&&sx==n?lx:(ox=e,sx=n,lx=n=="up"||n=="down"?QL(t,e,n):WL(t,e,n))}const Gn=0,ax=1,To=2,mr=3;class Ia{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Gn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let l,a;if(e==this.contentDOM)l=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;l=e.previousSibling}for(;l&&!((a=l.pmViewDesc)&&a.parent==this);)l=l.previousSibling;return l?this.posBeforeChild(a)+a.size:this.posAtStart}else{let l,a;if(e==this.contentDOM)l=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;l=e.nextSibling}for(;l&&!((a=l.pmViewDesc)&&a.parent==this);)l=l.nextSibling;return l?this.posBeforeChild(a):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Lt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let l=e;;l=l.parentNode){if(l==this.dom){o=!1;break}if(l.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let l=e;;l=l.parentNode){if(l==this.dom){o=!0;break}if(l.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let l=this.getDesc(o),a;if(l&&(!n||l.node))if(r&&(a=l.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return l}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let l=this.getDesc(o);if(l)return l.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],l=r+o.size;if(r==e&&l!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let c=o.children[a];if(c.size){o=c;break}}return o}if(e<l)return o.descAt(e-r-o.border);r=l}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let l=0;r<this.children.length;r++){let a=this.children[r],c=l+a.size;if(c>e||a instanceof jE){o=e-l;break}l=c}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let l;r&&!(l=this.children[r-1]).size&&l instanceof zE&&l.side>=0;r--);if(n<=0){let l,a=!0;for(;l=r?this.children[r-1]:null,!(!l||l.dom.parentNode==this.contentDOM);r--,a=!1);return l&&n&&a&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?Lt(l.dom)+1:0}}else{let l,a=!0;for(;l=r<this.children.length?this.children[r]:null,!(!l||l.dom.parentNode==this.contentDOM);r++,a=!1);return l&&a&&!l.border&&!l.domAtom?l.domFromPos(0,n):{node:this.contentDOM,offset:l?Lt(l.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,l=-1;for(let a=r,c=0;;c++){let d=this.children[c],h=a+d.size;if(o==-1&&e<=h){let p=a+d.border;if(e>=p&&n<=h-d.border&&d.node&&d.contentDOM&&this.contentDOM.contains(d.contentDOM))return d.parseRange(e,n,p);e=a;for(let g=c;g>0;g--){let v=this.children[g-1];if(v.size&&v.dom.parentNode==this.contentDOM&&!v.emptyChildAt(1)){o=Lt(v.dom)+1;break}e-=v.size}o==-1&&(o=0)}if(o>-1&&(h>n||c==this.children.length-1)){n=h;for(let p=c+1;p<this.children.length;p++){let g=this.children[p];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(-1)){l=Lt(g.dom);break}n+=g.size}l==-1&&(l=this.contentDOM.childNodes.length);break}a=h}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:l}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let l=Math.min(e,n),a=Math.max(e,n);for(let b=0,S=0;b<this.children.length;b++){let x=this.children[b],C=S+x.size;if(l>S&&a<C)return x.setSelection(e-S-x.border,n-S-x.border,r,o);S=C}let c=this.domFromPos(e,e?-1:1),d=n==e?c:this.domFromPos(n,n?-1:1),h=r.root.getSelection(),p=r.domSelectionRange(),g=!1;if((Un||Gt)&&e==n){let{node:b,offset:S}=c;if(b.nodeType==3){if(g=!!(S&&b.nodeValue[S-1]==`
|
|
61
|
+
`),g&&S==b.nodeValue.length)for(let x=b,C;x;x=x.parentNode){if(C=x.nextSibling){C.nodeName=="BR"&&(c=d={node:C.parentNode,offset:Lt(C)+1});break}let E=x.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let x=b.childNodes[S-1];g=x&&(x.nodeName=="BR"||x.contentEditable=="false")}}if(Un&&p.focusNode&&p.focusNode!=d.node&&p.focusNode.nodeType==1){let b=p.focusNode.childNodes[p.focusOffset];b&&b.contentEditable=="false"&&(o=!0)}if(!(o||g&&Gt)&&Bo(c.node,c.offset,p.anchorNode,p.anchorOffset)&&Bo(d.node,d.offset,p.focusNode,p.focusOffset))return;let v=!1;if((h.extend||e==n)&&!(g&&Un)){h.collapse(c.node,c.offset);try{e!=n&&h.extend(d.node,d.offset),v=!0}catch{}}if(!v){if(e>n){let S=c;c=d,d=S}let b=document.createRange();b.setEnd(d.node,d.offset),b.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(b)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let l=this.children[o],a=r+l.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let c=r+l.border,d=a-l.border;if(e>=c&&n<=d){this.dirty=e==r||n==a?To:ax,e==c&&n==d&&(l.contentLost||l.dom.parentNode!=this.contentDOM)?l.dirty=mr:l.markDirty(e-c,n-c);return}else l.dirty=l.dom==l.contentDOM&&l.dom.parentNode==this.contentDOM&&!l.children.length?To:mr}r=a}this.dirty=To}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?To:ax;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class zE extends Ia{constructor(e,n,r,o){let l,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)})),!n.type.spec.raw){if(a.nodeType!=1){let c=document.createElement("span");c.appendChild(a),a=c}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,l=this}matchesWidget(e){return this.dirty==Gn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class tB extends Ia{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Vo extends Ia{constructor(e,n,r,o,l){super(e,[],r,o),this.mark=n,this.spec=l}static create(e,n,r,o){let l=o.nodeViews[n.type.name],a=l&&l(n,o,r);return(!a||!a.dom)&&(a=$o.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Vo(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&mr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=mr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Gn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Gn}}slice(e,n,r){let o=Vo.create(this.parent,this.mark,!0,r),l=this.children,a=this.size;n<a&&(l=Mm(l,n,a,r)),e>0&&(l=Mm(l,0,e,r));for(let c=0;c<l.length;c++)l[c].parent=o;return o.children=l,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Vi extends Ia{constructor(e,n,r,o,l,a,c,d,h){super(e,[],l,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=c}static create(e,n,r,o,l,a){let c=l.nodeViews[n.type.name],d,h=c&&c(n,l,()=>{if(!d)return a;if(d.parent)return d.parent.posBeforeChild(d)},r,o),p=h&&h.dom,g=h&&h.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:g}=$o.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!g&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let v=p;return p=BE(p,r,n),h?d=new nB(e,n,r,o,p,g||null,v,h,l,a+1):n.isText?new Af(e,n,r,o,p,v,l):new Vi(e,n,r,o,p,g||null,v,l,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>te.empty)}return e}matchesNode(e,n,r){return this.dirty==Gn&&e.eq(this.node)&&qc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,l=e.composing?this.localCompositionInfo(e,n):null,a=l&&l.pos>-1?l:null,c=l&&l.pos<0,d=new iB(this,a&&a.node,e);lB(this.node,this.innerDeco,(h,p,g)=>{h.spec.marks?d.syncToMarks(h.spec.marks,r,e,p):h.type.side>=0&&!g&&d.syncToMarks(p==this.node.childCount?et.none:this.node.child(p).marks,r,e,p),d.placeWidget(h,e,o)},(h,p,g,v)=>{d.syncToMarks(h.marks,r,e,v);let b;d.findNodeMatch(h,p,g,v)||c&&e.state.selection.from>o&&e.state.selection.to<o+h.nodeSize&&(b=d.findIndexWithChild(l.node))>-1&&d.updateNodeAt(h,p,g,b,e)||d.updateNextNode(h,p,g,e,v,o)||d.addNode(h,p,g,e,o),o+=h.nodeSize}),d.syncToMarks([],r,e,0),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==To)&&(a&&this.protectLocalComposition(e,a),IE(this.contentDOM,this.children,e),Ys&&aB(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ae)||r<n||o>n+this.node.content.size)return null;let l=e.input.compositionNode;if(!l||!this.dom.contains(l.parentNode))return null;if(this.node.inlineContent){let a=l.nodeValue,c=uB(this.node.content,a,r-n,o-n);return c<0?null:{node:l,pos:c,text:a}}else return{node:l,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let l=n;for(;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=void 0)}let a=new tB(this,l,n,o);e.input.compositionNodes.push(a),this.children=Mm(this.children,r,r+o.length,e,a)}update(e,n,r,o){return this.dirty==mr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Gn}updateOuterDeco(e){if(qc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=LE(this.dom,this.nodeDOM,Cm(this.outerDeco,this.node,n),Cm(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ux(t,e,n,r,o){BE(r,e,t);let l=new Vi(void 0,t,e,n,r,r,r,o,0);return l.contentDOM&&l.updateChildren(o,0),l}class Af extends Vi{constructor(e,n,r,o,l,a,c){super(e,n,r,o,l,null,a,c,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==mr||this.dirty!=Gn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Gn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Gn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),l=document.createTextNode(o.text);return new Af(this.parent,o,this.outerDeco,this.innerDeco,l,l,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=mr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class jE extends Ia{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Gn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class nB extends Vi{constructor(e,n,r,o,l,a,c,d,h,p){super(e,n,r,o,l,a,c,h,p),this.spec=d}update(e,n,r,o){if(this.dirty==mr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let l=this.spec.update(e,n,r);return l&&this.updateInner(e,n,r,o),l}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function IE(t,e,n){let r=t.firstChild,o=!1;for(let l=0;l<e.length;l++){let a=e[l],c=a.dom;if(c.parentNode==t){for(;c!=r;)r=cx(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(c,r);if(a instanceof Vo){let d=r?r.previousSibling:t.lastChild;IE(a.contentDOM,a.children,n),r=d?d.nextSibling:t.firstChild}}for(;r;)r=cx(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const aa=function(t){t&&(this.nodeName=t)};aa.prototype=Object.create(null);const Ao=[new aa];function Cm(t,e,n){if(t.length==0)return Ao;let r=n?Ao[0]:new aa,o=[r];for(let l=0;l<t.length;l++){let a=t[l].type.attrs;if(a){a.nodeName&&o.push(r=new aa(a.nodeName));for(let c in a){let d=a[c];d!=null&&(n&&o.length==1&&o.push(r=new aa(e.isInline?"span":"div")),c=="class"?r.class=(r.class?r.class+" ":"")+d:c=="style"?r.style=(r.style?r.style+";":"")+d:c!="nodeName"&&(r[c]=d))}}}return o}function LE(t,e,n,r){if(n==Ao&&r==Ao)return e;let o=e;for(let l=0;l<r.length;l++){let a=r[l],c=n[l];if(l){let d;c&&c.nodeName==a.nodeName&&o!=t&&(d=o.parentNode)&&d.nodeName.toLowerCase()==a.nodeName||(d=document.createElement(a.nodeName),d.pmIsDeco=!0,d.appendChild(o),c=Ao[0]),o=d}rB(o,c||Ao[0],a)}return o}function rB(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let l=0;l<r.length;l++)o.indexOf(r[l])==-1&&t.classList.remove(r[l]);for(let l=0;l<o.length;l++)r.indexOf(o[l])==-1&&t.classList.add(o[l]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function BE(t,e,n){return LE(t,t,Ao,Cm(e,n,t.nodeType!=1))}function qc(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function cx(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class iB{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=oB(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,o){let l=0,a=this.stack.length>>1,c=Math.min(a,e.length);for(;l<c&&(l==a-1?this.top:this.stack[l+1<<1]).matchesMark(e[l])&&e[l].type.spec.spanning!==!1;)l++;for(;l<a;)this.destroyRest(),this.top.dirty=Gn,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let d=-1,h=this.top.children.length;o<this.preMatch.index&&(h=Math.min(this.index+3,h));for(let p=this.index;p<h;p++){let g=this.top.children[p];if(g.matchesMark(e[a])&&!this.isLocked(g.dom)){d=p;break}}if(d>-1)d>this.index&&(this.changed=!0,this.destroyBetween(this.index,d)),this.top=this.top.children[this.index];else{let p=Vo.create(this.top,e[a],n,r);this.top.children.splice(this.index,0,p),this.top=p,this.changed=!0}this.index=0,a++}}findNodeMatch(e,n,r,o){let l=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))l=this.top.children.indexOf(a,this.index);else for(let c=this.index,d=Math.min(this.top.children.length,c+5);c<d;c++){let h=this.top.children[c];if(h.matchesNode(e,n,r)&&!this.preMatch.matched.has(h)){l=c;break}}return l<0?!1:(this.destroyBetween(this.index,l),this.index++,!0)}updateNodeAt(e,n,r,o,l){let a=this.top.children[o];return a.dirty==mr&&a.dom==a.contentDOM&&(a.dirty=To),a.update(e,n,r,l)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,l,a){for(let c=this.index;c<this.top.children.length;c++){let d=this.top.children[c];if(d instanceof Vi){let h=this.preMatch.matched.get(d);if(h!=null&&h!=l)return!1;let p=d.dom,g,v=this.isLocked(p)&&!(e.isText&&d.node&&d.node.isText&&d.nodeDOM.nodeValue==e.text&&d.dirty!=mr&&qc(n,d.outerDeco));if(!v&&d.update(e,n,r,o))return this.destroyBetween(this.index,c),d.dom!=p&&(this.changed=!0),this.index++,!0;if(!v&&(g=this.recreateWrapper(d,e,n,r,o,a)))return this.destroyBetween(this.index,c),this.top.children[this.index]=g,g.contentDOM&&(g.dirty=To,g.updateChildren(o,a+1),g.dirty=Gn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,l,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!qc(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let c=Vi.create(this.top,n,r,o,l,a);if(c.contentDOM){c.children=e.children,e.children=[];for(let d of c.children)d.parent=c}return e.destroy(),c}addNode(e,n,r,o,l){let a=Vi.create(this.top,e,n,r,o,l);a.contentDOM&&a.updateChildren(o,l+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let l=new zE(this.top,e,n,r);this.top.children.splice(this.index++,0,l),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Vo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Af)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Gt||Vt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new jE(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function oB(t,e){let n=e,r=n.children.length,o=t.childCount,l=new Map,a=[];e:for(;o>0;){let c;for(;;)if(r){let h=n.children[r-1];if(h instanceof Vo)n=h,r=h.children.length;else{c=h,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let d=c.node;if(d){if(d!=t.child(o-1))break;--o,l.set(c,o),a.push(c)}}return{index:o,matched:l,matches:a.reverse()}}function sB(t,e){return t.type.side-e.type.side}function lB(t,e,n,r){let o=e.locals(t),l=0;if(o.length==0){for(let h=0;h<t.childCount;h++){let p=t.child(h);r(p,o,e.forChild(l,p),h),l+=p.nodeSize}return}let a=0,c=[],d=null;for(let h=0;;){let p,g;for(;a<o.length&&o[a].to==l;){let C=o[a++];C.widget&&(p?(g||(g=[p])).push(C):p=C)}if(p)if(g){g.sort(sB);for(let C=0;C<g.length;C++)n(g[C],h,!!d)}else n(p,h,!!d);let v,b;if(d)b=-1,v=d,d=null;else if(h<t.childCount)b=h,v=t.child(h++);else break;for(let C=0;C<c.length;C++)c[C].to<=l&&c.splice(C--,1);for(;a<o.length&&o[a].from<=l&&o[a].to>l;)c.push(o[a++]);let S=l+v.nodeSize;if(v.isText){let C=S;a<o.length&&o[a].from<C&&(C=o[a].from);for(let E=0;E<c.length;E++)c[E].to<C&&(C=c[E].to);C<S&&(d=v.cut(C-l),v=v.cut(0,C-l),S=C,b=-1)}else for(;a<o.length&&o[a].to<S;)a++;let x=v.isInline&&!v.isLeaf?c.filter(C=>!C.inline):c.slice();r(v,x,e.forChild(l,v),b),l=S}}function aB(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function uB(t,e,n,r){for(let o=0,l=0;o<t.childCount&&l<=r;){let a=t.child(o++),c=l;if(l+=a.nodeSize,!a.isText)continue;let d=a.text;for(;o<t.childCount;){let h=t.child(o++);if(l+=h.nodeSize,!h.isText)break;d+=h.text}if(l>=n){if(l>=r&&d.slice(r-e.length-c,r-c)==e)return r-e.length;let h=c<r?d.lastIndexOf(e,r-c-1):-1;if(h>=0&&h+e.length+c>=n)return c+h;if(n==r&&d.length>=r+e.length-c&&d.slice(r-c,r-c+e.length)==e)return r}}return-1}function Mm(t,e,n,r,o){let l=[];for(let a=0,c=0;a<t.length;a++){let d=t[a],h=c,p=c+=d.size;h>=n||p<=e?l.push(d):(h<e&&l.push(d.slice(0,e-h,r)),o&&(l.push(o),o=void 0),p>n&&l.push(d.slice(n-h,d.size,r)))}return l}function yg(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),l=o&&o.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let c=r.resolve(a),d,h;if(Tf(n)){for(d=a;o&&!o.node;)o=o.parent;let g=o.node;if(o&&g.isAtom&&we.isSelectable(g)&&o.parent&&!(g.isInline&&IL(n.focusNode,n.focusOffset,o.dom))){let v=o.posBefore;h=new we(a==v?c:r.resolve(v))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let g=a,v=a;for(let b=0;b<n.rangeCount;b++){let S=n.getRangeAt(b);g=Math.min(g,t.docView.posFromDOM(S.startContainer,S.startOffset,1)),v=Math.max(v,t.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(g<0)return null;[d,a]=v==t.state.selection.anchor?[v,g]:[g,v],c=r.resolve(a)}else d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null}let p=r.resolve(d);if(!h){let g=e=="pointer"||t.state.selection.head<c.pos&&!l?1:-1;h=vg(t,p,c,g)}return h}function VE(t){return t.editable?t.hasFocus():PE(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Kr(t,e=!1){let n=t.state.selection;if(FE(t,n),!!VE(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Vt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Bo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)fB(t);else{let{anchor:r,head:o}=n,l,a;fx&&!(n instanceof Ae)&&(n.$from.parent.inlineContent||(l=dx(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=dx(t,n.to))),t.docView.setSelection(r,o,t,e),fx&&(l&&hx(l),a&&hx(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&cB(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const fx=Gt||Vt&&RE<63;function dx(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,l=r?n.childNodes[r-1]:null;if(Gt&&o&&o.contentEditable=="false")return Op(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return Op(o);if(l)return Op(l)}}function Op(t){return t.contentEditable="true",Gt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function hx(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function cB(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!VE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function fB(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Lt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&hn&&Bi<=11&&(n.disabled=!0,n.disabled=!1)}function FE(t,e){if(e instanceof we){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(px(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else px(t)}function px(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function vg(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ae.between(e,n,r)}function mx(t){return t.editable&&!t.hasFocus()?!1:PE(t)}function PE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function dB(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Bo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Em(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),l=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return l&&ze.findFrom(l,e)}function ki(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function gx(t,e,n){let r=t.state.selection;if(r instanceof Ae)if(n.indexOf("s")>-1){let{$head:o}=r,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+l.nodeSize*(e<0?-1:1));return ki(t,new Ae(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Em(t.state,e);return o&&o instanceof we?ki(t,o):!1}else if(!(Fn&&n.indexOf("m")>-1)){let o=r.$head,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,a;if(!l||l.isText)return!1;let c=e<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM?we.isSelectable(l)?ki(t,new we(e<0?t.state.doc.resolve(o.pos-l.nodeSize):o)):ja?ki(t,new Ae(t.state.doc.resolve(e<0?c:c+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof we&&r.node.isInline)return ki(t,new Ae(e>0?r.$to:r.$from));{let o=Em(t.state,e);return o?ki(t,o):!1}}}function Kc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ua(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ds(t,e){return e<0?hB(t):pB(t)}function hB(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,l,a=!1;for(Un&&n.nodeType==1&&r<Kc(n)&&ua(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let c=n.childNodes[r-1];if(ua(c,-1))o=n,l=--r;else if(c.nodeType==3)n=c,r=n.nodeValue.length;else break}}else{if($E(n))break;{let c=n.previousSibling;for(;c&&ua(c,-1);)o=n.parentNode,l=Lt(c),c=c.previousSibling;if(c)n=c,r=Kc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?Rm(t,n,r):o&&Rm(t,o,l)}function pB(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Kc(n),l,a;for(;;)if(r<o){if(n.nodeType!=1)break;let c=n.childNodes[r];if(ua(c,1))l=n,a=++r;else break}else{if($E(n))break;{let c=n.nextSibling;for(;c&&ua(c,1);)l=c.parentNode,a=Lt(c)+1,c=c.nextSibling;if(c)n=c,r=0,o=Kc(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}l&&Rm(t,l,a)}function $E(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function mB(t,e){for(;t&&e==t.childNodes.length&&!za(t);)e=Lt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function gB(t,e){for(;t&&!e&&!za(t);)e=Lt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Rm(t,e,n){if(e.nodeType!=3){let l,a;(a=mB(e,n))?(e=a,n=0):(l=gB(e,n))&&(e=l,n=l.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Tf(r)){let l=document.createRange();l.setEnd(e,n),l.setStart(e,n),r.removeAllRanges(),r.addRange(l)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Kr(t)},50)}function yx(t,e){let n=t.state.doc.resolve(e);if(!(Vt||TE)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let l=t.coordsAtPos(e-1),a=(l.top+l.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(l.left-o.left)>1)return l.left<o.left?"ltr":"rtl"}if(e<n.end()){let l=t.coordsAtPos(e+1),a=(l.top+l.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(l.left-o.left)>1)return l.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function vx(t,e,n){let r=t.state.selection;if(r instanceof Ae&&!r.empty||n.indexOf("s")>-1||Fn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=Em(t.state,e);if(a&&a instanceof we)return ki(t,a)}if(!o.parent.inlineContent){let a=e<0?o:l,c=r instanceof An?ze.near(a,e):ze.findFrom(a,e);return c?ki(t,c):!1}return!1}function bx(t,e){if(!(t.state.selection instanceof Ae))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(l&&!l.isText){let a=t.state.tr;return e<0?a.delete(n.pos-l.nodeSize,n.pos):a.delete(n.pos,n.pos+l.nodeSize),t.dispatch(a),!0}return!1}function Sx(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function yB(t){if(!Gt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Sx(t,r,"true"),setTimeout(()=>Sx(t,r,"false"),20)}return!1}function vB(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function bB(t,e){let n=e.keyCode,r=vB(e);if(n==8||Fn&&n==72&&r=="c")return bx(t,-1)||Ds(t,-1);if(n==46&&!e.shiftKey||Fn&&n==68&&r=="c")return bx(t,1)||Ds(t,1);if(n==13||n==27)return!0;if(n==37||Fn&&n==66&&r=="c"){let o=n==37?yx(t,t.state.selection.from)=="ltr"?-1:1:-1;return gx(t,o,r)||Ds(t,o)}else if(n==39||Fn&&n==70&&r=="c"){let o=n==39?yx(t,t.state.selection.from)=="ltr"?1:-1:1;return gx(t,o,r)||Ds(t,o)}else{if(n==38||Fn&&n==80&&r=="c")return vx(t,-1,r)||Ds(t,-1);if(n==40||Fn&&n==78&&r=="c")return yB(t)||vx(t,1,r)||Ds(t,1);if(r==(Fn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function bg(t,e){t.someProp("transformCopied",b=>{e=b(e,t)});let n=[],{content:r,openStart:o,openEnd:l}=e;for(;o>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,l--;let b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=t.someProp("clipboardSerializer")||$o.fromSchema(t.state.schema),c=YE(),d=c.createElement("div");d.appendChild(a.serializeFragment(r,{document:c}));let h=d.firstChild,p,g=0;for(;h&&h.nodeType==1&&(p=KE[h.nodeName.toLowerCase()]);){for(let b=p.length-1;b>=0;b--){let S=c.createElement(p[b]);for(;d.firstChild;)S.appendChild(d.firstChild);d.appendChild(S),g++}h=d.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${o} ${l}${g?` -${g}`:""} ${JSON.stringify(n)}`);let v=t.someProp("clipboardTextSerializer",b=>b(e,t))||e.content.textBetween(0,e.content.size,`
|
|
62
|
+
|
|
63
|
+
`);return{dom:d,text:v,slice:e}}function HE(t,e,n,r,o){let l=o.parent.type.spec.code,a,c;if(!n&&!e)return null;let d=!!e&&(r||l||!n);if(d){if(t.someProp("transformPastedText",v=>{e=v(e,l||r,t)}),l)return c=new ae(te.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
64
|
+
`))),0,0),t.someProp("transformPasted",v=>{c=v(c,t,!0)}),c;let g=t.someProp("clipboardTextParser",v=>v(e,o,r,t));if(g)c=g;else{let v=o.marks(),{schema:b}=t.state,S=$o.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let C=a.appendChild(document.createElement("p"));x&&C.appendChild(S.serializeNode(b.text(x,v)))})}}else t.someProp("transformPastedHTML",g=>{n=g(n,t)}),a=CB(n),ja&&MB(a);let h=a&&a.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let g=+p[3];g>0;g--){let v=a.firstChild;for(;v&&v.nodeType!=1;)v=v.nextSibling;if(!v)break;a=v}if(c||(c=(t.someProp("clipboardParser")||t.someProp("domParser")||Li.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(d||p),context:o,ruleFromNode(v){return v.nodeName=="BR"&&!v.nextSibling&&v.parentNode&&!SB.test(v.parentNode.nodeName)?{ignore:!0}:null}})),p)c=EB(xx(c,+p[1],+p[2]),p[4]);else if(c=ae.maxOpen(xB(c.content,o),!0),c.openStart||c.openEnd){let g=0,v=0;for(let b=c.content.firstChild;g<c.openStart&&!b.type.spec.isolating;g++,b=b.firstChild);for(let b=c.content.lastChild;v<c.openEnd&&!b.type.spec.isolating;v++,b=b.lastChild);c=xx(c,g,v)}return t.someProp("transformPasted",g=>{c=g(c,t,d)}),c}const SB=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function xB(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),l,a=[];if(t.forEach(c=>{if(!a)return;let d=o.findWrapping(c.type),h;if(!d)return a=null;if(h=a.length&&l.length&&GE(d,l,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=qE(a[a.length-1],l.length));let p=UE(c,d);a.push(p),o=o.matchType(p.type),l=d}}),a)return te.from(a)}return t}function UE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,te.from(t));return t}function GE(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let l=GE(t,e,n,r.lastChild,o+1);if(l)return r.copy(r.content.replaceChild(r.childCount-1,l));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(te.from(UE(n,t,o+1))))}}function qE(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,qE(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(te.empty,!0);return t.copy(n.append(r))}function Tm(t,e,n,r,o,l){let a=e<0?t.firstChild:t.lastChild,c=a.content;return t.childCount>1&&(l=0),o<r-1&&(c=Tm(c,e,n,r,o+1,l)),o>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,l<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(te.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}function xx(t,e,n){return e<t.openStart&&(t=new ae(Tm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ae(Tm(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const KE={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let wx=null;function YE(){return wx||(wx=document.implementation.createHTMLDocument("title"))}let kp=null;function wB(t){let e=window.trustedTypes;return e?(kp||(kp=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),kp.createHTML(t)):t}function CB(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=YE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&KE[r[1].toLowerCase()])&&(t=o.map(l=>"<"+l+">").join("")+t+o.map(l=>"</"+l+">").reverse().join("")),n.innerHTML=wB(t),o)for(let l=0;l<o.length;l++)n=n.querySelector(o[l])||n;return n}function MB(t){let e=t.querySelectorAll(Vt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function EB(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:l,openEnd:a}=t;for(let c=r.length-2;c>=0;c-=2){let d=n.nodes[r[c]];if(!d||d.hasRequiredAttrs())break;o=te.from(d.create(r[c+1],o)),l++,a++}return new ae(o,l,a)}const nn={},rn={},RB={touchstart:!0,touchmove:!0};class TB{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function AB(t){for(let e in nn){let n=nn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{kB(t,r)&&!Sg(t,r)&&(t.editable||!(r.type in rn))&&n(t,r)},RB[e]?{passive:!0}:void 0)}Gt&&t.dom.addEventListener("input",()=>null),Am(t)}function ji(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function OB(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Am(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Sg(t,r))})}function Sg(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function kB(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function NB(t,e){!Sg(t,e)&&nn[e.type]&&(t.editable||!(e.type in rn))&&nn[e.type](t,e)}rn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!JE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Gr&&Vt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Ys&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Eo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||bB(t,n)?n.preventDefault():ji(t,"key")};rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};rn.keypress=(t,e)=>{let n=e;if(JE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Fn&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ae)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),l=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,o,l))&&t.dispatch(l()),n.preventDefault()}};function Of(t){return{left:t.clientX,top:t.clientY}}function DB(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function xg(t,e,n,r,o){if(r==-1)return!1;let l=t.state.doc.resolve(r);for(let a=l.depth+1;a>0;a--)if(t.someProp(e,c=>a>l.depth?c(t,n,l.nodeAfter,l.before(a),o,!0):c(t,n,l.node(a),l.before(a),o,!1)))return!0;return!1}function Hs(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function _B(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&we.isSelectable(r)?(Hs(t,new we(n)),!0):!1}function zB(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof we&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let c=a>l.depth?l.nodeAfter:l.node(a);if(we.isSelectable(c)){r&&n.$from.depth>0&&a>=n.$from.depth&&l.before(n.$from.depth+1)==n.$from.pos?o=l.before(n.$from.depth):o=l.before(a);break}}return o!=null?(Hs(t,we.create(t.state.doc,o)),!0):!1}function jB(t,e,n,r,o){return xg(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(o?zB(t,n):_B(t,n))}function IB(t,e,n,r){return xg(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function LB(t,e,n,r){return xg(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||BB(t,n,r)}function BB(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Hs(t,Ae.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let l=o.depth+1;l>0;l--){let a=l>o.depth?o.nodeAfter:o.node(l),c=o.before(l);if(a.inlineContent)Hs(t,Ae.create(r,c+1,c+1+a.content.size));else if(we.isSelectable(a))Hs(t,we.create(r,c));else continue;return!0}}function wg(t){return Yc(t)}const XE=Fn?"metaKey":"ctrlKey";nn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=wg(t),o=Date.now(),l="singleClick";o-t.input.lastClick.time<500&&DB(n,t.input.lastClick)&&!n[XE]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?l="doubleClick":t.input.lastClick.type=="doubleClick"&&(l="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:l,button:n.button};let a=t.posAtCoords(Of(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new VB(t,a,n,!!r)):(l=="doubleClick"?IB:LB)(t,a.pos,a.inside,n)?n.preventDefault():ji(t,"pointer"))};class VB{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[XE],this.allowDefault=r.shiftKey;let l,a;if(n.inside>-1)l=e.state.doc.nodeAt(n.inside),a=n.inside;else{let p=e.state.doc.resolve(n.pos);l=p.parent,a=p.depth?p.before():0}const c=o?null:r.target,d=c?e.docView.nearestDesc(c,!0):null;this.target=d&&d.nodeDOM.nodeType==1?d.nodeDOM:null;let{selection:h}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||h instanceof we&&h.from<=a&&h.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Un&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ji(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Kr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Of(e))),this.updateAllowDefault(e),this.allowDefault||!n?ji(this.view,"pointer"):jB(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Gt&&this.mightDrag&&!this.mightDrag.node.isAtom||Vt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Hs(this.view,ze.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ji(this.view,"pointer")}move(e){this.updateAllowDefault(e),ji(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}nn.touchstart=t=>{t.input.lastTouch=Date.now(),wg(t),ji(t,"pointer")};nn.touchmove=t=>{t.input.lastTouch=Date.now(),ji(t,"pointer")};nn.contextmenu=t=>wg(t);function JE(t,e){return t.composing?!0:Gt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const FB=Gr?5e3:-1;rn.compositionstart=rn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ae&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Vt&&TE&&PB(t)))t.markCursor=t.state.storedMarks||n.marks(),Yc(t,!0),t.markCursor=null;else if(Yc(t,!e.selection.empty),Un&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,l=r.focusOffset;o&&o.nodeType==1&&l!=0;){let a=l<0?o.lastChild:o.childNodes[l-1];if(!a)break;if(a.nodeType==3){let c=t.domSelection();c&&c.collapse(a,a.nodeValue.length);break}else o=a,l=-1}}t.input.composing=!0}QE(t,FB)};function PB(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}rn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,QE(t,20))};function QE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Yc(t),e))}function ZE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=HB());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function $B(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=zL(e.focusNode,e.focusOffset),r=jL(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,l=t.domObserver.lastChangedTextNode;if(n==l||r==l)return l;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function HB(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Yc(t,e=!1){if(!(Gr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ZE(t),e||t.docView&&t.docView.dirty){let n=yg(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function UB(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const xa=hn&&Bi<15||Ys&&VL<604;nn.copy=rn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let l=xa?null:n.clipboardData,a=r.content(),{dom:c,text:d}=bg(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",c.innerHTML),l.setData("text/plain",d)):UB(t,c),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function GB(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function qB(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?wa(t,r.value,null,o,e):wa(t,r.textContent,r.innerHTML,o,e)},50)}function wa(t,e,n,r,o){let l=HE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",d=>d(t,o,l||ae.empty)))return!0;if(!l)return!1;let a=GB(l),c=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function WE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rn.paste=(t,e)=>{let n=e;if(t.composing&&!Gr)return;let r=xa?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&wa(t,WE(r),r.getData("text/html"),o,n)?n.preventDefault():qB(t,n)};class eR{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const KB=Fn?"altKey":"ctrlKey";function tR(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[KB]}nn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,l=o.empty?null:t.posAtCoords(Of(n)),a;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof we?o.to-1:o.to))){if(r&&r.mightDrag)a=we.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let g=t.docView.nearestDesc(n.target,!0);g&&g.node.type.spec.draggable&&g!=t.docView&&(a=we.create(t.state.doc,g.posBefore))}}let c=(a||t.state.selection).content(),{dom:d,text:h,slice:p}=bg(t,c);(!n.dataTransfer.files.length||!Vt||RE>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xa?"Text":"text/html",d.innerHTML),n.dataTransfer.effectAllowed="copyMove",xa||n.dataTransfer.setData("text/plain",h),t.dragging=new eR(p,tR(t,n),a)};nn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};rn.dragover=rn.dragenter=(t,e)=>e.preventDefault();rn.drop=(t,e)=>{try{YB(t,e,t.dragging)}finally{t.dragging=null}};function YB(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Of(e));if(!r)return;let o=t.state.doc.resolve(r.pos),l=n&&n.slice;l?t.someProp("transformPasted",b=>{l=b(l,t,!1)}):l=HE(t,WE(e.dataTransfer),xa?null:e.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&tR(t,e));if(t.someProp("handleDrop",b=>b(t,e,l||ae.empty,a))){e.preventDefault();return}if(!l)return;e.preventDefault();let c=l?oE(t.state.doc,o.pos,l):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){let{node:b}=n;b?b.replace(d):d.deleteSelection()}let h=d.mapping.map(c),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,g=d.doc;if(p?d.replaceRangeWith(h,h,l.content.firstChild):d.replaceRange(h,h,l),d.doc.eq(g))return;let v=d.doc.resolve(h);if(p&&we.isSelectable(l.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new we(v));else{let b=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((S,x,C,E)=>b=E),d.setSelection(vg(t,v,d.doc.resolve(b)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))}nn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kr(t)},20))};nn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};nn.beforeinput=(t,e)=>{if(Vt&&Gr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",l=>l(t,Eo(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in rn)nn[t]=rn[t];function Ca(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Xc{constructor(e,n){this.toDOM=e,this.spec=n||Do,this.side=this.spec.side||0}map(e,n,r,o){let{pos:l,deleted:a}=e.mapResult(n.from+o,this.side<0?-1:1);return a?null:new Ut(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Xc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ca(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Fi{constructor(e,n){this.attrs=e,this.spec=n||Do}map(e,n,r,o){let l=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return l>=a?null:new Ut(l,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Fi&&Ca(this.attrs,e.attrs)&&Ca(this.spec,e.spec)}static is(e){return e.type instanceof Fi}destroy(){}}class Cg{constructor(e,n){this.attrs=e,this.spec=n||Do}map(e,n,r,o){let l=e.mapResult(n.from+o,1);if(l.deleted)return null;let a=e.mapResult(n.to+o,-1);return a.deleted||a.pos<=l.pos?null:new Ut(l.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),l;return o==n.from&&!(l=e.child(r)).isText&&o+l.nodeSize==n.to}eq(e){return this==e||e instanceof Cg&&Ca(this.attrs,e.attrs)&&Ca(this.spec,e.spec)}destroy(){}}class Ut{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ut(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ut(e,e,new Xc(n,r))}static inline(e,n,r,o){return new Ut(e,n,new Fi(r,o))}static node(e,n,r,o){return new Ut(e,n,new Cg(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fi}get widget(){return this.type instanceof Xc}}const js=[],Do={};class lt{constructor(e,n){this.local=e.length?e:js,this.children=n.length?n:js}static create(e,n){return n.length?Jc(n,e,0,Do):Ht}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,l){for(let a=0;a<this.local.length;a++){let c=this.local[a];c.from<=n&&c.to>=e&&(!l||l(c.spec))&&r.push(c.copy(c.from+o,c.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let c=this.children[a]+1;this.children[a+2].findInner(e-c,n-c,r,o+c,l)}}map(e,n,r){return this==Ht||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Do)}mapInner(e,n,r,o,l){let a;for(let c=0;c<this.local.length;c++){let d=this.local[c].map(e,r,o);d&&d.type.valid(n,d)?(a||(a=[])).push(d):l.onRemove&&l.onRemove(this.local[c].spec)}return this.children.length?XB(this.children,a||[],e,n,r,o,l):a?new lt(a.sort(_o),js):Ht}add(e,n){return n.length?this==Ht?lt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,l=0;e.forEach((c,d)=>{let h=d+r,p;if(p=rR(n,c,h)){for(o||(o=this.children.slice());l<o.length&&o[l]<d;)l+=3;o[l]==d?o[l+2]=o[l+2].addInner(c,p,h+1):o.splice(l,0,d,d+c.nodeSize,Jc(p,c,h+1,Do)),l+=3}});let a=nR(l?iR(n):n,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new lt(a.length?this.local.concat(a).sort(_o):this.local,o||this.children)}remove(e){return e.length==0||this==Ht?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let l=0;l<r.length;l+=3){let a,c=r[l]+n,d=r[l+1]+n;for(let p=0,g;p<e.length;p++)(g=e[p])&&g.from>c&&g.to<d&&(e[p]=null,(a||(a=[])).push(g));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[l+2].removeInner(a,c+1);h!=Ht?r[l+2]=h:(r.splice(l,3),l-=3)}if(o.length){for(let l=0,a;l<e.length;l++)if(a=e[l])for(let c=0;c<o.length;c++)o[c].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(c--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new lt(o,r):Ht}forChild(e,n){if(this==Ht)return this;if(n.isLeaf)return lt.empty;let r,o;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=e){this.children[c]==e&&(r=this.children[c+2]);break}let l=e+1,a=l+n.content.size;for(let c=0;c<this.local.length;c++){let d=this.local[c];if(d.from<a&&d.to>l&&d.type instanceof Fi){let h=Math.max(l,d.from)-l,p=Math.min(a,d.to)-l;h<p&&(o||(o=[])).push(d.copy(h,p))}}if(o){let c=new lt(o.sort(_o),js);return r?new Di([c,r]):c}return r||Ht}eq(e){if(this==e)return!0;if(!(e instanceof lt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Mg(this.localsInner(e))}localsInner(e){if(this==Ht)return js;if(e.inlineContent||!this.local.some(Fi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fi||n.push(this.local[r]);return n}forEachSet(e){e(this)}}lt.empty=new lt([],[]);lt.removeOverlap=Mg;const Ht=lt.empty;class Di{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Do));return Di.from(r)}forChild(e,n){if(n.isLeaf)return lt.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(e,n);l!=Ht&&(l instanceof Di?r=r.concat(l.members):r.push(l))}return Di.from(r)}eq(e){if(!(e instanceof Di)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let l=this.members[o].localsInner(e);if(l.length)if(!n)n=l;else{r&&(n=n.slice(),r=!1);for(let a=0;a<l.length;a++)n.push(l[a])}}return n?Mg(r?n:n.sort(_o)):js}static from(e){switch(e.length){case 0:return Ht;case 1:return e[0];default:return new Di(e.every(n=>n instanceof lt)?e:e.reduce((n,r)=>n.concat(r instanceof lt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function XB(t,e,n,r,o,l,a){let c=t.slice();for(let h=0,p=l;h<n.maps.length;h++){let g=0;n.maps[h].forEach((v,b,S,x)=>{let C=x-S-(b-v);for(let E=0;E<c.length;E+=3){let A=c[E+1];if(A<0||v>A+p-g)continue;let O=c[E]+p-g;b>=O?c[E+1]=v<=O?-2:-1:v>=p&&C&&(c[E]+=C,c[E+1]+=C)}g+=C}),p=n.maps[h].map(p,-1)}let d=!1;for(let h=0;h<c.length;h+=3)if(c[h+1]<0){if(c[h+1]==-2){d=!0,c[h+1]=-1;continue}let p=n.map(t[h]+l),g=p-o;if(g<0||g>=r.content.size){d=!0;continue}let v=n.map(t[h+1]+l,-1),b=v-o,{index:S,offset:x}=r.content.findIndex(g),C=r.maybeChild(S);if(C&&x==g&&x+C.nodeSize==b){let E=c[h+2].mapInner(n,C,p+1,t[h]+l+1,a);E!=Ht?(c[h]=g,c[h+1]=b,c[h+2]=E):(c[h+1]=-2,d=!0)}else d=!0}if(d){let h=JB(c,t,e,n,o,l,a),p=Jc(h,r,0,a);e=p.local;for(let g=0;g<c.length;g+=3)c[g+1]<0&&(c.splice(g,3),g-=3);for(let g=0,v=0;g<p.children.length;g+=3){let b=p.children[g];for(;v<c.length&&c[v]<b;)v+=3;c.splice(v,0,p.children[g],p.children[g+1],p.children[g+2])}}return new lt(e.sort(_o),c)}function nR(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Ut(o.from+e,o.to+e,o.type))}return n}function JB(t,e,n,r,o,l,a){function c(d,h){for(let p=0;p<d.local.length;p++){let g=d.local[p].map(r,o,h);g?n.push(g):a.onRemove&&a.onRemove(d.local[p].spec)}for(let p=0;p<d.children.length;p+=3)c(d.children[p+2],d.children[p]+h+1)}for(let d=0;d<t.length;d+=3)t[d+1]==-1&&c(t[d+2],e[d]+l+1);return n}function rR(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let l=0,a;l<t.length;l++)(a=t[l])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),t[l]=null);return o}function iR(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Jc(t,e,n,r){let o=[],l=!1;e.forEach((c,d)=>{let h=rR(t,c,d+n);if(h){l=!0;let p=Jc(h,c,n+d+1,r);p!=Ht&&o.push(d,d+c.nodeSize,p)}});let a=nR(l?iR(t):t,-n).sort(_o);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||(r.onRemove&&r.onRemove(a[c].spec),a.splice(c--,1));return a.length||o.length?new lt(a,o):Ht}function _o(t,e){return t.from-e.from||t.to-e.to}function Mg(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let l=e[o];if(l.from==r.from){l.to!=r.to&&(e==t&&(e=t.slice()),e[o]=l.copy(l.from,r.to),Cx(e,o+1,l.copy(r.to,l.to)));continue}else{l.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,l.from),Cx(e,o,r.copy(l.from,r.to)));break}}}return e}function Cx(t,e,n){for(;e<t.length&&_o(n,t[e])>0;)e++;t.splice(e,0,n)}function Np(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ht&&e.push(r)}),t.cursorWrapper&&e.push(lt.create(t.state.doc,[t.cursorWrapper.deco])),Di.from(e)}const QB={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ZB=hn&&Bi<=11;class WB{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class eV{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new WB,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);hn&&Bi<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Gt&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ZB&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,QB)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(mx(this.view)){if(this.suppressingSelectionUpdates)return Kr(this.view);if(hn&&Bi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Bo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let l=e.focusNode;l;l=Ks(l))n.add(l);for(let l=e.anchorNode;l;l=Ks(l))if(n.has(l)){r=l;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&mx(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,c=!1,d=[];if(e.editable)for(let p=0;p<n.length;p++){let g=this.registerMutation(n[p],d);g&&(l=l<0?g.from:Math.min(g.from,l),a=a<0?g.to:Math.max(g.to,a),g.typeOver&&(c=!0))}if(d.some(p=>p.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let p of d)if(p.nodeName=="BR"&&p.parentNode){let g=p.nextSibling;for(;g&&g.nodeType==1;){if(g.contentEditable=="false"){p.parentNode.removeChild(p);break}g=g.firstChild}}}else if(Un&&d.length){let p=d.filter(g=>g.nodeName=="BR");if(p.length==2){let[g,v]=p;g.parentNode&&g.parentNode.parentNode==v.parentNode?v.remove():g.remove()}else{let{focusNode:g}=this.currentSelection;for(let v of p){let b=v.parentNode;b&&b.nodeName=="LI"&&(!g||rV(e,g)!=b)&&v.remove()}}}let h=null;l<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tf(r)&&(h=yg(e))&&h.eq(ze.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Kr(e),this.currentSelection.set(r),e.scrollToSelection()):(l>-1||o)&&(l>-1&&(e.docView.markDirty(l,a),tV(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,iV(e,d)),this.handleDOMChange(l,a,c,d),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Kr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let p=0;p<e.addedNodes.length;p++){let g=e.addedNodes[p];n.push(g),g.nodeType==3&&(this.lastChangedTextNode=g)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,l=e.nextSibling;if(hn&&Bi<=11&&e.addedNodes.length)for(let p=0;p<e.addedNodes.length;p++){let{previousSibling:g,nextSibling:v}=e.addedNodes[p];(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(o=g),(!v||Array.prototype.indexOf.call(e.addedNodes,v)<0)&&(l=v)}let a=o&&o.parentNode==e.target?Lt(o)+1:0,c=r.localPosFromDOM(e.target,a,-1),d=l&&l.parentNode==e.target?Lt(l):e.target.childNodes.length,h=r.localPosFromDOM(e.target,d,1);return{from:c,to:h}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Mx=new WeakMap,Ex=!1;function tV(t){if(!Mx.has(t)&&(Mx.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Un,Ex)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Ex=!0}}function Rx(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,l=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Bo(a.node,a.offset,o,l)&&([n,r,o,l]=[o,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:l}}function nV(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Rx(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Rx(t,n):null}function rV(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function iV(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let l of e)if(((n=l.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=l.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let c=a;for(;;){let d=c.firstChild;if(!d||d.nodeType!=1||d.contentEditable=="false"||/^(BR|IMG)$/.test(d.nodeName))break;c=d}c.insertBefore(l,c.firstChild),r==l&&t.domSelection().collapse(l,o)}else l.parentNode.removeChild(l)}}function oV(t,e,n){let{node:r,fromOffset:o,toOffset:l,from:a,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),h,p=d.anchorNode;if(p&&t.dom.contains(p.nodeType==1?p:p.parentNode)&&(h=[{node:p,offset:d.anchorOffset}],Tf(d)||h.push({node:d.focusNode,offset:d.focusOffset})),Vt&&t.input.lastKeyCode===8)for(let C=l;C>o;C--){let E=r.childNodes[C-1],A=E.pmViewDesc;if(E.nodeName=="BR"&&!A){l=C;break}if(!A||A.size)break}let g=t.state.doc,v=t.someProp("domParser")||Li.fromSchema(t.state.schema),b=g.resolve(a),S=null,x=v.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:o,to:l,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:sV,context:b});if(h&&h[0].pos!=null){let C=h[0].pos,E=h[1]&&h[1].pos;E==null&&(E=C),S={anchor:C+a,head:E+a}}return{doc:x,sel:S,from:a,to:c}}function sV(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Gt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Gt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const lV=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function aV(t,e,n,r,o){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=yg(t,_);if(I&&!t.state.selection.eq(I)){if(Vt&&Gr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ue=>ue(t,Eo(13,"Enter"))))return;let Q=t.state.tr.setSelection(I);_=="pointer"?Q.setMeta("pointer",!0):_=="key"&&Q.scrollIntoView(),l&&Q.setMeta("composition",l),t.dispatch(Q)}return}let a=t.state.doc.resolve(e),c=a.sharedDepth(n);e=a.before(c+1),n=t.state.doc.resolve(n).after(c+1);let d=t.state.selection,h=oV(t,e,n),p=t.state.doc,g=p.slice(h.from,h.to),v,b;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(v=t.state.selection.to,b="end"):(v=t.state.selection.from,b="start"),t.input.lastKeyCode=null;let S=fV(g.content,h.doc.content,h.from,v,b);if(S&&t.input.domChangeCount++,(Ys&&t.input.lastIOSEnter>Date.now()-225||Gr)&&o.some(_=>_.nodeType==1&&!lV.test(_.nodeName))&&(!S||S.endA>=S.endB)&&t.someProp("handleKeyDown",_=>_(t,Eo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!S)if(r&&d instanceof Ae&&!d.empty&&d.$head.sameParent(d.$anchor)&&!t.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))S={start:d.from,endA:d.to,endB:d.to};else{if(h.sel){let _=Tx(t,t.state.doc,h.sel);if(_&&!_.eq(t.state.selection)){let I=t.state.tr.setSelection(_);l&&I.setMeta("composition",l),t.dispatch(I)}}return}t.state.selection.from<t.state.selection.to&&S.start==S.endB&&t.state.selection instanceof Ae&&(S.start>t.state.selection.from&&S.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?S.start=t.state.selection.from:S.endA<t.state.selection.to&&S.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(S.endB+=t.state.selection.to-S.endA,S.endA=t.state.selection.to)),hn&&Bi<=11&&S.endB==S.start+1&&S.endA==S.start&&S.start>h.from&&h.doc.textBetween(S.start-h.from-1,S.start-h.from+1)==" "&&(S.start--,S.endA--,S.endB--);let x=h.doc.resolveNoCache(S.start-h.from),C=h.doc.resolveNoCache(S.endB-h.from),E=p.resolve(S.start),A=x.sameParent(C)&&x.parent.inlineContent&&E.end()>=S.endA;if((Ys&&t.input.lastIOSEnter>Date.now()-225&&(!A||o.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!A&&x.pos<h.doc.content.size&&(!x.sameParent(C)||!x.parent.inlineContent)&&x.pos<C.pos&&!/\S/.test(h.doc.textBetween(x.pos,C.pos,"","")))&&t.someProp("handleKeyDown",_=>_(t,Eo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>S.start&&cV(p,S.start,S.endA,x,C)&&t.someProp("handleKeyDown",_=>_(t,Eo(8,"Backspace")))){Gr&&Vt&&t.domObserver.suppressSelectionUpdates();return}Vt&&S.endB==S.start&&(t.input.lastChromeDelete=Date.now()),Gr&&!A&&x.start()!=C.start()&&C.parentOffset==0&&x.depth==C.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==S.endA&&(S.endB-=2,C=h.doc.resolveNoCache(S.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",function(_){return _(t,Eo(13,"Enter"))})},20));let O=S.start,D=S.endA,z=_=>{let I=_||t.state.tr.replace(O,D,h.doc.slice(S.start-h.from,S.endB-h.from));if(h.sel){let Q=Tx(t,I.doc,h.sel);Q&&!(Vt&&t.composing&&Q.empty&&(S.start!=S.endB||t.input.lastChromeDelete<Date.now()-100)&&(Q.head==O||Q.head==I.mapping.map(D)-1)||hn&&Q.empty&&Q.head==O)&&I.setSelection(Q)}return l&&I.setMeta("composition",l),I.scrollIntoView()},L;if(A)if(x.pos==C.pos){hn&&Bi<=11&&x.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Kr(t),20));let _=z(t.state.tr.delete(O,D)),I=p.resolve(S.start).marksAcross(p.resolve(S.endA));I&&_.ensureMarks(I),t.dispatch(_)}else if(S.endA==S.endB&&(L=uV(x.parent.content.cut(x.parentOffset,C.parentOffset),E.parent.content.cut(E.parentOffset,S.endA-E.start())))){let _=z(t.state.tr);L.type=="add"?_.addMark(O,D,L.mark):_.removeMark(O,D,L.mark),t.dispatch(_)}else if(x.parent.child(x.index()).isText&&x.index()==C.index()-(C.textOffset?0:1)){let _=x.parent.textBetween(x.parentOffset,C.parentOffset),I=()=>z(t.state.tr.insertText(_,O,D));t.someProp("handleTextInput",Q=>Q(t,O,D,_,I))||t.dispatch(I())}else t.dispatch(z());else t.dispatch(z())}function Tx(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:vg(t,e.resolve(n.anchor),e.resolve(n.head))}function uV(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,l=r,a,c,d;for(let p=0;p<r.length;p++)o=r[p].removeFromSet(o);for(let p=0;p<n.length;p++)l=n[p].removeFromSet(l);if(o.length==1&&l.length==0)c=o[0],a="add",d=p=>p.mark(c.addToSet(p.marks));else if(o.length==0&&l.length==1)c=l[0],a="remove",d=p=>p.mark(c.removeFromSet(p.marks));else return null;let h=[];for(let p=0;p<e.childCount;p++)h.push(d(e.child(p)));if(te.from(h).eq(t))return{mark:c,type:a}}function cV(t,e,n,r,o){if(n-e<=o.pos-r.pos||Dp(r,!0,!1)<o.pos)return!1;let l=t.resolve(e);if(!r.parent.isTextblock){let c=l.nodeAfter;return c!=null&&n==e+c.nodeSize}if(l.parentOffset<l.parent.content.size||!l.parent.isTextblock)return!1;let a=t.resolve(Dp(l,!0,!0));return!a.parent.isTextblock||a.pos>n||Dp(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Dp(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let l=t.node(r).maybeChild(t.indexAfter(r));for(;l&&!l.isLeaf;)l=l.firstChild,o++}return o}function fV(t,e,n,r,o){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:c}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let d=Math.max(0,l-Math.min(a,c));r-=a+d-l}if(a<l&&t.size<e.size){let d=r<=l&&r>=a?l-r:0;l-=d,l&&l<e.size&&Ax(e.textBetween(l-1,l+1))&&(l+=d?1:-1),c=l+(c-a),a=l}else if(c<l){let d=r<=l&&r>=c?l-r:0;l-=d,l&&l<t.size&&Ax(t.textBetween(l-1,l+1))&&(l+=d?1:-1),a=l+(a-c),c=l}return{start:l,endA:a,endB:c}}function Ax(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class oR{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new TB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(_x),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Nx(this),kx(this),this.nodeViews=Dx(this),this.docView=ux(this.state.doc,Ox(this),Np(this),this.dom,this),this.domObserver=new eV(this,(r,o,l,a)=>aV(this,r,o,l,a)),this.domObserver.start(),AB(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Am(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(_x),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(ZE(this),a=!0),this.state=e;let c=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(c||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let b=Dx(this);hV(b,this.nodeViews)&&(this.nodeViews=b,l=!0)}(c||n.handleDOMEvents!=this._props.handleDOMEvents)&&Am(this),this.editable=Nx(this),kx(this);let d=Np(this),h=Ox(this),p=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",g=l||!this.docView.matchesNode(e.doc,h,d);(g||!e.selection.eq(o.selection))&&(a=!0);let v=p=="preserve"&&a&&this.dom.style.overflowAnchor==null&&$L(this);if(a){this.domObserver.stop();let b=g&&(hn||Vt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&dV(o.selection,e.selection);if(g){let S=Vt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=$B(this)),(l||!this.docView.update(e.doc,h,d,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=ux(e.doc,h,d,this.dom,this)),S&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&dB(this))?Kr(this,b):(FE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),p=="reset"?this.dom.scrollTop=0:p=="to selection"?this.scrollToSelection():v&&HL(v)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof we){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&rx(this,n.getBoundingClientRect(),e)}else rx(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let l=r.from+(this.state.doc.content.size-n.doc.content.size);(l>0&&l<this.state.doc.content.size&&this.state.doc.nodeAt(l))==r.node&&(o=l)}this.dragging=new eR(e.slice,e.move,o<0?void 0:we.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let c=this.directPlugins[a].props[e];if(c!=null&&(o=n?n(c):c))return o}let l=this.state.plugins;if(l)for(let a=0;a<l.length;a++){let c=l[a].props[e];if(c!=null&&(o=n?n(c):c))return o}}hasFocus(){if(hn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&UL(this.dom),Kr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return XL(this,e)}coordsAtPos(e,n=1){return DE(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return eB(this,n||this.state,e)}pasteHTML(e,n){return wa(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return wa(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return bg(this,e)}destroy(){this.docView&&(OB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Np(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,DL())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return NB(this,e)}domSelectionRange(){let e=this.domSelection();return e?Gt&&this.root.nodeType===11&&LL(this.dom.ownerDocument)==this.dom&&nV(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}oR.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Ox(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ut.node(0,t.state.doc.content.size,e)]}function kx(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ut.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Nx(t){return!t.someProp("editable",e=>e(t.state)===!1)}function dV(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Dx(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function hV(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function _x(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Gi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pV=typeof navigator<"u"&&/Mac/.test(navigator.platform),mV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Bt=0;Bt<10;Bt++)Gi[48+Bt]=Gi[96+Bt]=String(Bt);for(var Bt=1;Bt<=24;Bt++)Gi[Bt+111]="F"+Bt;for(var Bt=65;Bt<=90;Bt++)Gi[Bt]=String.fromCharCode(Bt+32),Qc[Bt]=String.fromCharCode(Bt);for(var _p in Gi)Qc.hasOwnProperty(_p)||(Qc[_p]=Gi[_p]);function gV(t){var e=pV&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||mV&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Qc:Gi)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const yV=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),vV=typeof navigator<"u"&&/Win/.test(navigator.platform);function bV(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,l,a;for(let c=0;c<e.length-1;c++){let d=e[c];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))yV?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),a&&(n="Meta-"+n),l&&(n="Shift-"+n),n}function SV(t){let e=Object.create(null);for(let n in t)e[bV(n)]=t[n];return e}function zp(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function xV(t){return new St({props:{handleKeyDown:sR(t)}})}function sR(t){let e=SV(t);return function(n,r){let o=gV(r),l,a=e[zp(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let c=e[zp(o,r,!1)];if(c&&c(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(vV&&r.ctrlKey&&r.altKey)&&(l=Gi[r.keyCode])&&l!=o){let c=e[zp(l,r)];if(c&&c(n.state,n.dispatch,n))return!0}}return!1}}var wV=Object.defineProperty,Eg=(t,e)=>{for(var n in e)wV(t,n,{get:e[n],enumerable:!0})};function kf(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:l}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return l},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,l=n.storedMarks,n}}}var Nf=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,l=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...h)=>{const p=c(...h)(l);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:l}=r,a=[],c=!!t,d=t||o.tr,h=()=>(!c&&e&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),a.every(g=>g===!0)),p={...Object.fromEntries(Object.entries(n).map(([g,v])=>[g,(...S)=>{const x=this.buildProps(d,e),C=v(...S)(x);return a.push(C),p}])),run:h};return p}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,l=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([c,d])=>[c,(...h)=>d(...h)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:l}=r,a={tr:t,editor:r,view:l,state:kf({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([c,d])=>[c,(...h)=>d(...h)(a)]))}};return a}},lR={};Eg(lR,{blur:()=>CV,clearContent:()=>MV,clearNodes:()=>EV,command:()=>RV,createParagraphNear:()=>TV,cut:()=>AV,deleteCurrentNode:()=>OV,deleteNode:()=>kV,deleteRange:()=>NV,deleteSelection:()=>DV,enter:()=>_V,exitCode:()=>zV,extendMarkRange:()=>jV,first:()=>IV,focus:()=>BV,forEach:()=>VV,insertContent:()=>FV,insertContentAt:()=>HV,joinBackward:()=>qV,joinDown:()=>GV,joinForward:()=>KV,joinItemBackward:()=>YV,joinItemForward:()=>XV,joinTextblockBackward:()=>JV,joinTextblockForward:()=>QV,joinUp:()=>UV,keyboardShortcut:()=>WV,lift:()=>e4,liftEmptyBlock:()=>t4,liftListItem:()=>n4,newlineInCode:()=>r4,resetAttributes:()=>i4,scrollIntoView:()=>o4,selectAll:()=>s4,selectNodeBackward:()=>l4,selectNodeForward:()=>a4,selectParentNode:()=>u4,selectTextblockEnd:()=>c4,selectTextblockStart:()=>f4,setContent:()=>d4,setMark:()=>_4,setMeta:()=>z4,setNode:()=>j4,setNodeSelection:()=>I4,setTextDirection:()=>L4,setTextSelection:()=>B4,sinkListItem:()=>V4,splitBlock:()=>F4,splitListItem:()=>P4,toggleList:()=>$4,toggleMark:()=>H4,toggleNode:()=>U4,toggleWrap:()=>G4,undoInputRule:()=>q4,unsetAllMarks:()=>K4,unsetMark:()=>Y4,unsetTextDirection:()=>X4,updateAttributes:()=>J4,wrapIn:()=>Q4,wrapInList:()=>Z4});var CV=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),MV=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),EV=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:l,$to:a})=>{t.doc.nodesBetween(l.pos,a.pos,(c,d)=>{if(c.type.isText)return;const{doc:h,mapping:p}=e,g=h.resolve(p.map(d)),v=h.resolve(p.map(d+c.nodeSize)),b=g.blockRange(v);if(!b)return;const S=el(b);if(c.type.isTextblock){const{defaultType:x}=g.parent.contentMatchAt(g.index());e.setNodeMarkup(b.start,x)}(S||S===0)&&e.lift(b,S)})}),!0},RV=t=>e=>t(e),TV=()=>({state:t,dispatch:e})=>xE(t,e),AV=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,l=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,l.content),r.setSelection(new Ae(r.doc.resolve(Math.max(a-1,0)))),!0},OV=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===r.type){if(e){const c=o.before(l),d=o.after(l);t.delete(c,d).scrollIntoView()}return!0}return!1};function Nt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var kV=t=>({tr:e,state:n,dispatch:r})=>{const o=Nt(t,n.schema),l=e.selection.$anchor;for(let a=l.depth;a>0;a-=1)if(l.node(a).type===o){if(r){const d=l.before(a),h=l.after(a);e.delete(d,h).scrollIntoView()}return!0}return!1},NV=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},DV=()=>({state:t,dispatch:e})=>fg(t,e),_V=()=>({commands:t})=>t.keyboardShortcut("Enter"),zV=()=>({state:t,dispatch:e})=>yL(t,e);function Rg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Zc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Rg(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function aR(t,e,n={}){return t.find(r=>r.type===e&&Zc(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function zx(t,e,n={}){return!!aR(t,e,n)}function uR(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(p=>p.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(p=>p.type===e)||(n=n||((r=o.node.marks[0])==null?void 0:r.attrs),!aR([...o.node.marks],e,n)))return;let a=o.index,c=t.start()+o.offset,d=a+1,h=c+o.node.nodeSize;for(;a>0&&zx([...t.parent.child(a-1).marks],e,n);)a-=1,c-=t.parent.child(a).nodeSize;for(;d<t.parent.childCount&&zx([...t.parent.child(d).marks],e,n);)h+=t.parent.child(d).nodeSize,d+=1;return{from:c,to:h}}function Qr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var jV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const l=Qr(t,r.schema),{doc:a,selection:c}=n,{$from:d,from:h,to:p}=c;if(o){const g=uR(d,l,e);if(g&&g.from<=h&&g.to>=p){const v=Ae.create(a,g.from,g.to);n.setSelection(v)}}return!0},IV=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function cR(t){return t instanceof Ae}function Oo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function fR(t,e=null){if(!e)return null;const n=ze.atStart(t),r=ze.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,l=r.to;return e==="all"?Ae.create(t,Oo(0,o,l),Oo(t.content.size,o,l)):Ae.create(t,Oo(e,o,l),Oo(e,o,l))}function jx(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Wc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function LV(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var BV=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:l})=>{e={scrollIntoView:!0,...e};const a=()=>{(Wc()||jx())&&r.dom.focus(),LV()&&!Wc()&&!jx()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(l&&t===null&&!cR(n.state.selection))return a(),!0;const c=fR(o.doc,t)||n.state.selection,d=n.state.selection.eq(c);return l&&(d||o.setSelection(c),d&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},VV=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),FV=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),dR=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&dR(r)}return t};function vc(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return dR(n)}function Ma(t,e,n){if(t instanceof Ii||t instanceof te)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return te.fromArray(t.map(c=>e.nodeFromJSON(c)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(l){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:l});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",l),Ma("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,c="";const d=new KM({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,c=typeof h=="string"?h:h.outerHTML,null)}]}})});if(n.slice?Li.fromSchema(d).parseSlice(vc(t),n.parseOptions):Li.fromSchema(d).parse(vc(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const l=Li.fromSchema(e);return n.slice?l.parseSlice(vc(t),n.parseOptions).content:l.parse(vc(t),n.parseOptions)}return Ma("",e,n)}function PV(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof At||o instanceof Ot))return;const l=t.mapping.maps[r];let a=0;l.forEach((c,d,h,p)=>{a===0&&(a=p)}),t.setSelection(ze.near(t.doc.resolve(a),n))}var $V=t=>!("type"in t),HV=(t,e,n)=>({tr:r,dispatch:o,editor:l})=>{var a;if(o){n={parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let c;const d=C=>{l.emit("contentError",{editor:l,error:C,disableCollaboration:()=>{"collaboration"in l.storage&&typeof l.storage.collaboration=="object"&&l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!l.options.enableContentCheck&&l.options.emitContentError)try{Ma(e,l.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(C){d(C)}try{c=Ma(e,l.schema,{parseOptions:h,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:l.options.enableContentCheck})}catch(C){return d(C),!1}let{from:p,to:g}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},v=!0,b=!0;if(($V(c)?c:[c]).forEach(C=>{C.check(),v=v?C.isText&&C.marks.length===0:!1,b=b?C.isBlock:!1}),p===g&&b){const{parent:C}=r.doc.resolve(p);C.isTextblock&&!C.type.spec.code&&!C.childCount&&(p-=1,g+=1)}let x;if(v){if(Array.isArray(e))x=e.map(C=>C.text||"").join("");else if(e instanceof te){let C="";e.forEach(E=>{E.text&&(C+=E.text)}),x=C}else typeof e=="object"&&e&&e.text?x=e.text:x=e;r.insertText(x,p,g)}else{x=c;const C=r.doc.resolve(p),E=C.node(),A=C.parentOffset===0,O=E.isText||E.isTextblock,D=E.content.size>0;A&&O&&D&&(p=Math.max(0,p-1)),r.replaceWith(p,g,x)}n.updateSelection&&PV(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:p,text:x}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:p,text:x})}return!0},UV=()=>({state:t,dispatch:e})=>pL(t,e),GV=()=>({state:t,dispatch:e})=>mL(t,e),qV=()=>({state:t,dispatch:e})=>pE(t,e),KV=()=>({state:t,dispatch:e})=>vE(t,e),YV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Mf(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},XV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Mf(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},JV=()=>({state:t,dispatch:e})=>dL(t,e),QV=()=>({state:t,dispatch:e})=>hL(t,e);function hR(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ZV(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,l,a;for(let c=0;c<e.length-1;c+=1){const d=e[c];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))Wc()||hR()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${d}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),l&&(n=`Shift-${n}`),n}var WV=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const l=ZV(t).split(/-(?!$)/),a=l.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),c=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:l.includes("Alt"),ctrlKey:l.includes("Ctrl"),metaKey:l.includes("Meta"),shiftKey:l.includes("Shift"),bubbles:!0,cancelable:!0}),d=e.captureTransaction(()=>{n.someProp("handleKeyDown",h=>h(n,c))});return d?.steps.forEach(h=>{const p=h.map(r.mapping);p&&o&&r.maybeStep(p)}),!0};function Ea(t,e,n={}){const{from:r,to:o,empty:l}=t.selection,a=e?Nt(e,t.schema):null,c=[];t.doc.nodesBetween(r,o,(g,v)=>{if(g.isText)return;const b=Math.max(r,v),S=Math.min(o,v+g.nodeSize);c.push({node:g,from:b,to:S})});const d=o-r,h=c.filter(g=>a?a.name===g.node.type.name:!0).filter(g=>Zc(g.node.attrs,n,{strict:!1}));return l?!!h.length:h.reduce((g,v)=>g+v.to-v.from,0)>=d}var e4=(t,e={})=>({state:n,dispatch:r})=>{const o=Nt(t,n.schema);return Ea(n,o,e)?gL(n,r):!1},t4=()=>({state:t,dispatch:e})=>wE(t,e),n4=t=>({state:e,dispatch:n})=>{const r=Nt(t,e.schema);return AL(r)(e,n)},r4=()=>({state:t,dispatch:e})=>SE(t,e);function Df(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ix(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var i4=(t,e)=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=Df(typeof t=="string"?t:t.name,r.schema);if(!c)return!1;c==="node"&&(l=Nt(t,r.schema)),c==="mark"&&(a=Qr(t,r.schema));let d=!1;return n.selection.ranges.forEach(h=>{r.doc.nodesBetween(h.$from.pos,h.$to.pos,(p,g)=>{l&&l===p.type&&(d=!0,o&&n.setNodeMarkup(g,void 0,Ix(p.attrs,e))),a&&p.marks.length&&p.marks.forEach(v=>{a===v.type&&(d=!0,o&&n.addMark(g,g+p.nodeSize,a.create(Ix(v.attrs,e))))})})}),d},o4=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),s4=()=>({tr:t,dispatch:e})=>{if(e){const n=new An(t.doc);t.setSelection(n)}return!0},l4=()=>({state:t,dispatch:e})=>gE(t,e),a4=()=>({state:t,dispatch:e})=>bE(t,e),u4=()=>({state:t,dispatch:e})=>SL(t,e),c4=()=>({state:t,dispatch:e})=>CL(t,e),f4=()=>({state:t,dispatch:e})=>wL(t,e);function Om(t,e,n={},r={}){return Ma(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var d4=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:l,dispatch:a,commands:c})=>{const{doc:d}=l;if(r.preserveWhitespace!=="full"){const h=Om(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return a&&l.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!n),!0}return a&&l.setMeta("preventUpdate",!n),c.insertContentAt({from:0,to:d.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function pR(t,e){const n=Qr(e,t.schema),{from:r,to:o,empty:l}=t.selection,a=[];l?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,d=>{a.push(...d.marks)});const c=a.find(d=>d.type.name===n.name);return c?{...c.attrs}:{}}function h4(t,e){const n=new cE(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function p4(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function m4(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Tg(t){return e=>m4(e.$from,t)}function be(t,e,n){return t.config[e]===void 0&&t.parent?be(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?be(t.parent,e,n):null}):t.config[e]}function Ag(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=be(e,"addExtensions",n);return r?[e,...Ag(r())]:e}).flat(10)}function Og(t,e){const n=$o.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function mR(t){return typeof t=="function"}function st(t,e=void 0,...n){return mR(t)?e?t.bind(e)(...n):t(...n):t}function g4(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Xs(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function gR(t){const e=[],{nodeExtensions:n,markExtensions:r}=Xs(t),o=[...n,...r],l={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(h=>h.name!=="text").map(h=>h.name),c=r.map(h=>h.name),d=[...a,...c];return t.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage,extensions:o},g=be(h,"addGlobalAttributes",p);if(!g)return;g().forEach(b=>{let S;Array.isArray(b.types)?S=b.types:b.types==="*"?S=d:b.types==="nodes"?S=a:b.types==="marks"?S=c:S=[],S.forEach(x=>{Object.entries(b.attributes).forEach(([C,E])=>{e.push({type:x,name:C,attribute:{...l,...E}})})})})}),o.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage},g=be(h,"addAttributes",p);if(!g)return;const v=g();Object.entries(v).forEach(([b,S])=>{const x={...l,...S};typeof x?.default=="function"&&(x.default=x.default()),x?.isRequired&&x?.default===void 0&&delete x.default,e.push({type:h.name,name:b,attribute:x})})}),e}function y4(t){const e=[];let n="",r=!1,o=!1,l=0;const a=t.length;for(let c=0;c<a;c+=1){const d=t[c];if(d==="'"&&!o){r=!r,n+=d;continue}if(d==='"'&&!r){o=!o,n+=d;continue}if(!r&&!o){if(d==="("){l+=1,n+=d;continue}if(d===")"&&l>0){l-=1,n+=d;continue}if(d===";"&&l===0){e.push(n),n="";continue}}n+=d}return n&&e.push(n),e}function Lx(t){const e=[],n=y4(t||""),r=n.length;for(let o=0;o<r;o+=1){const l=n[o],a=l.indexOf(":");if(a===-1)continue;const c=l.slice(0,a).trim(),d=l.slice(a+1).trim();c&&d&&e.push([c,d])}return e}function yR(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,l])=>{if(!r[o]){r[o]=l;return}if(o==="class"){const c=l?String(l).split(" "):[],d=r[o]?r[o].split(" "):[],h=c.filter(p=>!d.includes(p));r[o]=[...d,...h].join(" ")}else if(o==="style"){const c=new Map([...Lx(r[o]),...Lx(l)]);r[o]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[o]=l}),r},{})}function ef(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>yR(n,r),{})}function v4(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Bx(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((l,a)=>{const c=a.attribute.parseHTML?a.attribute.parseHTML(n):v4(n.getAttribute(a.name));return c==null?l:{...l,[a.name]:c}},{});return{...r,...o}}}}function Vx(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&g4(n)?!1:n!=null))}function Fx(t){var e,n;const r={};return!((e=t?.attribute)!=null&&e.isRequired)&&"default"in(t?.attribute||{})&&(r.default=t.attribute.default),((n=t?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function b4(t,e){var n;const r=gR(t),{nodeExtensions:o,markExtensions:l}=Xs(t),a=(n=o.find(h=>be(h,"topNode")))==null?void 0:n.name,c=Object.fromEntries(o.map(h=>{const p=r.filter(E=>E.type===h.name),g={name:h.name,options:h.options,storage:h.storage,editor:e},v=t.reduce((E,A)=>{const O=be(A,"extendNodeSchema",g);return{...E,...O?O(h):{}}},{}),b=Vx({...v,content:st(be(h,"content",g)),marks:st(be(h,"marks",g)),group:st(be(h,"group",g)),inline:st(be(h,"inline",g)),atom:st(be(h,"atom",g)),selectable:st(be(h,"selectable",g)),draggable:st(be(h,"draggable",g)),code:st(be(h,"code",g)),whitespace:st(be(h,"whitespace",g)),linebreakReplacement:st(be(h,"linebreakReplacement",g)),defining:st(be(h,"defining",g)),isolating:st(be(h,"isolating",g)),attrs:Object.fromEntries(p.map(Fx))}),S=st(be(h,"parseHTML",g));S&&(b.parseDOM=S.map(E=>Bx(E,p)));const x=be(h,"renderHTML",g);x&&(b.toDOM=E=>x({node:E,HTMLAttributes:ef(E,p)}));const C=be(h,"renderText",g);return C&&(b.toText=C),[h.name,b]})),d=Object.fromEntries(l.map(h=>{const p=r.filter(C=>C.type===h.name),g={name:h.name,options:h.options,storage:h.storage,editor:e},v=t.reduce((C,E)=>{const A=be(E,"extendMarkSchema",g);return{...C,...A?A(h):{}}},{}),b=Vx({...v,inclusive:st(be(h,"inclusive",g)),excludes:st(be(h,"excludes",g)),group:st(be(h,"group",g)),spanning:st(be(h,"spanning",g)),code:st(be(h,"code",g)),attrs:Object.fromEntries(p.map(Fx))}),S=st(be(h,"parseHTML",g));S&&(b.parseDOM=S.map(C=>Bx(C,p)));const x=be(h,"renderHTML",g);return x&&(b.toDOM=C=>x({mark:C,HTMLAttributes:ef(C,p)})),[h.name,b]}));return new KM({topNode:a,nodes:c,marks:d})}function S4(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ca(t){return t.sort((n,r)=>{const o=be(n,"priority")||100,l=be(r,"priority")||100;return o>l?-1:o<l?1:0})}function vR(t){const e=ca(Ag(t)),n=S4(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function bR(t,e,n){const{from:r,to:o}=e,{blockSeparator:l=`
|
|
65
|
+
|
|
66
|
+
`,textSerializers:a={}}=n||{};let c="";return t.nodesBetween(r,o,(d,h,p,g)=>{var v;d.isBlock&&h>r&&(c+=l);const b=a?.[d.type.name];if(b)return p&&(c+=b({node:d,pos:h,parent:p,index:g,range:e})),!1;d.isText&&(c+=(v=d?.text)==null?void 0:v.slice(Math.max(r,h)-h,o-h))}),c}function x4(t,e){const n={from:0,to:t.content.size};return bR(t,n,e)}function SR(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function w4(t,e){const n=Nt(e,t.schema),{from:r,to:o}=t.selection,l=[];t.doc.nodesBetween(r,o,c=>{l.push(c)});const a=l.reverse().find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function C4(t,e){const n=Df(typeof e=="string"?e:e.name,t.schema);return n==="node"?w4(t,e):n==="mark"?pR(t,e):{}}function M4(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function E4(t){const e=M4(t);return e.length===1?e:e.filter((n,r)=>!e.filter((l,a)=>a!==r).some(l=>n.oldRange.from>=l.oldRange.from&&n.oldRange.to<=l.oldRange.to&&n.newRange.from>=l.newRange.from&&n.newRange.to<=l.newRange.to))}function R4(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,l)=>{const a=[];if(o.ranges.length)o.forEach((c,d)=>{a.push({from:c,to:d})});else{const{from:c,to:d}=n[l];if(c===void 0||d===void 0)return;a.push({from:c,to:d})}a.forEach(({from:c,to:d})=>{const h=e.slice(l).map(c,-1),p=e.slice(l).map(d),g=e.invert().map(h,-1),v=e.invert().map(p);r.push({oldRange:{from:g,to:v},newRange:{from:h,to:p}})})}),E4(r)}function Zl(t,e){return e.nodes[t]||e.marks[t]||null}function kc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(l=>l.type===e&&l.name===r);return o?o.attribute.keepOnSplit:!1}))}var T4=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,l,a,c)=>{var d,h;const p=((h=(d=o.type.spec).toText)==null?void 0:h.call(d,{node:o,pos:l,parent:a,index:c}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?p:p.slice(0,Math.max(0,r-l))}),n};function km(t,e,n={}){const{empty:r,ranges:o}=t.selection,l=e?Qr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(g=>l?l.name===g.type.name:!0).find(g=>Zc(g.attrs,n,{strict:!1}));let a=0;const c=[];if(o.forEach(({$from:g,$to:v})=>{const b=g.pos,S=v.pos;t.doc.nodesBetween(b,S,(x,C)=>{if(l&&x.inlineContent&&!x.type.allowsMarkType(l))return!1;if(!x.isText&&!x.marks.length)return;const E=Math.max(b,C),A=Math.min(S,C+x.nodeSize),O=A-E;a+=O,c.push(...x.marks.map(D=>({mark:D,from:E,to:A})))})}),a===0)return!1;const d=c.filter(g=>l?l.name===g.mark.type.name:!0).filter(g=>Zc(g.mark.attrs,n,{strict:!1})).reduce((g,v)=>g+v.to-v.from,0),h=c.filter(g=>l?g.mark.type!==l&&g.mark.type.excludes(l):!0).reduce((g,v)=>g+v.to-v.from,0);return(d>0?d+h:d)>=a}function A4(t,e,n={}){if(!e)return Ea(t,null,n)||km(t,null,n);const r=Df(e,t.schema);return r==="node"?Ea(t,e,n):r==="mark"?km(t,e,n):!1}function Px(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function $x(t,e){const{nodeExtensions:n}=Xs(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},l=st(be(r,"group",o));return typeof l!="string"?!1:l.split(" ").includes("list")}function _f(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(l=>{o!==!1&&(_f(l,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function O4(t){return t instanceof we}var xR=class wR{constructor(e){this.position=e}static fromJSON(e){return new wR(e.position)}toJSON(){return{position:this.position}}};function k4(t,e){const n=e.mapping.mapResult(t.position);return{position:new xR(n.pos),mapResult:n}}function N4(t){return new xR(t)}function D4(t,e,n){var r;const{selection:o}=e;let l=null;if(cR(o)&&(l=o.$cursor),l){const c=(r=t.storedMarks)!=null?r:l.marks();return l.parent.type.allowsMarkType(n)&&(!!n.isInSet(c)||!c.some(h=>h.type.excludes(n)))}const{ranges:a}=o;return a.some(({$from:c,$to:d})=>{let h=c.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(c.pos,d.pos,(p,g,v)=>{if(h)return!1;if(p.isInline){const b=!v||v.type.allowsMarkType(n),S=!!n.isInSet(p.marks)||!p.marks.some(x=>x.type.excludes(n));h=b&&S}return!h}),h})}var _4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=n,{empty:a,ranges:c}=l,d=Qr(t,r.schema);if(o)if(a){const h=pR(r,d);n.addStoredMark(d.create({...h,...e}))}else c.forEach(h=>{const p=h.$from.pos,g=h.$to.pos;r.doc.nodesBetween(p,g,(v,b)=>{const S=Math.max(b,p),x=Math.min(b+v.nodeSize,g);v.marks.find(E=>E.type===d)?v.marks.forEach(E=>{d===E.type&&n.addMark(S,x,d.create({...E.attrs,...e}))}):n.addMark(S,x,d.create(e))})});return D4(r,n,d)},z4=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),j4=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const l=Nt(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l.isTextblock?o().command(({commands:c})=>ex(l,{...a,...e})(n)?!0:c.clearNodes()).command(({state:c})=>ex(l,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},I4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Oo(t,0,r.content.size),l=we.create(r,o);e.setSelection(l)}return!0},L4=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=r;let a,c;return typeof e=="number"?(a=e,c=e):e&&"from"in e&&"to"in e?(a=e.from,c=e.to):(a=l.from,c=l.to),o&&n.doc.nodesBetween(a,c,(d,h)=>{d.isText||n.setNodeMarkup(h,void 0,{...d.attrs,dir:t})}),!0},B4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:l}=typeof t=="number"?{from:t,to:t}:t,a=Ae.atStart(r).from,c=Ae.atEnd(r).to,d=Oo(o,a,c),h=Oo(l,a,c),p=Ae.create(r,d,h);e.setSelection(p)}return!0},V4=t=>({state:e,dispatch:n})=>{const r=Nt(t,e.schema);return NL(r)(e,n)};function Hx(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}var F4=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:l,doc:a}=e,{$from:c,$to:d}=l,h=o.extensionManager.attributes,p=kc(h,c.node().type.name,c.node().attrs);if(l instanceof we&&l.node.isBlock)return!c.parentOffset||!qr(a,c.pos)?!1:(r&&(t&&Hx(n,o.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const g=d.parentOffset===d.parent.content.size,v=c.depth===0?void 0:p4(c.node(-1).contentMatchAt(c.indexAfter(-1)));let b=g&&v?[{type:v,attrs:p}]:void 0,S=qr(e.doc,e.mapping.map(c.pos),1,b);if(!b&&!S&&qr(e.doc,e.mapping.map(c.pos),1,v?[{type:v}]:void 0)&&(S=!0,b=v?[{type:v,attrs:p}]:void 0),r){if(S&&(l instanceof Ae&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,b),v&&!g&&!c.parentOffset&&c.parent.type!==v)){const x=e.mapping.map(c.before()),C=e.doc.resolve(x);c.node(-1).canReplaceWith(C.index(),C.index()+1,v)&&e.setNodeMarkup(e.mapping.map(c.before()),v)}t&&Hx(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return S},P4=(t,e={})=>({tr:n,state:r,dispatch:o,editor:l})=>{var a;const c=Nt(t,r.schema),{$from:d,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||d.depth<2||!d.sameParent(h))return!1;const g=d.node(-1);if(g.type!==c)return!1;const v=l.extensionManager.attributes;if(d.parent.content.size===0&&d.node(-1).childCount===d.indexAfter(-1)){if(d.depth===2||d.node(-3).type!==c||d.index(-2)!==d.node(-2).childCount-1)return!1;if(o){let E=te.empty;const A=d.index(-1)?1:d.index(-2)?2:3;for(let I=d.depth-A;I>=d.depth-3;I-=1)E=te.from(d.node(I).copy(E));const O=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,D={...kc(v,d.node().type.name,d.node().attrs),...e},z=((a=c.contentMatch.defaultType)==null?void 0:a.createAndFill(D))||void 0;E=E.append(te.from(c.createAndFill(null,z)||void 0));const L=d.before(d.depth-(A-1));n.replace(L,d.after(-O),new ae(E,4-A,0));let _=-1;n.doc.nodesBetween(L,n.doc.content.size,(I,Q)=>{if(_>-1)return!1;I.isTextblock&&I.content.size===0&&(_=Q+1)}),_>-1&&n.setSelection(Ae.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const b=h.pos===d.end()?g.contentMatchAt(0).defaultType:null,S={...kc(v,g.type.name,g.attrs),...e},x={...kc(v,d.node().type.name,d.node().attrs),...e};n.delete(d.pos,h.pos);const C=b?[{type:c,attrs:S},{type:b,attrs:x}]:[{type:c,attrs:S}];if(!qr(n.doc,d.pos,2))return!1;if(o){const{selection:E,storedMarks:A}=r,{splittableMarks:O}=l.extensionManager,D=A||E.$to.parentOffset&&E.$from.marks();if(n.split(d.pos,2,C).scrollIntoView(),!D||!o)return!0;const z=D.filter(L=>O.includes(L.type.name));n.ensureMarks(z)}return!0},jp=(t,e)=>{const n=Tg(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Ho(t.doc,n.pos)&&t.join(n.pos),!0},Ip=(t,e)=>{const n=Tg(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Ho(t.doc,r)&&t.join(r),!0},$4=(t,e,n,r={})=>({editor:o,tr:l,state:a,dispatch:c,chain:d,commands:h,can:p})=>{const{extensions:g,splittableMarks:v}=o.extensionManager,b=Nt(t,a.schema),S=Nt(e,a.schema),{selection:x,storedMarks:C}=a,{$from:E,$to:A}=x,O=E.blockRange(A),D=C||x.$to.parentOffset&&x.$from.marks();if(!O)return!1;const z=Tg(L=>$x(L.type.name,g))(x);if(O.depth>=1&&z&&O.depth-z.depth<=1){if(z.node.type===b)return h.liftListItem(S);if($x(z.node.type.name,g)&&b.validContent(z.node.content)&&c)return d().command(()=>(l.setNodeMarkup(z.pos,b),!0)).command(()=>jp(l,b)).command(()=>Ip(l,b)).run()}return!n||!D||!c?d().command(()=>p().wrapInList(b,r)?!0:h.clearNodes()).wrapInList(b,r).command(()=>jp(l,b)).command(()=>Ip(l,b)).run():d().command(()=>{const L=p().wrapInList(b,r),_=D.filter(I=>v.includes(I.type.name));return l.ensureMarks(_),L?!0:h.clearNodes()}).wrapInList(b,r).command(()=>jp(l,b)).command(()=>Ip(l,b)).run()},H4=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:l=!1}=n,a=Qr(t,r.schema);return km(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:l}):o.setMark(a,e)},U4=(t,e,n={})=>({state:r,commands:o})=>{const l=Nt(t,r.schema),a=Nt(e,r.schema),c=Ea(r,l,n);let d;return r.selection.$anchor.sameParent(r.selection.$head)&&(d=r.selection.$anchor.parent.attrs),c?o.setNode(a,d):o.setNode(l,{...d,...n})},G4=(t,e={})=>({state:n,commands:r})=>{const o=Nt(t,n.schema);return Ea(n,o,e)?r.lift(o):r.wrapIn(o,e)},q4=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let l;if(o.spec.isInputRules&&(l=o.getState(t))){if(e){const a=t.tr,c=l.transform;for(let d=c.steps.length-1;d>=0;d-=1)a.step(c.steps[d].invert(c.docs[d]));if(l.text){const d=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,d))}else a.delete(l.from,l.to)}return!0}}return!1},K4=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(l=>{t.removeMark(l.$from.pos,l.$to.pos)}),!0},Y4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var l;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=n,d=Qr(t,r.schema),{$from:h,empty:p,ranges:g}=c;if(!o)return!0;if(p&&a){let{from:v,to:b}=c;const S=(l=h.marks().find(C=>C.type===d))==null?void 0:l.attrs,x=uR(h,d,S);x&&(v=x.from,b=x.to),n.removeMark(v,b,d)}else g.forEach(v=>{n.removeMark(v.$from.pos,v.$to.pos,d)});return n.removeStoredMark(d),!0},X4=t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=n;let l,a;return typeof t=="number"?(l=t,a=t):t&&"from"in t&&"to"in t?(l=t.from,a=t.to):(l=o.from,a=o.to),r&&e.doc.nodesBetween(l,a,(c,d)=>{if(c.isText)return;const h={...c.attrs};delete h.dir,e.setNodeMarkup(d,void 0,h)}),!0},J4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=Df(typeof t=="string"?t:t.name,r.schema);if(!c)return!1;c==="node"&&(l=Nt(t,r.schema)),c==="mark"&&(a=Qr(t,r.schema));let d=!1;return n.selection.ranges.forEach(h=>{const p=h.$from.pos,g=h.$to.pos;let v,b,S,x;n.selection.empty?r.doc.nodesBetween(p,g,(C,E)=>{l&&l===C.type&&(d=!0,S=Math.max(E,p),x=Math.min(E+C.nodeSize,g),v=E,b=C)}):r.doc.nodesBetween(p,g,(C,E)=>{E<p&&l&&l===C.type&&(d=!0,S=Math.max(E,p),x=Math.min(E+C.nodeSize,g),v=E,b=C),E>=p&&E<=g&&(l&&l===C.type&&(d=!0,o&&n.setNodeMarkup(E,void 0,{...C.attrs,...e})),a&&C.marks.length&&C.marks.forEach(A=>{if(a===A.type&&(d=!0,o)){const O=Math.max(E,p),D=Math.min(E+C.nodeSize,g);n.addMark(O,D,a.create({...A.attrs,...e}))}}))}),b&&(v!==void 0&&o&&n.setNodeMarkup(v,void 0,{...b.attrs,...e}),a&&b.marks.length&&b.marks.forEach(C=>{a===C.type&&o&&n.addMark(S,x,a.create({...C.attrs,...e}))}))}),d},Q4=(t,e={})=>({state:n,dispatch:r})=>{const o=Nt(t,n.schema);return ML(o,e)(n,r)},Z4=(t,e={})=>({state:n,dispatch:r})=>{const o=Nt(t,n.schema);return EL(o,e)(n,r)},W4=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},eF=(t,e)=>{if(Rg(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function bc(t){var e;const{editor:n,from:r,to:o,text:l,rules:a,plugin:c}=t,{view:d}=n;if(d.composing)return!1;const h=d.state.doc.resolve(r);if(h.parent.type.spec.code||(e=h.nodeBefore||h.nodeAfter)!=null&&e.marks.find(v=>v.type.spec.code))return!1;let p=!1;const g=T4(h)+l;return a.forEach(v=>{if(p)return;const b=eF(g,v.find);if(!b)return;const S=d.state.tr,x=kf({state:d.state,transaction:S}),C={from:r-(b[0].length-l.length),to:o},{commands:E,chain:A,can:O}=new Nf({editor:n,state:x});v.handler({state:x,range:C,match:b,commands:E,chain:A,can:O})===null||!S.steps.length||(v.undoable&&S.setMeta(c,{transform:S,from:r,to:o,text:l}),d.dispatch(S),p=!0)}),p}function tF(t){const{editor:e,rules:n}=t,r=new St({state:{init(){return null},apply(o,l,a){const c=o.getMeta(r);if(c)return c;const d=o.getMeta("applyInputRules");return d&&setTimeout(()=>{let{text:p}=d;typeof p=="string"?p=p:p=Og(te.from(p),a.schema);const{from:g}=d,v=g+p.length;bc({editor:e,from:g,to:v,text:p,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:l}},props:{handleTextInput(o,l,a,c){return bc({editor:e,from:l,to:a,text:c,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:l}=o.state.selection;l&&bc({editor:e,from:l.pos,to:l.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,l){if(l.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?bc({editor:e,from:a.pos,to:a.pos,text:`
|
|
67
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function nF(t){return Object.prototype.toString.call(t).slice(8,-1)}function Sc(t){return nF(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function CR(t,e){const n={...t};return Sc(t)&&Sc(e)&&Object.keys(e).forEach(r=>{Sc(e[r])&&Sc(t[r])?n[r]=CR(t[r],e[r]):n[r]=e[r]}),n}var kg=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...st(be(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...st(be(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>CR(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},rF=class MR extends kg{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new MR(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const a=o.marks();if(!!!a.find(h=>h?.type.name===n.name))return!1;const d=a.find(h=>h?.type.name===n.name);return d&&r.removeStoredMark(d),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function iF(t){return typeof t=="number"}var oF=(t,e,n)=>{if(Rg(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const l=[o.text];return l.index=o.index,l.input=t,l.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),l.push(o.replaceWith)),l}):[]};function sF(t){const{editor:e,state:n,from:r,to:o,rule:l,pasteEvent:a,dropEvent:c}=t,{commands:d,chain:h,can:p}=new Nf({editor:e,state:n}),g=[];return n.doc.nodesBetween(r,o,(b,S)=>{var x,C,E,A,O;if((C=(x=b.type)==null?void 0:x.spec)!=null&&C.code||!(b.isText||b.isTextblock||b.isInline))return;const D=(O=(A=(E=b.content)==null?void 0:E.size)!=null?A:b.nodeSize)!=null?O:0,z=Math.max(r,S),L=Math.min(o,S+D);if(z>=L)return;const _=b.isText?b.text||"":b.textBetween(z-S,L-S,void 0,"");oF(_,l.find,a).forEach(Q=>{if(Q.index===void 0)return;const ue=z+Q.index+1,se=ue+Q[0].length,le={from:n.tr.mapping.map(ue),to:n.tr.mapping.map(se)},xe=l.handler({state:n,range:le,match:Q,commands:d,chain:h,can:p,pasteEvent:a,dropEvent:c});g.push(xe)})}),g.every(b=>b!==null)}var xc=null,lF=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function aF(t){const{editor:e,rules:n}=t;let r=null,o=!1,l=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const d=({state:p,from:g,to:v,rule:b,pasteEvt:S})=>{const x=p.tr,C=kf({state:p,transaction:x});if(!(!sF({editor:e,state:C,from:Math.max(g-1,0),to:v.b-1,rule:b,pasteEvent:S,dropEvent:c})||!x.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,x}};return n.map(p=>new St({view(g){const v=S=>{var x;r=(x=g.dom.parentElement)!=null&&x.contains(S.target)?g.dom.parentElement:null,r&&(xc=e)},b=()=>{xc&&(xc=null)};return window.addEventListener("dragstart",v),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",v),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(g,v)=>{if(l=r===g.dom.parentElement,c=v,!l){const b=xc;b?.isEditable&&setTimeout(()=>{const S=b.state.selection;S&&b.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(g,v)=>{var b;const S=(b=v.clipboardData)==null?void 0:b.getData("text/html");return a=v,o=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(g,v,b)=>{const S=g[0],x=S.getMeta("uiEvent")==="paste"&&!o,C=S.getMeta("uiEvent")==="drop"&&!l,E=S.getMeta("applyPasteRules"),A=!!E;if(!x&&!C&&!A)return;if(A){let{text:z}=E;typeof z=="string"?z=z:z=Og(te.from(z),b.schema);const{from:L}=E,_=L+z.length,I=lF(z);return d({rule:p,state:b,from:L,to:{b:_},pasteEvt:I})}const O=v.doc.content.findDiffStart(b.doc.content),D=v.doc.content.findDiffEnd(b.doc.content);if(!(!iF(O)||!D||O===D.b))return d({rule:p,state:b,from:O,to:D,pasteEvt:a})}}))}var zf=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=vR(t),this.schema=b4(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Zl(e.name,this.schema)},r=be(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return ca([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Zl(r.name,this.schema)},l=[],a=be(r,"addKeyboardShortcuts",o);let c={};if(r.type==="mark"&&be(r,"exitable",o)&&(c.ArrowRight=()=>rF.handleExit({editor:t,mark:r})),a){const v=Object.fromEntries(Object.entries(a()).map(([b,S])=>[b,()=>S({editor:t})]));c={...c,...v}}const d=xV(c);l.push(d);const h=be(r,"addInputRules",o);if(Px(r,t.options.enableInputRules)&&h){const v=h();if(v&&v.length){const b=tF({editor:t,rules:v}),S=Array.isArray(b)?b:[b];l.push(...S)}}const p=be(r,"addPasteRules",o);if(Px(r,t.options.enablePasteRules)&&p){const v=p();if(v&&v.length){const b=aF({editor:t,rules:v});l.push(...b)}}const g=be(r,"addProseMirrorPlugins",o);if(g){const v=g();l.push(...v)}return l})}get attributes(){return gR(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Xs(this.extensions);return Object.fromEntries(e.filter(n=>!!be(n,"addNodeView")).map(n=>{const r=this.attributes.filter(d=>d.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Nt(n.name,this.schema)},l=be(n,"addNodeView",o);if(!l)return[];const a=l();if(!a)return[];const c=(d,h,p,g,v)=>{const b=ef(d,r);return a({node:d,view:h,getPos:p,decorations:g,innerDecorations:v,editor:t,extension:n,HTMLAttributes:b})};return[n.name,c]}))}dispatchTransaction(t){const{editor:e}=this;return ca([...this.extensions].reverse()).reduceRight((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Zl(o.name,this.schema)},a=be(o,"dispatchTransaction",l);return a?c=>{a.call(l,{transaction:c,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return ca([...this.extensions]).reduce((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Zl(o.name,this.schema)},a=be(o,"transformPastedHTML",l);return a?(c,d)=>{const h=r(c,d);return a.call(l,h)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Xs(this.extensions);return Object.fromEntries(e.filter(n=>!!be(n,"addMarkView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Qr(n.name,this.schema)},l=be(n,"addMarkView",o);if(!l)return[];const a=(c,d,h)=>{const p=ef(c,r);return l()({mark:c,view:d,inline:h,editor:t,extension:n,HTMLAttributes:p,updateAttributes:g=>{wF(c,t,g)}})};return[n.name,a]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Zl(e.name,this.schema)};e.type==="mark"&&((n=st(be(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const o=be(e,"onBeforeCreate",r),l=be(e,"onCreate",r),a=be(e,"onUpdate",r),c=be(e,"onSelectionUpdate",r),d=be(e,"onTransaction",r),h=be(e,"onFocus",r),p=be(e,"onBlur",r),g=be(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),l&&this.editor.on("create",l),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),d&&this.editor.on("transaction",d),h&&this.editor.on("focus",h),p&&this.editor.on("blur",p),g&&this.editor.on("destroy",g)})}};zf.resolve=vR;zf.sort=ca;zf.flatten=Ag;var uF={};Eg(uF,{ClipboardTextSerializer:()=>RR,Commands:()=>TR,Delete:()=>AR,Drop:()=>OR,Editable:()=>kR,FocusEvents:()=>DR,Keymap:()=>_R,Paste:()=>zR,Tabindex:()=>jR,TextDirection:()=>IR,focusEventsPluginKey:()=>NR});var xt=class ER extends kg{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new ER(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},RR=xt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new St({key:new Jt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:l}=o,a=Math.min(...l.map(p=>p.$from.pos)),c=Math.max(...l.map(p=>p.$to.pos)),d=SR(n);return bR(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:d})}}})]}}),TR=xt.create({name:"commands",addCommands(){return{...lR}}}),AR=xt.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const l=()=>{var a,c,d,h;if((h=(d=(c=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:c.filterTransaction)==null?void 0:d.call(c,t))!=null?h:t.getMeta("y-sync$"))return;const p=h4(t.before,[t,...e]);R4(p).forEach(b=>{p.mapping.mapResult(b.oldRange.from).deletedAfter&&p.mapping.mapResult(b.oldRange.to).deletedBefore&&p.before.nodesBetween(b.oldRange.from,b.oldRange.to,(S,x)=>{const C=x+S.nodeSize-2,E=b.oldRange.from<=x&&C<=b.oldRange.to;this.editor.emit("delete",{type:"node",node:S,from:x,to:C,newFrom:p.mapping.map(x),newTo:p.mapping.map(C),deletedRange:b.oldRange,newRange:b.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:p})})});const v=p.mapping;p.steps.forEach((b,S)=>{var x,C;if(b instanceof Zn){const E=v.slice(S).map(b.from,-1),A=v.slice(S).map(b.to),O=v.invert().map(E,-1),D=v.invert().map(A),z=(x=p.doc.nodeAt(E-1))==null?void 0:x.marks.some(_=>_.eq(b.mark)),L=(C=p.doc.nodeAt(A))==null?void 0:C.marks.some(_=>_.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:O,to:D},newRange:{from:E,to:A},partial:!!(L||z),editor:this.editor,transaction:t,combinedTransform:p})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(l,0):l()}}),OR=xt.create({name:"drop",addProseMirrorPlugins(){return[new St({key:new Jt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),kR=xt.create({name:"editable",addProseMirrorPlugins(){return[new St({key:new Jt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),NR=new Jt("focusEvents"),DR=xt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new St({key:NR,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),_R=xt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:c})=>{const{selection:d,doc:h}=c,{empty:p,$anchor:g}=d,{pos:v,parent:b}=g,S=g.parent.isTextblock&&v>0?c.doc.resolve(v-1):g,x=S.parent.type.spec.isolating,C=g.pos-g.parentOffset,E=x&&S.parent.childCount===1?C===g.pos:ze.atStart(h).from===v;return!p||!b.type.isTextblock||b.textContent.length||!E||E&&g.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},l={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Wc()||hR()?l:o},addProseMirrorPlugins(){return[new St({key:new Jt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(x=>x.getMeta("composition")))return;const r=t.some(x=>x.docChanged)&&!e.doc.eq(n.doc),o=t.some(x=>x.getMeta("preventClearDocument"));if(!r||o)return;const{empty:l,from:a,to:c}=e.selection,d=ze.atStart(e.doc).from,h=ze.atEnd(e.doc).to;if(l||!(a===d&&c===h)||!_f(n.doc))return;const v=n.tr,b=kf({state:n,transaction:v}),{commands:S}=new Nf({editor:this.editor,state:b});if(S.clearNodes(),!!v.steps.length)return v}})]}}),zR=xt.create({name:"paste",addProseMirrorPlugins(){return[new St({key:new Jt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),jR=xt.create({name:"tabindex",addProseMirrorPlugins(){return[new St({key:new Jt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),IR=xt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Xs(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new St({key:new Jt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),cF=class ia{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new ia(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new ia(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new ia(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,l=n.isAtom&&!n.isText,a=n.isInline,c=this.pos+r+(l?0:1);if(c<0||c>this.resolvedPos.doc.nodeSize-2)return;const d=this.resolvedPos.doc.resolve(c);if(!o&&!a&&d.depth<=this.depth)return;const h=new ia(d,this.editor,o,o||a?n:null);o&&(h.actualDepth=this.depth+1),e.push(h)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const l=o.node.attrs,a=Object.keys(n);for(let c=0;c<a.length;c+=1){const d=a[c];if(l[d]!==n[d])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const l=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===e&&l.every(d=>n[d]===a.node.attrs[d])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},fF=`.ProseMirror {
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ProseMirror {
|
|
72
|
+
word-wrap: break-word;
|
|
73
|
+
white-space: pre-wrap;
|
|
74
|
+
white-space: break-spaces;
|
|
75
|
+
-webkit-font-variant-ligatures: none;
|
|
76
|
+
font-variant-ligatures: none;
|
|
77
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror [contenteditable="false"] {
|
|
81
|
+
white-space: normal;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
85
|
+
white-space: pre-wrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ProseMirror pre {
|
|
89
|
+
white-space: pre-wrap;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
img.ProseMirror-separator {
|
|
93
|
+
display: inline !important;
|
|
94
|
+
border: none !important;
|
|
95
|
+
margin: 0 !important;
|
|
96
|
+
width: 0 !important;
|
|
97
|
+
height: 0 !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ProseMirror-gapcursor {
|
|
101
|
+
display: none;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
position: absolute;
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ProseMirror-gapcursor:after {
|
|
108
|
+
content: "";
|
|
109
|
+
display: block;
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: -2px;
|
|
112
|
+
width: 20px;
|
|
113
|
+
border-top: 1px solid black;
|
|
114
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@keyframes ProseMirror-cursor-blink {
|
|
118
|
+
to {
|
|
119
|
+
visibility: hidden;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ProseMirror-hideselection *::selection {
|
|
124
|
+
background: transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
128
|
+
background: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ProseMirror-hideselection * {
|
|
132
|
+
caret-color: transparent;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
136
|
+
display: block;
|
|
137
|
+
}`;function dF(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var hF=class extends W4{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:k4,createMappablePosition:N4},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:o,moved:l})=>this.options.onDrop(r,o,l)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=fR(e,this.options.autofocus);this.editorState=Ls.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=dF(fF,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=mR(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(o=>{const l=typeof o=="string"?`${o}$`:o.key;n=n.filter(a=>!a.key.startsWith(l))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[kR,RR.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),TR,DR,_R,jR,OR,zR,AR,IR.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new zf(r,this)}createCommandManager(){this.commandManager=new Nf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Om(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Om(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,l=e.transformPastedHTML,a=this.extensionManager.transformPastedHTML(l);this.editorView=new oR(t,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:o,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const d=this.view.dom;d.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(h=>{var p;return(p=this.capturedTransaction)==null?void 0:p.step(h)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),l=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(h=>h.getMeta("focus")||h.getMeta("blur")),c=a?.getMeta("focus"),d=a?.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:a}),d&&this.emit("blur",{editor:this,event:d.event,transaction:a}),!(t.getMeta("preventUpdate")||!n.some(h=>h.docChanged)||l.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return C4(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return A4(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Og(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
138
|
+
|
|
139
|
+
`,textSerializers:n={}}=t||{};return x4(this.state.doc,{blockSeparator:e,textSerializers:{...SR(this.schema),...n}})}get isEmpty(){return _f(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new cF(e,this)}get $doc(){return this.$pos(0)}},pF={};Eg(pF,{createAtomBlockMarkdownSpec:()=>mF,createBlockMarkdownSpec:()=>gF,createInlineMarkdownSpec:()=>bF,parseAttributes:()=>Ng,parseIndentedBlocks:()=>SF,renderNestedMarkdownContent:()=>xF,serializeAttributes:()=>Dg});function Ng(t){if(!t?.trim())return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,h=>(n.push(h),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const h=o.map(p=>p.trim().slice(1));e.class=h.join(" ")}const l=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);l&&(e.id=l[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,h,p])=>{var g;const v=parseInt(((g=p.match(/__QUOTED_(\d+)__/))==null?void 0:g[1])||"0",10),b=n[v];b&&(e[h]=b.slice(1,-1))});const d=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return d&&d.split(/\s+/).filter(Boolean).forEach(p=>{p.match(/^[a-zA-Z][\w-]*$/)&&(e[p]=!0)}),e}function Dg(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function mF(t){const{nodeName:e,name:n,parseAttributes:r=Ng,serializeAttributes:o=Dg,defaultAttributes:l={},requiredAttributes:a=[],allowedAttributes:c}=t,d=n||e,h=p=>{if(!c)return p;const g={};return c.forEach(v=>{v in p&&(g[v]=p[v])}),g};return{parseMarkdown:(p,g)=>{const v={...l,...p.attributes};return g.createNode(e,v,[])},markdownTokenizer:{name:e,level:"block",start(p){var g;const v=new RegExp(`^:::${d}(?:\\s|$)`,"m"),b=(g=p.match(v))==null?void 0:g.index;return b!==void 0?b:-1},tokenize(p,g,v){const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),S=p.match(b);if(!S)return;const x=S[1]||"",C=r(x);if(!a.find(A=>!(A in C)))return{type:e,raw:S[0],attributes:C}}},renderMarkdown:p=>{const g=h(p.attrs||{}),v=o(g),b=v?` {${v}}`:"";return`:::${d}${b} :::`}}}function gF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=Ng,serializeAttributes:l=Dg,defaultAttributes:a={},content:c="block",allowedAttributes:d}=t,h=n||e,p=g=>{if(!d)return g;const v={};return d.forEach(b=>{b in g&&(v[b]=g[b])}),v};return{parseMarkdown:(g,v)=>{let b;if(r){const x=r(g);b=typeof x=="string"?[{type:"text",text:x}]:x}else c==="block"?b=v.parseChildren(g.tokens||[]):b=v.parseInline(g.tokens||[]);const S={...a,...g.attributes};return v.createNode(e,S,b)},markdownTokenizer:{name:e,level:"block",start(g){var v;const b=new RegExp(`^:::${h}`,"m"),S=(v=g.match(b))==null?void 0:v.index;return S!==void 0?S:-1},tokenize(g,v,b){var S;const x=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),C=g.match(x);if(!C)return;const[E,A=""]=C,O=o(A);let D=1;const z=E.length;let L="";const _=/^:::([\w-]*)(\s.*)?/gm,I=g.slice(z);for(_.lastIndex=0;;){const Q=_.exec(I);if(Q===null)break;const ue=Q.index,se=Q[1];if(!((S=Q[2])!=null&&S.endsWith(":::"))){if(se)D+=1;else if(D-=1,D===0){const le=I.slice(0,ue);L=le.trim();const xe=g.slice(0,z+ue+Q[0].length);let ie=[];if(L)if(c==="block")for(ie=b.blockTokens(le),ie.forEach(ve=>{ve.text&&(!ve.tokens||ve.tokens.length===0)&&(ve.tokens=b.inlineTokens(ve.text))});ie.length>0;){const ve=ie[ie.length-1];if(ve.type==="paragraph"&&(!ve.text||ve.text.trim()===""))ie.pop();else break}else ie=b.inlineTokens(L);return{type:e,raw:xe,attributes:O,content:L,tokens:ie}}}}}},renderMarkdown:(g,v)=>{const b=p(g.attrs||{}),S=l(b),x=S?` {${S}}`:"",C=v.renderChildren(g.content||[],`
|
|
140
|
+
|
|
141
|
+
`);return`:::${h}${x}
|
|
142
|
+
|
|
143
|
+
${C}
|
|
144
|
+
|
|
145
|
+
:::`}}}function yF(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,o,l,a]=r;e[o]=l||a,r=n.exec(t)}return e}function vF(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function bF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=yF,serializeAttributes:l=vF,defaultAttributes:a={},selfClosing:c=!1,allowedAttributes:d}=t,h=n||e,p=v=>{if(!d)return v;const b={};return d.forEach(S=>{const x=typeof S=="string"?S:S.name,C=typeof S=="string"?void 0:S.skipIfDefault;if(x in v){const E=v[x];if(C!==void 0&&E===C)return;b[x]=E}}),b},g=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(v,b)=>{const S={...a,...v.attributes};if(c)return b.createNode(e,S);const x=r?r(v):v.content||"";return x?b.createNode(e,S,[b.createTextNode(x)]):b.createNode(e,S,[])},markdownTokenizer:{name:e,level:"inline",start(v){const b=c?new RegExp(`\\[${g}\\s*[^\\]]*\\]`):new RegExp(`\\[${g}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${g}\\]`),S=v.match(b),x=S?.index;return x!==void 0?x:-1},tokenize(v,b,S){const x=c?new RegExp(`^\\[${g}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${g}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${g}\\]`),C=v.match(x);if(!C)return;let E="",A="";if(c){const[,D]=C;A=D}else{const[,D,z]=C;A=D,E=z||""}const O=o(A.trim());return{type:e,raw:C[0],content:E.trim(),attributes:O}}},renderMarkdown:v=>{let b="";r?b=r(v):v.content&&v.content.length>0&&(b=v.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const S=p(v.attrs||{}),x=l(S),C=x?` ${x}`:"";return c?`[${h}${C}]`:`[${h}${C}]${b}[/${h}]`}}}function SF(t,e,n){var r,o,l,a;const c=t.split(`
|
|
146
|
+
`),d=[];let h="",p=0;const g=e.baseIndentSize||2;for(;p<c.length;){const v=c[p],b=v.match(e.itemPattern);if(!b){if(d.length>0)break;if(v.trim()===""){p+=1,h=`${h}${v}
|
|
147
|
+
`;continue}else return}const S=e.extractItemData(b),{indentLevel:x,mainContent:C}=S;h=`${h}${v}
|
|
148
|
+
`;const E=[C];for(p+=1;p<c.length;){const z=c[p];if(z.trim()===""){const _=c.slice(p+1).findIndex(ue=>ue.trim()!=="");if(_===-1)break;if((((o=(r=c[p+1+_].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>x){E.push(z),h=`${h}${z}
|
|
149
|
+
`,p+=1;continue}else break}if((((a=(l=z.match(/^(\s*)/))==null?void 0:l[1])==null?void 0:a.length)||0)>x)E.push(z),h=`${h}${z}
|
|
150
|
+
`,p+=1;else break}let A;const O=E.slice(1);if(O.length>0){const z=O.map(L=>L.slice(x+g)).join(`
|
|
151
|
+
`);z.trim()&&(e.customNestedParser?A=e.customNestedParser(z):A=n.blockTokens(z))}const D=e.createToken(S,A);d.push(D)}if(d.length!==0)return{items:d,raw:h}}function xF(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[l,...a]=t.content,c=e.renderChildren([l]);let d=`${o}${c}`;return a&&a.length>0&&a.forEach((h,p)=>{var g,v;const b=(v=(g=e.renderChild)==null?void 0:g.call(e,h,p+1))!=null?v:e.renderChildren([h]);if(b!=null){const S=b.split(`
|
|
152
|
+
`).map(x=>x?e.indent(x):e.indent("")).join(`
|
|
153
|
+
`);d+=h.type==="paragraph"?`
|
|
154
|
+
|
|
155
|
+
${S}`:`
|
|
156
|
+
${S}`}}),d}function wF(t,e,n={}){const{state:r}=e,{doc:o,tr:l}=r,a=t;o.descendants((c,d)=>{const h=l.mapping.map(d),p=l.mapping.map(d)+c.nodeSize;let g=null;if(c.marks.forEach(b=>{if(b!==a)return!1;g=b}),!g)return;let v=!1;if(Object.keys(n).forEach(b=>{n[b]!==g.attrs[b]&&(v=!0)}),v){const b=t.type.create({...t.attrs,...n});l.removeMark(h,p,t.type),l.addMark(h,p,b)}}),l.docChanged&&e.view.dispatch(l)}var _g=class LR extends kg{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new LR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},CF=_g.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
157
|
+
|
|
158
|
+
`):""}),MF=CF,Ux=" ",EF=" ",RF=_g.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",yR(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Ux||r[0].text===EF)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,o;if(!t)return"";const l=Array.isArray(t.content)?t.content:[];if(l.length===0){const a=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n?.previousNode)==null?void 0:o.type)==="paragraph"&&a.length===0?Ux:""}return e.renderChildren(l)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),TF=RF;function AF(t={}){return new St({view(e){return new OF(e,t)}})}class OF{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let l=a=>{this[o](a)};return e.dom.addEventListener(o,l),{name:o,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,l=o.getBoundingClientRect(),a=l.width/o.offsetWidth,c=l.height/o.offsetHeight;if(n){let g=e.nodeBefore,v=e.nodeAfter;if(g||v){let b=this.editorView.nodeDOM(this.cursorPos-(g?g.nodeSize:0));if(b){let S=b.getBoundingClientRect(),x=g?S.bottom:S.top;g&&v&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let C=this.width/2*c;r={left:S.left,right:S.right,top:x-C,bottom:x+C}}}}if(!r){let g=this.editorView.coordsAtPos(this.cursorPos),v=this.width/2*a;r={left:g.left-v,right:g.left+v,top:g.top,bottom:g.bottom}}let d=this.editorView.dom.offsetParent;this.element||(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let h,p;if(!d||d==document.body&&getComputedStyle(d).position=="static")h=-pageXOffset,p=-pageYOffset;else{let g=d.getBoundingClientRect(),v=g.width/d.offsetWidth,b=g.height/d.offsetHeight;h=g.left-d.scrollLeft*v,p=g.top-d.scrollTop*b}this.element.style.left=(r.left-h)/a+"px",this.element.style.top=(r.top-p)/c+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/c+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,l=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let c=oE(this.editorView.state.doc,a,this.editorView.dragging.slice);c!=null&&(a=c)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ct extends ze{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ct.valid(r)?new ct(r):ze.near(r)}content(){return ae.empty}eq(e){return e instanceof ct&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ct(e.resolve(n.pos))}getBookmark(){return new zg(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!kF(e)||!NF(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ct.valid(e))return e;let o=e.pos,l=null;for(let a=e.depth;;a--){let c=e.node(a);if(n>0?e.indexAfter(a)<c.childCount:e.index(a)>0){l=c.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;o+=n;let d=e.doc.resolve(o);if(ct.valid(d))return d}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!we.isSelectable(l)){e=e.doc.resolve(o+l.nodeSize*n),r=!1;continue e}break}l=a,o+=n;let c=e.doc.resolve(o);if(ct.valid(c))return c}return null}}}ct.prototype.visible=!1;ct.findFrom=ct.findGapCursorFrom;ze.jsonID("gapcursor",ct);class zg{constructor(e){this.pos=e}map(e){return new zg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ct.valid(n)?new ct(n):ze.near(n)}}function BR(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function kF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||BR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function NF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||BR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function DF(){return new St({props:{decorations:IF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ct.valid(n)?new ct(n):null},handleClick:zF,handleKeyDown:_F,handleDOMEvents:{beforeinput:jF}}})}const _F=sR({ArrowLeft:wc("horiz",-1),ArrowRight:wc("horiz",1),ArrowUp:wc("vert",-1),ArrowDown:wc("vert",1)});function wc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,l){let a=r.selection,c=e>0?a.$to:a.$from,d=a.empty;if(a instanceof Ae){if(!l.endOfTextblock(n)||c.depth==0)return!1;d=!1,c=r.doc.resolve(e>0?c.after():c.before())}let h=ct.findGapCursorFrom(c,e,d);return h?(o&&o(r.tr.setSelection(new ct(h))),!0):!1}}function zF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ct.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&we.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ct(r))),!0)}function jF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ct))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=te.empty;for(let a=r.length-1;a>=0;a--)o=te.from(r[a].createAndFill(null,o));let l=t.state.tr.replace(n.pos,n.pos,new ae(o,0,0));return l.setSelection(Ae.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}function IF(t){if(!(t.selection instanceof ct))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",lt.create(t.doc,[Ut.widget(t.selection.head,e,{key:"gapcursor"})])}var tf=200,kt=function(){};kt.prototype.append=function(e){return e.length?(e=kt.from(e),!this.length&&e||e.length<tf&&this.leafAppend(e)||this.length<tf&&e.leafPrepend(this)||this.appendInner(e)):this};kt.prototype.prepend=function(e){return e.length?kt.from(e).append(this):this};kt.prototype.appendInner=function(e){return new LF(this,e)};kt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?kt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};kt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};kt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};kt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(l,a){return o.push(e(l,a))},n,r),o};kt.from=function(e){return e instanceof kt?e:e&&e.length?new VR(e):kt.empty};var VR=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,l){return o==0&&l==this.length?this:new e(this.values.slice(o,l))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,l,a,c){for(var d=l;d<a;d++)if(o(this.values[d],c+d)===!1)return!1},e.prototype.forEachInvertedInner=function(o,l,a,c){for(var d=l-1;d>=a;d--)if(o(this.values[d],c+d)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=tf)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=tf)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(kt);kt.empty=new VR([]);var LF=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,l,a){var c=this.left.length;if(o<c&&this.left.forEachInner(r,o,Math.min(l,c),a)===!1||l>c&&this.right.forEachInner(r,Math.max(o-c,0),Math.min(this.length,l)-c,a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,l,a){var c=this.left.length;if(o>c&&this.right.forEachInvertedInner(r,o-c,Math.max(l,c)-c,a+c)===!1||l<c&&this.left.forEachInvertedInner(r,Math.min(o,c),l,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var l=this.left.length;return o<=l?this.left.slice(r,o):r>=l?this.right.slice(r-l,o-l):this.left.slice(r,l).append(this.right.slice(0,o-l))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(kt);const BF=500;class Qn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,l;n&&(o=this.remapping(r,this.items.length),l=o.maps.length);let a=e.tr,c,d,h=[],p=[];return this.items.forEach((g,v)=>{if(!g.step){o||(o=this.remapping(r,v+1),l=o.maps.length),l--,p.push(g);return}if(o){p.push(new cr(g.map));let b=g.step.map(o.slice(l)),S;b&&a.maybeStep(b).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new cr(S,void 0,void 0,h.length+p.length))),l--,S&&o.appendMap(S,l)}else a.maybeStep(g.step);if(g.selection)return c=o?g.selection.map(o.slice(l)):g.selection,d=new Qn(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:d,transform:a,selection:c}}addTransform(e,n,r,o){let l=[],a=this.eventCount,c=this.items,d=!o&&c.length?c.get(c.length-1):null;for(let p=0;p<e.steps.length;p++){let g=e.steps[p].invert(e.docs[p]),v=new cr(e.mapping.maps[p],g,n),b;(b=d&&d.merge(v))&&(v=b,p?l.pop():c=c.slice(0,c.length-1)),l.push(v),n&&(a++,n=void 0),o||(d=v)}let h=a-r.depth;return h>FF&&(c=VF(c,h),a-=h),new Qn(c.append(l),a)}remapping(e,n){let r=new ba;return this.items.forEach((o,l)=>{let a=o.mirrorOffset!=null&&l-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new Qn(this.items.append(e.map(n=>new cr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),l=e.mapping,a=e.steps.length,c=this.eventCount;this.items.forEach(v=>{v.selection&&c--},o);let d=n;this.items.forEach(v=>{let b=l.getMirror(--d);if(b==null)return;a=Math.min(a,b);let S=l.maps[b];if(v.step){let x=e.steps[b].invert(e.docs[b]),C=v.selection&&v.selection.map(l.slice(d+1,b));C&&c++,r.push(new cr(S,x,C))}else r.push(new cr(S))},o);let h=[];for(let v=n;v<a;v++)h.push(new cr(l.maps[v]));let p=this.items.slice(0,o).append(h).append(r),g=new Qn(p,c);return g.emptyItemCount()>BF&&(g=g.compress(this.items.length-r.length)),g}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],l=0;return this.items.forEach((a,c)=>{if(c>=e)o.push(a),a.selection&&l++;else if(a.step){let d=a.step.map(n.slice(r)),h=d&&d.getMap();if(r--,h&&n.appendMap(h,r),d){let p=a.selection&&a.selection.map(n.slice(r));p&&l++;let g=new cr(h.invert(),d,p),v,b=o.length-1;(v=o.length&&o[b].merge(g))?o[b]=v:o.push(g)}}else a.map&&r--},this.items.length,0),new Qn(kt.from(o.reverse()),l)}}Qn.empty=new Qn(kt.empty,0);function VF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class cr{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new cr(n.getMap().invert(),n,this.selection)}}}class Ni{constructor(e,n,r,o,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=l}}const FF=20;function PF(t,e,n,r){let o=n.getMeta(zo),l;if(o)return o.historyState;n.getMeta(UF)&&(t=new Ni(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(zo))return a.getMeta(zo).redo?new Ni(t.done.addTransform(n,void 0,r,Nc(e)),t.undone,Gx(n.mapping.maps),t.prevTime,t.prevComposition):new Ni(t.done,t.undone.addTransform(n,void 0,r,Nc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),d=t.prevTime==0||!a&&t.prevComposition!=c&&(t.prevTime<(n.time||0)-r.newGroupDelay||!$F(n,t.prevRanges)),h=a?Lp(t.prevRanges,n.mapping):Gx(n.mapping.maps);return new Ni(t.done.addTransform(n,d?e.selection.getBookmark():void 0,r,Nc(e)),Qn.empty,h,n.time,c??t.prevComposition)}else return(l=n.getMeta("rebased"))?new Ni(t.done.rebased(n,l),t.undone.rebased(n,l),Lp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ni(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Lp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function $F(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let l=0;l<e.length;l+=2)r<=e[l+1]&&o>=e[l]&&(n=!0)}),n}function Gx(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,l,a)=>e.push(l,a));return e}function Lp(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),l=e.map(t[r+1],-1);o<=l&&n.push(o,l)}return n}function HF(t,e,n){let r=Nc(e),o=zo.get(e).spec.config,l=(n?t.undone:t.done).popEvent(e,r);if(!l)return null;let a=l.selection.resolve(l.transform.doc),c=(n?t.done:t.undone).addTransform(l.transform,e.selection.getBookmark(),o,r),d=new Ni(n?c:l.remaining,n?l.remaining:c,null,0,-1);return l.transform.setSelection(a).setMeta(zo,{redo:n,historyState:d})}let Bp=!1,qx=null;function Nc(t){let e=t.plugins;if(qx!=e){Bp=!1,qx=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Bp=!0;break}}return Bp}const zo=new Jt("history"),UF=new Jt("closeHistory");function GF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new St({key:zo,state:{init(){return new Ni(Qn.empty,Qn.empty,null,0,-1)},apply(e,n,r){return PF(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?PR:r=="historyRedo"?$R:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function FR(t,e){return(n,r)=>{let o=zo.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let l=HF(o,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}const PR=FR(!1,!0),$R=FR(!0,!0);xt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new St({key:new Jt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const l=this.storage.characters({node:r.doc});if(l>o){const a=l-o,c=0,d=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const h=r.tr.deleteRange(c,d);return t=!0,h}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),l=this.storage.characters({node:e.doc});if(l<=r||o>r&&l>r&&l<=o)return!0;if(o>r&&l>r&&l>o||!e.getMeta("paste"))return!1;const c=e.selection.$head.pos,d=l-r,h=c-d,p=c;return e.deleteRange(h,p),!(this.storage.characters({node:e.doc})>r)}})]}});xt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[AF(this.options)]}});xt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new St({key:new Jt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,l=[];if(!n||!r)return lt.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((d,h)=>{if(d.isText)return;if(!(o>=h&&o<=h+d.nodeSize-1))return!1;a+=1});let c=0;return t.descendants((d,h)=>{if(d.isText||!(o>=h&&o<=h+d.nodeSize-1))return!1;if(c+=1,this.options.mode==="deepest"&&a-c>0||this.options.mode==="shallowest"&&c>1)return this.options.mode==="deepest";l.push(Ut.node(h,h+d.nodeSize,{class:this.options.className}))}),lt.create(t,l)}}})]}});xt.create({name:"gapCursor",addProseMirrorPlugins(){return[DF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=st(be(t,"allowGapCursor",n)))!=null?e:null}}});var Kx="placeholder";function qF(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var KF=xt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Kx,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${qF(this.options.dataAttribute)}`:`data-${Kx}`;return[new St({key:new Jt("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,l=[];if(!r)return null;const a=this.editor.isEmpty;return e.descendants((c,d)=>{const h=o>=d&&o<=d+c.nodeSize,p=!c.isLeaf&&_f(c);if(!c.type.isTextblock)return this.options.includeChildren;if((h||!this.options.showOnlyCurrent)&&p){const g=[this.options.emptyNodeClass];a&&g.push(this.options.emptyEditorClass);const v=Ut.node(d,d+c.nodeSize,{class:g.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:c,pos:d,hasAnchor:h}):this.options.placeholder});l.push(v)}return this.options.includeChildren}),lt.create(e,l)}}})]}});xt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new St({key:new Jt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||O4(n.selection)||t.view.dragging?null:lt.create(n.doc,[Ut.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Yx({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}xt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Jt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new St({key:e,appendTransaction:(o,l,a)=>{const{doc:c,tr:d,schema:h}=a,p=e.getState(a),g=c.content.size,v=h.nodes[n];if(p)return d.insert(g,v.create())},state:{init:(o,l)=>{const a=l.tr.doc.lastChild;return!Yx({node:a,types:r})},apply:(o,l)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return l;const a=o.doc.lastChild;return!Yx({node:a,types:r})}}})]}});xt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>PR(t,e),redo:()=>({state:t,dispatch:e})=>$R(t,e)}},addProseMirrorPlugins(){return[GF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var YF=KF,XF=_g.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),JF=XF;const{getOwnPropertyNames:QF,getOwnPropertySymbols:ZF}=Object,{hasOwnProperty:WF}=Object.prototype;function Vp(t,e){return function(r,o,l){return t(r,o,l)&&e(r,o,l)}}function Cc(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);const{cache:l}=o,a=l.get(n),c=l.get(r);if(a&&c)return a===r&&c===n;l.set(n,r),l.set(r,n);const d=t(n,r,o);return l.delete(n),l.delete(r),d}}function e5(t){return t?.[Symbol.toStringTag]}function Xx(t){return QF(t).concat(ZF(t))}const t5=Object.hasOwn||((t,e)=>WF.call(t,e));function Uo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const n5="__v",r5="__o",i5="_owner",{getOwnPropertyDescriptor:Jx,keys:Qx}=Object;function o5(t,e){return t.byteLength===e.byteLength&&nf(new Uint8Array(t),new Uint8Array(e))}function s5(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function l5(t,e){return t.byteLength===e.byteLength&&nf(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function a5(t,e){return Uo(t.getTime(),e.getTime())}function u5(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function c5(t,e){return t===e}function Zx(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),l=t.entries();let a,c,d=0;for(;(a=l.next())&&!a.done;){const h=e.entries();let p=!1,g=0;for(;(c=h.next())&&!c.done;){if(o[g]){g++;continue}const v=a.value,b=c.value;if(n.equals(v[0],b[0],d,g,t,e,n)&&n.equals(v[1],b[1],v[0],b[0],t,e,n)){p=o[g]=!0;break}g++}if(!p)return!1;d++}return!0}const f5=Uo;function d5(t,e,n){const r=Qx(t);let o=r.length;if(Qx(e).length!==o)return!1;for(;o-- >0;)if(!HR(t,e,n,r[o]))return!1;return!0}function Wl(t,e,n){const r=Xx(t);let o=r.length;if(Xx(e).length!==o)return!1;let l,a,c;for(;o-- >0;)if(l=r[o],!HR(t,e,n,l)||(a=Jx(t,l),c=Jx(e,l),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function h5(t,e){return Uo(t.valueOf(),e.valueOf())}function p5(t,e){return t.source===e.source&&t.flags===e.flags}function Wx(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),l=t.values();let a,c;for(;(a=l.next())&&!a.done;){const d=e.values();let h=!1,p=0;for(;(c=d.next())&&!c.done;){if(!o[p]&&n.equals(a.value,c.value,a.value,c.value,t,e,n)){h=o[p]=!0;break}p++}if(!h)return!1}return!0}function nf(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function m5(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function HR(t,e,n,r){return(r===i5||r===r5||r===n5)&&(t.$$typeof||e.$$typeof)?!0:t5(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const g5="[object ArrayBuffer]",y5="[object Arguments]",v5="[object Boolean]",b5="[object DataView]",S5="[object Date]",x5="[object Error]",w5="[object Map]",C5="[object Number]",M5="[object Object]",E5="[object RegExp]",R5="[object Set]",T5="[object String]",A5={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},O5="[object URL]",k5=Object.prototype.toString;function N5({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:l,areMapsEqual:a,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:h,areRegExpsEqual:p,areSetsEqual:g,areTypedArraysEqual:v,areUrlsEqual:b,unknownTagComparators:S}){return function(C,E,A){if(C===E)return!0;if(C==null||E==null)return!1;const O=typeof C;if(O!==typeof E)return!1;if(O!=="object")return O==="number"?c(C,E,A):O==="function"?l(C,E,A):!1;const D=C.constructor;if(D!==E.constructor)return!1;if(D===Object)return d(C,E,A);if(Array.isArray(C))return e(C,E,A);if(D===Date)return r(C,E,A);if(D===RegExp)return p(C,E,A);if(D===Map)return a(C,E,A);if(D===Set)return g(C,E,A);const z=k5.call(C);if(z===S5)return r(C,E,A);if(z===E5)return p(C,E,A);if(z===w5)return a(C,E,A);if(z===R5)return g(C,E,A);if(z===M5)return typeof C.then!="function"&&typeof E.then!="function"&&d(C,E,A);if(z===O5)return b(C,E,A);if(z===x5)return o(C,E,A);if(z===y5)return d(C,E,A);if(A5[z])return v(C,E,A);if(z===g5)return t(C,E,A);if(z===b5)return n(C,E,A);if(z===v5||z===C5||z===T5)return h(C,E,A);if(S){let L=S[z];if(!L){const _=e5(C);_&&(L=S[_])}if(L)return L(C,E,A)}return!1}}function D5({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:o5,areArraysEqual:n?Wl:s5,areDataViewsEqual:l5,areDatesEqual:a5,areErrorsEqual:u5,areFunctionsEqual:c5,areMapsEqual:n?Vp(Zx,Wl):Zx,areNumbersEqual:f5,areObjectsEqual:n?Wl:d5,arePrimitiveWrappersEqual:h5,areRegExpsEqual:p5,areSetsEqual:n?Vp(Wx,Wl):Wx,areTypedArraysEqual:n?Vp(nf,Wl):nf,areUrlsEqual:m5,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=Cc(r.areArraysEqual),l=Cc(r.areMapsEqual),a=Cc(r.areObjectsEqual),c=Cc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:a,areSetsEqual:c})}return r}function _5(t){return function(e,n,r,o,l,a,c){return t(e,n,c)}}function z5({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(c,d){const{cache:h=t?new WeakMap:void 0,meta:p}=n();return e(c,d,{cache:h,equals:r,meta:p,strict:o})};if(t)return function(c,d){return e(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const l={cache:void 0,equals:r,meta:void 0,strict:o};return function(c,d){return e(c,d,l)}}const j5=Xi();Xi({strict:!0});Xi({circular:!0});Xi({circular:!0,strict:!0});Xi({createInternalComparator:()=>Uo});Xi({strict:!0,createInternalComparator:()=>Uo});Xi({circular:!0,createInternalComparator:()=>Uo});Xi({circular:!0,createInternalComparator:()=>Uo,strict:!0});function Xi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,l=D5(t),a=N5(l),c=n?n(a):_5(a);return z5({circular:e,comparator:a,createState:r,equals:c,strict:o})}var Fp={exports:{}},Pp={};var e1;function I5(){if(e1)return Pp;e1=1;var t=Ra(),e=bw();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,l=t.useRef,a=t.useEffect,c=t.useMemo,d=t.useDebugValue;return Pp.useSyncExternalStoreWithSelector=function(h,p,g,v,b){var S=l(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=c(function(){function E(L){if(!A){if(A=!0,O=L,L=v(L),b!==void 0&&x.hasValue){var _=x.value;if(b(_,L))return D=_}return D=L}if(_=D,r(O,L))return _;var I=v(L);return b!==void 0&&b(_,I)?(O=L,_):(O=L,D=I)}var A=!1,O,D,z=g===void 0?null:g;return[function(){return E(p())},z===null?void 0:function(){return E(z())}]},[p,g,v,b]);var C=o(h,S[0],S[1]);return a(function(){x.hasValue=!0,x.value=C},[C]),d(C),C},Pp}var t1;function L5(){return t1||(t1=1,Fp.exports=I5()),Fp.exports}var B5=L5(),V5=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},F5=({contentComponent:t})=>{const e=Sw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return R.jsx(R.Fragment,{children:Object.values(e)})};function P5(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:L1.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}var $5=class extends tn.Component{constructor(t){var e;super(t),this.editorContentRef=tn.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=P5(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return R.jsxs(R.Fragment,{children:[R.jsx("div",{ref:V5(e,this.editorContentRef),...n}),t?.contentComponent&&R.jsx(F5,{contentComponent:t.contentComponent})]})}},H5=M.forwardRef((t,e)=>{const n=tn.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return tn.createElement($5,{key:n,innerRef:e,...t})}),UR=tn.memo(H5),U5=typeof window<"u"?M.useLayoutEffect:M.useEffect,G5=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function q5(t){var e;const[n]=M.useState(()=>new G5(t.editor)),r=B5.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:j5);return U5(()=>n.watch(t.editor),[t.editor,n]),M.useDebugValue(r),r}var K5=!1,Nm=typeof window>"u",Y5=Nm||!!(typeof window<"u"&&window.next),X5=class GR{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Nm||Y5?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,l;return(l=(o=this.options.current).onBeforeCreate)==null?void 0:l.call(o,...r)},onBlur:(...r)=>{var o,l;return(l=(o=this.options.current).onBlur)==null?void 0:l.call(o,...r)},onCreate:(...r)=>{var o,l;return(l=(o=this.options.current).onCreate)==null?void 0:l.call(o,...r)},onDestroy:(...r)=>{var o,l;return(l=(o=this.options.current).onDestroy)==null?void 0:l.call(o,...r)},onFocus:(...r)=>{var o,l;return(l=(o=this.options.current).onFocus)==null?void 0:l.call(o,...r)},onSelectionUpdate:(...r)=>{var o,l;return(l=(o=this.options.current).onSelectionUpdate)==null?void 0:l.call(o,...r)},onTransaction:(...r)=>{var o,l;return(l=(o=this.options.current).onTransaction)==null?void 0:l.call(o,...r)},onUpdate:(...r)=>{var o,l;return(l=(o=this.options.current).onUpdate)==null?void 0:l.call(o,...r)},onContentError:(...r)=>{var o,l;return(l=(o=this.options.current).onContentError)==null?void 0:l.call(o,...r)},onDrop:(...r)=>{var o,l;return(l=(o=this.options.current).onDrop)==null?void 0:l.call(o,...r)},onPaste:(...r)=>{var o,l;return(l=(o=this.options.current).onPaste)==null?void 0:l.call(o,...r)},onDelete:(...r)=>{var o,l;return(l=(o=this.options.current).onDelete)==null?void 0:l.call(o,...r)}};return new hF(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,l)=>{var a;return o===((a=n.extensions)==null?void 0:a[l])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?GR.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function J5(t={},e=[]){const n=M.useRef(t);n.current=t;const[r]=M.useState(()=>new X5(n)),o=Sw.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return M.useDebugValue(o),M.useEffect(r.onRender(e)),q5({editor:o,selector:({transactionNumber:l})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&l===0?0:l+1}),o}var qR=M.createContext({editor:null});qR.Consumer;var Q5=M.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Z5=()=>M.useContext(Q5);tn.forwardRef((t,e)=>{const{onDragStart:n}=Z5(),r=t.as||"div";return R.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});tn.createContext({markViewContentRef:()=>{}});var jg=M.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});jg.displayName="TiptapContext";var W5=()=>M.useContext(jg);function KR({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=M.useMemo(()=>({editor:r}),[r]),l=M.useMemo(()=>({editor:r}),[r]);return R.jsx(qR.Provider,{value:l,children:R.jsx(jg.Provider,{value:o,children:n})})}KR.displayName="Tiptap";function YR({...t}){const{editor:e}=W5();return R.jsx(UR,{editor:e,...t})}YR.displayName="Tiptap.Content";Object.assign(KR,{Content:YR});function eP({className:t,...e}){return R.jsx("div",{"data-slot":"input-group",role:"group",className:Ne("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",t),...e})}const tP=$m("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function n1({className:t,align:e="inline-start",...n}){return R.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:Ne(tP({align:e}),t),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const nP=$m("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function rP({className:t,type:e="button",variant:n="ghost",size:r="xs",...o}){return R.jsx(Ps,{type:e,"data-size":r,variant:n,className:Ne(nP({size:r}),t),...o})}const r1=new Jt("data-table-search-selector-highlighter"),XR="refresh-data-table-search-selector-highlighter",JR={fields:[]};function i1(t){const e=L3(rf(t),JR.fields);return lt.create(t,e.map(n=>{const r=Bs(t,n.start),o=Bs(t,n.end);return r>=o?null:Ut.inline(r,o,{class:"data-table-search-input-selector-token","data-table-search-selector":""},{inclusiveEnd:!1,inclusiveStart:!1})}).filter(n=>n!==null))}const iP=xt.create({name:"dataTableSelectorHighlighter",addProseMirrorPlugins(){return[new St({key:r1,state:{init:(t,e)=>i1(e.doc),apply:(t,e,n,r)=>t.docChanged||t.getMeta(XR)?i1(r.doc):e.map(t.mapping,t.doc)},props:{decorations(t){return r1.getState(t)}}})]}});function o1(t,e){if(typeof t=="function"){t(e);return}t&&(t.current=e)}function s1(t){return{content:t?[{content:[{text:t,type:"text"}],type:"paragraph"}]:[{type:"paragraph"}],type:"doc"}}function rf(t){return t.textBetween(0,t.content.size,"","")}function _s(t){return t.state.doc.textBetween(0,t.state.selection.from,"","").length}function Bs(t,e){const n=rf(t).length;let o=Math.max(0,Math.min(e,n)),l=Ae.atStart(t).from;return t.descendants((a,c)=>{if(!a.isText)return!0;const d=a.text??"";return o<=d.length?(l=c+o,!1):(o-=d.length,l=c+d.length,!0)}),l}function oP(t){return t.replace(/\r\n?/g,`
|
|
159
|
+
`).replace(/\n/g," ")}function l1(t,e,n){return e<=0?-1:t<0?n===1?0:e-1:(t+n+e)%e}function sP({inputRef:t,isLoading:e=!1,placeholder:n="Search table...",...r}){const o=xf(),l="fields"in r?r.fields:o?.searchFields??void 0,a="value"in r?r.value:o?.search??void 0,c="onSearchChange"in r?r.onSearchChange:o?.setSearch??void 0,d=M.useRef(null),h=M.useRef([]),p=M.useRef(a??""),g=M.useRef(!1),v=M.useRef(-1),b=M.useRef(!1),S=M.useRef([]),x=M.useRef(()=>{}),C=M.useRef(null),[E,A]=M.useState(0),[O,D]=M.useState(!1),[z,L]=M.useState(-1);if(!l||a===void 0||!c)throw new Error("DataTableSearchInput must be used inside DataTableProvider or receive fields, value, and onSearchChange props.");const _=M.useCallback(U=>{v.current=U,L(U)},[]),I=M.useMemo(()=>B3(a,E,l),[E,l,a]),Q=M.useMemo(()=>I.filter(U=>U.group==="input"),[I]),ue=M.useMemo(()=>I.filter(U=>U.group==="values"),[I]),se=M.useMemo(()=>I.filter(U=>U.group==="filters"),[I]),le=M.useCallback((U,q,K)=>{U.commands.setContent(s1(q),{emitUpdate:!1,parseOptions:{preserveWhitespace:"full"}}),K&&U.commands.setTextSelection({from:Bs(U.state.doc,K.start),to:Bs(U.state.doc,K.end)})},[]),xe=M.useCallback((U,q)=>{const K=V3(a,E,l,q);C.current={end:K.selectionStart,start:K.selectionStart},A(K.selectionStart),D(K.keepOpen),K.keepOpen||(b.current=!0),U&&(le(U,K.value,C.current),U.commands.focus()),c(K.value)},[E,l,c,le,a]),ie=J5({content:s1(a),editorProps:{attributes:{autocapitalize:"off",autocomplete:"off",autocorrect:"off",class:"data-table-search-input-editor min-w-0 flex-1 overflow-x-auto px-2 py-0 text-sm outline-none whitespace-pre",spellcheck:"false"},handleKeyDown:(U,q)=>{if(q.key==="Escape")return q.preventDefault(),b.current=!0,D(!1),!0;if(q.key==="ArrowDown")return q.preventDefault(),D(!0),_(l1(v.current,S.current.length,1)),!0;if(q.key==="ArrowUp")return q.preventDefault(),D(!0),_(l1(v.current,S.current.length,-1)),!0;if(q.key==="Tab"){const K=S.current[v.current];return!g.current||!K?!1:(q.preventDefault(),x.current(ie,K),!0)}if(q.key==="Enter"){q.preventDefault(),q.stopPropagation();const K=S.current[v.current];return g.current&&K?x.current(ie,K):A(_s(ie)),!0}return!1},handlePaste:(U,q)=>{const K=q.clipboardData?.getData("text/plain");return typeof K!="string"?!1:(q.preventDefault(),U.dispatch(U.state.tr.insertText(oP(K),U.state.selection.from,U.state.selection.to)),!0)}},extensions:[MF,TF,JF,YF.configure({placeholder:n}),iP,xt.create({name:"singleLineSearchBehavior",addKeyboardShortcuts(){return{Enter:()=>!0}}})],immediatelyRender:!0,onSelectionUpdate:({editor:U})=>{A(_s(U))},onUpdate:({editor:U})=>{const q=rf(U.state.doc);A(_s(U)),q!==p.current&&c(q),D(!0)}},[]);M.useEffect(()=>{p.current=a},[a]),M.useEffect(()=>{g.current=O},[O]),M.useEffect(()=>{v.current=z},[z]),M.useEffect(()=>{S.current=I},[I]),M.useEffect(()=>{x.current=xe},[xe]),M.useEffect(()=>{h.current.length=I.length},[I.length]),M.useEffect(()=>{JR.fields=l},[l]),M.useEffect(()=>{ie&&ie.view.dispatch(ie.state.tr.setMeta(XR,!0))},[ie,l]),M.useEffect(()=>{if(!ie)return;const U=C.current;rf(ie.state.doc)!==a?le(ie,a,U??void 0):U&&ie.commands.setTextSelection({from:Bs(ie.state.doc,U.start),to:Bs(ie.state.doc,U.end)}),C.current=null,A(_s(ie))},[ie,le,a]),M.useEffect(()=>{const U=Math.min(E,a.length);U!==E&&A(U)},[E,a.length]),M.useEffect(()=>{const U=I.length>0?Math.min(z,I.length-1):-1;_(O?U:-1)},[z,O,_,I.length]),M.useEffect(()=>{!O||z<0||h.current[z]?.scrollIntoView({block:"nearest"})},[z,O]),M.useEffect(()=>{const U=q=>{d.current?.contains(q.target)||D(!1)};return window.addEventListener("pointerdown",U),()=>window.removeEventListener("pointerdown",U)},[]),M.useEffect(()=>{if(t)return o1(t,{focus:()=>{ie?.commands.focus()},selectAll:()=>{ie?.chain().focus().selectAll().run()}}),()=>o1(t,null)},[ie,t]);const ve=e,V=[{items:Q,label:void 0},{items:ue,label:"Values"},{items:se,label:"Filters"}];let Z=0;return R.jsxs("div",{ref:d,className:"relative min-w-64 flex-1",children:[R.jsxs(eP,{className:"h-10 w-full text-lg focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",children:[R.jsx(n1,{align:"inline-start",children:R.jsx("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center",children:ve?R.jsx(af,{className:"size-4.5 animate-spin"}):R.jsx(zm,{className:"size-4.5"})})}),R.jsx("div",{className:"min-w-0 flex-1",children:R.jsx(UR,{editor:ie,onBlur:()=>{requestAnimationFrame(()=>{d.current?.contains(document.activeElement)||D(!1),b.current=!1})},onClick:()=>{A(ie?_s(ie):0),b.current=!1,D(!0)},onFocus:()=>{if(A(ie?_s(ie):0),b.current){b.current=!1;return}D(!0)}})}),R.jsx(n1,{align:"inline-end",children:a?R.jsx(rP,{"aria-label":"Clear search",size:"icon-xs",variant:"ghost",onClick:()=>{if(!ie){c(""),A(0),D(!1);return}C.current={end:0,start:0},A(0),D(!1),le(ie,"",C.current),ie.commands.focus(),c("")},children:R.jsx(jm,{className:"pointer-events-none"})}):null})]}),O?R.jsx("div",{className:"absolute top-full left-0 z-50 mt-1 w-full",children:R.jsx("div",{className:"max-h-[min(calc(var(--spacing(72)---spacing(9)),calc(100svh---spacing(20)))] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",children:I.length===0?R.jsx("div",{className:"flex w-full justify-center py-2 text-center text-xs/relaxed text-muted-foreground",children:"No items found."}):R.jsx("div",{className:"max-h-[min(calc(var(--spacing(72)---spacing(9)),calc(100svh---spacing(20)))] overflow-y-auto p-1",children:V.map(U=>U.items.length===0?null:R.jsxs("div",{children:[U.label?R.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:U.label}):null,U.items.map(q=>{const K=Z;return Z+=1,R.jsx("button",{ref:N=>{h.current[K]=N},type:"button",className:`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-left text-xs/relaxed outline-hidden select-none hover:bg-accent hover:text-accent-foreground ${K===z?"bg-accent text-accent-foreground":""}`,"data-highlighted":K===z?"":void 0,onClick:()=>xe(ie,q),onMouseDown:N=>{N.preventDefault()},onMouseEnter:()=>_(K),children:R.jsx("span",{className:"truncate",children:q.label})},q.id)})]},U.label??"Input"))})})}):null]})}function QR({...t}){return R.jsx(a3,{"data-slot":"dropdown-menu",...t})}function ZR({...t}){return R.jsx(u3,{"data-slot":"dropdown-menu-trigger",...t})}function WR({className:t,align:e="start",sideOffset:n=4,...r}){return R.jsx(c3,{children:R.jsx(f3,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:Ne("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r})})}function $p({className:t,inset:e,variant:n="default",...r}){return R.jsx(h3,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Ne("group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function a1({className:t,children:e,checked:n,inset:r,...o}){return R.jsxs(p3,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:Ne("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),checked:n,...o,children:[R.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:R.jsx(dM,{children:R.jsx(Js,{})})}),e]})}function eT({...t}){return R.jsx(m3,{"data-slot":"dropdown-menu-radio-group",...t})}function tT({className:t,children:e,inset:n,...r}){return R.jsxs(g3,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:Ne("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[R.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:R.jsx(dM,{children:R.jsx(Js,{})})}),e]})}function Is({className:t,inset:e,...n}){return R.jsx(d3,{"data-slot":"dropdown-menu-label","data-inset":e,className:Ne("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",t),...n})}function Ro({className:t,...e}){return R.jsx(y3,{"data-slot":"dropdown-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border/50",t),...e})}function Hp({...t}){return R.jsx(v3,{"data-slot":"dropdown-menu-sub",...t})}function Up({className:t,inset:e,children:n,...r}){return R.jsxs(b3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:Ne("flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[n,R.jsx(Dm,{className:"ml-auto"})]})}function Gp({className:t,...e}){return R.jsx(S3,{"data-slot":"dropdown-menu-sub-content",className:Ne("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})}function lP({isConnected:t,isConnecting:e,className:n}){const r=t?{dotClassName:"bg-emerald-500",label:"Connected",textClassName:"text-emerald-600 dark:text-emerald-400"}:e?{dotClassName:"bg-amber-500",label:"Connecting",textClassName:"text-amber-600 dark:text-amber-400"}:{dotClassName:"bg-muted-foreground/60",label:"Disconnected",textClassName:"text-muted-foreground"};return R.jsxs("div",{className:Ne("inline-flex items-center gap-2 text-xs font-medium",n),children:[R.jsx("span",{"aria-hidden":"true",className:Ne("size-2 rounded-full",r.dotClassName)}),R.jsx("span",{className:r.textClassName,children:r.label})]})}function aP({streams:t,selectedStreamId:e,isConnected:n,isConnecting:r,isDisabled:o=!1,canClear:l=!0,onClear:a,onPause:c,onPlay:d,onSelectStream:h,className:p}){const g=M.useMemo(()=>e?t.find(x=>x.id===e)?.label??"Select a stream":t[0]?.label??"Select a stream",[e,t]),v=!o&&t.length>0,b=!o&&!!e&&!r,S=n?"Pause stream":"Play stream";return R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsxs("div",{className:Ne("flex min-w-0 h-10 overflow-hidden rounded-md border border-input bg-background",p),children:[R.jsxs(QR,{children:[R.jsx(ZR,{asChild:!0,children:R.jsxs(Ps,{type:"button",variant:"ghost",className:"h-10 min-w-0 border-0 flex-1 justify-between",disabled:!v,children:[R.jsx("span",{className:"truncate text-sm",children:g}),R.jsx(x1,{className:"size-4 text-muted-foreground"})]})}),R.jsxs(WR,{align:"start",sideOffset:10,className:"max-h-80 max-w-[min(24rem,calc(100vw-2rem))]",children:[R.jsx("div",{className:"px-2 py-1.5",children:R.jsx(lP,{isConnected:n,isConnecting:r})}),R.jsx(Ro,{}),R.jsx(Is,{children:"Streams"}),R.jsx(Ro,{}),R.jsx(eT,{value:e??"",onValueChange:h,children:t.map(x=>R.jsx(tT,{value:x.id,className:"min-h-9 text-sm",children:x.label},x.id))})]})]}),R.jsx(Ps,{type:"button",variant:"ghost",size:"icon-xl",disabled:!l,"aria-label":"Clear rows",onClick:a,className:"rounded-full",children:R.jsx(jm,{className:"size-5"})})]}),R.jsxs(Ps,{type:"button",size:"xl",variant:"outline",disabled:!b,"aria-label":S,onClick:n?c:d,className:Ne(n?"border-blue-500 ring-1 ring-blue-500 text-blue-500!":"","cursor-pointer gap-2"),children:[R.jsx("div",{className:Ne("[&_svg]:shrink-0 [&_svg]:size-3",r?"animate-spin":""),children:r?R.jsx(af,{}):n?R.jsx(ZO,{className:"[&_rect]:fill-current"}):R.jsx(JO,{className:"[&_path]:fill-current"})}),"Live"]})]})}const nT="(prefers-color-scheme: dark)",uP=["dark","light","system"],rT=M.createContext(void 0);function u1(t){return t===null?!1:uP.includes(t)}function c1(){return window.matchMedia(nT).matches?"dark":"light"}function cP(){const t=document.createElement("style");return t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.remove()})})}}function fP(t){return t instanceof HTMLElement?!!(t.isContentEditable||t.closest("input, textarea, select, [contenteditable='true']")):!1}function dP({children:t,defaultTheme:e="system",storageKey:n="theme",disableTransitionOnChange:r=!0,...o}){const[l,a]=M.useState(()=>{const p=localStorage.getItem(n);return u1(p)?p:e}),c=M.useCallback(p=>{localStorage.setItem(n,p),a(p)},[n]),d=M.useCallback(p=>{const g=document.documentElement,v=p==="system"?c1():p,b=r?cP():null;g.classList.remove("light","dark"),g.classList.add(v),b&&b()},[r]);M.useEffect(()=>{if(d(l),l!=="system")return;const p=window.matchMedia(nT),g=()=>{d("system")};return p.addEventListener("change",g),()=>{p.removeEventListener("change",g)}},[l,d]),M.useEffect(()=>{const p=g=>{g.repeat||g.metaKey||g.ctrlKey||g.altKey||fP(g.target)||g.key.toLowerCase()==="d"&&a(v=>{const b=v==="dark"?"light":v==="light"?"dark":c1()==="dark"?"light":"dark";return localStorage.setItem(n,b),b})};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[n]),M.useEffect(()=>{const p=g=>{if(g.storageArea===localStorage&&g.key===n){if(u1(g.newValue)){a(g.newValue);return}a(e)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}},[e,n]);const h=M.useMemo(()=>({theme:l,setTheme:c}),[l,c]);return R.jsx(rT.Provider,{...o,value:h,children:t})}const hP=()=>{const t=M.useContext(rT);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},pP=[{icon:R1,label:"Light",value:"light"},{icon:M1,label:"Dark",value:"dark"},{icon:E1,label:"System",value:"system"}];function mP({columns:t,groupedColumnIds:e,isDisabled:n=!1,onExportCsv:r,onExportMarkdown:o,onClearGrouping:l,onToggleGrouping:a,onToggleColumn:c,className:d}){const{theme:h,setTheme:p}=hP(),g=!n&&t.length>0,v=M.useMemo(()=>e.flatMap(b=>{const S=t.find(x=>x.id===b);return S?[S.label]:[]}),[t,e]);return R.jsxs(QR,{children:[R.jsx(ZR,{asChild:!0,children:R.jsx(Ps,{type:"button",variant:"outline",size:"icon-xl",disabled:n,className:Ne("shrink-0",d),"aria-label":"Open settings",children:R.jsx(nk,{className:"size-4"})})}),R.jsxs(WR,{align:"end",sideOffset:10,className:"w-64 max-w-[min(24rem,calc(100vw-2rem))]",children:[R.jsx(Is,{children:"View"}),R.jsxs(Hp,{children:[R.jsxs(Up,{className:"min-h-9 text-sm",children:[R.jsx(E1,{className:"size-4 text-muted-foreground"}),"Columns"]}),R.jsxs(Gp,{className:"max-h-80 w-64 overflow-y-auto",children:[R.jsx(Is,{children:"Visible columns"}),R.jsx(Ro,{}),t.map(b=>R.jsx(a1,{checked:b.visible,className:"min-h-9 text-sm",onSelect:S=>{S.preventDefault()},onCheckedChange:S=>c(b.id,S===!0),children:R.jsxs("span",{className:"flex min-w-0 items-center gap-2 pr-4",children:[b.kind?R.jsx(fa,{kind:b.kind,className:"size-4 shrink-0 text-muted-foreground"}):null,R.jsx("span",{className:"truncate",children:b.label})]})},b.id))]})]}),R.jsxs(Hp,{children:[R.jsxs(Up,{className:"min-h-9 text-sm",disabled:n||t.length===0,children:[R.jsx(fk,{className:"size-4 text-muted-foreground"}),"Group rows"]}),R.jsxs(Gp,{className:"max-h-80 w-64 overflow-y-auto",children:[R.jsx(Is,{children:v.length>0?`Grouped by ${v.join(", ")}`:"Group rows by field"}),R.jsx(Ro,{}),R.jsx($p,{className:"min-h-9 text-sm",disabled:e.length===0,onSelect:b=>{b.preventDefault(),l()},children:"Clear grouping"}),R.jsx(Ro,{}),t.map(b=>R.jsx(a1,{checked:e.includes(b.id),className:"min-h-9 text-sm",onSelect:S=>{S.preventDefault()},onCheckedChange:S=>a(b.id,S===!0),children:R.jsxs("span",{className:"flex min-w-0 items-center gap-2 pr-4",children:[b.kind?R.jsx(fa,{kind:b.kind,className:"size-4 shrink-0 text-muted-foreground"}):null,R.jsx("span",{className:"truncate",children:b.label})]})},b.id))]})]}),R.jsxs(Hp,{children:[R.jsxs(Up,{className:"min-h-9 text-sm",children:[R.jsx(R1,{className:"size-4 text-muted-foreground dark:hidden"}),R.jsx(M1,{className:"hidden size-4 text-muted-foreground dark:block"}),"Theme"]}),R.jsxs(Gp,{className:"w-44",children:[R.jsx(Is,{children:"Appearance"}),R.jsx(Ro,{}),R.jsx(eT,{value:h,onValueChange:b=>p(b),children:pP.map(b=>{const S=b.icon;return R.jsxs(tT,{value:b.value,className:"min-h-9 text-sm",children:[R.jsx(S,{className:"size-4 text-muted-foreground"}),b.label]},b.value)})})]})]}),R.jsx(Ro,{}),R.jsx(Is,{children:"Export"}),R.jsxs($p,{className:"min-h-9 text-sm",disabled:!g,onSelect:r,children:[R.jsx(Yp,{className:"size-4 text-muted-foreground"}),"Export CSV"]}),R.jsxs($p,{className:"min-h-9 text-sm",disabled:!g,onSelect:o,children:[R.jsx(Yp,{className:"size-4 text-muted-foreground"}),"Export Markdown"]})]})]})}const of="stream",iT="datatable-",f1="datool";function sf(t){return`${t}-search`}function lf(t){return`${iT}${t}`}function gP(t){return t.startsWith(`${iT}${f1}`)||t.startsWith(`${f1}-`)&&t.endsWith("-search")}function Ig(t){if(typeof window>"u")return null;try{const e=new URL(window.location.href).searchParams.get(lf(t));return e?JSON.parse(e):null}catch{return null}}function oT(t,e){const n=new Set(e);return Object.fromEntries(Object.entries(t??{}).filter(([r])=>n.has(r)))}function sT(t,e){const n=new Set(e);return(t??[]).filter((r,o,l)=>n.has(r)&&l.indexOf(r)===o)}function yP(t,e){const n=sf(e),r=lf(e);for(const o of Array.from(t.searchParams.keys()))o===of||o===n||o===r||gP(o)&&t.searchParams.delete(o)}function lT(){return typeof window>"u"?null:new URL(window.location.href).searchParams.get(of)}function qp(t){return typeof window>"u"?"":new URL(window.location.href).searchParams.get(sf(t))??""}function d1(t,e){return oT(Ig(t)?.columnVisibility,e)}function h1(t,e){return sT(Ig(t)?.groupBy,e)}function vP({columnIds:t,columnVisibility:e,groupBy:n,search:r,selectedStreamId:o,tableId:l}){if(typeof window>"u")return;const a=new URL(window.location.href),c=r.trim(),d=oT(e,t),h=sT(n,t),p={...Ig(l)};yP(a,l),o?a.searchParams.set(of,o):a.searchParams.delete(of),c?a.searchParams.set(sf(l),r):a.searchParams.delete(sf(l)),Object.keys(d).length>0?p.columnVisibility=d:delete p.columnVisibility,h.length>0?p.groupBy=h:delete p.groupBy,Object.keys(p).length>0?a.searchParams.set(lf(l),JSON.stringify(p)):a.searchParams.delete(lf(l)),window.history.replaceState(window.history.state,"",a)}const bP={Ban:FO,Check:Js,CircleAlert:_m,Copy:w1,Download:Yp,ExternalLink:ik,Filter:C1,Info:uk,Play:bk,RefreshCcw:xk,Search:zm,Trash:Tk,X:jm};function SP(t,e){const n=t.findIndex(r=>r.__datoolRowId===e.__datoolRowId);return n<0?[...t,e]:t.map((r,o)=>o===n?e:r)}function xP(t){return t.map(({__datoolRowId:e,...n})=>n)}function wP(t){if(t===void 0)return"undefined:";if(t===null)return"null:";if(t instanceof Date)return`date:${t.toISOString()}`;if(typeof t=="object")try{return`object:${JSON.stringify(t)}`}catch{return`object:${String(t)}`}return`${typeof t}:${String(t)}`}function CP(t,e){if(e.length===0||t.length===0)return t;const n=[],r=new Map;for(const l of t){const a=e.map(d=>wP(wf(l,d.accessorKey))).join(""),c=r.get(a);if(c){c.push(l);continue}n.push(a),r.set(a,[l])}const o=[];return n.forEach((l,a)=>{const c=r.get(l)??[];o.push(...c)}),o}function MP(t,e,n){if(!n||n.length===0)return t;const r=new Map(e.map((o,l)=>[o,n[l]??!0]));return t.flatMap(o=>{const l=r.get(o.__datoolRowId);return l===void 0||l===!0?[o]:l===!1||l===null?[]:[{...l,__datoolRowId:o.__datoolRowId}]})}function EP(){return lT()}function RP(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function Kp(t){return t?`datool-${t}`:"datool"}function aT(t,e){if(t==null||t==="")return"";if(e==="date"){const n=t instanceof Date?t:new Date(t);if(!Number.isNaN(n.getTime()))return n.toISOString()}return typeof t=="object"?JSON.stringify(t):String(t)}function p1(t){return/[",\n]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function m1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
|
|
160
|
+
`).replace(/\n/g,"<br />")}function TP(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"log-view"}function AP(t,e,n){const r=new Blob([t],{type:`${n};charset=utf-8`}),o=window.URL.createObjectURL(r),l=document.createElement("a");l.href=o,l.download=e,document.body.appendChild(l),l.click(),l.remove(),window.setTimeout(()=>{window.URL.revokeObjectURL(o)},0)}function OP(t,e){const n=e.map(o=>p1(o.label)).join(","),r=t.map(o=>e.map(l=>p1(aT(wf(o,l.accessorKey),l.kind))).join(","));return[n,...r].join(`
|
|
161
|
+
`)}function kP(t,e){const n=`| ${e.map(l=>m1(l.label)).join(" | ")} |`,r=`| ${e.map(()=>"---").join(" | ")} |`,o=t.map(l=>`| ${e.map(a=>m1(aT(wf(l,a.accessorKey),a.kind))).join(" | ")} |`);return[n,r,...o].join(`
|
|
162
|
+
`)}function NP(t){return t.map((e,n)=>{const r=gI(e.accessorKey);return{accessorFn:r?o=>wf(o,e.accessorKey):void 0,accessorKey:r?void 0:e.accessorKey,align:e.align,enumColors:e.enumColors,header:e.header,id:NM(e,n),kind:e.kind,maxWidth:e.maxWidth,minWidth:e.minWidth,truncate:e.truncate,width:e.width}})}function DP(t){return JSON.parse(t.data)}function _P(t){return JSON.parse(t.data)}function zP(t){return JSON.parse(t.data)}function Lg(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function g1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
|
|
163
|
+
`).replace(/\n/g,"<br />")}function uT(t,e){if(e.accessorFn)return e.accessorFn(t);if(e.accessorKey)return t[e.accessorKey]}function cT(t,e){return t.header??t.id??t.accessorKey??`Column ${e+1}`}function jP(t,e){const n=e.map((o,l)=>g1(cT(o,l)));return[`| ${n.join(" | ")} |`,`| ${n.map(()=>"---").join(" | ")} |`,...t.map(o=>`| ${e.map(a=>g1(Lg(uT(o,a)))).join(" | ")} |`)].join(`
|
|
164
|
+
`)}function IP(t,e){const n=Lg(e);return n.trim()?`${t}:${yM(n)}`:null}function LP(t,e,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=mM(t).filter(l=>!l.match(new RegExp(`^${r}(:|>|<)`)));return o.push(n),o.join(" ")}function BP({activeStream:t,columns:e,config:n,errorMessage:r,isConnected:o,isConnecting:l,isLoadingConfig:a,rows:c,settingsColumns:d,groupedColumnIds:h,selectedStreamId:p,setGroupedColumnIds:g,setColumnVisibility:v,searchInputRef:b,handleExport:S,setRows:x,setSelectedStreamId:C,setShouldConnect:E}){const{search:A,setSearch:O}=X3(),D=M.useMemo(()=>[...t?.actions.map(L=>({button:L.button,icon:L.icon?bP[L.icon]:void 0,id:`config-${L.id}`,label:L.label,onSelect:async({actionRowIds:_,actionRows:I})=>{if(!t)return;const Q=new URL(`/api/streams/${encodeURIComponent(t.id)}/actions/${encodeURIComponent(L.id)}`,window.location.origin),ue=new URL(window.location.href).searchParams;for(const[ie,ve]of ue.entries())Q.searchParams.set(ie,ve);const se={rows:xP(I)},le=await fetch(Q,{body:JSON.stringify(se),headers:{"Content-Type":"application/json"},method:"POST"}),xe=await le.json().catch(()=>null);if(!le.ok)throw new Error(xe?.error??`Failed to run action "${L.label}".`);if(xe?.rowChanges!==void 0&&!Array.isArray(xe.rowChanges))throw new Error(`Action "${L.label}" returned an invalid response.`);x(ie=>MP(ie,_,xe?.rowChanges))},scope:"selection"}))??[],{icon:w1,id:"copy-markdown",label:({actionRows:L})=>L.length>1?`Copy ${L.length} rows as Markdown`:"Copy row as Markdown",onSelect:async({actionRows:L})=>{await navigator.clipboard.writeText(jP(L,e))},scope:"selection"},{icon:C1,id:"filter-matching",items:({anchorRow:L})=>e.map((_,I)=>{const Q=uT(L,_),ue=IP(_.id??`column-${I}`,Q);return{disabled:ue===null,icon:se=>R.jsx(fa,{kind:_.kind??"text",...se}),id:`filter-${_.id??I}`,label:`${cT(_,I)}: ${Lg(Q)||"(empty)"}`,onSelect:()=>{ue&&O(LP(A,_.id??`column-${I}`,ue))},scope:"row"}}),label:"Filter matching",scope:"row"}],[t,e,A,O]);return R.jsxs("main",{className:"flex h-svh min-h-0 w-full min-w-0 flex-col gap-3 bg-background px-0 pt-3 pb-0",children:[R.jsxs("header",{className:"flex w-full flex-wrap items-start gap-3 px-4",children:[R.jsx(sP,{inputRef:b}),R.jsxs("div",{className:"flex min-w-20 items-start gap-3",children:[R.jsx(aP,{streams:n?.streams??[],selectedStreamId:p,isConnected:o,isConnecting:l,isDisabled:a||!n,canClear:c.length>0,onSelectStream:C,onPlay:()=>E(!0),onPause:()=>E(!1),onClear:()=>x([])}),R.jsx(mP,{columns:d,groupedColumnIds:h,isDisabled:a||!t,onExportCsv:()=>S("csv"),onExportMarkdown:()=>S("md"),onClearGrouping:()=>g([]),onToggleGrouping:(z,L)=>g(_=>L?_.includes(z)?_:[..._,z]:_.filter(I=>I!==z)),onToggleColumn:(z,L)=>v(_=>({..._,[z]:L}))})]})]}),r?R.jsx("div",{className:"px-4 text-sm text-destructive",children:r}):null,R.jsx("div",{className:"min-h-0 flex-1",children:t?R.jsx(mI,{rowActions:D}):R.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"No stream selected."})})]})}function VP(){const[t]=M.useState(()=>{const F=EP(),X=Kp(F);return{search:qp(X),streamId:F,tableId:X}}),[e,n]=M.useState(null),[r,o]=M.useState([]),[l,a]=M.useState(()=>t.streamId),[c,d]=M.useState(()=>!!t.streamId),[h,p]=M.useState(!0),[g,v]=M.useState(!1),[b,S]=M.useState(null),[x,C]=M.useState(()=>t.search),[E,A]=M.useState({}),[O,D]=M.useState([]),z=M.useRef(null),L=M.useRef(!1),[_,I]=M.useState(null);M.useEffect(()=>{let F=!1;return fetch("/api/config").then(async X=>{if(!X.ok)throw new Error("Failed to load log viewer config.");return await X.json()}).then(X=>{F||(n(X),a(ne=>ne&&X.streams.some(oe=>oe.id===ne)?ne:X.streams[0]?.id??null))}).catch(X=>{F||S(X instanceof Error?X.message:String(X))}).finally(()=>{F||p(!1)}),()=>{F=!0}},[]);const Q=M.useMemo(()=>!e||!l?null:e.streams.find(F=>F.id===l)??null,[e,l]),ue=M.useMemo(()=>Q?NP(Q.columns):[],[Q]),se=M.useMemo(()=>Kp(l),[l]),le=M.useMemo(()=>Q?.columns.map((F,X)=>({accessorKey:F.accessorKey,id:NM(F,X),kind:F.kind,label:F.header??RP(F.accessorKey)}))??[],[Q]),xe=M.useMemo(()=>le.map(F=>({id:F.id,kind:F.kind,label:F.label,visible:E[F.id]!==!1})),[E,le]),ie=M.useMemo(()=>le.filter(F=>E[F.id]!==!1),[E,le]),ve=M.useMemo(()=>new Map(le.map(F=>[F.id,F])),[le]),V=M.useMemo(()=>O.flatMap(F=>{const X=ve.get(F);return X?[X]:[]}),[ve,O]),Z=M.useMemo(()=>CP(r,V),[V,r]),U=!!l&&c&&!g,q=M.useMemo(()=>le.map(F=>F.id),[le]);M.useEffect(()=>{L.current&&(o([]),S(null)),L.current=!0},[l]),M.useEffect(()=>{if(!Q){D([]),I(null);return}C(qp(se)),A(d1(se,q)),D(h1(se,q)),I(se)},[Q,q,se]),M.useEffect(()=>{if(!Q||_!==se)return;const F=window.setTimeout(()=>{vP({columnIds:q,columnVisibility:E,groupBy:O,search:x,selectedStreamId:l,tableId:se})},300);return()=>window.clearTimeout(F)},[Q,q,E,O,_,x,l,se]),M.useEffect(()=>{const F=()=>{const X=lT(),ne=Kp(X);a(oe=>(oe===X&&(C(qp(ne)),A(d1(ne,q)),D(h1(ne,q)),I(ne)),X))};return window.addEventListener("popstate",F),()=>window.removeEventListener("popstate",F)},[q]),M.useEffect(()=>{if(!l||!c){z.current?.close(),z.current=null,v(!1);return}S(null),o([]);const F=new URL(`/api/streams/${encodeURIComponent(l)}/events`,window.location.origin),X=new URL(window.location.href).searchParams;for(const[De,ye]of X.entries())F.searchParams.set(De,ye);const ne=new EventSource(F);z.current=ne;const oe=De=>{const ye=DP(De);o(it=>SP(it,{...ye.row,__datoolRowId:ye.id}))},fe=De=>{const ye=_P(De);S(ye.message)},me=De=>{zP(De),ne.close(),z.current=null,v(!1)};return ne.onopen=()=>{v(!0)},ne.onerror=()=>{v(!1)},ne.addEventListener("row",oe),ne.addEventListener("runtime-error",fe),ne.addEventListener("end",me),()=>{ne.removeEventListener("row",oe),ne.removeEventListener("runtime-error",fe),ne.removeEventListener("end",me),ne.close(),v(!1)}},[l,c]);const K=M.useRef(null);M.useEffect(()=>{const F=X=>{(X.metaKey||X.ctrlKey)&&X.key.toLowerCase()==="f"&&(X.preventDefault(),K.current?.focus(),K.current?.selectAll())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[]);const N=M.useCallback(F=>{if(!Q||ie.length===0)return;const X=new Date().toISOString().replaceAll(":","-"),ne=`${TP(Q.label)}-${X}`,oe=F==="csv"?OP(Z,ie):kP(Z,ie);AP(oe,`${ne}.${F}`,F==="csv"?"text/csv":"text/markdown")},[Q,Z,ie]);return R.jsx(J3,{autoScrollToBottom:O.length===0,columnVisibility:E,columns:ue,data:r,dateFormat:e?.dateFormat,getRowId:F=>F.__datoolRowId,grouping:O,height:"100%",id:se,onColumnVisibilityChange:A,onGroupingChange:D,onSearchChange:C,search:x,rowHeight:20,statePersistence:"none",children:R.jsx(BP,{activeStream:Q,columns:ue,config:e,errorMessage:b,handleExport:N,isConnected:g,isConnecting:U,isLoadingConfig:h,groupedColumnIds:O,rows:r,settingsColumns:xe,setGroupedColumnIds:D,setColumnVisibility:A,searchInputRef:K,selectedStreamId:l,setRows:o,setSelectedStreamId:a,setShouldConnect:d})})}OO.createRoot(document.getElementById("root")).render(R.jsx(M.StrictMode,{children:R.jsx(dP,{storageKey:"datool-theme",children:R.jsx(VP,{})})}));
|