@romansmirnov/doku 1.0.2 → 1.0.3
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.
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ae={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=h(),n=p(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xd(t),e=Zd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=Zd(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),sp._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,eee=t.unstable_LowPriority,Le=t.unstable_IdlePriority,tee=t.log,nee=t.unstable_setDisableYieldValue,Re=null,ze=null;function Be(e){if(typeof tee==`function`&&nee(e),ze&&typeof ze.setStrictMode==`function`)try{ze.setStrictMode(Re,e)}catch{}}var Ve=Math.clz32?Math.clz32:Ue,He=Math.log,ree=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(He(e)/ree|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function iee(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Xe(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ve(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ve(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ve(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=ae.p;return e===0?(e=window.event,e===void 0?32:Cp(e.type)):e}function ot(e,t){var n=ae.p;try{return ae.p=e,t()}finally{ae.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bf(e);e!==null;){if(n=e[ct])return n;e=bf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=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]*$`),Dt={},Ot={};function kt(e){return De.call(Ot,e)?!0:De.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=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 Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Qt=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`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(Du(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,`passive`,{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function bn(){return!1}function xn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?yn:bn,this.isPropagationStopped=bn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=f({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=f({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(f({},kn,{dataTransfer:0})),Mn=xn(f({},wn,{relatedTarget:0})),Nn=xn(f({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(f({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(f({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(f({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(f({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(f({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(f({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(f({},kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Kn=xn(f({},Sn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=dn&&`CompositionEvent`in window,Yn=null;dn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=dn&&`TextEvent`in window&&!Yn,Zn=dn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=_n(),gn=hn=mn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=Fd(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,M=null;function lr(e){Dd(e,0)}function ur(e){if(Lt(yt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(dn){var pr;if(dn){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){cr&&(cr.detachEvent(`onpropertychange`,_r),M=cr=null)}function _r(e){if(e.propertyName===`value`&&ur(M)){var t=[];sr(t,M,e,rn(e)),ln(lr,t)}}function aee(e,t,n){e===`focusin`?(gr(),cr=t,M=n,cr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function N(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(M)}function vr(e,t){if(e===`click`)return ur(t)}function yr(e,t){if(e===`input`||e===`change`)return ur(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Or=dn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Rt(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=Fd(Ar,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};dn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),wt(t,[e])}var Yr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ve(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<vu)throw vu=0,yu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=Qf(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=si(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Ve(r)-1;r&=~(1<<i),n+=1;var a=32-Ve(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Ve(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Od(`cancel`,t),Od(`close`,t);break;case`iframe`:case`object`:case`embed`:Od(`load`,t);break;case`video`:case`audio`:for(n=0;n<Td.length;n++)Od(Td[n],t);break;case`source`:Od(`error`,t);break;case`img`:case`image`:case`link`:Od(`error`,t),Od(`load`,t);break;case`details`:Od(`toggle`,t);break;case`input`:Od(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Od(`invalid`,t);break;case`textarea`:Od(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Bd(t.textContent,n)?(r.popover!=null&&(Od(`beforetoggle`,t),Od(`toggle`,t)),r.onScroll!=null&&Od(`scroll`,t),r.onScrollEnd!=null&&Od(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Qd(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=yf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=yf(e)}else t===27?(t=Ni,sf(e.type)?(e=vf,vf=null,Ni=e):Ni=t):Ni=Mi?_f(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(iu===null?iu=e:iu.push.apply(iu,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=le(null),Ki=null,qi=null;function Ji(e,t,n){de(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,ue(Gi)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sp]:e.push(sp))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=yd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=j.S;j.S=function(e,t){su=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=le(null);function ya(){var e=va.current;return e===null?Hl.pooledCache:e}function ba(e,t){t===null?de(va,va.current):de(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Hl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=di(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(ie(t)||te(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Oa(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Oa(r),m(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Ia(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Pi&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Pi&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Pi&&Di(i,h),l}function _(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Pi&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Pi&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Vl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Wl&p)===p:(r&p)===p){p!==0&&p===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ba=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ql|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=le(null),$a=le(0);function eo(e,t){e=Xl,de($a,e),de(Qa,t),Xl=e|t.baseLanes}function to(){de($a,Xl),de(Qa,Qa.current)}function no(){Xl=$a.current,ue(Qa),ue($a)}var ro=le(null),io=null;function ao(e){var t=e.alternate;de(uo,uo.current&1),de(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){de(uo,uo.current),de(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(de(uo,uo.current),de(ro,e),io===null&&(io=e)):co(e)}function co(){de(uo,uo.current),de(ro,ro.current)}function lo(e){ue(ro),io===e&&(io=null),ue(uo)}var uo=le(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mf(n)||hf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,mo=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(i(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return po=a,mo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Us:Ws,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){j.H=Hs;var t=ho!==null&&ho.next!==null;if(po=0,go=ho=mo=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&$i(e)&&(ic=!0))}function Oo(e,t,n,r){mo=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Gs,o=t(n,r)}while(vo);return o}function ko(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(mo.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}po=0,go=ho=mo=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?mo.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=mo.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?mo.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw mo.alternate===null?Error(i(467)):Error(i(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?mo.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Da(So,e,t),t=mo,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Us:Ws),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Ro(e){var t=null,n=mo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=mo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Fo(),mo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(Wl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,mo.lanes|=p,Ql|=p;f=u.action,yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,mo.lanes|=f,Ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(ic=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ho(e){var t=Po(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);xr(o,t.memoizedState)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=mo,a=Po(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((ho||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,hs(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),Hl===null)throw Error(i(349));o||po&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mo.updateQueue,t===null?(t=Fo(),mo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Jo(e){var t=ni(e,2);t!==null&&Su(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){Be(!0);try{n()}finally{Be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,a){if(zs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(Pi){var n=Hl.formState;if(n!==null){a:{var r=mo;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=_f(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=_f(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Is.bind(null,mo,r),r.dispatch=n,r=Yo(!1),a=Rs.bind(null,mo,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,mo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return ss(Po(),ho,e)}function ss(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===Sa?wa:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(mo.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Po(),n=ho;if(n!==null)return ss(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=mo.updateQueue,t===null&&(t=Fo(),mo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ds(){return Po().memoizedState}function fs(e,t,n,r){var i=No();mo.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(mo.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){mo.flags|=4;var t=mo.updateQueue;if(t===null)t=Fo(),mo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Po().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Vl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||po&1073741824&&!(Wl&261930)?e.memoizedState=t:(e.memoizedState=n,e=xu(),mo.lanes|=e,Ql|=e,n)}function Es(e,t,n,r){return xr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Wl&261930)?(ic=!0,e.memoizedState=n):(e=xu(),mo.lanes|=e,Ql|=e,t):(e=Ts(e,n,r),xr(e,t)||(ic=!0),e)}function Ds(e,t,n,r,i){var a=ae.p;ae.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Rs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ls(e,t,ga(c,r),bu(e)):Ls(e,t,r,bu(e))}catch(n){Ls(e,t,{then:function(){},status:`rejected`,reason:n},bu())}finally{ae.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function oee(){}function Os(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ks(e).queue;Ds(e,a,t,oe,n===null?oee:function(){return As(e),n(r)})}function ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function As(e){var t=ks(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},bu())}function js(){return ta(sp)}function Ms(){return Po().memoizedState}function Ns(){return Po().memoizedState}function Ps(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(Su(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Fs(e,t,n){var r=bu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Bs(t,n):(n=ti(e,t,n,r),n!==null&&(Su(n,e,r),Vs(n,t,r)))}function Is(e,t,n){Ls(e,t,n,bu())}function Ls(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Bs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Hl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return Su(n,e,r),Vs(n,t,r),!0}return!1}function Rs(e,t,n,r){if(r={lane:2,revertLane:yd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&Su(t,e,2)}function zs(e){var t=e.alternate;return e===mo||t!==null&&t===mo}function Bs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Hs={readContext:ta,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Hs.useEffectEvent=wo;var Us={readContext:ta,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){Be(!0);try{n(t)}finally{Be(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Fs.bind(null,mo,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Is.bind(null,mo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Ds.bind(null,mo,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=mo,a=No();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Hl===null)throw Error(i(349));Wl&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ms(Ko.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Hl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:js,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rs.bind(null,mo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ps.bind(null,mo)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Vl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ws={readContext:ta,use:Lo,useCallback:Cs,useContext:ta,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Bo,useRef:ds,useState:function(){return Bo(zo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Ws.useEffectEvent=_s;var Gs={readContext:ta,use:Lo,useCallback:Cs,useContext:ta,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Ho,useRef:ds,useState:function(){return Ho(zo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Po();return ho===null?Ts(n,e,t):Es(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Gs.useEffectEvent=_s;function Ks(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Su(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Su(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(Su(t,e,n),Ga(t,e,n))}};function Js(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Ys(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&qs.enqueueReplaceState(t,t.state,null)}function Xs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function see(e){Yr(e)}function P(e){console.error(e)}function F(e){Yr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Ua(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(uu===null?uu=new Set([this]):uu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Pu():n.alternate===null&&Zl===0&&(Zl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),$u(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),$u(e,r,a)),!1}throw Error(i(435,n.tag))}return $u(e,r,a),Pu(),!1}if(Pi)return t=ro.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=$s(e.stateNode,r,a),Ka(e,a),Zl!==4&&(Zl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),ru===null?ru=[o]:ru.push(o),Zl!==4&&(Zl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(uu===null||!uu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!ic?(jo(e,t,i),Ac(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if(ic=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return Ra(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(oo(t),(e=Ni)?(e=pf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ic||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Hl,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),Su(r,e,s),rc;Pu(),t=pc(e,t,n)}else e=o.treeContext,Ni=_f(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=fc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return ea(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!ic?(jo(e,t,i),Ac(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!ic?(jo(e,t,a),Ac(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ks(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&qs.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Xs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ys(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Ks(t,n,d,r),l=t.memoizedState),(c=Ba||Js(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Xs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ys(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Ks(t,n,s,r),p=t.memoizedState),(u=Ba||Js(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Hi(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:xa()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=tu),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Pi){if(a?ao(t):co(t),(e=Ni)?(e=pf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return hf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(ao(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),hf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(ic||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Hl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),Su(s,e,r),rc;mf(c)||Pu(),t=Ec(e,t,n)}else mf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=_f(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return Ra(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,de(uo,o),ac(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(uo,uo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!jc(e,n)&&!(t.flags&128))return ic=!1,Mc(e,t,n);ic=!!(e.flags&131072)}else ic=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Xs(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Xs(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=yc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=_f(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Yd(me.current).createElement(n),r[ct]=t,r[lt]=e,Ud(r,n,e),xt(r),t.stateNode=r):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Pi&&(r=t.stateNode=xf(t.type,t.pendingProps,me.current),Mi=t,Ii=!0,a=Ni,sf(t.type)?(vf=a,Ni=_f(r.firstChild)):Ni=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=df(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=_f(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Qd(a,o)?r=null:s!==null&&Qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Eo(e,t,ko,null,null,n),sp._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=ff(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return Cc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Hl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(ju())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$f(t))if(ju())e.flags|=8192;else throw ka=Ta,Ca}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,nu|=t)}function Rc(e,t){if(!Pi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zc(t),null;case 1:return zc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),zc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(zc(t),Fc(t,a,null,r,n)):(zc(t),Ic(t,o))):o?o===e.memoizedState?(zc(t),t.flags&=-16777217):(Pc(t),zc(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),zc(t),Fc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}e=fe.current,Vi(t)?zi(t,e):(e=xf(a,r,n),t.stateNode=e,Pc(t))}return zc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}if(o=fe.current,Vi(t))zi(t,o);else{var s=Yd(me.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ud(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return zc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Bd(e.nodeValue,n)),e||Ri(t,!0)}else e=Yd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return zc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return zc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),zc(t),null);case 4:return _e(),e===null&&jd(t.stateNode.containerInfo),zc(t),null;case 10:return Yi(t.type),zc(t),null;case 19:if(ue(uo),r=t.memoizedState,r===null)return zc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(Zl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return de(uo,uo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>cu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return zc(t),null}else 2*Me()-r.renderingStartTime>cu&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(zc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=uo.current,de(uo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zc(t),t.subtreeFlags&6&&(t.flags|=8192)):zc(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),zc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(uo),null;case 4:return _e(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&ue(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Hc(e,t){switch(Ai(t),t.tag){case 3:Yi(sa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:ue(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&ue(va);break;case 24:Yi(sa)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Qu(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Qu(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Qu(e,e.return,t)}}}function Kc(e,t,n){n.props=Xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Qu(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Qu(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Qu(e,t,n)}else n.current=null}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Qu(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Wd(r,e.type,n,t),r[lt]=t}catch(t){Qu(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sf(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&sf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ud(t,r,n),t[ct]=e,t[lt]=n}catch(t){Qu(e,e.return,t)}}var nl=!1,rl=!1,il=!1,al=typeof WeakSet==`function`?WeakSet:Set,ol=null;function cee(e,t){if(e=e.containerInfo,qd=gp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},gp=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Xs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)uf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:uf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ol=e;break}ol=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Uc(5,n);break;case 1:if(Sl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Qu(n,n.return,e)}else{var i=Xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Qu(n,n.return,e)}}r&64&&Gc(n),r&512&&qc(n,n.return);break;case 3:if(Sl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Za(e,t)}catch(e){Qu(n,n.return,e)}}break;case 27:t===null&&r&4&&tl(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Yc(n),r&512&&qc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=nd.bind(null,n),gf(e,n))));break;case 22:if(r=n.memoizedState!==null||nl,!r){t=t!==null&&t.memoizedState!==null||rl,i=nl;var a=rl;nl=r,(rl=t)&&!a?wl(e,n,(n.subtreeFlags&8772)!=0):Sl(e,n),nl=i,rl=a}break;case 30:break;default:Sl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&>(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(ze&&typeof ze.onCommitFiberUnmount==`function`)try{ze.onCommitFiberUnmount(Re,n)}catch{}switch(n.tag){case 26:rl||Jc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rl||Jc(n,t);var r=ll,i=ul;sf(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),Sf(n.stateNode),ll=r,ul=i;break;case 5:rl||Jc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null)if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){Qu(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){Qu(n,t,e)}break;case 18:ll!==null&&(ul?(e=ll,cf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):cf(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Wc(2,n,t),rl||Wc(4,n,t),dl(e,t,n);break;case 1:rl||(Jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Kc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:rl=(r=rl)||n.memoizedState!==null,dl(e,t,n),rl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){Qu(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){Qu(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new al),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new al),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=rd.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(sf(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Wc(3,e,e.return),Uc(3,e),Wc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&64&&nl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ud(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=Xf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ud(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Xf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ud(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else Zf(a,e.type,e.stateNode);else e.stateNode=Gf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Zf(a,e.type,e.stateNode):Gf(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){Qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Xc(e,a,n===null?a:n.memoizedProps)),r&1024&&(il=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Qu(e,e.return,t)}}break;case 3:if(Yf=null,a=vl,vl=Tf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){Qu(e,e.return,t)}il&&(il=!1,xl(e));break;case 4:r=vl,vl=Tf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ou=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=nl,d=rl;if(nl=u||a,rl=d||l,_l(t,e),rl=d,nl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||nl||rl||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?lf(m,!0):lf(l.stateNode,!1)}catch(e){Qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Zc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;el(e,Qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),el(e,Qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;$c(e,Qc(e),s);break;default:throw Error(i(161))}}catch(t){Qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wc(4,t,t.return),Cl(t);break;case 1:Jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Kc(t,t.return,n),Cl(t);break;case 27:Sf(t.stateNode);case 26:case 5:Jc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Uc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){Qu(r,r.return,e)}}n&&o&64&&Gc(a),qc(a,a.return);break;case 27:tl(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Yc(a),qc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),qc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Uc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Qu(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:kl(a,o,s,c,i),Uc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&ep(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=Tf(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Wc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Wc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(cl(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var zl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,Vl=0,Hl=null,Ul=null,Wl=0,Gl=0,Kl=null,ql=!1,Jl=!1,Yl=!1,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=null,iu=null,au=!1,ou=0,su=0,cu=1/0,lu=null,uu=null,du=0,fu=null,pu=null,mu=0,hu=0,gu=null,_u=null,vu=0,yu=null;function bu(){return Vl&2&&Wl!==0?Wl&-Wl:j.T===null?at():yd()}function xu(){if(tu===0)if(!(Wl&536870912)||Pi){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),tu=e}else tu=536870912;return e=ro.current,e!==null&&(e.flags|=32),tu}function Su(e,t,n){(e===Hl&&(Gl===2||Gl===9)||e.cancelPendingCommit!==null)&&(ku(e,0),Eu(e,Wl,tu,!1)),Qe(e,n),(!(Vl&2)||e!==Hl)&&(e===Hl&&(!(Vl&2)&&($l|=n),Zl===4&&Eu(e,Wl,tu,!1)),dd(e))}function Cu(e,t,n){if(Vl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),a=r?Lu(e,t):Fu(e,t,!0),o=r;do{if(a===0){Jl&&!r&&Eu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Tu(n)){a=Fu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ru;var l=c.current.memoizedState.isDehydrated;if(l&&(ku(c,s).flags|=256),s=Fu(c,s,!1),s!==2){if(Yl&&!l){c.errorRecoveryDisabledLanes|=o,$l|=o,a=4;break a}o=iu,iu=a,o!==null&&(iu===null?iu=o:iu.push.apply(iu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ku(e,0),Eu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Eu(r,t,tu,!ql);break a;case 2:iu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=ou+300-Me(),10<a)){if(Eu(r,t,tu,!ql),Je(r,0,!0)!==0)break a;mu=t,r.timeoutHandle=tf(wu.bind(null,r,n,iu,lu,au,t,tu,$l,nu,ql,o,`Throttled`,-0,0),a);break a}wu(r,n,iu,lu,au,t,tu,$l,nu,ql,o,null,-0,0)}}break}while(1);dd(e)}function wu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Nl(t,a,d);var m=(a&62914560)===a?ou-Me():(a&4194048)===a?su-Me():0;if(m=np(d,m),m!==null){mu=a,e.cancelPendingCommit=m(Wu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Eu(e,a,o,!l);return}}Wu(e,t,a,n,r,i,o,s,c)}function Tu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Eu(e,t,n,r){t&=~eu,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ve(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function Du(){return Vl&6?!0:(fd(0,!1),!1)}function Ou(){if(Ul!==null){if(Gl===0)var e=Ul.return;else e=Ul,qi=Ki=null,Mo(e),Ma=null,Na=0,e=Ul;for(;e!==null;)Hc(e.alternate,e),e=e.return;Ul=null}}function ku(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,nf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),mu=0,Ou(),Hl=e,Ul=n=li(e.current,null),Wl=t,Gl=0,Kl=null,ql=!1,Jl=Ye(e,t),Yl=!1,nu=tu=eu=$l=Ql=Zl=0,iu=ru=null,au=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ve(r),a=1<<i;t|=e[i],r&=~a}return Xl=t,$r(),n}function Au(e,t){mo=null,j.H=Hs,t===Sa||t===wa?(t=Aa(),Gl=3):t===Ca?(t=Aa(),Gl=4):Gl=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Kl=t,Ul===null&&(Zl=1,Zs(e,_i(t,e.current)))}function ju(){var e=ro.current;return e===null?!0:(Wl&4194048)===Wl?io===null:(Wl&62914560)===Wl||Wl&536870912?e===io:!1}function Mu(){var e=j.H;return j.H=Hs,e===null?Hs:e}function Nu(){var e=j.A;return j.A=zl,e}function Pu(){Zl=4,ql||(Wl&4194048)!==Wl&&ro.current!==null||(Jl=!0),!(Ql&134217727)&&!($l&134217727)||Hl===null||Eu(Hl,Wl,tu,!1)}function Fu(e,t,n){var r=Vl;Vl|=2;var i=Mu(),a=Nu();(Hl!==e||Wl!==t)&&(lu=null,ku(e,t)),t=!1;var o=Zl;a:do try{if(Gl!==0&&Ul!==null){var s=Ul,c=Kl;switch(Gl){case 8:Ou(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Gl;if(Gl=0,Kl=null,Vu(e,s,c,l),n&&Jl){o=0;break a}break;default:l=Gl,Gl=0,Kl=null,Vu(e,s,c,l)}}Iu(),o=Zl;break}catch(t){Au(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Vl=r,j.H=i,j.A=a,Ul===null&&(Hl=null,Wl=0,$r()),o}function Iu(){for(;Ul!==null;)zu(Ul)}function Lu(e,t){var n=Vl;Vl|=2;var r=Mu(),a=Nu();Hl!==e||Wl!==t?(lu=null,cu=Me()+500,ku(e,t)):Jl=Ye(e,t);a:do try{if(Gl!==0&&Ul!==null){t=Ul;var o=Kl;b:switch(Gl){case 1:Gl=0,Kl=null,Vu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Gl=0,Kl=null,Bu(t);break}t=function(){Gl!==2&&Gl!==9||Hl!==e||(Gl=7),dd(e)},o.then(t,t);break a;case 3:Gl=7;break a;case 4:Gl=5;break a;case 7:Ea(o)?(Gl=0,Kl=null,Bu(t)):(Gl=0,Kl=null,Vu(e,t,o,7));break;case 5:var s=null;switch(Ul.tag){case 26:s=Ul.memoizedState;case 5:case 27:var c=Ul;if(s?$f(s):c.stateNode.complete){Gl=0,Kl=null;var l=c.sibling;if(l!==null)Ul=l;else{var u=c.return;u===null?Ul=null:(Ul=u,Hu(u))}break b}}Gl=0,Kl=null,Vu(e,t,o,5);break;case 6:Gl=0,Kl=null,Vu(e,t,o,6);break;case 8:Ou(),Zl=6;break a;default:throw Error(i(462))}}Ru();break}catch(t){Au(e,t)}while(1);return qi=Ki=null,j.H=r,j.A=a,Vl=n,Ul===null?(Hl=null,Wl=0,$r(),Zl):0}function Ru(){for(;Ul!==null&&!Ae();)zu(Ul)}function zu(e){var t=Nc(e.alternate,e,Xl);e.memoizedProps=e.pendingProps,t===null?Hu(e):Ul=t}function Bu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,Wl);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,Wl);break;case 5:Mo(t);default:Hc(n,t),t=Ul=ui(t,Xl),t=Nc(n,t,Xl)}e.memoizedProps=e.pendingProps,t===null?Hu(e):Ul=t}function Vu(e,t,n,r){qi=Ki=null,Mo(t),Ma=null,Na=0;var i=t.return;try{if(nc(e,i,t,n,Wl)){Zl=1,Zs(e,_i(n,e.current)),Ul=null;return}}catch(t){if(i!==null)throw Ul=i,t;Zl=1,Zs(e,_i(n,e.current)),Ul=null;return}t.flags&32768?(Pi||r===1?e=!0:Jl||Wl&536870912?e=!1:(ql=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Uu(t,e)):Hu(t)}function Hu(e){var t=e;do{if(t.flags&32768){Uu(t,ql);return}e=t.return;var n=Bc(t.alternate,t,Xl);if(n!==null){Ul=n;return}if(t=t.sibling,t!==null){Ul=t;return}Ul=t=e}while(t!==null);Zl===0&&(Zl=5)}function Uu(e,t){do{var n=Vc(e.alternate,e);if(n!==null){n.flags&=32767,Ul=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ul=e;return}Ul=e=n}while(e!==null);Zl=6,Ul=null}function Wu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Yu();while(du!==0);if(Vl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,$e(e,n,o,s,c,l),e===Hl&&(Ul=Hl=null,Wl=0),pu=t,fu=e,mu=n,hu=o,gu=a,_u=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,id(Ie,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=ae.p,ae.p=2,s=Vl,Vl|=4;try{cee(e,t,n)}finally{Vl=s,ae.p=a,j.T=r}}du=1,Gu(),Ku(),qu()}}function Gu(){if(du===1){du=0;var e=fu,t=pu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=ae.p;ae.p=2;var i=Vl;Vl|=4;try{yl(t,e);var a=Jd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gp=!!qd,Jd=qd=null}finally{Vl=i,ae.p=r,j.T=n}}e.current=t,du=2}}function Ku(){if(du===2){du=0;var e=fu,t=pu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=ae.p;ae.p=2;var i=Vl;Vl|=4;try{sl(e,t.alternate,t)}finally{Vl=i,ae.p=r,j.T=n}}du=3}}function qu(){if(du===4||du===3){du=0,je();var e=fu,t=pu,n=mu,r=_u;t.subtreeFlags&10256||t.flags&10256?du=5:(du=0,pu=fu=null,Ju(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(uu=null),it(n),t=t.stateNode,ze&&typeof ze.onCommitFiberRoot==`function`)try{ze.onCommitFiberRoot(Re,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=ae.p,ae.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,ae.p=i}}mu&3&&Yu(),dd(e),i=e.pendingLanes,n&261930&&i&42?e===yu?vu++:(vu=0,yu=e):vu=0,fd(0,!1)}}function Ju(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Yu(){return Gu(),Ku(),qu(),Xu()}function Xu(){if(du!==5)return!1;var e=fu,t=hu;hu=0;var n=it(mu),r=j.T,a=ae.p;try{ae.p=32>n?32:n,j.T=null,n=gu,gu=null;var o=fu,s=mu;if(du=0,pu=fu=null,mu=0,Vl&6)throw Error(i(331));var c=Vl;if(Vl|=4,Il(o.current),Ol(o,o.current,s,n),Vl=c,fd(0,!1),ze&&typeof ze.onPostCommitFiberRoot==`function`)try{ze.onPostCommitFiberRoot(Re,o)}catch{}return!0}finally{ae.p=a,j.T=r,Ju(e,t)}}function Zu(e,t,n){t=_i(n,t),t=$s(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Qe(e,2),dd(e))}function Qu(e,t,n){if(e.tag===3)Zu(e,e,n);else for(;t!==null;){if(t.tag===3){Zu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(uu===null||!uu.has(r))){e=_i(n,e),n=ec(2),r=Wa(t,n,2),r!==null&&(tc(n,r,t,e),Qe(r,2),dd(r));break}}t=t.return}}function $u(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Yl=!0,i.add(n),e=ed.bind(null,e,t,n),t.then(e,e))}function ed(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Hl===e&&(Wl&n)===n&&(Zl===4||Zl===3&&(Wl&62914560)===Wl&&300>Me()-ou?!(Vl&2)&&ku(e,0):eu|=n,nu===Wl&&(nu=0)),dd(e)}function td(e,t){t===0&&(t=Xe()),e=ni(e,t),e!==null&&(Qe(e,t),dd(e))}function nd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),td(e,n)}function rd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),td(e,n)}function id(e,t){return Oe(e,t)}var ad=null,od=null,sd=!1,cd=!1,ld=!1,ud=0;function dd(e){e!==od&&e.next===null&&(od===null?ad=od=e:od=od.next=e),cd=!0,sd||(sd=!0,vd())}function fd(e,t){if(!ld&&cd){ld=!0;do for(var n=!1,r=ad;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ve(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,_d(r,a))}else a=Wl,a=Je(r,r===Hl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,_d(r,a));r=r.next}while(n);ld=!1}}function pd(){md()}function md(){cd=sd=!1;var e=0;ud!==0&&ef()&&(e=ud);for(var t=Me(),n=null,r=ad;r!==null;){var i=r.next,a=hd(r,t);a===0?(r.next=null,n===null?ad=i:n.next=i,i===null&&(od=n)):(n=r,(e!==0||a&3)&&(cd=!0)),r=i}du!==0&&du!==5||fd(e,!1),ud!==0&&(ud=0)}function hd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ve(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=iee(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Hl,n=Wl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Gl===2||Gl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),it(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Le;break;default:n=Ie}return r=gd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function gd(e,t){if(du!==0&&du!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Yu()&&e.callbackNode!==n)return null;var r=Wl;return r=Je(e,e===Hl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Cu(e,r,t),hd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?gd.bind(null,e):null)}function _d(e,t){if(Yu())return null;Cu(e,t,!0)}function vd(){af(function(){Vl&6?Oe(Pe,pd):md()})}function yd(){if(ud===0){var e=fa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),ud=e}return ud}function bd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function xd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Sd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=bd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?bd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ud!==0){var e=o?xd(i,o):new FormData(i);Os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?xd(i,o):new FormData(i),Os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Cd=0;Cd<qr.length;Cd++){var wd=qr[Cd];Jr(wd.toLowerCase(),`on`+(wd[0].toUpperCase()+wd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Td=`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(` `),Ed=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Td));function Dd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function Od(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Md(t,e,2,!1),n.add(r))}function kd(e,t,n){var r=0;t&&(r|=4),Md(n,e,r,t)}var Ad=`_reactListening`+Math.random().toString(36).slice(2);function jd(e){if(!e[Ad]){e[Ad]=!0,St.forEach(function(t){t!==`selectionchange`&&(Ed.has(t)||kd(t,!1,e),kd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ad]||(t[Ad]=!0,kd(`selectionchange`,!1,t))}}function Md(e,t,n,r){switch(Cp(t)){case 2:var i=_p;break;case 8:i=vp;break;default:i=yp}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Nd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case zr:case Br:case Vr:l=Nn;break;case Gr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=un(m,p),g!=null&&d.push(Pd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Id,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ld(s,c,l,d,!1),u!==null&&f!==null&&Ld(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(or(c))if(fr)v=yr;else{v=N;var y=aee}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=dr):v=vr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(s,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(s,n,i)}var b;if(Jn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,nr=!0)),y=Fd(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Fd(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Sd(s,e,r,n,i)}Dd(s,t)})}function Pd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=un(e,n),i!=null&&r.unshift(Pd(e,i,a)),i=un(e,t),i!=null&&r.push(Pd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Id(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ld(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=un(n,a),l!=null&&o.unshift(Pd(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Pd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Rd=/\r\n?/g,lee=/\u0000|\uFFFD/g;function zd(e){return(typeof e==`string`?e:``+e).replace(Rd,`
|
|
9
|
+
`).replace(lee,``)}function Bd(e,t){return t=zd(t),zd(e)===t}function Vd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Vd(e,t,`name`,a.name,a,null),Vd(e,t,`formEncType`,a.formEncType,a,null),Vd(e,t,`formMethod`,a.formMethod,a,null),Vd(e,t,`formTarget`,a.formTarget,a,null)):(Vd(e,t,`encType`,a.encType,a,null),Vd(e,t,`method`,a.method,a,null),Vd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&Od(`scroll`,e);break;case`onScrollEnd`:r!=null&&Od(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Od(`beforetoggle`,e),Od(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,At(e,n,r))}}function Hd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&Od(`scroll`,e);break;case`onScrollEnd`:r!=null&&Od(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Ud(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Od(`error`,e),Od(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Vd(e,t,o,s,n,null)}}a&&Vd(e,t,`srcSet`,n.srcSet,n,null),r&&Vd(e,t,`src`,n.src,n,null);return;case`input`:Od(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Vd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Od(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Vd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in Od(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Vd(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Vd(e,t,l,r,n,null)}return;case`dialog`:Od(`beforetoggle`,e),Od(`toggle`,e),Od(`cancel`,e),Od(`close`,e);break;case`iframe`:case`object`:Od(`load`,e);break;case`video`:case`audio`:for(r=0;r<Td.length;r++)Od(Td[r],e);break;case`image`:Od(`error`,e),Od(`load`,e);break;case`details`:Od(`toggle`,e);break;case`embed`:case`source`:case`link`:Od(`error`,e),Od(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Vd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Hd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Vd(e,t,c,r,n,null))}function Wd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Vd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Vd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Vd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Vd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Vd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Vd(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Vd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Vd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Vd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Vd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Hd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Hd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Vd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Vd(e,t,f,p,r,m)}function Gd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Kd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var qd=null,Jd=null;function Yd(e){return e.nodeType===9?e:e.ownerDocument}function Xd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Zd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Qd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $d=null;function ef(){var e=window.event;return e&&e.type===`popstate`?e===$d?!1:($d=e,!0):($d=null,!1)}var tf=typeof setTimeout==`function`?setTimeout:void 0,nf=typeof clearTimeout==`function`?clearTimeout:void 0,rf=typeof Promise==`function`?Promise:void 0,af=typeof queueMicrotask==`function`?queueMicrotask:rf===void 0?tf:function(e){return rf.resolve(null).then(e).catch(of)};function of(e){setTimeout(function(){throw e})}function sf(e){return e===`head`}function cf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sf(e.ownerDocument.body);n=i}while(n);Vp(t)}function lf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function uf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:uf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function df(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_f(e.nextSibling),e===null)break}return null}function ff(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_f(e.nextSibling),e===null))return null;return e}function pf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_f(e.nextSibling),e===null))return null;return e}function mf(e){return e.data===`$?`||e.data===`$~`}function hf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _f(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vf=null;function yf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _f(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xf(e,t,n){switch(t=Yd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var Cf=new Map,wf=new Set;function Tf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ef=ae.d;ae.d={f:Df,r:Of,D:jf,C:Mf,L:Nf,m:Pf,X:If,S:Ff,M:Lf};function Df(){var e=Ef.f(),t=Du();return e||t}function Of(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?As(t):Ef.r(e)}var kf=typeof document>`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),xt(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=bt(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);xt(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=bt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=f({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),xt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=bt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),xt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=me.current)?Tf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Bt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),xt(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Bt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Ud(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,xt(a),a):(r=n,(a=Cf.get(o))&&(r=f({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Ud(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Yf=null;function Xf(e,t,n){if(Yf===null){var r=new Map,i=Yf=new Map;i.set(n,r)}else i=Yf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Zf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&tp===0&&(tp=62500*Kd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=rp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sp={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function cp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function lp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new cp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function up(e){return e?(e=ai,e):ai}function dp(e,t,n,r,i,a){i=up(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(Su(n,e,t),Ga(n,e,t))}function fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pp(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function mp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&Su(t,e,67108864),pp(e,67108864)}}function hp(e){if(e.tag===13||e.tag===31){var t=bu();t=rt(t);var n=ni(e,t);n!==null&&Su(n,e,t),pp(e,t)}}var gp=!0;function _p(e,t,n,r){var i=j.T;j.T=null;var a=ae.p;try{ae.p=2,yp(e,t,n,r)}finally{ae.p=a,j.T=i}}function vp(e,t,n,r){var i=j.T;j.T=null;var a=ae.p;try{ae.p=8,yp(e,t,n,r)}finally{ae.p=a,j.T=i}}function yp(e,t,n,r){if(gp){var i=bp(r);if(i===null)Nd(e,t,r,xp,n),Mp(e,r);else if(Pp(i,e,t,n,r))r.stopPropagation();else if(Mp(e,r),t&4&&-1<jp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ve(o);s.entanglements[1]|=c,o&=~c}dd(a),!(Vl&6)&&(cu=Me()+500,fd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&Su(s,a,2),Du(),pp(a,2)}if(a=bp(r),a===null&&Nd(e,t,r,xp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nd(e,t,r,null,n)}}function bp(e){return e=rn(e),Sp(e)}var xp=null;function Sp(e){if(xp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xp=e,null}function Cp(e){switch(e){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(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case eee:return 32;case Le:return 268435456;default:return 32}default:return 32}}var wp=!1,Tp=null,Ep=null,Dp=null,Op=new Map,kp=new Map,Ap=[],jp=`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 Mp(e,t){switch(e){case`focusin`:case`focusout`:Tp=null;break;case`dragenter`:case`dragleave`:Ep=null;break;case`mouseover`:case`mouseout`:Dp=null;break;case`pointerover`:case`pointerout`:Op.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kp.delete(t.pointerId)}}function Np(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&mp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pp(e,t,n,r,i){switch(t){case`focusin`:return Tp=Np(Tp,e,t,n,r,i),!0;case`dragenter`:return Ep=Np(Ep,e,t,n,r,i),!0;case`mouseover`:return Dp=Np(Dp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Op.set(a,Np(Op.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kp.set(a,Np(kp.get(a)||null,e,t,n,r,i)),!0}return!1}function Fp(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){hp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){hp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ip(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&mp(t),e.blockedOn=n,!1;t.shift()}return!0}function Lp(e,t,n){Ip(e)&&n.delete(t)}function uee(){wp=!1,Tp!==null&&Ip(Tp)&&(Tp=null),Ep!==null&&Ip(Ep)&&(Ep=null),Dp!==null&&Ip(Dp)&&(Dp=null),Op.forEach(Lp),kp.forEach(Lp)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,wp||(wp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,uee)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp!==null&&Rp(Dp,e),Op.forEach(t),kp.forEach(t);for(var n=0;n<Ap.length;n++){var r=Ap[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ap.length&&(n=Ap[0],n.blockedOn===null);)Fp(n),n.blockedOn===null&&Ap.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(Sp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dp(n,bu(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dp(e.current,2,null,e,null,null),Du(),t[ut]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ap.length&&t!==0&&t<Ap[n].priority;n++);Ap.splice(n,0,e),n===0&&Fp(e)}};var Gp=n.version;if(Gp!==`19.2.4`)throw Error(i(527,Gp,`19.2.4`));ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{Re=qp.inject(Kp),ze=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=see,s=P,c=F;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[ut]=t.current,jd(e),new Up(t)}})),y=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=v()})),b,x,S,C,w=o((()=>{b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=x(t,n),t in S)return;S[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:b,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));function T(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function E(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return A(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:te(t)}return re(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ee(){return Math.random().toString(36).substring(2,10)}function k(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function A(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ne(t):t,state:n,key:t&&t.key||r||ee(),unstable_mask:i}}function te({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ne(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function re(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=T(e)?e:A(h.location,e,t);n&&n(r,e),l=u()+1;let d=k(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=T(e)?e:A(h.location,e,t);n&&n(r,e),l=u();let i=k(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ie(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Xt,d),c=e,()=>{i.removeEventListener(Xt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ie(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),D(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:te(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function j(e,t,n=`/`){return ae(e,t,n,!1)}function ae(e,t,n,r){let i=ge((typeof t==`string`?ne(t):t).pathname||`/`,n);if(i==null)return null;let a=se(e);le(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=he(i);o=fe(a[e],t,r)}return o}function oe(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function se(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=on([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),se(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ce(e.path))a(e,t,!0,n)}),t}function ce(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ce(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function le(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(rn)&&(r+=nn),t&&(r+=$t),n.filter(e=>!rn(e)).reduce((e,t)=>e+(Zt.test(t)?Qt:t===``?en:tn),r)}function de(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function fe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:on([a,u.pathname]),pathnameBase:sn(on([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=on([a,u.pathnameBase]))}return o}function pe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function me(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function he(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ge(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ne(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:cn(r),hash:ln(i)}}function ve(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xe(e){let t=be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Se(e,t,n,r=!1){let i;typeof e==`string`?i=ne(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),ye(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_e(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}function Ce(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function we(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}function Te(e,t){let n=e;if(typeof n!=`string`||!an.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(dn)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ge(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}function Ee(){return Wt.useContext(gn)}function De(e){if(e.startsWith(`${wn}:${Tn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Oe(e){if(e.startsWith(`${wn}:${En}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new un(t.status,t.statusText,t.data)}catch{}}function ke(e,{relative:t}={}){D(Ae(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=Gt.useContext(bn),{hash:i,pathname:a,search:o}=Ie(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:on([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ae(){return Gt.useContext(xn)!=null}function je(){return D(Ae(),`useLocation() may be used only in the context of a <Router> component.`),Gt.useContext(xn).location}function Me(e){Gt.useContext(bn).static||Gt.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=Gt.useContext(Sn);return e?Je():Pe()}function Pe(){D(Ae(),`useNavigate() may be used only in the context of a <Router> component.`);let e=Gt.useContext(mn),{basename:t,navigator:n}=Gt.useContext(bn),{matches:r}=Gt.useContext(Sn),{pathname:i}=je(),a=JSON.stringify(xe(r)),o=Gt.useRef(!1);return Me(()=>{o.current=!0}),Gt.useCallback((r,s={})=>{if(O(o.current,Dn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Se(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:on([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}function Fe(){let{matches:e}=Gt.useContext(Sn),t=e[e.length-1];return t?t.params:{}}function Ie(e,{relative:t}={}){let{matches:n}=Gt.useContext(Sn),{pathname:r}=je(),i=JSON.stringify(xe(n));return Gt.useMemo(()=>Se(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function eee(e,t){return Le(e,t)}function Le(e,t,n){D(Ae(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=Gt.useContext(bn),{matches:i}=Gt.useContext(Sn),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ye(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=je(),d;if(t){let e=typeof t==`string`?ne(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=j(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=ze(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:on([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:on([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?Gt.createElement(xn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function tee(){let e=qe(),t=Ce(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=Gt.createElement(Gt.Fragment,null,Gt.createElement(`p`,null,`💿 Hey developer 👋`),Gt.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,Gt.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,Gt.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),Gt.createElement(Gt.Fragment,null,Gt.createElement(`h2`,null,`Unexpected Application Error!`),Gt.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?Gt.createElement(`pre`,{style:i},n):null,o)}function nee({children:e,error:t}){let{basename:n}=Gt.useContext(bn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=De(t.digest);if(e){let r=An.get(t);if(r)throw r;let i=Te(e.location,n);if(dn&&!An.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw An.set(t,n),n}return Gt.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Re({routeContext:e,match:t,children:n}){let r=Gt.useContext(mn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Gt.createElement(Sn.Provider,{value:e},n)}function ze(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:we(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||On,o&&(s<0&&c===0?(Ye(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?Gt.createElement(n.route.Component,null):n.route.element?n.route.element:e,Gt.createElement(Re,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?Gt.createElement(kn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Be(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ve(e){let t=Gt.useContext(mn);return D(t,Be(e)),t}function He(e){let t=Gt.useContext(hn);return D(t,Be(e)),t}function ree(e){let t=Gt.useContext(Sn);return D(t,Be(e)),t}function Ue(e){let t=ree(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function We(){return Ue(`useRouteId`)}function Ge(){return He(`useNavigation`).navigation}function Ke(){let{matches:e,loaderData:t}=He(`useMatches`);return Gt.useMemo(()=>e.map(e=>oe(e,t)),[e,t])}function qe(){let e=Gt.useContext(Cn),t=He(`useRouteError`),n=Ue(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Je(){let{router:e}=Ve(`useNavigate`),t=Ue(`useNavigate`),n=Gt.useRef(!1);return Me(()=>{n.current=!0}),Gt.useCallback(async(r,i={})=>{O(n.current,Dn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}function Ye(e,t,n){!t&&!jn[e]&&(jn[e]=!0,O(!1,n))}function iee({routes:e,future:t,state:n,isStatic:r,onError:i}){return Le(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Xe(e){D(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ze({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){D(!Ae(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=Kt.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ne(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=Kt.useMemo(()=>{let e=ge(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return O(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:Kt.createElement(bn.Provider,{value:c},Kt.createElement(xn.Provider,{children:t,value:h}))}function Qe({children:e,location:t}){return eee($e(e),t)}function $e(e,t=[]){let n=[];return Kt.Children.forEach(e,(e,r)=>{if(!Kt.isValidElement(e))return;let i=[...t,r];if(e.type===Kt.Fragment){n.push.apply(n,$e(e.props.children,i));return}D(e.type===Xe,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),D(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=$e(e.props.children,i)),n.push(a)}),n}function et(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function tt(e){return et(e)&&e.tagName.toLowerCase()===`button`}function nt(e){return et(e)&&e.tagName.toLowerCase()===`form`}function rt(e){return et(e)&&e.tagName.toLowerCase()===`input`}function it(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function at(e,t){return e.button===0&&(!t||t===`_self`)&&!it(e)}function ot(){if(Pn===null)try{new FormData(document.createElement(`form`),0),Pn=!1}catch{Pn=!0}return Pn}function st(e){return e!=null&&!Fn.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nn}"`),null):e}function ct(e,t){let n,r,i,a,o;if(nt(e)){let o=e.getAttribute(`action`);r=o?ge(o,t):null,n=e.getAttribute(`method`)||Mn,i=st(e.getAttribute(`enctype`))||Nn,a=new FormData(e)}else if(tt(e)||rt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ge(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Mn,i=st(e.getAttribute(`formenctype`))||st(o.getAttribute(`enctype`))||Nn,a=new FormData(o,e),!ot()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(et(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Mn,r=null,i=Nn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function lt(e){return e.replace(Ln,e=>In[e])}function ut(e,t){if(e===!1||e==null)throw Error(t)}function dt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ge(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function ft(e,t){if(e.id in t)return t[e.id];try{let n=await C(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pt(e){return e!=null&&typeof e.page==`string`}function mt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ht(e,t,n){return bt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ft(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(mt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function gt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function _t(e,t,{includeHydrateFallback:n}={}){return vt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function vt(e){return[...new Set(e)]}function yt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!pt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(yt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function xt(){let e=Jt.useContext(mn);return ut(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function St(){let e=Jt.useContext(hn);return ut(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}function Ct(){let e=Jt.useContext(Rn);return ut(e,`You must render this element inside a <HydratedRouter> element`),e}function wt(e,t){let n=Jt.useContext(Rn),[r,i]=Jt.useState(!1),[a,o]=Jt.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=Jt.useRef(null);Jt.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),Jt.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Tt(s,p),onBlur:Tt(c,m),onMouseEnter:Tt(l,p),onMouseLeave:Tt(u,m),onTouchStart:Tt(d,p)}]:[a,f,{}]:[!1,f,{}]}function Tt(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Et({page:e,...t}){let n=Ee(),{router:r}=xt(),i=Jt.useMemo(()=>j(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?Jt.createElement(Ot,{page:e,matches:i,...t}):Jt.createElement(kt,{page:e,matches:i,...t}):null}function Dt(e){let{manifest:t,routeModules:n}=Ct(),[r,i]=Jt.useState([]);return Jt.useEffect(()=>{let r=!1;return ht(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ot({page:e,matches:t,...n}){let r=je(),{future:i}=Ct(),{basename:a}=xt(),o=Jt.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=dt(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return Jt.createElement(Jt.Fragment,null,o.map(e=>Jt.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function kt({page:e,matches:t,...n}){let r=je(),{future:i,manifest:a,routeModules:o}=Ct(),{basename:s}=xt(),{loaderData:c,matches:l}=St(),u=Jt.useMemo(()=>gt(e,t,l,a,r,`data`),[e,t,l,a,r]),d=Jt.useMemo(()=>gt(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=Jt.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=dt(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=Jt.useMemo(()=>_t(d,a),[d,a]),m=Dt(d);return Jt.createElement(Jt.Fragment,null,f.map(e=>Jt.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>Jt.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>Jt.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function At(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function jt({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=Yt.useRef();i.current??=E({window:r,v5Compat:!0});let a=i.current,[o,s]=Yt.useState({action:a.action,location:a.location}),c=Yt.useCallback(e=>{n===!1?s(e):Yt.startTransition(()=>s(e))},[n]);return Yt.useLayoutEffect(()=>a.listen(c),[a,c]),Yt.createElement(Ze,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Mt({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=Yt.useState({action:n.action,location:n.location}),o=Yt.useCallback(e=>{r===!1?a(e):Yt.startTransition(()=>a(e))},[r]);return Yt.useLayoutEffect(()=>n.listen(o),[n,o]),Yt.createElement(Ze,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}function Nt({getKey:e,storageKey:t,...n}){let r=Yt.useContext(Rn),{basename:i}=Yt.useContext(bn),a=je(),o=Ke();Vt({getKey:e,storageKey:t});let s=Yt.useMemo(()=>{if(!r||!e)return null;let t=Bt(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return Yt.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${lt(JSON.stringify(t||Kn))}, ${lt(JSON.stringify(s))})`}})}function Pt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ft(e){let t=Yt.useContext(mn);return D(t,Pt(e)),t}function It(e){let t=Yt.useContext(hn);return D(t,Pt(e)),t}function Lt(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=Ne(),d=je(),f=Ie(e,{relative:o});return Yt.useCallback(p=>{if(at(p,t)){p.preventDefault();let t=n===void 0?te(d)===te(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?Yt.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Rt(){let{router:e}=Ft(`useSubmit`),{basename:t}=Yt.useContext(bn),n=We(),r=e.fetch,i=e.navigate;return Yt.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ct(e,t);a.navigate===!1?await r(a.fetcherKey||Gn(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function zt(e,{relative:t}={}){let{basename:n}=Yt.useContext(bn),r=Yt.useContext(Sn);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ie(e||`.`,{relative:t})},o=je();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:on([n,a.pathname])),te(a)}function Bt(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ge(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Vt({getKey:e,storageKey:t}={}){let{router:n}=Ft(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=It(`useScrollRestoration`),{basename:a}=Yt.useContext(bn),o=je(),s=Ke(),c=Ge();Yt.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ht(Yt.useCallback(()=>{if(c.state===`idle`){let t=Bt(o,s,a,e);qn[t]=window.scrollY}try{sessionStorage.setItem(t||Kn,JSON.stringify(qn))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(Yt.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Kn);e&&(qn=JSON.parse(e))}catch{}},[t]),Yt.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(qn,()=>window.scrollY,e?(t,n)=>Bt(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),Yt.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Ht(e,t){let{capture:n}=t||{};Yt.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Ut(e,{relative:t}={}){let n=Yt.useContext(_n);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ft(`useViewTransitionState`),i=Ie(e,{relative:t});if(!n.isTransitioning)return!1;let a=ge(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ge(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pe(i.pathname,o)!=null||pe(i.pathname,a)!=null}var Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn=o((()=>{Wt=u(p(),1),Gt=u(p(),1),Kt=u(p(),1),p(),qt=u(p(),1),Jt=u(p(),1),p(),p(),p(),Yt=u(p(),1),p(),w(),Xt=`popstate`,Zt=/^:[\w-]+$/,Qt=3,$t=2,en=1,tn=10,nn=-2,rn=e=>e===`*`,an=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,on=e=>e.join(`/`).replace(/\/\/+/g,`/`),sn=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),cn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ln=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,un=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}},dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`),fn=[`POST`,`PUT`,`PATCH`,`DELETE`],new Set(fn),pn=[`GET`,...fn],new Set(pn),mn=Wt.createContext(null),mn.displayName=`DataRouter`,hn=Wt.createContext(null),hn.displayName=`DataRouterState`,gn=Wt.createContext(!1),_n=Wt.createContext({isTransitioning:!1}),_n.displayName=`ViewTransition`,vn=Wt.createContext(new Map),vn.displayName=`Fetchers`,yn=Wt.createContext(null),yn.displayName=`Await`,bn=Wt.createContext(null),bn.displayName=`Navigation`,xn=Wt.createContext(null),xn.displayName=`Location`,Sn=Wt.createContext({outlet:null,matches:[],isDataRoute:!1}),Sn.displayName=`Route`,Cn=Wt.createContext(null),Cn.displayName=`RouteError`,wn=`REACT_ROUTER_ERROR`,Tn=`REDIRECT`,En=`ROUTE_ERROR_RESPONSE`,Dn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`,Gt.createContext(null),On=Gt.createElement(tee,null),kn=class extends Gt.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Oe(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:Gt.createElement(Sn.Provider,{value:this.props.routeContext},Gt.createElement(Cn.Provider,{value:e,children:this.props.component}));return this.context?Gt.createElement(nee,{error:e},t):t}},kn.contextType=gn,An=new WeakMap,jn={},Kt.useOptimistic,Kt.memo(iee),Kt.Component,Mn=`get`,Nn=`application/x-www-form-urlencoded`,Pn=null,Fn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]),Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`),In={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ln=/[&><\u2028\u2029]/g,Rn=Jt.createContext(void 0),Rn.displayName=`FrameworkContext`,qt.Component,zn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{zn&&(window.__reactRouterVersion=`7.14.0`)}catch{}Mt.displayName=`unstable_HistoryRouter`,Bn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vn=Yt.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=Yt.useContext(bn),v=typeof l==`string`&&Bn.test(l),y=Te(l,h);l=y.to;let b=ke(l,{relative:r}),x=je(),S=null;if(o){let e=Se(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:on([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=wt(n,p),E=Lt(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),ee=Yt.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:At(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?Yt.createElement(Yt.Fragment,null,ee,Yt.createElement(Et,{page:b})):ee}),Vn.displayName=`Link`,Hn=Yt.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ie(a,{relative:c.relative}),d=je(),f=Yt.useContext(hn),{navigator:p,basename:m}=Yt.useContext(bn),h=f!=null&&Ut(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=ge(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return Yt.createElement(Vn,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)}),Hn.displayName=`NavLink`,Un=Yt.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Mn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=Yt.useContext(bn),g=Rt(),_=zt(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Bn.test(s);return Yt.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?Yt.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})}),Un.displayName=`Form`,Nt.displayName=`ScrollRestoration`,Wn=0,Gn=()=>`__${String(++Wn)}__`,Kn=`react-router-scroll-positions`,qn={}})),Yn=o((()=>{Jn()})),Xn=o((()=>{Yn()}));function Zn(e){return Object.keys(e)}var Qn=o((()=>{}));function $n(e){return e&&typeof e==`object`&&!Array.isArray(e)}function er(e,t){let n={...e},r=t;return $n(e)&&$n(t)&&Object.keys(t).forEach(t=>{$n(r[t])&&t in e?n[t]=er(n[t],r[t]):n[t]=r[t]}),n}var tr=o((()=>{}));function nr(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var rr=o((()=>{}));function ir(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function ar(e){let t=ir(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}var or=o((()=>{}));function sr(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function cr(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?sr(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?sr(n):n}}return r}return n}var M,lr,ur=o((()=>{M=cr(`rem`,{shouldScale:!0}),lr=cr(`em`)}));function dr(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}var fr=o((()=>{}));function pr(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}var mr=o((()=>{}));function hr(e){return Array.isArray(e)||e===null?!1:typeof e==`object`?e.type!==gr.Fragment:!1}var gr,_r=o((()=>{gr=u(p(),1)})),aee=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),N=s(((e,t)=>{t.exports=aee()}));function vr(e){let t=(0,br.createContext)(null);return[({children:e,value:n})=>(0,yr.jsx)(t.Provider,{value:n,children:e}),()=>{let n=(0,br.useContext)(t);if(n===null)throw Error(e);return n}]}var yr,br,xr=o((()=>{yr=N(),br=u(p(),1)}));function Sr(e=null){let t=(0,wr.createContext)(e);return[({children:e,value:n})=>(0,Cr.jsx)(t.Provider,{value:n,children:e}),()=>(0,wr.useContext)(t)]}var Cr,wr,Tr=o((()=>{Cr=N(),wr=u(p(),1)}));function Er(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var Dr=o((()=>{}));function Or(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}var kr=o((()=>{}));function Ar(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function jr(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e}return e}function Mr(e,t,n){return Or(e,n)===Or(t,n)}function Nr({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:a=`rtl`,orientation:o}){return s=>{n?.(s);let c=Array.from(Or(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Mr(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=jr(l,c,r),d=Ar(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),!c[0].disabled&&c[0].focus();break;case`End`:{s.stopPropagation(),s.preventDefault();let e=c.length-1;!c[e].disabled&&c[e].focus();break}}}}var Pr=o((()=>{kr()}));function Fr(e){return Ir[e]}var Ir,Lr=o((()=>{Ir={app:100,modal:200,popover:300,overlay:400,max:9999}})),Rr,zr=o((()=>{Rr=()=>{}}));function Br(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Rr:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}var Vr=o((()=>{zr()}));function Hr(e,t=`size`,n=!0){if(e!==void 0)return pr(e)?n?M(e):e:`var(--${t}-${e})`}function Ur(e){return Hr(e,`mantine-spacing`)}function Wr(e){return e===void 0?`var(--mantine-radius-default)`:Hr(e,`mantine-radius`)}function Gr(e){return Hr(e,`mantine-font-size`)}function Kr(e){return Hr(e,`mantine-line-height`,!1)}function qr(e){if(e)return Hr(e,`mantine-shadow`,!1)}var Jr=o((()=>{mr(),ur()}));function Yr(e,t){return n=>{e?.(n),t?.(n)}}var Xr=o((()=>{}));function Zr(e,t,n){return n?Array.from(Or(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Qr=o((()=>{kr()}));function $r(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}var ei=o((()=>{}));function ti(e){let t=(0,ni.useRef)(e);return(0,ni.useEffect)(()=>{t.current=e}),(0,ni.useMemo)(()=>((...e)=>t.current?.(...e)),[])}var ni,ri=o((()=>{ni=u(p(),1)}));function ii(e,t,n){let r=(0,ai.useRef)(null),i=t||oi;return(0,ai.useEffect)(()=>{let t=t=>{let{target:i}=t??{};if(Array.isArray(n)){let r=!document.body.contains(i)&&i?.tagName!==`HTML`;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e(t)}else r.current&&!r.current.contains(i)&&e(t)};return i.forEach(e=>document.addEventListener(e,t)),()=>{i.forEach(e=>document.removeEventListener(e,t))}},[r,e,n]),r}var ai,oi,si=o((()=>{ai=u(p(),1),oi=[`mousedown`,`touchstart`]}));function ci(e,t){try{return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function li(e,t){return typeof window<`u`&&`matchMedia`in window?window.matchMedia(e).matches:!1}function ui(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,di.useState)(n?t:li(e));return(0,di.useEffect)(()=>{try{let t=window.matchMedia(e);return i(t.matches),ci(t,e=>i(e.matches))}catch{return}},[e]),r||!1}var di,fi=o((()=>{di=u(p(),1)})),pi,mi,hi=o((()=>{pi=u(p(),1),mi=typeof document<`u`?pi.useLayoutEffect:pi.useEffect}));function gi(e,t){let n=(0,_i.useRef)(!1);(0,_i.useEffect)(()=>()=>{n.current=!1},[]),(0,_i.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}var _i,vi=o((()=>{_i=u(p(),1)}));function yi({opened:e,shouldReturnFocus:t=!0}){let n=(0,bi.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return gi(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};return document.addEventListener(`keydown`,a),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var bi,xi=o((()=>{bi=u(p(),1),vi()}));function Si(e){return e.style.display===`none`}function Ci(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&!(t===document.body||t.nodeType===11);){if(Si(t))return!1;t=t.parentNode}return!0}function wi(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Ti(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(wi(e));return(Oi.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Ci(e)}function Ei(e){let t=wi(e);return(Number.isNaN(t)||t>=0)&&Ti(e)}function Di(e){return Array.from(e.querySelectorAll(ki)).filter(Ei)}var Oi,ki,Ai=o((()=>{Oi=/input|select|textarea|button|object/,ki=`a, input, select, textarea, button, object, [tabindex]`}));function ji(e,t){let n=Di(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}var Mi=o((()=>{Ai()}));function Ni(e=!0){let t=(0,Pi.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(ki));t=n.find(Ei)||n.find(Ti)||null,!t&&Ti(e)&&(t=e)}t&&t.focus({preventScroll:!0})},r=(0,Pi.useCallback)(r=>{e&&r!==null&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,Pi.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));let r=e=>{e.key===`Tab`&&t.current&&ji(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}var Pi,Fi=o((()=>{Pi=u(p(),1),Mi(),Ai()}));function Ii(){let e=Ri();return e?`mantine-${e.replace(/:/g,``)}`:``}var Li,Ri,zi=o((()=>{Li=u(p(),1),Ri=Li.default.useId||(()=>void 0)}));function Bi(e){let t=Ii(),[n,r]=(0,Vi.useState)(t);return mi(()=>{r($r())},[]),typeof e==`string`?e:typeof window>`u`?t:n}var Vi,Hi=o((()=>{Vi=u(p(),1),hi(),ei(),zi()}));function Ui(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function Wi(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=Ui(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():Ui(e,null)}),t.clear()}}}function Gi(...e){return(0,Ki.useCallback)(Wi(...e),e)}var Ki,qi=o((()=>{Ki=u(p(),1)}));function Ji({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,Yi.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var Yi,Xi=o((()=>{Yi=u(p(),1)}));function Zi(e,t){return ui(`(prefers-reduced-motion: reduce)`,e,t)}var Qi=o((()=>{fi()}));function $i(){let[e,t]=(0,ea.useState)(!1),n=(0,ea.useRef)(null),r=(0,ea.useCallback)(()=>{t(!0)},[]),i=(0,ea.useCallback)(()=>{t(!1)},[]);return{ref:(0,ea.useCallback)(e=>{n.current&&(n.current.removeEventListener(`mouseenter`,r),n.current.removeEventListener(`mouseleave`,i)),e&&(e.addEventListener(`mouseenter`,r),e.addEventListener(`mouseleave`,i)),n.current=e},[r,i]),hovered:e}}var ea,ta=o((()=>{ea=u(p(),1)}));function na(e=!1,t={}){let[n,r]=(0,ra.useState)(e),i=(0,ra.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,ra.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,ra.useCallback)(()=>{n?a():i()},[a,i,n])}]}var ra,ia=o((()=>{ra=u(p(),1)}));function aa(e){return e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement?e.currentTarget.contains(e.relatedTarget):!1}function oa({onBlur:e,onFocus:t}={}){let[n,r]=(0,sa.useState)(!1),i=(0,sa.useRef)(!1),a=(0,sa.useRef)(null),o=ti(t),s=ti(e),c=(0,sa.useCallback)(e=>{r(e),i.current=e},[]),l=(0,sa.useCallback)(e=>{i.current||(c(!0),o(e))},[]),u=(0,sa.useCallback)(e=>{i.current&&!aa(e)&&(c(!1),s(e))},[]),d=(0,sa.useCallback)(e=>{e&&(a.current&&(a.current.removeEventListener(`focusin`,l),a.current.removeEventListener(`focusout`,u)),e.addEventListener(`focusin`,l),e.addEventListener(`focusout`,u),a.current=e)},[l,u]);return(0,sa.useEffect)(()=>()=>{a.current&&(a.current.removeEventListener(`focusin`,l),a.current.removeEventListener(`focusout`,u))},[]),{ref:d,focused:n}}var sa,ca=o((()=>{sa=u(p(),1),ri()})),la=o((()=>{si(),xi(),vi(),Fi(),Hi(),hi(),qi(),Qi(),Xi(),ta(),ia(),ca()}));function ua(e){return e?.props?.ref}var da=o((()=>{p()}));function fa(e){let t=pa.Children.toArray(e);return t.length!==1||!hr(t[0])?null:t[0]}var pa,ma=o((()=>{pa=u(p(),1),_r()}));function ha(e){return e}var ga=o((()=>{}));function _a(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_a(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function va(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_a(e))&&(r&&(r+=` `),r+=t);return r}var ya=o((()=>{}));function ba(e){let t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=va(t[e],n):t[e]=n})}),t}function xa({theme:e,classNames:t,props:n,stylesCtx:r}){return ba((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||Sa))}var Sa,Ca=o((()=>{ya(),Sa={}}));function wa({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,i)=>typeof i==`function`?{...t,...i(e,n,r)}:{...t,...i},{})}var Ta=o((()=>{}));function Ea(){let e=(0,Fa.useContext)(Ia);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function Da(){return Ea().cssVariablesResolver}function Oa(){return Ea().classNamesPrefix}function ka(){return Ea().getStyleNonce}function Aa(){return Ea().withStaticClasses}function ja(){return Ea().headless}function Ma(){return Ea().stylesTransform?.sx}function Na(){return Ea().stylesTransform?.styles}function Pa(){return Ea().env||`default`}var Fa,Ia,La=o((()=>{Fa=u(p(),1),Ia=(0,Fa.createContext)(null)}));function Ra(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function za(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function Ba(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function Va(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function Ha(e){return Ra(e)?za(e):e.startsWith(`rgb`)?Ba(e):e.startsWith(`hsl`)?Va(e):{r:0,g:0,b:0,a:1}}var Ua=o((()=>{}));function Wa(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=Ha(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}var Ga=o((()=>{Ua()}));function Ka(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}var qa=o((()=>{}));function Ja(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function Ya(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function Xa(e){if(e.startsWith(`oklch(`))return(Ya(e)||0)/100;let{r:t,g:n,b:r}=Ha(e),i=t/255,a=n/255,o=r/255,s=Ja(i),c=Ja(a),l=Ja(o);return .2126*s+.7152*c+.0722*l}function Za(e,t=.179){return e.startsWith(`var(`)?!1:Xa(e)>t}var Qa=o((()=>{Ua()}));function $a({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Za(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Za(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Za(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][Ka(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:Za(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:Za(e,t.luminanceThreshold),shade:a,variable:void 0}}var eo=o((()=>{qa(),Qa()}));function to(e,t){let n=$a({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}var no=o((()=>{eo()}));function ro(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=to(n.from,t),i=to(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}var io=o((()=>{no()}));function ao(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=Ha(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var oo,so=o((()=>{Ua(),oo=ao})),co,lo=o((()=>{ur(),p(),N(),Ga(),io(),eo(),so(),co=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=$a({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let t=o&&a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${M(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:t,border:`${M(1)} solid transparent`}:{background:e,hover:Wa(e,.1),color:t,border:`${M(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${M(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:ao(n,.1),hover:ao(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${M(1)} solid transparent`}}return{background:ao(e,.1),hover:ao(e,.12),color:e,border:`${M(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${M(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:ao(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${M(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:ao(e,.05),color:e,border:`${M(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${M(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:ao(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${M(1)} solid transparent`}}return{background:`transparent`,hover:ao(e,.12),color:e,border:`${M(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${M(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${M(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${M(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:Wa(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${M(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:Wa(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${M(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:Wa(t.white,.01),color:e,border:`${M(1)} solid transparent`}:n===`gradient`?{background:ro(r,t),hover:ro(r,t),color:`var(--mantine-color-white)`,border:`none`}:n===`default`?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${M(1)} solid var(--mantine-color-default-border)`}:{}}})),uo,fo=o((()=>{uo={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]}})),po,mo,ho=o((()=>{ur(),p(),N(),lo(),fo(),po=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,mo={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:uo,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:co,autoContrast:!1,luminanceThreshold:.3,fontFamily:po,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`sm`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:po,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:M(34),lineHeight:`1.3`},h2:{fontSize:M(26),lineHeight:`1.35`},h3:{fontSize:M(22),lineHeight:`1.4`},h4:{fontSize:M(18),lineHeight:`1.45`},h5:{fontSize:M(16),lineHeight:`1.5`},h6:{fontSize:M(14),lineHeight:`1.5`}}},fontSizes:{xs:M(12),sm:M(14),md:M(16),lg:M(18),xl:M(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},radius:{xs:M(2),sm:M(4),md:M(8),lg:M(16),xl:M(32)},spacing:{xs:M(10),sm:M(12),md:M(16),lg:M(20),xl:M(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), 0 ${M(1)} ${M(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(10)} ${M(15)} ${M(-5)}, rgba(0, 0, 0, 0.04) 0 ${M(7)} ${M(7)} ${M(-5)}`,md:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(20)} ${M(25)} ${M(-5)}, rgba(0, 0, 0, 0.04) 0 ${M(10)} ${M(10)} ${M(-5)}`,lg:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(28)} ${M(23)} ${M(-7)}, rgba(0, 0, 0, 0.04) 0 ${M(12)} ${M(12)} ${M(-7)}`,xl:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(36)} ${M(28)} ${M(-7)}, rgba(0, 0, 0, 0.04) 0 ${M(17)} ${M(17)} ${M(-7)}`},other:{},components:{}}}));function go(e){return e===`auto`||e===`dark`||e===`light`}var _o=o((()=>{}));function vo({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return go(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&go(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}var yo=o((()=>{_o()}));function bo(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function xo(e){if(!(e.primaryColor in e.colors))throw Error(Co);if(typeof e.primaryShade==`object`&&(!bo(e.primaryShade.dark)||!bo(e.primaryShade.light))||typeof e.primaryShade==`number`&&!bo(e.primaryShade))throw Error(wo)}function So(e,t){if(!t)return xo(e),e;let n=er(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),xo(n),n}var Co,wo,To=o((()=>{tr(),p(),N(),Co=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,wo=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`}));function Eo(){let e=(0,ko.useContext)(Ao);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function Do({theme:e,children:t,inherit:n=!0}){let r=jo(),i=(0,ko.useMemo)(()=>So(n?r:mo,e),[e,r,n]);return(0,Oo.jsx)(Ao.Provider,{value:i,children:t})}var Oo,ko,Ao,jo,Mo=o((()=>{Oo=N(),ko=u(p(),1),ho(),To(),Ao=(0,ko.createContext)(null),jo=()=>(0,ko.useContext)(Ao)||mo,Do.displayName=`@mantine/core/MantineThemeProvider`}));function No(){let e=Eo(),t=ka(),n=Zn(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=ar(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:lr(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:lr(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,Po.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}var Po,Fo=o((()=>{Po=N(),Qn(),or(),ur(),p(),La(),Mo()}));function Io(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}var Lo=o((()=>{}));function Ro(e,t){let n=t?[t]:[`:root`,`:host`],r=Io(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=Io(e.dark),o=Io(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}
|
|
12
|
+
|
|
13
|
+
${a?`${s(`dark`)}{${a}}`:``}
|
|
14
|
+
|
|
15
|
+
${o?`${s(`light`)}{${o}}`:``}`}var zo=o((()=>{Lo()}));function Bo({color:e,theme:t,autoContrast:n}){return(typeof n==`boolean`?n:t.autoContrast)&&$a({color:e||t.primaryColor,theme:t}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Vo(e,t){return Bo({color:e.colors[e.primaryColor][Ka(e,t)],theme:e,autoContrast:null})}var Ho=o((()=>{qa(),eo()}));function Uo({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=Ka(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:oo(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:oo(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:oo(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=Ka(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:oo(e.colors[t][Math.max(0,a-2)],.15),[`--mantine-color-${r}-light-hover`]:oo(e.colors[t][Math.max(0,a-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(a-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:oo(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}var Wo=o((()=>{qa(),p(),N(),so()}));function Go(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}var Ko=o((()=>{p(),N()}));function qo(e,t,n){Zn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var Jo,Yo=o((()=>{Qn(),ur(),p(),N(),qa(),Ho(),Wo(),Ko(),Jo=e=>{let t=Ka(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:M(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":Vo(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":Vo(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};qo(r.variables,e.breakpoints,`breakpoint`),qo(r.variables,e.spacing,`spacing`),qo(r.variables,e.fontSizes,`font-size`),qo(r.variables,e.lineHeights,`line-height`),qo(r.variables,e.shadows,`shadow`),qo(r.variables,e.radius,`radius`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),Zn(e.colors).forEach(t=>{let n=e.colors[t];if(Go(n)){Object.assign(r.light,Uo({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Uo({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Uo({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Uo({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return Zn(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r}}));function Xo({theme:e,generator:t}){let n=Jo(e),r=t?.(e);return r?er(n,r):n}var Zo=o((()=>{tr(),p(),N(),Yo()}));function Qo(e){let t={variables:{},light:{},dark:{}};return Zn(e.variables).forEach(n=>{$o.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Zn(e.light).forEach(n=>{$o.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Zn(e.dark).forEach(n=>{$o.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}var $o,es=o((()=>{Qn(),p(),N(),ho(),Yo(),$o=Jo(mo)}));function ts(e){return Ro({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function ns({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=Eo(),r=ka(),i=Xo({theme:n,generator:Da()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Ro(a?Qo(i):i,e);return o?(0,rs.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:ts(e)}`}}):null}var rs,is=o((()=>{rs=N(),zo(),La(),Mo(),Zo(),es(),ns.displayName=`@mantine/CssVariables`}));function as(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function ss({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,cs.useRef)(null),[a,o]=(0,cs.useState)(()=>e.get(t)),s=r||a,c=(0,cs.useCallback)(t=>{r||(as(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,cs.useCallback)(()=>{o(t),as(t,n),e.clear()},[e.clear,t]);return(0,cs.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),mi(()=>{as(e.get(t),n)},[]),(0,cs.useEffect)(()=>{if(r)return as(r,n),()=>{};r===void 0&&as(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&as(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}var cs,ls=o((()=>{cs=u(p(),1),la()}));function us({respectReducedMotion:e,getRootElement:t}){mi(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}var ds=o((()=>{la()}));function fs({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=vo(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h}){let{colorScheme:g,setColorScheme:_,clearColorScheme:v}=ss({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return us({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,ms.jsx)(Ia.Provider,{value:{colorScheme:g,setColorScheme:_,clearColorScheme:v,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h},children:(0,ms.jsxs)(Do,{theme:e,children:[o&&(0,ms.jsx)(ns,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,ms.jsx)(No,{}),t]})})}function ps({children:e,theme:t,env:n}){return(0,ms.jsx)(Ia.Provider,{value:{colorScheme:`auto`,setColorScheme:()=>{},clearColorScheme:()=>{},getRootElement:()=>document.documentElement,classNamesPrefix:`mantine`,cssVariablesSelector:`:root`,withStaticClasses:!1,headless:!0,env:n},children:(0,ms.jsx)(Do,{theme:t,children:e})})}var ms,hs=o((()=>{ms=N(),yo(),La(),Fo(),is(),p(),Mo(),ls(),ds(),fs.displayName=`@mantine/core/MantineProvider`,ps.displayName=`@mantine/core/HeadlessMantineProvider`}));function gs({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Eo();return{resolvedClassNames:xa({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:wa({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var _s=o((()=>{p(),N(),Mo(),Ca(),Ta()}));function vs({theme:e,options:t,unstyled:n}){return va(t?.focusable&&!n&&(e.focusClassName||ys[e.focusRing]),t?.active&&!n&&e.activeClassName)}var ys,bs=o((()=>{ya(),ys={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`}}));function xs({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return xa({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}var Ss=o((()=>{Ca()}));function Cs({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return xa({theme:n,classNames:r,props:i,stylesCtx:t})[e]}var ws=o((()=>{Ca()}));function Ts({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}var Es=o((()=>{}));function Ds({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}var oee=o((()=>{}));function Os({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}var ks=o((()=>{}));function As({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(e=>xa({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:i})?.[n])}var js=o((()=>{Ca()}));function Ms({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}var Ns=o((()=>{}));function Ps({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:a,classes:o,unstyled:s,className:c,rootSelector:l,props:u,stylesCtx:d,withStaticClasses:f,headless:p,transformedStyles:m}){return va(vs({theme:e,options:t,unstyled:s||p}),As({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),Ms({options:t,classes:o,selector:r,unstyled:s}),Cs({selector:r,stylesCtx:d,theme:e,classNames:a,props:u}),Cs({selector:r,stylesCtx:d,theme:e,classNames:m,props:u}),xs({selector:r,stylesCtx:d,options:t,props:u,theme:e}),Ts({rootSelector:l,selector:r,className:c}),Ds({selector:r,classes:o,unstyled:s||p}),f&&!p&&Os({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}var Fs=o((()=>{ya(),bs(),Ss(),ws(),Es(),oee(),ks(),js(),Ns()}));function Is({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(t=>wa({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[i]).reduce((e,t)=>({...e,...t}),{})}var Ls=o((()=>{Ta()}));function Rs({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Rs({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}var zs=o((()=>{}));function Bs(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...dr(t[n])}}),e),{})}var Vs=o((()=>{fr(),p(),N()}));function Hs({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:a,themeName:o,headless:s}){return Bs([s?{}:t?.(n,r,i),...o.map(e=>n.components?.[e]?.vars?.(n,r,i)),e?.(n,r,i)])?.[a]}var Us=o((()=>{Vs()}));function Ws({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:a,rootSelector:o,styles:s,style:c,vars:l,varsResolver:u,headless:d,withStylesTransform:f}){return{...!f&&Is({theme:e,themeName:t,props:i,stylesCtx:a,selector:n}),...!f&&wa({theme:e,styles:s,props:i,stylesCtx:a})[n],...!f&&wa({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:a})[n],...Hs({theme:e,props:i,stylesCtx:a,vars:l,varsResolver:u,selector:n,themeName:t,headless:d}),...o===n?Rs({style:c,theme:e}):null,...Rs({style:r?.style,theme:e})}}var Gs=o((()=>{Ls(),zs(),Ta(),Us()}));function Ks({props:e,stylesCtx:t,themeName:n}){let r=Eo(),i=Na()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}var qs=o((()=>{p(),N(),La(),Mo()}));function Js({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f}){let p=Eo(),m=Oa(),h=Aa(),g=ja(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=Ks({props:n,stylesCtx:r,themeName:_});return(e,b)=>({className:Ps({theme:p,options:b,themeName:_,selector:e,classNamesPrefix:m,classNames:c,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([b?.styles,l])}),style:Ws({theme:p,themeName:_,selector:e,options:b,props:n,stylesCtx:r,rootSelector:o,styles:l,style:a,vars:u,varsResolver:d,headless:g,withStylesTransform:v}),...f?.[e]})}var Ys=o((()=>{p(),N(),La(),Mo(),Fs(),Gs(),qs()}));function Xs(e,t){return typeof e==`boolean`?e:t.autoContrast}var see=o((()=>{}));function P(e,t,n){let r=Eo(),i=r.components[e]?.defaultProps,a=typeof i==`function`?i(r):i;return{...t,...a,...dr(n)}}var F=o((()=>{fr(),p(),N(),Mo()}));function Zs(e){return Zn(e).reduce((t,n)=>e[n]===void 0?t:`${t}${nr(n)}:${e[n]};`,``).trim()}var Qs=o((()=>{Qn(),rr(),p(),N()}));function $s({selector:e,styles:t,media:n,container:r}){let i=t?Zs(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${Zs(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${Zs(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}var ec=o((()=>{Qs()}));function tc(e){let t=ka();return(0,nc.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:t?.(),dangerouslySetInnerHTML:{__html:$s(e)}})}var nc,rc=o((()=>{nc=N(),p(),La(),ec()}));function ic(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bdrs:b,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:ee,fs:k,tt:A,td:te,w:ne,miw:re,maw:ie,h:j,mih:ae,mah:oe,bgsz:se,bgp:ce,bgr:le,bga:ue,pos:de,top:fe,left:pe,bottom:me,right:he,inset:ge,display:_e,flex:ve,hiddenFrom:ye,visibleFrom:be,lightHidden:xe,darkHidden:Se,sx:Ce,...we}=e;return{styleProps:dr({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:ee,fs:k,tt:A,td:te,w:ne,miw:re,maw:ie,h:j,mih:ae,mah:oe,bgsz:se,bgp:ce,bgr:le,bga:ue,pos:de,top:fe,left:pe,bottom:me,right:he,inset:ge,display:_e,flex:ve,bdrs:b,hiddenFrom:ye,visibleFrom:be,lightHidden:xe,darkHidden:Se,sx:Ce}),rest:we}}var ac=o((()=>{fr(),p(),N()})),oc,sc=o((()=>{oc={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}}}));function cc(e,t){let n=$a({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function lc(e,t){let n=$a({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:cc(e,t)}var uc=o((()=>{eo(),p(),N()}));function dc(e,t){if(typeof e==`number`)return M(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${M(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${cc(i.join(` `),t)}`),a.trim()}return e}var fc=o((()=>{ur(),p(),N(),uc()}));function pc(e){return typeof e==`string`&&e in mc?mc[e]:e}var mc,hc=o((()=>{mc={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`}}));function gc(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&_c.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?M(e):e}var _c,vc=o((()=>{ur(),p(),N(),_c=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]}));function yc(e){return e}var bc=o((()=>{}));function xc(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&Sc.includes(e)?`var(--mantine-${e}-line-height)`:e}var Sc,Cc=o((()=>{Sc=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]}));function wc(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?M(e):e}var Tc=o((()=>{ur(),p(),N()}));function Ec(e){return typeof e==`number`?M(e):e}var Dc=o((()=>{ur(),p(),N()}));function Oc(e,t){if(typeof e==`number`)return M(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return M(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var kc=o((()=>{ur(),p(),N()})),Ac,jc=o((()=>{fc(),uc(),hc(),vc(),bc(),Cc(),Tc(),Dc(),kc(),Ac={color:cc,textColor:lc,fontSize:gc,spacing:Oc,radius:wc,identity:yc,size:Ec,lineHeight:xc,fontFamily:pc,border:dc}}));function Mc(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function Nc({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(Mc(e))-Number(Mc(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}var Pc=o((()=>{}));function Fc(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return!(t.length===1&&t[0]===`base`)}function Ic(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Lc(e){return typeof e==`object`&&e?Zn(e).filter(e=>e!==`base`):[]}function Rc(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function zc({styleProps:e,data:t,theme:n}){return Nc(Zn(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Ic(e[i]);if(!Fc(e[i]))return o.forEach(e=>{r.inlineStyles[e]=Ac[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Lc(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=Ac[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:Ac[a.type](Rc(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}var Bc=o((()=>{Qn(),p(),N(),jc(),Pc()}));function Vc(){return`__m__-${(0,Hc.useId)().replace(/[:«»]/g,``)}`}var Hc,Uc=o((()=>{Hc=u(p(),1)}));function Wc(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Wc(n,t)}),{}):typeof e==`function`?e(t):e??{}}var Gc=o((()=>{}));function Kc(e){return e}var qc=o((()=>{}));function Jc(e){return e.startsWith(`data-`)?e:`data-${e}`}function Yc(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Jc(n)]=e[n]),t},{})}function Xc(e){return e?typeof e==`string`?{[Jc(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Xc(t)}),{}):Yc(e):null}var Zc=o((()=>{}));function Qc(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Qc(n,t)}),{}):typeof e==`function`?e(t):e??{}}function $c({theme:e,style:t,vars:n,styleProps:r}){let i=Qc(t,e),a=Qc(n,e);return{...i,...a,...r}}var el=o((()=>{})),tl,nl,rl,il,al=o((()=>{tl=N(),nl=u(p(),1),ya(),qc(),rc(),mr(),La(),Mo(),Zc(),el(),ac(),sc(),Bc(),Uc(),rl=(0,nl.forwardRef)(({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:c,lightHidden:l,darkHidden:u,renderRoot:d,__size:f,...p},m)=>{let h=Eo(),g=e||`div`,{styleProps:_,rest:v}=ic(p),y=Ma()?.()?.(_.sx),b=Vc(),x=zc({styleProps:_,theme:h,data:oc}),S={ref:m,style:$c({theme:h,style:t,vars:n,styleProps:x.inlineStyles}),className:va(r,y,{[b]:x.hasResponsiveStyles,"mantine-light-hidden":l,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${c}`]:c}),"data-variant":i,"data-size":pr(o)?void 0:o||void 0,size:f,...Xc(a),...v};return(0,tl.jsxs)(tl.Fragment,{children:[x.hasResponsiveStyles&&(0,tl.jsx)(tc,{selector:`.${b}`,styles:x.styles,media:x.media}),typeof d==`function`?d(S):(0,tl.jsx)(g,{...S})]})}),rl.displayName=`@mantine/core/Box`,il=Kc(rl)}));function ol(e){return e}function cee(e){let t=e;return e=>{let n=(0,ll.forwardRef)((n,r)=>(0,cl.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n}}function sl(e){let t=(0,ll.forwardRef)(e);return t.extend=ol,t.withProps=e=>{let n=(0,ll.forwardRef)((n,r)=>(0,cl.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}var cl,ll,ul=o((()=>{cl=N(),ll=u(p(),1)}));function dl(e){let t=(0,pl.forwardRef)(e);return t.withProps=e=>{let n=(0,pl.forwardRef)((n,r)=>(0,fl.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=ol,t}var fl,pl,ml=o((()=>{fl=N(),pl=u(p(),1),ul()}));function hl(){return(0,gl.useContext)(_l)}var gl,_l,vl=o((()=>{N(),gl=u(p(),1),_l=(0,gl.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}})}));function yl(){return typeof window<`u`}function bl(e){return Cl(e)?(e.nodeName||``).toLowerCase():`#document`}function xl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sl(e){return((Cl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Cl(e){return yl()?e instanceof Node||e instanceof xl(e).Node:!1}function wl(e){return yl()?e instanceof Element||e instanceof xl(e).Element:!1}function Tl(e){return yl()?e instanceof HTMLElement||e instanceof xl(e).HTMLElement:!1}function El(e){return!yl()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xl(e).ShadowRoot}function Dl(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Pl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ol(e){return/^(table|td|th)$/.test(bl(e))}function kl(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}function Al(e){let t=wl(e)?Pl(e):e;return Hl(t.transform)||Hl(t.translate)||Hl(t.scale)||Hl(t.rotate)||Hl(t.perspective)||!Ml()&&(Hl(t.backdropFilter)||Hl(t.filter))||Bl.test(t.willChange||``)||Vl.test(t.contain||``)}function jl(e){let t=Il(e);for(;Tl(t)&&!Nl(t);){if(Al(t))return t;if(kl(t))return null;t=Il(t)}return null}function Ml(){return Ul??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ul}function Nl(e){return/^(html|body|#document)$/.test(bl(e))}function Pl(e){return xl(e).getComputedStyle(e)}function Fl(e){return wl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Il(e){if(bl(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||El(e)&&e.host||Sl(e);return El(t)?t.host:t}function Ll(e){let t=Il(e);return Nl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tl(t)&&Dl(t)?t:Ll(t)}function Rl(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ll(e),i=r===e.ownerDocument?.body,a=xl(r);if(i){let e=zl(a);return t.concat(a,a.visualViewport||[],Dl(r)?r:[],e&&n?Rl(e):[])}else return t.concat(r,Rl(r,[],n))}function zl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Bl,Vl,Hl,Ul,Wl=o((()=>{Bl=/transform|translate|scale|rotate|perspective|filter/,Vl=/paint|layout|strict|content/,Hl=e=>!!e&&e!==`none`}));function Gl(e,t,n){return fu(e,du(t,n))}function Kl(e,t){return typeof e==`function`?e(t):e}function ql(e){return e.split(`-`)[0]}function Jl(e){return e.split(`-`)[1]}function Yl(e){return e===`x`?`y`:`x`}function Xl(e){return e===`y`?`height`:`width`}function Zl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ql(e){return Yl(Zl(e))}function $l(e,t,n){n===void 0&&(n=!1);let r=Jl(e),i=Ql(e),a=Xl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=iu(o)),[o,iu(o)]}function eu(e){let t=iu(e);return[tu(e),t,tu(t)]}function tu(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}function nu(e,t,n){switch(e){case`top`:case`bottom`:return n?t?vu:_u:t?_u:vu;case`left`:case`right`:return t?yu:bu;default:return[]}}function ru(e,t,n,r){let i=Jl(e),a=nu(ql(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(tu)))),a}function iu(e){let t=ql(e);return gu[t]+e.slice(t.length)}function au(e){return{top:0,right:0,bottom:0,left:0,...e}}function ou(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:au(e)}function su(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu=o((()=>{cu=[`top`,`right`,`bottom`,`left`],lu=[`start`,`end`],uu=cu.reduce((e,t)=>e.concat(t,t+`-`+lu[0],t+`-`+lu[1]),[]),du=Math.min,fu=Math.max,pu=Math.round,mu=Math.floor,hu=e=>({x:e,y:e}),gu={left:`right`,right:`left`,bottom:`top`,top:`bottom`},_u=[`left`,`right`],vu=[`right`,`left`],yu=[`top`,`bottom`],bu=[`bottom`,`top`]})),Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u=o((()=>{Su=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],Cu=Su.join(`,`),wu=typeof Element>`u`,Tu=wu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Eu=!wu&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Du=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Du(e.parentNode))},Ou=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},ku=function(e,t,n){if(Du(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Cu));return t&&Tu.call(e,Cu)&&r.unshift(e),r=r.filter(n),r},Au=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Du(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Au(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Tu.call(a,Cu)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Du(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Au(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},ju=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Mu=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Ou(e))&&!ju(e)?0:e.tabIndex},Nu=function(e,t){var n=Mu(e);return n<0&&t&&!ju(e)?0:n},Pu=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fu=function(e){return e.tagName===`INPUT`},Iu=function(e){return Fu(e)&&e.type===`hidden`},Lu=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ru=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},zu=function(e){if(!e.name)return!0;var t=e.form||Eu(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Ru(r,e.form);return!i||i===e},Bu=function(e){return Fu(e)&&e.type===`radio`},Vu=function(e){return Bu(e)&&!zu(e)},Hu=function(e){var t=e&&Eu(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Eu(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Uu=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Wu=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Tu.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Tu.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Eu(e);if(o&&!o.shadowRoot&&r(o)===!0)return Uu(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Hu(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Uu(e);return!1},Gu=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Tu.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Ku=function(e,t){return!(t.disabled||Iu(t)||Wu(t,e)||Lu(t)||Gu(t))},qu=function(e,t){return!(Vu(t)||Mu(t)<0||!Ku(e,t))},Ju=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Yu=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Nu(a,i),s=i?Yu(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Pu).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Xu=function(e,t){t||={};var n=t.getShadowRoot?Au([e],t.includeContainer,{filter:qu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ju}):ku(e,t.includeContainer,qu.bind(null,t));return Yu(n)},Zu=function(e,t){return t||={},t.getShadowRoot?Au([e],t.includeContainer,{filter:Ku.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ku(e,t.includeContainer,Ku.bind(null,t))},Qu=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Tu.call(e,Cu)===!1?!1:qu(t,e)}}));function ed(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function td(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function nd(){return/apple/i.test(navigator.vendor)}function rd(){let e=/android/i;return e.test(ed())||e.test(td())}function id(){return ed().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function ad(){return td().includes(`jsdom/`)}function od(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function sd(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&El(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function cd(e){return`composedPath`in e?e.composedPath()[0]:e.target}function ld(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ud(e){return e.matches(`html,body`)}function dd(e){return e?.ownerDocument||document}function fd(e){return Tl(e)&&e.matches(Md)}function pd(e){return e?e.getAttribute(`role`)===`combobox`&&fd(e):!1}function md(e){if(!e||ad())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function hd(e){return e?e.hasAttribute(jd)?e:e.querySelector(`[`+jd+`]`)||e:null}function gd(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...gd(e,t.id,n)])}function _d(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function vd(e){e.preventDefault(),e.stopPropagation()}function yd(e){return`nativeEvent`in e}function bd(e){return e.mozInputSource===0&&e.isTrusted?!0:rd()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function xd(e){return ad()?!1:!rd()&&e.width===0&&e.height===0||rd()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Sd(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Cd(e){let t=kd.useRef(e);return Nd(()=>{t.current=e}),t}function wd(e){let t=kd.useRef(()=>{});return Fd(()=>{t.current=e}),kd.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Td(e,t){let n=Xu(e,Id()),r=n.length;if(r===0)return;let i=od(dd(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ed(e){return Td(dd(e).body,1)||e}function Dd(e){return Td(dd(e).body,-1)||e}function Od(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!sd(n,r)}var kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld=o((()=>{Wl(),kd=u(p(),1),Ad=u(p(),1),$u(),jd=`data-floating-ui-focusable`,Md=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Nd=typeof document<`u`?Ad.useLayoutEffect:function(){},Pd={...kd},Fd=Pd.useInsertionEffect||(e=>e()),Id=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`})}));function Rd(e,t,n){let{reference:r,floating:i}=e,a=Zl(t),o=Ql(t),s=Xl(o),c=ql(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Jl(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function lee(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Kl(t,e),p=ou(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=su(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=su(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}function zd(e,t,n){return(e?[...n.filter(t=>Jl(t)===e),...n.filter(t=>Jl(t)!==e)]:n.filter(e=>ql(e)===e)).filter(n=>e?Jl(n)===e||(t?tu(n)!==n:!1):!0)}function Bd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vd(e){return cu.some(t=>e[t]>=0)}function Hd(e){let t=du(...e.map(e=>e.left)),n=du(...e.map(e=>e.top)),r=fu(...e.map(e=>e.right)),i=fu(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Ud(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>su(Hd(e)))}async function Wd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ql(n),s=Jl(n),c=Zl(n)===`y`,l=Qd.has(o)?-1:1,u=a&&c?-1:1,d=Kl(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf=o((()=>{xu(),Gd=50,Kd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:lee},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Rd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Gd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Rd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},qd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Kl(e,t)||{};if(l==null)return{};let d=ou(u),f={x:n,y:r},p=Ql(i),m=Xl(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=du(d[_],T),D=du(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=Gl(O,k,ee),te=!c.arrow&&Jl(i)!=null&&k!==A&&a.reference[m]/2-(k<O?E:D)-h[m]/2<0,ne=te?k<O?k-O:k-ee:0;return{[p]:f[p]+ne,data:{[p]:A,centerOffset:k-A-ne,...te&&{alignmentOffset:ne}},reset:te}}}),Jd=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=uu,autoAlignment:u=!0,...d}=Kl(e,t),f=c!==void 0||l===uu?zd(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=$l(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[ql(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=Jl(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,Jl(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},Yd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Kl(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ql(r),_=Zl(o),v=ql(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[iu(o)]:eu(o)),x=p!==`none`;!d&&x&&b.push(...ru(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=$l(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Zl(t))||T.every(e=>Zl(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Zl(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Xd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Kl(e,t);switch(i){case`referenceHidden`:{let e=Bd(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Vd(e)}}}case`escaped`:{let e=Bd(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Vd(e)}}}default:return{}}}}},Zd=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Kl(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Ud(u),f=su(Hd(u)),p=ou(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(Zl(n)===`y`){let e=d[0],t=d[d.length-1],r=ql(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=ql(n)===`left`,t=fu(...d.map(e=>e.right)),r=du(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Qd=new Set([`left`,`top`]),$d=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Wd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ef=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Kl(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Zl(ql(i)),p=Yl(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Gl(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Gl(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},tf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Kl(e,t),u={x:n,y:r},d=Zl(i),f=Yl(d),p=u[f],m=u[d],h=Kl(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Qd.has(ql(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},nf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Kl(e,t),u=await o.detectOverflow(t,l),d=ql(i),f=Jl(i),p=Zl(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=du(h-u[g],v),x=du(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=fu(u.left,0),t=fu(u.right,0),n=fu(u.top,0),r=fu(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:fu(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:fu(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}}}));function af(e){let t=Pl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Tl(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=pu(n)!==a||pu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function of(e){return wl(e)?e:e.contextElement}function sf(e){let t=of(e);if(!Tl(t))return hu(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=af(t),o=(a?pu(n.width):n.width)/r,s=(a?pu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}function cf(e){let t=xl(e);return!Ml()||!t.visualViewport?jf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xl(e)?!1:t}function uf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=of(e),o=hu(1);t&&(r?wl(r)&&(o=sf(r)):o=sf(e));let s=lf(a,n,r)?cf(a):hu(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=xl(a),t=r&&wl(r)?xl(r):r,n=e,i=zl(n);for(;i&&r&&t!==n;){let e=sf(i),t=i.getBoundingClientRect(),r=Pl(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=xl(i),i=zl(n)}}return su({width:u,height:d,x:c,y:l})}function df(e,t){let n=Fl(e).scrollLeft;return t?t.left+n:uf(Sl(e)).left+n}function ff(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-df(e,n),y:n.top+t.scrollTop}}function pf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Sl(r),s=t?kl(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=hu(1),u=hu(0),d=Tl(r);if((d||!d&&!a)&&((bl(r)!==`body`||Dl(o))&&(c=Fl(r)),d)){let e=uf(r);l=sf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ff(o,c):hu(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function mf(e){return Array.from(e.getClientRects())}function hf(e){let t=Sl(e),n=Fl(e),r=e.ownerDocument.body,i=fu(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=fu(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+df(e),s=-n.scrollTop;return Pl(r).direction===`rtl`&&(o+=fu(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function gf(e,t){let n=xl(e),r=Sl(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ml();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=df(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Mf&&(a-=o)}else l<=Mf&&(a+=l);return{width:a,height:o,x:s,y:c}}function _f(e,t){let n=uf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Tl(e)?sf(e):hu(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function vf(e,t,n){let r;if(t===`viewport`)r=gf(e,n);else if(t===`document`)r=hf(Sl(e));else if(wl(t))r=_f(t,n);else{let n=cf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return su(r)}function yf(e,t){let n=Il(e);return n===t||!wl(n)||Nl(n)?!1:Pl(n).position===`fixed`||yf(n,t)}function bf(e,t){let n=t.get(e);if(n)return n;let r=Rl(e,[],!1).filter(e=>wl(e)&&bl(e)!==`body`),i=null,a=Pl(e).position===`fixed`,o=a?Il(e):e;for(;wl(o)&&!Nl(o);){let t=Pl(o),n=Al(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Dl(o)&&!n&&yf(e,o))?r=r.filter(e=>e!==o):i=t,o=Il(o)}return t.set(e,r),r}function xf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?kl(t)?[]:bf(t,this._c):[].concat(n),r],o=vf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=vf(t,a[e],i);s=fu(n.top,s),c=du(n.right,c),l=du(n.bottom,l),u=fu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Sf(e){let{width:t,height:n}=af(e);return{width:t,height:n}}function Cf(e,t,n){let r=Tl(t),i=Sl(t),a=n===`fixed`,o=uf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=hu(0);function l(){c.x=df(i)}if(r||!r&&!a)if((bl(t)!==`body`||Dl(i))&&(s=Fl(t)),r){let e=uf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ff(i,s):hu(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function wf(e){return Pl(e).position===`static`}function Tf(e,t){if(!Tl(e)||Pl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Sl(e)===n&&(n=n.ownerDocument.body),n}function Ef(e,t){let n=xl(e);if(kl(e))return n;if(!Tl(e)){let t=Il(e);for(;t&&!Nl(t);){if(wl(t)&&!wf(t))return t;t=Il(t)}return n}let r=Tf(e,t);for(;r&&Ol(r)&&wf(r);)r=Tf(r,t);return r&&Nl(r)&&wf(r)&&!Al(r)?n:r||jl(e)||n}function Df(e){return Pl(e).direction===`rtl`}function Of(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kf(e,t){let n=null,r,i=Sl(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=mu(d),h=mu(i.clientWidth-(u+f)),g=mu(i.clientHeight-(d+p)),_=mu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:fu(0,du(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Of(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Af(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=of(e),u=i||a?[...l?Rl(l):[],...t?Rl(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?kf(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?uf(e):null;c&&g();function g(){let t=uf(e);h&&!Of(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf=o((()=>{rf(),xu(),Wl(),jf=hu(0),Mf=25,Nf=async function(e){let t=this.getOffsetParent||Ef,n=this.getDimensions,r=await n(e.floating);return{reference:Cf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},Pf={convertOffsetParentRelativeRectToViewportRelativeRect:pf,getDocumentElement:Sl,getClippingRect:xf,getOffsetParent:Ef,getElementRects:Nf,getClientRects:mf,getDimensions:Sf,getScale:sf,isElement:wl,isRTL:Df},Ff=$d,If=Jd,Lf=ef,Rf=Yd,zf=nf,Bf=Xd,Vf=qd,Hf=Zd,Uf=tf,Wf=(e,t,n)=>{let r=new Map,i={platform:Pf,...n},a={...i.platform,_c:r};return Kd(e,t,{...i,platform:a})}}));function Kf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jf(e,t){let n=qf(e);return Math.round(t*n)/n}function Yf(e){let t=Zf.useRef(e);return ep(()=>{t.current=e}),t}function Xf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Zf.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Zf.useState(r);Kf(f,r)||p(r);let[m,h]=Zf.useState(null),[g,_]=Zf.useState(null),v=Zf.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Zf.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Zf.useRef(null),C=Zf.useRef(null),w=Zf.useRef(u),T=c!=null,E=Yf(c),D=Yf(i),O=Yf(l),ee=Zf.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Wf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};k.current&&!Kf(w.current,t)&&(w.current=t,$f.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);ep(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=Zf.useRef(!1);ep(()=>(k.current=!0,()=>{k.current=!1}),[]),ep(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let A=Zf.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),te=Zf.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=Zf.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Jf(te.floating,u.x),r=Jf(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qf(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return Zf.useMemo(()=>({...u,update:ee,refs:A,elements:te,floatingStyles:ne}),[u,ee,A,te,ne])}var Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp=o((()=>{Gf(),Zf=u(p(),1),Qf=u(p(),1),$f=u(_(),1),ep=typeof document<`u`?Qf.useLayoutEffect:function(){},tp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Vf({element:r.current,padding:i}).fn(n):r?Vf({element:r,padding:i}).fn(n):{}}}},np=(e,t)=>{let n=Ff(e);return{name:n.name,fn:n.fn,options:[e,t]}},rp=(e,t)=>{let n=Lf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>({fn:Uf(e).fn,options:[e,t]}),ap=(e,t)=>{let n=Rf(e);return{name:n.name,fn:n.fn,options:[e,t]}},op=(e,t)=>{let n=zf(e);return{name:n.name,fn:n.fn,options:[e,t]}},sp=(e,t)=>{let n=If(e);return{name:n.name,fn:n.fn,options:[e,t]}},cp=(e,t)=>{let n=Bf(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=(e,t)=>{let n=Hf(e);return{name:n.name,fn:n.fn,options:[e,t]}},up=(e,t)=>{let n=tp(e);return{name:n.name,fn:n.fn,options:[e,t]}}}));function fp(e){let t=I.useRef(void 0),n=I.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return I.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}function pp(){let[e,t]=I.useState(()=>sm?lm():void 0);return Nd(()=>{e??t(lm())},[]),I.useEffect(()=>{sm=!0},[]),e}function mp(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}function hp(e){return`data-floating-ui-`+e}function gp(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}function _p(e,t,n){if(n&&!Sd(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function vp(e){return typeof e==`function`?e():e}function yp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=mm(),m=pm(),h=Cd(l),g=Cd(c),_=Cd(n),v=Cd(d),y=I.useRef(),b=I.useRef(-1),x=I.useRef(),S=I.useRef(-1),C=I.useRef(!0),w=I.useRef(!1),T=I.useRef(()=>{}),E=I.useRef(!1),D=wd(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});I.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(gp(b),gp(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),I.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=dd(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=I.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=_p(g.current,`close`,y.current);i&&!x.current?(gp(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(gp(b),r(!1,e,n))},[g,r]),ee=wd(()=>{T.current(),x.current=void 0}),k=wd(()=>{if(w.current){let e=dd(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(hm),w.current=!1}}),A=wd(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);I.useEffect(()=>{if(!s)return;function e(e){if(gp(b),C.current=!1,u&&!Sd(y.current)||vp(v.current)>0&&!_p(g.current,`open`))return;let t=_p(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(A()){k();return}T.current();let t=dd(o.floating);if(gp(S),E.current=!1,h.current&&i.current.floatingContext){n||gp(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){k(),ee(),A()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!sd(o.floating,e.relatedTarget))&&O(e)}function a(e){A()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){k(),ee(),A()||O(e)}})(e))}function c(){gp(b)}function l(e){A()||O(e,!1)}if(wl(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,O,ee,k,r,n,_,p,g,h,i,A,v]),Nd(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(wl(o.domReference)&&e){var t;let n=dd(o.floating).body;n.setAttribute(hm,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,D]),Nd(()=>{n||(y.current=void 0,E.current=!1,ee(),k())},[n,ee,k]),I.useEffect(()=>()=>{ee(),gp(b),gp(S),k()},[s,o.domReference,ee,k]);let te=I.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Sd(y.current)||n||vp(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(gp(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,vp(v.current))))}}},[u,r,n,_,v]);return I.useMemo(()=>s?{reference:te}:{},[s,te])}function bp(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=I.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=I.useRef(null),s=I.useCallback(e=>{a({currentId:e})},[]);return Nd(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,Yp.jsx)(_m.Provider,{value:I.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function xp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=vm(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Nd(()=>{o&&l&&(f({delay:{open:1,close:_p(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Nd(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Nd(()=>{o&&(u===gm||!n||u(s))},[o,n,u,s]),c}function Sp(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ym);let a=()=>e?.focus({preventScroll:n});i?a():ym=requestAnimationFrame(a)}function Cp(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&El(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function wp(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Tp(e){return e?.ownerDocument||document}function Ep(e){return e===`inert`?bm.inert:e===`aria-hidden`?bm[`aria-hidden`]:bm.none}function Dp(e){return e?El(e)?e.host:Dp(e.parentNode):null}function Op(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Tm(t,e),s=new Set,c=new Set(o),l=[];Sm[i]||(Sm[i]=new WeakMap);let u=Sm[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(bl(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Ep(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&xm.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Cm++,()=>{l.forEach(e=>{let t=Ep(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!xm.has(e)&&a&&e.removeAttribute(a),xm.delete(e)),r||e.removeAttribute(i)}),Cm--,Cm||(bm.inert=new WeakMap,bm[`aria-hidden`]=new WeakMap,bm.none=new WeakMap,xm=new WeakSet,Sm={})}}function kp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Tp(e[0]).body;return Op(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}function Ap(e){return I.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}function jp(){jm=jm.filter(e=>e.deref()?.isConnected)}function Mp(e){jp(),e&&bl(e)!==`body`&&(jm.push(new WeakRef(e)),jm.length>Am&&(jm=jm.slice(-Am)))}function Np(){return jp(),jm[jm.length-1]?.deref()}function Pp(e){let t=Id();return Qu(e,t)?e:Xu(e,t)[0]||e}function Fp(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=Id(),i=Zu(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Qu(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Ip(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:h,events:g,dataRef:_,elements:{domReference:v,floating:y}}=t,b=wd(()=>_.current.floatingContext?.nodeId),x=wd(p),S=typeof o==`number`&&o<0,C=pd(v)&&S,w=wm(),T=w?a:!0,E=!T||w&&f,D=Cd(i),O=Cd(o),ee=Cd(s),k=mm(),A=km(),te=I.useRef(null),ne=I.useRef(null),re=I.useRef(!1),ie=I.useRef(!1),j=I.useRef(-1),ae=I.useRef(-1),oe=A!=null,se=hd(y),ce=wd(function(e){return e===void 0&&(e=se),e?Xu(e,Id()):[]}),le=wd(e=>{let t=ce(e);return D.current.map(e=>v&&e===`reference`?v:se&&e===`floating`?se:t).filter(Boolean).flat()});I.useEffect(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){sd(se,od(dd(se)))&&ce().length===0&&!C&&vd(e);let t=le(),n=cd(e);D.current[0]===`reference`&&n===v&&(vd(e),e.shiftKey?Sp(t[t.length-1]):Sp(t[1])),D.current[1]===`floating`&&n===se&&e.shiftKey&&(vd(e),Sp(t[0]))}}let t=dd(se);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,se,l,D,C,ce,le]),I.useEffect(()=>{if(r||!y)return;function e(e){let t=cd(e),n=ce().indexOf(t);n!==-1&&(j.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,ce]),I.useEffect(()=>{if(r||!d)return;function e(){ie.current=!0,setTimeout(()=>{ie.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=cd(e);queueMicrotask(()=>{let i=b(),a=!(sd(v,t)||sd(y,t)||sd(t,y)||sd(A?.portalNode,t)||t!=null&&t.hasAttribute(hp(`focus-guard`))||k&&(gd(k.nodesRef.current,i).find(e=>sd(e.context?.elements.floating,t)||sd(e.context?.elements.domReference,t))||_d(k.nodesRef.current,i).find(e=>[e.context?.elements.floating,hd(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&se&&Fp(se,D),c&&n!==v&&!(r!=null&&r.isConnected)&&od(dd(se))===dd(se).body){Tl(se)&&se.focus();let e=j.current,t=ce(),n=t[e]||t[t.length-1]||se;Tl(n)&&n.focus()}if(_.current.insideReactTree){_.current.insideReactTree=!1;return}(C||!l)&&t&&a&&!ie.current&&t!==Np()&&(re.current=!0,h(!1,e,`focus-out`))})}let n=!!(!k&&A);function i(){gp(ae),_.current.insideReactTree=!0,ae.current=window.setTimeout(()=>{_.current.insideReactTree=!1})}if(y&&Tl(v))return v.addEventListener(`focusout`,t),v.addEventListener(`pointerdown`,e),y.addEventListener(`focusout`,t),n&&y.addEventListener(`focusout`,i,!0),()=>{v.removeEventListener(`focusout`,t),v.removeEventListener(`pointerdown`,e),y.removeEventListener(`focusout`,t),n&&y.removeEventListener(`focusout`,i,!0)}},[r,v,y,se,l,k,A,h,d,c,ce,C,b,D,_]);let ue=I.useRef(null),de=I.useRef(null),fe=Ap([ue,A?.beforeInsideRef]),pe=Ap([de,A?.afterInsideRef]);I.useEffect(()=>{var e,t;if(r||!y)return;let n=Array.from((A==null||(e=A.portalNode)==null?void 0:e.querySelectorAll(`[`+hp(`portal`)+`]`))||[]),i=[y,(t=(k?_d(k.nodesRef.current,b()):[]).find(e=>pd(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,...n,...x(),te.current,ne.current,ue.current,de.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,D.current.includes(`reference`)||C?v:null].filter(e=>e!=null),a=l||C?kp(i,!E,E):kp(i);return()=>{a()}},[r,v,y,l,D,A,C,T,E,k,b,x]),Nd(()=>{if(r||!Tl(se))return;let e=od(dd(se));queueMicrotask(()=>{let t=le(se),n=O.current,r=(typeof n==`number`?t[n]:n.current)||se,i=sd(se,e);!S&&!i&&m&&Sp(r,{preventScroll:r===se})})},[r,m,se,S,le,O]),Nd(()=>{if(r||!se)return;let e=dd(se);Mp(od(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(re.current=!0),t===`outside-press`)if(r)re.current=!1;else if(bd(n)||xd(n))re.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?re.current=!1:re.current=!0}}g.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Em),oe&&v&&v.insertAdjacentElement(`afterend`,n);function i(){if(typeof ee.current==`boolean`){let e=v||Np();return e&&e.isConnected?e:n}return ee.current.current||n}return()=>{g.off(`openchange`,t);let r=od(e),a=sd(y,r)||k&&gd(k.nodesRef.current,b(),!1).some(e=>sd(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Pp(o);ee.current&&!re.current&&Tl(t)&&(!(t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,se,ee,_,g,k,oe,v,b]),I.useEffect(()=>(queueMicrotask(()=>{re.current=!1}),()=>{queueMicrotask(jp)}),[r]),Nd(()=>{if(!r&&A)return A.setFocusManagerState({modal:l,closeOnFocusOut:d,open:m,onOpenChange:h,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,l,m,h,d,v]),Nd(()=>{r||se&&Fp(se,D)},[r,se,D]);function me(e){return r||!u||!l?null:(0,Yp.jsx)(mee,{ref:e===`start`?te:ne,onClick:e=>h(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let he=!r&&T&&(l?!C:!0)&&(oe||l);return(0,Yp.jsxs)(Yp.Fragment,{children:[he&&(0,Yp.jsx)(Dm,{"data-type":`inside`,ref:fe,onFocus:e=>{if(l){let e=le();Sp(i[0]===`reference`?e[0]:e[e.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(re.current=!1,Od(e,A.portalNode))Ed(v)?.focus();else{var t;(t=A.beforeOutsideRef.current)==null||t.focus()}}}),!C&&me(`start`),n,me(`end`),he&&(0,Yp.jsx)(Dm,{"data-type":`inside`,ref:pe,onFocus:e=>{if(l)Sp(le()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(d&&(re.current=!0),Od(e,A.portalNode))Dd(v)?.focus();else{var t;(t=A.afterOutsideRef.current)==null||t.focus()}}})]})}function Lp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=mm(),g=wd(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=I.useRef(!1),{escapeKey:y,outsidePress:b}=Mm(p),{escapeKey:x,outsidePress:S}=Mm(m),C=I.useRef(!1),w=wd(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?gd(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,yd(e)?e.nativeEvent:e,`escape-key`)}),T=wd(e=>{var t;let n=()=>{var t;w(e),(t=cd(e))==null||t.removeEventListener(`keydown`,n)};(t=cd(e))==null||t.addEventListener(`keydown`,n)}),E=wd(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=cd(e),s=`[`+hp(`inert`)+`]`,c=dd(i.floating).querySelectorAll(s),u=wl(o)?o:null;for(;u&&!Nl(u);){let e=Il(u);if(Nl(e)||!wl(e))break;u=e}if(c.length&&wl(o)&&!ud(o)&&!sd(o,i.floating)&&Array.from(c).every(e=>!sd(u,e)))return;if(Tl(o)&&ee){let t=Nl(o),n=Pl(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&gd(h.nodesRef.current,d).some(t=>ld(e,t.context?.elements.floating));if(ld(e,i.floating)||ld(e,i.domReference)||f)return;let p=h?gd(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),D=wd(e=>{var t;let n=()=>{var t;E(e),(t=cd(e))==null||t.removeEventListener(l,n)};(t=cd(e))==null||t.addEventListener(l,n)});I.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},Ml()?5:0)}let d=dd(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?D:E,S);let p=[];return f&&(wl(i.domReference)&&(p=Rl(i.domReference)),wl(i.floating)&&(p=p.concat(Rl(i.floating))),!wl(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Rl(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?D:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,D]),I.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let O=I.useMemo(()=>({onKeyDown:w,...u&&{[hee[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),ee=I.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[gee[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return I.useMemo(()=>o?{reference:O,floating:ee}:{},[o,O,ee])}function uee(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=um(),a=I.useRef({}),[o]=I.useState(()=>mp()),s=pm()!=null,[c,l]=I.useState(r.reference),u=wd((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=I.useMemo(()=>({setPositionReference:l}),[]),f=I.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return I.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Rp(e){e===void 0&&(e={});let{nodeId:t}=e,n=uee({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=I.useState(null),[s,c]=I.useState(null),l=i?.domReference||a,u=I.useRef(null),d=mm();Nd(()=>{l&&(u.current=l)},[l]);let f=Xf({...e,elements:{...i,...s&&{reference:s}}}),p=I.useCallback(e=>{let t=wl(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=I.useCallback(e=>{(wl(e)||e===null)&&(u.current=e,o(e)),(wl(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!wl(e))&&f.refs.setReference(e)},[f.refs]),h=I.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=I.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),_=I.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Nd(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),I.useMemo(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}function zp(){return id()&&nd()}function Bp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=I.useRef(!1),u=I.useRef(-1),d=I.useRef(!0);I.useEffect(()=>{if(!s)return;let e=xl(o.domReference);function t(){!n&&Tl(o.domReference)&&o.domReference===od(dd(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),zp()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),zp()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),I.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),I.useEffect(()=>()=>{gp(u)},[]);let f=I.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=cd(e.nativeEvent);if(c&&wl(t)){if(zp()&&!e.relatedTarget){if(!d.current&&!fd(t))return}else if(!md(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=wl(t)&&t.hasAttribute(hp(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=od(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||sd(a.current.floatingContext?.refs.floating.current,e)||sd(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return I.useMemo(()=>s?{reference:f}:{},[s,f])}function Vp(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Qp]:t,[$p]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Zp]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Qp,$p].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function Hp(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=I.useCallback(t=>Vp(t,e,`reference`),t),a=I.useCallback(t=>Vp(t,e,`floating`),n),o=I.useCallback(t=>Vp(t,e,`item`),r);return I.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}function Up(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=um(),c=r.domReference?.id||s,l=I.useMemo(()=>hd(r.floating)?.id||i,[r.floating,i]),u=_ee.get(o)??o,d=pm()!=null,f=I.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=I.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=I.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return I.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Wp(e,t){return typeof e==`function`?e(t):e}function Gp(e,t){let[n,r]=I.useState(e);return e&&!n&&r(!0),I.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function Kp(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=I.useState(`unmounted`),c=Gp(n,a);return!c&&o===`close`&&s(`unmounted`),Nd(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{Xp.flushSync(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function qp(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=I.useMemo(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=I.useState(()=>({...Wp(a,l),...Wp(n,l)})),{isMounted:h,status:g}=Kp(e,{duration:o}),_=Cd(n),v=Cd(r),y=Cd(i),b=Cd(a);return Nd(()=>{let e=Wp(_.current,l),t=Wp(y.current,l),n=Wp(b.current,l),r=Wp(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(Nm).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(Nm).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function dee(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...dee(e,t.id,n)])}function Jp(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function fee(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function pee(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){gp(i),u()}if(gp(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=wp(e),v=e.type===`mouseleave`,y=Cp(c.floating,_),b=Cp(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=fee(g,x),D=S.width>x.width,O=S.height>x.height,ee=(D?x:S).left,k=(D?x:S).right,A=(O?x:S).top,te=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&wl(e.relatedTarget)&&Cp(c.floating,e.relatedTarget)||f&&dee(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let ne=[];switch(C){case`top`:ne=[[ee,x.top+1],[ee,S.bottom-1],[k,S.bottom-1],[k,x.top+1]];break;case`bottom`:ne=[[ee,S.top+1],[ee,x.bottom-1],[k,x.bottom-1],[k,S.top+1]];break;case`left`:ne=[[S.right-1,te],[S.right-1,A],[x.left+1,A],[x.left+1,te]];break;case`right`:ne=[[x.right-1,te],[x.right-1,A],[S.left+1,A],[S.left+1,te]];break}function re(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]]}}if(!Jp([m,h],ne)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Jp([m,h],re([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var I,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,mee,hee,gee,Mm,_ee,Nm,Pm=o((()=>{I=u(p(),1),Ld(),Yp=N(),Wl(),$u(),Xp=u(_(),1),dp(),Zp=`data-floating-ui-focusable`,Qp=`active`,$p=`selected`,em=`ArrowLeft`,tm=`ArrowRight`,nm=`ArrowUp`,rm=`ArrowDown`,im=[em,tm],am=[nm,rm],[...im,...am],om={...I},sm=!1,cm=0,lm=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ cm++,um=om.useId||pp,dm=I.createContext(null),fm=I.createContext(null),pm=()=>I.useContext(dm)?.id||null,mm=()=>I.useContext(fm),hm=hp(`safe-polygon`),gm=()=>{},_m=I.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:gm,setState:gm,isInstantPhase:!1}),vm=()=>I.useContext(_m),ym=0,bm={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap},xm=new WeakSet,Sm={},Cm=0,wm=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,Tm=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Dp(t);return e.contains(n)?n:null}).filter(e=>e!=null),Em={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Dm=I.forwardRef(function(e,t){let[n,r]=I.useState();Nd(()=>{nd()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[hp(`focus-guard`)]:``,style:Em};return(0,Yp.jsx)(`span`,{...e,...i})}),Om=I.createContext(null),km=()=>I.useContext(Om),Am=20,jm=[],mee=I.forwardRef(function(e,t){return(0,Yp.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:Em})}),hee={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},gee={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Mm=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}),_ee=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]),Nm=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase())})),Fm,vee=o((()=>{Fm={root:`m_87cf2631`}})),yee,bee,Im,Lm=o((()=>{yee=N(),p(),F(),Ys(),al(),ml(),vee(),bee={__staticSelector:`UnstyledButton`},Im=dl((e,t)=>{let n=P(`UnstyledButton`,bee,e),{className:r,component:i=`button`,__staticSelector:a,unstyled:o,classNames:s,styles:c,style:l,attributes:u,...d}=n;return(0,yee.jsx)(il,{...Js({name:a,props:n,classes:Fm,className:r,style:l,classNames:s,styles:c,unstyled:o,attributes:u})(`root`,{focusable:!0}),component:i,ref:t,type:i===`button`?`button`:void 0,...d})}),Im.classes=Fm,Im.displayName=`@mantine/core/UnstyledButton`})),Rm,xee=o((()=>{Rm={root:`m_515a97f8`}})),See,zm,Cee=o((()=>{See=N(),p(),F(),Ys(),al(),ul(),xee(),zm=sl((e,t)=>{let n=P(`VisuallyHidden`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,attributes:l,...u}=n;return(0,See.jsx)(il,{component:`span`,ref:t,...Js({name:`VisuallyHidden`,classes:Rm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:l})(`root`),...u})}),zm.classes=Rm,zm.displayName=`@mantine/core/VisuallyHidden`})),Bm,wee=o((()=>{Bm={root:`m_1b7284a3`}})),Tee,Eee,Vm,Dee=o((()=>{Tee=N(),p(),Jr(),ga(),F(),Ys(),al(),ml(),wee(),Eee=ha((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Wr(t),"--paper-shadow":qr(n)}})),Vm=dl((e,t)=>{let n=P(`Paper`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=n,g=Js({name:`Paper`,props:n,classes:Bm,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:l,varsResolver:Eee});return(0,Tee.jsx)(il,{ref:t,mod:[{"data-with-border":c},p],...g(`root`),variant:f,...h})}),Vm.classes=Bm,Vm.displayName=`@mantine/core/Paper`}));function Oee(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function kee(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}function Aee({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[jee[c]]:r},d=-t/2;return c===`left`?{...u,...Oee(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Oee(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...kee(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...kee(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}var jee,Mee=o((()=>{jee={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`}})),Nee,Pee,Hm,Fee=o((()=>{Nee=N(),Pee=u(p(),1),vl(),Mee(),Hm=(0,Pee.forwardRef)(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l},u)=>{let{dir:d}=hl();return a?(0,Nee.jsx)(`div`,{...l,ref:u,style:{...c,...Aee({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:d,arrowX:o,arrowY:s})}}):null}),Hm.displayName=`@mantine/core/FloatingArrow`}));function Um(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}var Wm=o((()=>{})),Gm,Iee=o((()=>{Gm={root:`m_9814e45f`}})),Km,qm,Jm,Ym,Xm=o((()=>{Km=N(),ur(),p(),Lr(),Jr(),ga(),so(),F(),Ys(),al(),ml(),Iee(),qm={zIndex:Fr(`modal`)},Jm=ha((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&ao(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${M(i)})`:void 0,"--overlay-radius":a===void 0?void 0:Wr(a),"--overlay-z-index":o?.toString()}})),Ym=dl((e,t)=>{let n=P(`Overlay`,qm,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fixed:l,center:u,children:d,radius:f,zIndex:p,gradient:m,blur:h,color:g,backgroundOpacity:_,mod:v,attributes:y,...b}=n;return(0,Km.jsx)(il,{ref:t,...Js({name:`Overlay`,props:n,classes:Gm,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Jm})(`root`),mod:[{center:u,fixed:l},v],...b,children:d})}),Ym.classes=Gm,Ym.displayName=`@mantine/core/Overlay`}));function Zm(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function Lee({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||Zm(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=Zm(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return Zm(n)}var Qm,$m,eh,th,nh,Ree=o((()=>{Qm=N(),$m=u(p(),1),eh=u(_(),1),la(),F(),ul(),th={reuseTargetNode:!0},nh=sl((e,t)=>{let{children:n,target:r,reuseTargetNode:i,...a}=P(`Portal`,th,e),[o,s]=(0,$m.useState)(!1),c=(0,$m.useRef)(null);return mi(()=>(s(!0),c.current=Lee({target:r,reuseTargetNode:i,...a}),Ui(t,c.current),!r&&!i&&c.current&&document.body.appendChild(c.current),()=>{!r&&!i&&c.current&&document.body.removeChild(c.current)}),[r]),!o||!c.current?null:(0,eh.createPortal)((0,Qm.jsx)(Qm.Fragment,{children:n}),c.current)}),nh.displayName=`@mantine/core/Portal`})),rh,ih,ah=o((()=>{rh=N(),p(),La(),ul(),Ree(),ih=sl(({withinPortal:e=!0,children:t,...n},r)=>Pa()===`test`||!e?(0,rh.jsx)(rh.Fragment,{children:t}):(0,rh.jsx)(nh,{ref:r,...n,children:t})),ih.displayName=`@mantine/core/OptionalPortal`})),oh,sh,zee=o((()=>{oh=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),sh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...oh(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...oh(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...oh(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...oh(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...oh(`top`),common:{transformOrigin:`top right`}}}}));function Bee({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in sh?{transitionProperty:sh[e].transitionProperty,...i,...sh[e].common,...sh[e][ch[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[ch[t]]}}var ch,Vee=o((()=>{zee(),ch={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`}}));function Hee({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:s,enterDelay:c,exitDelay:l}){let u=Eo(),d=Zi(),f=u.respectReducedMotion?d:!1,[p,m]=(0,lh.useState)(f?0:e),[h,g]=(0,lh.useState)(r?`entered`:`exited`),_=(0,lh.useRef)(-1),v=(0,lh.useRef)(-1),y=(0,lh.useRef)(-1);function b(){window.clearTimeout(_.current),window.clearTimeout(v.current),cancelAnimationFrame(y.current)}let x=n=>{b();let r=n?i:a,c=n?o:s,l=f?0:n?e:t;m(l),l===0?(typeof r==`function`&&r(),typeof c==`function`&&c(),g(n?`entered`:`exited`)):y.current=requestAnimationFrame(()=>{uh.flushSync(()=>{g(n?`pre-entering`:`pre-exiting`)}),y.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),g(n?`entering`:`exiting`),_.current=window.setTimeout(()=>{typeof c==`function`&&c(),g(n?`entered`:`exited`)},l)})})},S=e=>{if(b(),typeof(e?c:l)!=`number`){x(e);return}v.current=window.setTimeout(()=>{x(e)},e?c:l)};return gi(()=>{S(r)},[r]),(0,lh.useEffect)(()=>()=>{b()},[]),{transitionDuration:p,transitionStatus:h,transitionTimingFunction:n||`ease`}}var lh,uh,Uee=o((()=>{lh=u(p(),1),uh=u(_(),1),la(),N(),Mo()}));function dh({keepMounted:e,transition:t=`fade`,duration:n=250,exitDuration:r=n,mounted:i,children:a,timingFunction:o=`ease`,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f}){let p=Pa(),{transitionDuration:m,transitionStatus:h,transitionTimingFunction:g}=Hee({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f});return m===0||p===`test`?i?(0,fh.jsx)(fh.Fragment,{children:a({})}):e?a({display:`none`}):null:h===`exited`?e?a({display:`none`}):null:(0,fh.jsx)(fh.Fragment,{children:a(Bee({transition:t,duration:m,state:h,timingFunction:g}))})}var fh,ph=o((()=>{fh=N(),p(),La(),Vee(),Uee(),dh.displayName=`@mantine/core/Transition`})),mh,hh,gh=o((()=>{p(),xr(),N(),[mh,hh]=vr(`Popover component was not found in the tree`)})),_h,vh=o((()=>{_h={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`}}));function yh({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=Gi(Ni(t),r),a=fa(e);return a?(0,Sh.cloneElement)(a,{[n]:i}):e}function bh(e){return(0,xh.jsx)(zm,{tabIndex:-1,"data-autofocus":!0,...e})}var xh,Sh,Wee=o((()=>{xh=N(),Sh=u(p(),1),la(),ma(),Cee(),yh.displayName=`@mantine/core/FocusTrap`,bh.displayName=`@mantine/core/FocusTrapInitialFocus`,yh.InitialFocus=bh})),Ch,wh,Th=o((()=>{Ch=N(),la(),ur(),p(),Vr(),F(),al(),ul(),Fee(),Wee(),ah(),ph(),gh(),vh(),wh=sl((e,t)=>{let n=P(`PopoverDropdown`,null,e),{className:r,style:i,vars:a,children:o,onKeyDownCapture:s,variant:c,classNames:l,styles:u,...d}=n,f=hh(),p=yi({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},h=Gi(t,f.floating);return f.disabled?null:(0,Ch.jsx)(ih,{...f.portalProps,withinPortal:f.withinPortal,children:(0,Ch.jsx)(dh,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,Ch.jsx)(yh,{active:f.trapFocus&&f.opened,innerRef:h,children:(0,Ch.jsxs)(il,{...m,...d,variant:c,onKeyDownCapture:Br(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:r,props:n,classNames:l,styles:u,style:[{...e,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:M(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles.dropdown,u?.dropdown,i]}),children:[o,(0,Ch.jsx)(Hm,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:n,classNames:l,styles:u})})]})})})})}),wh.classes=_h,wh.displayName=`@mantine/core/PopoverDropdown`})),Eh,Dh,Oh,kh=o((()=>{Eh=u(p(),1),ya(),la(),N(),da(),ma(),F(),ul(),gh(),Dh={refProp:`ref`,popupType:`dialog`},Oh=sl((e,t)=>{let{children:n,refProp:r,popupType:i,...a}=P(`PopoverTarget`,Dh,e),o=fa(n);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,c=hh(),l=Gi(c.reference,ua(o),t),u=c.withRoles?{"aria-haspopup":i,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return(0,Eh.cloneElement)(o,{...s,...u,...c.targetProps,className:va(c.targetProps.className,s.className,d.className),[r]:l,...c.controlled?null:{onClick:()=>{c.onToggle(),d.onClick?.()}}})}),Oh.displayName=`@mantine/core/PopoverTarget`}));function Gee(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Kee(e,t,n){let r=Gee(e.middlewares),i=[np(e.offset),cp()];return e.dropdownVisible&&n!==`test`&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip==`boolean`?ap():ap(r.flip)),r.shift&&i.push(rp(typeof r.shift==`boolean`?{limiter:ip(),padding:5}:{limiter:ip(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline==`boolean`?lp():lp(r.inline)),i.push(up({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width===`target`)&&i.push(op({...typeof r.size==`boolean`?{}:r.size,apply({rects:n,availableWidth:i,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};r.size&&(typeof r.size==`object`&&r.size.apply?r.size.apply({rects:n,availableWidth:i,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),i}function qee(e){let t=Pa(),[n,r]=Ji({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),i=(0,Ah.useRef)(n),a=()=>{n&&!e.disabled&&r(!1)},o=()=>{e.disabled||r(!n)},s=Rp({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:Kee(e,()=>s,t),whileElementsMounted:e.keepMounted?void 0:Af});return(0,Ah.useEffect)(()=>{if(!(!s.refs.reference.current||!s.refs.floating.current)&&n)return Af(s.refs.reference.current,s.refs.floating.current,s.update)},[n,s.update]),gi(()=>{e.onPositionChange?.(s.placement),e.positionRef.current=s.placement},[s.placement,e.preventPositionChangeWhenVisible]),gi(()=>{n!==i.current&&(n?e.onOpen?.():e.onClose?.()),i.current=n},[n,e.onClose,e.onOpen]),mi(()=>{let t=-1;return n&&(t=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(t)}},[n,e.position]),{floating:s,controlled:typeof e.opened==`boolean`,opened:n,onClose:a,onToggle:o}}var Ah,Jee=o((()=>{Ah=u(p(),1),Pm(),la(),N(),La()}));function jh(e){let t=P(`Popover`,Ph,e),{children:n,position:r,offset:i,onPositionChange:a,positionDependencies:o,opened:s,transitionProps:c,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,unstyled:v,classNames:y,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:w,clickOutsideEvents:T,trapFocus:E,onClose:D,onDismiss:O,onOpen:ee,onChange:k,zIndex:A,radius:te,shadow:ne,id:re,defaultOpened:ie,__staticSelector:j,withRoles:ae,disabled:oe,returnFocus:se,variant:ce,keepMounted:le,vars:ue,floatingStrategy:de,withOverlay:fe,overlayProps:pe,hideDetached:me,attributes:he,preventPositionChangeWhenVisible:ge,..._e}=t,ve=Js({name:j,props:t,classes:_h,classNames:y,styles:b,unstyled:v,attributes:he,rootSelector:`dropdown`,vars:ue,varsResolver:Fh}),{resolvedStyles:ye}=gs({classNames:y,styles:b,props:t}),[be,xe]=(0,Nh.useState)(s??ie??!1),Se=(0,Nh.useRef)(r),Ce=(0,Nh.useRef)(null),[we,Te]=(0,Nh.useState)(null),[Ee,De]=(0,Nh.useState)(null),{dir:Oe}=hl(),ke=Pa(),Ae=Bi(re),je=qee({middlewares:f,width:d,position:Um(Oe,r),offset:typeof i==`number`?i+(p?m/2:0):i,arrowRef:Ce,arrowOffset:h,onPositionChange:a,positionDependencies:o,opened:s,defaultOpened:ie,onChange:k,onOpen:ee,onClose:D,onDismiss:O,strategy:de,dropdownVisible:be,setDropdownVisible:xe,positionRef:Se,disabled:oe,preventPositionChangeWhenVisible:ge,keepMounted:le});ii(()=>{x&&(je.onClose(),O?.())},T,[we,Ee]);let Me=(0,Nh.useCallback)(e=>{Te(e),je.floating.refs.setReference(e)},[je.floating.refs.setReference]),Ne=(0,Nh.useCallback)(e=>{De(e),je.floating.refs.setFloating(e)},[je.floating.refs.setFloating]),Pe=(0,Nh.useCallback)(()=>{c?.onExited?.(),l?.(),xe(!1),ge||(Se.current=r)},[c?.onExited,l,ge,r]),Fe=(0,Nh.useCallback)(()=>{c?.onEntered?.(),u?.()},[c?.onEntered,u]);return(0,Mh.jsxs)(mh,{value:{returnFocus:se,disabled:oe,controlled:je.controlled,reference:Me,floating:Ne,x:je.floating.x,y:je.floating.y,arrowX:je.floating?.middlewareData?.arrow?.x,arrowY:je.floating?.middlewareData?.arrow?.y,opened:je.opened,arrowRef:Ce,transitionProps:{...c,onExited:Pe,onEntered:Fe},width:d,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,placement:je.floating.placement,trapFocus:E,withinPortal:S,portalProps:C,zIndex:A,radius:te,shadow:ne,closeOnEscape:w,onDismiss:O,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${Ae}-target`,getDropdownId:()=>`${Ae}-dropdown`,withRoles:ae,targetProps:_e,__staticSelector:j,classNames:y,styles:b,unstyled:v,variant:ce,keepMounted:le,getStyles:ve,resolvedStyles:ye,floatingStrategy:de,referenceHidden:me&&ke!==`test`?je.floating.middlewareData.hide?.referenceHidden:!1},children:[n,fe&&(0,Mh.jsx)(dh,{transition:`fade`,mounted:je.opened,duration:c?.duration||250,exitDuration:c?.exitDuration||250,children:e=>(0,Mh.jsx)(ih,{withinPortal:S,children:(0,Mh.jsx)(Ym,{...pe,...ve(`overlay`,{className:pe?.className,style:[e,pe?.style]})})})})]})}var Mh,Nh,Ph,Fh,Ih=o((()=>{Mh=N(),Nh=u(p(),1),la(),Lr(),Jr(),ga(),_s(),Ys(),La(),F(),vl(),Wm(),Xm(),ah(),ph(),gh(),vh(),Th(),kh(),Jee(),Ph={position:`bottom`,offset:8,positionDependencies:[],transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:Fr(`popover`),__staticSelector:`Popover`,width:`max-content`},Fh=ha((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Wr(t),"--popover-shadow":qr(n)}})),jh.Target=Oh,jh.Dropdown=wh,jh.displayName=`@mantine/core/Popover`,jh.extend=e=>e})),Lh,Rh=o((()=>{Lh={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`}})),zh,Bh,Vh,Yee=o((()=>{zh=N(),Bh=u(p(),1),ya(),al(),Rh(),Vh=(0,Bh.forwardRef)(({className:e,...t},n)=>(0,zh.jsxs)(il,{component:`span`,className:va(Lh.barsLoader,e),...t,ref:n,children:[(0,zh.jsx)(`span`,{className:Lh.bar}),(0,zh.jsx)(`span`,{className:Lh.bar}),(0,zh.jsx)(`span`,{className:Lh.bar})]})),Vh.displayName=`@mantine/core/Bars`})),Hh,Uh,Wh,Xee=o((()=>{Hh=N(),Uh=u(p(),1),ya(),al(),Rh(),Wh=(0,Uh.forwardRef)(({className:e,...t},n)=>(0,Hh.jsxs)(il,{component:`span`,className:va(Lh.dotsLoader,e),...t,ref:n,children:[(0,Hh.jsx)(`span`,{className:Lh.dot}),(0,Hh.jsx)(`span`,{className:Lh.dot}),(0,Hh.jsx)(`span`,{className:Lh.dot})]})),Wh.displayName=`@mantine/core/Dots`})),Gh,Kh,qh,Zee=o((()=>{Gh=N(),Kh=u(p(),1),ya(),al(),Rh(),qh=(0,Kh.forwardRef)(({className:e,...t},n)=>(0,Gh.jsx)(il,{component:`span`,className:va(Lh.ovalLoader,e),...t,ref:n})),qh.displayName=`@mantine/core/Oval`})),Jh,Yh,Xh,Zh,Qh,$h=o((()=>{Jh=N(),p(),Jr(),ga(),no(),F(),Ys(),al(),ul(),Rh(),Yee(),Xee(),Zee(),Yh={bars:Vh,oval:qh,dots:Wh},Xh={loaders:Yh,type:`oval`},Zh=ha((e,{size:t,color:n})=>({root:{"--loader-size":Hr(t,`loader-size`),"--loader-color":n?to(n,e):void 0}})),Qh=sl((e,t)=>{let n=P(`Loader`,Xh,e),{size:r,color:i,type:a,vars:o,className:s,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=n,_=Js({name:`Loader`,props:n,classes:Lh,className:s,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:o,varsResolver:Zh});return m?(0,Jh.jsx)(il,{..._(`root`),ref:t,...g,children:m}):(0,Jh.jsx)(il,{..._(`root`),ref:t,component:f[a],variant:p,size:r,...g})}),Qh.defaultLoaders=Yh,Qh.classes=Lh,Qh.displayName=`@mantine/core/Loader`})),eg,tg=o((()=>{eg={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`}})),Qee,ng,$ee,rg,ete=o((()=>{Qee=N(),ur(),p(),ga(),F(),Ys(),al(),ul(),tg(),ng={orientation:`horizontal`},$ee=ha((e,{borderWidth:t})=>({group:{"--ai-border-width":M(t)}})),rg=sl((e,t)=>{let n=P(`ActionIconGroup`,ng,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=P(`ActionIconGroup`,ng,e);return(0,Qee.jsx)(il,{...Js({name:`ActionIconGroup`,props:n,classes:eg,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:$ee,rootSelector:`group`})(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})}),rg.classes=eg,rg.displayName=`@mantine/core/ActionIconGroup`})),tte,nte,ig,rte=o((()=>{tte=N(),p(),Jr(),ga(),F(),Ys(),al(),ul(),tg(),nte=ha((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":Hr(o,`section-height`),"--section-padding-x":Hr(o,`section-padding-x`),"--section-fz":Gr(o),"--section-radius":t===void 0?void 0:Wr(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),ig=sl((e,t)=>{let n=P(`ActionIconGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n;return(0,tte.jsx)(il,{...Js({name:`ActionIconGroupSection`,props:n,classes:eg,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:nte,rootSelector:`groupSection`})(`groupSection`),ref:t,variant:l,...m})}),ig.classes=eg,ig.displayName=`@mantine/core/ActionIconGroupSection`})),ag,ite,og,ate=o((()=>{ag=N(),p(),Jr(),ga(),F(),Ys(),al(),ml(),$h(),ph(),Lm(),tg(),ete(),rte(),ite=ha((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":Hr(t,`ai-size`),"--ai-radius":n===void 0?void 0:Wr(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),og=dl((e,t)=>{let n=P(`ActionIcon`,null,e),{className:r,unstyled:i,variant:a,classNames:o,styles:s,style:c,loading:l,loaderProps:u,size:d,color:f,radius:p,__staticSelector:m,gradient:h,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=n,w=Js({name:[`ActionIcon`,m],props:n,className:r,style:c,classes:eg,classNames:o,styles:s,unstyled:i,attributes:S,vars:g,varsResolver:ite});return(0,ag.jsxs)(Im,{...w(`root`,{active:!v&&!l&&!y}),...C,unstyled:i,variant:a,size:d,disabled:v||l,ref:t,mod:[{loading:l,disabled:v||y},x],children:[typeof l==`boolean`&&(0,ag.jsx)(dh,{mounted:l,transition:`slide-down`,duration:150,children:e=>(0,ag.jsx)(il,{component:`span`,...w(`loader`,{style:e}),"aria-hidden":!0,children:(0,ag.jsx)(Qh,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...u})})}),(0,ag.jsx)(il,{component:`span`,mod:{loading:l},...w(`icon`),children:_})]})}),og.classes=eg,og.displayName=`@mantine/core/ActionIcon`,og.Group=rg,og.GroupSection=ig})),sg,ote,cg,ste=o((()=>{sg=N(),ote=u(p(),1),cg=(0,ote.forwardRef)(({size:e=`var(--cb-icon-size, 70%)`,style:t,...n},r)=>(0,sg.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},ref:r,...n,children:(0,sg.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})),cg.displayName=`@mantine/core/CloseIcon`})),lg,cte=o((()=>{lg={root:`m_86a44da5`,"root--subtle":`m_220c80f2`}})),ug,lte,ute,dg,dte=o((()=>{ug=N(),ur(),p(),Jr(),ga(),F(),Ys(),ml(),Lm(),cte(),ste(),lte={variant:`subtle`},ute=ha((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Hr(t,`cb-size`),"--cb-radius":n===void 0?void 0:Wr(n),"--cb-icon-size":M(r)}})),dg=dl((e,t)=>{let n=P(`CloseButton`,lte,e),{iconSize:r,children:i,vars:a,radius:o,className:s,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=n,b=Js({name:v||`CloseButton`,props:n,className:s,style:l,classes:lg,classNames:c,styles:u,unstyled:d,attributes:_,vars:a,varsResolver:ute});return(0,ug.jsxs)(Im,{ref:t,...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,ug.jsx)(cg,{}),i]})}),dg.classes=lg,dg.displayName=`@mantine/core/CloseButton`}));function fte(e){return pte.Children.toArray(e).filter(Boolean)}var pte,mte=o((()=>{pte=u(p(),1)})),fg,hte=o((()=>{fg={root:`m_4081bf90`}})),gte,_te,vte,pg,yte=o((()=>{gte=N(),p(),Jr(),ga(),F(),Ys(),al(),ul(),mte(),hte(),_te={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},vte=ha((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":Ur(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),pg=sl((e,t)=>{let n=P(`Group`,_te,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...b}=n,x=fte(c),S=x.length,C=Ur(l??`md`);return(0,gte.jsx)(il,{...Js({name:`Group`,props:n,stylesCtx:{childWidth:`calc(${100/S}% - (${C} - ${C} / ${S}))`},className:i,style:a,classes:fg,classNames:r,styles:o,unstyled:s,attributes:y,vars:h,varsResolver:vte})(`root`),ref:t,variant:g,mod:[{grow:p},v],size:_,...b,children:x})}),pg.classes=fg,pg.displayName=`@mantine/core/Group`})),bte,xte,Ste=o((()=>{p(),N(),Tr(),[bte,xte]=Sr({size:`sm`})})),mg,hg=o((()=>{mg={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,description:`m_fe47ce59`}})),Cte,gg,wte=o((()=>{Cte=N(),p(),_s(),F(),ul(),dte(),Ste(),gg=sl((e,t)=>{let n=P(`InputClearButton`,null,e),{size:r,variant:i,vars:a,classNames:o,styles:s,...c}=n,l=xte(),{resolvedClassNames:u,resolvedStyles:d}=gs({classNames:o,styles:s,props:n});return(0,Cte.jsx)(dg,{variant:i||`transparent`,ref:t,size:r||l?.size||`sm`,classNames:u,styles:d,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...c.style},...c})}),gg.displayName=`@mantine/core/InputClearButton`}));function Tte({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`}){let a=e&&t;return a&&(n||r)?(0,Ete.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:Dte[i]},children:[a,n||r]}):n===null?null:n||a||r}var Ete,Dte,Ote=o((()=>{Ete=N(),Dte={xs:7,sm:8,md:10,lg:12,xl:15}})),kte,_g,vg=o((()=>{p(),N(),Tr(),[kte,_g]=Sr({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0})})),Ate,jte,yg,Mte=o((()=>{Ate=N(),ur(),p(),Jr(),ga(),F(),Ys(),al(),ul(),hg(),vg(),jte=ha((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`}})),yg=sl((e,t)=>{let n=P(`InputDescription`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,variant:p,...m}=P(`InputDescription`,null,n),h=_g(),g=Js({name:[`InputWrapper`,u],props:n,classes:mg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,rootSelector:`description`,vars:c,varsResolver:jte});return(0,Ate.jsx)(il,{component:`p`,ref:t,variant:p,size:l,...(d&&h?.getStyles||g)(`description`,h?.getStyles?{className:i,style:a}:void 0),...m})}),yg.classes=mg,yg.displayName=`@mantine/core/InputDescription`})),Nte,Pte,bg,Fte=o((()=>{Nte=N(),ur(),p(),Jr(),ga(),F(),Ys(),al(),ul(),hg(),vg(),Pte=ha((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`}})),bg=sl((e,t)=>{let n=P(`InputError`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,variant:p,...m}=n,h=Js({name:[`InputWrapper`,d],props:n,classes:mg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,rootSelector:`error`,vars:c,varsResolver:Pte}),g=_g();return(0,Nte.jsx)(il,{component:`p`,ref:t,variant:p,size:l,...(f&&g?.getStyles||h)(`error`,g?.getStyles?{className:i,style:a}:void 0),...m})}),bg.classes=mg,bg.displayName=`@mantine/core/InputError`})),xg,Sg,Ite,Cg,Lte=o((()=>{xg=N(),p(),Jr(),ga(),F(),Ys(),al(),ul(),hg(),vg(),Sg={labelElement:`label`},Ite=ha((e,{size:t})=>({label:{"--input-label-size":Gr(t),"--input-asterisk-color":void 0}})),Cg=sl((e,t)=>{let n=P(`InputLabel`,Sg,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,labelElement:l,size:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,variant:g,mod:_,attributes:v,...y}=P(`InputLabel`,Sg,n),b=Js({name:[`InputWrapper`,h],props:n,classes:mg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,rootSelector:`label`,vars:c,varsResolver:Ite}),x=_g(),S=x?.getStyles||b;return(0,xg.jsxs)(il,{...S(`label`,x?.getStyles?{className:i,style:a}:void 0),component:l,variant:g,size:u,ref:t,htmlFor:l===`label`?f:void 0,mod:[{required:d},_],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[m,d&&(0,xg.jsx)(`span`,{...S(`required`),"aria-hidden":!0,children:` *`})]})}),Cg.classes=mg,Cg.displayName=`@mantine/core/InputLabel`})),Rte,wg,zte=o((()=>{Rte=N(),p(),F(),Ys(),al(),ul(),hg(),wg=sl((e,t)=>{let n=P(`InputPlaceholder`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,__staticSelector:l,variant:u,error:d,mod:f,attributes:p,...m}=n;return(0,Rte.jsx)(il,{...Js({name:[`InputPlaceholder`,l],props:n,classes:mg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,rootSelector:`placeholder`})(`placeholder`),mod:[{error:!!d},f],component:`span`,variant:u,ref:t,...m})}),wg.classes=mg,wg.displayName=`@mantine/core/InputPlaceholder`}));function Bte(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var Vte=o((()=>{})),Tg,Eg,Hte,Ute,Dg,Wte=o((()=>{Tg=N(),Eg=u(p(),1),la(),ur(),Jr(),ga(),F(),Ys(),al(),ul(),hg(),Mte(),Fte(),Lte(),vg(),Vte(),Hte={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},Ute=ha((e,{size:t})=>({label:{"--input-label-size":Gr(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`}})),Dg=sl((e,t)=>{let n=P(`InputWrapper`,Hte,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,variant:u,__staticSelector:d,inputContainer:f,inputWrapperOrder:p,label:m,error:h,description:g,labelProps:_,descriptionProps:v,errorProps:y,labelElement:b,children:x,withAsterisk:S,id:C,required:w,__stylesApiProps:T,mod:E,attributes:D,...O}=n,ee=Js({name:[`InputWrapper`,d],props:T||n,classes:mg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:D,vars:c,varsResolver:Ute}),k={size:l,variant:u,__staticSelector:d},A=Bi(C),te=typeof S==`boolean`?S:w,ne=y?.id||`${A}-error`,re=v?.id||`${A}-description`,ie=A,j=!!h&&typeof h!=`boolean`,ae=!!g,oe=`${j?ne:``} ${ae?re:``}`,se=oe.trim().length>0?oe.trim():void 0,ce=_?.id||`${A}-label`,le=m&&(0,Tg.jsx)(Cg,{labelElement:b,id:ce,htmlFor:ie,required:te,...k,..._,children:m},`label`),ue=ae&&(0,Tg.jsx)(yg,{...v,...k,size:v?.size||k.size,id:v?.id||re,children:g},`description`),de=(0,Tg.jsx)(Eg.Fragment,{children:f(x)},`input`),fe=j&&(0,Eg.createElement)(bg,{...y,...k,size:y?.size||k.size,key:`error`,id:y?.id||ne},h),pe=p.map(e=>{switch(e){case`label`:return le;case`input`:return de;case`description`:return ue;case`error`:return fe;default:return null}});return(0,Tg.jsx)(kte,{value:{getStyles:ee,describedBy:se,inputId:ie,labelId:ce,...Bte(p,{hasDescription:ae,hasError:j})},children:(0,Tg.jsx)(il,{ref:t,variant:u,size:l,mod:[{error:!!h},E],...ee(`root`),...O,children:pe})})}),Dg.classes=mg,Dg.displayName=`@mantine/core/InputWrapper`})),Og,Gte,Kte,kg,qte=o((()=>{Og=N(),ur(),p(),Jr(),ga(),F(),Ys(),ac(),al(),ml(),Ste(),hg(),wte(),Ote(),Mte(),Fte(),Lte(),zte(),vg(),Wte(),Gte={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,size:`sm`},Kte=ha((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":Hr(t.size,`input-height`),"--input-fz":Gr(t.size),"--input-radius":t.radius===void 0?void 0:Wr(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:M(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:M(t.rightSectionWidth),"--input-padding-y":t.multiline?Hr(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),kg=dl((e,t)=>{let n=P(`Input`,Gte,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,required:c,__staticSelector:l,__stylesApiProps:u,size:d,wrapperProps:f,error:p,disabled:m,leftSection:h,leftSectionProps:g,leftSectionWidth:_,rightSection:v,rightSectionProps:y,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:S,variant:C,vars:w,pointer:T,multiline:E,radius:D,id:O,withAria:ee,withErrorStyles:k,mod:A,inputSize:te,attributes:ne,__clearSection:re,__clearable:ie,__defaultRightSection:j,...ae}=n,{styleProps:oe,rest:se}=ic(ae),ce=_g(),le={offsetBottom:ce?.offsetBottom,offsetTop:ce?.offsetTop},ue=Js({name:[`Input`,l],props:u||n,classes:mg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:ne,stylesCtx:le,rootSelector:`wrapper`,vars:w,varsResolver:Kte}),de=ee?{required:c,disabled:m,"aria-invalid":!!p,"aria-describedby":ce?.describedBy,id:ce?.inputId||O}:{},fe=Tte({__clearable:ie,__clearSection:re,rightSection:v,__defaultRightSection:j,size:d});return(0,Og.jsx)(bte,{value:{size:d||`sm`},children:(0,Og.jsxs)(il,{...ue(`wrapper`),...oe,...f,mod:[{error:!!p&&k,pointer:T,disabled:m,multiline:E,"data-with-right-section":!!fe,"data-with-left-section":!!h},A],variant:C,size:d,children:[h&&(0,Og.jsx)(`div`,{...g,"data-position":`left`,...ue(`section`,{className:g?.className,style:g?.style}),children:h}),(0,Og.jsx)(il,{component:`input`,...se,...de,ref:t,required:c,mod:{disabled:m,error:!!p&&k},variant:C,__size:te,...ue(`input`)}),fe&&(0,Og.jsx)(`div`,{...y,"data-position":`right`,...ue(`section`,{className:y?.className,style:y?.style}),children:fe})]})})}),kg.classes=mg,kg.Wrapper=Dg,kg.Label=Cg,kg.Error=bg,kg.Description=yg,kg.Placeholder=wg,kg.ClearButton=gg,kg.displayName=`@mantine/core/Input`}));function Jte(e,t,n){let r=P(e,t,n),{label:i,description:a,error:o,required:s,classNames:c,styles:l,className:u,unstyled:d,__staticSelector:f,__stylesApiProps:p,errorProps:m,labelProps:h,descriptionProps:g,wrapperProps:_,id:v,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,vars:T,mod:E,attributes:D,...O}=r,{styleProps:ee,rest:k}=ic(O),A={label:i,description:a,error:o,required:s,classNames:c,className:u,__staticSelector:f,__stylesApiProps:p||r,errorProps:m,labelProps:h,descriptionProps:g,unstyled:d,styles:l,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,id:v,mod:E,attributes:D,..._};return{...k,classNames:c,styles:l,unstyled:d,wrapperProps:{...A,...ee},inputProps:{required:s,classNames:c,styles:l,unstyled:d,size:y,__staticSelector:f,__stylesApiProps:p||r,error:o,variant:w,id:v,attributes:D}}}var Yte=o((()=>{p(),N(),F(),ac()})),Ag,Xte,jg,Zte=o((()=>{Ag=N(),p(),ml(),qte(),Yte(),Xte={__staticSelector:`InputBase`,withAria:!0,size:`sm`},jg=dl((e,t)=>{let{inputProps:n,wrapperProps:r,...i}=Jte(`InputBase`,Xte,e);return(0,Ag.jsx)(kg.Wrapper,{...r,children:(0,Ag.jsx)(kg,{...n,...i,ref:t})})}),jg.classes={...kg.classes,...kg.Wrapper.classes},jg.displayName=`@mantine/core/InputBase`})),Qte,$te=o((()=>{Qte={gap:{type:`spacing`,property:`gap`},rowGap:{type:`spacing`,property:`rowGap`},columnGap:{type:`spacing`,property:`columnGap`},align:{type:`identity`,property:`alignItems`},justify:{type:`identity`,property:`justifyContent`},wrap:{type:`identity`,property:`flexWrap`},direction:{type:`identity`,property:`flexDirection`}}})),Mg,ene=o((()=>{Mg={root:`m_8bffd616`}})),Ng,Pg,tne=o((()=>{Ng=N(),fr(),p(),Mo(),F(),Ys(),rc(),Bc(),Uc(),al(),ml(),$te(),ene(),Pg=dl((e,t)=>{let n=P(`Flex`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h,attributes:g,..._}=n,v=Js({name:`Flex`,classes:Mg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c}),y=Eo(),b=Vc(),x=zc({styleProps:{gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h},theme:y,data:Qte});return(0,Ng.jsxs)(Ng.Fragment,{children:[x.hasResponsiveStyles&&(0,Ng.jsx)(tc,{selector:`.${b}`,styles:x.styles,media:x.media}),(0,Ng.jsx)(il,{ref:t,...v(`root`,{className:b,style:dr(x.inlineStyles)}),..._})]})}),Pg.classes=Mg,Pg.displayName=`@mantine/core/Flex`}));function Fg({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,Ig.useRef)(-1),a=(0,Ig.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,Ig.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var Ig,Lg=o((()=>{Ig=u(p(),1)}));function Rg({style:e,size:t=16,...n}){return(0,zg.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:M(t),height:M(t),display:`block`},...n,children:(0,zg.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var zg,nne=o((()=>{zg=N(),ur(),p(),Rg.displayName=`@mantine/core/AccordionChevron`})),Bg,rne=o((()=>{Bg={root:`m_b6d8b162`}}));function ine(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Vg,Hg,Ug,Wg,ane=o((()=>{Vg=N(),p(),Jr(),ga(),no(),io(),F(),Ys(),al(),ml(),rne(),Hg={inherit:!1},Ug=ha((e,{variant:t,lineClamp:n,gradient:r,size:i,color:a})=>({root:{"--text-fz":Gr(i),"--text-lh":Kr(i),"--text-gradient":t===`gradient`?ro(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-color":a?to(a,e):void 0}})),Wg=dl((e,t)=>{let n=P(`Text`,Hg,e),{lineClamp:r,truncate:i,inline:a,inherit:o,gradient:s,span:c,__staticSelector:l,vars:u,className:d,style:f,classNames:p,styles:m,unstyled:h,variant:g,mod:_,size:v,attributes:y,...b}=n;return(0,Vg.jsx)(il,{...Js({name:[`Text`,l],props:n,classes:Bg,className:d,style:f,classNames:p,styles:m,unstyled:h,attributes:y,vars:u,varsResolver:Ug})(`root`,{focusable:!0}),ref:t,component:c?`span`:`p`,variant:g,mod:[{"data-truncate":ine(i),"data-line-clamp":typeof r==`number`,"data-inline":a,"data-inherit":o},_],size:v,...b})}),Wg.classes=Bg,Wg.displayName=`@mantine/core/Text`}));function Gg({size:e,style:t,...n}){return(0,Kg.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:M(e),height:M(e),...t},"aria-hidden":!0,...n,children:(0,Kg.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Kg,qg=o((()=>{Kg=N(),ur(),p()})),Jg,Yg=o((()=>{Jg={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`}}));function one(){return{withinGroup:!!(0,Xg.useContext)(Zg)}}var Xg,Zg,Qg,$g=o((()=>{Xg=u(p(),1),Zg=(0,Xg.createContext)(null),Qg=Zg.Provider})),e_,t_,n_,sne=o((()=>{e_=N(),p(),Jr(),ga(),F(),Ys(),al(),ul(),Yg(),$g(),t_=ha((e,{spacing:t})=>({group:{"--ag-spacing":Ur(t)}})),n_=sl((e,t)=>{let n=P(`AvatarGroup`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,spacing:l,attributes:u,...d}=n;return(0,e_.jsx)(Qg,{value:!0,children:(0,e_.jsx)(il,{ref:t,...Js({name:`AvatarGroup`,classes:Jg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,vars:c,varsResolver:t_,rootSelector:`group`})(`group`),...d})})}),n_.classes=Jg,n_.displayName=`@mantine/core/AvatarGroup`}));function cne(e){return(0,r_.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,r_.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var r_,lne=o((()=>{r_=N()}));function une(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function dne(e,t=i_){let n=une(e);return t[Math.abs(n)%t.length]}var i_,fne=o((()=>{i_=[`blue`,`cyan`,`grape`,`green`,`indigo`,`lime`,`orange`,`pink`,`red`,`teal`,`violet`]}));function pne(e,t=2){let n=e.split(` `);return n.length===1?e.slice(0,t).toUpperCase():n.map(e=>e[0]).slice(0,t).join(``).toUpperCase()}var mne=o((()=>{})),a_,o_,s_,c_,hne=o((()=>{a_=N(),o_=u(p(),1),Jr(),ga(),F(),Ys(),al(),ml(),Yg(),sne(),$g(),lne(),fne(),mne(),s_=ha((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?dne(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":Hr(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:Wr(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),c_=dl((e,t)=>{let n=P(`Avatar`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,src:l,alt:u,radius:d,color:f,gradient:p,imageProps:m,children:h,autoContrast:g,mod:_,name:v,allowedInitialsColors:y,attributes:b,...x}=n,S=one(),[C,w]=(0,o_.useState)(!l),T=Js({name:`Avatar`,props:n,classes:Jg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:s_});return(0,o_.useEffect)(()=>w(!l),[l]),(0,a_.jsx)(il,{...T(`root`),mod:[{"within-group":S.withinGroup},_],ref:t,...x,children:C||!l?(0,a_.jsx)(`span`,{...T(`placeholder`),title:u,children:h||typeof v==`string`&&pne(v)||(0,a_.jsx)(cne,{})}):(0,a_.jsx)(`img`,{...m,...T(`image`),src:l,alt:u,onError:e=>{w(!0),m?.onError?.(e)}})})}),c_.classes=Jg,c_.displayName=`@mantine/core/Avatar`,c_.Group=n_})),l_,gne=o((()=>{l_={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`}})),u_,d_,f_,_ne=o((()=>{u_=N(),p(),Jr(),ga(),no(),F(),Ys(),al(),ml(),gne(),d_=ha((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":Hr(a,`badge-height`),"--badge-padding-x":Hr(a,`badge-padding-x`),"--badge-fz":Hr(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:Wr(t),"--badge-bg":n||i?c.background:void 0,"--badge-color":n||i?c.color:void 0,"--badge-bd":n||i?c.border:void 0,"--badge-dot-color":i===`dot`?to(n,e):void 0}}}),f_=dl((e,t)=>{let n=P(`Badge`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,gradient:d,leftSection:f,rightSection:p,children:m,variant:h,fullWidth:g,autoContrast:_,circle:v,mod:y,attributes:b,...x}=n,S=Js({name:`Badge`,props:n,classes:l_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:d_});return(0,u_.jsxs)(il,{variant:h,mod:[{block:g,circle:v,"with-right-section":!!p,"with-left-section":!!f},y],...S(`root`,{variant:h}),ref:t,...x,children:[f&&(0,u_.jsx)(`span`,{...S(`section`),"data-position":`left`,children:f}),(0,u_.jsx)(`span`,{...S(`label`),children:m}),p&&(0,u_.jsx)(`span`,{...S(`section`),"data-position":`right`,children:p})]})}),f_.classes=l_,f_.displayName=`@mantine/core/Badge`})),p_,m_=o((()=>{p_={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`}})),h_,g_,__,v_,vne=o((()=>{h_=N(),ur(),p(),ga(),F(),Ys(),al(),ul(),m_(),g_={orientation:`horizontal`},__=ha((e,{borderWidth:t})=>({group:{"--button-border-width":M(t)}})),v_=sl((e,t)=>{let n=P(`ButtonGroup`,g_,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=P(`ButtonGroup`,g_,e);return(0,h_.jsx)(il,{...Js({name:`ButtonGroup`,props:n,classes:p_,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:__,rootSelector:`group`})(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})}),v_.classes=p_,v_.displayName=`@mantine/core/ButtonGroup`})),y_,b_,x_,yne=o((()=>{y_=N(),p(),Jr(),ga(),F(),Ys(),al(),ul(),m_(),b_=ha((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":Hr(o,`section-height`),"--section-padding-x":Hr(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?Gr(o.replace(`compact-`,``)):Gr(o),"--section-radius":t===void 0?void 0:Wr(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),x_=sl((e,t)=>{let n=P(`ButtonGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n;return(0,y_.jsx)(il,{...Js({name:`ButtonGroupSection`,props:n,classes:p_,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:b_,rootSelector:`groupSection`})(`groupSection`),ref:t,variant:l,...m})}),x_.classes=p_,x_.displayName=`@mantine/core/ButtonGroupSection`})),S_,C_,w_,T_,bne=o((()=>{S_=N(),ur(),p(),Jr(),ga(),F(),Ys(),al(),ml(),$h(),ph(),Lm(),m_(),vne(),yne(),C_={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${M(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},w_=ha((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":Hr(a,`button-height`),"--button-padding-x":Hr(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?Gr(a.replace(`compact-`,``)):Gr(a),"--button-radius":t===void 0?void 0:Wr(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),T_=dl((e,t)=>{let n=P(`Button`,null,e),{style:r,vars:i,className:a,color:o,disabled:s,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=n,T=Js({name:`Button`,props:n,classes:p_,className:a,style:r,classNames:_,styles:v,unstyled:y,attributes:C,vars:i,varsResolver:w_}),E=!!l,D=!!u;return(0,S_.jsxs)(Im,{ref:t,...T(`root`,{active:!s&&!m&&!b}),unstyled:y,variant:f,disabled:s||m,mod:[{disabled:s||b,loading:m,block:d,"with-left-section":E,"with-right-section":D},S],...w,children:[typeof m==`boolean`&&(0,S_.jsx)(dh,{mounted:m,transition:C_,duration:150,children:e=>(0,S_.jsx)(il,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,S_.jsx)(Qh,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,S_.jsxs)(`span`,{...T(`inner`),children:[l&&(0,S_.jsx)(il,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,S_.jsx)(il,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,S_.jsx)(il,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})}),T_.classes=p_,T_.displayName=`@mantine/core/Button`,T_.Group=v_,T_.GroupSection=x_})),E_,D_,O_=o((()=>{p(),xr(),N(),[E_,D_]=vr(`Card component was not found in tree`)})),k_,A_=o((()=>{k_={root:`m_e615b15f`,section:`m_599a2148`}})),j_,M_,xne=o((()=>{j_=N(),p(),F(),al(),ml(),O_(),A_(),M_=dl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,withBorder:s,inheritPadding:c,mod:l,...u}=P(`CardSection`,null,e),d=D_();return(0,j_.jsx)(il,{ref:t,mod:[{"with-border":s,"inherit-padding":c},l],...d.getStyles(`section`,{className:r,style:i,styles:a,classNames:n}),...u})}),M_.classes=k_,M_.displayName=`@mantine/core/CardSection`})),N_,P_,F_,I_,Sne=o((()=>{N_=N(),P_=u(p(),1),Jr(),ga(),F(),Ys(),ml(),Dee(),O_(),A_(),xne(),F_=ha((e,{padding:t})=>({root:{"--card-padding":Ur(t)}})),I_=dl((e,t)=>{let n=P(`Card`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,padding:u,attributes:d,...f}=n,p=Js({name:`Card`,props:n,classes:k_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:F_}),m=P_.Children.toArray(l),h=m.map((e,t)=>typeof e==`object`&&e&&`type`in e&&e.type===M_?(0,P_.cloneElement)(e,{"data-first-section":t===0||void 0,"data-last-section":t===m.length-1||void 0}):e);return(0,N_.jsx)(E_,{value:{getStyles:p},children:(0,N_.jsx)(Vm,{ref:t,unstyled:s,...p(`root`),...f,children:h})})}),I_.classes=k_,I_.displayName=`@mantine/core/Card`,I_.Section=M_})),L_,Cne=o((()=>{L_={root:`m_f59ffda3`,label:`m_be049a53`,"label--outline":`m_3904c1af`,"label--filled":`m_fa109255`,"label--light":`m_f7e165c3`,iconWrapper:`m_9ac86df9`,checkIcon:`m_d6d72580`,input:`m_bde07329`}})),R_,z_,B_=o((()=>{p(),N(),Tr(),[R_,z_]=Sr()}));function V_(e){let{value:t,defaultValue:n,onChange:r,multiple:i,children:a}=P(`ChipGroup`,null,e),[o,s]=Ji({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r});return(0,H_.jsx)(R_,{value:{isChipSelected:e=>Array.isArray(o)?o.includes(e):e===o,onChange:e=>{let t=e.currentTarget.value;s(Array.isArray(o)?o.includes(t)?o.filter(e=>e!==t):[...o,t]:t)},multiple:i},children:a})}var H_,wne=o((()=>{H_=N(),la(),p(),F(),B_(),V_.displayName=`@mantine/core/ChipGroup`})),U_,W_,G_,K_,Tne=o((()=>{U_=N(),la(),p(),Jr(),ga(),F(),Ys(),ac(),al(),ul(),qg(),Cne(),B_(),wne(),W_={type:`checkbox`},G_=ha((e,{size:t,radius:n,variant:r,color:i,autoContrast:a})=>{let o=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||`filled`,autoContrast:a});return{root:{"--chip-fz":Gr(t),"--chip-size":Hr(t,`chip-size`),"--chip-radius":n===void 0?void 0:Wr(n),"--chip-checked-padding":Hr(t,`chip-checked-padding`),"--chip-padding":Hr(t,`chip-padding`),"--chip-icon-size":Hr(t,`chip-icon-size`),"--chip-bg":i||r?o.background:void 0,"--chip-hover":i||r?o.hover:void 0,"--chip-color":i||r?o.color:void 0,"--chip-bd":i||r?o.border:void 0,"--chip-spacing":Hr(t,`chip-spacing`)}}}),K_=sl((e,t)=>{let n=P(`Chip`,W_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,id:l,checked:u,defaultChecked:d,onChange:f,value:p,wrapperProps:m,type:h,disabled:g,children:_,size:v,variant:y,icon:b,rootRef:x,autoContrast:S,mod:C,attributes:w,...T}=n,E=Js({name:`Chip`,classes:L_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:w,vars:c,varsResolver:G_}),D=z_(),O=Bi(l),{styleProps:ee,rest:k}=ic(T),[A,te]=Ji({value:u,defaultValue:d,finalValue:!1,onChange:f}),ne=D?{checked:D.isChipSelected(p),onChange:e=>{D.onChange(e),f?.(e.currentTarget.checked)},type:D.multiple?`checkbox`:`radio`}:{},re=ne.checked||A;return(0,U_.jsxs)(il,{size:v,variant:y,ref:x,mod:C,...E(`root`),...ee,...m,children:[(0,U_.jsx)(`input`,{type:h,...E(`input`),checked:re,onChange:e=>te(e.currentTarget.checked),id:O,disabled:g,ref:t,value:p,...ne,...k}),(0,U_.jsxs)(`label`,{htmlFor:O,"data-checked":re||void 0,"data-disabled":g||void 0,...E(`label`,{variant:y||`filled`}),children:[re&&b!==null&&b!==!1&&(0,U_.jsx)(`span`,{...E(`iconWrapper`),children:b===void 0?(0,U_.jsx)(Gg,{...E(`checkIcon`)}):b}),(0,U_.jsx)(`span`,{children:_})]})]})}),K_.classes=L_,K_.displayName=`@mantine/core/Chip`,K_.Group=V_})),q_,Ene=o((()=>{q_={root:`m_3eebeb36`,label:`m_9e365f20`}})),J_,Y_,X_,Z_,Dne=o((()=>{J_=N(),p(),Jr(),ga(),no(),F(),Ys(),al(),ul(),Ene(),Y_={orientation:`horizontal`},X_=ha((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?to(t,e):void 0,"--divider-border-style":n,"--divider-size":Hr(r,`divider-size`)}})),Z_=sl((e,t)=>{let n=P(`Divider`,Y_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,orientation:u,label:d,labelPosition:f,mod:p,attributes:m,...h}=n,g=Js({name:`Divider`,classes:q_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:X_});return(0,J_.jsx)(il,{ref:t,mod:[{orientation:u,"with-label":!!d},p],...g(`root`),...h,role:`separator`,children:d&&(0,J_.jsx)(il,{component:`span`,mod:{position:f},...g(`label`),children:d})})}),Z_.classes=q_,Z_.displayName=`@mantine/core/Divider`})),Q_,$_,ev,tv,One=o((()=>{Q_=N(),$_=u(p(),1),la(),F(),ev={multiple:!1},tv=(0,$_.forwardRef)((e,t)=>{let{onChange:n,children:r,multiple:i,accept:a,name:o,form:s,resetRef:c,disabled:l,capture:u,inputProps:d,...f}=P(`FileButton`,ev,e),p=(0,$_.useRef)(null),m=()=>{!l&&p.current?.click()};return Ui(c,()=>{p.current&&(p.current.value=``)}),(0,Q_.jsxs)(Q_.Fragment,{children:[(0,Q_.jsx)(`input`,{style:{display:`none`},type:`file`,accept:a,multiple:i,onChange:e=>{if(e.currentTarget.files===null)return n(i?[]:null);n(i?Array.from(e.currentTarget.files):e.currentTarget.files[0]||null)},ref:Gi(t,p),name:o,form:s,capture:u,...d}),r({onClick:m,...f})]})}),tv.displayName=`@mantine/core/FileButton`})),nv,rv,iv,av,ov,sv,kne=o((()=>{nv=N(),rv=u(p(),1),la(),_s(),F(),ul(),dte(),One(),qte(),Zte(),iv=({value:e})=>(0,nv.jsx)(`div`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Array.isArray(e)?e.map(e=>e.name).join(`, `):e?.name}),av={valueComponent:iv,size:`sm`},ov=sl((e,t)=>{let n=P(`FileInput`,av,e),{unstyled:r,vars:i,onChange:a,value:o,defaultValue:s,multiple:c,accept:l,name:u,form:d,valueComponent:f,clearable:p,clearButtonProps:m,readOnly:h,capture:g,fileInputProps:_,rightSection:v,size:y,placeholder:b,component:x,resetRef:S,classNames:C,styles:w,attributes:T,...E}=n,D=(0,rv.useRef)(null),{resolvedClassNames:O,resolvedStyles:ee}=gs({classNames:C,styles:w,props:n}),[k,A]=Ji({value:o,defaultValue:s,onChange:a,finalValue:c?[]:null}),te=Array.isArray(k)?k.length!==0:k!==null,ne=v||(p&&te&&!h?(0,nv.jsx)(dg,{...m,variant:`subtle`,onClick:()=>A(c?[]:null),size:y,unstyled:r}):null);return(0,rv.useEffect)(()=>{(Array.isArray(k)&&k.length===0||k===null)&&D.current?.()},[k]),(0,nv.jsx)(tv,{onChange:A,multiple:c,accept:l,name:u,form:d,resetRef:Gi(D,S),disabled:h,capture:g,inputProps:_,children:e=>(0,nv.jsx)(jg,{component:x||`button`,ref:t,rightSection:ne,...e,...E,__staticSelector:`FileInput`,multiline:!0,type:`button`,pointer:!0,__stylesApiProps:n,unstyled:r,size:y,classNames:C,styles:w,attributes:T,children:te?(0,nv.jsx)(f,{value:k}):(0,nv.jsx)(kg.Placeholder,{__staticSelector:`FileInput`,classNames:O,styles:ee,attributes:T,children:b})})})}),ov.classes=jg.classes,ov.displayName=`@mantine/core/FileInput`,sv=ov})),cv,Ane=o((()=>{cv={root:`m_6e45937b`,loader:`m_e8eb006c`,overlay:`m_df587f17`}})),lv,uv,dv,fv,jne=o((()=>{lv=N(),p(),Lr(),ga(),Mo(),F(),Ys(),al(),ul(),$h(),Xm(),ph(),Ane(),uv={transitionProps:{transition:`fade`,duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Fr(`overlay`)},dv=ha((e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}})),fv=sl((e,t)=>{let n=P(`LoadingOverlay`,uv,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,transitionProps:l,loaderProps:u,overlayProps:d,visible:f,zIndex:p,attributes:m,...h}=n,g=Eo(),_=Js({name:`LoadingOverlay`,classes:cv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:dv}),v={...uv.overlayProps,...d};return(0,lv.jsx)(dh,{transition:`fade`,...l,mounted:!!f,children:e=>(0,lv.jsxs)(il,{..._(`root`,{style:e}),ref:t,...h,children:[(0,lv.jsx)(Qh,{..._(`loader`),unstyled:s,...u}),(0,lv.jsx)(Ym,{...v,..._(`overlay`),darkHidden:!0,unstyled:s,color:d?.color||g.white}),(0,lv.jsx)(Ym,{...v,..._(`overlay`),lightHidden:!0,unstyled:s,color:d?.color||g.colors.dark[5]})]})})}),fv.classes=cv,fv.displayName=`@mantine/core/LoadingOverlay`})),pv,mv,hv=o((()=>{p(),xr(),N(),[pv,mv]=vr(`Menu component was not found in the tree`)})),gv,_v=o((()=>{gv={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,itemLabel:`m_5476e0d3`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`}})),vv,yv,Mne=o((()=>{vv=N(),p(),F(),al(),ul(),hv(),_v(),yv=sl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=P(`MenuDivider`,null,e);return(0,vv.jsx)(il,{ref:t,...mv().getStyles(`divider`,{className:r,style:i,styles:a,classNames:n}),...s})}),yv.classes=gv,yv.displayName=`@mantine/core/MenuDivider`})),bv,xv,Sv,Nne=o((()=>{bv=N(),xv=u(p(),1),la(),Xr(),F(),ul(),Ih(),hv(),_v(),Sv=sl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=P(`MenuDropdown`,null,e),f=(0,xv.useRef)(null),p=mv(),m=Yr(l,e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),h=Yr(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),g=Yr(c,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,bv.jsxs)(jh.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:Gi(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[p.withInitialFocusPlaceholder&&(0,bv.jsx)(`div`,{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})}),Sv.classes=gv,Sv.displayName=`@mantine/core/MenuDropdown`})),Cv,wv,Tv=o((()=>{p(),N(),Tr(),[Cv,wv]=Sr()})),Ev,Dv,Ov,Pne=o((()=>{Ev=N(),Dv=u(p(),1),la(),Pr(),Xr(),eo(),Mo(),F(),ml(),vl(),Lm(),hv(),_v(),Tv(),Ov=dl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,closeMenuOnClick:c,leftSection:l,rightSection:u,children:d,disabled:f,"data-disabled":p,...m}=P(`MenuItem`,null,e),h=mv(),g=wv(),_=Eo(),{dir:v}=hl(),y=(0,Dv.useRef)(null),b=m,x=Yr(b.onClick,()=>{p||(typeof c==`boolean`?c&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),S=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,C=s?$a({color:s,theme:_}):null,w=Yr(b.onKeyDown,e=>{e.key===`ArrowLeft`&&g&&(g.close(),g.focusParentItem())});return(0,Ev.jsxs)(Im,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:Gi(y,t),role:`menuitem`,disabled:f,"data-menu-item":!0,"data-disabled":f||p||void 0,"data-mantine-stop-propagation":!0,onClick:x,onKeyDown:Nr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:w}),__vars:{"--menu-item-color":C?.isThemeColor&&C?.shade===void 0?`var(--mantine-color-${C.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[l&&(0,Ev.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:l}),d&&(0,Ev.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:d}),u&&(0,Ev.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:u})]})}),Ov.classes=gv,Ov.displayName=`@mantine/core/MenuItem`})),kv,Av,Fne=o((()=>{kv=N(),p(),F(),al(),ul(),hv(),_v(),Av=sl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=P(`MenuLabel`,null,e);return(0,kv.jsx)(il,{ref:t,...mv().getStyles(`label`,{className:r,style:i,styles:a,classNames:n}),...s})}),Av.classes=gv,Av.displayName=`@mantine/core/MenuLabel`})),jv,Mv,Nv,Ine=o((()=>{jv=N(),Mv=u(p(),1),la(),Xr(),F(),ul(),Ih(),hv(),_v(),Tv(),Nv=sl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=P(`MenuSubDropdown`,null,e),f=(0,Mv.useRef)(null),p=mv(),m=wv(),h=Yr(s,m?.open),g=Yr(c,m?.close);return(0,jv.jsx)(jh.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:Gi(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:u})}),Nv.classes=gv,Nv.displayName=`@mantine/core/MenuSubDropdown`})),Pv,Fv,Iv,Lne=o((()=>{Pv=N(),Fv=u(p(),1),la(),Pr(),Xr(),eo(),Mo(),F(),ml(),vl(),nne(),Lm(),hv(),_v(),Tv(),Iv=dl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,leftSection:c,rightSection:l,children:u,disabled:d,"data-disabled":f,closeMenuOnClick:p,...m}=P(`MenuSubItem`,null,e),h=mv(),g=wv(),_=Eo(),{dir:v}=hl(),y=(0,Fv.useRef)(null),b=m,x=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,S=s?$a({color:s,theme:_}):null,C=Yr(b.onKeyDown,e=>{e.key===`ArrowRight`&&(g?.open(),g?.focusFirstItem()),e.key===`ArrowLeft`&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),w=Yr(b.onClick,()=>{!f&&p&&h.closeDropdownImmediately()}),T=Yr(b.onMouseEnter,g?.open),E=Yr(b.onMouseLeave,g?.close);return(0,Pv.jsxs)(Im,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:Gi(y,t),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:T,onMouseLeave:E,onClick:w,onKeyDown:Nr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:C}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:x?.color,"--menu-item-hover":x?.hover},children:[c&&(0,Pv.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:c}),u&&(0,Pv.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:u}),(0,Pv.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:l||(0,Pv.jsx)(Rg,{...h.getStyles(`chevron`),size:14})})]})}),Iv.classes=gv,Iv.displayName=`@mantine/core/MenuSubItem`}));function Lv({children:e,refProp:t}){if(!hr(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return mv(),(0,Rv.jsx)(jh.Target,{refProp:t,popupType:`menu`,children:e})}var Rv,Rne=o((()=>{Rv=N(),_r(),p(),Ih(),hv(),Lv.displayName=`@mantine/core/MenuSubTarget`}));function zv(e){let{children:t,closeDelay:n,openDelay:r,...i}=P(`MenuSub`,Vv,e),a=Bi(),[o,{open:s,close:c}]=na(!1),l=wv(),{openDropdown:u,closeDropdown:d}=Fg({open:s,close:c,closeDelay:n,openDelay:r});return(0,Bv.jsx)(Cv,{value:{opened:o,close:d,open:u,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-target`)?.focus()},16),parentContext:l},children:(0,Bv.jsx)(jh,{opened:o,withinPortal:!1,withArrow:!1,id:a,...i,children:t})})}var Bv,Vv,zne=o((()=>{Bv=N(),la(),p(),F(),Lg(),Ih(),Ine(),Lne(),Rne(),Tv(),Vv={offset:0,position:`right-start`,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}},zv.extend=e=>e,zv.displayName=`@mantine/core/MenuSub`,zv.Target=Lv,zv.Dropdown=Nv,zv.Item=Iv})),Hv,Uv,Wv,Gv,Bne=o((()=>{Hv=N(),Uv=u(p(),1),Xr(),ma(),F(),Ih(),hv(),Wv={refProp:`ref`},Gv=(0,Uv.forwardRef)((e,t)=>{let{children:n,refProp:r,...i}=P(`MenuTarget`,Wv,e),a=fa(n);if(!a)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=mv(),s=a.props,c=Yr(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=Yr(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=Yr(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,Hv.jsx)(jh.Target,{refProp:r,popupType:`menu`,ref:t,...i,children:(0,Uv.cloneElement)(a,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})}),Gv.displayName=`@mantine/core/MenuTarget`}));function Kv(e){let t=P(`Menu`,Yv,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,...w}=t,T=Js({name:`Menu`,classes:gv,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[E,D]=Ji({value:a,defaultValue:o,finalValue:!1,onChange:c}),[O,ee]=(0,Jv.useState)(!1),k=()=>{D(!1),ee(!1),E&&i?.()},A=()=>{D(!0),!E&&r?.()},te=()=>{E?k():A()},{openDropdown:ne,closeDropdown:re}=Fg({open:A,close:k,closeDelay:m,openDelay:p}),ie=e=>Zr(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:j,resolvedStyles:ae}=gs({classNames:h,styles:g,props:t});return(0,qv.jsx)(pv,{value:{getStyles:T,opened:E,toggleDropdown:te,getItemIndex:ie,openedViaClick:O,setOpenedViaClick:ee,closeOnItemClick:l,closeDropdown:f===`click`?k:re,openDropdown:f===`click`?A:ne,closeDropdownImmediately:k,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S},children:(0,qv.jsx)(jh,{returnFocus:!0,...w,opened:E,onChange:te,defaultOpened:o,trapFocus:x?!1:s,closeOnEscape:d,__staticSelector:`Menu`,classNames:j,styles:ae,unstyled:_,variant:v,keepMounted:x,children:n})})}var qv,Jv,Yv,Vne=o((()=>{qv=N(),Jv=u(p(),1),la(),Qr(),_s(),Ys(),F(),ul(),Lg(),Ih(),hv(),_v(),Mne(),Nne(),Pne(),Fne(),zne(),Bne(),Yv={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1},Kv.extend=e=>e,Kv.withProps=cee(Kv),Kv.classes=gv,Kv.displayName=`@mantine/core/Menu`,Kv.Item=Ov,Kv.Label=Av,Kv.Dropdown=Sv,Kv.Target=Gv,Kv.Divider=yv,Kv.Sub=zv}));function Xv(e,t){return{...Zv,...t,...e}}var Zv,Hne=o((()=>{Zv={duration:100,transition:`fade`}})),Qv,$v=o((()=>{Qv={tooltip:`m_1b3c8819`,arrow:`m_f898399f`}}));function Une({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,ey.useState)(n),a=(0,ey.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Rp({placement:t,middleware:[rp({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,ey.useCallback)(({clientX:e,clientY:t})=>{l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,ey.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Rl(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var ey,Wne=o((()=>{ey=u(p(),1),Pm()})),ty,ny,ry,iy,ay,Gne=o((()=>{ty=N(),ny=u(p(),1),la(),Lr(),Jr(),da(),ma(),ga(),no(),Mo(),F(),Ys(),Gc(),al(),ul(),ah(),$v(),Wne(),ry={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:Fr(`popover`)},iy=ha((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Wr(t),"--tooltip-bg":n?to(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),ay=sl((e,t)=>{let n=P(`TooltipFloating`,ry,e),{children:r,refProp:i,withinPortal:a,style:o,className:s,classNames:c,styles:l,unstyled:u,radius:d,color:f,label:p,offset:m,position:h,multiline:g,zIndex:_,disabled:v,defaultOpened:y,variant:b,vars:x,portalProps:S,attributes:C,...w}=n,T=Eo(),E=Js({name:`TooltipFloating`,props:n,classes:Qv,className:s,style:o,classNames:c,styles:l,unstyled:u,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:iy}),{handleMouseMove:D,x:O,y:ee,opened:k,boundaryRef:A,floating:te,setOpened:ne}=Une({offset:m,position:h,defaultOpened:y}),re=fa(r);if(!re)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let ie=Gi(A,ua(re),t),j=re.props,ae=e=>{j.onMouseEnter?.(e),D(e),ne(!0)},oe=e=>{j.onMouseLeave?.(e),ne(!1)};return(0,ty.jsxs)(ty.Fragment,{children:[(0,ty.jsx)(ih,{...S,withinPortal:a,children:(0,ty.jsx)(il,{...w,...E(`tooltip`,{style:{...Wc(o,T),zIndex:_,display:!v&&k?`block`:`none`,top:(ee&&Math.round(ee))??``,left:(O&&Math.round(O))??``}}),variant:b,ref:te,mod:{multiline:g},children:p})}),(0,ny.cloneElement)(re,{...j,[i]:ie,onMouseEnter:ae,onMouseLeave:oe})]})}),ay.classes=Qv,ay.displayName=`@mantine/core/TooltipFloating`})),oy,sy,cy,ly,uy=o((()=>{oy=u(p(),1),sy=(0,oy.createContext)(!1),cy=sy.Provider,ly=()=>(0,oy.useContext)(sy)}));function dy(e){let{openDelay:t,closeDelay:n,children:r}=P(`TooltipGroup`,py,e);return(0,fy.jsx)(cy,{value:!0,children:(0,fy.jsx)(bp,{delay:{open:t,close:n},children:r})})}var fy,py,Kne=o((()=>{fy=N(),Pm(),p(),F(),uy(),py={openDelay:0,closeDelay:0},dy.displayName=`@mantine/core/TooltipGroup`,dy.extend=e=>e}));function qne(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Jne(e){let t=qne(e.middlewares),n=[np(e.offset)];return t.shift&&n.push(rp(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?ap():ap(t.flip)),n.push(up({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?lp():lp(t.inline)):e.inline&&n.push(lp()),n}function Yne(e){let[t,n]=(0,my.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=ly(),a=Bi(),o=(0,my.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=Rp({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:Jne(e),whileElementsMounted:Af}),{delay:m,currentId:h,setCurrentId:g}=xp(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Hp([yp(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),Bp(l,{enabled:e.events?.focus,visibleOnly:!0}),Up(l,{role:`tooltip`}),Lp(l,{enabled:e.opened===void 0})]);gi(()=>{e.onPositionChange?.(d)},[d]);let y=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:y,opened:r,placement:d}}var my,Xne=o((()=>{my=u(p(),1),Pm(),la(),uy()})),hy,gy,_y,vy,yy,Zne=o((()=>{hy=N(),gy=u(p(),1),ya(),la(),Lr(),Jr(),da(),ma(),ga(),F(),Ys(),al(),ul(),vl(),Fee(),Wm(),ah(),ph(),Hne(),$v(),Gne(),Kne(),Xne(),_y={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:Fr(`popover`),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},vy=ha((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:Wr(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),yy=sl((e,t)=>{let n=P(`Tooltip`,_y,e),{children:r,position:i,refProp:a,label:o,openDelay:s,closeDelay:c,onPositionChange:l,opened:u,defaultOpened:d,withinPortal:f,radius:p,color:m,classNames:h,styles:g,unstyled:_,style:v,className:y,withArrow:b,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,offset:T,transitionProps:E,multiline:D,events:O,zIndex:ee,disabled:k,positionDependencies:A,onClick:te,onMouseEnter:ne,onMouseLeave:re,inline:ie,variant:j,keepMounted:ae,vars:oe,portalProps:se,mod:ce,floatingStrategy:le,middlewares:ue,autoContrast:de,attributes:fe,target:pe,...me}=P(`Tooltip`,_y,n),{dir:he}=hl(),ge=(0,gy.useRef)(null),_e=Yne({position:Um(he,i),closeDelay:c,openDelay:s,onPositionChange:l,opened:u,defaultOpened:d,events:O,arrowRef:ge,arrowOffset:S,offset:typeof T==`number`?T+(b?x/2:0):T,positionDependencies:[...A,pe??r],inline:ie,strategy:le,middlewares:ue});(0,gy.useEffect)(()=>{let e=pe instanceof HTMLElement?pe:typeof pe==`string`?document.querySelector(pe):pe?.current||null;e&&_e.reference(e)},[pe,_e]);let ve=Js({name:`Tooltip`,props:n,classes:Qv,className:y,style:v,classNames:h,styles:g,unstyled:_,attributes:fe,rootSelector:`tooltip`,vars:oe,varsResolver:vy}),ye=fa(r);if(!pe&&!ye)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);if(pe){let e=Xv(E,{duration:100,transition:`fade`});return(0,hy.jsx)(hy.Fragment,{children:(0,hy.jsx)(ih,{...se,withinPortal:f,children:(0,hy.jsx)(dh,{...e,keepMounted:ae,mounted:!k&&!!_e.opened,duration:_e.isGroupPhase?10:e.duration,children:e=>(0,hy.jsxs)(il,{...me,"data-fixed":le===`fixed`||void 0,variant:j,mod:[{multiline:D},ce],..._e.getFloatingProps({ref:_e.floating,className:ve(`tooltip`).className,style:{...ve(`tooltip`).style,...e,zIndex:ee,top:_e.y??0,left:_e.x??0}}),children:[o,(0,hy.jsx)(Hm,{ref:ge,arrowX:_e.arrowX,arrowY:_e.arrowY,visible:b,position:_e.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...ve(`arrow`)})]})})})})}let be=ye.props,xe=Gi(_e.reference,ua(ye),t),Se=Xv(E,{duration:100,transition:`fade`});return(0,hy.jsxs)(hy.Fragment,{children:[(0,hy.jsx)(ih,{...se,withinPortal:f,children:(0,hy.jsx)(dh,{...Se,keepMounted:ae,mounted:!k&&!!_e.opened,duration:_e.isGroupPhase?10:Se.duration,children:e=>(0,hy.jsxs)(il,{...me,"data-fixed":le===`fixed`||void 0,variant:j,mod:[{multiline:D},ce],..._e.getFloatingProps({ref:_e.floating,className:ve(`tooltip`).className,style:{...ve(`tooltip`).style,...e,zIndex:ee,top:_e.y??0,left:_e.x??0}}),children:[o,(0,hy.jsx)(Hm,{ref:ge,arrowX:_e.arrowX,arrowY:_e.arrowY,visible:b,position:_e.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...ve(`arrow`)})]})})}),(0,gy.cloneElement)(ye,_e.getReferenceProps({onClick:te,onMouseEnter:ne,onMouseLeave:re,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...be,className:va(y,be.className),[a]:xe}))]})}),yy.classes=Qv,yy.displayName=`@mantine/core/Tooltip`,yy.Floating=ay,yy.Group=dy})),by,Qne=o((()=>{by={root:`m_18320242`,"skeleton-fade":`m_299c329c`}})),xy,Sy,Cy,wy,$ne=o((()=>{xy=N(),ur(),p(),Jr(),ga(),F(),Ys(),al(),ul(),Qne(),Sy={visible:!0,animate:!0},Cy=ha((e,{width:t,height:n,radius:r,circle:i})=>({root:{"--skeleton-height":M(n),"--skeleton-width":M(i?n:t),"--skeleton-radius":i?`1000px`:r===void 0?void 0:Wr(r)}})),wy=sl((e,t)=>{let n=P(`Skeleton`,Sy,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,width:l,height:u,circle:d,visible:f,radius:p,animate:m,mod:h,attributes:g,..._}=n;return(0,xy.jsx)(il,{ref:t,...Js({name:`Skeleton`,classes:by,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:Cy})(`root`),mod:[{visible:f,animate:m},h],..._})}),wy.classes=by,wy.displayName=`@mantine/core/Skeleton`})),Ty,ere=o((()=>{Ty={root:`m_6d731127`}})),tre,nre,rre,Ey,ire=o((()=>{tre=N(),p(),Jr(),ga(),F(),Ys(),al(),ul(),ere(),nre={gap:`md`,align:`stretch`,justify:`flex-start`},rre=ha((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Ur(t),"--stack-align":n,"--stack-justify":r}})),Ey=sl((e,t)=>{let n=P(`Stack`,nre,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=n;return(0,tre.jsx)(il,{ref:t,...Js({name:`Stack`,props:n,classes:Ty,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:rre})(`root`),variant:f,...m})}),Ey.classes=Ty,Ey.displayName=`@mantine/core/Stack`})),are,Dy,Oy=o((()=>{p(),xr(),N(),[are,Dy]=vr(`Tabs component was not found in the tree`)})),ky,Ay=o((()=>{ky={root:`m_89d60db1`,"list--default":`m_576c9d4`,list:`m_89d33d6d`,tab:`m_4ec4dce6`,panel:`m_b0c91715`,tabSection:`m_fc420b1f`,tabLabel:`m_42bbd1ae`,"tab--default":`m_539e827b`,"list--outline":`m_6772fbd5`,"tab--outline":`m_b59ab47c`,"tab--pills":`m_c3381914`}})),ore,jy,sre=o((()=>{ore=N(),p(),F(),al(),ul(),Oy(),Ay(),jy=sl((e,t)=>{let n=P(`TabsList`,null,e),{children:r,className:i,grow:a,justify:o,classNames:s,styles:c,style:l,mod:u,...d}=n,f=Dy();return(0,ore.jsx)(il,{...d,...f.getStyles(`list`,{className:i,style:l,classNames:s,styles:c,props:n,variant:f.variant}),ref:t,role:`tablist`,variant:f.variant,mod:[{grow:a,orientation:f.orientation,placement:f.orientation===`vertical`&&f.placement,inverted:f.inverted},u],"aria-orientation":f.orientation,__vars:{"--tabs-justify":o},children:r})}),jy.classes=ky,jy.displayName=`@mantine/core/TabsList`})),cre,My,lre=o((()=>{cre=N(),p(),F(),al(),ul(),Oy(),Ay(),My=sl((e,t)=>{let n=P(`TabsPanel`,null,e),{children:r,className:i,value:a,classNames:o,styles:s,style:c,mod:l,keepMounted:u,...d}=n,f=Dy(),p=f.value===a,m=f.keepMounted||u||p?r:null;return(0,cre.jsx)(il,{...f.getStyles(`panel`,{className:i,classNames:o,styles:s,style:[c,p?void 0:{display:`none`}],props:n}),ref:t,mod:[{orientation:f.orientation},l],role:`tabpanel`,id:f.getPanelId(a),"aria-labelledby":f.getTabId(a),...d,children:m})}),My.classes=ky,My.displayName=`@mantine/core/TabsPanel`})),Ny,Py,ure=o((()=>{Ny=N(),p(),Pr(),no(),Mo(),F(),ul(),vl(),Lm(),Oy(),Ay(),Py=sl((e,t)=>{let n=P(`TabsTab`,null,e),{className:r,children:i,rightSection:a,leftSection:o,value:s,onClick:c,onKeyDown:l,disabled:u,color:d,style:f,classNames:p,styles:m,vars:h,mod:g,tabIndex:_,...v}=n,y=Eo(),{dir:b}=hl(),x=Dy(),S=s===x.value,C=e=>{x.onChange(x.allowTabDeactivation&&s===x.value?null:s),c?.(e)},w={classNames:p,styles:m,props:n};return(0,Ny.jsxs)(Im,{...x.getStyles(`tab`,{className:r,style:f,variant:x.variant,...w}),disabled:u,unstyled:x.unstyled,variant:x.variant,mod:[{active:S,disabled:u,orientation:x.orientation,inverted:x.inverted,placement:x.orientation===`vertical`&&x.placement},g],ref:t,role:`tab`,id:x.getTabId(s),"aria-selected":S,tabIndex:_===void 0?S||x.value===null?0:-1:_,"aria-controls":x.getPanelId(s),onClick:C,__vars:{"--tabs-color":d?to(d,y):void 0},onKeyDown:Nr({siblingSelector:`[role="tab"]`,parentSelector:`[role="tablist"]`,activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||`horizontal`,dir:b,onKeyDown:l}),...v,children:[o&&(0,Ny.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`left`,children:o}),i&&(0,Ny.jsx)(`span`,{...x.getStyles(`tabLabel`,w),children:i}),a&&(0,Ny.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`right`,children:a})]})}),Py.classes=ky,Py.displayName=`@mantine/core/TabsTab`})),Fy,Iy,dre,fre,Ly,pre=o((()=>{Fy=N(),la(),p(),Dr(),Jr(),ga(),no(),Ho(),see(),F(),Ys(),al(),ul(),Oy(),Ay(),sre(),lre(),ure(),Iy=`Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value`,dre={keepMounted:!0,orientation:`horizontal`,loop:!0,activateTabWithKeyboard:!0,variant:`default`,placement:`left`},fre=ha((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Wr(t),"--tabs-color":to(n,e),"--tabs-text-color":Xs(r,e)?Bo({color:n,theme:e,autoContrast:r}):void 0}})),Ly=sl((e,t)=>{let n=P(`Tabs`,dre,e),{defaultValue:r,value:i,onChange:a,orientation:o,children:s,loop:c,id:l,activateTabWithKeyboard:u,allowTabDeactivation:d,variant:f,color:p,radius:m,inverted:h,placement:g,keepMounted:_,classNames:v,styles:y,unstyled:b,className:x,style:S,vars:C,autoContrast:w,mod:T,attributes:E,...D}=n,O=Bi(l),[ee,k]=Ji({value:i,defaultValue:r,finalValue:null,onChange:a}),A=Js({name:`Tabs`,props:n,classes:ky,className:x,style:S,classNames:v,styles:y,unstyled:b,attributes:E,vars:C,varsResolver:fre});return(0,Fy.jsx)(are,{value:{placement:g,value:ee,orientation:o,id:O,loop:c,activateTabWithKeyboard:u,getTabId:Er(`${O}-tab`,Iy),getPanelId:Er(`${O}-panel`,Iy),onChange:k,allowTabDeactivation:d,variant:f,color:p,radius:m,inverted:h,keepMounted:_,unstyled:b,getStyles:A},children:(0,Fy.jsx)(il,{ref:t,id:O,variant:f,mod:[{orientation:o,inverted:o===`horizontal`&&h,placement:o===`vertical`&&g},T],...A(`root`),...D,children:s})})}),Ly.classes=ky,Ly.displayName=`@mantine/core/Tabs`,Ly.Tab=Py,Ly.Panel=My,Ly.List=jy})),mre,Ry,hre=o((()=>{mre=N(),p(),F(),ul(),Zte(),Ry=sl((e,t)=>(0,mre.jsx)(jg,{component:`input`,ref:t,...P(`TextInput`,null,e),__staticSelector:`TextInput`})),Ry.classes=jg.classes,Ry.displayName=`@mantine/core/TextInput`})),gre=o((()=>{hs(),La(),Ih(),Th(),kh(),ate(),yte(),$h(),tne(),hne(),_ne(),bne(),Sne(),qg(),Tne(),Dne(),kne(),jne(),Vne(),$ne(),ire(),pre(),ane(),hre(),Zne()})),_re=o((()=>{}));async function vre(){let e=await fetch(`${By}/config`);if(!e.ok)throw Error(`Failed to load config`);return e.json()}async function yre(){let e=await fetch(`${By}/tree`);if(!e.ok)throw Error(`Failed to load tree`);return e.json()}async function bre(e){let t=await fetch(`${By}/doc/${e}`);if(!t.ok)throw Error(`Failed to load document`);return t.json()}async function zy(e,t){let n=await fetch(`${By}/doc/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t})});if(!n.ok)throw Error(`Failed to save document`);return n.json()}async function xre(e){let t=await fetch(`${By}/doc/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete document`);return t.json()}async function Sre(e){let t=await fetch(`${By}/folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})});if(!t.ok)throw Error(`Failed to create folder`);return t.json()}async function Cre(e){let t=await fetch(`${By}/folder/${e}`);if(!t.ok)throw Error(`Failed to load folder`);return t.json()}async function wre(e,t){return zy(e,t)}async function Tre(e){let t=new FormData;t.append(`image`,e);let n=await fetch(`${By}/upload`,{method:`POST`,body:t});if(!n.ok)throw Error(`Upload failed`);return n.json()}async function Ere(e){let t=await fetch(`${By}/search?q=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Search failed`);return t.json()}var By,Vy=o((()=>{By=`/api`})),Dre,Hy,Ore=o((()=>{Dre=u(p(),1),Hy=(0,Dre.createContext)({})}));function kre(e){let t=(0,Are.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Are,jre=o((()=>{Are=u(p(),1)})),Mre,Nre=o((()=>{Mre=typeof window<`u`})),Uy,Wy,Pre=o((()=>{Uy=u(p(),1),Nre(),Wy=Mre?Uy.useLayoutEffect:Uy.useEffect})),Fre,Gy,Ky=o((()=>{Fre=u(p(),1),Gy=(0,Fre.createContext)(null)}));function qy(e,t){e.indexOf(t)===-1&&e.push(t)}function Jy(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Ire=o((()=>{})),Yy,Lre=o((()=>{Yy=(e,t,n)=>n>t?t:n<e?e:n})),Xy,Zy,Rre=o((()=>{Xy=()=>{},Zy=()=>{}})),Qy,zre=o((()=>{Qy={}})),$y,Bre=o((()=>{$y=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)}));function Vre(e){return typeof e==`object`&&!!e}var Hre=o((()=>{})),eb,Ure=o((()=>{eb=e=>/^0[^.\s]+$/u.test(e)}));function Wre(e){let t;return()=>(t===void 0&&(t=e()),t)}var Gre=o((()=>{})),tb,nb=o((()=>{tb=e=>e})),Kre,rb,qre=o((()=>{Kre=(e,t)=>n=>t(e(n)),rb=(...e)=>e.reduce(Kre)})),ib,Jre=o((()=>{ib=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r}})),ab,Yre=o((()=>{Ire(),ab=class{constructor(){this.subscriptions=[]}add(e){return qy(this.subscriptions,e),()=>Jy(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}})),ob,sb,Xre=o((()=>{ob=e=>e*1e3,sb=e=>e/1e3}));function Zre(e,t){return t?1e3/t*e:0}var Qre=o((()=>{}));function $re(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=lb(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>eie&&++s<tie);return o}function cb(e,t,n,r){if(e===t&&n===r)return tb;let i=t=>$re(t,0,1,e,n);return e=>e===0||e===1?e:lb(i(e),t,r)}var lb,eie,tie,ub=o((()=>{nb(),lb=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,eie=1e-7,tie=12})),db,nie=o((()=>{db=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2})),fb,rie=o((()=>{fb=e=>t=>1-e(1-t)})),pb,mb,hb,gb=o((()=>{ub(),nie(),rie(),pb=cb(.33,1.53,.69,.99),mb=fb(pb),hb=db(mb)})),_b,iie=o((()=>{gb(),_b=e=>e>=1?1:(e*=2)<1?.5*mb(e):.5*(2-2**(-10*(e-1)))})),vb,yb,bb,aie=o((()=>{nie(),rie(),vb=e=>1-Math.sin(Math.acos(e)),yb=fb(vb),bb=db(vb)})),oie,sie,xb,cie=o((()=>{ub(),oie=cb(.42,0,1,1),sie=cb(0,0,.58,1),xb=cb(.42,0,.58,1)})),lie,uie=o((()=>{lie=e=>Array.isArray(e)&&typeof e[0]!=`number`})),Sb,die=o((()=>{Sb=e=>Array.isArray(e)&&typeof e[0]==`number`})),Cb,fie,wb,pie=o((()=>{Rre(),nb(),iie(),gb(),aie(),ub(),cie(),die(),Cb={linear:tb,easeIn:oie,easeInOut:xb,easeOut:sie,circIn:vb,circInOut:bb,circOut:yb,backIn:mb,backInOut:hb,backOut:pb,anticipate:_b},fie=e=>typeof e==`string`,wb=e=>{if(Sb(e)){Zy(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return cb(t,n,r,i)}else if(fie(e))return Zy(Cb[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),Cb[e];return e}})),Tb=o((()=>{Ire(),Lre(),Rre(),zre(),Bre(),Hre(),Ure(),Gre(),nb(),qre(),Jre(),Yre(),Xre(),Qre(),iie(),gb(),aie(),cie(),die(),uie(),pie()})),Eb,mie=o((()=>{Eb=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`]})),Db,Ob=o((()=>{Db={value:null,addProjectionMetrics:null}}));function hie(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&Db.value&&Db.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var gie=o((()=>{Ob()}));function _ie(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Eb.reduce((e,n)=>(e[n]=hie(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Qy.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,vie),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Eb.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Eb.length;t++)o[Eb[t]].cancel(e)},state:i,steps:o}}var vie,yie=o((()=>{Tb(),mie(),gie(),vie=40})),kb,Ab,jb,Mb,Nb=o((()=>{Tb(),yie(),{schedule:kb,cancel:Ab,state:jb,steps:Mb}=_ie(typeof requestAnimationFrame<`u`?requestAnimationFrame:tb,!0)}));function bie(){Pb=void 0}var Pb,Fb,Ib=o((()=>{Tb(),Nb(),Fb={now:()=>(Pb===void 0&&Fb.set(jb.isProcessing||Qy.useManualTiming?jb.timestamp:performance.now()),Pb),set:e=>{Pb=e,queueMicrotask(bie)}}})),Lb,Rb=o((()=>{Lb={layout:0,mainThread:0,waapi:0}}));function xie(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var zb,Bb,Sie,Vb,Cie,Hb=o((()=>{zb=e=>t=>typeof t==`string`&&t.startsWith(e),Bb=zb(`--`),Sie=zb(`var(--`),Vb=e=>Sie(e)?Cie.test(e.split(`/*`)[0].trim()):!1,Cie=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu})),Ub,Wb,Gb,Kb=o((()=>{Tb(),Ub={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Wb={...Ub,transform:e=>Yy(0,1,e)},Gb={...Ub,default:1}})),qb,Jb=o((()=>{qb=e=>Math.round(e*1e5)/1e5})),Yb,Xb=o((()=>{Yb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu}));function wie(e){return e==null}var Tie=o((()=>{})),Eie,Die=o((()=>{Eie=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu})),Zb,Qb,$b=o((()=>{Xb(),Tie(),Die(),Zb=(e,t)=>n=>!!(typeof n==`string`&&Eie.test(n)&&n.startsWith(e)||t&&!wie(n)&&Object.prototype.hasOwnProperty.call(n,t)),Qb=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Yb);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}}})),Oie,ex,tx,nx=o((()=>{Tb(),Kb(),Jb(),$b(),Oie=e=>Yy(0,255,e),ex={...Ub,transform:e=>Math.round(Oie(e))},tx={test:Zb(`rgb`,`red`),parse:Qb(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ex.transform(e)+`, `+ex.transform(t)+`, `+ex.transform(n)+`, `+qb(Wb.transform(r))+`)`}}));function kie(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var rx,Aie=o((()=>{nx(),$b(),rx={test:Zb(`#`),parse:kie,transform:tx.transform}})),ix,ax,ox,L,jie,sx,cx,lx=o((()=>{ix=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ax=ix(`deg`),ox=ix(`%`),L=ix(`px`),jie=ix(`vh`),sx=ix(`vw`),cx={...ox,parse:e=>ox.parse(e)/100,transform:e=>ox.transform(e*100)}})),ux,dx=o((()=>{Kb(),lx(),Jb(),$b(),ux={test:Zb(`hsl`,`hue`),parse:Qb(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+ox.transform(qb(t))+`, `+ox.transform(qb(n))+`, `+qb(Wb.transform(r))+`)`}})),fx,px=o((()=>{Aie(),dx(),nx(),fx={test:e=>tx.test(e)||rx.test(e)||ux.test(e),parse:e=>tx.test(e)?tx.parse(e):ux.test(e)?ux.parse(e):rx.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?tx.transform(e):ux.transform(e),getAnimatableNone:e=>{let t=fx.parse(e);return t.alpha=0,fx.transform(t)}}})),mx,Mie=o((()=>{mx=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu}));function Nie(e){return isNaN(e)&&typeof e==`string`&&(e.match(Yb)?.length||0)+(e.match(mx)?.length||0)>0}function hx(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Sx,e=>(fx.test(e)?(r.color.push(a),i.push(vx),n.push(fx.parse(e))):e.startsWith(bx)?(r.var.push(a),i.push(yx),n.push(e)):(r.number.push(a),i.push(_x),n.push(parseFloat(e))),++a,xx)).split(xx),indexes:r,types:i}}function Pie(e){return hx(e).values}function gx({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===_x?i+=qb(r[a]):e===vx?i+=fx.transform(r[a]):i+=r[a]}return i}}function Fie(e){return gx(hx(e))}function Iie(e){let t=hx(e);return gx(t)(t.values.map((e,n)=>wx(e,t.split[n])))}var _x,vx,yx,bx,xx,Sx,Cx,wx,Tx,Ex=o((()=>{px(),Mie(),Xb(),Jb(),_x=`number`,vx=`color`,yx=`var`,bx=`var(`,xx="${}",Sx=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu,Cx=e=>typeof e==`number`?0:fx.test(e)?fx.getAnimatableNone(e):e,wx=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Cx(e),Tx={test:Nie,parse:Pie,createTransformer:Fie,getAnimatableNone:Iie}}));function Dx(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Lie({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Dx(s,r,e+1/3),a=Dx(s,r,e),o=Dx(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}var Rie=o((()=>{}));function Ox(e,t){return n=>n>0?t:e}var kx=o((()=>{})),Ax,jx=o((()=>{Ax=(e,t,n)=>e+(t-e)*n}));function Mx(e){let t=Fx(e);if(Xy(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,`color-not-animatable`),!t)return!1;let n=t.parse(e);return t===ux&&(n=Lie(n)),n}var Nx,Px,Fx,Ix,zie=o((()=>{Tb(),Aie(),dx(),Rie(),nx(),kx(),jx(),Nx=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Px=[rx,tx,ux],Fx=e=>Px.find(t=>t.test(e)),Ix=(e,t)=>{let n=Mx(e),r=Mx(t);if(!n||!r)return Ox(e,t);let i={...n};return e=>(i.red=Nx(n.red,r.red,e),i.green=Nx(n.green,r.green,e),i.blue=Nx(n.blue,r.blue,e),i.alpha=Ax(n.alpha,r.alpha,e),tx.transform(i))}}));function Bie(e,t){return Lx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}var Lx,Vie=o((()=>{Lx=new Set([`none`,`hidden`])}));function Hie(e,t){return n=>Ax(e,t,n)}function Rx(e){return typeof e==`number`?Hie:typeof e==`string`?Vb(e)?Ox:fx.test(e)?Ix:Bx:Array.isArray(e)?zx:typeof e==`object`?fx.test(e)?Ix:Uie:Ox}function zx(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Rx(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Uie(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Rx(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Wie(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Bx,Gie=o((()=>{Tb(),Hb(),px(),Ex(),zie(),kx(),jx(),Vie(),Bx=(e,t)=>{let n=Tx.createTransformer(t),r=hx(e),i=hx(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Lx.has(e)&&!i.values.length||Lx.has(t)&&!r.values.length?Bie(e,t):rb(zx(Wie(r,i),i.values),n):(Xy(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,`complex-values-different`),Ox(e,t))}}));function Vx(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Ax(e,t,n):Rx(e)(e,t)}var Hx=o((()=>{Gie(),jx()})),Ux,Kie=o((()=>{Ib(),Nb(),Ux=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>kb.update(t,e),stop:()=>Ab(t),now:()=>jb.isProcessing?jb.timestamp:Fb.now()}}})),Wx,Gx=o((()=>{Wx=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`}}));function Kx(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}var qx,Jx=o((()=>{qx=2e4}));function qie(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Kx(r),qx);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:sb(i)}}var Jie=o((()=>{Tb(),Jx()}));function Yx(e,t){return e*Math.sqrt(1-t*t)}function Yie(e,t,n){let r=n;for(let n=1;n<$x;n++)r-=e(r)/t(r);return r}function Xie({duration:e=Qx.duration,bounce:t=Qx.bounce,velocity:n=Qx.velocity,mass:r=Qx.mass}){let i,a;Xy(e<=ob(Qx.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=Yy(Qx.minDamping,Qx.maxDamping,o),e=Yy(Qx.minDuration,Qx.maxDuration,sb(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Yx(t,o),c=Math.exp(-i);return eS-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Yx(t**2,o);return(-i(t)+eS>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-eS+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Yie(i,a,s);if(e=ob(e),isNaN(c))return{stiffness:Qx.stiffness,damping:Qx.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}function Xx(e,t){return t.some(t=>e[t]!==void 0)}function Zie(e){let t={velocity:Qx.velocity,stiffness:Qx.stiffness,damping:Qx.damping,mass:Qx.mass,isResolvedFromDuration:!1,...e};if(!Xx(e,nS)&&Xx(e,tS))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Yy(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Qx.mass,stiffness:i,damping:a}}else{let n=Xie({...e,velocity:0});t={...t,...n,mass:Qx.mass},t.isResolvedFromDuration=!0}return t}function Zx(e=Qx.visualDuration,t=Qx.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Zie({...n,velocity:-sb(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=sb(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Qx.restSpeed.granular:Qx.restSpeed.default,i||=v?Qx.restDelta.granular:Qx.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Yx(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>ob(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=ob(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=ob(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Kx(T),qx),t=Wx(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}var Qx,$x,eS,tS,nS,rS=o((()=>{Tb(),Gx(),Jx(),Jie(),Qx={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},$x=12,eS=.001,tS=[`duration`,`bounce`],nS=[`stiffness`,`damping`,`mass`],Zx.applyToOptions=e=>{let t=qie(e,100,Zx);return e.ease=t.ease,e.duration=ob(t.duration),e.type=`keyframes`,e}}));function iS(e,t,n){let r=Math.max(t-aS,0);return Zre(n-e(r),t-r)}var aS,oS=o((()=>{Tb(),aS=5}));function sS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Zx({keyframes:[f.value,m(f.value)],velocity:iS(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}var cS=o((()=>{rS(),oS()}));function Qie(e,t,n){let r=[],i=n||Qy.mix||Vx,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=rb(Array.isArray(t)?t[n]||tb:t,a)),r.push(a)}return r}function $ie(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(Zy(a===t.length,`Both input and output ranges must be the same length`,`range-length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Qie(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ib(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Yy(e[0],e[a-1],t)):l}var eae=o((()=>{Tb(),Hx()}));function tae(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ib(0,t,r);e.push(Ax(n,1,i))}}var nae=o((()=>{Tb(),jx()}));function rae(e){let t=[0];return tae(t,e.length-1),t}var iae=o((()=>{nae()}));function aae(e,t){return e.map(e=>e*t)}var oae=o((()=>{}));function sae(e,t){return e.map(()=>t||xb).splice(0,e.length-1)}function lS({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=lie(r)?r.map(wb):wb(r),a={done:!1,value:t[0]},o=$ie(aae(n&&n.length===t.length?n:rae(t),e),t,{ease:Array.isArray(i)?i:sae(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var uS=o((()=>{Tb(),eae(),iae(),oae()}));function dS(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(fS),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var fS,pS=o((()=>{fS=e=>e!==null}));function mS(e){typeof e.type==`string`&&(e.type=hS[e.type])}var hS,gS=o((()=>{cS(),uS(),rS(),hS={decay:sS,inertia:sS,tween:lS,keyframes:lS,spring:Zx}})),_S,vS=o((()=>{_S=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}})),yS,bS,xS=o((()=>{Tb(),Ib(),Rb(),Hx(),Kie(),cS(),uS(),Jx(),oS(),pS(),gS(),vS(),yS=e=>e/100,bS=class extends _S{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Fb.now()&&this.tick(Fb.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Lb.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;mS(e);let{type:t=lS,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||lS;s!==lS&&typeof o[0]!=`number`&&(this.mixKeyframes=rb(yS,Vx(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Kx(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Yy(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==sS&&(b.value=dS(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return sb(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+sb(e)}get time(){return sb(this.currentTime)}set time(e){e=ob(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return iS(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Fb.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=sb(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ux,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Fb.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Lb.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}}}));function cae(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var lae=o((()=>{}));function SS(e){return e.includes(`scale`)?1:0}function CS(e,t){if(!e||e===`none`)return SS(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=jS,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ES,i=t}if(!i)return SS(t);let a=r[t],o=i[1].split(`,`).map(uae);return typeof a==`function`?a(o):o[a]}function uae(e){return parseFloat(e.trim())}var wS,TS,ES,DS,OS,kS,AS,jS,MS,NS=o((()=>{wS=e=>e*180/Math.PI,TS=e=>DS(wS(Math.atan2(e[1],e[0]))),ES={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:TS,rotateZ:TS,skewX:e=>wS(Math.atan(e[1])),skewY:e=>wS(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},DS=e=>(e%=360,e<0&&(e+=360),e),OS=TS,kS=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),AS=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),jS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:kS,scaleY:AS,scale:e=>(kS(e)+AS(e))/2,rotateX:e=>DS(wS(Math.atan2(e[6],e[5]))),rotateY:e=>DS(wS(Math.atan2(-e[2],e[0]))),rotateZ:OS,rotate:OS,skewX:e=>wS(Math.atan(e[4])),skewY:e=>wS(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2},MS=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return CS(n,t)}})),PS,FS,IS=o((()=>{PS=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],FS=new Set(PS)}));function dae(e){let t=[];return zS.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var LS,RS,zS,BS,VS=o((()=>{NS(),IS(),Kb(),lx(),LS=e=>e===Ub||e===L,RS=new Set([`x`,`y`,`z`]),zS=PS.filter(e=>!RS.has(e)),BS={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>CS(t,`x`),y:(e,{transform:t})=>CS(t,`y`)},BS.translateX=BS.x,BS.translateY=BS.y}));function HS(){if(KS){let e=Array.from(WS).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=dae(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}KS=!1,GS=!1,WS.forEach(e=>e.complete(qS)),WS.clear()}function US(){WS.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(KS=!0)})}function fae(){qS=!0,US(),HS(),qS=!1}var WS,GS,KS,qS,JS,YS=o((()=>{lae(),VS(),Nb(),WS=new Set,GS=!1,KS=!1,qS=!1,JS=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(WS.add(this),GS||(GS=!0,kb.read(US),kb.resolveKeyframes(HS))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}cae(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),WS.delete(this)}cancel(){this.state===`scheduled`&&(WS.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}}})),XS,pae=o((()=>{XS=e=>e.startsWith(`--`)}));function ZS(e,t,n){XS(t)?e.style.setProperty(t,n):e.style[t]=n}var QS=o((()=>{pae()})),$S,mae=o((()=>{$S={}}));function eC(e,t){let n=Wre(e);return()=>$S[t]??n()}var tC=o((()=>{Tb(),mae()})),nC,hae=o((()=>{tC(),nC=eC(()=>window.ScrollTimeline!==void 0,`scrollTimeline`)})),rC,iC=o((()=>{tC(),rC=eC(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`)})),aC,oC=o((()=>{aC=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`})),sC,gae=o((()=>{oC(),sC={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:aC([0,.65,.55,1]),circOut:aC([.55,0,1,.45]),backIn:aC([.31,.01,.66,-.59]),backOut:aC([.33,1.53,.69,.99])}}));function cC(e,t){if(e)return typeof e==`function`?rC()?Wx(e,t):`ease-out`:Sb(e)?aC(e):Array.isArray(e)?e.map(e=>cC(e,t)||sC.easeOut):sC[e]}var _ae=o((()=>{Tb(),iC(),Gx(),oC(),gae()}));function vae(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=cC(s,i);Array.isArray(d)&&(u.easing=d),Db.value&&Lb.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Db.value&&p.finished.finally(()=>{Lb.waapi--}),p}var yae=o((()=>{Rb(),Ob(),_ae()}));function lC(e){return typeof e==`function`&&`applyToOptions`in e}var uC=o((()=>{}));function bae({type:e,...t}){return lC(e)&&rC()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var xae=o((()=>{iC(),uC()})),dC,fC=o((()=>{Tb(),QS(),hae(),pS(),vS(),yae(),xae(),dC=class extends _S{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,Zy(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=bae(e);this.animation=vae(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=dS(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ZS(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return sb(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+sb(e)}get time(){return sb(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ob(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&nC()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),tb):r(this)}}}));function Sae(e){return e in pC}function Cae(e){typeof e.ease==`string`&&Sae(e.ease)&&(e.ease=pC[e.ease])}var pC,wae=o((()=>{Tb(),pC={anticipate:_b,backInOut:hb,circInOut:bb}})),mC,hC,Tae=o((()=>{Tb(),Ib(),QS(),xS(),fC(),gS(),wae(),mC=10,hC=class extends dC{constructor(e){Cae(e),mS(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new bS({...a,autoplay:!1}),s=Math.max(mC,Fb.now()-this.startTime),c=Yy(0,mC,s-mC),l=o.sample(s).value,{name:u}=this.options;i&&u&&ZS(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}}})),gC,Eae=o((()=>{Ex(),gC=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Tx.test(e)||e===`0`)&&!e.startsWith(`url(`))}));function Dae(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Oae(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=gC(i,t),s=gC(a,t);return Xy(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,`value-not-animatable`),!o||!s?!1:Dae(e)||(n===`spring`||lC(n))&&r}var kae=o((()=>{Tb(),uC(),Eae()}));function _C(e){e.duration=0,e.type=`keyframes`}var vC=o((()=>{})),yC,bC=o((()=>{yC=new Set([`opacity`,`clipPath`,`filter`,`transform`])}));function Aae(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&xC.test(e[t]))return!0;return!1}var xC,jae=o((()=>{xC=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/}));function Mae(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return CC()&&n&&(yC.has(n)||SC.has(n)&&Aae(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var SC,CC,Nae=o((()=>{Tb(),bC(),jae(),SC=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),CC=Wre(()=>Object.hasOwnProperty.call(Element.prototype,`animate`))})),wC,TC,Pae=o((()=>{Tb(),Ib(),xS(),pS(),YS(),Tae(),kae(),vC(),vS(),Nae(),wC=40,TC=class extends _S{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Fb.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||JS)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Fb.now();let u=!0;Oae(e,i,a,o)||(u=!1,(Qy.instantAnimations||!s)&&l?.(dS(e,n,t)),e[0]=e[e.length-1],_C(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>wC?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Mae(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new hC({...d,element:p})}catch{m=new bS(d)}else m=new bS(d);m.finished.then(()=>{this.notifyFinished()}).catch(tb),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),fae()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}}));function EC(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var DC=o((()=>{}));function Fae(e){let t=kC.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function OC(e,t,n=1){Zy(n<=AC,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=Fae(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return $y(e)?parseFloat(e):e}return Vb(i)?OC(i,t,n+1):i}var kC,AC,Iae=o((()=>{Tb(),Hb(),kC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,AC=4})),jC,MC,NC,PC,FC,Lae=o((()=>{IS(),jC={type:`spring`,stiffness:500,damping:25,restSpeed:10},MC=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),NC={type:`keyframes`,duration:.8},PC={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},FC=(e,{keyframes:t})=>t.length>2?NC:FS.has(e)?e.startsWith(`scale`)?MC(t[1]):jC:PC}));function IC(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}var LC=o((()=>{}));function RC(e,t){let n=e?.[t]??e?.default??e;return n===e?n:IC(n,e)}var zC=o((()=>{LC()}));function Rae(e){for(let t in e)if(!BC.has(t))return!0;return!1}var BC,zae=o((()=>{BC=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`])})),VC,HC=o((()=>{Tb(),Pae(),xS(),zC(),vC(),Lae(),pS(),zae(),Nb(),VC=(e,t,n,r={},i,a)=>o=>{let s=RC(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ob(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Rae(s)||Object.assign(u,FC(e,u)),u.duration&&=ob(u.duration),u.repeatDelay&&=ob(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(_C(u),u.delay===0&&(d=!0)),(Qy.instantAnimations||Qy.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,_C(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=dS(u.keyframes,s);if(e!==void 0){kb.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new bS(u):new TC(u)}}));function UC(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function WC(e,t,n,r){if(typeof t==`function`){let[i,a]=UC(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=UC(r);t=t(n===void 0?e.custom:n,i,a)}return t}var GC=o((()=>{}));function KC(e,t,n){let r=e.getProps();return WC(r,t,n===void 0?r.custom:n,e)}var qC=o((()=>{GC()})),JC,YC=o((()=>{IS(),JC=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...PS])}));function XC(e,t){return new ew(e,t)}var ZC,QC,$C,ew,tw=o((()=>{Tb(),Ib(),Nb(),ZC=30,QC=e=>!isNaN(parseFloat(e)),$C={current:void 0},ew=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Fb.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Fb.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=QC(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ab);let n=this.events[e].add(t);return e===`change`?()=>{n(),kb.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return $C.current&&$C.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Fb.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ZC)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ZC);return Zre(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}})),nw,rw=o((()=>{nw=e=>Array.isArray(e)}));function Bae(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,XC(n))}function Vae(e){return nw(e)?e[e.length-1]||0:e}function iw(e,t){let{transitionEnd:n={},transition:r={},...i}=KC(e,t)||{};i={...i,...n};for(let t in i)Bae(e,t,Vae(i[t]))}var aw=o((()=>{tw(),qC(),rw()})),ow,sw=o((()=>{ow=e=>!!(e&&e.getVelocity)}));function Hae(e){return!!(ow(e)&&e.add)}var Uae=o((()=>{sw()}));function cw(e,t){let n=e.getValue(`willChange`);if(Hae(n))return n.add(t);if(!n&&Qy.WillChange){let n=new Qy.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var lw=o((()=>{Tb(),Uae()}));function uw(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var dw=o((()=>{})),fw,pw,mw=o((()=>{dw(),fw=`framerAppearId`,pw=`data-`+uw(fw)}));function hw(e){return e.props[pw]}var gw=o((()=>{mw()}));function Wae({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function _w(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?IC(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Wae(d,t))continue;let o={delay:n,...RC(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){kb.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=hw(e);if(n){let e=window.MotionHandoffAnimation(n,t,kb);e!==null&&(o.startTime=e,f=!0)}}cw(e,t);let p=l??e.shouldReduceMotion;r.start(VC(t,r,i,p&&JC.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>kb.update(()=>{o&&iw(e,o)});u.length?Promise.all(u).then(t):t()}return u}var vw=o((()=>{zC(),LC(),YC(),aw(),lw(),gw(),HC(),Nb()}));function yw(e,t,n={}){let r=KC(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(_w(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Gae(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Gae(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(yw(c,t,{...o,delay:n+(typeof r==`function`?0:r)+EC(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}var Kae=o((()=>{qC(),DC(),vw()}));function bw(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>yw(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=yw(e,t,n);else{let i=typeof t==`function`?KC(e,t,n.custom):t;r=Promise.all(_w(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var xw=o((()=>{qC(),vw(),Kae()})),Sw,qae=o((()=>{Sw={test:e=>e===`auto`,parse:e=>e}})),Cw,ww=o((()=>{Cw=e=>t=>t.test(e)})),Tw,Ew,Dw=o((()=>{qae(),Kb(),lx(),ww(),Tw=[Ub,L,ox,ax,sx,jie,Sw],Ew=e=>Tw.find(Cw(e))}));function Jae(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||eb(e)}var Yae=o((()=>{Tb()}));function Xae(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Yb)||[];if(!r)return e;let i=n.replace(r,``),a=Ow.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var Ow,kw,Aw,jw=o((()=>{Ex(),Xb(),Ow=new Set([`brightness`,`contrast`,`saturate`,`opacity`]),kw=/\b([a-z-]*)\(.*?\)/gu,Aw={...Tx,getAnimatableNone:e=>{let t=e.match(kw);return t?t.map(Xae).join(` `):e}}})),Mw,Nw=o((()=>{Ex(),Mw={...Tx,getAnimatableNone:e=>{let t=Tx.parse(e);return Tx.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}}})),Pw,Zae=o((()=>{Kb(),Pw={...Ub,transform:Math.round}})),Fw,Qae=o((()=>{Kb(),lx(),Fw={rotate:ax,rotateX:ax,rotateY:ax,rotateZ:ax,scale:Gb,scaleX:Gb,scaleY:Gb,scaleZ:Gb,skew:ax,skewX:ax,skewY:ax,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:Wb,originX:cx,originY:cx,originZ:L}})),Iw,Lw=o((()=>{Zae(),Kb(),lx(),Qae(),Iw={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,...Fw,zIndex:Pw,fillOpacity:Wb,strokeOpacity:Wb,numOctaves:Pw}})),Rw,zw,Bw=o((()=>{px(),jw(),Nw(),Lw(),Rw={...Iw,color:fx,backgroundColor:fx,outlineColor:fx,fill:fx,stroke:fx,borderColor:fx,borderTopColor:fx,borderRightColor:fx,borderBottomColor:fx,borderLeftColor:fx,filter:Aw,WebkitFilter:Aw,mask:Mw,WebkitMask:Mw},zw=e=>Rw[e]}));function Vw(e,t){let n=zw(e);return Hw.has(n)||(n=Tx),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Hw,Uw=o((()=>{Ex(),jw(),Nw(),Bw(),Hw=new Set([Aw,Mw])}));function $ae(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ww.has(t)&&hx(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Vw(n,i)}var Ww,eoe=o((()=>{Ex(),Uw(),Ww=new Set([`auto`,`none`,`0`])})),Gw,toe=o((()=>{YC(),Dw(),Iae(),Hb(),YS(),Yae(),eoe(),VS(),Gw=class extends JS{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Vb(r))){let i=OC(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!JC.has(n)||e.length!==2)return;let[r,i]=e,a=Ew(r),o=Ew(i);if(xie(r)!==xie(i)&&BS[n]){this.needsMeasurement=!0;return}if(a!==o)if(LS(a)&&LS(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else BS[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Jae(e[t]))&&n.push(t);n.length&&$ae(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=BS[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=BS[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}}));function Kw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var qw=o((()=>{})),Jw,Yw=o((()=>{Jw=(e,t)=>t&&typeof e==`number`?t.transform(e):e}));function noe(e){return Vre(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var roe=o((()=>{Tb()})),Xw,ioe,Zw=o((()=>{yie(),{schedule:Xw,cancel:ioe}=_ie(queueMicrotask,!1)}));function Qw(){return $w.x||$w.y}var $w,eT=o((()=>{$w={x:!1,y:!1}}));function aoe(e){return e===`x`||e===`y`?$w[e]?null:($w[e]=!0,()=>{$w[e]=!1}):$w.x||$w.y?null:($w.x=$w.y=!0,()=>{$w.x=$w.y=!1})}var ooe=o((()=>{eT()}));function tT(e,t){let n=Kw(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}var nT=o((()=>{qw()}));function soe(e){return!(e.pointerType===`touch`||Qw())}function coe(e,t,n={}){let[r,i,a]=tT(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!soe(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var loe=o((()=>{eT(),nT()})),rT,uoe=o((()=>{rT=(e,t)=>t?e===t?!0:rT(e,t.parentElement):!1})),iT,aT=o((()=>{iT=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1}));function doe(e){return oT.has(e.tagName)||e.isContentEditable===!0}function foe(e){return sT.has(e.tagName)||e.isContentEditable===!0}var oT,sT,cT=o((()=>{oT=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]),sT=new Set([`INPUT`,`SELECT`,`TEXTAREA`])})),lT,uT=o((()=>{lT=new WeakSet}));function dT(e){return t=>{t.key===`Enter`&&e(t)}}function fT(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var pT,poe=o((()=>{uT(),pT=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=dT(()=>{if(lT.has(n))return;fT(n,`down`);let e=dT(()=>{fT(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>fT(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)}}));function mT(e){return iT(e)&&!Qw()}function moe(e,t,n={}){let[r,i,a]=tT(e,n),o=e=>{let r=e.currentTarget;if(!mT(e)||hT.has(e))return;lT.add(r),n.stopPropagation&&hT.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),lT.has(r)&&lT.delete(r),mT(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||rT(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),noe(e)&&(e.addEventListener(`focus`,e=>pT(e,i)),!doe(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var hT,hoe=o((()=>{roe(),eT(),uoe(),aT(),nT(),cT(),poe(),uT(),hT=new WeakSet}));function gT(e){return Vre(e)&&`ownerSVGElement`in e}var _T=o((()=>{Tb()}));function goe({target:e,borderBoxSize:t}){vT.get(e)?.forEach(n=>{n(e,{get width(){return xT(e,t)},get height(){return ST(e,t)}})})}function _oe(e){e.forEach(goe)}function voe(){typeof ResizeObserver>`u`||(yT=new ResizeObserver(_oe))}function yoe(e,t){yT||voe();let n=Kw(e);return n.forEach(e=>{let n=vT.get(e);n||(n=new Set,vT.set(e,n)),n.add(t),yT?.observe(e)}),()=>{n.forEach(e=>{let n=vT.get(e);n?.delete(t),n?.size||yT?.unobserve(e)})}}var vT,yT,bT,xT,ST,boe=o((()=>{_T(),qw(),vT=new WeakMap,bT=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:gT(r)&&`getBBox`in r?r.getBBox()[t]:r[n],xT=bT(`inline`,`width`,`offsetWidth`),ST=bT(`block`,`height`,`offsetHeight`)}));function xoe(){wT=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};CT.forEach(t=>t(e))},window.addEventListener(`resize`,wT)}function Soe(e){return CT.add(e),wT||xoe(),()=>{CT.delete(e),!CT.size&&typeof wT==`function`&&(window.removeEventListener(`resize`,wT),wT=void 0)}}var CT,wT,Coe=o((()=>{CT=new Set}));function TT(e,t){return typeof e==`function`?Soe(e):yoe(e,t)}var woe=o((()=>{boe(),Coe()}));function Toe(e){return gT(e)&&e.tagName===`svg`}var Eoe=o((()=>{_T()})),ET,DT,Doe=o((()=>{px(),Ex(),Dw(),ww(),ET=[...Tw,fx,Tx],DT=e=>ET.find(Cw(e))})),OT,kT,AT,jT,MT=o((()=>{OT=()=>({translate:0,scale:1,origin:0,originPoint:0}),kT=()=>({x:OT(),y:OT()}),AT=()=>({min:0,max:0}),jT=()=>({x:AT(),y:AT()})})),NT,Ooe=o((()=>{NT=new WeakMap}));function PT(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}var FT=o((()=>{}));function IT(e){return typeof e==`string`||Array.isArray(e)}var LT=o((()=>{})),RT,zT,BT=o((()=>{RT=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],zT=[`initial`,...RT]}));function VT(e){return PT(e.animate)||zT.some(t=>IT(e[t]))}function HT(e){return!!(VT(e)||e.variants)}var UT=o((()=>{FT(),LT(),BT()}));function koe(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ow(i))e.addValue(r,i);else if(ow(a))e.addValue(r,XC(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,XC(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Aoe=o((()=>{tw(),sw()})),WT,GT,KT=o((()=>{WT={current:null},GT={current:!1}}));function joe(){if(GT.current=!0,qT)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>WT.current=e.matches;e.addEventListener(`change`,t),t()}else WT.current=!1}var qT,Moe=o((()=>{KT(),qT=typeof window<`u`}));function JT(e){XT=e}function Noe(){return XT}var YT,XT,ZT,QT=o((()=>{Tb(),YS(),fC(),bC(),Zw(),Ib(),MT(),tw(),Ex(),Uw(),Doe(),sw(),Ooe(),UT(),IS(),Aoe(),Moe(),GC(),KT(),Nb(),YT=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],XT={},ZT=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=JS,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Fb.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,kb.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=VT(t),this.isVariantNode=HT(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ow(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,NT.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(GT.current||joe(),this.shouldReduceMotion=WT.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ab(this.notifyUpdate),Ab(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&yC.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new dC({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ob(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=FS.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&kb.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in XT){let t=XT[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):jT()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<YT.length;t++){let n=YT[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=koe(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=XC(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&($y(n)||eb(n))?n=parseFloat(n):!DT(n)&&Tx.test(t)&&(n=Vw(e,t)),this.setBaseTarget(e,ow(n)?n.get():n)),ow(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=WC(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!ow(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ab),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Xw.render(this.render)}}})),$T,eE=o((()=>{sw(),toe(),QT(),$T=class extends ZT{constructor(){super(...arguments),this.KeyframeResolver=Gw}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ow(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}}})),tE,Poe=o((()=>{tE=class{constructor(e){this.isMounted=!1,this.node=e}update(){}}}));function nE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Foe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ioe(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}var rE=o((()=>{}));function iE(e){return e===void 0||e===1}function aE({scale:e,scaleX:t,scaleY:n}){return!iE(e)||!iE(t)||!iE(n)}function oE(e){return aE(e)||sE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sE(e){return cE(e.x)||cE(e.y)}function cE(e){return e&&e!==`0%`}var lE=o((()=>{}));function uE(e,t,n){return n+t*(e-n)}function dE(e,t,n,r,i){return i!==void 0&&(e=uE(e,i,r)),uE(e,n,r)+t}function fE(e,t=0,n=1,r,i){e.min=dE(e.min,t,n,r,i),e.max=dE(e.max,t,n,r,i)}function pE(e,{x:t,y:n}){fE(e.x,t.translate,t.scale,t.originPoint),fE(e.y,n.translate,n.scale,n.originPoint)}function Loe(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(mE(e.x,-a.scroll.offset.x),mE(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,pE(e,o)),r&&oE(a.latestValues)&&_E(e,a.latestValues,a.layout?.layoutBox))}t.x<yE&&t.x>vE&&(t.x=1),t.y<yE&&t.y>vE&&(t.y=1)}function mE(e,t){e.min+=t,e.max+=t}function hE(e,t,n,r,i=.5){fE(e,t,n,Ax(e.min,e.max,i),r)}function gE(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function _E(e,t,n){let r=n??e;hE(e.x,gE(t.x,r.x),t.scaleX,t.scale,t.originX),hE(e.y,gE(t.y,r.y),t.scaleY,t.scale,t.originY)}var vE,yE,bE=o((()=>{jx(),lE(),vE=.999999999999,yE=1.0000000000001}));function xE(e,t){return nE(Ioe(e.getBoundingClientRect(),t))}function Roe(e,t,n){let r=xE(e,n),{scroll:i}=t;return i&&(mE(r.x,i.offset.x),mE(r.y,i.offset.y)),r}var SE=o((()=>{rE(),bE()}));function zoe(e,t,n){let r=``,i=!0;for(let a=0;a<wE;a++){let o=PS[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Jw(s,Iw[o]);if(!c){i=!1;let t=CE[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}var CE,wE,Boe=o((()=>{Yw(),Lw(),IS(),CE={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},wE=PS.length}));function TE(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(FS.has(e)){o=!0;continue}else if(Bb(e)){i[e]=n;continue}else{let t=Jw(n,Iw[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=zoe(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var EE=o((()=>{Yw(),Lw(),IS(),Hb(),Boe()}));function DE(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var OE=o((()=>{}));function kE(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var AE,Voe=o((()=>{lx(),AE={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(L.test(e))e=parseFloat(e);else return e;return`${kE(e,t.target.x)}% ${kE(e,t.target.y)}%`}}})),jE,Hoe=o((()=>{Ex(),jx(),jE={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Tx.parse(e);if(i.length>5)return r;let a=Tx.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Ax(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}})),ME,NE=o((()=>{Voe(),Hoe(),ME={borderRadius:{...AE,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:AE,borderTopRightRadius:AE,borderBottomLeftRadius:AE,borderBottomRightRadius:AE,boxShadow:jE}}));function PE(e,{layout:t,layoutId:n}){return FS.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!ME[e]||e===`opacity`)}var FE=o((()=>{IS(),NE()}));function IE(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ow(r[t])||i&&ow(i[t])||PE(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}var LE=o((()=>{sw(),FE()}));function Uoe(e){return window.getComputedStyle(e)}var RE,Woe=o((()=>{Hb(),IS(),NS(),SE(),eE(),EE(),OE(),LE(),RE=class extends $T{constructor(){super(...arguments),this.type=`html`,this.renderInstance=DE}readValueFromInstance(e,t){if(FS.has(t))return this.projection?.isProjecting?SS(t):MS(e,t);{let n=Uoe(e),r=(Bb(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return xE(e,t)}build(e,t,n){TE(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return IE(e,t,n)}}}));function Goe(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?zE:BE;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var zE,BE,Koe=o((()=>{zE={offset:`stroke-dashoffset`,array:`stroke-dasharray`},BE={offset:`strokeDashoffset`,array:`strokeDasharray`}}));function VE(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(TE(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of HE)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Goe(d,i,a,o,!1)}var HE,UE=o((()=>{EE(),Koe(),HE=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`]})),WE,GE=o((()=>{WE=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`])})),KE,qE=o((()=>{KE=e=>typeof e==`string`&&e.toLowerCase()===`svg`}));function qoe(e,t,n,r){DE(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(WE.has(n)?n:uw(n),t.attrs[n])}var Joe=o((()=>{dw(),OE(),GE()}));function JE(e,t,n){let r=IE(e,t,n);for(let n in e)if(ow(e[n])||ow(t[n])){let t=PS.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var YE=o((()=>{sw(),IS(),LE()})),XE,Yoe=o((()=>{IS(),Bw(),MT(),eE(),dw(),UE(),GE(),qE(),Joe(),YE(),XE=class extends $T{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=jT}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(FS.has(t)){let e=zw(t);return e&&e.default||0}return t=WE.has(t)?t:uw(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return JE(e,t,n)}build(e,t,n){VE(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){qoe(e,t,n,r)}mount(e){this.isSVGTag=KE(e.tagName),super.mount(e)}}}));function ZE(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ZE(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<QE;n++){let r=zT[n],i=e.props[r];(IT(i)||i===!1)&&(t[r]=i)}return t}var QE,Xoe=o((()=>{LT(),BT(),QE=zT.length}));function $E(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Zoe=o((()=>{}));function Qoe(e){return t=>Promise.all(t.map(({animation:t,options:n})=>bw(e,t,n)))}function $oe(e){let t=Qoe(e),n=tD(),r=!0,i=!1,a=t=>(n,r)=>{let i=KC(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=ZE(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<rD;t++){let p=nD[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=IT(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||PT(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=ese(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=nw(t)&&nw(n)?!$E(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=KC(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=EC(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=KC(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=tD(),i=!0}}}function ese(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!$E(t,e):!1}function eD(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tD(){return{animate:eD(!0),whileInView:eD(),whileHover:eD(),whileTap:eD(),whileDrag:eD(),whileFocus:eD(),exit:eD()}}var nD,rD,tse=o((()=>{xw(),DC(),Xoe(),FT(),rw(),LT(),qC(),Zoe(),BT(),nD=[...RT].reverse(),rD=RT.length}));function iD(e,t){e.min=t.min,e.max=t.max}function aD(e,t){iD(e.x,t.x),iD(e.y,t.y)}function oD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var nse=o((()=>{}));function sD(e){return e.max-e.min}function rse(e,t,n){return Math.abs(e-t)<=n}function cD(e,t,n,r=.5){e.origin=r,e.originPoint=Ax(t.min,t.max,e.origin),e.scale=sD(n)/sD(t),e.translate=Ax(n.min,n.max,e.origin)-e.originPoint,(e.scale>=mD&&e.scale<=hD||isNaN(e.scale))&&(e.scale=1),(e.translate>=_D&&e.translate<=vD||isNaN(e.translate))&&(e.translate=0)}function lD(e,t,n,r){cD(e.x,t.x,n.x,r?r.originX:void 0),cD(e.y,t.y,n.y,r?r.originY:void 0)}function uD(e,t,n,r=0){e.min=(r?Ax(n.min,n.max,r):n.min)+t.min,e.max=e.min+sD(t)}function ise(e,t,n,r){uD(e.x,t.x,n.x,r?.x),uD(e.y,t.y,n.y,r?.y)}function dD(e,t,n,r=0){let i=r?Ax(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+sD(t)}function fD(e,t,n,r){dD(e.x,t.x,n.x,r?.x),dD(e.y,t.y,n.y,r?.y)}var pD,mD,hD,gD,_D,vD,yD=o((()=>{jx(),pD=1e-4,mD=1-pD,hD=1+pD,gD=.01,_D=0-gD,vD=0+gD}));function bD(e,t,n,r,i){return e-=t,e=uE(e,1/n,r),i!==void 0&&(e=uE(e,1/i,r)),e}function ase(e,t=0,n=1,r=.5,i,a=e,o=e){if(ox.test(t)&&(t=parseFloat(t),t=Ax(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Ax(a.min,a.max,r);e===a&&(s-=t),e.min=bD(e.min,t,n,s,i),e.max=bD(e.max,t,n,s,i)}function xD(e,t,[n,r,i],a,o){ase(e,t[n],t[r],t[i],t.scale,a,o)}function SD(e,t,n,r){xD(e.x,t,CD,n?n.x:void 0,r?r.x:void 0),xD(e.y,t,wD,n?n.y:void 0,r?r.y:void 0)}var CD,wD,ose=o((()=>{jx(),lx(),bE(),CD=[`x`,`scaleX`,`originX`],wD=[`y`,`scaleY`,`originY`]}));function TD(e){return e.translate===0&&e.scale===1}function ED(e){return TD(e.x)&&TD(e.y)}function DD(e,t){return e.min===t.min&&e.max===t.max}function sse(e,t){return DD(e.x,t.x)&&DD(e.y,t.y)}function OD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kD(e,t){return OD(e.x,t.x)&&OD(e.y,t.y)}function AD(e){return sD(e.x)/sD(e.y)}function jD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var cse=o((()=>{yD()}));function MD(e){return[e(`x`),e(`y`)]}var ND=o((()=>{}));function lse(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var use=o((()=>{}));function dse(e,t,n,r,i,a){i?(e.opacity=Ax(0,n.opacity??1,BD(r)),e.opacityExit=Ax(t.opacity??1,0,VD(r))):a&&(e.opacity=Ax(t.opacity??1,n.opacity??1,r));for(let i=0;i<LD;i++){let a=ID[i],o=PD(t,a),s=PD(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||zD(o)===zD(s)?(e[a]=Math.max(Ax(RD(o),RD(s),r),0),(ox.test(s)||ox.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Ax(t.rotate||0,n.rotate||0,r))}function PD(e,t){return e[t]===void 0?e.borderRadius:e[t]}function FD(e,t,n){return r=>r<e?0:r>t?1:n(ib(e,t,r))}var ID,LD,RD,zD,BD,VD,fse=o((()=>{jx(),lx(),Tb(),ID=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],LD=ID.length,RD=e=>typeof e==`string`?parseFloat(e):e,zD=e=>typeof e==`number`||L.test(e),BD=FD(0,.5,yb),VD=FD(.5,.95,tb)}));function pse(e,t,n){let r=ow(e)?e:XC(e);return r.start(VC(``,r,t,n)),r.animation}var mse=o((()=>{HC(),tw(),sw()}));function HD(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var UD=o((()=>{})),WD,hse=o((()=>{WD=(e,t)=>e.depth-t.depth})),GD,gse=o((()=>{Tb(),hse(),GD=class{constructor(){this.children=[],this.isDirty=!1}add(e){qy(this.children,e),this.isDirty=!0}remove(e){Jy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(WD),this.isDirty=!1,this.children.forEach(e)}}}));function _se(e,t){let n=Fb.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Ab(r),e(a-t))};return kb.setup(r,!0),()=>Ab(r)}var vse=o((()=>{Ib(),Nb()}));function KD(e){return ow(e)?e.get():e}var qD=o((()=>{sw()})),JD,yse=o((()=>{Tb(),JD=class{constructor(){this.members=[]}add(e){qy(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Jy(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Jy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}})),YD,XD=o((()=>{YD={hasAnimatedSinceResize:!0,hasEverUpdated:!1}}));function ZD(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function QD(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=hw(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,kb,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&QD(r)}function $D({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=uO++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Db.value&&(sO.nodes=sO.calculatedTargetDeltas=sO.calculatedProjections=0),this.nodes.forEach(Sse),this.nodes.forEach(Ose),this.nodes.forEach(kse),this.nodes.forEach(Cse),Db.addProjectionMetrics&&Db.addProjectionMetrics(sO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new GD)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ab),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=gT(t)&&!Toe(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;kb.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=_se(i,250),YD.hasAnimatedSinceResize&&(YD.hasAnimatedSinceResize=!1,this.nodes.forEach(nO)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||dO,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!kD(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...RC(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||nO(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ab(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ase),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&QD(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Tse),this.nodes.forEach(eO);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(tO);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ese),this.nodes.forEach(Dse),this.nodes.forEach(bse),this.nodes.forEach(xse)):this.nodes.forEach(tO),this.clearAllSnapshots();let e=Fb.now();jb.delta=Yy(0,1e3/60,e-jb.timestamp),jb.timestamp=e,jb.isProcessing=!0,Mb.update.process(jb),Mb.preRender.process(jb),Mb.render.process(jb),jb.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(wse),this.sharedNodes.forEach(jse)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,kb.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){kb.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!sD(this.snapshot.measuredBox.x)&&!sD(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=jT(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ED(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||oE(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Pse(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return jT();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Fse))){let{scroll:e}=this.root;e&&(mE(t.x,e.offset.x),mE(t.y,e.offset.y))}return t}removeElementScroll(e){let t=jT();if(aD(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&aD(t,e),mE(t.x,i.offset.x),mE(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||jT();aD(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(mE(r.x,-n.scroll.offset.x),mE(r.y,-n.scroll.offset.y)),oE(n.latestValues)&&_E(r,n.latestValues,n.layout?.layoutBox)}return oE(this.latestValues)&&_E(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=jT();aD(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!oE(n.latestValues))continue;let r;n.instance&&(aE(n.latestValues)&&n.updateSnapshot(),r=jT(),aD(r,n.measurePageBox())),SD(t,n.latestValues,n.snapshot?.layoutBox,r)}return oE(this.latestValues)&&SD(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==jb.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=jb.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=jT(),this.targetWithTransforms=jT()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ise(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):aD(this.target,this.layout.layoutBox),pE(this.target,this.targetDelta)):aD(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Db.value&&sO.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||aE(this.parent.latestValues)||sE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=jT(),this.relativeTargetOrigin=jT(),fD(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),aD(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===jb.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;aD(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Loe(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=jT());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oD(this.prevProjectionDelta.x,this.projectionDelta.x),oD(this.prevProjectionDelta.y,this.projectionDelta.y)),lD(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!jD(this.projectionDelta.x,this.prevProjectionDelta.x)||!jD(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Db.value&&sO.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=kT(),this.projectionDelta=kT(),this.projectionDeltaWithTransform=kT()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=kT();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=jT(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Nse));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;rO(a.x,e.x,n),rO(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fD(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Mse(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&sse(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=jT(),aD(d,this.relativeTarget)),s&&(this.animationValues=i,dse(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Ab(this.pendingAnimation),void 0),this.pendingAnimation=kb.update(()=>{YD.hasAnimatedSinceResize=!0,Lb.layout++,this.motionValue||=XC(0),this.motionValue.jump(0,!1),this.currentAnimation=pse(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Lb.layout--},onComplete:()=>{Lb.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&oO(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||jT();let t=sD(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=sD(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}aD(t,n),_E(t,i),lD(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new JD),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ZD(`z`,e,r,this.animationValues);for(let t=0;t<cO.length;t++)ZD(`rotate${cO[t]}`,e,r,this.animationValues),ZD(`skew${cO[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=KD(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=KD(t?.pointerEvents)||``),this.hasProjected&&!oE(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lse(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in ME){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=ME[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?KD(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(eO),this.root.sharedNodes.clear()}}}function bse(e){e.updateLayout()}function xse(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)MD(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=sD(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;iD(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else oO(i,t.layoutBox,n)&&MD(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=sD(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=kT();lD(o,n,t.layoutBox);let s=kT();a?lD(s,e.applyTransform(r,!0),t.measuredBox):lD(s,n,t.layoutBox);let c=!ED(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=jT();fD(s,t.layoutBox,i.layoutBox,o);let c=jT();fD(c,n,a.layoutBox,o),kD(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Sse(e){Db.value&&sO.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Cse(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wse(e){e.clearSnapshot()}function eO(e){e.clearMeasurements()}function Tse(e){e.isLayoutDirty=!0,e.updateLayout()}function tO(e){e.isLayoutDirty=!1}function Ese(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Dse(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function nO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ose(e){e.resolveTargetDelta()}function kse(e){e.calcProjection()}function Ase(e){e.resetSkewAndRotation()}function jse(e){e.removeLeadSnapshot()}function rO(e,t,n){e.translate=Ax(t.translate,0,n),e.scale=Ax(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iO(e,t,n,r){e.min=Ax(t.min,n.min,r),e.max=Ax(t.max,n.max,r)}function Mse(e,t,n,r){iO(e.x,t.x,n.x,r),iO(e.y,t.y,n.y,r)}function Nse(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}function aO(e){e.min=pO(e.min),e.max=pO(e.max)}function Pse(e){aO(e.x),aO(e.y)}function oO(e,t,n){return e===`position`||e===`preserve-aspect`&&!rse(AD(t),AD(n),.2)}function Fse(e){return e!==e.root&&e.scroll?.wasRoot}var sO,cO,lO,uO,dO,fO,pO,mO=o((()=>{Tb(),mse(),gw(),zC(),Zw(),Ib(),NE(),Rb(),Ob(),vse(),_T(),Eoe(),jx(),tw(),qD(),fse(),nse(),bE(),yD(),ose(),MT(),cse(),yse(),use(),ND(),gse(),lE(),XD(),Nb(),sO={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cO=[``,`X`,`Y`,`Z`],lO=1e3,uO=0,dO={duration:.45,ease:[.4,0,.1,1]},fO=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),pO=fO(`applewebkit/`)&&!fO(`chrome/`)?Math.round:tb})),hO,Ise=o((()=>{UD(),mO(),hO=$D({attachResizeListener:(e,t)=>HD(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0})})),gO,_O,Lse=o((()=>{mO(),Ise(),gO={current:void 0},_O=$D({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gO.current){let e=new hO({});e.mount(window),e.setOptions({layoutScroll:!0}),gO.current=e}return gO.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`})})),vO=o((()=>{HC(),xw(),mw(),Zw(),ooe(),loe(),hoe(),cT(),aT(),woe(),jx(),lx(),sw(),lw(),Poe(),Woe(),Yoe(),QT(),tse(),FT(),UT(),FE(),LT(),qC(),GC(),aw(),rE(),yD(),MT(),ND(),SE(),UD(),qD(),Lse(),XD(),EE(),LE(),UE(),qE(),YE(),Nb()})),yO,bO,xO=o((()=>{yO=u(p(),1),bO=(0,yO.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`})}));function Rse(e=!0){let t=(0,SO.useContext)(Gy);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,SO.useId)();(0,SO.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,SO.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var SO,zse=o((()=>{SO=u(p(),1),Ky()})),CO,wO,TO=o((()=>{CO=u(p(),1),wO=(0,CO.createContext)({strict:!1})}));function Bse(){if(OO)return;let e={};for(let t in DO)e[t]={isEnabled:e=>DO[t].some(t=>!!e[t])};JT(e),OO=!0}function EO(){return Bse(),Noe()}var DO,OO,kO=o((()=>{vO(),DO={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},OO=!1}));function Vse(e){let t=EO();for(let n in e)t[n]={...t[n],...e[n]};JT(t)}var Hse=o((()=>{vO(),kO()}));function AO(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||jO.has(e)}var jO,Use=o((()=>{jO=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`))})),Wse=c({default:()=>MO}),MO,Gse=o((()=>{throw MO={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)}));function Kse(e){typeof e==`function`&&(NO=t=>t.startsWith(`on`)?!AO(t):e(t))}function qse(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||ow(e[i])||(NO(i)||n===!0&&AO(i)||!t&&!AO(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var NO,Jse=o((()=>{vO(),Use(),NO=e=>!AO(e);try{Kse((Gse(),d(Wse)).default)}catch{}})),PO,FO,IO=o((()=>{PO=u(p(),1),FO=(0,PO.createContext)({})}));function Yse(e,t){if(VT(e)){let{initial:t,animate:n}=e;return{initial:t===!1||IT(t)?t:void 0,animate:IT(n)?n:void 0}}return e.inherit===!1?{}:t}var Xse=o((()=>{vO()}));function Zse(e){let{initial:t,animate:n}=Yse(e,(0,RO.useContext)(FO));return(0,RO.useMemo)(()=>({initial:t,animate:n}),[LO(t),LO(n)])}function LO(e){return Array.isArray(e)?e.join(` `):e}var RO,Qse=o((()=>{RO=u(p(),1),IO(),Xse()})),zO,BO=o((()=>{zO=()=>({style:{},transform:{},transformOrigin:{},vars:{}})}));function VO(e,t,n){for(let r in t)!ow(t[r])&&!PE(r,n)&&(e[r]=t[r])}function $se({transformTemplate:e},t){return(0,HO.useMemo)(()=>{let n=zO();return TE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ece(e,t){let n=e.style||{},r={};return VO(r,n,e),Object.assign(r,$se(e,t)),r}function tce(e,t){let n={},r=ece(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var HO,UO=o((()=>{vO(),HO=u(p(),1),BO()})),WO,GO=o((()=>{BO(),WO=()=>({...zO(),attrs:{}})}));function nce(e,t,n,r){let i=(0,KO.useMemo)(()=>{let n=WO();return VE(n,t,KE(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};VO(t,e.style,e),i.style={...t,...i.style}}return i}var KO,rce=o((()=>{vO(),KO=u(p(),1),UO(),GO()})),qO,ice=o((()=>{qO=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`]}));function JO(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(qO.indexOf(e)>-1||/[A-Z]/u.test(e))}var YO=o((()=>{ice()}));function ace(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??JO(e)?nce:tce)(t,r,i,e),c=qse(t,typeof e==`string`,a),l=e===XO.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,XO.useMemo)(()=>ow(u)?u.get():u,[u]);return(0,XO.createElement)(e,{...l,children:d})}var XO,oce=o((()=>{vO(),XO=u(p(),1),UO(),rce(),Jse(),YO()}));function sce({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:cce(n,r,i,e),renderState:t()}}function cce(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=KD(a[e]);let{initial:o,animate:s}=e,c=VT(e),l=HT(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!PT(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=WC(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var ZO,QO,$O=o((()=>{vO(),ZO=u(p(),1),IO(),Ky(),jre(),QO=e=>(t,n)=>{let r=(0,ZO.useContext)(FO),i=(0,ZO.useContext)(Gy),a=()=>sce(e,t,r,i);return n?a():kre(a)}})),ek,lce=o((()=>{vO(),$O(),BO(),ek=QO({scrapeMotionValuesFromProps:IE,createRenderState:zO})})),tk,uce=o((()=>{vO(),$O(),GO(),tk=QO({scrapeMotionValuesFromProps:JE,createRenderState:WO})})),nk,dce=o((()=>{nk=Symbol.for(`motionComponentSymbol`)}));function fce(e,t,n){let r=(0,rk.useRef)(n);(0,rk.useInsertionEffect)(()=>{r.current=n});let i=(0,rk.useRef)(null);return(0,rk.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var rk,pce=o((()=>{rk=u(p(),1)})),ik,ak,ok=o((()=>{ik=u(p(),1),ak=(0,ik.createContext)({})}));function sk(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}var ck=o((()=>{}));function mce(e,t,n,r,i,a){let{visualElement:o}=(0,uk.useContext)(FO),s=(0,uk.useContext)(wO),c=(0,uk.useContext)(Gy),l=(0,uk.useContext)(bO),u=l.reducedMotion,d=l.skipAnimations,f=(0,uk.useRef)(null),p=(0,uk.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,uk.useContext)(ak);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&hce(f.current,n,i,h);let g=(0,uk.useRef)(!1);(0,uk.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[pw],v=(0,uk.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Wy(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,uk.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function hce(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:lk(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&sk(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function lk(e){if(e)return e.options.allowProjection===!1?lk(e.parent):e.projection}var uk,gce=o((()=>{vO(),uk=u(p(),1),TO(),xO(),IO(),Ky(),ok(),ck(),Pre()}));function dk(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Vse(r);let a=n?n===`svg`:JO(e),o=a?tk:ek;function s(n,s){let c,l={...(0,pk.useContext)(bO),...n,layoutId:_ce(n)},{isStatic:u}=l,d=Zse(n),f=o(n,u);if(!u&&typeof window<`u`){vce(l,r);let t=yce(l);c=t.MeasureLayout,d.visualElement=mce(e,f,l,i,t.ProjectionNode,a)}return(0,fk.jsxs)(FO.Provider,{value:d,children:[c&&d.visualElement?(0,fk.jsx)(c,{visualElement:d.visualElement,...l}):null,ace(e,n,fce(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,pk.forwardRef)(s);return c[nk]=e,c}function _ce({layoutId:e}){let t=(0,pk.useContext)(Hy).id;return t&&e!==void 0?t+`-`+e:e}function vce(e,t){(0,pk.useContext)(wO).strict}function yce(e){let{drag:t,layout:n}=EO();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var fk,pk,bce=o((()=>{fk=N(),pk=u(p(),1),Ore(),TO(),xO(),IO(),Qse(),oce(),YO(),lce(),uce(),kO(),Hse(),dce(),pce(),gce()}));function xce(e,t){if(typeof Proxy>`u`)return dk;let n=new Map,r=(n,r)=>dk(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,dk(a,void 0,e,t)),n.get(a))})}var Sce=o((()=>{bce()})),mk,hk,Cce=o((()=>{vO(),mk=u(p(),1),YO(),hk=(e,t)=>t.isSVG??JO(e)?new XE(t):new RE(t,{allowProjection:e!==mk.Fragment})})),gk,wce=o((()=>{vO(),gk=class extends tE{constructor(e){super(e),e.animationState||=$oe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();PT(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}})),_k,vk,Tce=o((()=>{vO(),_k=0,vk=class extends tE{constructor(){super(...arguments),this.id=_k++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=KC(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}})),yk,Ece=o((()=>{wce(),Tce(),yk={animation:{Feature:gk},exit:{Feature:vk}}}));function bk(e){return{point:{x:e.pageX,y:e.pageY}}}var xk,Sk=o((()=>{vO(),xk=e=>t=>iT(t)&&e(t,bk(t))}));function Ck(e,t,n,r){return HD(e,t,xk(n),r)}var wk=o((()=>{vO(),Sk()})),Tk,Ek=o((()=>{Tk=({current:e})=>e?e.ownerDocument.defaultView:null}));function Dce(e,t){let n=Dk(e.x,t.x),r=Dk(e.y,t.y);return Math.sqrt(n**2+r**2)}var Dk,Oce=o((()=>{Dk=(e,t)=>Math.abs(e-t)}));function Ok(e,t){return t?{point:t(e.point)}:e}function kk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ak({point:e},t){return{point:e,delta:kk(e,jk(t)),offset:kk(e,kce(t)),velocity:Ace(t,.1)}}function kce(e){return e[0]}function jk(e){return e[e.length-1]}function Ace(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=jk(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ob(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>ob(t)*2&&(r=e[1]);let a=sb(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Mk,Nk,jce=o((()=>{vO(),Tb(),wk(),Sk(),Oce(),Mk=new Set([`auto`,`scroll`]),Nk=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ok(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Ak(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Dce(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=jb;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Ok(t,this.transformPagePoint),kb.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Ak(e.type===`pointercancel`?this.lastMoveEventInfo:Ok(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!iT(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Ok(bk(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=jb;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Ak(s,this.history)),this.removeListeners=rb(Ck(this.contextWindow,`pointermove`,this.handlePointerMove),Ck(this.contextWindow,`pointerup`,this.handlePointerUp),Ck(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Mk.has(e.overflowX)||Mk.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),kb.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ab(this.updatePoint)}}}));function Mce(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ax(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ax(n,e,r.max):Math.min(e,n)),e}function Nce(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Pce(e,{top:t,left:n,bottom:r,right:i}){return{x:Nce(e.x,n,i),y:Nce(e.y,t,r)}}function Fce(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Ice(e,t){return{x:Fce(e.x,t.x),y:Fce(e.y,t.y)}}function Lce(e,t){let n=.5,r=sD(e),i=sD(t);return i>r?n=ib(t.min,t.max-r,e.min):r>i&&(n=ib(e.min,e.max-i,t.min)),Yy(0,1,n)}function Rce(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}function zce(e=Pk){return e===!1?e=0:e===!0&&(e=Pk),{x:Bce(e,`left`,`right`),y:Bce(e,`top`,`bottom`)}}function Bce(e,t,n){return{min:Vce(e,t),max:Vce(e,n)}}function Vce(e,t){return typeof e==`number`?e:e[t]||0}var Pk,Hce=o((()=>{vO(),Tb(),Pk=.35}));function Uce(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Wce(e,t,n){let r=TT(e,Uce(n)),i=TT(t,Uce(n));return()=>{r(),i()}}function Fk(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Gce(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Kce,qce,Jce=o((()=>{vO(),Tb(),wk(),Sk(),Ek(),ck(),jce(),Hce(),Kce=new WeakMap,qce=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=jT(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(bk(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=aoe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),MD(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ox.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=sD(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&kb.update(()=>i(e,t),!1,!0),cw(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Gce(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&kb.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Nk(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Tk(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&kb.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Fk(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Mce(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&sk(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Pce(n.layoutBox,e):this.constraints=!1,this.elastic=zce(t),r!==this.constraints&&!sk(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&MD(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Rce(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!sk(e))return!1;let n=e.current;Zy(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Roe(n,r.root,this.visualElement.getTransformPagePoint()),a=Ice(r.layout.layoutBox,i);if(t){let e=t(Foe(a));this.hasMutatedConstraints=!!e,e&&(a=nE(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=MD(o=>{if(!Fk(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return cw(this.visualElement,e),n.start(VC(e,n,0,t,this.visualElement,!1))}stopAnimation(){MD(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){MD(t=>{let{drag:n}=this.getProps();if(!Fk(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Ax(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!sk(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};MD(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Lce({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),MD(t=>{if(!Fk(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Ax(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Kce.set(this.visualElement,this);let e=this.visualElement.current,t=Ck(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&foe(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();sk(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Wce(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),kb.read(r);let o=HD(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(MD(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Pk,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}})),Yce,Xce=o((()=>{vO(),Tb(),Jce(),Yce=class extends tE{constructor(e){super(e),this.removeGroupControls=tb,this.removeListeners=tb,this.controls=new qce(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tb}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}})),Ik,Zce,Qce=o((()=>{vO(),Tb(),wk(),Ek(),jce(),Ik=e=>(t,n)=>{e&&kb.update(()=>e(t,n),!1,!0)},Zce=class extends tE{constructor(){super(...arguments),this.removePointerDownListener=tb}onPointerDown(e){this.session=new Nk(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Tk(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ik(e),onStart:Ik(t),onMove:Ik(n),onEnd:(e,t)=>{delete this.session,r&&kb.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Ck(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}}));function $ce(e){let[t,n]=Rse(),r=(0,Lk.useContext)(Hy);return(0,ele.jsx)(tle,{...e,layoutGroup:r,switchLayoutGroup:(0,Lk.useContext)(ak),isPresent:t,safeToRemove:n})}var ele,Lk,Rk,tle,nle=o((()=>{ele=N(),vO(),Lk=u(p(),1),zse(),Ore(),ok(),Rk=!1,tle=class extends Lk.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Rk&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),YD.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Rk=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||kb.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Xw.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Rk=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}})),rle,ile=o((()=>{Xce(),Qce(),nle(),vO(),rle={pan:{Feature:Zce},drag:{Feature:Yce,ProjectionNode:_O,MeasureLayout:$ce}}}));function ale(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&kb.postRender(()=>i(t,bk(t)))}var ole,sle=o((()=>{vO(),Sk(),ole=class extends tE{mount(){let{current:e}=this.node;e&&(this.unmount=coe(e,(e,t)=>(ale(this.node,t,`Start`),e=>ale(this.node,e,`End`))))}unmount(){}}})),cle,lle=o((()=>{vO(),Tb(),cle=class extends tE{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=rb(HD(this.node.current,`focus`,()=>this.onFocus()),HD(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}}}));function ule(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&kb.postRender(()=>i(t,bk(t)))}var dle,fle=o((()=>{vO(),Sk(),dle=class extends tE{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=moe(e,(e,t)=>(ule(this.node,t,`Start`),(e,{success:t})=>ule(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}}}));function ple({root:e,...t}){let n=e||document;Bk.has(n)||Bk.set(n,{});let r=Bk.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gle,{root:e,...t})),r[i]}function mle(e,t,n){let r=ple(t);return zk.set(e,n),r.observe(e),()=>{zk.delete(e),r.unobserve(e)}}var zk,Bk,hle,gle,_le=o((()=>{zk=new WeakMap,Bk=new WeakMap,hle=e=>{let t=zk.get(e.target);t&&t(e)},gle=e=>{e.forEach(hle)}}));function vle({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var yle,ble,xle=o((()=>{vO(),_le(),yle={some:0,all:1},ble=class extends tE{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:yle[r]};this.stopObserver=mle(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(vle(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}})),Sle,Cle=o((()=>{sle(),lle(),fle(),xle(),Sle={inView:{Feature:ble},tap:{Feature:dle},focus:{Feature:cle},hover:{Feature:ole}}})),wle,Tle=o((()=>{vO(),nle(),wle={layout:{ProjectionNode:_O,MeasureLayout:$ce}}})),Ele,Dle=o((()=>{Ece(),ile(),Cle(),Tle(),Ele={...yk,...Sle,...rle,...wle}})),Vk,Ole=o((()=>{Cce(),Sce(),Dle(),Vk=xce(Ele,hk)}));function kle(e){e.values.forEach(e=>e.stop())}function Hk(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&iw(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Hk(e,t)})})}function Ale(e,t){if(Array.isArray(t))return Hk(e,t);if(typeof t==`string`)return Hk(e,[t]);iw(e,t)}function jle(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){Zy(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(bw(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return Zy(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Ale(e,n)})},stop(){t.forEach(e=>{kle(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}var Mle=o((()=>{vO(),Tb()}));function Nle(){let e=kre(jle);return Wy(e.mount,[]),e}var Uk,Ple=o((()=>{jre(),Pre(),Mle(),Uk=Nle})),Fle=o((()=>{Ole(),vO(),Tb(),Ple()})),Wk=o((()=>{Fle(),Fle()}));function Gk(...e){return e.filter(Boolean).join(` `)}var Kk=o((()=>{})),qk,Jk,Yk,Ile=o((()=>{Wk(),qk=u(p()),Kk(),Jk=N(),Yk=(0,qk.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,qk.useRef)(!1);(0,qk.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,qk.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,qk.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,Jk.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,Jk.jsxs)(Vk.svg,{animate:o,fill:`none`,height:r,initial:`normal`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,variants:{normal:{scale:1},animate:{scale:1.05,transition:{duration:.3,ease:`easeOut`}}},viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,Jk.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),(0,Jk.jsx)(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),(0,Jk.jsx)(Vk.path,{d:`M10 9H8`,stroke:`currentColor`,strokeWidth:`2`,variants:{normal:{pathLength:1,x1:8,x2:10},animate:{pathLength:[1,0,1],x1:[8,10,8],x2:[10,10,10],transition:{duration:.7,delay:.3}}}}),(0,Jk.jsx)(Vk.path,{d:`M16 13H8`,stroke:`currentColor`,strokeWidth:`2`,variants:{normal:{pathLength:1,x1:8,x2:16},animate:{pathLength:[1,0,1],x1:[8,16,8],x2:[16,16,16],transition:{duration:.7,delay:.5}}}}),(0,Jk.jsx)(Vk.path,{d:`M16 17H8`,stroke:`currentColor`,strokeWidth:`2`,variants:{normal:{pathLength:1,x1:8,x2:16},animate:{pathLength:[1,0,1],x1:[8,16,8],x2:[16,16,16],transition:{duration:.7,delay:.7}}}})]})})}),Yk.displayName=`FileTextIcon`})),Xk,Zk,Lle,Qk,Rle=o((()=>{Wk(),Xk=u(p()),Kk(),Zk=N(),Lle={normal:{rotate:0},animate:{rotate:[0,-8,6,-4,0],transition:{ease:`easeInOut`,rotate:{duration:.6}}}},Qk=(0,Xk.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,Xk.useRef)(!1);(0,Xk.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,Xk.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,Xk.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,Zk.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,Zk.jsx)(Vk.svg,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,Zk.jsx)(Vk.path,{animate:o,d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,initial:`normal`,style:{transformOrigin:`12px 12px`},variants:Lle})})})}),Qk.displayName=`FolderOpenIcon`})),$k,eA,tA,zle=o((()=>{Wk(),$k=u(p()),Kk(),eA=N(),tA=(0,$k.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,$k.useRef)(!1);(0,$k.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,$k.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,$k.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,eA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,eA.jsxs)(Vk.svg,{animate:o,fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,transition:{type:`spring`,stiffness:100,damping:15},variants:{normal:{rotate:0},animate:{rotate:180}},viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,eA.jsx)(`path`,{d:`M5 12h14`}),(0,eA.jsx)(`path`,{d:`M12 5v14`})]})})}),tA.displayName=`PlusIcon`})),nA,rA,iA,Ble=o((()=>{Wk(),nA=u(p()),Kk(),rA=N(),iA=(0,nA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,nA.useRef)(!1);(0,nA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,nA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,nA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,rA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,rA.jsxs)(Vk.svg,{animate:o,fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,transition:{duration:1,bounce:.3},variants:{normal:{x:0,y:0},animate:{x:[0,0,-3,0],y:[0,-4,0,0]}},viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,rA.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,rA.jsx)(`path`,{d:`m21 21-4.3-4.3`})]})})}),iA.displayName=`SearchIcon`})),aA,oA,Vle,sA,cA,Hle=o((()=>{Wk(),aA=u(p()),Kk(),oA=N(),Vle={normal:{y:0},animate:{y:-1.1}},sA={type:`spring`,stiffness:500,damping:30},cA=(0,aA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,aA.useRef)(!1);(0,aA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,aA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,aA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,oA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,oA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,oA.jsxs)(Vk.g,{animate:o,transition:sA,variants:Vle,children:[(0,oA.jsx)(`path`,{d:`M3 6h18`}),(0,oA.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`})]}),(0,oA.jsx)(Vk.path,{animate:o,d:`M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8`,transition:sA,variants:{normal:{d:`M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8`},animate:{d:`M19 9v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V9`}}}),(0,oA.jsx)(Vk.line,{animate:o,transition:sA,variants:{normal:{y1:11,y2:17},animate:{y1:11.5,y2:17.5}},x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,oA.jsx)(Vk.line,{animate:o,transition:sA,variants:{normal:{y1:11,y2:17},animate:{y1:11.5,y2:17.5}},x1:`14`,x2:`14`,y1:`11`,y2:`17`})]})})}),cA.displayName=`DeleteIcon`})),lA,uA,Ule,dA,Wle=o((()=>{Wk(),lA=u(p()),Kk(),uA=N(),Ule={times:[0,.4,1],duration:.5},dA=(0,lA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,lA.useRef)(!1);(0,lA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,lA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,lA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,uA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,uA.jsx)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,uA.jsx)(Vk.path,{animate:o,d:`m9 18 6-6-6-6`,transition:Ule,variants:{normal:{x:0},animate:{x:[0,2,0]}}})})})}),dA.displayName=`ChevronRightIcon`})),fA,pA,mA,Gle,Kle=o((()=>{Wk(),fA=u(p()),Kk(),pA=N(),mA={normal:{opacity:1,pathLength:1},animate:{opacity:[0,1],pathLength:[0,1]}},Gle=(0,fA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,fA.useRef)(!1);(0,fA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,fA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,fA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,pA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,pA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,pA.jsx)(Vk.path,{animate:o,d:`M18 6 6 18`,variants:mA}),(0,pA.jsx)(Vk.path,{animate:o,d:`m6 6 12 12`,transition:{delay:.2},variants:mA})]})})}),Gle.displayName=`XIcon`})),hA,gA,qle,_A,Jle=o((()=>{Wk(),hA=u(p()),Kk(),gA=N(),qle={normal:{opacity:1},animate:e=>({opacity:[0,1],transition:{delay:e*.1,duration:.3}})},_A=(0,hA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,hA.useRef)(!1);(0,hA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,hA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,hA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,gA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,gA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,gA.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),[`M12 2v2`,`m19.07 4.93-1.41 1.41`,`M20 12h2`,`m17.66 17.66 1.41 1.41`,`M12 20v2`,`m6.34 17.66-1.41 1.41`,`M2 12h2`,`m4.93 4.93 1.41 1.41`].map((e,t)=>(0,gA.jsx)(Vk.path,{animate:o,custom:t+1,d:e,variants:qle},e))]})})}),_A.displayName=`SunIcon`})),vA,yA,Yle,Xle,bA,Zle=o((()=>{Wk(),vA=u(p()),Kk(),yA=N(),Yle={normal:{rotate:0},animate:{rotate:[0,-10,10,-5,5,0]}},Xle={duration:1.2,ease:`easeInOut`},bA=(0,vA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,vA.useRef)(!1);(0,vA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,vA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,vA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,yA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,yA.jsx)(Vk.svg,{animate:o,fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,transition:Xle,variants:Yle,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,yA.jsx)(`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`})})})}),bA.displayName=`MoonIcon`})),xA,SA,CA,wA,Qle=o((()=>{Wk(),xA=u(p()),Kk(),SA=N(),CA={type:`spring`,stiffness:250,damping:25},wA=(0,xA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,xA.useRef)(!1);(0,xA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,xA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,xA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,SA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,SA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,SA.jsx)(Vk.path,{animate:o,d:`M8 3H5a2 2 0 0 0-2 2v3`,transition:CA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`-2px`}}}),(0,SA.jsx)(Vk.path,{animate:o,d:`M21 8V5a2 2 0 0 0-2-2h-3`,transition:CA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`-2px`}}}),(0,SA.jsx)(Vk.path,{animate:o,d:`M3 16v3a2 2 0 0 0 2 2h3`,transition:CA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`2px`}}}),(0,SA.jsx)(Vk.path,{animate:o,d:`M16 21h3a2 2 0 0 0 2-2v-3`,transition:CA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`2px`}}})]})})}),wA.displayName=`MaximizeIcon`})),TA,EA,DA,OA,$le=o((()=>{Wk(),TA=u(p()),Kk(),EA=N(),DA={type:`spring`,stiffness:250,damping:25},OA=(0,TA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,TA.useRef)(!1);(0,TA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,TA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,TA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,EA.jsx)(`div`,{className:Gk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,EA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,EA.jsx)(Vk.path,{animate:o,d:`M8 3v3a2 2 0 0 1-2 2H3`,transition:DA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`2px`}}}),(0,EA.jsx)(Vk.path,{animate:o,d:`M21 8h-3a2 2 0 0 1-2-2V3`,transition:DA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`2px`}}}),(0,EA.jsx)(Vk.path,{animate:o,d:`M3 16h3a2 2 0 0 1 2 2v3`,transition:DA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`-2px`}}}),(0,EA.jsx)(Vk.path,{animate:o,d:`M16 21v-3a2 2 0 0 1 2-2h3`,transition:DA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`-2px`}}})]})})}),OA.displayName=`MinimizeIcon`})),kA,AA,eue,jA,tue,nue,rue=o((()=>{Wk(),kA=u(p()),Kk(),AA=N(),eue=[{cx:9,cy:5},{cx:9,cy:12},{cx:9,cy:19},{cx:15,cy:5},{cx:15,cy:12},{cx:15,cy:19}],jA=3,tue={normal:{opacity:1,scale:1,transition:{duration:.25,ease:`easeOut`}},animate:e=>{let t=e.index%jA,n=Math.floor(e.index/jA);return{opacity:[1,.4,1],scale:[1,.85,1],transition:{delay:t*.15+n*(jA*.15-.2),duration:1,ease:`easeInOut`}}}},nue=(0,kA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Uk(),s=(0,kA.useRef)(!1),c=(0,kA.useRef)(!1),l=(0,kA.useCallback)(async()=>{c.current||=(c.current=!0,await o.start(`animate`),await o.start(`normal`),!1)},[o]),u=(0,kA.useCallback)(async()=>{c.current&&=(await o.start(`normal`),!1)},[o]);(0,kA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:l,stopAnimation:u}));let d=(0,kA.useCallback)(t=>{s.current||l(),e?.(t)},[l,e]),f=(0,kA.useCallback)(e=>{s.current||u(),t?.(e)},[u,t]);return(0,AA.jsx)(`div`,{className:Gk(`inline-flex items-center justify-center`,n),onMouseEnter:d,onMouseLeave:f,...i,children:(0,AA.jsx)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:eue.map((e,t)=>(0,AA.jsx)(Vk.circle,{animate:o,custom:{index:t},cx:e.cx,cy:e.cy,initial:`normal`,r:`1`,variants:tue},`${e.cx}-${e.cy}`))})})}),nue.displayName=`GripVerticalIcon`})),MA=o((()=>{Ile(),Rle(),zle(),Ble(),Hle(),Wle(),Kle(),Jle(),Zle(),Qle(),$le(),rue()})),iue=o((()=>{}));function aue({onSelect:e}){let[t,n]=(0,NA.useState)(``),[r,i]=(0,NA.useState)([]),[a,o]=(0,NA.useState)(!1),[s,c]=(0,NA.useState)(0),l=(0,NA.useRef)(null),u=(0,NA.useRef)(null);(0,NA.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&o(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);function d(e){let t=e.target.value;if(n(t),c(0),clearTimeout(l.current),t.trim().length<2){i([]),o(!1);return}l.current=setTimeout(async()=>{let e=await Ere(t.trim());i(e),o(e.length>0)},200)}function f(e){a&&(e.key===`ArrowDown`?(e.preventDefault(),c(e=>Math.min(e+1,r.length-1))):e.key===`ArrowUp`?(e.preventDefault(),c(e=>Math.max(e-1,0))):e.key===`Enter`&&r[s]?(e.preventDefault(),p(r[s])):e.key===`Escape`&&o(!1))}function p(t){o(!1),n(``),i([]),e(t.path)}function m(e){if(!e||!t.trim())return e;let n=RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)})`,`gi`);return e.replace(n,`<mark>$1</mark>`)}return(0,PA.jsxs)(`div`,{className:`search-wrapper`,ref:u,children:[(0,PA.jsx)(`span`,{className:`search-icon`,children:(0,PA.jsx)(iA,{size:14})}),(0,PA.jsx)(`input`,{type:`text`,className:`search-input`,placeholder:`Search... (Ctrl+K)`,value:t,onChange:d,onKeyDown:f,onFocus:()=>r.length>0&&o(!0)}),a&&(0,PA.jsx)(`div`,{className:`search-results`,children:r.map((e,t)=>(0,PA.jsxs)(`div`,{className:`search-result ${t===s?`selected`:``}`,onClick:()=>p(e),onMouseEnter:()=>c(t),children:[(0,PA.jsx)(`div`,{className:`search-result-title`,children:e.title}),(0,PA.jsx)(`div`,{className:`search-result-path`,children:e.path}),e.snippet&&(0,PA.jsx)(`div`,{className:`search-result-snippet`,dangerouslySetInnerHTML:{__html:m(e.snippet)}})]},e.path))})]})}var NA,PA,oue=o((()=>{NA=u(p()),Vy(),MA(),iue(),PA=N()})),sue=o((()=>{}));function cue({item:e,onNewDoc:t}){let[n,r]=(0,FA.useState)(!0),i=je(),a=Ne();if(e.type===`file`){let n=i.pathname===`/doc/${e.path}`;return(0,IA.jsxs)(Hn,{to:`/doc/${e.path}`,className:`tree-file ${n?`active`:``}`,title:e.title||e.name,children:[(0,IA.jsx)(`span`,{className:`tree-icon`,children:(0,IA.jsx)(Yk,{size:LA})}),(0,IA.jsx)(`span`,{className:`tree-label`,children:e.title||e.name}),(0,IA.jsx)(`span`,{className:`tree-new-doc-btn`,title:`New child document`,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(e.path)},children:(0,IA.jsx)(tA,{size:14})})]})}return(0,IA.jsxs)(`div`,{className:`tree-folder`,children:[(0,IA.jsxs)(`div`,{className:`tree-folder-header ${i.pathname===`/doc/${e.path}`?`active`:``}`,children:[(0,IA.jsx)(`span`,{className:`tree-arrow ${n?`expanded`:``}`,onClick:e=>{e.stopPropagation(),r(!n)},children:(0,IA.jsx)(dA,{size:14})}),(0,IA.jsxs)(`span`,{className:`tree-folder-link`,onClick:()=>{a(`/doc/${e.path}`),n||r(!0)},children:[(0,IA.jsx)(`span`,{className:`tree-icon`,children:(0,IA.jsx)(Qk,{size:LA})}),(0,IA.jsx)(`span`,{className:`tree-label`,children:e.title||e.name})]}),(0,IA.jsx)(`span`,{className:`tree-new-doc-btn`,title:`New child document`,onClick:n=>{n.stopPropagation(),t(e.path)},children:(0,IA.jsx)(tA,{size:14})})]}),n&&e.children&&(0,IA.jsx)(`div`,{className:`tree-children`,children:e.children.map(e=>(0,IA.jsx)(cue,{item:e,onNewDoc:t},e.path))})]})}function lue(){let[e,t]=(0,FA.useState)(()=>{let e=localStorage.getItem(`doku-theme`);return e?e===`dark`:window.matchMedia(`(prefers-color-scheme: dark)`).matches});return(0,FA.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e?`dark`:`light`),localStorage.setItem(`doku-theme`,e?`dark`:`light`)},[e]),(0,IA.jsx)(`button`,{className:`dark-mode-toggle`,onClick:()=>t(e=>!e),title:e?`Switch to light mode`:`Switch to dark mode`,children:e?(0,IA.jsx)(_A,{size:16}):(0,IA.jsx)(bA,{size:16})})}function uue({tree:e,projectName:t,onNewDoc:n,onSearchSelect:r,sidebarWidth:i,onResize:a}){let o=(0,FA.useRef)(!1);(0,FA.useEffect)(()=>{function e(e){o.current&&a(Math.max(200,e.clientX))}function t(){o.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``}return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[a]);function s(e){e.preventDefault(),o.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`}return(0,IA.jsxs)(`aside`,{className:`sidebar`,style:{width:i,minWidth:200},children:[(0,IA.jsx)(`div`,{className:`sidebar-header`,children:(0,IA.jsx)(`h2`,{className:`sidebar-title`,children:t||`Doku`})}),(0,IA.jsx)(`div`,{className:`sidebar-search`,children:(0,IA.jsx)(aue,{onSelect:r})}),(0,IA.jsxs)(`nav`,{className:`sidebar-tree`,children:[e.length===0&&(0,IA.jsx)(`div`,{className:`sidebar-empty`,children:`No documents yet.`}),e.map(e=>(0,IA.jsx)(cue,{item:e,onNewDoc:n},e.path)),(0,IA.jsx)(`button`,{className:`sidebar-new-root-btn`,onClick:()=>n(``),children:(0,IA.jsx)(tA,{size:14})})]}),(0,IA.jsx)(`div`,{className:`sidebar-bottom`,children:(0,IA.jsx)(lue,{})}),(0,IA.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:s})]})}var FA,IA,LA,due=o((()=>{FA=u(p()),Xn(),oue(),MA(),sue(),IA=N(),LA=16}));function RA(e){this.content=e}var fue=o((()=>{RA.prototype={constructor:RA,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new RA(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new RA(n)},addToStart:function(e,t){return new RA([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new RA(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new RA(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=RA.from(e),e.size?new RA(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=RA.from(e),e.size?new RA(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=RA.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},RA.from=function(e){if(e instanceof RA)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new RA(t)}}));function pue(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=pue(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function mue(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=mue(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function zA(e,t){return JA.index=e,JA.offset=t,JA}function BA(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!BA(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!BA(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}function hue(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(hue(a.content,t-i-1,n-i-1)))}function gue(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=gue(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function _ue(e,t,n){if(n.openStart>e.depth)throw new XA(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new XA(`Inconsistent open depths`);return vue(e,t,n,0)}function vue(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=vue(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return WA(a,GA(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return WA(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=xue(n,e);return WA(a,bue(e,i,o,t,r))}}function yue(e,t){if(!t.type.compatibleContent(e.type))throw new XA(`Cannot join `+t.type.name+` onto `+e.type.name)}function VA(e,t,n){let r=e.node(n);return yue(r,t.node(n)),r}function HA(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function UA(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(HA(e.nodeAfter,r),a++));for(let e=a;e<o;e++)HA(i.child(e),r);t&&t.depth==n&&t.textOffset&&HA(t.nodeBefore,r)}function WA(e,t){return e.type.checkContent(t),e.copy(t)}function bue(e,t,n,r,i){let a=e.depth>i&&VA(e,t,i+1),o=r.depth>i&&VA(n,r,i+1),s=[];return UA(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(yue(a,o),HA(WA(a,bue(e,t,n,r,i+1)),s)):(a&&HA(WA(a,GA(e,t,i+1)),s),UA(t,n,i,s),o&&HA(WA(o,GA(n,r,i+1)),s)),UA(r,null,i,s),new R(s)}function GA(e,t,n){let r=[];return UA(null,e,n,r),e.depth>n&&HA(WA(VA(e,t,n+1),GA(e,t,n+1)),r),UA(t,null,n,r),new R(r)}function xue(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(R.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}function Sue(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Cue(e){let t=[];do t.push(wue(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function wue(e){let t=[];do t.push(Tue(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Tue(e){let t=kue(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Due(e,t);else break;return t}function Eue(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Due(e,t){let n=Eue(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Eue(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Oue(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function kue(e){if(e.eat(`(`)){let t=Cue(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Oue(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Aue(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function jue(e,t){return t-e}function Mue(e,t){let n=[];return r(t),n.sort(jue);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Nue(e){let t=Object.create(null);return n(Mue(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Mue(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new tj(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(jue);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Pue(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Fue(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Iue(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Lue(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Rue(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new nde(e,r,t[r]);return n}function zue(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}function Bue(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Vue(e){return e.tag!=null}function Hue(e){return e.style!=null}function Uue(e,t,n){return t==null?e&&e.whitespace==`pre`?cj|lj:n&~uj:(t?cj:0)|(t===`full`?lj:0)}function Wue(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&sj.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Gue(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Kue(e){let t={};for(let n in e)t[n]=e[n];return t}function que(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}function Jue(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function KA(e){return e.document||window.document}function Yue(e){let t=mj.get(e);return t===void 0&&mj.set(e,t=Xue(e)),t}function Xue(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function qA(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Yue(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=qA(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var R,JA,YA,XA,z,ZA,Zue,Que,QA,$A,$ue,ej,ede,tj,tde,nj,nde,rj,ij,aj,oj,rde,sj,cj,lj,uj,dj,fj,pj,mj,hj=o((()=>{fue(),R=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return pue(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return mue(this,e,t,n)}findIndex(e){if(e==0)return zA(0,e);if(e==this.size)return zA(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?zA(t+1,i):zA(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}},R.empty=new R([],0),JA={index:0,offset:0},YA=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&BA(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}},YA.none=[],XA=class extends Error{},z=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=gue(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(hue(this.content,t+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(R.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}},z.empty=new z(R.empty,0,0),ZA=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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 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 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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return YA.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new $A(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=QA.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else QA.set(t,r=new Zue);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Que,i}},Zue=class{constructor(){this.elts=[],this.i=0}},Que=12,QA=new WeakMap,$A=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},$ue=Object.create(null),ej=class e{constructor(e,t,n,r=YA.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||R.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,t,n,r=0){this.content.nodesBetween(e,t,n,r,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,t,n,r){return this.content.textBetween(e,t,n,r)}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,t,n){return this.type==e&&BA(this.attrs,t||e.defaultAttrs||$ue)&&YA.sameSet(this.marks,n||YA.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return z.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new z(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return _ue(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ZA.resolveCached(this,e)}resolveNoCache(e){return ZA.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),Sue(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=R.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);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=YA.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!YA.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t 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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=R.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}},ej.prototype.text=void 0,ede=class e extends ej{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sue(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}},tj=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new tde(t,n);if(r.next==null)return e.empty;let i=Cue(r);r.next&&r.err(`Unexpected trailing text`);let a=Nue(Aue(i));return Pue(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return R.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
16
|
+
`)}},tj.empty=new tj(!0),tde=class{constructor(e,t){this.string=e,this.nodeTypes=t,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 SyntaxError(e+` (in content expression '`+this.string+`')`)}},nj=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Rue(e,n.attrs),this.defaultAttrs=Fue(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==tj.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:Iue(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new ej(this,this.computeAttrs(e),R.from(t),YA.setFrom(n))}createChecked(e=null,t,n){return t=R.from(t),this.checkContent(t),new ej(this,this.computeAttrs(e),t,YA.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=R.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(R.empty,!0);return i?new ej(this,e,t.append(i),YA.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Lue(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:YA.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}},nde=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?zue(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},rj=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Rue(e,r.attrs),this.excluded=null;let i=Fue(this.attrs);this.instance=i?new YA(this,i):null}create(e=null){return!e&&this.instance?this.instance:new YA(this,Iue(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Lue(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},ij=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=RA.from(e.nodes),t.marks=RA.from(e.marks||{}),this.nodes=nj.compile(this.spec.nodes,this),this.marks=rj.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=tj.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Bue(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Bue(this,n.split(` `))}this.nodeFromJSON=e=>ej.fromJSON(this,e),this.markFromJSON=e=>YA.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof nj))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ede(n,n.defaultAttrs,e,YA.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}},aj=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Vue(e))this.tags.push(e);else if(Hue(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new fj(this,t,!1);return n.addAll(e,YA.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new fj(this,t,!0);return n.addAll(e,YA.none,t.from,t.to),z.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Gue(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Kue(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Kue(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},oj={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},rde={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},sj={ol:!0,ul:!0},cj=1,lj=2,uj=4,dj=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=YA.none,this.match=i||(a&uj?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(R.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&cj)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=R.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!oj.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},fj=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Uue(null,t.preserveWhitespace,0)|(n?uj:0);i=r?new dj(r.type,r.attrs,YA.none,!0,t.topMatch||r.type.contentMatch,a):n?new dj(null,null,YA.none,!0,null,a):new dj(e.schema.topNodeType,null,YA.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&lj?`full`:this.localPreserveWS||(r.options&cj)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
17
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;sj.hasOwnProperty(a)&&this.parser.normalizeLists&&Wue(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:rde.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(oj.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
18
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=YA.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):que(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Uue(e,i,a.options);a.options&uj&&a.content.length==0&&(o|=uj);let s=YA.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):que(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new dj(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=cj);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}},pj=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=KA(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=qA(KA(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&qA(KA(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return qA(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Jue(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Jue(e.marks)}},mj=new WeakMap}));function ide(e,t){return e+t*kj}function ade(e){return e&Oj}function ode(e){return(e-(e&Oj))/kj}function gj(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(gj(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return R.fromArray(r)}function _j(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function sde(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Vj(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Bj(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function cde(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof rj){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Vj(t.from,t.to,t.style)))}function vj(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Wj(s,l,z.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Vj(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new z(R.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Wj(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(R.empty,!0);e.replace(s,s,new z(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function lde(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function yj(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!lde(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function ude(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=R.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=R.from(r.node(e).copy(u)),d++):c--;let f=R.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=R.from(i.node(e).copy(f)),p++):l++;e.step(new Gj(c,l,o,s,new z(u.append(f),d,p),u.size-d,!0))}function dde(e,t,n=null,r=e){let i=pde(e,t),a=i&&mde(r,t);return a?i.map(fde).concat({type:t,attrs:n}).concat(a.map(fde)):null}function fde(e){return{type:e,attrs:null}}function pde(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function mde(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function hde(e,t,n){let r=R.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=R.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Gj(i,a,i,a,new z(r,0,0),n.length,!0))}function gde(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&yde(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&vde(e,t,n,a),vj(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Gj(c,l,c+1,l-1,new z(R.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&_de(e,t,n,a),!1}})}function _de(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function vde(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
19
|
+
`))}})}function yde(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function bde(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Gj(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new z(R.from(o),0,0),1,!0))}function bj(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function xde(e,t,n=1,r){let i=e.doc.resolve(t),a=R.empty,o=R.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=R.from(i.node(e).copy(a));let t=r&&r[s];o=R.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Wj(t,t,new z(a.append(o),n,n),!0))}function xj(e,t){let n=e.resolve(t),r=n.index();return Cde(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Sde(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Cde(e,t){return!!(e&&t&&!e.isLeaf&&Sde(e,t))}function Sj(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Cde(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function wde(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);vde(e,r.node(),r.before(),s)}o.inlineContent&&vj(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Wj(l,c.map(t+n,-1),z.empty,!0)),r===!0){let t=e.doc.resolve(l);_de(e,t.node(),t.before(),e.steps.length)}return e}function Tde(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Ede(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+(n>0?1:0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Cj(e,t,n=t,r=z.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Dde(i,a,r)?new Wj(t,n,r):new Ide(i,a,r).fit()}function Dde(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}function wj(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(wj(e.firstChild.content,t-1,n)))}function Tj(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Tj(e.lastChild.content,t-1,n)))}function Ej(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Ode(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Ode(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(R.empty,!0)))),e.copy(r)}function Dj(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!kde(n,a.content,o)?s:null}function kde(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Ade(e){return e.spec.defining||e.spec.definingForContent}function jde(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Dde(i,a,r))return e.step(new Wj(t,n,r));let o=Fde(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Ade(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new z(Mde(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Mde(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Mde(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(R.empty,!0))}return e}function Nde(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Tde(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new z(R.from(r),0,0))}function Pde(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Fde(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Fde(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Ide,Kj,qj,Jj,Yj,Xj=o((()=>{hj(),Oj=65535,kj=2**16,Aj=1,jj=2,Mj=4,Nj=8,Pj=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Nj)>0}get deletedBefore(){return(this.delInfo&(Aj|Mj))>0}get deletedAfter(){return(this.delInfo&(jj|Mj))>0}get deletedAcross(){return(this.delInfo&Mj)>0}},Fj=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=ade(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+ode(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ide(o/3,e-s),f=e==s?jj:e==u?Aj:Mj;return(t<0?e!=s:e!=u)&&(f|=Nj),new Pj(a,f,d)}r+=l-c}return n?e+r:new Pj(e+r,0,null)}touches(e,t){let n=0,r=ade(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}},Fj.empty=new Fj([]),Ij=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Pj(e,r,null)}},Lj=Object.create(null),Rj=class{getMap(){return Fj.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Lj[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Lj)throw RangeError(`Duplicate use of step JSON ID `+e);return Lj[e]=t,t.prototype.jsonID=e,t}},zj=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof XA)return e.fail(t.message);throw t}}},Bj=class e extends Rj{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new z(gj(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return zj.fromReplace(e,this.from,this.to,i)}invert(){return new Vj(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},Rj.jsonID(`addMark`,Bj),Vj=class e extends Rj{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new z(gj(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return zj.fromReplace(e,this.from,this.to,n)}invert(){return new Bj(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},Rj.jsonID(`removeMark`,Vj),Hj=class e extends Rj{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return zj.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return zj.fromReplace(e,this.pos,this.pos+1,new z(R.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Uj(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},Rj.jsonID(`addNodeMark`,Hj),Uj=class e extends Rj{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return zj.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return zj.fromReplace(e,this.pos,this.pos+1,new z(R.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Hj(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},Rj.jsonID(`removeNodeMark`,Uj),Wj=class e extends Rj{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&_j(e,this.from,this.to)?zj.fail(`Structure replace would overwrite content`):zj.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Fj([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?z.empty:new z(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?z.empty:new z(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,z.fromJSON(t,n.slice),!!n.structure)}},Wj.MAP_BIAS=1,Rj.jsonID(`replace`,Wj),Gj=class e extends Rj{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(_j(e,this.from,this.gapFrom)||_j(e,this.gapTo,this.to)))return zj.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return zj.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?zj.fromReplace(e,this.from,this.to,n):zj.fail(`Content does not fit in gap`)}getMap(){return new Fj([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,z.fromJSON(t,n.slice),n.insert,!!n.structure)}},Rj.jsonID(`replaceAround`,Gj),Ide=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=R.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new z(i,a,o);return e>-1?new Gj(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Wj(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Ej(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(R.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ej(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new z(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ej(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new z(wj(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new z(wj(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Ode(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Tj(this.placed,t,R.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?z.empty:new z(wj(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new z(wj(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Dj(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Dj(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Dj(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Tj(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Tj(this.placed,this.depth,R.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(R.empty,!0);e.childCount&&(this.placed=Tj(this.placed,this.frontier.length,e))}},Kj=class e extends Rj{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return zj.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return zj.fromReplace(e,this.pos,this.pos+1,new z(R.from(r),0,t.isLeaf?0:1))}getMap(){return Fj.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}},Rj.jsonID(`attr`,Kj),qj=class e extends Rj{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return zj.ok(n)}getMap(){return Fj.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}},Rj.jsonID(`docAttr`,qj),Jj=class extends Error{},Jj=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Jj.prototype=Object.create(Error.prototype),Jj.prototype.constructor=Jj,Jj.prototype.name=`TransformError`,Yj=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ij}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Jj(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=z.empty){let r=Cj(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new z(R.from(n),0,0))}delete(e,t){return this.replace(e,t,z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return jde(this,e,t,n),this}replaceRangeWith(e,t,n){return Nde(this,e,t,n),this}deleteRange(e,t){return Pde(this,e,t),this}lift(e,t){return ude(this,e,t),this}join(e,t=1){return wde(this,e,t),this}wrap(e,t){return hde(this,e,t),this}setBlockType(e,t=e,n,r=null){return gde(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return bde(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Kj(e,t,n)),this}setDocAttribute(e,t){return this.step(new qj(e,t)),this}addNodeMark(e,t){return this.step(new Hj(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof YA)t.isInSet(n.marks)&&this.step(new Uj(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Uj(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return xde(this,e,t,n),this}addMark(e,t,n){return sde(this,e,t,n),this}removeMark(e,t,n){return cde(this,e,t,n),this}clearIncompatible(e,t,n){return vj(this,e,t,n),this}}}));function Lde(e){!tM&&!e.parent.inlineContent&&(tM=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}function Zj(e,t,n,r,i,a=!1){if(t.inlineContent)return B.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Zj(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&rM.isSelectable(r))return rM.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Rde(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Wj||i instanceof Gj))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection($j.near(e.doc.resolve(o),n))}function zde(e,t){return!t||!e?e:e.bind(t)}function Bde(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Bde(i,t,{})),n[r]=i}return n}function Vde(e){return e in dM?e+`$`+ ++dM[e]:(dM[e]=0,e+`$`)}var Qj,$j,eM,tM,B,nM,rM,Hde,iM,Ude,aM,oM,sM,Wde,cM,Gde,lM,Kde,uM,dM,fM,pM=o((()=>{hj(),Xj(),Qj=Object.create(null),$j=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new eM(e.min(t),e.max(t))]}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 t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=z.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?z.empty:t),o==0&&Rde(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Rde(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new B(e):Zj(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Zj(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Zj(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new iM(e.node(0))}static atStart(e){return Zj(e,e,0,0,1)||new iM(e)}static atEnd(e){return Zj(e,e,e.content.size,e.childCount,-1)||new iM(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Qj[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Qj)throw RangeError(`Duplicate use of selection JSON ID `+e);return Qj[e]=t,t.prototype.jsonID=e,t}getBookmark(){return B.between(this.$anchor,this.$head).getBookmark()}},$j.prototype.visible=!0,eM=class{constructor(e,t){this.$from=e,this.$to=t}},tM=!1,B=class e extends $j{constructor(e,t=e){Lde(e),Lde(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return $j.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=z.empty){if(super.replace(e,t),t==z.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new nM(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=$j.findFrom(n,r,!0)||$j.findFrom(n,-r,!0);if(e)n=e.$head;else return $j.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=($j.findFrom(t,-r,!0)||$j.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}},$j.jsonID(`text`,B),nM=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return B.between(e.resolve(this.anchor),e.resolve(this.head))}},rM=class e extends $j{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?$j.near(a):new e(a)}content(){return new z(R.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Hde(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}},rM.prototype.visible=!1,$j.jsonID(`node`,rM),Hde=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new nM(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&rM.isSelectable(n)?new rM(t):$j.near(t)}},iM=class e extends $j{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=z.empty){if(t==z.empty){e.delete(0,e.doc.content.size);let t=$j.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Ude}},$j.jsonID(`all`,iM),Ude={map(){return this},resolve(e){return new iM(e)}},aM=1,oM=2,sM=4,Wde=class extends Yj{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 RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|aM)&~oM,this.storedMarks=null,this}get selectionSet(){return(this.updated&aM)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=oM,this}ensureMarks(e){return YA.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&oM)>0}addStep(e,t){super.addStep(e,t),this.updated&=~oM,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||YA.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection($j.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,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|=sM,this}get scrolledIntoView(){return(this.updated&sM)>0}},cM=class{constructor(e,t,n){this.name=e,this.init=zde(t.init,n),this.apply=zde(t.apply,n)}},Gde=[new cM(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new cM(`selection`,{init(e,t){return e.selection||$j.atStart(t.doc)},apply(e){return e.selection}}),new cM(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new cM(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],lM=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Gde.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new cM(e.key,e.spec.state,e))})}},Kde=class e{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,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Wde(this)}static create(t){let n=new lM(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new lM(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new lM(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=ej.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=$j.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}},uM=class{constructor(e){this.spec=e,this.props={},e.props&&Bde(e.props,this,this.props),this.key=e.key?e.key.key:Vde(`plugin`)}getState(e){return e[this.key]}},dM=Object.create(null),fM=class{constructor(e=`key`){this.key=Vde(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}}));function qde(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:mM(e))){let n=e.parentNode;if(!n||n.nodeType!=1||hM(e)||vN.test(e.nodeName)||e.contentEditable==`false`)return!1;t=fN(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?mM(e):0}else return!1}}function mM(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Jde(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=mM(e)}else if(e.parentNode&&!hM(e))t=fN(e),e=e.parentNode;else return null}}function Yde(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!hM(e))t=fN(e)+1,e=e.parentNode;else return null}}function Xde(e,t,n){for(let r=t==0,i=t==mM(e);r||i;){if(e==n)return!0;let t=fN(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==mM(e)}}function hM(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}function gM(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Zde(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Qde(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(mM(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(mM(r.startContainer),r.startOffset)}}}function $de(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function _M(e,t){return typeof e==`number`?e:e[t]}function efe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function tfe(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=pN(o);continue}let e=o,n=e==a.body,s=n?$de(a):efe(e),c=0,l=0;if(t.top<s.top+_M(r,`top`)?l=-(s.top-t.top+_M(i,`top`)):t.bottom>s.bottom-_M(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+_M(i,`top`)-s.top:t.bottom-s.bottom+_M(i,`bottom`)),t.left<s.left+_M(r,`left`)?c=-(s.left-t.left+_M(i,`left`)):t.right>s.right-_M(r,`right`)&&(c=t.right-s.right+_M(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:pN(o)}}function nfe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:rfe(e.dom)}}function rfe(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=pN(r));return t}function ife({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;afe(n,r==0?0:r-t)}function afe(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}function ofe(e){if(e.setActive)return e.setActive();if(zN)return e.focus(zN);let t=rfe(e);e.focus(zN==null?{get preventScroll(){return zN={preventScroll:!0},!0}}:void 0),zN||(zN=!1,afe(t,0))}function sfe(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=hN(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?cfe(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:sfe(n,i)}function cfe(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=yM(r,1);if(n.top!=n.bottom&&vM(t,n)){i={node:e,offset:a+(t.left>=(n.left+n.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function vM(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function lfe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function ufe(e,t,n){let{node:r,offset:i}=sfe(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function dfe(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function ffe(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(vM(t,i))return ffe(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function pfe(e,t){let n=e.dom.ownerDocument,r,i=0,a=Qde(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!vM(t,n)||(o=ffe(e.dom,t,n),!o))return null}if(MN)for(let e=o;r&&e;e=pN(e))e.draggable&&(r=void 0);if(o=lfe(o,t),r){if(ON&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;LN&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=dfe(e,r,i,t))}s??=ufe(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function mfe(e){return e.top<e.bottom||e.left<e.right}function yM(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(mfe(e))return e}return Array.prototype.find.call(n,mfe)||e.getBoundingClientRect()}function hfe(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=LN||ON;if(r.nodeType==3)if(o&&(BN.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=yM(hN(r,i,i),n);if(ON&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=yM(hN(r,i-1,i-1),-1);if(t.top==e.top){let n=yM(hN(r,i,i+1),-1);if(n.top!=e.top)return bM(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,bM(yM(hN(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==mM(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return xM(e.getBoundingClientRect(),!1)}if(a==null&&i<mM(r)){let e=r.childNodes[i];if(e.nodeType==1)return xM(e.getBoundingClientRect(),!0)}return xM(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==mM(r))){let e=r.childNodes[i-1],t=e.nodeType==3?hN(e,mM(e)-(o?0:1)):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return bM(yM(t,1),!1)}if(a==null&&i<mM(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?hN(e,0,o?0:1):e.nodeType==1?e:null:null;if(t)return bM(yM(t,-1),!0)}return bM(yM(r.nodeType==3?hN(r):r,-n),n>=0)}function bM(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function xM(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function gfe(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function _fe(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return gfe(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=hfe(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=hN(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}function vfe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!VN.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:gfe(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}function yfe(e,t,n){return HN==t&&UN==n?WN:(HN=t,UN=n,WN=n==`up`||n==`down`?_fe(e,t,n):vfe(e,t,n))}function bfe(e,t,n,r,i){wfe(r,t,e);let a=new $N(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}function xfe(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Tfe(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof QN){let t=r?r.previousSibling:e.lastChild;xfe(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Tfe(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}function SM(e,t,n){if(e.length==0)return iP;let r=n?iP[0]:new rP,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new rP(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new rP(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Sfe(e,t,n,r){if(n==iP&&r==iP)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=iP[0],i=t)}Cfe(i,o||iP[0],a)}return i}function Cfe(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function wfe(e,t,n){return Sfe(e,e,iP,SM(t,n,e.nodeType!=1))}function CM(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Tfe(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function Efe(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof QN)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Dfe(e,t){return e.type.side-t.type.side}function Ofe(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Dfe);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function kfe(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Afe(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function wM(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function TM(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(yN(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&rM.isSelectable(e)&&i.parent&&!(e.isInline&&Xde(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new rM(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=OM(e,u,s,n)}return l}function jfe(e){return e.editable?e.hasFocus():zfe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function EM(e,t=!1){let n=e.state.selection;if(Ife(e,n),jfe(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&AN){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&_N(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ffe(e);else{let{anchor:r,head:i}=n,a,o;oP&&!(n instanceof B)&&(n.$from.parent.inlineContent||(a=Mfe(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Mfe(e,n.to))),e.docView.setSelection(r,i,e,t),oP&&(a&&Nfe(a),o&&Nfe(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Pfe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}function Mfe(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(MN&&i&&i.contentEditable==`false`)return DM(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return DM(i);if(a)return DM(a)}}function DM(e){return e.contentEditable=`true`,MN&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Nfe(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Pfe(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!jfe(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ffe(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,fN(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&EN&&DN<=11&&(n.disabled=!0,n.disabled=!1)}function Ife(e,t){if(t instanceof rM){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Lfe(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Lfe(e)}function Lfe(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function OM(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||B.between(t,n,r)}function Rfe(e){return e.editable&&!e.hasFocus()?!1:zfe(e)}function zfe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Bfe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return _N(t.node,t.offset,n.anchorNode,n.anchorOffset)}function kM(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&$j.findFrom(a,t)}function AM(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Vfe(e,t,n){let r=e.state.selection;if(r instanceof B){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return AM(e,new B(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=kM(e.state,t);return n&&n instanceof rM?AM(e,n):!1}else if(!(PN&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?rM.isSelectable(i)?AM(e,new rM(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):LN?AM(e,new B(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof rM&&r.node.isInline)return AM(e,new B(t>0?r.$to:r.$from));else{let n=kM(e.state,t);return n?AM(e,n):!1}}function jM(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function MM(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function NM(e,t){return t<0?Hfe(e):Ufe(e)}function Hfe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(ON&&n.nodeType==1&&r<jM(n)&&MM(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(MM(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Wfe(n))break;else{let t=n.previousSibling;for(;t&&MM(t,-1);)i=n.parentNode,a=fN(t),t=t.previousSibling;if(t)n=t,r=jM(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?PM(e,n,r):i&&PM(e,i,a)}function Ufe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=jM(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(MM(e,1))a=n,o=++r;else break}else if(Wfe(n))break;else{let t=n.nextSibling;for(;t&&MM(t,1);)a=t.parentNode,o=fN(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=jM(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&PM(e,a,o)}function Wfe(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Gfe(e,t){for(;e&&t==e.childNodes.length&&!hM(e);)t=fN(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Kfe(e,t){for(;e&&!t&&!hM(e);)t=fN(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function PM(e,t,n){if(t.nodeType!=3){let e,r;(r=Gfe(t,n))?(t=r,n=0):(e=Kfe(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(yN(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&EM(e)},50)}function qfe(e,t){let n=e.state.doc.resolve(t);if(!(AN||FN)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Jfe(e,t,n){let r=e.state.selection;if(r instanceof B&&!r.empty||n.indexOf(`s`)>-1||PN&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=kM(e.state,t);if(n&&n instanceof rM)return AM(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof iM?$j.near(n,t):$j.findFrom(n,t);return o?AM(e,o):!1}return!1}function Yfe(e,t){if(!(e.state.selection instanceof B))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Xfe(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Zfe(e){if(!MN||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Xfe(e,n,`true`),setTimeout(()=>Xfe(e,n,`false`),20)}return!1}function Qfe(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function $fe(e,t){let n=t.keyCode,r=Qfe(t);if(n==8||PN&&n==72&&r==`c`)return Yfe(e,-1)||NM(e,-1);if(n==46&&!t.shiftKey||PN&&n==68&&r==`c`)return Yfe(e,1)||NM(e,1);if(n==13||n==27)return!0;if(n==37||PN&&n==66&&r==`c`){let t=n==37?qfe(e,e.state.selection.from)==`ltr`?-1:1:-1;return Vfe(e,t,r)||NM(e,t)}else if(n==39||PN&&n==70&&r==`c`){let t=n==39?qfe(e,e.state.selection.from)==`ltr`?1:-1:1;return Vfe(e,t,r)||NM(e,t)}else if(n==38||PN&&n==80&&r==`c`)return Jfe(e,-1,r)||NM(e,-1);else if(n==40||PN&&n==78&&r==`c`)return Zfe(e)||Jfe(e,1,r)||NM(e,1);else if(r==(PN?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function FM(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||pj.fromSchema(e.state.schema),s=ope(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=cP[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
20
|
+
|
|
21
|
+
`),slice:t}}function epe(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new z(R.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
22
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=pj.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=cpe(n),LN&&lpe(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||aj.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!sP.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=upe(ape(s,+u[1],+u[2]),u[4]);else if(s=z.maxOpen(tpe(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=ape(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}function tpe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&rpe(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=ipe(a[a.length-1],i.length));let n=npe(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return R.from(a)}return e}function npe(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,R.from(e));return e}function rpe(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=rpe(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(R.from(npe(n,e,i+1))))}}function ipe(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ipe(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(R.empty,!0);return e.copy(n.append(r))}function IM(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=IM(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function ape(e,t,n){return t<e.openStart&&(e=new z(IM(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new z(IM(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}function ope(){return lP||=document.implementation.createHTMLDocument(`title`)}function spe(e){let t=window.trustedTypes;return t?(uP||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),uP.createHTML(e)):e}function cpe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=ope().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&cP[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=spe(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function lpe(e){let t=e.querySelectorAll(AN?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function upe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=R.from(t.create(r[e+1],i)),a++,o++}return new z(i,a,o)}function dpe(e){for(let t in dP){let n=dP[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{ppe(e,t)&&!zM(e,t)&&(e.editable||!(t.type in fP))&&n(e,t)},pP[t]?{passive:!0}:void 0)}MN&&e.dom.addEventListener(`input`,()=>null),RM(e)}function LM(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function fpe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function RM(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>zM(e,t))})}function zM(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function ppe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mpe(e,t){!zM(e,t)&&dP[t.type]&&(e.editable||!(t.type in fP))&&dP[t.type](e,t)}function BM(e){return{left:e.clientX,top:e.clientY}}function hpe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function VM(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function HM(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function gpe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&rM.isSelectable(r)?(HM(e,new rM(n),`pointer`),!0):!1}function _pe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof rM&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(rM.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(HM(e,rM.create(e.state.doc,i),`pointer`),!0)}function vpe(e,t,n,r,i){return VM(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?_pe(e,n):gpe(e,n))}function ype(e,t,n,r){return VM(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function bpe(e,t,n,r){return VM(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||xpe(e,n,r)}function xpe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(HM(e,B.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)HM(e,B.create(r,a+1,a+1+n.content.size),`pointer`);else if(rM.isSelectable(n))HM(e,rM.create(r,a),`pointer`);else continue;return!0}}function UM(e){return WM(e)}function Spe(e,t){return e.composing?!0:MN&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}function Cpe(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}function wpe(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>WM(e),t))}function Tpe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Dpe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Epe(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Jde(t.focusNode,t.focusOffset),r=Yde(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Dpe(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function WM(e,t=!1){if(!(IN&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Tpe(e),t||e.docView&&e.docView.dirty){let n=TM(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Ope(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}function kpe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Ape(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?GM(e,r.value,null,i,t):GM(e,r.textContent,r.innerHTML,i,t)},50)}function GM(e,t,n,r,i){let a=epe(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||z.empty)))return!0;if(!a)return!1;let o=kpe(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function KM(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}function qM(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[bP]:!n}function jpe(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(BM(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=epe(e,KM(t.dataTransfer),vP?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&qM(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||z.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Ede(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&rM.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new rM(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(OM(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}function JM(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function Mpe(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==OP?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=QM(Npe(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new DP(t.sort($M),s)}function YM(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new wP(i.from+t,i.to+t,i.type))}return n}function Npe(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function XM(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function ZM(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function QM(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=XM(e,t,o+n);if(s){a=!0;let e=QM(s,t,n+o+1,r);e!=OP&&i.push(o,o+t.nodeSize,e)}});let o=YM(a?ZM(e):e,-n).sort($M);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new DP(o,i):OP}function $M(e,t){return e.from-t.from||e.to-t.to}function eN(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),tN(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),tN(t,i,r.copy(a.from,r.to)));break}}}return t}function tN(e,t,n){for(;t<e.length&&$M(n,e[t])>0;)t++;e.splice(t,0,n)}function nN(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=OP&&t.push(r)}),e.cursorWrapper&&t.push(DP.create(e.state.doc,[e.cursorWrapper.deco])),kP.from(t)}function Ppe(e){if(!PP.has(e)&&(PP.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=ON,FP)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.`),FP=!0}}function rN(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return _N(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Fpe(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return rN(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?rN(e,n):null}function Ipe(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Lpe(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Rpe(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],yN(c)||l.push({node:c.focusNode,offset:c.focusOffset})),AN&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||aj.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:zpe,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function zpe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(MN&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||MN&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}function Bpe(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=TM(e,t);if(n&&!e.state.selection.eq(n)){if(AN&&IN&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,gM(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Rpe(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Upe(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(NN&&e.input.lastIOSEnter>Date.now()-225||IN)&&i.some(e=>e.nodeType==1&&!IP.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,gM(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof B&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=iN(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof B&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),EN&&DN<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((NN&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,gM(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Hpe(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,gM(8,`Backspace`)))){IN&&AN&&e.domObserver.suppressSelectionUpdates();return}AN&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),IN&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,gM(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=iN(e,n.doc,l.sel);t&&!(AN&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||EN&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){EN&&DN<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>EM(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Vpe(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-(g.textOffset?0:1)){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function iN(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:OM(e,t.resolve(n.anchor),t.resolve(n.head))}function Vpe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(R.from(l).eq(e))return{mark:s,type:o}}function Hpe(e,t,n,r,i){if(n-t<=i.pos-r.pos||aN(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(aN(a,!0,!0));return!o.parent.isTextblock||o.pos>n||aN(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function aN(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Upe(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&oN(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&oN(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function oN(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}function sN(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[wP.node(0,e.state.doc.content.size,t)]}function cN(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:wP.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function lN(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Wpe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function uN(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Gpe(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function dN(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var fN,pN,mN,hN,gN,_N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,LN,RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP=o((()=>{pM(),hj(),Xj(),fN=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},pN=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},mN=null,hN=function(e,t,n){let r=mN||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},gN=function(){mN=null},_N=function(e,t,n,r){return n&&(qde(e,t,n,r,-1)||qde(e,t,n,r,1))},vN=/^(img|br|input|textarea|hr)$/i,yN=function(e){return e.focusNode&&_N(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)},bN=typeof navigator<`u`?navigator:null,xN=typeof document<`u`?document:null,SN=bN&&bN.userAgent||``,CN=/Edge\/(\d+)/.exec(SN),wN=/MSIE \d/.exec(SN),TN=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(SN),EN=!!(wN||TN||CN),DN=wN?document.documentMode:TN?+TN[1]:CN?+CN[1]:0,ON=!EN&&/gecko\/(\d+)/i.test(SN),ON&&+(/Firefox\/(\d+)/.exec(SN)||[0,0])[1],kN=!EN&&/Chrome\/(\d+)/.exec(SN),AN=!!kN,jN=kN?+kN[1]:0,MN=!EN&&!!bN&&/Apple Computer/.test(bN.vendor),NN=MN&&(/Mobile\/\w+/.test(SN)||!!bN&&bN.maxTouchPoints>2),PN=NN||(bN?/Mac/.test(bN.platform):!1),FN=bN?/Win/.test(bN.platform):!1,IN=/Android \d/.test(SN),LN=!!xN&&`webkitFontSmoothing`in xN.documentElement.style,RN=LN?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,zN=null,BN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,VN=/[\u0590-\u08ac]/,HN=null,UN=null,WN=!1,GN=0,KN=1,qN=2,JN=3,YN=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=GN,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].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 t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.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,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>fN(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof tP){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof XN&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?fN(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?fN(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=fN(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=fN(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((ON||MN)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
23
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:fN(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(ON&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&MN)&&_N(o.node,o.offset,l.anchorNode,l.anchorOffset)&&_N(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&ON)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?qN:KN,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=JN:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?qN:JN}n=a}this.dirty=qN}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?qN:KN;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},XN=class extends YN{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==GN&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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}},ZN=class extends YN{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},QN=class e extends YN{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=pj.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&JN||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=JN&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=GN){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=GN}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=wM(a,n,o,r)),t>0&&(a=wM(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},$N=class e extends YN{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=pj.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=wfe(u,r,n),l?c=new nP(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new eP(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+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 t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>R.empty)}return e}matchesNode(e,t,n){return this.dirty==GN&&e.eq(this.node)&&CM(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new aP(this,a&&a.node,e);Ofe(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?YA.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==qN)&&(a&&this.protectLocalComposition(e,a),xfe(this.contentDOM,this.children,e),NN&&kfe(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof B)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Afe(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new ZN(this,i,t,r);e.input.compositionNodes.push(a),this.children=wM(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==JN||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=GN}updateOuterDeco(e){if(CM(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Sfe(this.dom,this.nodeDOM,SM(this.outerDeco,this.node,t),SM(e,this.node,t)),this.dom!=n&&(n.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}},eP=class e extends $N{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==JN||this.dirty!=GN&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=GN||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=GN,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=JN)}get domAtom(){return!1}isText(e){return this.node.text==e}},tP=class extends YN{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`}},nP=class extends $N{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==JN)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}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)}},rP=function(e){e&&(this.nodeName=e)},rP.prototype=Object.create(null),iP=[new rP],aP=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Efe(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<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 i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=QN.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==JN&&a.dom==a.contentDOM&&(a.dirty=qN),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof $N){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=JN&&CM(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=qN,u.updateChildren(r,a+1),u.dirty=GN),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!CM(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=$N.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=$N.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new XN(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof QN;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof eP)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((MN||AN)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new tP(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}},oP=MN||AN&&jN<63,sP=/^(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,cP={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},lP=null,uP=null,dP={},fP={},pP={touchstart:!0,touchmove:!0},mP=class{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}},fP.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Spe(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(IN&&AN&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),NN&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,gM(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||$fe(e,n)?n.preventDefault():LM(e,`key`)},fP.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},fP.keypress=(e,t)=>{let n=t;if(Spe(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||PN&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof B)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}},hP=PN?`metaKey`:`ctrlKey`,dP.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=UM(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&hpe(n,e.input.lastClick)&&!n[hP]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(BM(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new gP(e,o,n,!!r)):(a==`doubleClick`?ype:bpe)(e,o.pos,o.inside,n)?n.preventDefault():LM(e,`pointer`))},gP=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[hP],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof rM&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ON&&!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)),LM(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(()=>EM(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(BM(e))),this.updateAllowDefault(e),this.allowDefault||!t?LM(this.view,`pointer`):vpe(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||MN&&this.mightDrag&&!this.mightDrag.node.isAtom||AN&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(HM(this.view,$j.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):LM(this.view,`pointer`)}move(e){this.updateAllowDefault(e),LM(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)}},dP.touchstart=e=>{e.input.lastTouch=Date.now(),UM(e),LM(e,`pointer`)},dP.touchmove=e=>{e.input.lastTouch=Date.now(),LM(e,`pointer`)},dP.contextmenu=e=>UM(e),_P=IN?5e3:-1,fP.compositionstart=fP.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof B&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||AN&&FN&&Cpe(e)))e.markCursor=e.state.storedMarks||n.marks(),WM(e,!0),e.markCursor=null;else if(WM(e,!t.selection.empty),ON&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}wpe(e,_P)},fP.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,wpe(e,20))},vP=EN&&DN<15||NN&&RN<604,dP.copy=fP.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=vP?null:n.clipboardData,{dom:o,text:s}=FM(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Ope(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))},fP.paste=(e,t)=>{let n=t;if(e.composing&&!IN)return;let r=vP?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&GM(e,KM(r),r.getData(`text/html`),i,n)?n.preventDefault():Ape(e,n)},yP=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},bP=PN?`altKey`:`ctrlKey`,dP.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(BM(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof rM?i.to-1:i.to))){if(r&&r.mightDrag)o=rM.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=rM.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=FM(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!AN||jN>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(vP?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,vP||n.dataTransfer.setData(`text/plain`,c),e.dragging=new yP(l,qM(e,n),o)},dP.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},fP.dragover=fP.dragenter=(e,t)=>t.preventDefault(),fP.drop=(e,t)=>{try{jpe(e,t,e.dragging)}finally{e.dragging=null}},dP.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&EM(e)},20))},dP.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},dP.beforeinput=(e,t)=>{if(AN&&IN&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,gM(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in fP)dP[e]=fP[e];xP=class e{constructor(e,t){this.toDOM=e,this.spec=t||EP,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new wP(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&JM(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},SP=class e{constructor(e,t){this.attrs=e,this.spec=t||EP}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new wP(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&JM(this.attrs,t.attrs)&&JM(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},CP=class e{constructor(e,t){this.attrs=e,this.spec=t||EP}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new wP(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&JM(this.attrs,t.attrs)&&JM(this.spec,t.spec)}destroy(){}},wP=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new xP(n,r))}static inline(t,n,r,i){return new e(t,n,new SP(r,i))}static node(t,n,r,i){return new e(t,n,new CP(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof SP}get widget(){return this.type instanceof xP}},TP=[],EP={},DP=class e{constructor(e,t){this.local=e.length?e:TP,this.children=t.length?t:TP}static create(e,t){return t.length?QM(t,e,0,EP):OP}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==OP||e.maps.length==0?this:this.mapInner(e,t,0,0,n||EP)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Mpe(this.children,o||[],t,n,r,i,a):o?new e(o.sort($M),TP):OP}add(t,n){return n.length?this==OP?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=XM(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,QM(s,e,o+1,EP)),a+=3}});let o=YM(a?ZM(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort($M):this.local,i||this.children)}remove(e){return e.length==0||this==OP?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==OP?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):OP}forChild(t,n){if(this==OP)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof SP){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort($M),TP);return r?new kP([t,r]):t}return r||OP}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return eN(this.localsInner(e))}localsInner(e){if(this==OP)return TP;if(e.inlineContent||!this.local.some(SP.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof SP||t.push(this.local[e]);return t}forEachSet(e){e(this)}},DP.empty=new DP([],[]),DP.removeOverlap=eN,OP=DP.empty,kP=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,EP));return e.from(r)}forChild(t,n){if(n.isLeaf)return DP.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=OP&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?eN(n?t:t.sort($M)):TP}static from(t){switch(t.length){case 0:return OP;case 1:return t[0];default:return new e(t.every(e=>e instanceof DP)?t:t.reduce((e,t)=>e.concat(t instanceof DP?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}},AP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jP=EN&&DN<=11,MP=class{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}},NP=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new MP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);EN&&DN<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():MN&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),jP&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.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,AP)),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 t=0;t<e.length;t++)this.queue.push(e[t]);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(Rfe(this.view)){if(this.suppressingSelectionUpdates)return EM(this.view);if(EN&&DN<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&_N(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 t=new Set,n;for(let n=e.focusNode;n;n=pN(n))t.add(n);for(let r=e.anchorNode;r;r=pN(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Rfe(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(ON&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Ipe(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&yN(n)&&(c=TM(e))&&c.eq($j.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,EM(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Ppe(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Lpe(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||EM(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(EN&&DN<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?fN(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?fN(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},PP=new WeakMap,FP=!1,IP=/^(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,LP=class{constructor(e,t){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 mP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(dN),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=lN(this),cN(this),this.nodeViews=uN(this),this.docView=bfe(this.state.doc,sN(this),nN(this),this.dom,this),this.domObserver=new NP(this,(e,t,n,r)=>Bpe(this,e,t,n,r)),this.domObserver.start(),dpe(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&RM(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(dN),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Tpe(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=uN(this);Gpe(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&RM(this),this.editable=lN(this),cN(this);let o=nN(this),s=sN(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&nfe(this);if(i){this.domObserver.stop();let t=l&&(EN||AN)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Wpe(n.selection,e.selection);if(l){let n=AN?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Epe(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=bfe(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Bfe(this))?EM(this,t):(Ife(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&ife(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof rM){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&tfe(this,t.getBoundingClientRect(),e)}else tfe(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 e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new yP(e.slice,e.move,r<0?void 0:rM.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(EN){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&&ofe(this.dom),EM(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pfe(this,e)}coordsAtPos(e,t=1){return hfe(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return yfe(this,t||this.state,e)}pasteHTML(e,t){return GM(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return GM(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return FM(this,e)}destroy(){this.docView&&(fpe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],nN(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gN())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return mpe(this,e)}domSelectionRange(){let e=this.domSelection();return e?MN&&this.root.nodeType===11&&Zde(this.dom.ownerDocument)==this.dom&&Fpe(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}},LP.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}})),zP,BP,VP,HP,UP,WP=o((()=>{zP=()=>new Map,BP=e=>{let t=zP();return e.forEach((e,n)=>{t.set(n,e)}),t},VP=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},HP=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},UP=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}})),GP,KP=o((()=>{GP=()=>new Set})),qP,JP,YP,XP,ZP,QP,$P,eF=o((()=>{qP=e=>e[e.length-1],JP=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},YP=Array.from,XP=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},ZP=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},QP=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},$P=Array.isArray})),tF,Kpe=o((()=>{WP(),KP(),eF(),tF=class{constructor(){this._observers=zP()}on(e,t){return VP(this._observers,e,GP).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return YP((this._observers.get(e)||zP()).values()).forEach(e=>e(...t))}destroy(){this._observers=zP()}}})),nF,rF,iF,aF,oF,sF=o((()=>{nF=Math.floor,rF=Math.abs,iF=(e,t)=>e<t?e:t,aF=(e,t)=>e>t?e:t,Number.isNaN,oF=e=>e===0?1/e<0:e<0})),cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF=o((()=>{cF=1<<17,lF=1<<18,uF=1<<19,dF=1<<20,fF=1<<21,pF=1<<22,mF=1<<23,hF=1<<24,gF=1<<25,_F=1<<26,vF=1<<27,yF=1<<28,bF=1<<29,xF=1<<30,cF-1,lF-1,uF-1,dF-1,fF-1,pF-1,mF-1,hF-1,gF-1,_F-1,vF-1,yF-1,bF-1,xF-1})),CF,wF,TF,EF=o((()=>{sF(),SF(),CF=2**53-1,wF=-(2**53-1),TF=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&nF(e)===e),Number.isNaN,Number.parseInt})),DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF=o((()=>{eF(),DF=String.fromCharCode,String.fromCodePoint,DF(65535),OF=e=>e.toLowerCase(),kF=/^\s*/g,AF=e=>e.replace(kF,``),jF=/([A-Z])/g,MF=(e,t)=>AF(e.replace(jF,e=>`${t}${OF(e)}`)),NF=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},PF=typeof TextEncoder<`u`?new TextEncoder:null,FF=e=>PF.encode(e),IF=PF?FF:NF,LF=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),LF&&LF.decode(new Uint8Array).length===1&&(LF=null),RF=(e,t)=>QP(t,()=>e).join(``)})),BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI=o((()=>{sF(),EF(),SF(),zF(),eF(),BF=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},VF=()=>new BF,HF=e=>{let t=VF();return e(t),WF(t)},UF=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},WF=e=>{let t=new Uint8Array(UF(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},GF=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(aF(n,t)*2),e.cpos=0)},KF=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},qF=KF,JF=(e,t)=>{for(;t>127;)KF(e,128|127&t),t=nF(t/128);KF(e,127&t)},YF=(e,t)=>{let n=oF(t);for(n&&(t=-t),KF(e,(t>63?128:0)|(n?64:0)|63&t),t=nF(t/64);t>0;)KF(e,(t>127?128:0)|127&t),t=nF(t/128)},XF=new Uint8Array(3e4),ZF=XF.length/3,QF=(e,t)=>{if(t.length<ZF){let n=PF.encodeInto(t,XF).written||0;JF(e,n);for(let t=0;t<n;t++)KF(e,XF[t])}else nI(e,IF(t))},$F=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;JF(e,r);for(let t=0;t<r;t++)KF(e,n.codePointAt(t))},eI=PF&&PF.encodeInto?QF:$F,tI=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=iF(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(aF(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},nI=(e,t)=>{JF(e,t.byteLength),tI(e,t)},rI=(e,t)=>{GF(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},iI=(e,t)=>rI(e,4).setFloat32(0,t,!1),aI=(e,t)=>rI(e,8).setFloat64(0,t,!1),oI=(e,t)=>rI(e,8).setBigInt64(0,t,!1),sI=new DataView(new ArrayBuffer(4)),cI=e=>(sI.setFloat32(0,e),sI.getFloat32(0)===e),lI=(e,t)=>{switch(typeof t){case`string`:KF(e,119),eI(e,t);break;case`number`:TF(t)&&rF(t)<=2147483647?(KF(e,125),YF(e,t)):cI(t)?(KF(e,124),iI(e,t)):(KF(e,123),aI(e,t));break;case`bigint`:KF(e,122),oI(e,t);break;case`object`:if(t===null)KF(e,126);else if($P(t)){KF(e,117),JF(e,t.length);for(let n=0;n<t.length;n++)lI(e,t[n])}else if(t instanceof Uint8Array)KF(e,116),nI(e,t);else{KF(e,118);let n=Object.keys(t);JF(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];eI(e,i),lI(e,t[i])}}break;case`boolean`:KF(e,t?120:121);break;default:KF(e,127)}},uI=class extends BF{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&JF(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},dI=e=>{e.count>0&&(YF(e.encoder,e.count===1?e.s:-e.s),e.count>1&&JF(e.encoder,e.count-2))},fI=class{constructor(){this.encoder=new BF,this.s=0,this.count=0}write(e){this.s===e?this.count++:(dI(this),this.count=1,this.s=e)}toUint8Array(){return dI(this),WF(this.encoder)}},pI=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);YF(e.encoder,t),e.count>1&&JF(e.encoder,e.count-2)}},mI=class{constructor(){this.encoder=new BF,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(pI(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return pI(this),WF(this.encoder)}},hI=class{constructor(){this.sarr=[],this.s=``,this.lensE=new fI}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new BF;return this.sarr.push(this.s),this.s=``,eI(e,this.sarr.join(``)),tI(e,this.lensE.toUint8Array()),WF(e)}}})),_I,vI,yI,bI=o((()=>{_I=e=>Error(e),vI=()=>{throw _I(`Method unimplemented`)},yI=()=>{throw _I(`Unexpected case`)}})),xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,qpe=o((()=>{SF(),sF(),EF(),zF(),bI(),xI=_I(`Unexpected end of array`),SI=_I(`Integer out of Range`),CI=class{constructor(e){this.arr=e,this.pos=0}},wI=e=>new CI(e),TI=e=>e.pos!==e.arr.length,EI=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},DI=e=>EI(e,kI(e)),OI=e=>e.arr[e.pos++],kI=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>CF)throw SI}throw xI},AI=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>CF)throw SI}throw xI},jI=e=>{let t=kI(e);if(t===0)return``;{let n=String.fromCodePoint(OI(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(OI(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},MI=e=>LF.decode(DI(e)),NI=LF?MI:jI,PI=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},FI=e=>PI(e,4).getFloat32(0,!1),II=e=>PI(e,8).getFloat64(0,!1),LI=e=>PI(e,8).getBigInt64(0,!1),RI=[e=>void 0,e=>null,AI,FI,II,LI,e=>!1,e=>!0,NI,e=>{let t=kI(e),n={};for(let r=0;r<t;r++){let t=NI(e);n[t]=zI(e)}return n},e=>{let t=kI(e),n=[];for(let r=0;r<t;r++)n.push(zI(e));return n},DI],zI=e=>RI[127-OI(e)](e),BI=class extends CI{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),TI(this)?this.count=kI(this)+1:this.count=-1),this.count--,this.s}},VI=class extends CI{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=AI(this);let e=oF(this.s);this.count=1,e&&(this.s=-this.s,this.count=kI(this)+2)}return this.count--,this.s}},HI=class extends CI{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=AI(this),t=e&1;this.diff=nF(e/2),this.count=1,t&&(this.count=kI(this)+2)}return this.s+=this.diff,this.count--,this.s}},UI=class{constructor(e){this.decoder=new VI(e),this.str=NI(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}})),Jpe,Ype=o((()=>{crypto.subtle,Jpe=crypto.getRandomValues.bind(crypto)})),WI,GI,KI,qI,JI,YI=o((()=>{sF(),Ype(),WI=Math.random,GI=()=>Jpe(new Uint32Array(1))[0],KI=e=>e[nF(WI()*e.length)],qI=`10000000-1000-4000-8000-100000000000`,JI=()=>qI.replace(/[018]/g,e=>(e^GI()&15>>e/4).toString(16))})),XI,ZI=o((()=>{XI=Date.now})),QI,Xpe=o((()=>{QI=e=>new Promise(e),Promise.all.bind(Promise)})),$I,Zpe=o((()=>{$I=e=>e===void 0?null:e})),eL,tL,nL,Qpe=o((()=>{eL=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},tL=new eL;try{typeof localStorage<`u`&&localStorage&&(tL=localStorage)}catch{}nL=tL})),rL,iL,aL=o((()=>{rL=Symbol(`Equality`),iL=(e,t)=>e===t||!!e?.[rL]?.(t)||!1})),oL,sL,cL,lL,uL,dL,fL,pL,mL,hL,gL,_L=o((()=>{aL(),oL=e=>typeof e==`object`,sL=Object.assign,cL=Object.keys,lL=(e,t)=>{for(let n in e)t(e[n],n)},uL=e=>cL(e).length,dL=e=>{for(let t in e)return!1;return!0},fL=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},pL=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),mL=(e,t)=>e===t||uL(e)===uL(t)&&fL(e,(e,n)=>(e!==void 0||pL(t,n))&&iL(t[n],e)),hL=Object.freeze,gL=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&gL(e[t])}return hL(e)}})),vL,yL,bL,xL,SL=o((()=>{eF(),_L(),aL(),vL=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&vL(e,t,n+1)}},yL=e=>e,bL=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[rL]!=null)return e[rL](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!bL(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(uL(e)!==uL(t))return!1;for(let n in e)if(!pL(e,n)||!bL(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!bL(e[n],t[n]))return!1;break;default:return!1}return!0},xL=(e,t)=>t.includes(e)})),CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL=o((()=>{WP(),zF(),Zpe(),Qpe(),SL(),CL=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,wL=typeof window<`u`&&typeof document<`u`&&!CL,typeof navigator<`u`&&/Mac/.test(navigator.platform),EL=[],DL=()=>{if(TL===void 0)if(CL){TL=zP();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&TL.set(t,``),t=r):t===null?EL.push(r):(TL.set(t,r),t=null)}t!==null&&TL.set(t,``)}else typeof location==`object`?(TL=zP(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);TL.set(`--${MF(t,`-`)}`,n),TL.set(`-${MF(t,`-`)}`,n)}})):TL=zP();return TL},OL=e=>DL().has(e),kL=e=>$I(CL?{}[e.toUpperCase().replaceAll(`-`,`_`)]:nL.getItem(e)),AL=e=>OL(`--`+e)||kL(e)!==null,jL=AL(`production`),ML=CL&&xL({}.FORCE_COLOR,[`true`,`1`,`2`]),NL=ML||!OL(`--no-colors`)&&!AL(`no-color`)&&(!CL||process.stdout.isTTY)&&(!CL||OL(`--color`)||kL(`COLORTERM`)!==null||(kL(`TERM`)||``).includes(`color`))})),FL,IL,LL,RL,zL,BL,VL=o((()=>{zF(),PL(),gI(),FL=e=>new Uint8Array(e),IL=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=DF(e[n]);return btoa(t)},LL=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),RL=wL?IL:LL,zL=e=>{let t=FL(e.byteLength);return t.set(e),t},BL=e=>HF(t=>lI(t,e))})),HL,UL,$pe=o((()=>{HL=class{constructor(e,t){this.left=e,this.right=t}},UL=(e,t)=>new HL(e,t)})),WL,GL,KL,qL,JL,YL,XL,eme=o((()=>{zF(),sF(),WL=e=>e.next()>=.5,GL=(e,t,n)=>nF(e.next()*(n+1-t)+t),KL=(e,t,n)=>nF(e.next()*(n+1-t)+t),qL=(e,t,n)=>KL(e,t,n),JL=e=>DF(qL(e,97,122)),YL=(e,t=0,n=20)=>{let r=qL(e,t,n),i=``;for(let t=0;t<r;t++)i+=JL(e);return i},XL=(e,t)=>t[qL(e,0,t.length-1)]})),ZL,QL,$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR,BR,VR,HR,UR,WR,GR,KR,qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,tme=o((()=>{_L(),eF(),bI(),PL(),aL(),SL(),zF(),eme(),EF(),ZL=Symbol(`0schema`),QL=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(RF(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
|
|
24
|
+
`)}},$L=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[rL]?iL(e,t):$P(e)?XP(e,e=>ZP(t,t=>$L(e,t))):oL(e)?fL(e,(e,n)=>$L(e,t[n])):!1,eR=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),$L(t,n)}equals(e){return this.constructor===e.constructor&&bL(this.shape,e.shape)}[ZL](){return!0}[rL](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){vI()}get nullable(){return IR(this,ZR)}get optional(){return new fR(this)}cast(e){return tz(e,this),e}expect(e){return tz(e,this),e}},tR=class extends eR{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},nR=(e,t=null)=>new tR(e,t),nR(tR),rR=class extends eR{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},iR=e=>new rR(e),nR(rR),aR=class extends eR{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},oR=(...e)=>new aR(e),sR=nR(aR),cR=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),lR=e=>{if(KR.check(e))return[cR(e)];if(sR.check(e))return e.shape.map(e=>e+``);if(GR.check(e))return[`[+-]?\\d+.?\\d*`];if(qR.check(e))return[`.*`];if(LR.check(e))return e.shape.map(lR).flat(1);yI()},uR=class extends eR{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(lR).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}},nR(uR),dR=Symbol(`optional`),fR=class extends eR{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[dR](){return!0}},pR=nR(fR),mR=class extends eR{check(e,t){return t?.extend(null,`never`,typeof e),!1}},new mR,nR(mR),hR=class e extends eR{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):fL(this.shape,(n,r)=>{let i=this._isPartial&&!pL(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},gR=e=>new hR(e),_R=nR(hR),vR=iR(e=>e!=null&&(e.constructor===Object||e.constructor==null)),yR=class extends eR{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&fL(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},bR=(e,t)=>new yR(e,t),xR=nR(yR),SR=class extends eR{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&fL(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},CR=(...e)=>new SR(e),nR(SR),wR=class extends eR{constructor(e){super(),this.shape=e.length===1?e[0]:new FR(e)}check(e,t){let n=$P(e)&&XP(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},TR=(...e)=>new wR(e),ER=nR(wR),DR=iR(e=>$P(e)),OR=class extends eR{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},kR=(e,t=null)=>new OR(e,t),nR(OR),AR=kR(eR),jR=class extends eR{constructor(e){super(),this.len=e.length-1,this.args=CR(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}},MR=nR(jR),NR=iR(e=>typeof e==`function`),PR=class extends eR{constructor(e){super(),this.shape=e}check(e,t){let n=XP(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},nR(PR,e=>e.shape.length>0),FR=class extends eR{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=ZP(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},IR=(...e)=>e.findIndex(e=>LR.check(e))>=0?IR(...e.map(e=>ez(e)).map(e=>LR.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new FR(e),LR=nR(FR),RR=()=>!0,zR=iR(RR),BR=nR(rR,e=>e.shape===RR),VR=iR(e=>typeof e==`bigint`),HR=iR(e=>e===VR),UR=iR(e=>typeof e==`symbol`),iR(e=>e===UR),WR=iR(e=>typeof e==`number`),GR=iR(e=>e===WR),KR=iR(e=>typeof e==`string`),qR=iR(e=>e===KR),JR=iR(e=>typeof e==`boolean`),YR=iR(e=>e===JR),XR=oR(void 0),nR(aR,e=>e.shape.length===1&&e.shape[0]===void 0),oR(void 0),ZR=oR(null),QR=nR(aR,e=>e.shape.length===1&&e.shape[0]===null),nR(Uint8Array),nR(tR,e=>e.shape===Uint8Array),$R=IR(WR,KR,ZR,XR,VR,JR,UR),(()=>{let e=TR(zR),t=bR(KR,zR),n=IR(WR,KR,ZR,JR,e,t);return e.shape=n,t.shape.values=n,n})(),ez=e=>{if(AR.check(e))return e;if(vR.check(e)){let t={};for(let n in e)t[n]=ez(e[n]);return gR(t)}else if(DR.check(e))return IR(...e.map(ez));else if($R.check(e))return oR(e);else if(NR.check(e))return nR(e);yI()},tz=jL?()=>{}:(e,t)=>{let n=new QL;if(!t.check(e,n))throw _I(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},nz=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:ez(e),h:t}),this}else(e){return this.if(zR,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw _I(`Unhandled pattern`)}}},rz=e=>new nz(e),iz=rz(zR).if(GR,(e,t)=>GL(t,wF,CF)).if(qR,(e,t)=>YL(t)).if(YR,(e,t)=>WL(t)).if(HR,(e,t)=>BigInt(GL(t,wF,CF))).if(LR,(e,t)=>az(t,XL(t,e.shape))).if(_R,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(pR.check(i)){if(WL(t))continue;i=i.shape}n[r]=iz(i,t)}return n}).if(ER,(e,t)=>{let n=[],r=KL(t,0,42);for(let i=0;i<r;i++)n.push(az(t,e.shape));return n}).if(sR,(e,t)=>XL(t,e.shape)).if(QR,(e,t)=>null).if(MR,(e,t)=>{let n=az(t,e.res);return()=>n}).if(BR,(e,t)=>az(t,XL(t,[WR,KR,ZR,XR,VR,JR,TR(WR),bR(IR(`a`,`b`,`c`),WR)]))).if(xR,(e,t)=>{let n={},r=GL(t,0,3);for(let i=0;i<r;i++){let r=az(t,e.shape.keys);n[r]=az(t,e.shape.values)}return n}).done(),az=(e,t)=>iz(ez(t),e)})),oz,sz,cz,lz,uz,dz,fz=o((()=>{WP(),tme(),oz=typeof document<`u`?document:{},iR(e=>e.nodeType===dz),typeof DOMParser<`u`&&new DOMParser,iR(e=>e.nodeType===cz),iR(e=>e.nodeType===lz),sz=e=>HP(e,(e,t)=>`${t}:${e};`).join(``),cz=oz.ELEMENT_NODE,lz=oz.TEXT_NODE,oz.CDATA_SECTION_NODE,oz.COMMENT_NODE,uz=oz.DOCUMENT_NODE,oz.DOCUMENT_TYPE_NODE,dz=oz.DOCUMENT_FRAGMENT_NODE,iR(e=>e.nodeType===uz)})),pz,mz,hz,gz=o((()=>{pz=e=>class{constructor(e){this._=e}destroy(){e(this._)}},mz=pz(clearTimeout),hz=(e,t)=>new mz(setTimeout(t,e)),pz(clearInterval),pz(e=>typeof requestAnimationFrame<`u`&&cancelAnimationFrame(e)),pz(e=>typeof cancelIdleCallback<`u`&&cancelIdleCallback(e))})),_z,nme=o((()=>{_z=Symbol})),vz,yz,bz,xz,Sz,Cz,wz,Tz,Ez,Dz,rme=o((()=>{nme(),ZI(),vz=_z(),yz=_z(),bz=_z(),xz=_z(),Sz=_z(),Cz=_z(),wz=_z(),Tz=_z(),Ez=_z(),Dz=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n},XI()})),Oz,kz,Az,jz,Mz,Nz,ime=o((()=>{PL(),KP(),$pe(),fz(),WP(),rme(),Oz={[vz]:UL(`font-weight`,`bold`),[yz]:UL(`font-weight`,`normal`),[bz]:UL(`color`,`blue`),[Sz]:UL(`color`,`green`),[xz]:UL(`color`,`grey`),[Cz]:UL(`color`,`red`),[wz]:UL(`color`,`purple`),[Tz]:UL(`color`,`orange`),[Ez]:UL(`color`,`black`)},kz=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=zP(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=Oz[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=sz(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i},Az=NL?kz:Dz,jz=(...e)=>{console.log(...Az(e)),Nz.forEach(t=>t.print(e))},Mz=(...e)=>{console.warn(...Az(e)),e.unshift(Tz),Nz.forEach(t=>t.print(e))},Nz=GP()})),Pz,Fz,Iz,ame=o((()=>{Pz=e=>({[Symbol.iterator](){return this},next:e}),Fz=(e,t)=>Pz(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Iz=(e,t)=>Pz(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})}));function*ome(e){let t=kI(e.restDecoder);for(let n=0;n<t;n++){let t=kI(e.restDecoder),n=e.readClient(),r=kI(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=kI(e.restDecoder);yield new DU(AB(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new CU(AB(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,wU(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new UH(AB(n,r),t),r+=t}}}}var Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV,gV,_V,vV,yV,bV,xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV,KV,qV,JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH,aH,oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH,_H,vH,yH,bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU=o((()=>{Kpe(),eF(),sF(),WP(),gI(),qpe(),YI(),Xpe(),VL(),bI(),SF(),SL(),KP(),ime(),ZI(),ame(),_L(),PL(),Lz=class{constructor(e,t){this.clock=e,this.len=t}},Rz=class{constructor(){this.clients=new Map}},zz=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])iV(e,i,o.clock,o.len,n)}}),Bz=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=nF((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},Vz=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&Bz(n,t.clock)!==null},Hz=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new Lz(r.clock,aF(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},Uz=e=>{let t=new Rz;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)JP(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return Hz(t),t},Wz=(e,t,n,r)=>{VP(e.clients,t,()=>[]).push(new Lz(n,r))},Gz=()=>new Rz,Kz=e=>{let t=Gz();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new Lz(i,a))}}r.length>0&&t.clients.set(n,r)}),t},qz=(e,t)=>{JF(e.restEncoder,t.clients.size),YP(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),JF(e.restEncoder,t);let r=n.length;JF(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},Jz=e=>{let t=new Rz,n=kI(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=kI(e.restDecoder),r=kI(e.restDecoder);if(r>0){let i=VP(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new Lz(e.readDsClock(),e.readDsLen()))}}return t},Yz=(e,t,n)=>{let r=new Rz,i=kI(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=kI(e.restDecoder),a=kI(e.restDecoder),o=n.clients.get(i)||[],s=YB(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&Wz(r,i,s,a-s);let e=ZB(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,bU(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,bU(t,c,a-c.id.clock)),c.delete(t))}else Wz(r,i,n,a-n)}}if(r.clients.size>0){let e=new aB;return JF(e.restEncoder,0),qz(e,r),e.toUint8Array()}return null},Xz=GI,Zz=class e extends tF{constructor({guid:e=JI(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Xz(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new qB,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=QI(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>QI(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&fV(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(YP(this.subdocs).map(e=>e.guid))}transact(e,t=null){return fV(this,e,t)}get(e,t=VV){let n=VP(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==VV&&r!==t)if(r===VV){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,cH)}getText(e=``){return this.get(e,kH)}getMap(e=``){return this.get(e,dH)}getXmlElement(e=``){return this.get(e,PH)}getXmlFragment(e=``){return this.get(e,MH)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,YP(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,fV(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},Qz=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return kI(this.restDecoder)}readDsLen(){return kI(this.restDecoder)}},$z=class extends Qz{readLeftID(){return AB(kI(this.restDecoder),kI(this.restDecoder))}readRightID(){return AB(kI(this.restDecoder),kI(this.restDecoder))}readClient(){return kI(this.restDecoder)}readInfo(){return OI(this.restDecoder)}readString(){return NI(this.restDecoder)}readParentInfo(){return kI(this.restDecoder)===1}readTypeRef(){return kI(this.restDecoder)}readLen(){return kI(this.restDecoder)}readAny(){return zI(this.restDecoder)}readBuf(){return zL(DI(this.restDecoder))}readJSON(){return JSON.parse(NI(this.restDecoder))}readKey(){return NI(this.restDecoder)}},eB=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=kI(this.restDecoder),this.dsCurrVal}readDsLen(){let e=kI(this.restDecoder)+1;return this.dsCurrVal+=e,e}},tB=class extends eB{constructor(e){super(e),this.keys=[],kI(e),this.keyClockDecoder=new HI(DI(e)),this.clientDecoder=new VI(DI(e)),this.leftClockDecoder=new HI(DI(e)),this.rightClockDecoder=new HI(DI(e)),this.infoDecoder=new BI(DI(e),OI),this.stringDecoder=new UI(DI(e)),this.parentInfoDecoder=new BI(DI(e),OI),this.typeRefDecoder=new VI(DI(e)),this.lenDecoder=new VI(DI(e))}readLeftID(){return new OB(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new OB(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return zI(this.restDecoder)}readBuf(){return DI(this.restDecoder)}readJSON(){return zI(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},nB=class{constructor(){this.restEncoder=VF()}toUint8Array(){return WF(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){JF(this.restEncoder,e)}writeDsLen(e){JF(this.restEncoder,e)}},rB=class extends nB{writeLeftID(e){JF(this.restEncoder,e.client),JF(this.restEncoder,e.clock)}writeRightID(e){JF(this.restEncoder,e.client),JF(this.restEncoder,e.clock)}writeClient(e){JF(this.restEncoder,e)}writeInfo(e){qF(this.restEncoder,e)}writeString(e){eI(this.restEncoder,e)}writeParentInfo(e){JF(this.restEncoder,e?1:0)}writeTypeRef(e){JF(this.restEncoder,e)}writeLen(e){JF(this.restEncoder,e)}writeAny(e){lI(this.restEncoder,e)}writeBuf(e){nI(this.restEncoder,e)}writeJSON(e){eI(this.restEncoder,JSON.stringify(e))}writeKey(e){eI(this.restEncoder,e)}},iB=class{constructor(){this.restEncoder=VF(),this.dsCurrVal=0}toUint8Array(){return WF(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,JF(this.restEncoder,t)}writeDsLen(e){e===0&&yI(),JF(this.restEncoder,e-1),this.dsCurrVal+=e}},aB=class extends iB{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new mI,this.clientEncoder=new fI,this.leftClockEncoder=new mI,this.rightClockEncoder=new mI,this.infoEncoder=new uI(qF),this.stringEncoder=new hI,this.parentInfoEncoder=new uI(qF),this.typeRefEncoder=new fI,this.lenEncoder=new fI}toUint8Array(){let e=VF();return JF(e,0),nI(e,this.keyClockEncoder.toUint8Array()),nI(e,this.clientEncoder.toUint8Array()),nI(e,this.leftClockEncoder.toUint8Array()),nI(e,this.rightClockEncoder.toUint8Array()),nI(e,WF(this.infoEncoder)),nI(e,this.stringEncoder.toUint8Array()),nI(e,WF(this.parentInfoEncoder)),nI(e,this.typeRefEncoder.toUint8Array()),nI(e,this.lenEncoder.toUint8Array()),tI(e,WF(this.restEncoder)),WF(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){lI(this.restEncoder,e)}writeBuf(e){nI(this.restEncoder,e)}writeJSON(e){lI(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},oB=(e,t,n,r)=>{r=aF(r,t[0].id.clock);let i=ZB(t,r);JF(e.restEncoder,t.length-i),e.writeClient(n),JF(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},sB=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{YB(t,n)>e&&r.set(n,e)}),JB(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),JF(e.restEncoder,r.size),YP(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{oB(e,t.clients.get(n),n,r)})},cB=(e,t)=>{let n=zP(),r=kI(e.restDecoder);for(let i=0;i<r;i++){let r=kI(e.restDecoder),i=Array(r),a=e.readClient(),o=kI(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new UH(AB(a,o),t),o+=t;break}case 10:{let t=kI(e.restDecoder);i[n]=new DU(AB(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new CU(AB(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,wU(e,r));i[n]=c,o+=c.length}}}}return n},lB=(e,t,n)=>{let r=[],i=YP(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new qB,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==DU){let i=VP(d,u.id.client,()=>YB(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,YB(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new aB;return sB(e,s,new Map),JF(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},uB=(e,t)=>sB(e,t.doc.store,t.beforeState),dB=(e,t,n,r=new tB(e))=>fV(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=lB(e,i,cB(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<YB(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=xV([o.update,a.update])}}else i.pendingStructs=a;let s=Yz(r,e,i);if(i.pendingDs){let t=new tB(wI(i.pendingDs));kI(t.restDecoder);let n=Yz(t,e,i);s&&n?i.pendingDs=xV([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,fB(e.doc,t)}},n,!1),fB=(e,t,n,r=tB)=>{let i=wI(t);dB(i,e,n,new r(i))},pB=(e,t,n)=>fB(e,t,n,$z),mB=(e,t,n=new Map)=>{sB(e,t.store,n),qz(e,Kz(t.store))},hB=(e,t=new Uint8Array([0]),n=new aB)=>{mB(n,e,vB(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(SV(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===rB)return yV(r.map((e,t)=>t===0?e:DV(e)));if(n.constructor===aB)return xV(r)}return r[0]},gB=(e,t)=>hB(e,t,new rB),_B=e=>{let t=new Map,n=kI(e.restDecoder);for(let r=0;r<n;r++){let n=kI(e.restDecoder),r=kI(e.restDecoder);t.set(n,r)}return t},vB=e=>_B(new Qz(wI(e))),yB=(e,t)=>(JF(e.restEncoder,t.size),YP(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{JF(e.restEncoder,t),JF(e.restEncoder,n)}),e),bB=(e,t)=>yB(e,JB(t.store)),xB=(e,t=new iB)=>(e instanceof Map?yB(t,e):bB(t,e),t.toUint8Array()),SB=e=>xB(e,new nB),CB=class{constructor(){this.l=[]}},wB=()=>new CB,TB=(e,t)=>e.l.push(t),EB=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},DB=(e,t,n)=>vL(e.l,[t,n]),OB=class{constructor(e,t){this.client=e,this.clock=t}},kB=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,AB=(e,t)=>new OB(e,t),jB=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw yI()},MB=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},NB=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},PB=e=>new NB(e.type==null?null:AB(e.type.client,e.type.clock),e.tname??null,e.item==null?null:AB(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),FB=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},IB=(e,t,n=0)=>new FB(e,t,n),LB=(e,t,n)=>{let r=null,i=null;return e._item===null?i=jB(e):r=AB(e._item.id.client,e._item.id.clock),new NB(r,i,t,n)},RB=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return LB(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return LB(e,AB(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return LB(e,r.lastId,n);r=r.right}return LB(e,null,n)},zB=(e,t)=>{let n=$B(e,t);return{item:n,diff:t.clock-n.id.clock}},BB=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(YB(r,i.client)<=i.clock)return null;let e=n?vU(r,i):zB(r,i),t=e.item;if(!(t instanceof CU))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(YB(r,a.client)<=a.clock)return null;let{item:e}=n?vU(r,a):{item:$B(r,a)};if(e instanceof CU&&e.content instanceof gU)c=e.content.type;else return null}else throw yI();l=s>=0?c._length:0}return IB(c,l,e.assoc)},VB=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&kB(e.item,t.item)&&kB(e.type,t.type)&&e.assoc===t.assoc,HB=class{constructor(e,t){this.ds=e,this.sv=t}},UB=(e,t)=>new HB(e,t),UB(Gz(),new Map),WB=e=>UB(Kz(e.store),JB(e.store)),GB=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Vz(t.ds,e.id),KB=(e,t)=>{let n=VP(e.meta,KB,GP),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<YB(r,n)&&tV(e,AB(n,t))}),zz(e,t.ds,e=>{}),n.add(t))},qB=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},JB=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},YB=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},XB=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw yI()}n.push(t)},ZB=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=nF(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=nF((n+r)/2)}throw yI()},QB=(e,t)=>{let n=e.clients.get(t.client);return n[ZB(n,t.clock)]},$B=QB,eV=(e,t,n)=>{let r=ZB(t,n),i=t[r];return i.id.clock<n&&i instanceof CU?(t.splice(r+1,0,bU(e,i,n-i.id.clock)),r+1):r},tV=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[eV(e,n,t.clock)]},nV=(e,t,n)=>{let r=t.clients.get(n.client),i=ZB(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==UH&&r.splice(i+1,0,bU(e,a,n.clock-a.id.clock+1)),a},rV=(e,t,n)=>{let r=e.clients.get(t.id.client);r[ZB(r,t.id.clock)]=n},iV=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=eV(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&eV(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},aV=class{constructor(e,t,n){this.doc=e,this.deleteSet=new Rz,this.beforeState=JB(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},oV=(e,t)=>t.deleteSet.clients.size===0&&!UP(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(Hz(t.deleteSet),uB(e,t),qz(e,t.deleteSet),!0),sV=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&VP(e.changed,t,GP).add(n)},cV=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof CU&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},lV=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=ZB(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof CU&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},uV=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=iF(r.length-1,1+ZB(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+cV(r,e)}})},dV=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{Hz(a),n.afterState=JB(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{DB(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&EH(n)})}),vL(e,[])}finally{r.gc&&lV(a,i,r.gcFilter),uV(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=aF(ZB(e,r),1);for(let t=e.length-1;t>=n;)t-=1+cV(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=ZB(r,n);a+1<r.length&&cV(r,a+1)>1||a>0&&cV(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(jz(Tz,vz,`[yjs] `,yz,Cz,`Changed the client-id because another client seems to be using it.`),r.clientID=Xz()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new rB;oV(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new aB;oV(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):dV(e,t+1)}}},fV=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new aV(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&dV(i,0)}}return o},pV=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},mV=(e,t,n)=>{zz(e,n.deletions,n=>{n instanceof CU&&t.scope.some(t=>t===e.doc||MB(t,n))&&yU(n,!1)})},hV=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;fV(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,c=[],l=!1;zz(n,o.insertions,e=>{if(e instanceof CU){if(e.redone!==null){let{item:t,diff:i}=vU(r,e.id);i>0&&(t=tV(n,AB(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||MB(t,e))&&c.push(e)}}),zz(n,o.deletions,e=>{e instanceof CU&&a.some(t=>t===n.doc||MB(t,e))&&!Vz(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{l=SU(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||l});for(let t=c.length-1;t>=0;t--){let r=c[t];e.deleteFilter(r)&&(r.delete(n),l=!0)}e.currStackItem=l?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},gV=class extends tF{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=$P(e)?e[0].doc:e instanceof Zz?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new Rz;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&Wz(i,n,r,a)});let a=XI(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=Uz([t.deletions,e.deleteSet]),t.insertions=Uz([t.insertions,i])}else r.push(new pV(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),zz(e,e.deleteSet,t=>{t instanceof CU&&this.scope.some(n=>n===e.doc||MB(n,t))&&yU(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=$P(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof VV?e.doc!==this.doc:e!==this.doc)&&Mz(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>mV(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>mV(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=hV(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=hV(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}},_V=class{constructor(e,t){this.gen=ome(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===DU);return this.curr}},vV=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},yV=e=>xV(e,$z,rB),bV=(e,t)=>{if(e.constructor===UH){let{client:n,clock:r}=e.id;return new UH(AB(n,r+t),e.length-t)}else if(e.constructor===DU){let{client:n,clock:r}=e.id;return new DU(AB(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new CU(AB(r,i+t),null,AB(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},xV=(e,t=tB,n=aB)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(wI(e))),i=r.map(e=>new _V(e,!0)),a=null,o=new n,s=new vV(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===DU?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)wV(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===DU)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{wV(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new DU(AB(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===DU?a.struct.length-=t:n=bV(n,t)),a.struct.mergeWith(n)||(wV(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==DU;n=e.next())wV(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(wV(s,a.struct,a.offset),a=null),TV(s),qz(o,Uz(r.map(e=>Jz(e)))),o.toUint8Array()},SV=(e,t,n=tB,r=aB)=>{let i=vB(t),a=new r,o=new vV(a),s=new n(wI(e)),c=new _V(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===DU){c.next();continue}if(e.id.clock+e.length>n)for(wV(o,e,aF(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)wV(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return TV(o),qz(a,Jz(s)),a.toUint8Array()},CV=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:WF(e.encoder.restEncoder)}),e.encoder.restEncoder=VF(),e.written=0)},wV=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&CV(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),JF(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},TV=e=>{CV(e);let t=e.encoder.restEncoder;JF(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];JF(t,r.written),tI(t,r.restEncoder)}},EV=(e,t,n,r)=>{let i=new n(wI(e)),a=new _V(i,!1),o=new r,s=new vV(o);for(let e=a.curr;e!==null;e=a.next())wV(s,t(e),0);return TV(s),qz(o,Jz(i)),o.toUint8Array()},DV=e=>EV(e,yL,tB,rB),OV=`You must not compute changes after the event-handler fired.`,kV=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=AV(this.currentTarget,this.target)}deletes(e){return Vz(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw _I(OV);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=qP(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=qP(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=qP(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw _I(OV);let t=this.target,n=GP(),r=GP(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},AV=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},jV=()=>{Mz(`Invalid access: Add Yjs type to a document before reading data.`)},MV=80,NV=0,PV=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=NV++}},FV=e=>{e.timestamp=NV++},IV=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=NV++},LV=(e,t,n)=>{if(e.length>=MV){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return IV(r,t,n),r}else{let r=new PV(t,n);return e.push(r),r}},RV=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>rF(t-e.index)<rF(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,FV(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&rF(n.index-i)<r.parent.length/MV?(IV(n,r,i),n):LV(e._searchMarker,r,i)},zV=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=aF(t,i.index+n))}},BV=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;VP(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;DB(r._eH,n,t)},VV=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=wB(),this._dEH=wB(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw vI()}clone(){throw vI()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){TB(this._eH,e)}observeDeep(e){TB(this._dEH,e)}unobserve(e){EB(this._eH,e)}unobserveDeep(e){EB(this._dEH,e)}toJSON(){}},HV=(e,t,n)=>{e.doc??jV(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},UV=e=>{e.doc??jV();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},WV=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&GB(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},GV=(e,t)=>{let n=0,r=e._start;for(e.doc??jV();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},KV=(e,t)=>{let n=[];return GV(e,(r,i)=>{n.push(t(r,i,e))}),n},qV=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},JV=(e,t)=>{e.doc??jV();let n=RV(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},YV=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new CU(AB(o,YB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new iU(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new CU(AB(o,YB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new WH(new Uint8Array(n))),i.integrate(e,0);break;case Zz:i=new CU(AB(o,YB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new YH(n)),i.integrate(e,0);break;default:if(n instanceof VV)i=new CU(AB(o,YB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new gU(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},XV=()=>_I(`Length exceeded!`),ZV=(e,t,n,r)=>{if(n>t._length)throw XV();if(n===0)return t._searchMarker&&zV(t._searchMarker,n,r.length),YV(e,t,null,r);let i=n,a=RV(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&tV(e,AB(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&zV(t._searchMarker,i,r.length),YV(e,t,o,r)},QV=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return YV(e,t,r,n)},$V=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=RV(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&tV(e,AB(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&tV(e,AB(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw XV();t._searchMarker&&zV(t._searchMarker,i,-a+r)},eH=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},tH=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new iU([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new iU([r]);break;case Uint8Array:s=new WH(r);break;case Zz:s=new YH(r);break;default:if(r instanceof VV)s=new gU(r);else throw Error(`Unexpected content type`)}new CU(AB(o,YB(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},nH=(e,t)=>{e.doc??jV();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},rH=e=>{let t={};return e.doc??jV(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},iH=(e,t)=>{e.doc??jV();let n=e._map.get(t);return n!==void 0&&!n.deleted},aH=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&GB(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},oH=e=>(e.doc??jV(),Fz(e._map.entries(),e=>!e[1].deleted)),sH=class extends kV{},cH=class e extends VV{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof VV?e.clone():e)),t}get length(){return this.doc??jV(),this._length}_callObserver(e,t){super._callObserver(e,t),BV(this,e,new sH(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):fV(this.doc,n=>{ZV(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):fV(this.doc,t=>{QV(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):fV(this.doc,n=>{$V(n,this,e,t)})}get(e){return JV(this,e)}toArray(){return UV(this)}slice(e=0,t=this.length){return HV(this,e,t)}toJSON(){return this.map(e=>e instanceof VV?e.toJSON():e)}map(e){return KV(this,e)}forEach(e){GV(this,e)}[Symbol.iterator](){return qV(this)}_write(e){e.writeTypeRef(lU)}},lH=e=>new cH,uH=class extends kV{constructor(e,t,n){super(e,t),this.keysChanged=n}},dH=class e extends VV{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof VV?e.clone():e)}),t}_callObserver(e,t){BV(this,e,new uH(this,e,t))}toJSON(){this.doc??jV();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof VV?r.toJSON():r}}),e}get size(){return[...oH(this)].length}keys(){return Iz(oH(this),e=>e[0])}values(){return Iz(oH(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Iz(oH(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??jV(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):fV(this.doc,t=>{eH(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):fV(this.doc,n=>{tH(n,this,e,t)}),t}get(e){return nH(this,e)}has(e){return iH(this,e)}clear(){this.doc===null?this._prelimContent.clear():fV(this.doc,e=>{this.forEach(function(t,n,r){eH(e,r,n)})})}_write(e){e.writeTypeRef(uU)}},fH=e=>new dH,pH=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&mL(e,t),mH=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&yI(),this.right.content.constructor){case $H:this.right.deleted||vH(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},hH=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case $H:t.right.deleted||vH(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&tV(e,AB(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},gH=(e,t,n,r)=>{let i=new Map,a=r?RV(t,n):null;return a?hH(e,new mH(a.p.left,a.p,a.index,i),n-a.index):hH(e,new mH(null,t._start,0,i),n)},_H=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===$H&&pH(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new CU(AB(a,YB(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new $H(o,r));l.integrate(e,0),n.right=l,n.forward()})},vH=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},yH=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===$H&&pH(t[e.right.content.key]??null,e.right.content.value));)e.forward()},bH=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!pH(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new CU(AB(a,YB(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new $H(s,c)),n.right.integrate(e,0),n.forward()}}return o},xH=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;yH(n,i);let s=bH(e,t,n,i),c=r.constructor===String?new oU(r):r instanceof VV?new gU(r):new ZH(r),{left:l,right:u,index:d}=n;t._searchMarker&&zV(t._searchMarker,n.index,c.getLength()),u=new CU(AB(o,YB(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),_H(e,t,n,s)},SH=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;yH(n,i);let s=bH(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===$H));){if(!n.right.deleted)switch(n.right.content.constructor){case $H:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(pH(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&tV(e,AB(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
|
|
25
|
+
`;n.right=new CU(AB(o,YB(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new oU(i)),n.right.integrate(e,0),n.forward()}_H(e,t,n,s)},CH=(e,t,n,r,i)=>{let a=t,o=zP();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===$H){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case $H:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&vH(i,n);break}}}t=t.right}return s},wH=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===$H){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},TH=e=>{let t=0;return fV(e.doc,n=>{let r=e._start,i=e._start,a=zP(),o=BP(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case $H:vH(o,i.content);break;default:t+=CH(n,r,i,a,o),a=BP(o),r=i;break}i=i.right}}),t},EH=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&iV(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===$H&&e.constructor!==UH&&t.add(e.parent)})}fV(n,n=>{zz(e,e.deleteSet,e=>{if(e instanceof UH||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===$H?t.add(r):wH(n,e)});for(let e of t)TH(e)})},DH=(e,t,n)=>{let r=n,i=BP(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case gU:case ZH:case oU:n<t.right.length&&tV(e,AB(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&CH(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&zV(o._searchMarker,t.index,-r+n),t},OH=class extends kV{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];fV(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},dL(o)||(e.attributes=sL({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case gU:case ZH:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case oU:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case $H:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(pH(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),pH(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;pH(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(pH(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),vH(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},kH=class e extends VV{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??jV(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new OH(this,e,t);BV(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??jV();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===oU&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):fV(this.doc,n=>{let r=new mH(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
|
|
26
|
+
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&xH(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&DH(n,r,a.delete):SH(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??jV();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(GB(s,e)||t!==void 0&&GB(s,t))switch(s.content.constructor){case oU:{let r=i.get(`ychange`);e!==void 0&&!GB(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!GB(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case gU:case ZH:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case $H:GB(s,e)&&(c(),vH(i,s.content));break}s=s.right}c()};return e||t?fV(a,n=>{e&&KB(n,e),t&&KB(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):fV(r,r=>{let i=gH(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),xH(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):fV(r,r=>{let i=gH(r,this,e,!n);xH(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):fV(n,n=>{DH(n,gH(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):fV(r,r=>{let i=gH(r,this,e,!1);i.right!==null&&SH(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):fV(this.doc,t=>{eH(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):fV(this.doc,n=>{tH(n,this,e,t)})}getAttribute(e){return nH(this,e)}getAttributes(){return rH(this)}_write(e){e.writeTypeRef(dU)}},AH=e=>new kH,jH=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??jV()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===PH||t.constructor===MH)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},MH=class e extends VV{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof VV?e.clone():e)),t}get length(){return this.doc??jV(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new jH(this,e)}querySelector(e){e=e.toUpperCase();let t=new jH(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),YP(new jH(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){BV(this,e,new IH(this,t,e))}toString(){return KV(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),GV(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):fV(this.doc,n=>{ZV(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)fV(this.doc,n=>{let r=e&&e instanceof VV?e._item:e;YV(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw _I(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):fV(this.doc,n=>{$V(n,this,e,t)})}toArray(){return UV(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return JV(this,e)}slice(e=0,t=this.length){return HV(this,e,t)}forEach(e){GV(this,e)}_write(e){e.writeTypeRef(pU)}},NH=e=>new MH,PH=class e extends MH{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return lL(n,(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof VV?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):fV(this.doc,t=>{eH(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):fV(this.doc,n=>{tH(n,this,e,t)})}getAttribute(e){return nH(this,e)}hasAttribute(e){return iH(this,e)}getAttributes(e){return e?aH(this,e):rH(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return GV(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(fU),e.writeKey(this.nodeName)}},FH=e=>new PH(e.readKey()),IH=class extends kV{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},LH=class e extends dH{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(mU),e.writeKey(this.hookName)}},RH=e=>new LH(e.readKey()),zH=class e extends kH{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(hU)}},BH=e=>new zH,VH=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw vI()}mergeWith(e){return!1}write(e,t,n){throw vI()}integrate(e,t){throw vI()}},HH=0,UH=class extends VH{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),XB(e.doc.store,this)}write(e,t){e.writeInfo(HH),e.writeLen(this.length-t)}getMissing(e,t){return null}},WH=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw vI()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},GH=e=>new WH(e.readBuf()),KH=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Wz(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},qH=e=>new KH(e.readLen()),JH=(e,t)=>new Zz({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),YH=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(JH(this.doc.guid,this.opts))}splice(e){throw vI()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},XH=e=>new YH(JH(e.readString(),e.readAny())),ZH=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw vI()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},QH=e=>new ZH(e.readJSON()),$H=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw vI()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},eU=e=>new $H(e.readKey(),e.readJSON()),tU=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},nU=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new tU(n)},rU=kL(`node_env`)===`development`,iU=class e{constructor(e){this.arr=e,rU&&gL(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},aU=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new iU(n)},oU=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},sU=e=>new oU(e.readString()),cU=[lH,fH,AH,FH,NH,RH,BH],lU=0,uU=1,dU=2,fU=3,pU=4,mU=5,hU=6,gU=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw vI()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},_U=e=>new gU(cU[e.readTypeRef()](e)),vU=(e,t)=>{let n=t,r=0,i;do r>0&&(n=AB(n.client,n.clock+r)),i=$B(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof CU);return{item:i,diff:r}},yU=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},bU=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new CU(AB(r,i+n),t,AB(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=AB(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},xU=(e,t)=>ZP(e,e=>Vz(e.deletions,t)),SU=(e,t,n,r,i,a)=>{let o=e.doc,s=o.store,c=o.clientID,l=t.redone;if(l!==null)return tV(e,l);let u=t.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||SU(e,u,n,r,i,a)===null))return null;for(;u.redone!==null;)u=tV(e,u.redone)}let p=u===null?t.parent:u.content.type;if(t.parentSub===null){for(d=t.left,f=t;d!==null;){let t=d;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:tV(e,t.redone);if(t!==null&&t.parent._item===u){d=t;break}d=d.left}for(;f!==null;){let t=f;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:tV(e,t.redone);if(t!==null&&t.parent._item===u){f=t;break}f=f.right}}else if(f=null,t.right&&!i){for(d=t;d!==null&&d.right!==null&&(d.right.redone||Vz(r,d.right.id)||xU(a.undoStack,d.right.id)||xU(a.redoStack,d.right.id));)for(d=d.right;d.redone;)d=tV(e,d.redone);if(d&&d.right!==null)return null}else d=p._map.get(t.parentSub)||null;let m=AB(c,YB(s,c)),h=new CU(m,d,d&&d.lastId,f,f&&f.id,p,t.parentSub,t.content.copy());return t.redone=m,yU(h,!0),h.integrate(e,0),h},CU=class e extends VH{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=YB(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=YB(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===OB&&this.id.client!==this.parent.client&&this.parent.clock>=YB(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=nV(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=tV(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===UH||this.right&&this.right.constructor===UH)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===OB){let e=$B(n,this.parent);e.constructor===UH?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=nV(e,e.doc.store,AB(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),kB(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(kB(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has($B(e.doc.store,n.origin)))r.has($B(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),XB(e.doc.store,this),this.content.integrate(e,this),sV(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new UH(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:AB(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&kB(e.origin,this.lastId)&&this.right===e&&kB(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),Wz(e.deleteSet,this.id.client,this.id.clock,this.length),sV(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw yI();this.content.gc(e),t?rV(e,this,new UH(this.id,this.length)):this.content=new KH(this.length)}write(e,t){let n=t>0?AB(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=jB(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===OB?(e.writeParentInfo(!1),e.writeLeftID(t)):yI();i!==null&&e.writeString(i)}this.content.write(e,t)}},wU=(e,t)=>TU[t&31](e),TU=[()=>{yI()},qH,nU,GH,sU,QH,eU,_U,aU,XH,()=>{yI()}],EU=10,DU=class extends VH{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){yI()}write(e,t){e.writeInfo(EU),JF(e.restEncoder,this.length-t)}getMissing(e,t){return null}},OU=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},kU=`__ $YJS$ __`,OU[kU]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),OU[kU]=!0})),jU,sme=o((()=>{jU=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}}})),MU,NU,PU,FU,cme=o((()=>{MU=/[\uD800-\uDBFF]/,NU=/[\uDC00-\uDFFF]/,PU=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&MU.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&NU.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},FU=PU})),IU,LU,RU,zU=o((()=>{pM(),IU=new fM(`y-sync`),LU=new fM(`y-undo`),RU=new fM(`yjs-cursor`)})),BU,VU,HU,UU,WU,GU,KU,qU,JU,lme=o((()=>{SF(),BU=(e,t)=>e>>>t|e<<32-t,VU=e=>BU(e,2)^BU(e,13)^BU(e,22),HU=e=>BU(e,6)^BU(e,11)^BU(e,25),UU=e=>BU(e,7)^BU(e,18)^e>>>3,WU=e=>BU(e,17)^BU(e,19)^e>>>10,GU=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),KU=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qU=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(KU),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=WU(t[e-2])+t[e-7]+UU(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+HU(o)+(o&s^~o&c)+GU[e]+t[e]>>>0,d=VU(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/bF,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},JU=e=>new qU().digest(e)})),YU,XU,ume=o((()=>{lme(),VL(),YU=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},XU=e=>RL(YU(JU(BL(e))))})),ZU,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW=o((()=>{sme(),hj(),pM(),sF(),_L(),KP(),cme(),bI(),zU(),AU(),MW(),YI(),PL(),fz(),gz(),WP(),ume(),ZU=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Vz(t.ds,e.id),QU=[{light:`#ecd44433`,dark:`#ecd444`}],$U=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=GP();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,KI(t))}return e.get(n)},eW=(e,{colors:t=QU,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new rW(e,a),c=new uM({props:{editable:e=>{let t=IU.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:IU,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(IU);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&hz(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=LU.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},IU)})}},destroy:()=>{s.destroy()}})});return c},tW=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new iM(e.doc));else if(t.type===`node`){let r=jW(n.doc,n.type,t.anchor,n.mapping);e.setSelection(rM.create(e.doc,r))}else{let r=jW(n.doc,n.type,t.anchor,n.mapping),i=jW(n.doc,n.type,t.head,n.mapping);if(r!==null&&i!==null){let t=B.between(e.doc.resolve(r),e.doc.resolve(i));e.setSelection(t)}}},nW=(e,t)=>({type:t.selection.jsonID,anchor:kW(t.selection.anchor,e.type,e.mapping),head:kW(t.selection.head,e.type,e.mapping)}),rW=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=jU(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=nW(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(wL&&this._domSelectionInView===null&&(hz(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=oz.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=UB(Gz(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(IU,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>aW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new z(R.from(e),0,0));t.setMeta(IU,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>aW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new z(R.from(t),0,0));if(e){let t=iF(aF(e.anchor,0),n.doc.content.size),r=iF(aF(e.head,0),n.doc.content.size);n.setSelection(B.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(IU,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=WB(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&yI(),r=new Zz({gc:!1}),fB(r,t),t=WB(r),fB(r,e),e=WB(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[ZB(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{zz(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:$U(n.colorMapping,n.colors,r)}},s=WV(i,new HB(t.ds,e.sv)).map(n=>!n._item.deleted||ZU(n._item,e)||ZU(n._item,t)?aW(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new z(R.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(IU,{isChangeOrigin:!0}))},IU)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=IU.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);zz(t,t.deleteSet,e=>{if(e.constructor===CU){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>iW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new z(R.from(n),0,0));tW(r,this.beforeTransactionSelection,this),r=r.setMeta(IU,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof gV}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{CW(this.doc,this.type,e,this),this.beforeTransactionSelection=nW(this,this.prosemirrorView.state)},IU)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},iW=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof PH)return aW(e,t,n,r,i,a);throw vI()}return o},aW=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof PH){let s=iW(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof kH&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=oW(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):WV(e,new HB(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(ZU(e._item,r)?ZU(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}catch{return e.doc.transact(t=>{e._item.delete(t)},IU),n.mapping.delete(e),null}},oW=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,xW(n.attributes,t)))}}catch{return e.doc.transact(t=>{e._item.delete(t)},IU),null}return o},sW=(e,t)=>{let n=new zH,r=e.map(e=>({insert:e.text,attributes:SW(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},cW=(e,t)=>{let n=new PH(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,fW(e).map(e=>lW(e,t))),t.mapping.set(n,e),n},lW=(e,t)=>e instanceof Array?sW(e,t):cW(e,t),uW=e=>typeof e==`object`&&!!e,dW=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===(t==null?0:Object.keys(t).filter(e=>t[e]!==null).length);for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||uW(o)&&uW(s)&&dW(o,s)}return r},fW=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},pW=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&cL(e.attributes||{}).length===t[n].marks.length&&fL(e.attributes,(e,r)=>{let i=bW(r),a=t[n].marks;return dW(e,a.find(e=>e.type.name===i)?.attrs)}))},mW=(e,t)=>{if(e instanceof PH&&!(t instanceof Array)&&wW(e,t)){let n=fW(t);return e._length===n.length&&dW(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>mW(e,n[t]))}return e instanceof zH&&t instanceof Array&&pW(e,t)},hW=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),gW=(e,t,n)=>{let r=e.toArray(),i=fW(t),a=i.length,o=r.length,s=iF(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(hW(n.mapping.get(e),t))u=!0;else if(!mW(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(hW(n.mapping.get(e),t))u=!0;else if(!mW(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},_W=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof oU?t+=n.content.str:n.content instanceof $H&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},vW=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=_W(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,SW(e.marks,n))})),{insert:o,remove:s,index:c}=FU(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},yW=/(.*)(--[a-zA-Z0-9+/=]{8})$/,bW=e=>yW.exec(e)?.[1]??e,xW=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(bW(r),e[r]));return n},SW=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=VP(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${XU(e.toJSON())}`:e.type.name]=e.attrs}}),n},CW=(e,t,n,r)=>{if(t instanceof PH&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof PH){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=fW(n),a=i.length,o=t.toArray(),s=o.length,c=iF(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!hW(r.mapping.get(e),t))if(mW(e,t))r.mapping.set(e,t);else break}for(;u+l<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!hW(r.mapping.get(e),t))if(mW(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof zH&&c instanceof Array)pW(n,c)||vW(n,c,r),l+=1;else{let i=n instanceof PH&&wW(n,c),a=d instanceof PH&&wW(d,f);if(i&&a){let e=gW(n,c,r),t=gW(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(CW(e,n,c,r),l+=1):a?(CW(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[lW(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof zH?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(lW(i[t],r));t.insert(l,e)}},IU)},wW=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name})),EW,DW,OW,kW,AW,jW,MW=o((()=>{zU(),AU(),bI(),WP(),gz(),EW=null,DW=()=>{let e=EW;EW=null,e.forEach((e,t)=>{let n=t.state.tr,r=IU.getState(t.state);r&&r.binding&&!r.binding.isDestroyed&&(e.forEach((e,t)=>{n.setMeta(t,e)}),t.dispatch(n))})},OW=(e,t,n)=>{EW||(EW=new Map,hz(0,DW)),VP(EW,e,zP).set(t,n)},kW=(e,t,n)=>{if(e===0)return RB(t,0,t.length===0?-1:0);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof zH){if(r._length>=e)return RB(r,e,t.length===0?-1:0);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new NB(r._item===null?null:r._item.id,r._item===null?jB(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new NB(r._item===null?null:r._item.id,r._item===null?jB(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw yI();if(e===0&&r.constructor!==zH&&r!==t)return AW(r._item.parent,r._item)}return RB(t,t._length,t.length===0?-1:0)},AW=(e,t)=>{let n=null,r=null;return e._item===null?r=jB(e):n=AB(e._item.id.client,e._item.id.clock),new NB(n,r,t.id)},jW=(e,t,n,r)=>{let i=BB(n,e);if(i===null||i.type!==t&&!MB(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===zH)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof zH?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof zH?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1}})),NW,PW,FW,IW,LW,RW,dme=o((()=>{AU(),RP(),pM(),MW(),zU(),sF(),NW=(e,t,n)=>e!==t,PW=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(``),i=document.createTextNode(``);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},FW=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),IW=/^#[0-9a-fA-F]{6}$/,LW=(e,t,n,r,i)=>{let a=IU.getState(e),o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?DP.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:IW.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=jW(o,a.type,PB(t.cursor.anchor),a.binding.mapping),u=jW(o,a.type,PB(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=aF(e.doc.content.size-1,0);l=iF(l,t),u=iF(u,t),s.push(wP.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=iF(l,u),o=aF(l,u);s.push(wP.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),DP.create(e.doc,s))},RW=(e,{awarenessStateFilter:t=NW,cursorBuilder:n=PW,selectionBuilder:r=FW,getSelection:i=e=>e.selection}={},a=`cursor`)=>new uM({key:RU,state:{init(i,a){return LW(a,e,t,n,r)},apply(i,a,o,s){let c=IU.getState(s),l=i.getMeta(RU);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?LW(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>RU.getState(e)},view:t=>{let n=()=>{t.docView&&OW(t,RU,{awarenessUpdated:!0})},r=()=>{let n=IU.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=kW(o.anchor,n.type,n.binding.mapping),c=kW(o.head,n.type,n.binding.mapping);(r.cursor==null||!VB(PB(r.cursor.anchor),s)||!VB(PB(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&jW(n.doc,n.type,PB(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}})})),zW,BW,VW,HW,UW,WW,GW,fme=o((()=>{pM(),TW(),AU(),zU(),zW=e=>LU.getState(e)?.undoManager?.undo()!=null,BW=e=>LU.getState(e)?.undoManager?.redo()!=null,VW=(e,t)=>t==null?LU.getState(e)?.undoManager?.canUndo():zW(e),HW=(e,t)=>t==null?LU.getState(e)?.undoManager?.canRedo():BW(e),UW=new Set([`paragraph`]),WW=(e,t)=>!(e instanceof CU)||!(e.content instanceof gU)||!(e.content.type instanceof kH||e.content.type instanceof PH&&t.has(e.content.type.nodeName))||e.content.type._length===0,GW=({protectedNodes:e=UW,trackedOrigins:t=[],undoManager:n=null}={})=>new uM({key:LU,state:{init:(r,i)=>{let a=IU.getState(i),o=n||new gV(a.type,{trackedOrigins:new Set([IU].concat(t)),deleteFilter:t=>WW(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=IU.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:nW(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=IU.getState(e.state),n=LU.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,LU.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}})})),KW=o((()=>{dme(),TW(),fme(),zU(),MW()}));function qW(e){let t=Array.from(e).sort((e,t)=>e instanceof iG&&e.options.deps.includes(t)?1:t instanceof iG&&t.options.deps.includes(e)?-1:0);for(let e of t){if(XW.current.includes(e))continue;XW.current.push(e),e.recompute();let t=YW.get(e);if(t)for(let e of t){let t=JW.get(e);t&&qW(t)}}}function pme(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function mme(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function hme(e){if(QW>0&&!eG.has(e)&&eG.set(e,e.prevState),$W.add(e),!(QW>0)&&!ZW)try{for(ZW=!0;$W.size>0;){let e=Array.from($W);$W.clear();for(let t of e)t.prevState=eG.get(t)??t.prevState,pme(t);for(let t of e){let e=JW.get(t);e&&(XW.current.push(t),qW(e))}for(let t of e){let e=JW.get(t);if(e)for(let t of e)mme(t)}}}finally{ZW=!1,XW.current=[],eG.clear()}}var JW,YW,XW,ZW,QW,$W,eG,tG=o((()=>{vme(),JW=new WeakMap,YW=new WeakMap,XW={current:[]},ZW=!1,QW=0,$W=new Set,eG=new Map}));function gme(e){return typeof e==`function`}var _me=o((()=>{})),nG,rG=o((()=>{tG(),_me(),nG=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):gme(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),hme(this)}}})),iG,vme=o((()=>{rG(),tG(),iG=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof nG){let e=JW.get(n);e||(e=new Set,JW.set(n,e)),e.add(this);let t=YW.get(this);t||(t=new Set,YW.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof nG){let e=JW.get(n);e&&e.delete(this);let t=YW.get(this);t&&t.delete(n)}}}})),aG=o((()=>{rG()}));function oG(e){if(typeof e==`object`&&`key`in e)return function t(){return e[cG]=t,e};if(typeof e!=`function`)throw Error(`factory must be a function`);return function t(n){return r=>{let i=e({editor:r.editor,options:n});return i[cG]=t,i}}}function sG(e,t){return new nG(e,t)}var cG,lG=o((()=>{aG(),cG=Symbol(`originalFactory`)})),uG,dG,fG=o((()=>{pM(),RP(),lG(),uG=new fM(`blocknote-show-selection`),dG=oG(({editor:e})=>{let t=sG({enabledSet:new Set},{onUpdate(){e.transact(e=>e.setMeta(uG,{}))}});return{key:`showSelection`,store:t,prosemirrorPlugins:[new uM({key:uG,props:{decorations:e=>{let{doc:n,selection:r}=e;if(t.state.enabledSet.size===0)return DP.empty;let i=wP.inline(r.from,r.to,{"data-show-selection":`true`});return DP.create(n,[i])}}})],showSelection(e,n){t.setState({enabledSet:e?new Set([...t.state.enabledSet,n]):new Set([...t.state.enabledSet].filter(e=>e!==n))})}}})})),yme=o((()=>{Xj()}));function pG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}function mG(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Cj(e.doc,i,o,z.empty);if(!s||s.from!=i||s instanceof Wj&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(B.create(t.doc,i)),n(t.scrollIntoView())}return!0}function hG(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}function gG(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function _G(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}function vG(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function yG(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function bme(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof rM&&t.selection.node.isBlock)return!r.parentOffset||!bj(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=yG(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof B||t.selection instanceof iM)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=bj(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,bj(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}function xme(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||xj(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function bG(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&xme(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=R.empty;for(let e=o.length-1;e>=0;e--)s=R.from(o[e].create(null,s));s=R.from(i.copy(s));let c=e.tr.step(new Gj(t.pos-1,r,t.pos,r,new z(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&xj(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:$j.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&yj(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&hG(a,`start`,!0)&&hG(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=R.empty;for(let e=o.length-1;e>=0;e--)r=R.from(o[e].copy(r));n(e.tr.step(new Gj(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new z(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function xG(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(B.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}function Sme(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&dde(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function SG(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function CG(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var wG,TG,EG,DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,Cme=o((()=>{Xj(),hj(),pM(),wG=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),TG=(e,t,n)=>{let r=pG(e,n);if(!r)return!1;let i=gG(r);if(!i){let n=r.blockRange(),i=n&&yj(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(bG(e,i,t,-1))return!0;if(r.parent.content.size==0&&(hG(a,`end`)||rM.isSelectable(a)))for(let n=r.depth;;n--){let o=Cj(e.doc,r.before(n),r.after(n),z.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(hG(a,`end`)?$j.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):rM.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},EG=(e,t,n)=>{let r=pG(e,n);if(!r)return!1;let i=gG(r);return i?mG(e,i,t):!1},DG=(e,t,n)=>{let r=_G(e,n);if(!r)return!1;let i=vG(r);return i?mG(e,i,t):!1},OG=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=gG(r)}let o=a&&a.nodeBefore;return!o||!rM.isSelectable(o)?!1:(t&&t(e.tr.setSelection(rM.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)},kG=(e,t,n)=>{let r=_G(e,n);if(!r)return!1;let i=vG(r);if(!i)return!1;let a=i.nodeAfter;if(bG(e,i,t,1))return!0;if(r.parent.content.size==0&&(hG(a,`start`)||rM.isSelectable(a))){let n=Cj(e.doc,r.before(),r.after(),z.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(hG(a,`start`)?$j.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):rM.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},AG=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=vG(r)}let o=a&&a.nodeAfter;return!o||!rM.isSelectable(o)?!1:(t&&t(e.tr.setSelection(rM.create(e.doc,a.pos)).scrollIntoView()),!0)},jG=(e,t)=>{let n=e.selection,r=n instanceof rM,i;if(r){if(n.node.isTextblock||!xj(e.doc,n.from))return!1;i=n.from}else if(i=Sj(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(rM.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},MG=(e,t)=>{let n=e.selection,r;if(n instanceof rM){if(n.node.isTextblock||!xj(e.doc,n.to))return!1;r=n.to}else if(r=Sj(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},NG=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&yj(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},PG=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
27
|
+
`).scrollIntoView()),!0)},FG=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=yG(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection($j.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},IG=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof iM||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=yG(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(B.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},LG=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(bj(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&yj(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},RG=bme(),zG=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(rM.create(e.doc,i))),!0)},BG=(e,t)=>(t&&t(e.tr.setSelection(new iM(e.doc))),!0),VG=xG(-1),HG=xG(1),UG=CG(wG,TG,OG),WG=CG(wG,kG,AG),GG={Enter:CG(PG,IG,LG,RG),"Mod-Enter":FG,Backspace:UG,"Mod-Backspace":UG,"Shift-Backspace":UG,Delete:WG,"Mod-Delete":WG,"Mod-a":BG},KG={"Ctrl-h":GG.Backspace,"Alt-Backspace":GG[`Mod-Backspace`],"Ctrl-d":GG.Delete,"Ctrl-Alt-Backspace":GG[`Mod-Delete`],"Alt-Delete":GG[`Mod-Delete`],"Alt-d":GG[`Mod-Delete`],"Ctrl-a":VG,"Ctrl-e":HG};for(let e in GG)KG[e]=GG[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()})),wme=o((()=>{Cme()})),qG=o((()=>{pM()})),JG=o((()=>{hj()}));function Tme(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Eme(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Eme(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new $A(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new $A(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=dde(a,n,r,t);return s?(e&&Dme(e,t,s,i,n),!0):!1}function Dme(e,t,n,r,i){let a=R.empty;for(let e=n.length-1;e>=0;e--)a=R.from(n[e].type.create(n[e].attrs,a));e.step(new Gj(t.start-(r?2:0),t.end,t.start,t.end,new z(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&bj(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Ome(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?kme(t,n,e,a):Ame(t,n,a):!0:!1}}function kme(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Gj(a-1,o,a,o,new z(R.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new $A(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=yj(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return xj(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Ame(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+(s?0:1),u+1,o.content.append(c?R.empty:R.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Gj(d-(s?1:0),f+(c?1:0),d+1,f-1,new z((s?R.empty:R.from(i.copy(R.empty))).append(c?R.empty:R.from(i.copy(R.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}function jme(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=R.from(r?e.create():null),o=new z(R.from(e.create(null,R.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Gj(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Mme=o((()=>{Xj(),hj()})),Nme=o((()=>{Mme()})),YG=o((()=>{RP()}));function Pme(e){var t=!(QG&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||$G&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?ZG:XG)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var XG,ZG,QG,$G,eK,Fme=o((()=>{for(XG={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:`'`},ZG={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},QG=typeof navigator<`u`&&/Mac/.test(navigator.platform),$G=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eK=0;eK<10;eK++)XG[48+eK]=XG[96+eK]=String(eK);for(eK=1;eK<=24;eK++)XG[eK+111]=`F`+eK;for(eK=65;eK<=90;eK++)XG[eK]=String.fromCharCode(eK+32),ZG[eK]=String.fromCharCode(eK);for(var e in XG)ZG.hasOwnProperty(e)||(ZG[e]=XG[e])}));function Ime(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))iK?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Lme(e){let t=Object.create(null);for(let n in e)t[Ime(n)]=e[n];return t}function tK(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function nK(e){return new uM({props:{handleKeyDown:rK(e)}})}function rK(e){let t=Lme(e);return function(e,n){let r=Pme(n),i,a=t[tK(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[tK(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(aK&&n.ctrlKey&&n.altKey)&&(i=XG[n.keyCode])&&i!=r){let r=t[tK(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var iK,aK,oK=o((()=>{Fme(),pM(),iK=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),aK=typeof navigator<`u`&&/Win/.test(navigator.platform)})),sK=o((()=>{oK()}));function cK(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}function lK(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function uK(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function dK(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:uK(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function fK(e,t,n={}){return e.find(e=>e.type===t&&dK(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function pK(e,t,n={}){return!!fK(e,t,n)}function mK(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!fK([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&pK([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&pK([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function hK(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function gK(e){return e instanceof B}function _K(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function vK(e,t=null){if(!t)return null;let n=$j.atStart(e),r=$j.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?B.create(e,_K(0,i,a),_K(e.content.size,i,a)):B.create(e,_K(t,i,a),_K(t,i,a))}function yK(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function bK(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Rme(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}function xK(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Rq(n)}function SK(e,t,n){if(e instanceof ej||e instanceof R)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return R.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),SK(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new ij({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?aj.fromSchema(a).parseSlice(xK(e),n.parseOptions):aj.fromSchema(a).parse(xK(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=aj.fromSchema(t);return n.slice?r.parseSlice(xK(e),n.parseOptions).content:r.parse(xK(e),n.parseOptions)}return SK(``,t,n)}function CK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Wj||i instanceof Gj))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection($j.near(e.doc.resolve(o),n))}function wK(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function zme(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))bK()||wK()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}function TK(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?lK(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>dK(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}function EK(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function DK(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function OK(e,t,n={},r={}){return SK(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function kK(e,t){let n=hK(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function AK(e,t){let n=new Yj(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Bme(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function jK(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function MK(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function NK(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function PK(e){return t=>NK(t.$from,e)}function FK(e,t,n){return e.config[t]===void 0&&e.parent?FK(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?FK(e.parent,t,n):null}):e.config[t]}function IK(e){return e.map(e=>{let t=FK(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...IK(t())]:e}).flat(10)}function LK(e,t){let n=pj.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function RK(e){return typeof e==`function`}function zK(e,t=void 0,...n){return RK(e)?t?e.bind(t)(...n):e(...n):e}function Vme(e={}){return Object.keys(e).length===0&&e.constructor===Object}function BK(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function VK(e){let t=[],{nodeExtensions:n,markExtensions:r}=BK(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=FK(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=FK(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Hme(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function HK(e){let t=[],n=Hme(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function UK(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...HK(n[e]),...HK(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function WK(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>UK(e,t),{})}function Ume(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function GK(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Ume(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function KK(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Vme(t)?!1:t!=null))}function qK(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function JK(e,t){let n=VK(e),{nodeExtensions:r,markExtensions:i}=BK(e);return new ij({topNode:r.find(e=>FK(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=KK({...e.reduce((e,t)=>{let n=FK(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:zK(FK(r,`content`,a)),marks:zK(FK(r,`marks`,a)),group:zK(FK(r,`group`,a)),inline:zK(FK(r,`inline`,a)),atom:zK(FK(r,`atom`,a)),selectable:zK(FK(r,`selectable`,a)),draggable:zK(FK(r,`draggable`,a)),code:zK(FK(r,`code`,a)),whitespace:zK(FK(r,`whitespace`,a)),linebreakReplacement:zK(FK(r,`linebreakReplacement`,a)),defining:zK(FK(r,`defining`,a)),isolating:zK(FK(r,`isolating`,a)),attrs:Object.fromEntries(i.map(qK))}),s=zK(FK(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>GK(e,i)));let c=FK(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:WK(e,i)}));let l=FK(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=KK({...e.reduce((e,t)=>{let n=FK(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:zK(FK(r,`inclusive`,a)),excludes:zK(FK(r,`excludes`,a)),group:zK(FK(r,`group`,a)),spanning:zK(FK(r,`spanning`,a)),code:zK(FK(r,`code`,a)),attrs:Object.fromEntries(i.map(qK))}),s=zK(FK(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>GK(e,i)));let c=FK(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:WK(e,i)})),[r.name,o]}))})}function Wme(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function YK(e){return e.sort((e,t)=>{let n=FK(e,`priority`)||100,r=FK(t,`priority`)||100;return n>r?-1:n<r?1:0})}function XK(e){let t=YK(IK(e)),n=Wme(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Gme(e,t){return JK(XK(e),t)}function ZK(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
28
|
+
|
|
29
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Kme(e,t){return ZK(e,{from:0,to:e.content.size},t)}function QK(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function qme(e,t){let n=lK(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function $K(e,t){let n=EK(typeof t==`string`?t:t.name,e.schema);return n===`node`?qme(e,t):n===`mark`?kK(e,t):{}}function Jme(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Yme(e){let t=Jme(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function eq(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Yme(r)}function tq(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=mK(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function nq(e,t){return t.nodes[e]||t.marks[e]||null}function rq(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}function iq(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?hK(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>dK(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>dK(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Xme(e,t,n={}){if(!t)return TK(e,null,n)||iq(e,null,n);let r=EK(t,e.schema);return r===`node`?TK(e,t,n):r===`mark`?iq(e,t,n):!1}function aq(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function oq(e,t){let{nodeExtensions:n}=BK(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=zK(FK(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function sq(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(sq(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Zme(e){return e instanceof rM}function Qme(e,t){let n=t.mapping.mapResult(e.position);return{position:new uJ(n.pos),mapResult:n}}function $me(e){return new uJ(e)}function cq(e,t,n){let r=e.state.doc.content.size,i=_K(t,0,r),a=_K(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function ehe(e,t,n){let{selection:r}=t,i=null;if(gK(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}function lq(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}function the(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return B.create(t,1,r)}function uq(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=lJ(c)+i;return a.forEach(e=>{if(l)return;let a=FJ(u,e.find);if(!a)return;let c=s.state.tr,d=cK({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new yq({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function nhe(e){let{editor:t,rules:n}=e,r=new uM({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:LK(R.from(e),a.schema);let{from:i}=s;uq({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return uq({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&uq({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?uq({editor:t,from:a.pos,to:a.pos,text:`
|
|
30
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function rhe(e){return Object.prototype.toString.call(e).slice(8,-1)}function dq(e){return rhe(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function fq(e,t){let n={...e};return dq(e)&&dq(t)&&Object.keys(t).forEach(r=>{dq(t[r])&&dq(e[r])?n[r]=fq(e[r],t[r]):n[r]=t[r]}),n}function ihe(e){return typeof e==`number`}function ahe(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new yq({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||zJ(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}function ohe(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!ahe({editor:t,state:cK({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new uM({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(BJ=t)},i=()=>{BJ&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=BJ;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:LK(R.from(t),r.schema);let{from:n}=d,i=n+t.length,a=VJ(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!ihe(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}function she(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function pq(e){return new PJ({find:e.find,handler:({state:t,range:n,match:r})=>{let i=zK(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(tq(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function mq(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=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 o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function hq(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function che(e){let{nodeName:t,name:n,parseAttributes:r=mq,serializeAttributes:i=hq,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function lhe(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=mq,serializeAttributes:a=hq,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
|
|
31
|
+
|
|
32
|
+
${t.renderChildren(e.content||[],`
|
|
33
|
+
|
|
34
|
+
`)}
|
|
35
|
+
|
|
36
|
+
:::`}}}function uhe(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function dhe(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function fhe(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=uhe,serializeAttributes:a=dhe,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function phe(e,t,n){let r=e.split(`
|
|
37
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
|
|
38
|
+
`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
39
|
+
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
|
|
40
|
+
`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
41
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
42
|
+
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function mhe(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
|
|
43
|
+
`).map(e=>e?t.indent(e):t.indent(``)).join(`
|
|
44
|
+
`);s+=e.type===`paragraph`?`
|
|
45
|
+
|
|
46
|
+
${n}`:`
|
|
47
|
+
${n}`}}),s}function hhe(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}function gq(e){return new RJ({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=zK(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(tq(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var _q,vq,yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY=o((()=>{yme(),wme(),qG(),JG(),Nme(),YG(),sK(),_q=Object.defineProperty,vq=(e,t)=>{for(var n in t)_q(e,n,{get:t[n],enumerable:!0})},yq=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:cK({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},bq={},vq(bq,{blur:()=>xq,clearContent:()=>Sq,clearNodes:()=>Cq,command:()=>wq,createParagraphNear:()=>Tq,cut:()=>Eq,deleteCurrentNode:()=>Dq,deleteNode:()=>Oq,deleteRange:()=>kq,deleteSelection:()=>Aq,enter:()=>jq,exitCode:()=>Mq,extendMarkRange:()=>Nq,first:()=>Pq,focus:()=>Fq,forEach:()=>Iq,insertContent:()=>Lq,insertContentAt:()=>Bq,joinBackward:()=>Uq,joinDown:()=>Hq,joinForward:()=>Wq,joinItemBackward:()=>Gq,joinItemForward:()=>Kq,joinTextblockBackward:()=>qq,joinTextblockForward:()=>Jq,joinUp:()=>Vq,keyboardShortcut:()=>Yq,lift:()=>Xq,liftEmptyBlock:()=>Zq,liftListItem:()=>Qq,newlineInCode:()=>$q,resetAttributes:()=>eJ,scrollIntoView:()=>tJ,selectAll:()=>nJ,selectNodeBackward:()=>rJ,selectNodeForward:()=>iJ,selectParentNode:()=>aJ,selectTextblockEnd:()=>oJ,selectTextblockStart:()=>sJ,setContent:()=>cJ,setMark:()=>dJ,setMeta:()=>fJ,setNode:()=>pJ,setNodeSelection:()=>mJ,setTextDirection:()=>hJ,setTextSelection:()=>gJ,sinkListItem:()=>_J,splitBlock:()=>vJ,splitListItem:()=>yJ,toggleList:()=>SJ,toggleMark:()=>CJ,toggleNode:()=>wJ,toggleWrap:()=>TJ,undoInputRule:()=>EJ,unsetAllMarks:()=>DJ,unsetMark:()=>OJ,unsetTextDirection:()=>kJ,updateAttributes:()=>AJ,wrapIn:()=>jJ,wrapInList:()=>MJ}),xq=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Sq=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Cq=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=yj(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},wq=e=>t=>e(t),Tq=()=>({state:e,dispatch:t})=>IG(e,t),Eq=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new B(r.doc.resolve(Math.max(o-1,0)))),!0},Dq=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},Oq=e=>({tr:t,state:n,dispatch:r})=>{let i=lK(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},kq=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Aq=()=>({state:e,dispatch:t})=>wG(e,t),jq=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Mq=()=>({state:e,dispatch:t})=>FG(e,t),Nq=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=hK(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=mK(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=B.create(o,e.from,e.to);n.setSelection(t)}}return!0},Pq=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},Fq=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(bK()||yK())&&r.dom.focus(),Rme()&&!bK()&&!yK()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!gK(n.state.selection))return o(),!0;let s=vK(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Iq=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Lq=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Rq=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Rq(r)}return e},zq=e=>!(`type`in e),Bq=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{SK(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=SK(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((zq(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof R){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&CK(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},Vq=()=>({state:e,dispatch:t})=>jG(e,t),Hq=()=>({state:e,dispatch:t})=>MG(e,t),Uq=()=>({state:e,dispatch:t})=>TG(e,t),Wq=()=>({state:e,dispatch:t})=>kG(e,t),Gq=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Sj(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Kq=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Sj(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},qq=()=>({state:e,dispatch:t})=>EG(e,t),Jq=()=>({state:e,dispatch:t})=>DG(e,t),Yq=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=zme(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},Xq=(e,t={})=>({state:n,dispatch:r})=>TK(n,lK(e,n.schema),t)?NG(n,r):!1,Zq=()=>({state:e,dispatch:t})=>LG(e,t),Qq=e=>({state:t,dispatch:n})=>Ome(lK(e,t.schema))(t,n),$q=()=>({state:e,dispatch:t})=>PG(e,t),eJ=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=EK(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=lK(e,r.schema)),s===`mark`&&(o=hK(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,DK(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(DK(a.attrs,t))))})})}),c},tJ=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),nJ=()=>({tr:e,dispatch:t})=>{if(t){let t=new iM(e.doc);e.setSelection(t)}return!0},rJ=()=>({state:e,dispatch:t})=>OG(e,t),iJ=()=>({state:e,dispatch:t})=>AG(e,t),aJ=()=>({state:e,dispatch:t})=>zG(e,t),oJ=()=>({state:e,dispatch:t})=>HG(e,t),sJ=()=>({state:e,dispatch:t})=>VG(e,t),cJ=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=OK(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})},lJ=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n},uJ=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}},dJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=hK(e,r.schema);if(i)if(o){let e=kK(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return ehe(r,n,c)},fJ=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),pJ=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=lK(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>SG(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>SG(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},mJ=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=_K(e,0,n.content.size),i=rM.create(n,r);t.setSelection(i)}return!0},hJ=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},gJ=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=B.atStart(n).from,o=B.atEnd(n).to,s=_K(r,a,o),c=_K(i,a,o),l=B.create(n,s,c);t.setSelection(l)}return!0},_J=e=>({state:t,dispatch:n})=>jme(lK(e,t.schema))(t,n),vJ=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=rq(l,s.node().type.name,s.node().attrs);if(a instanceof rM&&a.node.isBlock)return!s.parentOffset||!bj(o,s.pos)?!1:(r&&(e&&lq(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Bme(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=bj(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&bj(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof B&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&lq(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},yJ=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=lK(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=R.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=R.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...rq(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(R.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new z(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(B.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...rq(d,u.type.name,u.attrs),...t},m={...rq(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!bj(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},bJ=(e,t)=>{let n=PK(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&xj(e.doc,n.pos)&&e.join(n.pos),!0},xJ=(e,t)=>{let n=PK(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&xj(e.doc,r)&&e.join(r),!0},SJ=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=lK(e,o.schema),m=lK(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=PK(e=>oq(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&oq(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=the(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(oq(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>bJ(a,p)).command(()=>xJ(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>bJ(a,p)).command(()=>xJ(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>bJ(a,p)).command(()=>xJ(a,p)).run()},CJ=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=hK(e,r.schema);return iq(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},wJ=(e,t,n={})=>({state:r,commands:i})=>{let a=lK(e,r.schema),o=lK(t,r.schema),s=TK(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},TJ=(e,t={})=>({state:n,commands:r})=>{let i=lK(e,n.schema);return TK(n,i,t)?r.lift(i):r.wrapIn(i,t)},EJ=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},DJ=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},OJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=hK(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=mK(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},kJ=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},AJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=EK(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=lK(e,r.schema)),s===`mark`&&(o=hK(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},jJ=(e,t={})=>({state:n,dispatch:r})=>Sme(lK(e,n.schema),t)(n,r),MJ=(e,t={})=>({state:n,dispatch:r})=>Tme(lK(e,n.schema),t)(n,r),NJ=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},PJ=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},FJ=(e,t)=>{if(uK(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,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},IJ=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...zK(FK(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...zK(FK(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>fq(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},LJ=class e extends IJ{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},RJ=class{constructor(e){this.find=e.find,this.handler=e.handler}},zJ=(e,t,n)=>{if(uK(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]},BJ=null,VJ=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n},HJ=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=XK(e),this.schema=JK(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=FK(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:nq(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return YK([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:nq(t.name,this.schema)},r=[],i=FK(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&FK(t,`exitable`,n)&&(a.ArrowRight=()=>LJ.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=nK(a);r.push(o);let s=FK(t,`addInputRules`,n);if(aq(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=nhe({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=FK(t,`addPasteRules`,n);if(aq(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=ohe({editor:e,rules:t});r.push(...n)}}let l=FK(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return VK(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=BK(this.extensions);return Object.fromEntries(t.filter(e=>!!FK(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=FK(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:lK(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:WK(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return YK([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:nq(n.name,this.schema)},i=FK(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return YK([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:nq(n.name,this.schema)},i=FK(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=BK(this.extensions);return Object.fromEntries(t.filter(e=>!!FK(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=FK(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:hK(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=WK(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{hhe(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:nq(e.name,this.schema)};e.type===`mark`&&(zK(FK(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=FK(e,`onBeforeCreate`,t),r=FK(e,`onCreate`,t),i=FK(e,`onUpdate`,t),a=FK(e,`onSelectionUpdate`,t),o=FK(e,`onTransaction`,t),s=FK(e,`onFocus`,t),c=FK(e,`onBlur`,t),l=FK(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}},HJ.resolve=XK,HJ.sort=YK,HJ.flatten=IK,UJ={},vq(UJ,{ClipboardTextSerializer:()=>GJ,Commands:()=>KJ,Delete:()=>qJ,Drop:()=>JJ,Editable:()=>YJ,FocusEvents:()=>ZJ,Keymap:()=>QJ,Paste:()=>$J,Tabindex:()=>eY,TextDirection:()=>tY,focusEventsPluginKey:()=>XJ}),WJ=class e extends IJ{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},GJ=WJ.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new uM({key:new fM(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=QK(n);return ZK(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),KJ=WJ.create({name:`commands`,addCommands(){return{...bq}}}),qJ=WJ.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=AK(e.before,[e,...t]);eq(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Vj){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),JJ=WJ.create({name:`drop`,addProseMirrorPlugins(){return[new uM({key:new fM(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),YJ=WJ.create({name:`editable`,addProseMirrorPlugins(){return[new uM({key:new fM(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),XJ=new fM(`focusEvents`),ZJ=WJ.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new uM({key:XJ,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),QJ=WJ.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:$j.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return bK()||wK()?i:r},addProseMirrorPlugins(){return[new uM({key:new fM(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=$j.atStart(t.doc).from,l=$j.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!sq(n.doc))return;let u=n.tr,d=cK({state:n,transaction:u}),{commands:f}=new yq({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),$J=WJ.create({name:`paste`,addProseMirrorPlugins(){return[new uM({key:new fM(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),eY=WJ.create({name:`tabindex`,addProseMirrorPlugins(){return[new uM({key:new fM(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),tY=WJ.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=BK(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new uM({key:new fM(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),nY=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}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(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},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;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+(a?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},rY=`.ProseMirror {
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ProseMirror {
|
|
52
|
+
word-wrap: break-word;
|
|
53
|
+
white-space: pre-wrap;
|
|
54
|
+
white-space: break-spaces;
|
|
55
|
+
-webkit-font-variant-ligatures: none;
|
|
56
|
+
font-variant-ligatures: none;
|
|
57
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ProseMirror [contenteditable="false"] {
|
|
61
|
+
white-space: normal;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ProseMirror pre {
|
|
69
|
+
white-space: pre-wrap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
img.ProseMirror-separator {
|
|
73
|
+
display: inline !important;
|
|
74
|
+
border: none !important;
|
|
75
|
+
margin: 0 !important;
|
|
76
|
+
width: 0 !important;
|
|
77
|
+
height: 0 !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror-gapcursor {
|
|
81
|
+
display: none;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
position: absolute;
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ProseMirror-gapcursor:after {
|
|
88
|
+
content: "";
|
|
89
|
+
display: block;
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: -2px;
|
|
92
|
+
width: 20px;
|
|
93
|
+
border-top: 1px solid black;
|
|
94
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes ProseMirror-cursor-blink {
|
|
98
|
+
to {
|
|
99
|
+
visibility: hidden;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ProseMirror-hideselection *::selection {
|
|
104
|
+
background: transparent;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
108
|
+
background: transparent;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ProseMirror-hideselection * {
|
|
112
|
+
caret-color: transparent;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
116
|
+
display: block;
|
|
117
|
+
}`,iY=class extends NJ{constructor(e={}){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:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Qme,createMappablePosition:$me},this.setOptions(e),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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=vK(t,this.options.autofocus);this.editorState=Kde.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),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){let e=this.editorView.dom;e?.editor&&delete e.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(e){console.warn(`Failed to remove CSS element:`,e)}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=she(rY,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=RK(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new HJ([...this.options.enableCoreExtensions?[YJ,GJ.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),KJ,ZJ,QJ,eY,JJ,$J,qJ,tY.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new yq({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=OK(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,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(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=OK(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new LP(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return $K(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Xme(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return LK(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
118
|
+
|
|
119
|
+
`,textSerializers:n={}}=e||{};return Kme(this.state.doc,{blockSeparator:t,textSerializers:{...QK(this.schema),...n}})}get isEmpty(){return sq(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new nY(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}},aY={},vq(aY,{createAtomBlockMarkdownSpec:()=>che,createBlockMarkdownSpec:()=>lhe,createInlineMarkdownSpec:()=>fhe,parseAttributes:()=>mq,parseIndentedBlocks:()=>phe,renderNestedMarkdownContent:()=>mhe,serializeAttributes:()=>hq}),oY=class e extends IJ{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}}})),cY,lY,uY,dY,fY=o((()=>{cY=Object.defineProperty,lY=(e,t,n)=>t in e?cY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uY=(e,t,n)=>lY(e,typeof t==`symbol`?t:t+``,n),dY=class{constructor(){uY(this,`callbacks`,{})}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}}}));function ghe(){if(!pY&&(pY=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!pY))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return pY(mY)}var pY,mY,_he=o((()=>{mY=new Uint8Array(16)})),hY,vhe=o((()=>{hY=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i}));function yhe(e){return typeof e==`string`&&hY.test(e)}var bhe=o((()=>{vhe()}));function xhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(gY[e[t+0]]+gY[e[t+1]]+gY[e[t+2]]+gY[e[t+3]]+`-`+gY[e[t+4]]+gY[e[t+5]]+`-`+gY[e[t+6]]+gY[e[t+7]]+`-`+gY[e[t+8]]+gY[e[t+9]]+`-`+gY[e[t+10]]+gY[e[t+11]]+gY[e[t+12]]+gY[e[t+13]]+gY[e[t+14]]+gY[e[t+15]]).toLowerCase();if(!yhe(n))throw TypeError(`Stringified UUID is invalid`);return n}var gY,_Y,She=o((()=>{for(bhe(),gY=[],_Y=0;_Y<256;++_Y)gY.push((_Y+256).toString(16).substr(1))}));function vY(e,t,n){e||={};var r=e.random||(e.rng||ghe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return xhe(r)}var Che=o((()=>{_he(),She()})),yY=o((()=>{Che()}));function whe(e,t){let n=new Map;return e.descendants((e,r)=>{e.marks.forEach(i=>{if(i.type.name===t){let t=i.attrs.threadId;if(!t)return;let a=r,o=a+e.nodeSize,s=n.get(t)??{from:1/0,to:0};n.set(t,{from:Math.min(a,s.from),to:Math.max(o,s.to)})}})}),n}var bY,xY,SY,CY,wY,TY,EY,The=o((()=>{pM(),RP(),KW(),lG(),fG(),sY(),fY(),bY=Object.defineProperty,xY=(e,t,n)=>t in e?bY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SY=(e,t,n)=>xY(e,typeof t==`symbol`?t:t+``,n),CY=LJ.create({name:`comment`,excludes:``,inclusive:!1,keepOnSplit:!0,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute(`data-orphan`),renderHTML:e=>e.orphan?{"data-orphan":`true`}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute(`data-bn-thread-id`),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:``}}},renderHTML({HTMLAttributes:e}){return[`span`,UK(e,{class:`bn-thread-mark`})]},parseHTML(){return[{tag:`span.bn-thread-mark`}]},extendMarkSchema(e){return e.name===`comment`?{blocknoteIgnore:!0}:{}}}),wY=class extends dY{constructor(e){super(),SY(this,`userCache`,new Map),SY(this,`loadingUsers`,new Set),this.resolveUsers=e}async loadUsers(e){let t=e.filter(e=>!this.userCache.has(e)&&!this.loadingUsers.has(e));if(t.length!==0){for(let e of t)this.loadingUsers.add(e);try{let e=await this.resolveUsers(t);for(let t of e)this.userCache.set(t.id,t);this.emit(`update`,this.userCache)}finally{for(let e of t)this.loadingUsers.delete(e)}}}getUser(e){return this.userCache.get(e)}subscribe(e){return this.on(`update`,e)}},TY=new fM(`blocknote-comments`),EY=oG(({editor:e,options:{schema:t,threadStore:n,resolveUsers:r}})=>{if(!r)throw Error(`resolveUsers is required to be defined when using comments`);if(!n)throw Error(`threadStore is required to be defined when using comments`);let i=CY.name,a=new wY(r),o=sG({pendingComment:!1,selectedThreadId:void 0,threadPositions:new Map},{onUpdate(){o.state.selectedThreadId!==o.prevState.selectedThreadId&&e.transact(e=>e.setMeta(TY,!0))}}),s=t=>{e.transact(e=>{e.doc.descendants((n,r)=>{n.marks.forEach(a=>{if(a.type.name===i){let i=a.type,s=a.attrs.threadId,c=t.get(s),l=!!(!c||c.resolved||c.deletedAt);if(l!==a.attrs.orphan){let t=Math.max(r,0),c=Math.min(r+n.nodeSize,e.doc.content.size-1,e.doc.content.size-1);e.removeMark(t,c,a),e.addMark(t,c,i.create({...a.attrs,orphan:l})),l&&o.state.selectedThreadId===s&&o.setState(e=>({...e,selectedThreadId:void 0}))}}})})})};return{key:`comments`,store:o,prosemirrorPlugins:[new uM({key:TY,state:{init(){return{decorations:DP.empty}},apply(e,t){let n=e.getMeta(TY);if(!e.docChanged&&!n)return t;let r=e.docChanged?whe(e.doc,i):o.state.threadPositions;(r.size>0||o.state.threadPositions.size>0)&&o.setState(e=>({...e,threadPositions:r}));let a=[];if(o.state.selectedThreadId){let e=r.get(o.state.selectedThreadId);e&&a.push(wP.inline(e.from,e.to,{class:`bn-thread-mark-selected`}))}return{decorations:DP.create(e.doc,a)}}},props:{decorations(e){return TY.getState(e)?.decorations??DP.empty},handleClick:(e,t,n)=>{if(n.button!==0)return;let r=e.state.doc.nodeAt(t);if(!r){o.setState(e=>({...e,selectedThreadId:void 0}));return}let a=r.marks.find(e=>e.type.name===i&&e.attrs.orphan!==!0)?.attrs.threadId;a!==o.state.selectedThreadId&&o.setState(e=>({...e,selectedThreadId:a}))}}})],threadStore:n,mount(){let t=n.subscribe(s);s(n.getThreads());let r=e.onSelectionChange(()=>{o.state.pendingComment&&o.setState(e=>({...e,pendingComment:!1}))});return()=>{t(),r()}},selectThread(t,n=!0){var r;if(o.state.selectedThreadId!==t&&(o.setState(e=>({...e,pendingComment:!1,selectedThreadId:t})),t&&n)){let n=o.state.threadPositions.get(t);if(!n)return;(r=e.prosemirrorView?.domAtPos(n.from).node)==null||r.scrollIntoView({behavior:`smooth`,block:`center`})}},startPendingComment(){var t;o.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!0})),(t=e.getExtension(dG))==null||t.showSelection(!0,`comments`)},stopPendingComment(){var t;o.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!1})),(t=e.getExtension(dG))==null||t.showSelection(!1,`comments`)},async createThread(t){let r=await n.createThread(t);if(n.addThreadToDocument){let t=e.prosemirrorView,i=t.state.selection,a=IU.getState(t.state),o={prosemirror:{head:i.head,anchor:i.anchor},yjs:a?nW(a.binding,t.state):void 0};await n.addThreadToDocument({threadId:r.id,selection:o})}else e._tiptapEditor.commands.setMark(i,{orphan:!1,threadId:r.id})},userStore:a,commentEditorSchema:t,tiptapExtensions:[CY]}})})),Ehe=s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}));function Dhe(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Ohe(e){return Dhe(e.filter((t,n)=>e.indexOf(t)!==n))}function DY(e){return e.type===`link`}function OY(e){return typeof e!=`string`&&e.type===`link`}function kY(e){return typeof e!=`string`&&e.type===`text`}function AY(e){return MY(e)?{...e}:jY(e)?{type:`tableCell`,content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??`default`,textColor:e.props?.textColor??`default`,textAlignment:e.props?.textAlignment??`left`,colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:`tableCell`,content:[].concat(e),props:{backgroundColor:`default`,textColor:`default`,textAlignment:`left`,colspan:1,rowspan:1}}}function jY(e){return e!=null&&typeof e!=`string`&&!Array.isArray(e)&&e.type===`tableCell`}function MY(e){return jY(e)&&e.props!==void 0&&e.content!==void 0}function NY(e){return MY(e)?e.props.colspan??1:1}function PY(e){return MY(e)?e.props.rowspan??1:1}function FY(e,t=!0){let{"data-test":n,...r}=e;if(Object.keys(r).length>0&&t)throw Error(`Object must be empty `+JSON.stringify(e))}function IY(e,t){let n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup(`bnBlock`))return{posBeforeNode:n.pos,node:n.nodeAfter};let r=n.depth,i=n.node(r);for(;r>0;){if(i.type.isInGroup(`bnBlock`))return{posBeforeNode:n.before(r),node:i};r--,i=n.node(r)}let a=[];e.descendants((e,t)=>{e.type.isInGroup(`bnBlock`)&&a.push(t)}),console.warn(`Position ${t} is not within a blockContainer node.`);let o=e.resolve(a.find(e=>e>=t)||a[a.length-1]);return{posBeforeNode:o.pos,node:o.nodeAfter}}function LY(e,t){if(!e.type.isInGroup(`bnBlock`))throw Error(`Attempted to get bnBlock node at position but found node of different type ${e.type.name}`);let n=e,r=t,i={node:n,beforePos:r,afterPos:r+n.nodeSize};if(n.type.name===`blockContainer`){let e,t;if(n.forEach((n,i)=>{if(n.type.spec.group===`blockContent`){let t=n,a=r+i+1;e={node:t,beforePos:a,afterPos:a+n.nodeSize}}else if(n.type.name===`blockGroup`){let e=n,a=r+i+1;t={node:e,beforePos:a,afterPos:a+n.nodeSize}}}),!e)throw Error(`blockContainer node does not contain a blockContent node in its children: ${n}`);return{isBlockContainer:!0,bnBlock:i,blockContent:e,childContainer:t,blockNoteType:e.node.type.name}}else{if(!i.node.type.isInGroup(`childContainer`))throw Error(`bnBlock node is not in the childContainer group: ${i.node}`);return{isBlockContainer:!1,bnBlock:i,childContainer:i,blockNoteType:i.node.type.name}}}function RY(e){return LY(e.node,e.posBeforeNode)}function zY(e){if(!e.nodeAfter)throw Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return LY(e.nodeAfter,e.pos)}function BY(e){return RY(IY(e.doc,e.selection.anchor))}function VY(e){return RY(IY(e.doc,e.selection.anchor))}function HY(e){return`doc`in e?e.doc.type.schema:e.type.schema}function UY(e){return e.cached.blockNoteEditor}function WY(e){return UY(e).schema}function GY(e){return WY(e).blockSchema}function KY(e){return WY(e).inlineContentSchema}function qY(e){return WY(e).styleSchema}function JY(e){return UY(e).blockCache}function YY(e,t,n){var r;let i={type:`tableContent`,columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},a=[];e.content.forEach((e,r,o)=>{let s={cells:[]};o===0&&e.content.forEach(e=>{let t=e.attrs.colwidth;t??=Array(e.attrs.colspan??1).fill(void 0),i.columnWidths.push(...t)}),s.cells=e.content.content.map((e,r)=>(a[o]||(a[o]=[]),a[o][r]=e.type.name===`tableHeader`,{type:`tableCell`,content:e.content.content.map(e=>XY(e,t,n)).reduce((e,t)=>{if(!e.length)return t;let n=e[e.length-1],r=t[0];return r&&kY(n)&&kY(r)&&JSON.stringify(n.styles)===JSON.stringify(r.styles)?(n.text+=`
|
|
120
|
+
`+r.text,e.push(...t.slice(1)),e):(e.push(...t),e)},[]),props:{colspan:e.attrs.colspan,rowspan:e.attrs.rowspan,backgroundColor:e.attrs.backgroundColor,textColor:e.attrs.textColor,textAlignment:e.attrs.textAlignment}})),i.rows.push(s)});for(let e=0;e<a.length;e++)(r=a[e])!=null&&r.every(e=>e)&&(i.headerRows=(i.headerRows??0)+1);for(let e=0;e<a[0]?.length;e++)a!=null&&a.every(t=>t[e])&&(i.headerCols=(i.headerCols??0)+1);return i}function XY(e,t,n){let r=[],i;return e.content.forEach(e=>{if(e.type.name===`hardBreak`){if(i)if(kY(i))i.text+=`
|
|
121
|
+
`;else if(DY(i))i.content[i.content.length-1].text+=`
|
|
122
|
+
`;else throw Error(`unexpected`);else i={type:`text`,text:`
|
|
123
|
+
`,styles:{}};return}if(e.type.name!==`link`&&e.type.name!==`text`){if(!t[e.type.name]){console.warn(`unrecognized inline content type`,e.type.name);return}i&&=(r.push(i),void 0),r.push(ZY(e,t,n));return}let a={},o;for(let t of e.marks)if(t.type.name===`link`)o=t;else{let e=n[t.type.name];if(!e){if(t.type.spec.blocknoteIgnore)continue;throw Error(`style ${t.type.name} not found in styleSchema`)}if(e.propSchema===`boolean`)a[e.type]=!0;else if(e.propSchema===`string`)a[e.type]=t.attrs.stringValue;else throw new gX(e.propSchema)}i?kY(i)?o?(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):JSON.stringify(i.styles)===JSON.stringify(a)?i.text+=e.textContent:(r.push(i),i={type:`text`,text:e.textContent,styles:a}):DY(i)&&(o?i.href===o.attrs.href?JSON.stringify(i.content[i.content.length-1].styles)===JSON.stringify(a)?i.content[i.content.length-1].text+=e.textContent:i.content.push({type:`text`,text:e.textContent,styles:a}):(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):(r.push(i),i={type:`text`,text:e.textContent,styles:a})):i=o?{type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}:{type:`text`,text:e.textContent,styles:a}}),i&&r.push(i),r}function ZY(e,t,n){if(e.type.name===`text`||e.type.name===`link`)throw Error(`unexpected`);let r={},i=t[e.type.name];for(let[t,n]of Object.entries(e.attrs)){if(!i)throw Error(`ic node is of an unrecognized type: `+e.type.name);t in i.propSchema&&(r[t]=n)}let a;return a=i.content===`styled`?XY(e,t,n):void 0,{type:e.type.name,props:r,content:a}}function QY(e,t,n=GY(t),r=KY(t),i=qY(t),a=JY(t)){var o;if(!e.type.isInGroup(`bnBlock`))throw Error(`Node should be a bnBlock, but is instead: `+e.type.name);let s=a?.get(e);if(s)return s;let c=LY(e,0),l=c.bnBlock.node.attrs.id;l===null&&(l=hX.options.generateID());let u=n[c.blockNoteType];if(!u)throw Error(`Block is of an unrecognized type: `+c.blockNoteType);let d={};for(let[t,n]of Object.entries({...e.attrs,...c.isBlockContainer?c.blockContent.node.attrs:{}})){let e=u.propSchema;t in e&&!(e[t].default===void 0&&n===void 0)&&(d[t]=n)}let f=n[c.blockNoteType],p=[];(o=c.childContainer)==null||o.node.forEach(e=>{p.push(QY(e,t,n,r,i,a))});let m;if(f.content===`inline`){if(!c.isBlockContainer)throw Error(`impossible`);m=XY(c.blockContent.node,r,i)}else if(f.content===`table`){if(!c.isBlockContainer)throw Error(`impossible`);m=YY(c.blockContent.node,r,i)}else if(f.content===`none`)m=void 0;else throw new gX(f.content);let h={id:l,type:f.type,props:d,content:m,children:p};return a?.set(e,h),h}function khe(e,t=HY(e),n=GY(t),r=KY(t),i=qY(t),a=JY(t)){let o=[];return e.firstChild&&e.firstChild.descendants(e=>(o.push(QY(e,t,n,r,i,a)),!1)),o}function Ahe(e,t,n=GY(t),r=KY(t),i=qY(t),a=JY(t)){function o(e,s,c){if(e.type.name!==`blockGroup`)throw Error(`unexpected`);let l=[],u,d;return e.forEach((f,p,m)=>{if(f.type.name!==`blockContainer`)throw Error(`unexpected`);if(f.childCount===0)return;if(f.childCount===0||f.childCount>2)throw Error(`unexpected, blockContainer.childCount: `+f.childCount);let h=m===0,g=m===e.childCount-1;if(f.firstChild.type.name===`blockGroup`){if(!h)throw Error(`unexpected`);let e=o(f.firstChild,Math.max(0,s-1),g?Math.max(0,c-1):0);u=e.blockCutAtStart,g&&(d=e.blockCutAtEnd),l.push(...e.blocks);return}let _=QY(f,t,n,r,i,a),v=f.childCount>1?f.child(1):void 0,y=[];if(v){let e=o(v,0,g?Math.max(0,c-1):0);y=e.blocks,g&&(d=e.blockCutAtEnd)}g&&!v&&c>1&&(d=_.id),h&&s>1&&(u=_.id),l.push({..._,children:y})}),{blocks:l,blockCutAtStart:u,blockCutAtEnd:d}}if(e.content.childCount===0)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(e.content.childCount!==1)throw Error(`slice must be a single block, did you forget includeParents=true?`);return o(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function $Y(e){let{height:t,width:n}=nX(e),r=Array(t).fill(!1).map(()=>Array(n).fill(null)),i=(e,i)=>{for(let a=e;a<t;a++)for(let e=i;e<n;e++)if(!r[a][e])return{row:a,col:e};throw Error(`Unable to create occupancy grid for table, no more available cells`)};for(let t=0;t<e.content.rows.length;t++)for(let n=0;n<e.content.rows[t].cells.length;n++){let a=AY(e.content.rows[t].cells[n]),o=PY(a),s=NY(a),{row:c,col:l}=i(t,n);for(let e=c;e<c+o;e++)for(let i=l;i<l+s;i++){if(r[e][i])throw Error(`Unable to create occupancy grid for table, cell at ${e},${i} is already occupied`);r[e][i]={row:t,col:n,rowspan:o,colspan:s,cell:a}}}return r}function eX(e){let t=new Set;return e.map(e=>({cells:e.map(e=>t.has(e.row+`:`+e.col)?!1:(t.add(e.row+`:`+e.col),e.cell)).filter(e=>e!==!1)}))}function tX(e,t,n=$Y(t)){for(let t=0;t<n.length;t++)for(let r=0;r<n[t].length;r++){let i=n[t][r];if(i&&i.row===e.row&&i.col===e.col)return{row:t,col:r,cell:i.cell}}throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function nX(e){let t=e.content.rows.length,n=0;return e.content.rows.forEach(e=>{let t=0;e.cells.forEach(e=>{t+=NY(e)}),n=Math.max(n,t)}),{height:t,width:n}}function rX(e,t,n=$Y(t)){let r=n[e.row]?.[e.col];if(r)return{row:r.row,col:r.col,cell:r.cell}}function iX(e,t){let n=$Y(e);if(t<0||t>=n.length)return[];let r=0;for(let e=0;e<t;e++){let e=n[r]?.[0];if(!e)return[];r+=e.rowspan}let i=Array(n[0].length).fill(!1).map((t,i)=>rX({row:r,col:i},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function aX(e,t){let n=$Y(e);if(t<0||t>=n[0].length)return[];let r=0;for(let e=0;e<t;e++){let e=n[0]?.[r];if(!e)return[];r+=e.colspan}let i=Array(n.length).fill(!1).map((t,i)=>rX({row:i,col:r},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function jhe(e,t,n,r=$Y(e)){let{col:i}=tX({row:0,col:t},e,r),{col:a}=tX({row:0,col:n},e,r);return r.forEach(e=>{let[t]=e.splice(i,1);e.splice(a,0,t)}),eX(r)}function Mhe(e,t,n,r=$Y(e)){let{row:i}=tX({row:t,col:0},e,r),{row:a}=tX({row:n,col:0},e,r),[o]=r.splice(i,1);return r.splice(a,0,o),eX(r)}function oX(e){return e?jY(e)?oX(e.content):typeof e==`string`?e.length===0:Array.isArray(e)?e.every(e=>typeof e==`string`?e.length===0:kY(e)?e.text.length===0:OY(e)?typeof e.content==`string`?e.content.length===0:e.content.every(e=>e.text.length===0):!1):!1:!0}function Nhe(e,t,n=$Y(e)){if(t===`columns`){let e=0;for(let t=n[0].length-1;t>=0&&n.every(e=>oX(e[t].cell)&&e[t].colspan===1);t--)e++;for(let t=n.length-1;t>=0;t--){let r=Math.max(n[t].length-e,1);n[t]=n[t].slice(0,r)}return eX(n)}let r=0;for(let e=n.length-1;e>=0&&n[e].every(e=>oX(e.cell)&&e.rowspan===1);e--)r++;let i=Math.min(r,n.length-1);return n.splice(n.length-i,i),eX(n)}function Phe(e,t,n,r=$Y(e)){let{width:i,height:a}=nX(e);if(t===`columns`)r.forEach((e,t)=>{if(n>=0)for(let r=0;r<n;r++)e.push({row:t,col:Math.max(...e.map(e=>e.col))+1,rowspan:1,colspan:1,cell:AY(``)});else e.splice(i+n,-1*n)});else if(n>0)for(let e=0;e<n;e++){let t=Array(i).fill(null).map((t,n)=>({row:a+e,col:n,rowspan:1,colspan:1,cell:AY(``)}));r.push(t)}else n<0&&r.splice(a+n,-1*n);return eX(r)}function sX(e,t,n){let r=iX(e,n);if(!r.some(e=>PY(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=PY(e.cell);i=Math.max(i,e.row+t-1),a=Math.min(a,e.row)}),t<n?n===i:n===a}function cX(e,t,n){let r=aX(e,n);if(!r.some(e=>NY(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=NY(e.cell);i=Math.max(i,e.col+t-1),a=Math.min(a,e.col)}),t<n?n===i:n===a}function Fhe(e,t,n){let r=tX(e,n),i=tX(t,n);return r.col===i.col}function lX(e,t,n,r){let i=[];for(let[r,a]of Object.entries(e.styles||{})){let e=n[r];if(!e)throw Error(`style ${r} not found in styleSchema`);if(e.propSchema===`boolean`)a&&i.push(t.mark(r));else if(e.propSchema===`string`)a&&i.push(t.mark(r,{stringValue:a}));else throw new gX(e.propSchema)}return!r||!t.nodes[r].spec.code?e.text.split(/(\n)/g).filter(e=>e.length>0).map(e=>e===`
|
|
124
|
+
`?t.nodes.hardBreak.createChecked():t.text(e,i)):e.text.length>0?[t.text(e.text,i)]:[]}function Ihe(e,t,n){let r=t.marks.link.create({href:e.href});return uX(e.content,t,n).map(e=>{if(e.type.name===`text`)return e.mark([...e.marks,r]);if(e.type.name===`hardBreak`)return e;throw Error(`unexpected node type`)})}function uX(e,t,n,r){let i=[];if(typeof e==`string`)return i.push(...lX({text:e,styles:{}},t,n,r)),i;for(let a of e)i.push(...lX(a,t,n,r));return i}function dX(e,t,n,r=qY(t)){let i=[];for(let a of e)typeof a==`string`?i.push(...uX(a,t,r,n)):OY(a)?i.push(...Ihe(a,t,r)):kY(a)?i.push(...uX([a],t,r,n)):i.push(pX(a,t,r));return i}function fX(e,t,n=qY(t)){let r=[],i=Array(e.headerRows??0).fill(!0),a=Array(e.headerCols??0).fill(!0),o=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){let c=e.rows[s],l=[],u=i[s];for(let r=0;r<c.cells.length;r++){let i=c.cells[r],d=a[r],f=null,p=tX({row:s,col:r},{content:e}),m=o[p.col]?[o[p.col]]:null;if(i)if(typeof i==`string`)f=t.text(i);else if(jY(i)){i.content&&(f=dX(i.content,t,`tableParagraph`,n));let e=NY(i);e>1&&(m=Array(e).fill(!1).map((e,t)=>o[p.col+t]??void 0))}else f=dX(i,t,`tableParagraph`,n);let h=t.nodes[d||u?`tableHeader`:`tableCell`].createChecked({...jY(i)?i.props:{},colwidth:m},t.nodes.tableParagraph.createChecked(void 0,f));l.push(h)}let d=t.nodes.tableRow.createChecked({},l);r.push(d)}return r}function pX(e,t,n){let r,i=e.type;if(i===void 0&&(i=`paragraph`),!t.nodes[i])throw Error(`node type ${i} not found in schema`);if(!e.content)r=t.nodes[i].createChecked(e.props);else if(typeof e.content==`string`){let a=dX([e.content],t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(Array.isArray(e.content)){let a=dX(e.content,t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(e.content.type===`tableContent`){let a=fX(e.content,t,n);r=t.nodes[i].createChecked(e.props,a)}else throw new gX(e.content.type);return r}function mX(e,t,n=qY(t)){let r=e.id;r===void 0&&(r=hX.options.generateID());let i=[];if(e.children)for(let r of e.children)i.push(mX(r,t,n));if(!e.type||t.nodes[e.type].isInGroup(`blockContent`)){let a=pX(e,t,n),o=i.length>0?t.nodes.blockGroup.createChecked({},i):void 0;return t.nodes.blockContainer.createChecked({id:r,...e.props},o?[a,o]:a)}else{if(t.nodes[e.type].isInGroup(`bnBlock`))return t.nodes[e.type].createChecked({id:r,...e.props},i);throw Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}var hX,gX,_X=o((()=>{sY(),hj(),pM(),yY(),hX=WJ.create({name:`uniqueID`,priority:1e4,addOptions(){return{attributeName:`id`,types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<`u`&&window.__TEST_OPTIONS){let e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return vY()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{let t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new uM({key:new fM(`uniqueID`),appendTransaction:(e,t,n)=>{let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=this.options.filterTransaction&&e.some(e=>{var t,n;return!((n=(t=this.options).filterTransaction)!=null&&n.call(t,e))});if(!r||i)return;let{tr:a}=n,{types:o,attributeName:s,generateID:c}=this.options,l=AK(t.doc,e),{mapping:u}=l;if(eq(l).forEach(({newRange:e})=>{let r=MK(n.doc,e,e=>o.includes(e.type.name)),i=Ohe(r.map(({node:e})=>e.attrs[s]).filter(e=>e!==null));r.forEach(({node:e,pos:r})=>{let o=a.doc.nodeAt(r)?.attrs[s];if(o===null){let i=t.doc.type.createAndFill().content;if(t.doc.content.findDiffStart(i)===null){let t=JSON.parse(JSON.stringify(n.doc.toJSON()));if(t.content[0].content[0].attrs.id=`initialBlockId`,JSON.stringify(t.content)===JSON.stringify(i.toJSON())){a.setNodeMarkup(r,void 0,{...e.attrs,[s]:`initialBlockId`});return}}a.setNodeMarkup(r,void 0,{...e.attrs,[s]:c()});return}let{deleted:l}=u.invert().mapResult(r);l&&i.includes(o)&&a.setNodeMarkup(r,void 0,{...e.attrs,[s]:c()})})}),a.steps.length)return a.setMeta(`uniqueID`,!0),a},view(t){let n=n=>{let r;e=(r=t.dom.parentElement)!=null&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener(`dragstart`,n),{destroy(){window.removeEventListener(`dragstart`,n)}}},props:{handleDOMEvents:{drop:(n,r)=>(t=e!==n.dom.parentElement||r.dataTransfer?.effectAllowed===`copy`,e=null,!1),paste:()=>(t=!0,!1)},transformPasted:e=>{if(!t)return e;let{types:n,attributeName:r}=this.options,i=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if(!n.includes(e.type.name)){t.push(e.copy(i(e.content)));return}let a=e.type.create({...e.attrs,[r]:null},i(e.content),e.marks);t.push(a)}),R.from(t)};return t=!1,new z(i(e.content),e.openStart,e.openEnd)}}})]}}),gX=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}}}));function Lhe(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Rhe(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new $X(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&zhe(s,o,e),s}function Rhe(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function zhe(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=Bhe(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function Bhe(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function vX(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}function yX(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Vhe(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function bX(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function xX(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=yX(t.$head)||Hhe(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Hhe(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function SX(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Uhe(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function CX(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function wX(e,t,n){let r=e.node(-1),i=$X.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function TX(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function EX(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Whe(e,t,n){let r=vX(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}function Ghe(e){if(!(e.selection instanceof tZ))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(wP.node(n,n+e.nodeSize,{class:`selectedCell`}))}),DP.create(e.doc,t)}function Khe({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function qhe({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Jhe(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof rM&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=tZ.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=tZ.rowSelection(e,e)}else if(!n){let e=$X.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=tZ.create(i,t+1,n)}}else r instanceof B&&Khe(r)?a=B.create(i,r.from):r instanceof B&&qhe(r)&&(a=B.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}function DX(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?DX(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Yhe(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Xhe(e,t,r,n))};return t?t.doc!=e.doc&&DX(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Xhe(e,t,n,r){let i=$X.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,TX(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=vX(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(rZ,{fixTables:!0})}function OX(e){let t=e.selection,n=xX(e),r=n.node(-1),i=n.start(-1),a=$X.get(r);return{...t instanceof tZ?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function kX(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Whe(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,EX(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?vX(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Zhe(e,t){if(!bX(e))return!1;if(t){let n=OX(e);t(kX(e.tr,n,n.left))}return!0}function Qhe(e,t){if(!bX(e))return!1;if(t){let n=OX(e);t(kX(e.tr,n,n.right))}return!0}function $he(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,TX(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function ege(e,t){if(!bX(e))return!1;if(t){let n=OX(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;$he(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=$X.get(e)}t(r)}return!0}function tge(e,t,n){let r=vX(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function AX(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;tge(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?vX(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,vX(r.type.schema).row.create(null,o)),e}function nge(e,t){if(!bX(e))return!1;if(t){let n=OX(e);t(AX(e.tr,n,n.top))}return!0}function rge(e,t){if(!bX(e))return!1;if(t){let n=OX(e);t(AX(e.tr,n,n.bottom))}return!0}function ige(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function age(e,t){if(!bX(e))return!1;if(t){let n=OX(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;ige(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=$X.get(n.table)}t(r)}return!0}function jX(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function oge({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function sge(e,t){let n=e.selection;if(!(n instanceof tZ)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=OX(e),{map:i}=r;if(oge(i,r))return!1;if(t){let n=e.tr,a={},o=R.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{jX(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...EX(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=jX(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new tZ(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function cge(e,t){let n=vX(e.schema);return lge(({node:e})=>n[e.type.spec.tableRole])(e,t)}function lge(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof tZ){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Vhe(r.$from),!i)return!1;a=yX(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=OX(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof tZ&&u.setSelection(new tZ(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function uge(e){return function(t,n){if(!bX(t))return!1;if(n){let r=vX(t.schema),i=OX(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function MX(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function NX(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?uge(e):function(t,n){if(!bX(t))return!1;if(n){let r=vX(t.schema),i=OX(t),a=t.tr,o=MX(`row`,i,r),s=MX(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}function dge(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function PX(e){return function(t,n){if(!bX(t))return!1;let r=dge(xX(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(B.between(e,Uhe(e))).scrollIntoView())}return!0}}function FX(e,t){let n=e.selection;if(!(n instanceof tZ))return!1;if(t){let r=e.tr,i=vX(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new z(i,0,0))}),r.docChanged&&t(r)}return!0}function fge(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=IX(vX(o).row,new z(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?IX(vX(o).row,new z(t,n,r)).content:t);else return null;return pge(o,s)}function pge(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(R.empty),n[i]<r){let a=vX(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(R.from(o))}return{height:t.length,width:r,rows:t}}function IX(e,t){let n=e.createAndFill();return new Yj(n).replace(0,n.content.size,t).doc}function mge({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(TX(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(R.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(R.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function hge(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=vX(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,R.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function LX(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function RX(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,TX(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(TX(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function zX(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=$X.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=$X.get(a),f=d.mapping.maps.length}hge(d,o,a,n,l,u,f)&&p(),LX(d,o,a,n,c,l,s,f)&&p(),LX(d,o,a,n,c,l,u,f)&&p(),RX(d,o,a,n,s,u,c,f)&&p(),RX(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new z(i.rows[e-s],0,0))}p(),d.setSelection(new tZ(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}function BX(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function VX(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof tZ)return BX(n,r,$j.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=UX(i,e,t);if(o==null)return!1;if(e==`horiz`)return BX(n,r,$j.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=wX(i,e,t),s;return s=a?$j.near(a,1):t<0?$j.near(n.doc.resolve(i.before(-1)),-1):$j.near(n.doc.resolve(i.after(-1)),1),BX(n,r,s)}}}function HX(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof tZ)o=a;else{let r=UX(i,e,t);if(r==null)return!1;o=new tZ(n.doc.resolve(r))}let s=wX(o.$headCell,e,t);return s?BX(n,r,new tZ(o.$anchorCell,s)):!1}}function gge(e,t){let n=e.state.doc,r=yX(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new tZ(r))),!0):!1}function _ge(e,t,n){if(!bX(e.state))return!1;let r=fge(n),i=e.state.selection;if(i instanceof tZ){r||={width:1,height:1,rows:[R.from(IX(vX(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=$X.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=mge(r,o.right-o.left,o.bottom-o.top),zX(e.state,e.dispatch,a,o,r),!0}else if(r){let t=xX(e.state),n=t.start(-1);return zX(e.state,e.dispatch,n,$X.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function vge(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=WX(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof tZ)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=yX(e.state.selection.$anchor))!=null&&GX(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=GX(e,n),i=eZ.getState(e.state)==null;if(!r||!CX(t,r))if(i)r=t;else return;let a=new tZ(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(eZ,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),eZ.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(eZ,-1))}function o(r){let o=r,s=eZ.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(WX(e,o.target)!=n&&(c=GX(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function UX(e,t,n){if(!(e.state.selection instanceof B))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function WX(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function GX(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&yX(e.state.doc.resolve(r))||yX(e.state.doc.resolve(i))}function KX(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}function yge({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=aZ,lastColumnResizable:i=!0}={}){let a=new uM({key:oZ,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=vX(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new sZ(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=oZ.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{bge(t,n,e,i)},mouseleave:e=>{xge(e)},mousedown:(e,r)=>{Sge(e,r,t,n)}},decorations:e=>{let t=oZ.getState(e);if(t&&t.activeHandle>-1)return Dge(e,t.activeHandle)},nodeViews:{}}});return a}function bge(e,t,n,r){if(!e.editable)return;let i=oZ.getState(e.state);if(i&&!i.dragging){let a=wge(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=qX(e,t,`left`,n):i-t.clientX<=n&&(o=qX(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=$X.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}YX(e,o)}}}function xge(e){if(!e.editable)return;let t=oZ.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&YX(e,-1)}function Sge(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=oZ.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Cge(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(oZ,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=oZ.getState(e.state);r?.dragging&&(Tge(e,r.activeHandle,JX(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(oZ,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=oZ.getState(e.state);if(i&&i.dragging){let a=JX(i.dragging,t,n);XX(e,i.activeHandle,a,r)}}return XX(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Cge(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function wge(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function qX(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=yX(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=$X.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function JX(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function YX(e,t){e.dispatch(e.state.tr.setMeta(oZ,{setHandle:t}))}function Tge(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=$X.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():Ege(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function XX(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=$X.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&KX(a,c.firstChild,c,r,s,n)}function Ege(e){return Array(e).fill(0)}function Dge(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return DP.empty;let a=$X.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,oZ.getState(e)?.dragging&&n.push(wP.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(wP.widget(s,c))}}return DP.create(e.doc,n)}function Oge({allowTableNodeSelection:e=!1}={}){return new uM({key:eZ,state:{init(){return null},apply(e,t){let n=e.getMeta(eZ);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Ghe,handleDOMEvents:{mousedown:vge},createSelectionBetween(e){return eZ.getState(e.state)==null?null:e.state.selection},handleTripleClick:gge,handleKeyDown:iZ,handlePaste:_ge},appendTransaction(t,n,r){return Jhe(r,Yhe(r,n),e)}})}var ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ=o((()=>{if(pM(),hj(),RP(),oK(),Xj(),typeof WeakMap<`u`){let e=new WeakMap;ZX=t=>e.get(t),QX=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;ZX=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},QX=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}$X=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return ZX(e)||QX(e,Lhe(e))}},eZ=new fM(`selectingCells`),tZ=class e extends $j{constructor(e,t=e){let n=e.node(-1),r=$X.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new eM(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(SX(r)&&SX(i)&&CX(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return B.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=$X.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=TX(e,0,l)),u>0&&(e=TX(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(R.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new z(R.from(o),1,1)}replace(e,t=z.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?z.empty:t)}let i=$j.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new z(R.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=$X.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=$X.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=$X.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=$X.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new nZ(this.$anchorCell.pos,this.$headCell.pos)}},tZ.prototype.visible=!1,$j.jsonID(`cell`,tZ),nZ=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&CX(t,n)?new tZ(t,n):$j.near(n,1)}},rZ=new fM(`fix-tables`),NX(`row`,{useDeprecatedLogic:!0}),NX(`column`,{useDeprecatedLogic:!0}),NX(`cell`,{useDeprecatedLogic:!0}),iZ=rK({ArrowLeft:VX(`horiz`,-1),ArrowRight:VX(`horiz`,1),ArrowUp:VX(`vert`,-1),ArrowDown:VX(`vert`,1),"Shift-ArrowLeft":HX(`horiz`,-1),"Shift-ArrowRight":HX(`horiz`,1),"Shift-ArrowUp":HX(`vert`,-1),"Shift-ArrowDown":HX(`vert`,1),Backspace:FX,"Mod-Backspace":FX,Delete:FX,"Mod-Delete":FX}),aZ=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),KX(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,KX(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}},oZ=new fM(`tableColumnResizing`),sZ=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(oZ);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return SX(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}}})),lZ,kge=o((()=>{lZ=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]}})),Age=o((()=>{kge()})),uZ,dZ,fZ,pZ,mZ,hZ,jge=o((()=>{sY(),Age(),uZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,dZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,fZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,pZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,mZ=LJ.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return lZ(`strong`,{...UK(this.options.HTMLAttributes,e),children:lZ(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[pq({find:uZ,type:this.type}),pq({find:fZ,type:this.type})]},addPasteRules(){return[gq({find:dZ,type:this.type}),gq({find:pZ,type:this.type})]}}),hZ=mZ})),gZ,_Z,vZ,yZ,Mge=o((()=>{sY(),gZ=/(^|[^`])`([^`]+)`(?!`)$/,_Z=/(^|[^`])`([^`]+)`(?!`)/g,vZ=LJ.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,UK(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[pq({find:gZ,type:this.type})]},addPasteRules(){return[gq({find:_Z,type:this.type})]}}),yZ=vZ})),bZ,xZ,SZ,CZ,wZ,TZ,Nge=o((()=>{sY(),bZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,xZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,SZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,CZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wZ=LJ.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,UK(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[pq({find:bZ,type:this.type}),pq({find:SZ,type:this.type})]},addPasteRules(){return[gq({find:xZ,type:this.type}),gq({find:CZ,type:this.type})]}}),TZ=wZ})),EZ,DZ,OZ,kZ,Pge=o((()=>{sY(),EZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,DZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,OZ=LJ.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,UK(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[pq({find:EZ,type:this.type})]},addPasteRules(){return[gq({find:DZ,type:this.type})]}}),kZ=OZ})),AZ,jZ,Fge=o((()=>{sY(),AZ=LJ.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,UK(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),jZ=AZ}));function Ige({parser:e,nodeTypes:t=[`code_block`,`codeBlock`],languageExtractor:n=e=>e.attrs.language}){let r=new fM(`prosemirror-highlight`);return new uM({key:r,state:{init(r,i){let a=new NZ,[o,s]=MZ(i.doc,e,t,n,a);return{cache:a,decorations:o,promises:s}},apply:(r,i)=>{let a=i.cache.invalidate(r),o=!!r.getMeta(`prosemirror-highlight-refresh`);if(!r.docChanged&&!o)return{cache:a,decorations:i.decorations.map(r.mapping,r.doc),promises:i.promises};let[s,c]=MZ(r.doc,e,t,n,a);return{cache:a,decorations:s,promises:c}}},view:e=>{let t=new Set,n=()=>{if(t.size>0)return;let n=e.state.tr.setMeta(`prosemirror-highlight-refresh`,!0);e.dispatch(n)},i=()=>{let i=r.getState(e.state);for(let e of i?.promises??[])t.add(e),e.then(()=>{t.delete(e),n()}).catch(()=>{t.delete(e)})};return i(),{update:()=>{i()}}},props:{decorations(e){return this.getState(e)?.decorations}}})}function MZ(e,t,n,r,i){let a=[],o=[];return e.descendants((e,s)=>{if(!e.type.isTextblock)return!0;if(n.includes(e.type.name)){let n=r(e),c=i.get(s);if(c){let[e,t]=c;a.push(...t)}else{let r=t({content:e.textContent,language:n||void 0,pos:s,size:e.nodeSize});r&&Array.isArray(r)?(i.set(s,e,r),a.push(...r)):r instanceof Promise&&(i.remove(s),o.push(r))}}return!1}),[DP.create(e,a),o]}var NZ,Lge=o((()=>{pM(),RP(),NZ=class e{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,t,n){e<0||this.cache.set(e,[t,n])}replace(e,t,n,r){this.remove(e),this.set(t,n,r)}remove(e){this.cache.delete(e)}invalidate(t){let n=new e(this.cache),r=t.mapping;return this.cache.forEach(([e,i],a)=>{if(a<0)return;let o=r.mapResult(a),s=t.doc.nodeAt(o.pos);if(o.deleted||!s?.eq(e))n.remove(a);else if(a!==o.pos){let e=i.map(e=>e.map(r,0,0)).filter(e=>e!=null);n.replace(a,o.pos,s,e)}}),n}}}));function Rge(e,t){return function({content:n,language:r,pos:i,size:a}){let o=[],{tokens:s,fg:c,bg:l,rootStyle:u}=e.codeToTokens(n,{lang:r,...t??{theme:e.getLoadedThemes()[0]}}),d=u||(c&&l?`--prosemirror-highlight:${c};--prosemirror-highlight-bg:${l}`:``);if(d){let e=wP.node(i,i+a,{style:d});o.push(e)}let f=i+1;for(let e of s){for(let t of e){let e=f+t.content.length,n=wP.inline(f,e,{style:zge(t.htmlStyle??`color: ${t.color}`),class:`shiki`});o.push(n),f=e}f+=1}return o}}function zge(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var Bge=o((()=>{RP()}));function PZ(e,t=`Ctrl`){return uQ()?e.replace(`Mod`,`⌘`):e.replace(`Mod`,t)}function FZ(...e){return[...new Set(e.filter(e=>e).join(` `).split(` `))].join(` `)}function Vge(e,t,n,r){let i=document.createElement(`div`);i.className=FZ(`bn-block-content`,n.class),i.setAttribute(`data-content-type`,e);for(let[e,t]of Object.entries(n))e!==`class`&&i.setAttribute(e,t);let a=document.createElement(t);a.className=FZ(`bn-inline-content`,r.class);for(let[e,t]of Object.entries(r))e!==`class`&&a.setAttribute(e,t);return i.appendChild(a),{dom:i,contentDOM:a}}function IZ(e,t=`<br>`){let n=e.querySelectorAll(`p`);if(n.length>1){let e=n[0];for(let r=1;r<n.length;r++){let i=n[r];e.innerHTML+=t+i.innerHTML,i.remove()}}}function LZ(e){return`data-`+e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function RZ(e){let t=e.split(`/`);return!t.length||t[t.length-1]===``?e:t[t.length-1]}function Hge(e){let t=[`mp4`,`webm`,`ogg`,`mov`,`mkv`,`flv`,`avi`,`wmv`,`m4v`];try{let n=new URL(e).pathname.split(`.`).pop()?.toLowerCase()||``;return t.includes(n)}catch{return!1}}function Uge(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={default:n.default,keepOnSplit:!0,parseHTML:t=>{let r=t.getAttribute(LZ(e));if(r===null)return null;if(n.default===void 0&&n.type===`boolean`||n.default!==void 0&&typeof n.default==`boolean`)return r===`true`?!0:r===`false`?!1:null;if(n.default===void 0&&n.type===`number`||n.default!==void 0&&typeof n.default==`number`){let e=parseFloat(r);return!Number.isNaN(e)&&Number.isFinite(e)?e:null}return r},renderHTML:t=>t[e]===n.default?{}:{[LZ(e)]:t[e]}}}),t}function Wge(e,t,n,r){let i=e();if(i===void 0)throw Error(`Cannot find node position`);let a=n.state.doc.resolve(i).node().attrs.id;if(!a)throw Error(`Block doesn't have id`);let o=t.getBlock(a);if(o.type!==r)throw Error(`Block type does not match`);return o}function zZ(e,t,n,r,i=!1,a){let o=document.createElement(`div`);if(a!==void 0)for(let[e,t]of Object.entries(a))e!==`class`&&o.setAttribute(e,t);o.className=FZ(`bn-block-content`,a?.class||``),o.setAttribute(`data-content-type`,t);for(let[e,t]of Object.entries(n))t!==r[e].default&&o.setAttribute(LZ(e),t);return i&&o.setAttribute(`data-file-block`,``),o.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=FZ(`bn-inline-content`,e.contentDOM.className)),{...e,dom:o}}function Gge(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,render:fQ,toExternalHTML:fQ},extensions:n}}function Kge(e,t){e.stopEvent=e=>(e.type===`mousedown`&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function qge(e,t){let n=[{tag:`[data-content-type=`+e.type+`]`,contentElement:`.bn-inline-content`}];return t.parse&&n.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t.parse?.call(t,e);return n===void 0?!1:n},preserveWhitespace:!0,getContent:e.content===`inline`||e.content===`none`?(n,r)=>{var i;if(t.parseContent){let e=t.parseContent({el:n,schema:r});if(e!==void 0)return e}if(e.content===`inline`){let e=n.cloneNode(!0);return IZ(e,(i=t.meta)!=null&&i.code?`
|
|
125
|
+
`:`<br>`),aj.fromSchema(r).parse(e,{topNode:r.nodes.paragraph.create(),preserveWhitespace:!0}).content}return R.empty}:void 0}),n}function Jge(e,t,n,r){let i=t.node||oY.create({name:e.type,content:e.content===`inline`?`inline*`:e.content===`none`?``:e.content,group:`blockContent`,selectable:t.meta?.selectable??!0,isolating:t.meta?.isolating??!0,code:t.meta?.code??!1,defining:t.meta?.defining??!0,priority:r,addAttributes(){return Uge(e.propSchema)},parseHTML(){return qge(e,t)},renderHTML({HTMLAttributes:n}){let r=document.createElement(`div`);return zZ({dom:r,contentDOM:e.content===`inline`?r:void 0},e.type,{},e.propSchema,t.meta?.fileBlockAccept!==void 0,n)},addNodeView(){return n=>{let r=this.options.editor,i=Wge(n.getPos,r,this.editor,e.type),a=this.options.domAttributes?.blockContent||{},o=t.render.call({blockContentDOMAttributes:a,props:n,renderType:`nodeView`},i,r);return t.meta?.selectable===!1&&Kge(o,this.editor),o}}});if(i.name!==e.type)throw Error(`Node name does not match block type. This is a bug in BlockNote.`);return{config:e,implementation:{...t,node:i,render(e,n){let r=i.options.domAttributes?.blockContent||{};return t.render.call({blockContentDOMAttributes:r,props:void 0,renderType:`dom`},e,n)},toExternalHTML:(e,n,r)=>{let a=i.options.domAttributes?.blockContent||{};return t.toExternalHTML?.call({blockContentDOMAttributes:a},e,n,r)??t.render.call({blockContentDOMAttributes:a,renderType:`dom`,props:void 0},e,n)}},extensions:n}}function BZ(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t,o=n?typeof n==`function`?n(r):n:void 0;return{config:i,implementation:{...a,toExternalHTML(e,t,n){let r=a.toExternalHTML?.call({blockContentDOMAttributes:this.blockContentDOMAttributes},e,t,n);if(r!==void 0)return zZ(r,e.type,e.props,i.propSchema,a.meta?.fileBlockAccept!==void 0)},render(e,t){return zZ(a.render.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},e,t),e.type,e.props,i.propSchema,a.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}},extensions:o}}}function VZ(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Yge(e){return e===`boolean`?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:e=>e.getAttribute(`data-value`),renderHTML:e=>e.stringValue===void 0?{}:{"data-value":e.stringValue}}}}function HZ(e,t,n,r){return e.dom.setAttribute(`data-style-type`,t),r===`string`&&e.dom.setAttribute(`data-value`,n),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function UZ(e,t){return{config:e,implementation:t}}function WZ(e,t){return UZ({type:e.name,propSchema:t},{mark:e,render(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=pj.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a},toExternalHTML(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=pj.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a}})}function GZ(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Xge(e,t){let n=[{tag:`[data-style-type="${e.type}"]`,contentElement:e=>{let t=e;return t.matches(`[data-editable]`)?t:t.querySelector(`[data-editable]`)||t}}];return t&&n.push({tag:`*`,consuming:!1,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n===void 0?!1:{stringValue:n}}}),n}function KZ(e,t){let n=LJ.create({name:e.type,addAttributes(){return Yge(e.propSchema)},parseHTML(){return Xge(e,t.parse)},renderHTML({mark:n}){return HZ((t.toExternalHTML||t.render)(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:n})=>HZ(t.render(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)}});return UZ(e,{...t,mark:n,render:n=>HZ(t.render(n),e.type,n,e.propSchema),toExternalHTML:n=>HZ((t.toExternalHTML||t.render)(n),e.type,n,e.propSchema)})}function qZ(e,t){let n,r;if(t.firstChild.descendants((t,i)=>n?!1:!JZ(t)||t.attrs.id!==e?!0:(n=t,r=i+1,!1)),!(n===void 0||r===void 0))return{node:n,posBeforeNode:r}}function JZ(e){return e.type.isInGroup(`bnBlock`)}function YZ(e,t,n,r,i){let a=zY(e.doc.resolve(t)),o=null;a.blockNoteType===`table`&&(o=$ge(e));let s=HY(e);if(r!==void 0&&i!==void 0&&r>i)throw Error(`Invalid replaceFromPos or replaceToPos`);let c=s.nodes[a.blockNoteType],l=s.nodes[n.type||a.blockNoteType],u=l.isInGroup(`bnBlock`)?l:s.nodes.blockContainer;if(a.isBlockContainer&&l.isInGroup(`blockContent`)){let t=r!==void 0&&r>a.blockContent.beforePos&&r<a.blockContent.afterPos?r-a.blockContent.beforePos-1:void 0,o=i!==void 0&&i>a.blockContent.beforePos&&i<a.blockContent.afterPos?i-a.blockContent.beforePos-1:void 0;XZ(n,e,a),Zge(n,e,c,l,a,t,o)}else if(!a.isBlockContainer&&l.isInGroup(`bnBlock`))XZ(n,e,a);else{let t=QY(a.bnBlock.node,s);e.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,mX({children:t.children,...n},s));return}e.setNodeMarkup(a.bnBlock.beforePos,u,{...a.bnBlock.node.attrs,...n.props}),o&&e_e(e,a,o)}function Zge(e,t,n,r,i,a,o){let s=HY(t),c=`keep`;if(e.content)if(typeof e.content==`string`)c=dX([e.content],s,r.name);else if(Array.isArray(e.content))c=dX(e.content,s,r.name);else if(e.content.type===`tableContent`)c=fX(e.content,s);else throw new gX(e.content.type);else n.spec.content===``||r.spec.content!==n.spec.content&&(c=[]);if(c===`keep`)t.setNodeMarkup(i.blockContent.beforePos,r,{...i.blockContent.node.attrs,...e.props});else if(a!==void 0||o!==void 0){t.setNodeMarkup(i.blockContent.beforePos,r,{...i.blockContent.node.attrs,...e.props});let n=i.blockContent.beforePos+1+(a??0),s=i.blockContent.beforePos+1+(o??i.blockContent.node.content.size),l=t.doc.resolve(i.blockContent.beforePos).depth,u=t.doc.resolve(n).depth,d=t.doc.resolve(s).depth;t.replace(n,s,new z(R.from(c),u-l-1,d-l-1))}else t.replaceWith(i.blockContent.beforePos,i.blockContent.afterPos,r.createChecked({...i.blockContent.node.attrs,...e.props},c))}function XZ(e,t,n){let r=HY(t);if(e.children!==void 0&&e.children.length>0){let i=e.children.map(e=>mX(e,r));if(n.childContainer)t.step(new Wj(n.childContainer.beforePos+1,n.childContainer.afterPos-1,new z(R.from(i),0,0)));else{if(!n.isBlockContainer)throw Error(`impossible`);t.insert(n.blockContent.afterPos,r.nodes.blockGroup.createChecked({},i))}}}function Qge(e,t,n,r,i){let a=typeof t==`string`?t:t.id,o=qZ(a,e.doc);if(!o)throw Error(`Block with ID ${a} not found`);return YZ(e,o.posBeforeNode,n,r,i),QY(e.doc.resolve(o.posBeforeNode+1).node(),HY(e))}function $ge(e){let t=`selection`in e?e.selection:null;if(!(t instanceof B))return null;let n=e.doc.resolve(t.head),r=-1,i=-1;for(let e=n.depth;e>=0;e--){let t=n.node(e).type.name;if(r<0&&(t===`tableCell`||t===`tableHeader`)&&(r=e),t===`table`){i=e;break}}if(r<0||i<0)return null;let a=n.before(r),o=n.before(i),s=e.doc.nodeAt(o);if(!s||s.type.name!==`table`)return null;let c=$X.get(s),l=a-(o+1),u=c.map.indexOf(l);if(u<0)return null;let d=Math.floor(u/c.width),f=u%c.width,p=a+1+1;return{row:d,col:f,offset:Math.max(0,t.head-p)}}function e_e(e,t,n){if(t.blockNoteType!==`table`)return!1;let r=-1;if(t.isBlockContainer)r=e.mapping.map(t.blockContent.beforePos);else{let n=e.mapping.map(t.bnBlock.beforePos),i=n+(e.doc.nodeAt(n)?.nodeSize||0);e.doc.nodesBetween(n,i,(e,t)=>e.type.name===`table`?(r=t,!1):!0)}let i=r>=0?e.doc.nodeAt(r):null;if(!i||i.type.name!==`table`)return!1;let a=$X.get(i),o=Math.max(0,Math.min(n.row,a.height-1)),s=Math.max(0,Math.min(n.col,a.width-1)),c=o*a.width+s,l=a.map[c];if(l==null)return!1;let u=r+1+l+1,d=e.doc.nodeAt(u),f=u+1,p=d?d.content.size:0,m=f+Math.max(0,Math.min(n.offset,p));return`selection`in e&&e.setSelection(B.create(e.doc,m)),!0}function t_e(e){let t=globalThis,n,r;return Ige({parser:i=>{if(!e.createHighlighter)return[];if(!n)return t[FQ]=t[FQ]||e.createHighlighter(),t[FQ].then(e=>{n=e});let a=ZZ(e,i.language);return!a||a===`text`||a===`none`||a===`plaintext`||a===`txt`?[]:n.getLoadedLanguages().includes(a)?(r||(r=t[PQ]||Rge(n),t[PQ]=r),r(i)):n.loadLanguage(a)},languageExtractor:e=>e.attrs.language,nodeTypes:[`codeBlock`]})}function ZZ(e,t){return Object.entries(e.supportedLanguages??{}).find(([e,{aliases:n}])=>n?.includes(t)||e===t)?.[0]}function QZ(e,t,n){var r;let i=aj.fromSchema(t),a=e.querySelector(`:scope > summary`),o;if(a){let e=a.cloneNode(!0);IZ(e),o=i.parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}else o=R.empty;let s=document.createElement(`div`);s.setAttribute(`data-node-type`,`blockGroup`);let c=!1;for(let t of Array.from(e.childNodes))t.tagName!==`SUMMARY`&&(t.nodeType===3&&!((r=t.textContent)!=null&&r.trim())||(c=!0,s.appendChild(t.cloneNode(!0))));let l=t.nodes[n].create({},o);if(!c)return l.content;let u=i.parse(s,{topNode:t.nodes.blockGroup.create()});return u.content.size>0?l.content.addToEnd(u):l.content}function $Z(e,t,n){let r=aj.fromSchema(t),i=e,a=document.createElement(`div`);a.setAttribute(`data-node-type`,`blockGroup`);for(let e of Array.from(i.childNodes))a.appendChild(e.cloneNode(!0));let o=r.parse(a,{topNode:t.nodes.blockGroup.create()});(o.firstChild?.firstChild)?.type.name===`checkListItem`&&(o=o.copy(o.content.cut(o.firstChild.firstChild.nodeSize+2)));let s=o.firstChild?.firstChild;if(!(s!=null&&s.isTextblock))return R.from(o);let c=t.nodes[n].create({},s.content),l=o.content.cut(s.nodeSize+2);if(l.size>0){let e=o.copy(l);return c.content.addToEnd(e)}return c.content}function eQ(e,t,n,r){let i=e.firstChild.attrs.start||1,a=!0,o=!!e.firstChild.attrs.start,s=RY({posBeforeNode:t,node:e});if(!s.isBlockContainer)throw Error(`impossible`);let c=n.doc.resolve(s.bnBlock.beforePos).nodeBefore,l=c?r.get(c):void 0;return l===void 0?c&&RY({posBeforeNode:s.bnBlock.beforePos-c.nodeSize,node:c}).blockNoteType===`numberedListItem`&&(i=eQ(c,s.bnBlock.beforePos-c.nodeSize,n,r).index+1,a=!1):(i=l+1,a=!1),r.set(e,i),{index:i,isFirst:a,hasStart:o}}function tQ(e,t){let n=new Map,r=t.decorations.map(e.mapping,e.doc),i=[];e.doc.nodesBetween(0,e.doc.nodeSize-2,(t,a)=>{if(t.type.name===`blockContainer`&&t.firstChild.type.name===`numberedListItem`){let{index:o,isFirst:s,hasStart:c}=eQ(t,a,e,n);if(r.find(a,a+t.nodeSize,e=>e.index===o&&e.isFirst===s&&e.hasStart===c).length===0){let t=e.doc.nodeAt(a+1);i.push(wP.node(a+1,a+1+t.nodeSize,{"data-index":o.toString()}))}}});let a=i.flatMap(e=>r.find(e.from,e.to));return{decorations:r.remove(a).add(e.doc,i)}}function nQ(e,t){let n=aj.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return n.content.descendants(e=>{if(e.isInline)return r.push(e),!1}),R.fromArray(r)}function rQ(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(let[r,i]of Object.entries(n)){if(!(r in e.schema.blockSpecs[t].config.propSchema))return!1;if(typeof i==`string`){if(e.schema.blockSpecs[t].config.propSchema[r].default!==void 0&&typeof e.schema.blockSpecs[t].config.propSchema[r].default!==i||e.schema.blockSpecs[t].config.propSchema[r].type!==void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[r].default!==i.default||e.schema.blockSpecs[t].config.propSchema[r].default===void 0&&i.default===void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i.type||typeof e.schema.blockSpecs[t].config.propSchema[r].values!=typeof i.values)return!1;if(typeof e.schema.blockSpecs[t].config.propSchema[r].values==`object`&&typeof i.values==`object`){for(let n of i.values)if(!e.schema.blockSpecs[t].config.propSchema[r].values.includes(n))return!1}}}return!0}function iQ(e,t,n,r){return rQ(t,n,r)&&e.type===n}function aQ(e){return e instanceof tZ}function n_e(e){if(M$.has(e))return M$.get(e);let t=new Ij;return e._tiptapEditor.on(`transaction`,({transaction:e})=>{t.appendMapping(e.mapping)}),e._tiptapEditor.on(`destroy`,()=>{M$.delete(e)}),M$.set(e,t),t}function r_e(e,t,n=`left`){let r=IU.getState(e.prosemirrorState);if(!r){let r=n_e(e),i=r.maps.length;return()=>r.slice(i).map(t,n===`left`?-1:1)}let i=kW(t+(n===`right`?1:-1),r.binding.type,r.binding.mapping);return()=>{let t=IU.getState(e.prosemirrorState),r=jW(t.doc,t.binding.type,i,t.binding.mapping);if(r===null)throw Error(`Position not found, cannot track positions`);return r+(n===`right`?-1:1)}}function i_e(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;n===`none`;){if(t=e.getTextCursorPosition().nextBlock,t===void 0)return;n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,`end`)}}function oQ(e,t){let n=e.getTextCursorPosition().block;if(n.content===void 0)throw Error(`Slash Menu open in a block that doesn't contain content.`);let r;return Array.isArray(n.content)&&(n.content.length===1&&kY(n.content[0])&&n.content[0].type===`text`&&n.content[0].text===`/`||n.content.length===0)?(r=e.updateBlock(n,t),e.setTextCursorPosition(r)):(r=e.insertBlocks([t],n,`after`)[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),i_e(e),r}function a_e(e){let t=[];return rQ(e,`heading`,{level:`number`})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e<=3).forEach(n=>{t.push({onItemClick:()=>{oQ(e,{type:`heading`,props:{level:n}})},badge:PZ(`Mod-Alt-${n}`),key:n===1?`heading`:`heading_${n}`,...e.dictionary.slash_menu[n===1?`heading`:`heading_${n}`]})}),rQ(e,`quote`)&&t.push({onItemClick:()=>{oQ(e,{type:`quote`})},key:`quote`,...e.dictionary.slash_menu.quote}),rQ(e,`toggleListItem`)&&t.push({onItemClick:()=>{oQ(e,{type:`toggleListItem`})},badge:PZ(`Mod-Shift-6`),key:`toggle_list`,...e.dictionary.slash_menu.toggle_list}),rQ(e,`numberedListItem`)&&t.push({onItemClick:()=>{oQ(e,{type:`numberedListItem`})},badge:PZ(`Mod-Shift-7`),key:`numbered_list`,...e.dictionary.slash_menu.numbered_list}),rQ(e,`bulletListItem`)&&t.push({onItemClick:()=>{oQ(e,{type:`bulletListItem`})},badge:PZ(`Mod-Shift-8`),key:`bullet_list`,...e.dictionary.slash_menu.bullet_list}),rQ(e,`checkListItem`)&&t.push({onItemClick:()=>{oQ(e,{type:`checkListItem`})},badge:PZ(`Mod-Shift-9`),key:`check_list`,...e.dictionary.slash_menu.check_list}),rQ(e,`paragraph`)&&t.push({onItemClick:()=>{oQ(e,{type:`paragraph`})},badge:PZ(`Mod-Alt-0`),key:`paragraph`,...e.dictionary.slash_menu.paragraph}),rQ(e,`codeBlock`)&&t.push({onItemClick:()=>{oQ(e,{type:`codeBlock`})},badge:PZ(`Mod-Alt-c`),key:`code_block`,...e.dictionary.slash_menu.code_block}),rQ(e,`divider`)&&t.push({onItemClick:()=>{oQ(e,{type:`divider`})},key:`divider`,...e.dictionary.slash_menu.divider}),rQ(e,`table`)&&t.push({onItemClick:()=>{oQ(e,{type:`table`,content:{type:`tableContent`,rows:[{cells:[``,``,``]},{cells:[``,``,``]}]}})},badge:void 0,key:`table`,...e.dictionary.slash_menu.table}),rQ(e,`image`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=oQ(e,{type:`image`});(t=e.getExtension(xQ))==null||t.showMenu(n.id)},key:`image`,...e.dictionary.slash_menu.image}),rQ(e,`video`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=oQ(e,{type:`video`});(t=e.getExtension(xQ))==null||t.showMenu(n.id)},key:`video`,...e.dictionary.slash_menu.video}),rQ(e,`audio`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=oQ(e,{type:`audio`});(t=e.getExtension(xQ))==null||t.showMenu(n.id)},key:`audio`,...e.dictionary.slash_menu.audio}),rQ(e,`file`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=oQ(e,{type:`file`});(t=e.getExtension(xQ))==null||t.showMenu(n.id)},key:`file`,...e.dictionary.slash_menu.file}),rQ(e,`heading`,{level:`number`,isToggleable:`boolean`})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e<=3).forEach(n=>{t.push({onItemClick:()=>{oQ(e,{type:`heading`,props:{level:n,isToggleable:!0}})},key:n===1?`toggle_heading`:`toggle_heading_${n}`,...e.dictionary.slash_menu[n===1?`toggle_heading`:`toggle_heading_${n}`]})}),rQ(e,`heading`,{level:`number`})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e>3).forEach(n=>{t.push({onItemClick:()=>{oQ(e,{type:`heading`,props:{level:n}})},badge:PZ(`Mod-Alt-${n}`),key:`heading_${n}`,...e.dictionary.slash_menu[`heading_${n}`]})}),t.push({onItemClick:()=>{var t;(t=e.getExtension(I$))==null||t.openSuggestionMenu(`:`,{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:`emoji`,...e.dictionary.slash_menu.emoji}),t}function o_e(e,t){return e.filter(({title:e,aliases:n})=>e.toLowerCase().includes(t.toLowerCase())||n&&n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).length!==0)}var sQ,cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$=o((()=>{cZ(),sY(),pM(),RP(),Xj(),KW(),lG(),_X(),jge(),Mge(),Nge(),Pge(),Fge(),JG(),Lge(),Bge(),hj(),qG(),YG(),sQ=Object.defineProperty,cQ=(e,t,n)=>t in e?sQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lQ=(e,t,n)=>cQ(e,typeof t==`symbol`?t:t+``,n),uQ=()=>typeof navigator<`u`&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)),dQ=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),fQ=(e,t)=>{let n=mX(e,t.pmSchema);n.type.name===`blockContainer`&&(n=n.firstChild);let r=t.pmSchema.nodes[n.type.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=r(n);if(typeof i!=`object`||!(`dom`in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return i},pQ=(e,t)=>({tr:n,dispatch:r})=>(r&&YZ(n,e,t),!0),mQ={gray:{text:`#9b9a97`,background:`#ebeced`},brown:{text:`#64473a`,background:`#e9e5e3`},red:{text:`#e03e3e`,background:`#fbe4e4`},orange:{text:`#d9730d`,background:`#f6e9d9`},yellow:{text:`#dfab01`,background:`#fbf3db`},green:{text:`#4d6461`,background:`#ddedea`},blue:{text:`#0b6e99`,background:`#ddebf1`},purple:{text:`#6940a5`,background:`#eae4f2`},pink:{text:`#ad1a72`,background:`#f4dfeb`}},hQ={backgroundColor:{default:`default`},textColor:{default:`default`},textAlignment:{default:`left`,values:[`left`,`center`,`right`,`justify`]}},gQ=e=>{let t={};return e.hasAttribute(`data-background-color`)?t.backgroundColor=e.getAttribute(`data-background-color`):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute(`data-text-color`)?t.textColor=e.getAttribute(`data-text-color`):e.style.color&&(t.textColor=e.style.color),t.textAlignment=hQ.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},_Q=(e,t)=>{e.backgroundColor&&e.backgroundColor!==hQ.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in mQ?mQ[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==hQ.textColor.default&&(t.style.color=e.textColor in mQ?mQ[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==hQ.textAlignment.default&&(t.style.textAlign=e.textAlignment)},vQ=(e=`backgroundColor`)=>({default:hQ.backgroundColor.default,parseHTML:e=>e.hasAttribute(`data-background-color`)?e.getAttribute(`data-background-color`):e.style.backgroundColor?e.style.backgroundColor:hQ.backgroundColor.default,renderHTML:t=>t[e]===hQ.backgroundColor.default?{}:{"data-background-color":t[e]}}),yQ=(e=`textColor`)=>({default:hQ.textColor.default,parseHTML:e=>e.hasAttribute(`data-text-color`)?e.getAttribute(`data-text-color`):e.style.color?e.style.color:hQ.textColor.default,renderHTML:t=>t[e]===hQ.textColor.default?{}:{"data-text-color":t[e]}}),bQ=(e,t)=>{let n=e.querySelector(t);return n?{targetElement:n,caption:e.querySelector(`figcaption`)?.textContent??void 0}:void 0},xQ=oG(({editor:e})=>{let t=sG(void 0);function n(){t.setState(void 0)}return{key:`filePanel`,store:t,mount({signal:t}){let r=e.onChange(n,!1),i=e.onSelectionChange(n,!1);t.addEventListener(`abort`,()=>{r(),i()})},closeMenu:n,showMenu(e){t.setState(e)}}}),SQ=(e,t,n)=>{let r=document.createElement(`div`);r.className=`bn-add-file-button`;let i=document.createElement(`div`);i.className=`bn-add-file-button-icon`,n?i.appendChild(n):i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,r.appendChild(i);let a=document.createElement(`p`);a.className=`bn-add-file-button-text`,a.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,r.appendChild(a);let o=e=>{e.preventDefault(),e.stopPropagation()},s=()=>{var n;t.isEditable&&((n=t.getExtension(xQ))==null||n.showMenu(e.id))};return r.addEventListener(`mousedown`,o,!0),r.addEventListener(`click`,s,!0),{dom:r,destroy:()=>{r.removeEventListener(`mousedown`,o,!0),r.removeEventListener(`click`,s,!0)}}},CQ=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,wQ=e=>{let t=document.createElement(`div`);t.className=`bn-file-name-with-icon`;let n=document.createElement(`div`);n.className=`bn-file-icon`,n.innerHTML=CQ,t.appendChild(n);let r=document.createElement(`p`);return r.className=`bn-file-name`,r.textContent=e.props.name,t.appendChild(r),{dom:t}},TQ=(e,t,n,r)=>{let i=document.createElement(`div`);if(i.className=`bn-file-block-content-wrapper`,e.props.url===``){let n=SQ(e,t,r);i.appendChild(n.dom);let a=t.onUploadStart(t=>{if(t===e.id){i.removeChild(n.dom);let e=document.createElement(`div`);e.className=`bn-file-loading-preview`,e.textContent=`Loading...`,i.appendChild(e)}});return{dom:i,destroy:()=>{a(),n.destroy()}}}let a={dom:i};if(e.props.showPreview===!1||!n){let t=wQ(e);i.appendChild(t.dom),a.destroy=()=>{var e;(e=t.destroy)==null||e.call(t)}}else i.appendChild(n.dom);if(e.props.caption){let t=document.createElement(`p`);t.className=`bn-file-caption`,t.textContent=e.props.caption,i.appendChild(t)}return a},EQ=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},DQ=(e,t)=>{let n=document.createElement(`div`),r=document.createElement(`p`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},OQ=e=>({url:e.src||void 0}),kQ=e=>({type:`audio`,propSchema:{backgroundColor:hQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0}},content:`none`}),AQ=(e={})=>e=>{if(e.tagName===`AUDIO`){if(e.closest(`figure`))return;let{backgroundColor:t}=gQ(e);return{...OQ(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=bQ(e,`audio`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=gQ(e);return{...OQ(n),backgroundColor:i,caption:r}}},jQ=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>`;let i=document.createElement(`audio`);return i.className=`bn-audio`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.controls=!0,i.contentEditable=`false`,i.draggable=!1,TQ(t,n,{dom:i},r.firstElementChild)},MQ=(e={})=>(e,t)=>{if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add audio`,{dom:e}}let n;return e.props.showPreview?(n=document.createElement(`audio`),n.src=e.props.url):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?EQ(n,e.props.caption):DQ(n,e.props.caption):{dom:n}},NQ=BZ(kQ,e=>({meta:{fileBlockAccept:[`audio/*`]},parse:AQ(e),render:jQ(e),toExternalHTML:MQ(e),runsBefore:[`file`]})),PQ=Symbol.for(`blocknote.shikiParser`),FQ=Symbol.for(`blocknote.shikiHighlighterPromise`),IQ=({defaultLanguage:e=`text`})=>({type:`codeBlock`,propSchema:{language:{default:e}},content:`inline`}),LQ=BZ(IQ,e=>({meta:{code:!0,defining:!0,isolating:!1},parse:e=>{if(e.tagName!==`PRE`||e.childElementCount!==1||e.firstElementChild?.tagName!==`CODE`)return;let t=e.firstElementChild;return{language:t.getAttribute(`data-language`)||t.className.split(` `).find(e=>e.includes(`language-`))?.replace(`language-`,``)}},parseContent:({el:e,schema:t})=>{let n=aj.fromSchema(t),r=e.firstElementChild;return n.parse(r,{preserveWhitespace:`full`,topNode:t.nodes.codeBlock.create()}).content},render(t,n){let r=document.createDocumentFragment(),i=document.createElement(`pre`),a=document.createElement(`code`);i.appendChild(a);let o;if(e.supportedLanguages){let i=document.createElement(`select`);if(Object.entries(e.supportedLanguages??{}).forEach(([e,{name:t}])=>{let n=document.createElement(`option`);n.value=e,n.text=t,i.appendChild(n)}),i.value=t.props.language||e.defaultLanguage||`text`,n.isEditable){let e=e=>{let r=e.target.value;n.updateBlock(t.id,{props:{language:r}})};i.addEventListener(`change`,e),o=()=>i.removeEventListener(`change`,e)}else i.disabled=!0;let a=document.createElement(`div`);a.contentEditable=`false`,a.appendChild(i),r.appendChild(a)}return r.appendChild(i),{dom:r,contentDOM:a,destroy:()=>{o?.()}}},toExternalHTML(e){let t=document.createElement(`pre`),n=document.createElement(`code`);return n.className=`language-${e.props.language}`,n.dataset.language=e.props.language,t.appendChild(n),{dom:t,contentDOM:n}}}),e=>[oG({key:`code-block-highlighter`,prosemirrorPlugins:[t_e(e)]}),oG({key:`code-block-keyboard-shortcuts`,keyboardShortcuts:{Delete:({editor:e})=>e.transact(t=>{let{block:n}=e.getTextCursorPosition();if(n.type!==`codeBlock`)return!1;let{$from:r}=t.selection;return r.parent.textContent?!1:(e.removeBlocks([n]),!0)}),Tab:({editor:t})=>e.indentLineWithTab===!1?!1:t.transact(e=>{let{block:n}=t.getTextCursorPosition();return n.type===`codeBlock`?(e.insertText(` `),!0):!1}),Enter:({editor:e})=>e.transact(t=>{let{block:n,nextBlock:r}=e.getTextCursorPosition();if(n.type!==`codeBlock`)return!1;let{$from:i}=t.selection,a=i.parentOffset===i.parent.nodeSize-2,o=i.parent.textContent.endsWith(`
|
|
126
|
+
|
|
127
|
+
`);if(a&&o){if(t.delete(i.pos-2,i.pos),r)return e.setTextCursorPosition(r,`start`),!0;let[a]=e.insertBlocks([{type:`paragraph`}],n,`after`);return e.setTextCursorPosition(a,`start`),!0}return t.insertText(`
|
|
128
|
+
`),!0}),"Shift-Enter":({editor:e})=>e.transact(()=>{let{block:t}=e.getTextCursorPosition();if(t.type!==`codeBlock`)return!1;let[n]=e.insertBlocks([{type:`paragraph`}],t,`after`);return e.setTextCursorPosition(n,`start`),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{let n=t[1].trim();return{type:`codeBlock`,props:{language:{language:ZZ(e,n)??n}.language},content:[]}}}]})]),RQ=()=>({type:`divider`,propSchema:{},content:`none`}),zQ=BZ(RQ,{meta:{isolating:!1},parse(e){if(e.tagName===`HR`)return{}},render(){return{dom:document.createElement(`hr`)}}},[oG({key:`divider-block-shortcuts`,inputRules:[{find:RegExp(`^---$`),replace(){return{type:`divider`,props:{},content:[]}}}]})]),BQ=e=>({url:e.src||void 0}),VQ=()=>({type:`file`,propSchema:{backgroundColor:hQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``}},content:`none`}),HQ=()=>e=>{if(e.tagName===`EMBED`){if(e.closest(`figure`))return;let{backgroundColor:t}=gQ(e);return{...BQ(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=bQ(e,`embed`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=gQ(e);return{...BQ(n),backgroundColor:i,caption:r}}},UQ=BZ(VQ,{meta:{fileBlockAccept:[`*/*`]},parse:HQ(),render(e,t){return TQ(e,t)},toExternalHTML(e){if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add file`,{dom:e}}let t=document.createElement(`a`);return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?DQ(t,e.props.caption):{dom:t}}}),WQ={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?`true`:`false`),get:e=>window.localStorage.getItem(`toggle-${e.id}`)===`true`},GQ=(e,t,n,r=WQ)=>{if(`isToggleable`in e.props&&!e.props.isToggleable)return{dom:n};let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`bn-toggle-wrapper`;let o=document.createElement(`button`);o.className=`bn-toggle-button`,o.type=`button`,o.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>`;let s=e=>e.preventDefault();o.addEventListener(`mousedown`,s);let c=()=>{a.getAttribute(`data-show-children`)===`true`?(a.setAttribute(`data-show-children`,`false`),r.set(t.getBlock(e),!1),i.contains(l)&&i.removeChild(l)):(a.setAttribute(`data-show-children`,`true`),r.set(t.getBlock(e),!0),t.isEditable&&t.getBlock(e)?.children.length===0&&!i.contains(l)&&i.appendChild(l))};o.addEventListener(`click`,c),a.appendChild(o),a.appendChild(n);let l=document.createElement(`button`);l.className=`bn-toggle-add-block-button`,l.type=`button`,l.textContent=t.dictionary.toggle_blocks.add_block_button;let u=e=>e.preventDefault();l.addEventListener(`mousedown`,u);let d=()=>{t.transact(()=>{let n=t.updateBlock(e,{children:[{}]});t.setTextCursorPosition(n.children[0].id,`end`),t.focus()})};l.addEventListener(`click`,d),i.appendChild(a);let f=e.children.length,p=t.onChange(()=>{let n=t.getBlock(e)?.children.length??0;n>f?(a.getAttribute(`data-show-children`)===`false`&&(a.setAttribute(`data-show-children`,`true`),r.set(t.getBlock(e),!0)),i.contains(l)&&i.removeChild(l)):n===0&&n<f&&(a.getAttribute(`data-show-children`)===`true`&&(a.setAttribute(`data-show-children`,`false`),r.set(t.getBlock(e),!1)),i.contains(l)&&i.removeChild(l)),f=n});return r.get(e)?(a.setAttribute(`data-show-children`,`true`),t.isEditable&&e.children.length===0&&i.appendChild(l)):a.setAttribute(`data-show-children`,`false`),{dom:i,ignoreMutation:e=>e instanceof MutationRecord&&(e.type===`attributes`&&e.target===a&&e.attributeName===`data-show-children`||e.type===`childList`&&(e.addedNodes[0]===l||e.removedNodes[0]===l)),destroy:()=>{o.removeEventListener(`mousedown`,s),o.removeEventListener(`click`,c),l.removeEventListener(`mousedown`,u),l.removeEventListener(`click`,d),p?.()}}},KQ=[1,2,3,4,5,6],qQ=e=>({editor:t})=>{let n=t.getTextCursorPosition();return t.schema.blockSchema[n.block.type].content===`inline`?(t.updateBlock(n.block,{type:`heading`,props:{level:e}}),!0):!1},JQ=({defaultLevel:e=1,levels:t=KQ,allowToggleHeadings:n=!0}={})=>({type:`heading`,propSchema:{...hQ,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:`inline`}),YQ=BZ(JQ,({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1},parse(t){if(e&&t.tagName===`DETAILS`){let e=t.querySelector(`:scope > summary`);if(!e)return;let n=e.querySelector(`h1, h2, h3, h4, h5, h6`);return n?{...gQ(n),level:parseInt(n.tagName[1]),isToggleable:!0}:void 0}let n;switch(t.tagName){case`H1`:n=1;break;case`H2`:n=2;break;case`H3`:n=3;break;case`H4`:n=4;break;case`H5`:n=5;break;case`H6`:n=6;break;default:return}return{...gQ(t),level:n}},...e?{parseContent:({el:e,schema:t})=>{if(e.tagName===`DETAILS`)return QZ(e,t,`heading`)}}:{},runsBefore:[`toggleListItem`],render(t,n){let r=document.createElement(`h${t.props.level}`);return e?{...GQ(t,n,r),contentDOM:r}:{dom:r,contentDOM:r}},toExternalHTML(t){let n=document.createElement(`h${t.props.level}`);if(_Q(t.props,n),e&&t.props.isToggleable){let e=document.createElement(`details`);e.setAttribute(`open`,``);let t=document.createElement(`summary`);return t.appendChild(n),e.appendChild(t),{dom:e,contentDOM:n,childrenDOM:e}}return{dom:n,contentDOM:n}}}),({levels:e=KQ}={})=>[oG({key:`heading-shortcuts`,keyboardShortcuts:Object.fromEntries(e.map(e=>[`Mod-Alt-${e}`,qQ(e)])??[]),inputRules:e.map(e=>({find:RegExp(`^(#{${e}})\\s$`),replace({match:e}){return{type:`heading`,props:{level:e[1].length}}}}))})]),XQ=(e,t,n,r,i)=>{let{dom:a,destroy:o}=TQ(e,t,n,i),s=a;s.style.position=`relative`,e.props.url&&e.props.showPreview&&(e.props.previewWidth?s.style.width=`${e.props.previewWidth}px`:s.style.width=`fit-content`);let c=document.createElement(`div`);c.className=`bn-resize-handle`,c.style.left=`4px`;let l=document.createElement(`div`);l.className=`bn-resize-handle`,l.style.right=`4px`;let u=document.createElement(`div`);u.style.position=`absolute`,u.style.height=`100%`,u.style.width=`100%`;let d,f=e.props.previewWidth,p=n=>{if(!d){!t.isEditable&&r.contains(c)&&r.contains(l)&&(r.removeChild(c),r.removeChild(l));return}let i,a=`touches`in n?n.touches[0].clientX:n.clientX;i=e.props.textAlignment===`center`?d.handleUsed===`left`?d.initialWidth+(d.initialClientX-a)*2:d.initialWidth+(a-d.initialClientX)*2:d.handleUsed===`left`?d.initialWidth+d.initialClientX-a:d.initialWidth+a-d.initialClientX,f=Math.min(Math.max(i,64),t.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE),s.style.width=`${f}px`},m=n=>{(!n.target||!s.contains(n.target)||!t.isEditable)&&r.contains(c)&&r.contains(l)&&(r.removeChild(c),r.removeChild(l)),d&&(d=void 0,s.contains(u)&&s.removeChild(u),t.updateBlock(e,{props:{previewWidth:f}}))},h=()=>{t.isEditable&&(r.appendChild(c),r.appendChild(l))},g=e=>{e.relatedTarget===c||e.relatedTarget===l||d||t.isEditable&&r.contains(c)&&r.contains(l)&&(r.removeChild(c),r.removeChild(l))},_=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`left`,initialWidth:s.clientWidth,initialClientX:t}},v=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`right`,initialWidth:s.clientWidth,initialClientX:t}};return window.addEventListener(`mousemove`,p),window.addEventListener(`touchmove`,p),window.addEventListener(`mouseup`,m),window.addEventListener(`touchend`,m),s.addEventListener(`mouseenter`,h),s.addEventListener(`mouseleave`,g),c.addEventListener(`mousedown`,_),c.addEventListener(`touchstart`,_),l.addEventListener(`mousedown`,v),l.addEventListener(`touchstart`,v),{dom:s,destroy:()=>{o?.(),window.removeEventListener(`mousemove`,p),window.removeEventListener(`touchmove`,p),window.removeEventListener(`mouseup`,m),window.removeEventListener(`touchend`,m),s.removeEventListener(`mouseenter`,h),s.removeEventListener(`mouseleave`,g),c.removeEventListener(`mousedown`,_),c.removeEventListener(`touchstart`,_),l.removeEventListener(`mousedown`,v),l.removeEventListener(`touchstart`,v)}}},ZQ=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.alt||void 0}),QQ=(e={})=>({type:`image`,propSchema:{textAlignment:hQ.textAlignment,backgroundColor:hQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`}),$Q=(e={})=>e=>{if(e.tagName===`IMG`){if(e.closest(`figure`))return;let{backgroundColor:t}=gQ(e);return{...ZQ(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=bQ(e,`img`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=gQ(e);return{...ZQ(n),backgroundColor:i,caption:r}}},e$=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`img`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.alt=t.props.name||t.props.caption||`BlockNote image`,a.contentEditable=`false`,a.draggable=!1,i.appendChild(a),XQ(t,n,{dom:i},i,r.firstElementChild)},t$=(e={})=>(e,t)=>{if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add image`,{dom:e}}let n;return e.props.showPreview?(n=document.createElement(`img`),n.src=e.props.url,n.alt=e.props.name||e.props.caption||`BlockNote image`,e.props.previewWidth&&(n.width=e.props.previewWidth)):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?EQ(n,e.props.caption):DQ(n,e.props.caption):{dom:n}},n$=BZ(QQ,e=>({meta:{fileBlockAccept:[`image/*`]},parse:$Q(e),render:e$(e),toExternalHTML:t$(e),runsBefore:[`file`]})),r$=(e,t,n)=>({state:r,dispatch:i})=>i?i$(r.tr,e,t,n):!0,i$=(e,t,n,r)=>{let i=RY(IY(e.doc,t));if(!i.isBlockContainer)return!1;let a=HY(e),o=[{type:i.bnBlock.node.type,attrs:r?{...i.bnBlock.node.attrs,id:void 0}:{}},{type:n?i.blockContent.node.type:a.nodes.paragraph,attrs:r?{...i.blockContent.node.attrs}:{}}];return e.split(t,2,o),!0},a$=(e,t)=>{let{blockInfo:n,selectionEmpty:r}=e.transact(e=>({blockInfo:VY(e),selectionEmpty:e.selection.anchor===e.selection.head}));if(!n.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=n;return a.node.type.name!==t||!r?!1:a.node.childCount===0?(e.transact(e=>{YZ(e,i.beforePos,{type:`paragraph`,props:{}})}),!0):a.node.childCount>0?e.transact(e=>(e.deleteSelection(),i$(e,e.selection.from,!0))):!1},o$=()=>({type:`bulletListItem`,propSchema:{...hQ},content:`inline`}),s$=BZ(o$,{meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`))return gQ(e)},parseContent:({el:e,schema:t})=>$Z(e,t,`bulletListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return _Q(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[oG({key:`bullet-list-item-shortcuts`,keyboardShortcuts:{Enter:({editor:e})=>a$(e,`bulletListItem`),"Mod-Shift-8":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`bulletListItem`,props:{}}),!0):!1}},inputRules:[{find:/^\s?[-+*]\s$/,replace({editor:e}){if(BY(e.prosemirrorState).blockNoteType!==`heading`)return{type:`bulletListItem`,props:{}}}}]})]),c$=()=>({type:`checkListItem`,propSchema:{...hQ,checked:{default:!1,type:`boolean`}},content:`inline`}),l$=BZ(c$,{meta:{isolating:!1},parse(e){if(e.tagName===`input`)return e.closest(`[data-content-type]`)||e.closest(`li`)?void 0:e.type===`checkbox`?{checked:e.checked}:void 0;if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)){let t=e.querySelector(`input[type=checkbox]`)||null;return t===null?void 0:{...gQ(e),checked:t.checked}}},parseContent:({el:e,schema:t})=>$Z(e,t,`checkListItem`),render(e,t){let n=document.createDocumentFragment(),r=document.createElement(`input`);r.type=`checkbox`,r.checked=e.props.checked,e.props.checked&&r.setAttribute(`checked`,``),r.disabled=!t.isEditable,r.addEventListener(`change`,()=>{t.isEditable&&t.updateBlock(e,{props:{checked:!e.props.checked}})});let i=document.createElement(`p`),a=document.createElement(`div`);return a.contentEditable=`false`,a.appendChild(r),n.appendChild(a),n.appendChild(i),{dom:n,contentDOM:i}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`input`);n.type=`checkbox`,n.checked=e.props.checked,e.props.checked&&n.setAttribute(`checked`,``);let r=document.createElement(`p`);return _Q(e.props,t),t.appendChild(n),t.appendChild(r),{dom:t,contentDOM:r}},runsBefore:[`bulletListItem`]},[oG({key:`check-list-item-shortcuts`,keyboardShortcuts:{Enter:({editor:e})=>a$(e,`checkListItem`),"Mod-Shift-9":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`checkListItem`,props:{}}),!0):!1}},inputRules:[{find:/^\s?\[\s*\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!1}}}},{find:/^\s?\[[Xx]\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!0}}}}]})]),u$=()=>new uM({key:new fM(`numbered-list-indexing-decorations`),state:{init(e,t){return tQ(t.tr,{decorations:DP.empty})},apply(e,t){return!e.docChanged&&!e.selectionSet&&t.decorations?t:tQ(e,t)}},props:{decorations(e){return this.getState(e)?.decorations??DP.empty}}}),d$=()=>({type:`numberedListItem`,propSchema:{...hQ,start:{default:void 0,type:`number`}},content:`inline`}),f$=BZ(d$,{meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`OL`||t.tagName===`DIV`&&t.parentElement?.tagName===`OL`)){let n=parseInt(t.getAttribute(`start`)||`1`),r=gQ(e);return e.previousElementSibling||n===1?r:{...r,start:n}}},parseContent:({el:e,schema:t})=>$Z(e,t,`numberedListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return _Q(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[oG({key:`numbered-list-item-shortcuts`,inputRules:[{find:/^\s?(\d+)\.\s$/,replace({match:e,editor:t}){if(BY(t.prosemirrorState).blockNoteType===`heading`)return;let n=parseInt(e[1]);return{type:`numberedListItem`,props:{start:n===1?void 0:n}}}}],keyboardShortcuts:{Enter:({editor:e})=>a$(e,`numberedListItem`),"Mod-Shift-7":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`numberedListItem`,props:{}}),!0):!1}},prosemirrorPlugins:[u$()]})]),p$=()=>({type:`toggleListItem`,propSchema:{...hQ},content:`inline`}),m$=BZ(p$,{meta:{isolating:!1},parse(e){if(e.tagName===`DETAILS`)return gQ(e);if(e.tagName===`LI`){let t=e.parentElement;if(t&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)&&e.querySelector(`:scope > details`))return gQ(e)}},parseContent:({el:e,schema:t})=>{let n=e.tagName===`DETAILS`?e:e.querySelector(`:scope > details`);if(!n)throw Error(`No details found in toggleListItem parseContent`);return QZ(n,t,`toggleListItem`)},runsBefore:[`bulletListItem`],render(e,t){let n=document.createElement(`p`);return{...GQ(e,t,n),contentDOM:n}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`details`);n.setAttribute(`open`,``);let r=document.createElement(`summary`),i=document.createElement(`p`);return r.appendChild(i),n.appendChild(r),_Q(e.props,t),t.appendChild(n),{dom:t,contentDOM:i,childrenDOM:n}}},[oG({key:`toggle-list-item-shortcuts`,keyboardShortcuts:{Enter:({editor:e})=>a$(e,`toggleListItem`),"Mod-Shift-6":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`toggleListItem`,props:{}}),!0):!1}}})]),h$=()=>({type:`paragraph`,propSchema:hQ,content:`inline`}),g$=BZ(h$,{meta:{isolating:!1},parse:e=>{var t;if(e.tagName===`P`&&(t=e.textContent)!=null&&t.trim())return gQ(e)},render:()=>{let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`p`);return _Q(e.props,t),{dom:t,contentDOM:t}},runsBefore:[`default`,`heading`]},[oG({key:`paragraph-shortcuts`,keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`paragraph`,props:{}}),!0):!1}}})]),_$=()=>({type:`quote`,propSchema:{backgroundColor:hQ.backgroundColor,textColor:hQ.textColor},content:`inline`}),v$=BZ(_$,{meta:{isolating:!1},parse(e){if(e.tagName===`BLOCKQUOTE`){let{backgroundColor:t,textColor:n}=gQ(e);return{backgroundColor:t,textColor:n}}},render(){let e=document.createElement(`blockquote`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`blockquote`);return _Q(e.props,t),{dom:t,contentDOM:t}}},[oG({key:`quote-block-shortcuts`,keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`quote`,props:{}}),!0):!1}},inputRules:[{find:RegExp(`^>\\s$`),replace(){return{type:`quote`,props:{}}}}]})]),y$=35,b$=WJ.create({name:`BlockNoteTableExtension`,addProseMirrorPlugins:()=>[yge({cellMinWidth:y$,defaultCellMinWidth:120,View:null}),Oge()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name===`tableParagraph`?(this.editor.commands.insertContent({type:`hardBreak`}),!0):!1,Backspace:()=>{let e=this.editor.state.selection,t=e.empty,n=e.$head.parentOffset===0,r=e.$head.node().type.name===`tableParagraph`;return t&&n&&r},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>PX(1)(e,t,n)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>PX(-1)(e,t,n))}},extendNodeSchema(e){return{tableRole:zK(FK(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),x$={textColor:hQ.textColor},S$=oY.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getContent:(e,t)=>nQ(e,t)}]},renderHTML({HTMLAttributes:e}){return[`th`,UK(this.options.HTMLAttributes,e),0]}}),C$=oY.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getContent:(e,t)=>nQ(e,t)}]},renderHTML({HTMLAttributes:e}){return[`td`,UK(this.options.HTMLAttributes,e),0]}}),w$=oY.create({name:`table`,content:`tableRow+`,group:`blockContent`,tableRole:`table`,marks:`deletion insertion modification`,isolating:!0,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){var n;let r=Vge(this.name,`table`,{...this.options.domAttributes?.blockContent||{},...t},this.options.domAttributes?.inlineContent||{}),i=document.createElement(`colgroup`);for(let t of e.children[0].children)if(t.attrs.colwidth)for(let e of t.attrs.colwidth){let t=document.createElement(`col`);e&&(t.style=`width: ${e}px`),i.appendChild(t)}else i.appendChild(document.createElement(`col`));return(n=r.dom.firstChild)==null||n.appendChild(i),r},addNodeView(){return({node:e,HTMLAttributes:t})=>{class n extends aZ{constructor(e,t,n){super(e,t),this.node=e,this.cellMinWidth=t,this.blockContentHTMLAttributes=n;let r=document.createElement(`div`);r.className=FZ(`bn-block-content`,n.class),r.setAttribute(`data-content-type`,`table`);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);let i=this.dom,a=document.createElement(`div`);a.className=`tableWrapper-inner`,a.appendChild(i.firstChild),i.appendChild(a),r.appendChild(i);let o=document.createElement(`div`);o.className=`table-widgets-container`,o.style.position=`relative`,i.appendChild(o),this.dom=r}ignoreMutation(e){return!e.target.closest(`.tableWrapper-inner`)||super.ignoreMutation(e)}}return new n(e,120,{...this.options.domAttributes?.blockContent||{},...t})}}}),T$=oY.create({name:`tableParagraph`,group:`tableContent`,content:`inline*`,parseHTML(){return[{tag:`p`,getAttrs:e=>{if(typeof e==`string`||!e.textContent||!e.closest(`[data-content-type]`))return!1;let t=e.parentElement;return t===null?!1:t.tagName===`TD`||t.tagName===`TH`?{}:!1},node:`tableParagraph`}]},renderHTML({HTMLAttributes:e}){return[`p`,e,0]}}),E$=oY.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)+`,tableRole:`row`,marks:`deletion insertion modification`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,UK(this.options.HTMLAttributes,e),0]}}),D$=()=>Gge({node:w$,type:`table`,content:`table`},x$,[oG({key:`table-extensions`,tiptapExtensions:[b$,T$,S$,C$,E$]}),oG({key:`table-keyboard-delete`,keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof tZ))return!1;let t=e.getTextCursorPosition().block,n=t.content,r=0;for(let e of n.rows)for(let t of e.cells){if(`type`in t&&t.content.length>0||!(`type`in t)&&t.length>0)return!1;r++}let i=0;return e.prosemirrorState.selection.forEachCell(()=>{i++}),i<r?!1:(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})]),O$=e=>({url:e.src||void 0,previewWidth:e.width||void 0}),k$=e=>({type:`video`,propSchema:{textAlignment:hQ.textAlignment,backgroundColor:hQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`}),A$=e=>e=>{if(e.tagName===`VIDEO`){if(e.closest(`figure`))return;let{backgroundColor:t}=gQ(e);return{...O$(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=bQ(e,`video`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=gQ(e);return{...O$(n),backgroundColor:i,caption:r}}},j$=BZ(k$,e=>({meta:{fileBlockAccept:[`video/*`]},parse:A$(),render(t,n){let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`video`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.controls=!0,a.contentEditable=`false`,a.draggable=!1,a.width=t.props.previewWidth,i.appendChild(a),XQ(t,n,{dom:i},i,r.firstElementChild)},toExternalHTML(e){if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add video`,{dom:e}}let t;return e.props.showPreview?(t=document.createElement(`video`),t.src=e.props.url,e.props.previewWidth&&(t.width=e.props.previewWidth)):(t=document.createElement(`a`),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?EQ(t,e.props.caption):DQ(t,e.props.caption):{dom:t}},runsBefore:[`file`]})),M$=new Map,N$=PK(e=>e.type.name===`blockContainer`),P$=class{constructor(e,t,n){lQ(this,`state`),lQ(this,`emitUpdate`),lQ(this,`rootEl`),lQ(this,`pluginState`),lQ(this,`handleScroll`,()=>{var e;if((e=this.state)!=null&&e.show){let e=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!e)return;this.state.referencePos=e.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter)}}),lQ(this,`closeMenu`,()=>{this.editor.transact(e=>e.setMeta(F$,null))}),lQ(this,`clearQuery`,()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(e=>e.selection.from)}).run()});var r;this.editor=e,this.pluginState=void 0,this.emitUpdate=e=>{if(!this.state)throw Error(`Attempting to update uninitialized suggestions menu`);t(e,{...this.state,ignoreQueryLength:this.pluginState?.ignoreQueryLength})},this.rootEl=n.root,(r=this.rootEl)==null||r.addEventListener(`scroll`,this.handleScroll,!0)}update(e,t){let n=F$.getState(t),r=F$.getState(e.state),i=n===void 0&&r!==void 0,a=n!==void 0&&r===void 0;if(!i&&!(n!==void 0&&r!==void 0)&&!a)return;if(this.pluginState=a?n:r,a||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}let o=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&o&&(this.state={show:!0,referencePos:o.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var e;(e=this.rootEl)==null||e.removeEventListener(`scroll`,this.handleScroll,!0)}},F$=new fM(`SuggestionMenuPlugin`),I$=oG(({editor:e})=>{let t=new Map,n,r=sG(void 0);return{key:`suggestionMenu`,store:r,addSuggestionMenu:e=>{t.set(e.triggerCharacter,e)},removeSuggestionMenu:e=>{t.delete(e)},closeMenu:()=>{n?.closeMenu()},clearQuery:()=>{n?.clearQuery()},shown:()=>n?.state?.show||!1,openSuggestionMenu:(t,n)=>{e.headless||(e.focus(),e.transact(e=>{n!=null&&n.deleteTriggerCharacter&&e.insertText(t),e.scrollIntoView().setMeta(F$,{triggerCharacter:t,deleteTriggerCharacter:n?.deleteTriggerCharacter||!1,ignoreQueryLength:n?.ignoreQueryLength||!1})}))},prosemirrorPlugins:[new uM({key:F$,view:t=>(n=new P$(e,(e,t)=>{r.setState({...t,triggerCharacter:e})},t),n),state:{init(){},apply:(t,r,i,a)=>{if(t.selection.$from.parent.type.spec.code)return r;let o=t.getMeta(F$);if(typeof o==`object`&&o){r&&n?.closeMenu();let t=r_e(e,a.selection.from-o.triggerCharacter.length);return{triggerCharacter:o.triggerCharacter,deleteTriggerCharacter:o.deleteTriggerCharacter!==!1,queryStartPos:()=>t()+o.triggerCharacter.length,query:``,decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:o?.ignoreQueryLength}}if(r===void 0)return r;if(a.selection.from!==a.selection.to||o===null||t.getMeta(`focus`)||t.getMeta(`blur`)||t.getMeta(`pointer`)||r.triggerCharacter!==void 0&&a.selection.from<r.queryStartPos()||!a.selection.$from.sameParent(a.doc.resolve(r.queryStartPos())))return;let s={...r};return s.query=a.doc.textBetween(r.queryStartPos(),a.selection.from),s}},props:{handleTextInput(e,n,r,i){if(n===r){let r=e.state.doc;for(let[a,o]of t){let t=a.length>1?r.textBetween(n-a.length,n)+i:i;if(a===t){if(o.shouldOpen&&!o.shouldOpen(e.state.tr))continue;return e.dispatch(e.state.tr.insertText(i)),e.dispatch(e.state.tr.setMeta(F$,{triggerCharacter:t}).scrollIntoView()),!0}}}return!1},decorations(e){let t=this.getState(e);if(t===void 0)return null;if(!t.deleteTriggerCharacter){let n=N$(e.selection);if(n)return DP.create(e.doc,[wP.node(n.pos,n.pos+n.node.nodeSize,{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}return DP.create(e.doc,[wP.inline(t.queryStartPos()-t.triggerCharacter.length,t.queryStartPos(),{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}}})]}}),L$={audio:NQ(),bulletListItem:s$(),checkListItem:l$(),codeBlock:LQ(),divider:zQ(),file:UQ(),heading:YQ(),image:n$(),numberedListItem:f$(),paragraph:g$(),quote:v$(),table:D$(),toggleListItem:m$(),video:j$()},R$=KZ({type:`textColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==hQ.textColor.default&&(t.style.color=e in mQ?mQ[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.color)return e.style.color}}),z$=KZ({type:`backgroundColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==hQ.backgroundColor.default&&(t.style.backgroundColor=e in mQ?mQ[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.backgroundColor)return e.style.backgroundColor}}),B$={bold:WZ(hZ,`boolean`),italic:WZ(TZ,`boolean`),underline:WZ(jZ,`boolean`),strike:WZ(kZ,`boolean`),code:WZ(yZ,`boolean`),textColor:R$,backgroundColor:z$},GZ(B$),V$={text:{config:`text`,implementation:{}},link:{config:`link`,implementation:{}}},H$=VZ(V$)})),W$,G$,K$,q$,s_e=o((()=>{W$=200,G$=function(){},G$.prototype.append=function(e){return e.length?(e=G$.from(e),!this.length&&e||e.length<W$&&this.leafAppend(e)||this.length<W$&&e.leafPrepend(this)||this.appendInner(e)):this},G$.prototype.prepend=function(e){return e.length?G$.from(e).append(this):this},G$.prototype.appendInner=function(e){return new q$(this,e)},G$.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?G$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},G$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},G$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},G$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},G$.from=function(e){return e instanceof G$?e:e&&e.length?new K$(e):G$.empty},K$=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=W$)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=W$)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(G$),G$.empty=new K$([]),q$=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(G$)}));function c_e(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}function l_e(e,t,n,r){let i=n.getMeta(a1),a;if(i)return i.historyState;n.getMeta(o1)&&(e=new t1(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(a1))return o.getMeta(a1).redo?new t1(e.done.addTransform(n,void 0,r,X$(t)),e.undone,J$(n.mapping.maps),e.prevTime,e.prevComposition):new t1(e.done,e.undone.addTransform(n,void 0,r,X$(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!u_e(n,e.prevRanges)),s=o?Y$(e.prevRanges,n.mapping):J$(n.mapping.maps);return new t1(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,X$(t)),$$.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new t1(e.done.rebased(n,a),e.undone.rebased(n,a),Y$(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new t1(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y$(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function u_e(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function J$(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Y$(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function d_e(e,t,n){let r=X$(t),i=a1.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new t1(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(a1,{redo:n,historyState:c})}function X$(e){let t=e.plugins;if(i1!=t){r1=!1,i1=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){r1=!0;break}}return r1}function f_e(e){return e.setMeta(o1,!0)}function p_e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new uM({key:a1,state:{init(){return new t1($$.empty,$$.empty,null,0,-1)},apply(t,n,r){return l_e(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?s1:n==`historyRedo`?c1:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Z$(e,t){return(n,r)=>{let i=a1.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=d_e(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1=o((()=>{s_e(),Xj(),pM(),Q$=500,$$=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new e1(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new e1(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new e1(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>n1&&(s=c_e(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Ij;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new e1(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new e1(i,o,l))}else r.push(new e1(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new e1(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Q$&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new e1(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(G$.from(i.reverse()),a)}},$$.empty=new $$(G$.empty,0),e1=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},t1=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},n1=20,r1=!1,i1=null,a1=new fM(`history`),o1=new fM(`closeHistory`),s1=Z$(!1,!0),c1=Z$(!0,!0)})),m_e=o((()=>{l1()})),u1=o((()=>{})),d1,f1=o((()=>{d1=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}},d1.prototype.normal={},d1.prototype.property={},d1.prototype.space=void 0}));function p1(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new d1(n,r,t)}var h_e=o((()=>{f1()}));function m1(e){return e.toLowerCase()}var h1=o((()=>{})),g1,_1=o((()=>{g1=class{constructor(e,t){this.attribute=t,this.property=e}},g1.prototype.attribute=``,g1.prototype.booleanish=!1,g1.prototype.boolean=!1,g1.prototype.commaOrSpaceSeparated=!1,g1.prototype.commaSeparated=!1,g1.prototype.defined=!1,g1.prototype.mustUseProperty=!1,g1.prototype.number=!1,g1.prototype.overloadedBoolean=!1,g1.prototype.property=``,g1.prototype.spaceSeparated=!1,g1.prototype.space=void 0})),v1=c({boolean:()=>x1,booleanish:()=>S1,commaOrSpaceSeparated:()=>E1,commaSeparated:()=>T1,number:()=>V,overloadedBoolean:()=>C1,spaceSeparated:()=>w1});function y1(){return 2**++b1}var b1,x1,S1,C1,V,w1,T1,E1,D1=o((()=>{b1=0,x1=y1(),S1=y1(),C1=y1(),V=y1(),w1=y1(),T1=y1(),E1=y1()}));function O1(e,t,n){n&&(e[t]=n)}var k1,A1,j1=o((()=>{_1(),D1(),k1=Object.keys(v1),A1=class extends g1{constructor(e,t,n,r){let i=-1;if(super(e,t),O1(this,`space`,r),typeof n==`number`)for(;++i<k1.length;){let e=k1[i];O1(this,k1[i],(n&v1[e])===v1[e])}}},A1.prototype.defined=!0}));function M1(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new A1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[m1(r)]=r,n[m1(a.attribute)]=r}return new d1(t,n,e.space)}var N1=o((()=>{h1(),j1(),f1()})),P1,g_e=o((()=>{N1(),D1(),P1=M1({properties:{ariaActiveDescendant:null,ariaAtomic:S1,ariaAutoComplete:null,ariaBusy:S1,ariaChecked:S1,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:w1,ariaCurrent:null,ariaDescribedBy:w1,ariaDetails:null,ariaDisabled:S1,ariaDropEffect:w1,ariaErrorMessage:null,ariaExpanded:S1,ariaFlowTo:w1,ariaGrabbed:S1,ariaHasPopup:null,ariaHidden:S1,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:w1,ariaLevel:V,ariaLive:null,ariaModal:S1,ariaMultiLine:S1,ariaMultiSelectable:S1,ariaOrientation:null,ariaOwns:w1,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:S1,ariaReadOnly:S1,ariaRelevant:null,ariaRequired:S1,ariaRoleDescription:w1,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:S1,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}})}));function F1(e,t){return t in e?e[t]:t}var I1=o((()=>{}));function L1(e,t){return F1(e,t.toLowerCase())}var R1=o((()=>{I1()})),z1,__e=o((()=>{R1(),N1(),D1(),z1=M1({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:T1,acceptCharset:w1,accessKey:w1,action:null,allow:null,allowFullScreen:x1,allowPaymentRequest:x1,allowUserMedia:x1,alt:null,as:null,async:x1,autoCapitalize:null,autoComplete:w1,autoFocus:x1,autoPlay:x1,blocking:w1,capture:null,charSet:null,checked:x1,cite:null,className:w1,cols:V,colSpan:null,content:null,contentEditable:S1,controls:x1,controlsList:w1,coords:V|T1,crossOrigin:null,data:null,dateTime:null,decoding:null,default:x1,defer:x1,dir:null,dirName:null,disabled:x1,download:C1,draggable:S1,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:x1,formTarget:null,headers:w1,height:V,hidden:C1,high:V,href:null,hrefLang:null,htmlFor:w1,httpEquiv:w1,id:null,imageSizes:null,imageSrcSet:null,inert:x1,inputMode:null,integrity:null,is:null,isMap:x1,itemId:null,itemProp:w1,itemRef:w1,itemScope:x1,itemType:w1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:x1,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:x1,muted:x1,name:null,nonce:null,noModule:x1,noValidate:x1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:x1,optimum:V,pattern:null,ping:w1,placeholder:null,playsInline:x1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:x1,referrerPolicy:null,rel:w1,required:x1,reversed:x1,rows:V,rowSpan:V,sandbox:w1,scope:null,scoped:x1,seamless:x1,selected:x1,shadowRootClonable:x1,shadowRootDelegatesFocus:x1,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:S1,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:x1,useMap:null,value:S1,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:w1,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:x1,declare:x1,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:x1,noHref:x1,noShade:x1,noWrap:x1,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:S1,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:x1,disableRemotePlayback:x1,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:L1})})),B1,v_e=o((()=>{I1(),N1(),D1(),B1=M1({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:E1,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:w1,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:x1,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:T1,g2:T1,glyphName:T1,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:E1,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:w1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:E1,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:E1,rev:E1,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:E1,requiredFeatures:E1,requiredFonts:E1,requiredFormats:E1,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:E1,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:E1,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:E1,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:F1})})),V1,y_e=o((()=>{N1(),V1=M1({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}})})),H1,b_e=o((()=>{N1(),R1(),H1=M1({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:L1})})),U1,x_e=o((()=>{N1(),U1=M1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}})}));function W1(e,t){let n=m1(t),r=t,i=g1;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&q1.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(K1,C_e);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!K1.test(e)){let n=e.replace(G1,S_e);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=A1}return new i(r,t)}function S_e(e){return`-`+e.toLowerCase()}function C_e(e){return e.charAt(1).toUpperCase()}var G1,K1,q1,w_e=o((()=>{j1(),_1(),h1(),G1=/[A-Z]/g,K1=/-[a-z]/g,q1=/^data[-\w.:]+$/i})),J1,Y1,X1=o((()=>{h_e(),g_e(),__e(),v_e(),y_e(),b_e(),x_e(),w_e(),h1(),J1=p1([P1,z1,V1,H1,U1],`html`),Y1=p1([P1,B1,V1,H1,U1],`svg`)}));function Z1(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function T_e(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Q1=o((()=>{}));function E_e(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){$1.lastIndex=i;let e=$1.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}var $1,D_e=o((()=>{$1=/[#.]/g})),O_e=o((()=>{D_e()}));function e0(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function k_e(e){return e.join(` `).trim()}var t0=o((()=>{}));function n0(e,t,n){let r=n?N_e(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=E_e(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,A_e(i))a.unshift(i);else for(let[t,n]of Object.entries(i))j_e(e,o.properties,t,n)}for(let e of a)r0(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function A_e(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function j_e(e,t,n,r){let i=W1(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?e0(r):i.commaSeparated?Z1(r):i.commaOrSpaceSeparated?e0(Z1(r).join(` `)):i0(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?M_e(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(i0(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function r0(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)r0(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?r0(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function i0(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||m1(n)===m1(t)))return!0}return n}function M_e(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function N_e(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var P_e=o((()=>{Q1(),O_e(),X1(),t0()})),a0,F_e=o((()=>{a0=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`)})),o0,s0,I_e=o((()=>{X1(),P_e(),F_e(),o0=n0(J1,`div`),s0=n0(Y1,`g`,a0)})),c0=o((()=>{I_e()}));function L_e(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=l0(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=l0(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function l0(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
129
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var R_e=o((()=>{})),z_e=o((()=>{R_e()})),u0,d0=o((()=>{u0={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`}}));function B_e(e,t){let n=t||{};return f0({file:n.file||void 0,location:!1,schema:n.space===`svg`?Y1:J1,verbose:n.verbose||!1},e)}function f0(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},m0(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:p0(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=L_e(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},m0(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},m0(e,r,n),n}default:return n=V_e(e,t),n}}function p0(e,t){let n=-1,r=[];for(;++n<t.length;){let i=f0(e,t[n]);r.push(i)}return r}function V_e(e,t){let n=e.schema;e.schema=t.namespaceURI===u0.svg?Y1:J1;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;_0.call(v0,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?s0:o0)(t.tagName,i,p0(e,t.childNodes));if(m0(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&h0(r.startTag),o=r&&r.endTag&&h0(r.endTag),s=f0(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function m0(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=H_e(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function H_e(e,t,n){let r=h0(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)_0.call(n.attrs,i)&&(r[W1(e.schema,i).property]=h0(n.attrs[i]));n.startTag;let a=h0(n.startTag),o=n.endTag?h0(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function h0(e){let t=g0({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=g0({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function g0(e){return e.line&&e.column?e:void 0}var _0,v0,U_e=o((()=>{u1(),c0(),X1(),z_e(),d0(),_0={}.hasOwnProperty,v0=Object.prototype})),W_e=o((()=>{U_e()}));function y0(e){return e>=55296&&e<=57343}function G_e(e){return e>=56320&&e<=57343}function K_e(e,t){return(e-55296)*1024+9216+t}function b0(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function x0(e){return e>=64976&&e<=65007||S0.has(e)}var S0,H,C0,w0=o((()=>{S0=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(H||={}),C0={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`}})),U,T0=o((()=>{(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(U||={})})),E0,D0,q_e=o((()=>{w0(),T0(),E0=65536,D0=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=E0,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(G_e(t))return this.pos++,this._addGap(),K_e(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(U.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;let n=this.html.charCodeAt(t);return n===H.CARRIAGE_RETURN?H.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;let e=this.html.charCodeAt(this.pos);return e===H.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,H.LINE_FEED):e===H.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,y0(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===H.LINE_FEED||e===H.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){b0(e)?this._err(U.controlCharacterInInputStream):x0(e)&&this._err(U.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}}));function O0(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var k0,A0=o((()=>{(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(k0||={})})),j0,J_e=o((()=>{j0=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0)))}));function Y_e(e){return e>=55296&&e<=57343||e>1114111?65533:M0.get(e)??e}var M0,X_e=o((()=>{M0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),String.fromCodePoint}));function N0(e){return e>=P0.ZERO&&e<=P0.NINE}function Z_e(e){return e>=P0.UPPER_A&&e<=P0.UPPER_F||e>=P0.LOWER_A&&e<=P0.LOWER_F}function Q_e(e){return e>=P0.UPPER_A&&e<=P0.UPPER_Z||e>=P0.LOWER_A&&e<=P0.LOWER_Z||N0(e)}function $_e(e){return e===P0.EQUALS||Q_e(e)}function eve(e,t,n,r){let i=(t&I0.BRANCH_LENGTH)>>7,a=t&I0.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var P0,F0,I0,L0,R0,z0,tve=o((()=>{X_e(),J_e(),(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(P0||={}),F0=32,(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(I0||={}),(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(L0||={}),(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(R0||={}),z0=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=L0.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=R0.Strict}startEntity(e){this.decodeMode=e,this.state=L0.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case L0.EntityStart:return e.charCodeAt(t)===P0.NUM?(this.state=L0.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=L0.NamedEntity,this.stateNamedEntity(e,t));case L0.NumericStart:return this.stateNumericStart(e,t);case L0.NumericDecimal:return this.stateNumericDecimal(e,t);case L0.NumericHex:return this.stateNumericHex(e,t);case L0.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|F0)===P0.LOWER_X?(this.state=L0.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=L0.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(N0(r)||Z_e(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(N0(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===P0.SEMI)this.consumed+=1;else if(this.decodeMode===R0.Strict)return 0;return this.emitCodePoint(Y_e(this.result),this.consumed),this.errors&&(e!==P0.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&I0.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=eve(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===R0.Attribute&&(i===0||$_e(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&I0.VALUE_LENGTH)>>14,i!==0){if(a===P0.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==R0.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&I0.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~I0.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case L0.NamedEntity:return this.result!==0&&(this.decodeMode!==R0.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case L0.NumericDecimal:return this.emitNumericEntity(0,2);case L0.NumericHex:return this.emitNumericEntity(0,3);case L0.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case L0.EntityStart:return 0}}}}));function B0(e){return U0.get(e)??K.UNKNOWN}var W,V0,H0,G,K,U0,q,W0,G0,K0=o((()=>{(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(W||={}),(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(V0||={}),(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(H0||={}),(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(G||={}),(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(K||={}),U0=new Map([[G.A,K.A],[G.ADDRESS,K.ADDRESS],[G.ANNOTATION_XML,K.ANNOTATION_XML],[G.APPLET,K.APPLET],[G.AREA,K.AREA],[G.ARTICLE,K.ARTICLE],[G.ASIDE,K.ASIDE],[G.B,K.B],[G.BASE,K.BASE],[G.BASEFONT,K.BASEFONT],[G.BGSOUND,K.BGSOUND],[G.BIG,K.BIG],[G.BLOCKQUOTE,K.BLOCKQUOTE],[G.BODY,K.BODY],[G.BR,K.BR],[G.BUTTON,K.BUTTON],[G.CAPTION,K.CAPTION],[G.CENTER,K.CENTER],[G.CODE,K.CODE],[G.COL,K.COL],[G.COLGROUP,K.COLGROUP],[G.DD,K.DD],[G.DESC,K.DESC],[G.DETAILS,K.DETAILS],[G.DIALOG,K.DIALOG],[G.DIR,K.DIR],[G.DIV,K.DIV],[G.DL,K.DL],[G.DT,K.DT],[G.EM,K.EM],[G.EMBED,K.EMBED],[G.FIELDSET,K.FIELDSET],[G.FIGCAPTION,K.FIGCAPTION],[G.FIGURE,K.FIGURE],[G.FONT,K.FONT],[G.FOOTER,K.FOOTER],[G.FOREIGN_OBJECT,K.FOREIGN_OBJECT],[G.FORM,K.FORM],[G.FRAME,K.FRAME],[G.FRAMESET,K.FRAMESET],[G.H1,K.H1],[G.H2,K.H2],[G.H3,K.H3],[G.H4,K.H4],[G.H5,K.H5],[G.H6,K.H6],[G.HEAD,K.HEAD],[G.HEADER,K.HEADER],[G.HGROUP,K.HGROUP],[G.HR,K.HR],[G.HTML,K.HTML],[G.I,K.I],[G.IMG,K.IMG],[G.IMAGE,K.IMAGE],[G.INPUT,K.INPUT],[G.IFRAME,K.IFRAME],[G.KEYGEN,K.KEYGEN],[G.LABEL,K.LABEL],[G.LI,K.LI],[G.LINK,K.LINK],[G.LISTING,K.LISTING],[G.MAIN,K.MAIN],[G.MALIGNMARK,K.MALIGNMARK],[G.MARQUEE,K.MARQUEE],[G.MATH,K.MATH],[G.MENU,K.MENU],[G.META,K.META],[G.MGLYPH,K.MGLYPH],[G.MI,K.MI],[G.MO,K.MO],[G.MN,K.MN],[G.MS,K.MS],[G.MTEXT,K.MTEXT],[G.NAV,K.NAV],[G.NOBR,K.NOBR],[G.NOFRAMES,K.NOFRAMES],[G.NOEMBED,K.NOEMBED],[G.NOSCRIPT,K.NOSCRIPT],[G.OBJECT,K.OBJECT],[G.OL,K.OL],[G.OPTGROUP,K.OPTGROUP],[G.OPTION,K.OPTION],[G.P,K.P],[G.PARAM,K.PARAM],[G.PLAINTEXT,K.PLAINTEXT],[G.PRE,K.PRE],[G.RB,K.RB],[G.RP,K.RP],[G.RT,K.RT],[G.RTC,K.RTC],[G.RUBY,K.RUBY],[G.S,K.S],[G.SCRIPT,K.SCRIPT],[G.SEARCH,K.SEARCH],[G.SECTION,K.SECTION],[G.SELECT,K.SELECT],[G.SOURCE,K.SOURCE],[G.SMALL,K.SMALL],[G.SPAN,K.SPAN],[G.STRIKE,K.STRIKE],[G.STRONG,K.STRONG],[G.STYLE,K.STYLE],[G.SUB,K.SUB],[G.SUMMARY,K.SUMMARY],[G.SUP,K.SUP],[G.TABLE,K.TABLE],[G.TBODY,K.TBODY],[G.TEMPLATE,K.TEMPLATE],[G.TEXTAREA,K.TEXTAREA],[G.TFOOT,K.TFOOT],[G.TD,K.TD],[G.TH,K.TH],[G.THEAD,K.THEAD],[G.TITLE,K.TITLE],[G.TR,K.TR],[G.TRACK,K.TRACK],[G.TT,K.TT],[G.U,K.U],[G.UL,K.UL],[G.SVG,K.SVG],[G.VAR,K.VAR],[G.WBR,K.WBR],[G.XMP,K.XMP]]),q=K,W0={[W.HTML]:new Set([q.ADDRESS,q.APPLET,q.AREA,q.ARTICLE,q.ASIDE,q.BASE,q.BASEFONT,q.BGSOUND,q.BLOCKQUOTE,q.BODY,q.BR,q.BUTTON,q.CAPTION,q.CENTER,q.COL,q.COLGROUP,q.DD,q.DETAILS,q.DIR,q.DIV,q.DL,q.DT,q.EMBED,q.FIELDSET,q.FIGCAPTION,q.FIGURE,q.FOOTER,q.FORM,q.FRAME,q.FRAMESET,q.H1,q.H2,q.H3,q.H4,q.H5,q.H6,q.HEAD,q.HEADER,q.HGROUP,q.HR,q.HTML,q.IFRAME,q.IMG,q.INPUT,q.LI,q.LINK,q.LISTING,q.MAIN,q.MARQUEE,q.MENU,q.META,q.NAV,q.NOEMBED,q.NOFRAMES,q.NOSCRIPT,q.OBJECT,q.OL,q.P,q.PARAM,q.PLAINTEXT,q.PRE,q.SCRIPT,q.SECTION,q.SELECT,q.SOURCE,q.STYLE,q.SUMMARY,q.TABLE,q.TBODY,q.TD,q.TEMPLATE,q.TEXTAREA,q.TFOOT,q.TH,q.THEAD,q.TITLE,q.TR,q.TRACK,q.UL,q.WBR,q.XMP]),[W.MATHML]:new Set([q.MI,q.MO,q.MN,q.MS,q.MTEXT,q.ANNOTATION_XML]),[W.SVG]:new Set([q.TITLE,q.FOREIGN_OBJECT,q.DESC]),[W.XLINK]:new Set,[W.XML]:new Set,[W.XMLNS]:new Set},G0=new Set([q.H1,q.H2,q.H3,q.H4,q.H5,q.H6]),new Set([G.STYLE,G.SCRIPT,G.XMP,G.IFRAME,G.NOEMBED,G.NOFRAMES,G.PLAINTEXT])}));function nve(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function q0(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function rve(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function J0(e){return rve(e)||q0(e)}function ive(e){return J0(e)||nve(e)}function Y0(e){return e+32}function ave(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function ove(e){return ave(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function sve(e){return e===H.NULL?U.nullCharacterReference:e>1114111?U.characterReferenceOutsideUnicodeRange:y0(e)?U.surrogateCharacterReference:x0(e)?U.noncharacterCharacterReference:b0(e)||e===H.CARRIAGE_RETURN?U.controlCharacterReference:null}var J,X0,cve,lve=o((()=>{q_e(),w0(),A0(),tve(),T0(),K0(),(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(J||={}),X0={DATA:J.DATA,RCDATA:J.RCDATA,RAWTEXT:J.RAWTEXT,SCRIPT_DATA:J.SCRIPT_DATA,PLAINTEXT:J.PLAINTEXT,CDATA_SECTION:J.CDATA_SECTION},cve=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=J.DATA,this.returnState=J.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new D0(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new z0(j0,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(U.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(U.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=sve(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:k0.START_TAG,tagName:``,tagID:K.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:k0.END_TAG,tagName:``,tagID:K.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:k0.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:k0.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(O0(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(U.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=B0(e.tagName),e.type===k0.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(U.endTagWithAttributes),e.selfClosing&&this._err(U.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case k0.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case k0.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case k0.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:k0.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=ave(e)?k0.WHITESPACE_CHARACTER:e===H.NULL?k0.NULL_CHARACTER:k0.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(k0.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=J.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?R0.Attribute:R0.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===J.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case J.DATA:this._stateData(e);break;case J.RCDATA:this._stateRcdata(e);break;case J.RAWTEXT:this._stateRawtext(e);break;case J.SCRIPT_DATA:this._stateScriptData(e);break;case J.PLAINTEXT:this._statePlaintext(e);break;case J.TAG_OPEN:this._stateTagOpen(e);break;case J.END_TAG_OPEN:this._stateEndTagOpen(e);break;case J.TAG_NAME:this._stateTagName(e);break;case J.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case J.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case J.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case J.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case J.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case J.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case J.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case J.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case J.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case J.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case J.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case J.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case J.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case J.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case J.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case J.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case J.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case J.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case J.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case J.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case J.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case J.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case J.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case J.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case J.BOGUS_COMMENT:this._stateBogusComment(e);break;case J.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case J.COMMENT_START:this._stateCommentStart(e);break;case J.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case J.COMMENT:this._stateComment(e);break;case J.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case J.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case J.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case J.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case J.COMMENT_END:this._stateCommentEnd(e);break;case J.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case J.DOCTYPE:this._stateDoctype(e);break;case J.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case J.DOCTYPE_NAME:this._stateDoctypeName(e);break;case J.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case J.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case J.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case J.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case J.CDATA_SECTION:this._stateCdataSection(e);break;case J.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case J.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case J.CHARACTER_REFERENCE:this._stateCharacterReference();break;case J.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case H.LESS_THAN_SIGN:this.state=J.TAG_OPEN;break;case H.AMPERSAND:this._startCharacterReference();break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitCodePoint(e);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case H.AMPERSAND:this._startCharacterReference();break;case H.LESS_THAN_SIGN:this.state=J.RCDATA_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case H.LESS_THAN_SIGN:this.state=J.RAWTEXT_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(J0(e))this._createStartTagToken(),this.state=J.TAG_NAME,this._stateTagName(e);else switch(e){case H.EXCLAMATION_MARK:this.state=J.MARKUP_DECLARATION_OPEN;break;case H.SOLIDUS:this.state=J.END_TAG_OPEN;break;case H.QUESTION_MARK:this._err(U.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=J.BOGUS_COMMENT,this._stateBogusComment(e);break;case H.EOF:this._err(U.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(U.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=J.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(J0(e))this._createEndTagToken(),this.state=J.TAG_NAME,this._stateTagName(e);else switch(e){case H.GREATER_THAN_SIGN:this._err(U.missingEndTagName),this.state=J.DATA;break;case H.EOF:this._err(U.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(U.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_ATTRIBUTE_NAME;break;case H.SOLIDUS:this.state=J.SELF_CLOSING_START_TAG;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentTagToken();break;case H.NULL:this._err(U.unexpectedNullCharacter),t.tagName+=`�`;break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(q0(e)?Y0(e):e)}}_stateRcdataLessThanSign(e){e===H.SOLIDUS?this.state=J.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=J.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){J0(e)?(this.state=J.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=J.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=J.BEFORE_ATTRIBUTE_NAME,!1;case H.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=J.SELF_CLOSING_START_TAG,!1;case H.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=J.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===H.SOLIDUS?this.state=J.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=J.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){J0(e)?(this.state=J.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=J.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case H.SOLIDUS:this.state=J.SCRIPT_DATA_END_TAG_OPEN;break;case H.EXCLAMATION_MARK:this.state=J.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=J.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){J0(e)?(this.state=J.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===H.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===H.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case H.HYPHEN_MINUS:this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case H.GREATER_THAN_SIGN:this.state=J.SCRIPT_DATA,this._emitChars(`>`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===H.SOLIDUS?this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:J0(e)?(this._emitChars(`<`),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){J0(e)?(this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(C0.SCRIPT,!1)&&ove(this.preprocessor.peek(C0.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<C0.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case H.HYPHEN_MINUS:this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case H.GREATER_THAN_SIGN:this.state=J.SCRIPT_DATA,this._emitChars(`>`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===H.SOLIDUS?(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(C0.SCRIPT,!1)&&ove(this.preprocessor.peek(C0.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<C0.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:this.state=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case H.EQUALS_SIGN:this._err(U.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=J.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=J.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:this._leaveAttrName(),this.state=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case H.EQUALS_SIGN:this._leaveAttrName(),this.state=J.BEFORE_ATTRIBUTE_VALUE;break;case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:this._err(U.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(q0(e)?Y0(e):e)}}_stateAfterAttributeName(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:this.state=J.SELF_CLOSING_START_TAG;break;case H.EQUALS_SIGN:this.state=J.BEFORE_ATTRIBUTE_VALUE;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentTagToken();break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=J.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:this.state=J.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case H.APOSTROPHE:this.state=J.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingAttributeValue),this.state=J.DATA,this.emitCurrentTagToken();break;default:this.state=J.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case H.QUOTATION_MARK:this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case H.AMPERSAND:this._startCharacterReference();break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case H.APOSTROPHE:this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case H.AMPERSAND:this._startCharacterReference();break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this._leaveAttrValue(),this.state=J.BEFORE_ATTRIBUTE_NAME;break;case H.AMPERSAND:this._startCharacterReference();break;case H.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:case H.EQUALS_SIGN:case H.GRAVE_ACCENT:this._err(U.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this._leaveAttrValue(),this.state=J.BEFORE_ATTRIBUTE_NAME;break;case H.SOLIDUS:this._leaveAttrValue(),this.state=J.SELF_CLOSING_START_TAG;break;case H.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this._err(U.missingWhitespaceBetweenAttributes),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case H.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=J.DATA,this.emitCurrentTagToken();break}case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this._err(U.unexpectedSolidusInTag),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentComment(t);break;case H.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case H.NULL:this._err(U.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(C0.DASH_DASH,!0)?(this._createCommentToken(C0.DASH_DASH.length+1),this.state=J.COMMENT_START):this._consumeSequenceIfMatch(C0.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(C0.DOCTYPE.length+1),this.state=J.DOCTYPE):this._consumeSequenceIfMatch(C0.CDATA_START,!0)?this.inForeignNode?this.state=J.CDATA_SECTION:(this._err(U.cdataInHtmlContent),this._createCommentToken(C0.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=J.BOGUS_COMMENT):this._ensureHibernation()||(this._err(U.incorrectlyOpenedComment),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_START_DASH;break;case H.GREATER_THAN_SIGN:{this._err(U.abruptClosingOfEmptyComment),this.state=J.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=J.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_END;break;case H.GREATER_THAN_SIGN:this._err(U.abruptClosingOfEmptyComment),this.state=J.DATA,this.emitCurrentComment(t);break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=J.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_END_DASH;break;case H.LESS_THAN_SIGN:t.data+=`<`,this.state=J.COMMENT_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.data+=`�`;break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case H.EXCLAMATION_MARK:t.data+=`!`,this.state=J.COMMENT_LESS_THAN_SIGN_BANG;break;case H.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=J.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===H.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=J.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===H.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=J.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==H.GREATER_THAN_SIGN&&e!==H.EOF&&this._err(U.nestedComment),this.state=J.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_END;break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=J.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentComment(t);break;case H.EXCLAMATION_MARK:this.state=J.COMMENT_END_BANG;break;case H.HYPHEN_MINUS:t.data+=`-`;break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=J.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:t.data+=`--!`,this.state=J.COMMENT_END_DASH;break;case H.GREATER_THAN_SIGN:this._err(U.incorrectlyClosedComment),this.state=J.DATA,this.emitCurrentComment(t);break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=J.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_DOCTYPE_NAME;break;case H.GREATER_THAN_SIGN:this.state=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case H.EOF:{this._err(U.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(U.missingWhitespaceBeforeDoctypeName),this.state=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(q0(e))this._createDoctypeToken(String.fromCharCode(Y0(e))),this.state=J.DOCTYPE_NAME;else switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.NULL:this._err(U.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=J.DOCTYPE_NAME;break;case H.GREATER_THAN_SIGN:{this._err(U.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=J.DATA;break}case H.EOF:{this._err(U.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=J.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.AFTER_DOCTYPE_NAME;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.NULL:this._err(U.unexpectedNullCharacter),t.name+=`�`;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(q0(e)?Y0(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(C0.PUBLIC,!1)?this.state=J.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(C0.SYSTEM,!1)?this.state=J.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(U.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case H.QUOTATION_MARK:this._err(U.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:this._err(U.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case H.QUOTATION_MARK:this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.publicId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case H.APOSTROPHE:this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.publicId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.QUOTATION_MARK:this._err(U.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:this._err(U.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.QUOTATION_MARK:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case H.QUOTATION_MARK:this._err(U.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:this._err(U.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case H.QUOTATION_MARK:this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.systemId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case H.APOSTROPHE:this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.systemId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case H.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.NULL:this._err(U.unexpectedNullCharacter);break;case H.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case H.RIGHT_SQUARE_BRACKET:this.state=J.CDATA_SECTION_BRACKET;break;case H.EOF:this._err(U.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===H.RIGHT_SQUARE_BRACKET?this.state=J.CDATA_SECTION_END:(this._emitChars(`]`),this.state=J.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case H.GREATER_THAN_SIGN:this.state=J.DATA;break;case H.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=J.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(H.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ive(this.preprocessor.peek(1))?J.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ive(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===H.SEMICOLON&&this._err(U.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}})),Z0,Q0,$0,uve,dve,e2,t2,fve,pve,mve,hve,gve,_ve=o((()=>{K0(),Z0=new Set([K.DD,K.DT,K.LI,K.OPTGROUP,K.OPTION,K.P,K.RB,K.RP,K.RT,K.RTC]),Q0=new Set([...Z0,K.CAPTION,K.COLGROUP,K.TBODY,K.TD,K.TFOOT,K.TH,K.THEAD,K.TR]),$0=new Set([K.APPLET,K.CAPTION,K.HTML,K.MARQUEE,K.OBJECT,K.TABLE,K.TD,K.TEMPLATE,K.TH]),uve=new Set([...$0,K.OL,K.UL]),dve=new Set([...$0,K.BUTTON]),e2=new Set([K.ANNOTATION_XML,K.MI,K.MN,K.MO,K.MS,K.MTEXT]),t2=new Set([K.DESC,K.FOREIGN_OBJECT,K.TITLE]),fve=new Set([K.TR,K.TEMPLATE,K.HTML]),pve=new Set([K.TBODY,K.TFOOT,K.THEAD,K.TEMPLATE,K.HTML]),mve=new Set([K.TABLE,K.TEMPLATE,K.HTML]),hve=new Set([K.TD,K.TH]),gve=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=K.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===K.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===W.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==W.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(G0,W.HTML)}popUntilTableCellPopped(){this.popUntilPopped(hve,W.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(mve,W.HTML)}clearBackToTableBodyContext(){this.clearBackTo(pve,W.HTML)}clearBackToTableRowContext(){this.clearBackTo(fve,W.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===K.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===K.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case W.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case W.SVG:if(t2.has(r))return!1;break;case W.MATHML:if(e2.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,$0)}hasInListItemScope(e){return this.hasInDynamicScope(e,uve)}hasInButtonScope(e){return this.hasInDynamicScope(e,dve)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case W.HTML:if(G0.has(t))return!0;if($0.has(t))return!1;break;case W.SVG:if(t2.has(t))return!1;break;case W.MATHML:if(e2.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===W.HTML)switch(this.tagIDs[t]){case e:return!0;case K.TABLE:case K.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===W.HTML)switch(this.tagIDs[e]){case K.TBODY:case K.THEAD:case K.TFOOT:return!0;case K.TABLE:case K.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===W.HTML)switch(this.tagIDs[t]){case e:return!0;case K.OPTION:case K.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Z0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Q0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Q0.has(this.currentTagId);)this.pop()}}})),n2,r2,i2,vve,yve=o((()=>{n2=3,(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(r2||={}),i2={type:r2.Marker},vve=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===r2.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<n2)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<n2)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=n2&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(i2)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:r2.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:r2.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(i2);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===r2.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===r2.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===r2.Element&&t.element===e)}}})),a2,o2=o((()=>{K0(),a2={createDocument(){return{nodeName:`#document`,mode:H0.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};a2.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(a2.isTextNode(n)){n.value+=t;return}}a2.appendChild(e,a2.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&a2.isTextNode(r)?r.value+=t:a2.insertBefore(e,a2.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}}}));function bve(e,t){return t.some(t=>e.startsWith(t))}function xve(e){return e.name===s2&&e.publicId===null&&(e.systemId===null||e.systemId===Cve)}function Sve(e){if(e.name!==s2)return H0.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===wve)return H0.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Eve.has(n))return H0.QUIRKS;let e=t===null?Tve:c2;if(bve(n,e))return H0.QUIRKS;if(e=t===null?l2:Dve,bve(n,e))return H0.LIMITED_QUIRKS}return H0.NO_QUIRKS}var s2,Cve,wve,c2,Tve,Eve,l2,Dve,Ove=o((()=>{K0(),s2=`html`,Cve=`about:legacy-compat`,wve=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,c2=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Tve=[...c2,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Eve=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),l2=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Dve=[...l2,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`]}));function kve(e){let t=e.tagID;return t===K.FONT&&e.attrs.some(({name:e})=>e===V0.COLOR||e===V0.SIZE||e===V0.FACE)||Vve.has(t)}function Ave(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Ive){e.attrs[t].name=Lve;break}}function jve(e){for(let t=0;t<e.attrs.length;t++){let n=Rve.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function u2(e){for(let t=0;t<e.attrs.length;t++){let n=zve.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Mve(e){let t=Bve.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=B0(e.tagName))}function Nve(e,t){return t===W.MATHML&&(e===K.MI||e===K.MO||e===K.MN||e===K.MS||e===K.MTEXT)}function Pve(e,t,n){if(t===W.MATHML&&e===K.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===V0.ENCODING){let t=n[e].value.toLowerCase();return t===d2.TEXT_HTML||t===d2.APPLICATION_XML}}return t===W.SVG&&(e===K.FOREIGN_OBJECT||e===K.DESC||e===K.TITLE)}function Fve(e,t,n,r){return(!r||r===W.HTML)&&Pve(e,t,n)||(!r||r===W.MATHML)&&Nve(e,t)}var d2,Ive,Lve,Rve,zve,Bve,Vve,Hve=o((()=>{K0(),d2={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},Ive=`definitionurl`,Lve=`definitionURL`,Rve=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),zve=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:W.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:W.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:W.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:W.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:W.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:W.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:W.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:W.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:W.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:W.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:W.XMLNS}]]),Bve=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),Vve=new Set([K.B,K.BIG,K.BLOCKQUOTE,K.BODY,K.BR,K.CENTER,K.CODE,K.DD,K.DIV,K.DL,K.DT,K.EM,K.EMBED,K.H1,K.H2,K.H3,K.H4,K.H5,K.H6,K.HEAD,K.HR,K.I,K.IMG,K.LI,K.LISTING,K.MENU,K.META,K.NOBR,K.OL,K.P,K.PRE,K.RUBY,K.S,K.SMALL,K.SPAN,K.STRONG,K.STRIKE,K.SUB,K.SUP,K.TABLE,K.TT,K.U,K.UL,K.VAR])}));function Uve(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Zye(e,t),n}function Wve(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Gve(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=zbe;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Kve(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Kve(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function qve(e,t,n){let r=B0(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===K.TEMPLATE&&i===W.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Jve(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function f2(e,t){for(let n=0;n<Rbe;n++){let n=Uve(e,t);if(!n)break;let r=Wve(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Gve(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&qve(e,a,i),Jve(e,r,n)}}function p2(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Yve(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Xve(e,t){e._appendCommentNode(t,e.document)}function m2(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Zve(e,t){e._setDocumentType(t);let n=t.forceQuirks?H0.QUIRKS:Sve(t);xve(t)||e._err(t,U.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Y.BEFORE_HTML}function h2(e,t){e._err(t,U.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,H0.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function Qve(e,t){t.tagID===K.HTML?(e._insertElement(t,W.HTML),e.insertionMode=Y.BEFORE_HEAD):g2(e,t)}function $ve(e,t){let n=t.tagID;(n===K.HTML||n===K.HEAD||n===K.BODY||n===K.BR)&&g2(e,t)}function g2(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function eye(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.HEAD:e._insertElement(t,W.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break;default:_2(e,t)}}function tye(e,t){let n=t.tagID;n===K.HEAD||n===K.BODY||n===K.HTML||n===K.BR?_2(e,t):e._err(t,U.endTagWithoutMatchingOpenElement)}function _2(e,t){e._insertFakeElement(G.HEAD,K.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function v2(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.TITLE:e._switchToTextParsing(t,X0.RCDATA);break;case K.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,X0.RAWTEXT):(e._insertElement(t,W.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break;case K.NOFRAMES:case K.STYLE:e._switchToTextParsing(t,X0.RAWTEXT);break;case K.SCRIPT:e._switchToTextParsing(t,X0.SCRIPT_DATA);break;case K.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break;case K.HEAD:e._err(t,U.misplacedStartTagForHeadElement);break;default:b2(e,t)}}function nye(e,t){switch(t.tagID){case K.HEAD:e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break;case K.BODY:case K.BR:case K.HTML:b2(e,t);break;case K.TEMPLATE:y2(e,t);break;default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function y2(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==K.TEMPLATE&&e._err(t,U.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(K.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,U.endTagWithoutMatchingOpenElement)}function b2(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function rye(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.BASEFONT:case K.BGSOUND:case K.HEAD:case K.LINK:case K.META:case K.NOFRAMES:case K.STYLE:v2(e,t);break;case K.NOSCRIPT:e._err(t,U.nestedNoscriptInHead);break;default:x2(e,t)}}function iye(e,t){switch(t.tagID){case K.NOSCRIPT:e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break;case K.BR:x2(e,t);break;default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function x2(e,t){let n=t.type===k0.EOF?U.openElementsLeftAfterEof:U.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function aye(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.BODY:e._insertElement(t,W.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break;case K.FRAMESET:e._insertElement(t,W.HTML),e.insertionMode=Y.IN_FRAMESET;break;case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:case K.NOFRAMES:case K.SCRIPT:case K.STYLE:case K.TEMPLATE:case K.TITLE:e._err(t,U.abandonedHeadElementChild),e.openElements.push(e.headElement,K.HEAD),v2(e,t),e.openElements.remove(e.headElement);break;case K.HEAD:e._err(t,U.misplacedStartTagForHeadElement);break;default:S2(e,t)}}function oye(e,t){switch(t.tagID){case K.BODY:case K.HTML:case K.BR:S2(e,t);break;case K.TEMPLATE:y2(e,t);break;default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function S2(e,t){e._insertFakeElement(G.BODY,K.BODY),e.insertionMode=Y.IN_BODY,C2(e,t)}function C2(e,t){switch(t.type){case k0.CHARACTER:cye(e,t);break;case k0.WHITESPACE_CHARACTER:sye(e,t);break;case k0.COMMENT:p2(e,t);break;case k0.START_TAG:w2(e,t);break;case k0.END_TAG:T2(e,t);break;case k0.EOF:Qye(e,t);break;default:}}function sye(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function cye(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function lye(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function uye(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function dye(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_FRAMESET)}function fye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML)}function pye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&G0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,W.HTML)}function mye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function hye(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),n||(e.formElement=e.openElements.current))}function gye(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===K.LI&&r===K.LI||(n===K.DD||n===K.DT)&&(r===K.DD||r===K.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==K.ADDRESS&&r!==K.DIV&&r!==K.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML)}function _ye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),e.tokenizer.state=X0.PLAINTEXT}function vye(e,t){e.openElements.hasInScope(K.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.framesetOk=!1}function yye(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(G.A);n&&(f2(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xye(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(K.NOBR)&&(f2(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,W.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Sye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Cye(e,t){e.treeAdapter.getDocumentMode(e.document)!==H0.QUIRKS&&e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function wye(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,W.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Tye(e){let t=O0(e,V0.TYPE);return t!=null&&t.toLowerCase()===Lbe}function Eye(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,W.HTML),Tye(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Dye(e,t){e._appendElement(t,W.HTML),t.ackSelfClosing=!0}function Oye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._appendElement(t,W.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function kye(e,t){t.tagName=G.IMG,t.tagID=K.IMG,wye(e,t)}function Aye(e,t){e._insertElement(t,W.HTML),e.skipNextNewLine=!0,e.tokenizer.state=X0.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function jye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,X0.RAWTEXT)}function Mye(e,t){e.framesetOk=!1,e._switchToTextParsing(t,X0.RAWTEXT)}function Nye(e,t){e._switchToTextParsing(t,X0.RAWTEXT)}function Pye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function Fye(e,t){e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML)}function Iye(e,t){e.openElements.hasInScope(K.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,W.HTML)}function Lye(e,t){e.openElements.hasInScope(K.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(K.RTC),e._insertElement(t,W.HTML)}function Rye(e,t){e._reconstructActiveFormattingElements(),Ave(t),u2(t),t.selfClosing?e._appendElement(t,W.MATHML):e._insertElement(t,W.MATHML),t.ackSelfClosing=!0}function zye(e,t){e._reconstructActiveFormattingElements(),jve(t),u2(t),t.selfClosing?e._appendElement(t,W.SVG):e._insertElement(t,W.SVG),t.ackSelfClosing=!0}function Bye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML)}function w2(e,t){switch(t.tagID){case K.I:case K.S:case K.B:case K.U:case K.EM:case K.TT:case K.BIG:case K.CODE:case K.FONT:case K.SMALL:case K.STRIKE:case K.STRONG:bye(e,t);break;case K.A:yye(e,t);break;case K.H1:case K.H2:case K.H3:case K.H4:case K.H5:case K.H6:pye(e,t);break;case K.P:case K.DL:case K.OL:case K.UL:case K.DIV:case K.DIR:case K.NAV:case K.MAIN:case K.MENU:case K.ASIDE:case K.CENTER:case K.FIGURE:case K.FOOTER:case K.HEADER:case K.HGROUP:case K.DIALOG:case K.DETAILS:case K.ADDRESS:case K.ARTICLE:case K.SEARCH:case K.SECTION:case K.SUMMARY:case K.FIELDSET:case K.BLOCKQUOTE:case K.FIGCAPTION:fye(e,t);break;case K.LI:case K.DD:case K.DT:gye(e,t);break;case K.BR:case K.IMG:case K.WBR:case K.AREA:case K.EMBED:case K.KEYGEN:wye(e,t);break;case K.HR:Oye(e,t);break;case K.RB:case K.RTC:Iye(e,t);break;case K.RT:case K.RP:Lye(e,t);break;case K.PRE:case K.LISTING:mye(e,t);break;case K.XMP:jye(e,t);break;case K.SVG:zye(e,t);break;case K.HTML:lye(e,t);break;case K.BASE:case K.LINK:case K.META:case K.STYLE:case K.TITLE:case K.SCRIPT:case K.BGSOUND:case K.BASEFONT:case K.TEMPLATE:v2(e,t);break;case K.BODY:uye(e,t);break;case K.FORM:hye(e,t);break;case K.NOBR:xye(e,t);break;case K.MATH:Rye(e,t);break;case K.TABLE:Cye(e,t);break;case K.INPUT:Eye(e,t);break;case K.PARAM:case K.TRACK:case K.SOURCE:Dye(e,t);break;case K.IMAGE:kye(e,t);break;case K.BUTTON:vye(e,t);break;case K.APPLET:case K.OBJECT:case K.MARQUEE:Sye(e,t);break;case K.IFRAME:Mye(e,t);break;case K.SELECT:Pye(e,t);break;case K.OPTION:case K.OPTGROUP:Fye(e,t);break;case K.NOEMBED:case K.NOFRAMES:Nye(e,t);break;case K.FRAMESET:dye(e,t);break;case K.TEXTAREA:Aye(e,t);break;case K.NOSCRIPT:e.options.scriptingEnabled?Nye(e,t):Bye(e,t);break;case K.PLAINTEXT:_ye(e,t);break;case K.COL:case K.TH:case K.TD:case K.TR:case K.HEAD:case K.FRAME:case K.TBODY:case K.TFOOT:case K.THEAD:case K.CAPTION:case K.COLGROUP:break;default:Bye(e,t)}}function Vye(e,t){if(e.openElements.hasInScope(K.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Hye(e,t){e.openElements.hasInScope(K.BODY)&&(e.insertionMode=Y.AFTER_BODY,Tbe(e,t))}function Uye(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Wye(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(K.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(K.FORM):n&&e.openElements.remove(n))}function Gye(e){e.openElements.hasInButtonScope(K.P)||e._insertFakeElement(G.P,K.P),e._closePElement()}function Kye(e){e.openElements.hasInListItemScope(K.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(K.LI),e.openElements.popUntilTagNamePopped(K.LI))}function qye(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Jye(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Yye(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Xye(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(G.BR,K.BR),e.openElements.pop(),e.framesetOk=!1}function Zye(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==K.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function T2(e,t){switch(t.tagID){case K.A:case K.B:case K.I:case K.S:case K.U:case K.EM:case K.TT:case K.BIG:case K.CODE:case K.FONT:case K.NOBR:case K.SMALL:case K.STRIKE:case K.STRONG:f2(e,t);break;case K.P:Gye(e);break;case K.DL:case K.UL:case K.OL:case K.DIR:case K.DIV:case K.NAV:case K.PRE:case K.MAIN:case K.MENU:case K.ASIDE:case K.BUTTON:case K.CENTER:case K.FIGURE:case K.FOOTER:case K.HEADER:case K.HGROUP:case K.DIALOG:case K.ADDRESS:case K.ARTICLE:case K.DETAILS:case K.SEARCH:case K.SECTION:case K.SUMMARY:case K.LISTING:case K.FIELDSET:case K.BLOCKQUOTE:case K.FIGCAPTION:Uye(e,t);break;case K.LI:Kye(e);break;case K.DD:case K.DT:qye(e,t);break;case K.H1:case K.H2:case K.H3:case K.H4:case K.H5:case K.H6:Jye(e);break;case K.BR:Xye(e);break;case K.BODY:Vye(e,t);break;case K.HTML:Hye(e,t);break;case K.FORM:Wye(e);break;case K.APPLET:case K.OBJECT:case K.MARQUEE:Yye(e,t);break;case K.TEMPLATE:y2(e,t);break;default:Zye(e,t)}}function Qye(e,t){e.tmplInsertionModeStack.length>0?Cbe(e,t):m2(e,t)}function $ye(e,t){var n;t.tagID===K.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function ebe(e,t){e._err(t,U.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function E2(e,t){if(e.openElements.currentTagId!==void 0&&R2.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case k0.CHARACTER:ube(e,t);break;case k0.WHITESPACE_CHARACTER:lbe(e,t);break}else k2(e,t)}function tbe(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_CAPTION}function nbe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function rbe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(G.COLGROUP,K.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,j2(e,t)}function ibe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_TABLE_BODY}function abe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(G.TBODY,K.TBODY),e.insertionMode=Y.IN_TABLE_BODY,N2(e,t)}function obe(e,t){e.openElements.hasInTableScope(K.TABLE)&&(e.openElements.popUntilTagNamePopped(K.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function sbe(e,t){Tye(t)?e._appendElement(t,W.HTML):k2(e,t),t.ackSelfClosing=!0}function cbe(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,W.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function D2(e,t){switch(t.tagID){case K.TD:case K.TH:case K.TR:abe(e,t);break;case K.STYLE:case K.SCRIPT:case K.TEMPLATE:v2(e,t);break;case K.COL:rbe(e,t);break;case K.FORM:cbe(e,t);break;case K.TABLE:obe(e,t);break;case K.TBODY:case K.TFOOT:case K.THEAD:ibe(e,t);break;case K.INPUT:sbe(e,t);break;case K.CAPTION:tbe(e,t);break;case K.COLGROUP:nbe(e,t);break;default:k2(e,t)}}function O2(e,t){switch(t.tagID){case K.TABLE:e.openElements.hasInTableScope(K.TABLE)&&(e.openElements.popUntilTagNamePopped(K.TABLE),e._resetInsertionMode());break;case K.TEMPLATE:y2(e,t);break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TBODY:case K.TD:case K.TFOOT:case K.TH:case K.THEAD:case K.TR:break;default:k2(e,t)}}function k2(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,C2(e,t),e.fosterParentingEnabled=n}function lbe(e,t){e.pendingCharacterTokens.push(t)}function ube(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function A2(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)k2(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}function dbe(e,t){let n=t.tagID;V2.has(n)?e.openElements.hasInTableScope(K.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,D2(e,t)):w2(e,t)}function fbe(e,t){let n=t.tagID;switch(n){case K.CAPTION:case K.TABLE:e.openElements.hasInTableScope(K.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,n===K.TABLE&&O2(e,t));break;case K.BODY:case K.COL:case K.COLGROUP:case K.HTML:case K.TBODY:case K.TD:case K.TFOOT:case K.TH:case K.THEAD:case K.TR:break;default:T2(e,t)}}function j2(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.COL:e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.TEMPLATE:v2(e,t);break;default:M2(e,t)}}function pbe(e,t){switch(t.tagID){case K.COLGROUP:e.openElements.currentTagId===K.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break;case K.TEMPLATE:y2(e,t);break;case K.COL:break;default:M2(e,t)}}function M2(e,t){e.openElements.currentTagId===K.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE,e._processToken(t))}function N2(e,t){switch(t.tagID){case K.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_ROW;break;case K.TH:case K.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(G.TR,K.TR),e.insertionMode=Y.IN_ROW,F2(e,t);break;case K.CAPTION:case K.COL:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,D2(e,t));break;default:D2(e,t)}}function P2(e,t){let n=t.tagID;switch(t.tagID){case K.TBODY:case K.TFOOT:case K.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break;case K.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,O2(e,t));break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TD:case K.TH:case K.TR:break;default:O2(e,t)}}function F2(e,t){switch(t.tagID){case K.TH:case K.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_CELL,e.activeFormattingElements.insertMarker();break;case K.CAPTION:case K.COL:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:case K.TR:e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,N2(e,t));break;default:D2(e,t)}}function mbe(e,t){switch(t.tagID){case K.TR:e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY);break;case K.TABLE:e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,P2(e,t));break;case K.TBODY:case K.TFOOT:case K.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(K.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,P2(e,t));break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TD:case K.TH:break;default:O2(e,t)}}function hbe(e,t){let n=t.tagID;V2.has(n)?(e.openElements.hasInTableScope(K.TD)||e.openElements.hasInTableScope(K.TH))&&(e._closeTableCell(),F2(e,t)):w2(e,t)}function gbe(e,t){let n=t.tagID;switch(n){case K.TD:case K.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_ROW);break;case K.TABLE:case K.TBODY:case K.TFOOT:case K.THEAD:case K.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),mbe(e,t));break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:break;default:T2(e,t)}}function _be(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.OPTION:e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e._insertElement(t,W.HTML);break;case K.OPTGROUP:e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e.openElements.currentTagId===K.OPTGROUP&&e.openElements.pop(),e._insertElement(t,W.HTML);break;case K.HR:e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e.openElements.currentTagId===K.OPTGROUP&&e.openElements.pop(),e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.INPUT:case K.KEYGEN:case K.TEXTAREA:case K.SELECT:e.openElements.hasInSelectScope(K.SELECT)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),t.tagID!==K.SELECT&&e._processStartTag(t));break;case K.SCRIPT:case K.TEMPLATE:v2(e,t);break;default:}}function vbe(e,t){switch(t.tagID){case K.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===K.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===K.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===K.OPTGROUP&&e.openElements.pop();break;case K.OPTION:e.openElements.currentTagId===K.OPTION&&e.openElements.pop();break;case K.SELECT:e.openElements.hasInSelectScope(K.SELECT)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode());break;case K.TEMPLATE:y2(e,t);break;default:}}function ybe(e,t){let n=t.tagID;n===K.CAPTION||n===K.TABLE||n===K.TBODY||n===K.TFOOT||n===K.THEAD||n===K.TR||n===K.TD||n===K.TH?(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),e._processStartTag(t)):_be(e,t)}function bbe(e,t){let n=t.tagID;n===K.CAPTION||n===K.TABLE||n===K.TBODY||n===K.TFOOT||n===K.THEAD||n===K.TR||n===K.TD||n===K.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),e.onEndTag(t)):vbe(e,t)}function xbe(e,t){switch(t.tagID){case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:case K.NOFRAMES:case K.SCRIPT:case K.STYLE:case K.TEMPLATE:case K.TITLE:v2(e,t);break;case K.CAPTION:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,D2(e,t);break;case K.COL:e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,j2(e,t);break;case K.TR:e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,N2(e,t);break;case K.TD:case K.TH:e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,F2(e,t);break;default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,w2(e,t)}}function Sbe(e,t){t.tagID===K.TEMPLATE&&y2(e,t)}function Cbe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(K.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):m2(e,t)}function wbe(e,t){t.tagID===K.HTML?w2(e,t):I2(e,t)}function Tbe(e,t){if(t.tagID===K.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===K.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else I2(e,t)}function I2(e,t){e.insertionMode=Y.IN_BODY,C2(e,t)}function Ebe(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.FRAMESET:e._insertElement(t,W.HTML);break;case K.FRAME:e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.NOFRAMES:v2(e,t);break;default:}}function Dbe(e,t){t.tagID===K.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==K.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function Obe(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.NOFRAMES:v2(e,t);break;default:}}function kbe(e,t){t.tagID===K.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function Abe(e,t){t.tagID===K.HTML?w2(e,t):L2(e,t)}function L2(e,t){e.insertionMode=Y.IN_BODY,C2(e,t)}function jbe(e,t){switch(t.tagID){case K.HTML:w2(e,t);break;case K.NOFRAMES:v2(e,t);break;default:}}function Mbe(e,t){t.chars=`�`,e._insertCharacters(t)}function Nbe(e,t){e._insertCharacters(t),e.framesetOk=!1}function Pbe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==W.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Fbe(e,t){if(kve(t))Pbe(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===W.MATHML?Ave(t):r===W.SVG&&(Mve(t),jve(t)),u2(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Ibe(e,t){if(t.tagID===K.P||t.tagID===K.BR){Pbe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===W.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}var Lbe,Rbe,zbe,Y,Bbe,R2,z2,B2,V2,Vbe=o((()=>{lve(),_ve(),yve(),o2(),Ove(),Hve(),T0(),w0(),K0(),A0(),Lbe=`hidden`,Rbe=8,zbe=3,(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Y||={}),Bbe={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},R2=new Set([K.TABLE,K.TBODY,K.TFOOT,K.THEAD,K.TR]),z2={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:a2,onParseError:null},B2=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Y.INITIAL,this.originalInsertionMode=Y.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...z2,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new cve(this.options,this),this.activeFormattingElements=new vve(this.treeAdapter),this.fragmentContextID=n?B0(this.treeAdapter.getTagName(n)):K.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new gve(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...z2,...t};e??=n.treeAdapter.createElement(G.TEMPLATE,W.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,W.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===K.TEMPLATE&&i.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Bbe,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===W.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,W.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=X0.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===G.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==W.HTML))switch(this.fragmentContextID){case K.TITLE:case K.TEXTAREA:this.tokenizer.state=X0.RCDATA;break;case K.STYLE:case K.XMP:case K.IFRAME:case K.NOEMBED:case K.NOFRAMES:case K.NOSCRIPT:this.tokenizer.state=X0.RAWTEXT;break;case K.SCRIPT:this.tokenizer.state=X0.SCRIPT_DATA;break;case K.PLAINTEXT:this.tokenizer.state=X0.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,W.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,W.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(G.HTML,W.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,K.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===k0.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===K.SVG&&this.treeAdapter.getTagName(t)===G.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===W.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===K.MGLYPH||e.tagID===K.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,W.HTML)}_processToken(e){switch(e.type){case k0.CHARACTER:this.onCharacter(e);break;case k0.NULL_CHARACTER:this.onNullCharacter(e);break;case k0.COMMENT:this.onComment(e);break;case k0.DOCTYPE:this.onDoctype(e);break;case k0.START_TAG:this._processStartTag(e);break;case k0.END_TAG:this.onEndTag(e);break;case k0.EOF:this.onEof(e);break;case k0.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return Fve(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===r2.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Y.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(K.P),this.openElements.popUntilTagNamePopped(K.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case K.TR:this.insertionMode=Y.IN_ROW;return;case K.TBODY:case K.THEAD:case K.TFOOT:this.insertionMode=Y.IN_TABLE_BODY;return;case K.CAPTION:this.insertionMode=Y.IN_CAPTION;return;case K.COLGROUP:this.insertionMode=Y.IN_COLUMN_GROUP;return;case K.TABLE:this.insertionMode=Y.IN_TABLE;return;case K.BODY:this.insertionMode=Y.IN_BODY;return;case K.FRAMESET:this.insertionMode=Y.IN_FRAMESET;return;case K.SELECT:this._resetInsertionModeForSelect(e);return;case K.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case K.HTML:this.insertionMode=this.headElement?Y.AFTER_HEAD:Y.BEFORE_HEAD;return;case K.TD:case K.TH:if(e>0){this.insertionMode=Y.IN_CELL;return}break;case K.HEAD:if(e>0){this.insertionMode=Y.IN_HEAD;return}break}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===K.TEMPLATE)break;if(e===K.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(e){return R2.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case K.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===W.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case K.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return W0[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Nbe(this,e);return}switch(this.insertionMode){case Y.INITIAL:h2(this,e);break;case Y.BEFORE_HTML:g2(this,e);break;case Y.BEFORE_HEAD:_2(this,e);break;case Y.IN_HEAD:b2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:x2(this,e);break;case Y.AFTER_HEAD:S2(this,e);break;case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:cye(this,e);break;case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:E2(this,e);break;case Y.IN_TABLE_TEXT:ube(this,e);break;case Y.IN_COLUMN_GROUP:M2(this,e);break;case Y.AFTER_BODY:I2(this,e);break;case Y.AFTER_AFTER_BODY:L2(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Mbe(this,e);return}switch(this.insertionMode){case Y.INITIAL:h2(this,e);break;case Y.BEFORE_HTML:g2(this,e);break;case Y.BEFORE_HEAD:_2(this,e);break;case Y.IN_HEAD:b2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:x2(this,e);break;case Y.AFTER_HEAD:S2(this,e);break;case Y.TEXT:this._insertCharacters(e);break;case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:E2(this,e);break;case Y.IN_COLUMN_GROUP:M2(this,e);break;case Y.AFTER_BODY:I2(this,e);break;case Y.AFTER_AFTER_BODY:L2(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){p2(this,e);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:p2(this,e);break;case Y.IN_TABLE_TEXT:A2(this,e);break;case Y.AFTER_BODY:Yve(this,e);break;case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:Xve(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:Zve(this,e);break;case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:this._err(e,U.misplacedDoctype);break;case Y.IN_TABLE_TEXT:A2(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,U.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Fbe(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Y.INITIAL:h2(this,e);break;case Y.BEFORE_HTML:Qve(this,e);break;case Y.BEFORE_HEAD:eye(this,e);break;case Y.IN_HEAD:v2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:rye(this,e);break;case Y.AFTER_HEAD:aye(this,e);break;case Y.IN_BODY:w2(this,e);break;case Y.IN_TABLE:D2(this,e);break;case Y.IN_TABLE_TEXT:A2(this,e);break;case Y.IN_CAPTION:dbe(this,e);break;case Y.IN_COLUMN_GROUP:j2(this,e);break;case Y.IN_TABLE_BODY:N2(this,e);break;case Y.IN_ROW:F2(this,e);break;case Y.IN_CELL:hbe(this,e);break;case Y.IN_SELECT:_be(this,e);break;case Y.IN_SELECT_IN_TABLE:ybe(this,e);break;case Y.IN_TEMPLATE:xbe(this,e);break;case Y.AFTER_BODY:wbe(this,e);break;case Y.IN_FRAMESET:Ebe(this,e);break;case Y.AFTER_FRAMESET:Obe(this,e);break;case Y.AFTER_AFTER_BODY:Abe(this,e);break;case Y.AFTER_AFTER_FRAMESET:jbe(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Ibe(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Y.INITIAL:h2(this,e);break;case Y.BEFORE_HTML:$ve(this,e);break;case Y.BEFORE_HEAD:tye(this,e);break;case Y.IN_HEAD:nye(this,e);break;case Y.IN_HEAD_NO_SCRIPT:iye(this,e);break;case Y.AFTER_HEAD:oye(this,e);break;case Y.IN_BODY:T2(this,e);break;case Y.TEXT:$ye(this,e);break;case Y.IN_TABLE:O2(this,e);break;case Y.IN_TABLE_TEXT:A2(this,e);break;case Y.IN_CAPTION:fbe(this,e);break;case Y.IN_COLUMN_GROUP:pbe(this,e);break;case Y.IN_TABLE_BODY:P2(this,e);break;case Y.IN_ROW:mbe(this,e);break;case Y.IN_CELL:gbe(this,e);break;case Y.IN_SELECT:vbe(this,e);break;case Y.IN_SELECT_IN_TABLE:bbe(this,e);break;case Y.IN_TEMPLATE:Sbe(this,e);break;case Y.AFTER_BODY:Tbe(this,e);break;case Y.IN_FRAMESET:Dbe(this,e);break;case Y.AFTER_FRAMESET:kbe(this,e);break;case Y.AFTER_AFTER_BODY:L2(this,e);break;default:}}onEof(e){switch(this.insertionMode){case Y.INITIAL:h2(this,e);break;case Y.BEFORE_HTML:g2(this,e);break;case Y.BEFORE_HEAD:_2(this,e);break;case Y.IN_HEAD:b2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:x2(this,e);break;case Y.AFTER_HEAD:S2(this,e);break;case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:Qye(this,e);break;case Y.TEXT:ebe(this,e);break;case Y.IN_TABLE_TEXT:A2(this,e);break;case Y.IN_TEMPLATE:Cbe(this,e);break;case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:m2(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===H.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:this._insertCharacters(e);break;case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:sye(this,e);break;case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:E2(this,e);break;case Y.IN_TABLE_TEXT:lbe(this,e);break;default:}}},V2=new Set([K.CAPTION,K.COL,K.COLGROUP,K.TBODY,K.TD,K.TFOOT,K.TH,K.THEAD,K.TR])})),Hbe=o((()=>{K0(),o2(),new Set([G.AREA,G.BASE,G.BASEFONT,G.BGSOUND,G.BR,G.COL,G.EMBED,G.FRAME,G.HR,G.IMG,G.INPUT,G.KEYGEN,G.LINK,G.META,G.PARAM,G.SOURCE,G.TRACK,G.WBR])}));function Ube(e,t){return B2.parse(e,t)}function Wbe(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=B2.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var Gbe=o((()=>{Vbe(),o2(),Hbe(),T0(),Hve(),K0(),A0(),lve()}));function H2(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Kbe(e.position):`start`in e||`end`in e?Kbe(e):`line`in e||`column`in e?U2(e):``}function U2(e){return qbe(e&&e.line)+`:`+qbe(e&&e.column)}function Kbe(e){return U2(e&&e.start)+`-`+U2(e&&e.end)}function qbe(e){return e&&typeof e==`number`?e:1}var Jbe=o((()=>{})),Ybe=o((()=>{Jbe()})),W2,Xbe=o((()=>{Ybe(),W2=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=H2(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}},W2.prototype.file=``,W2.prototype.name=``,W2.prototype.reason=``,W2.prototype.message=``,W2.prototype.stack=``,W2.prototype.column=void 0,W2.prototype.line=void 0,W2.prototype.ancestors=void 0,W2.prototype.cause=void 0,W2.prototype.fatal=void 0,W2.prototype.place=void 0,W2.prototype.ruleId=void 0,W2.prototype.source=void 0})),Zbe=o((()=>{Xbe()}));function Qbe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);G2(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function $be(e){if(G2(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function exe(e){G2(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function txe(...e){let t=-1,n;for(;++t<e.length;)G2(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:nxe(n)}function nxe(e){G2(e);let t=e.codePointAt(0)===47,n=rxe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function rxe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function G2(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var K2,ixe=o((()=>{K2={basename:Qbe,dirname:$be,extname:exe,join:txe,sep:`/`}}));function axe(){return`/`}var oxe,sxe=o((()=>{oxe={cwd:axe}}));function q2(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}var cxe=o((()=>{}));function lxe(e){if(typeof e==`string`)e=new URL(e);else if(!q2(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return uxe(e)}function uxe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var dxe=o((()=>{cxe()}));function J2(e,t){if(e&&e.includes(K2.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+K2.sep+"`")}function Y2(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function fxe(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function pxe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var X2,Z2,mxe=o((()=>{Zbe(),ixe(),sxe(),dxe(),X2=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Z2=class{constructor(e){let t;t=e?q2(e)?{path:e}:typeof e==`string`||pxe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:oxe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<X2.length;){let e=X2[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)X2.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?K2.basename(this.path):void 0}set basename(e){Y2(e,`basename`),J2(e,`basename`),this.path=K2.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?K2.dirname(this.path):void 0}set dirname(e){fxe(this.basename,`dirname`),this.path=K2.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?K2.extname(this.path):void 0}set extname(e){if(J2(e,`extname`),fxe(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=K2.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){q2(e)&&(e=lxe(e)),Y2(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?K2.basename(this.path,this.extname):void 0}set stem(e){Y2(e,`stem`),J2(e,`stem`),this.path=K2.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new W2(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}}})),hxe=o((()=>{mxe()})),gxe,_xe=o((()=>{gxe={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}}}));function vxe(e,t){let n=t||Oxe,r=n.onerror,i=e instanceof Z2?e:new Z2(e),a=n.fragment?Wbe:Ube,o=String(i);return B_e(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=yxe(t),s=n[a]??!0,c=typeof s==`number`?s:s?1:0;if(c){let n=gxe[a],o=new W2(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=Dxe[c],o.note=l(n.description),o.url=n.url===!1?void 0:Cxe+t,r(o)}function l(t){return t.replace(Txe,n).replace(Exe,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return xxe(o.charAt(e.startOffset+i))}function r(){return Sxe(o.charCodeAt(e.startOffset))}}}}function yxe(e){return e.replace(wxe,bxe)}function bxe(e){return e.charAt(1).toUpperCase()}function xxe(e){return e==="`"?"` ` `":e}function Sxe(e){return`0x`+e.toString(16).toUpperCase()}var Cxe,wxe,Txe,Exe,Dxe,Oxe,kxe=o((()=>{u1(),W_e(),Gbe(),hxe(),Zbe(),_xe(),Cxe=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,wxe=/-[a-z]/g,Txe=/%c(?:([-+])(\d+))?/g,Exe=/%x/g,Dxe={2:!0,1:!1,0:null},Oxe={}})),Axe=o((()=>{kxe()}));function jxe(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return vxe(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var Mxe=o((()=>{Axe()})),Nxe=o((()=>{Mxe()})),Pxe=o((()=>{})),Q2,Fxe,$2,Ixe=o((()=>{Pxe(),Q2=typeof self==`object`?self:globalThis,Fxe=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new Q2[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new Q2[a](o),i)};return r},$2=e=>Fxe(new Map,e)(0)})),e4,Lxe,Rxe,t4,n4,zxe,r4,Bxe=o((()=>{Pxe(),e4=``,{toString:Lxe}={},{keys:Rxe}=Object,t4=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Lxe.call(e).slice(8,-1);switch(n){case`Array`:return[1,e4];case`Object`:return[2,e4];case`Date`:return[3,e4];case`RegExp`:return[4,e4];case`Map`:return[5,e4];case`Set`:return[6,e4];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},n4=([e,t])=>e===0&&(t===`function`||t===`symbol`),zxe=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=t4(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Rxe(r))(e||!n4(t4(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(n4(t4(n))||n4(t4(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!n4(t4(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},r4=(e,{json:t,lossy:n}={})=>{let r=[];return zxe(!(t||n),!!t,new Map,r)(e),r}})),i4,a4=o((()=>{Ixe(),Bxe(),i4=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?$2(r4(e,t)):structuredClone(e):(e,t)=>$2(r4(e,t))}));function Vxe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=c4(e[n]);return o4(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Hxe(e){return o4(t);function t(t){return t.tagName===e}}function o4(e){return t;function t(t,n,r){return!!(Wxe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Uxe(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Wxe(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var s4,c4,Gxe=o((()=>{s4=(function(e,t,n,r,i){let a=c4(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return Wxe(e)?a.call(i,e,n,r):!1}),c4=(function(e){if(e==null)return Uxe;if(typeof e==`string`)return Hxe(e);if(typeof e==`object`)return Vxe(e);if(typeof e==`function`)return o4(e);throw Error("Expected function, string, or array as `test`")})})),l4=o((()=>{Gxe()})),u4,Kxe=o((()=>{l4(),u4=c4(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`})})),qxe=o((()=>{Kxe()}));function d4(e){return typeof e==`object`?e.type===`text`?Jxe(e.value):!1:Jxe(e)}function Jxe(e){return e.replace(Yxe,``)===``}var Yxe,Xxe=o((()=>{Yxe=/[ \t\n\f\r]/g})),f4=o((()=>{Xxe()}));function Zxe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=m4(e[n]);return p4(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Qxe(e){let t=e;return p4(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function $xe(e){return p4(t);function t(t){return t&&t.type===e}}function p4(e){return t;function t(t,n,r){return!!(tSe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function eSe(){return!0}function tSe(e){return typeof e==`object`&&!!e&&`type`in e}var m4,nSe=o((()=>{m4=(function(e){if(e==null)return eSe;if(typeof e==`function`)return p4(e);if(typeof e==`object`)return Array.isArray(e)?Zxe(e):Qxe(e);if(typeof e==`string`)return $xe(e);throw Error(`Expected function, string, or object as test`)})})),h4=o((()=>{nSe()})),rSe,iSe=o((()=>{rSe=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`)})),aSe,oSe=o((()=>{aSe=[`button`,`input`,`select`,`textarea`]})),sSe,cSe=o((()=>{sSe=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`]}));function lSe(e,t){uSe(e,{collapse:xSe((t||CSe).newlines?ySe:bSe),whitespace:`normal`})}function uSe(e,t){if(`children`in e){let n={...t};return(e.type===`root`||gSe(e))&&(n.before=!0,n.after=!0),n.whitespace=SSe(e,t),fSe(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return dSe(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:g4(e),stripAtStart:!1,remove:!1}}function dSe(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&vSe(n.charAt(0))&&i++,i!==a&&vSe(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function fSe(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=uSe(i[o],{...t,after:pSe(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),hSe(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function pSe(e,t,n){for(;++t<e.length;){let n=e[t],r=mSe(n);if(r===void 0&&`children`in n&&!_Se(n)&&(r=pSe(n.children,-1)),typeof r==`boolean`)return r}return n}function mSe(e){if(e.type===`element`){if(hSe(e))return!1;if(gSe(e))return!0}else if(e.type===`text`){if(!d4(e))return!1}else if(!g4(e))return!1}function hSe(e){return u4(e)||s4(e,aSe)}function gSe(e){return s4(e,rSe)}function _Se(e){return!!(e.type===`element`&&e.properties.hidden)||g4(e)||s4(e,sSe)}function vSe(e){return e===` `||e===`
|
|
130
|
+
`}function ySe(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function bSe(){return` `}function xSe(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function SSe(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}var CSe,g4,wSe=o((()=>{qxe(),l4(),f4(),h4(),iSe(),oSe(),cSe(),CSe={},g4=m4([`comment`,`doctype`])})),TSe=o((()=>{wSe()}));function ESe(e){return function(t){lSe(t,e)}}var DSe=o((()=>{TSe()})),OSe=o((()=>{DSe()}));function kSe(e){return e}var ASe=o((()=>{}));function jSe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=m4(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+kSe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=_4,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=MSe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function MSe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?_4:[e]}var _4,NSe,PSe=o((()=>{h4(),ASe(),_4=[],NSe=`skip`})),FSe=o((()=>{PSe()}));function v4(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),jSe(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var ISe=o((()=>{FSe()})),y4=o((()=>{ISe()}));function LSe(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function RSe(e){let t=x4(e),n=b4(e);if(t&&n)return{start:t,end:n}}var b4,x4,zSe=o((()=>{b4=LSe(`end`),x4=LSe(`start`)})),S4=o((()=>{zSe()}));function BSe(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}var VSe=o((()=>{}));function HSe(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}var USe=o((()=>{}));function WSe(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}var GSe=o((()=>{}));function KSe(e,t){let n={type:`break`};return e.patch(t,n),n}var qSe=o((()=>{})),C4,JSe=o((()=>{h4(),C4=(function(e,t,n){let r=m4(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]})})),YSe=o((()=>{JSe()}));function w4(e,t){let n=t||{},r=`children`in e?e.children:[],i=A4(e),a=tCe(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...QSe(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...XSe(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?D4(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
|
131
|
+
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function XSe(e,t,n){return e.type===`element`?ZSe(e,t,n):e.type===`text`?n.whitespace===`normal`?QSe(e,n):$Se(e):[]}function ZSe(e,t,n){let r=tCe(e,n),i=e.children||[],a=-1,o=[];if(oCe(e))return o;let s,c;for(D4(e)||k4(e)&&C4(t,e,k4)?c=`
|
|
132
|
+
`:aCe(e)?(s=2,c=2):A4(e)&&(s=1,c=1);++a<i.length;)o=o.concat(XSe(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?D4(i[a+1]):c}));return O4(e)&&C4(t,e,O4)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function QSe(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){T4.lastIndex=a;let e=T4.exec(n),i=e&&`index`in e?e.index:n.length;r.push(eCe(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function $Se(e){return[String(e.value)]}function eCe(e,t,n){let r=[],i=0,a;for(;i<e.length;){E4.lastIndex=i;let n=E4.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function tCe(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function nCe(e){return!!(e.properties||{}).hidden}function rCe(e){return e.tagName===`td`||e.tagName===`th`}function iCe(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var T4,E4,D4,O4,aCe,k4,oCe,A4,sCe=o((()=>{YSe(),l4(),T4=/\n/g,E4=/[\t ]+/g,D4=c4(`br`),O4=c4(rCe),aCe=c4(`p`),k4=c4(`tr`),oCe=c4([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,nCe,iCe]),A4=c4(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`))})),j4=o((()=>{sCe()}));function cCe(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var lCe=o((()=>{}));function M4(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===uCe){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:cCe(w4(t))};return e.patch(t,o),o}var uCe,dCe=o((()=>{j4(),lCe(),uCe=`language-`}));function fCe(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}var pCe=o((()=>{}));function N4(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}var mCe=o((()=>{}));function P4(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}var hCe=o((()=>{}));function gCe(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[..._Ce(e,r[i].titles),..._Ce(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:P4(o),children:o};return e.patch(t,n),n}}function _Ce(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,vCe);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:P4(r),children:r}]}function vCe(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var yCe=o((()=>{hCe()}));function F4(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}var bCe=o((()=>{}));function I4(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}var L4=o((()=>{}));function R4(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:I4(e.all(t))};return e.patch(t,n),n}var xCe=o((()=>{L4()}));function SCe(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}var CCe=o((()=>{}));function wCe(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}var TCe=o((()=>{}));function ECe(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}var DCe=o((()=>{}));function z4(e,t){let n={type:`inlineCode`,value:w4(t)};return e.patch(t,n),n}var OCe=o((()=>{j4()}));function kCe(e,t){let n=[],r=[],i=t||e.properties||{},a=ACe(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=w4(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function ACe(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...ACe(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var jCe=o((()=>{j4()}));function MCe(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||NCe:e.options.unchecked||PCe};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=kCe(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var NCe,PCe,FCe=o((()=>{jCe(),NCe=`[x]`,PCe=`[ ]`}));function ICe(e,t){let n=e.type===`element`&&LCe.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var LCe,RCe=o((()=>{LCe={}.hasOwnProperty})),zCe=o((()=>{RCe()}));function BCe(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!VCe.has(String(t[n])))return!1;return!0}var VCe,HCe=o((()=>{VCe=new Set([`pingback`,`prefetch`,`stylesheet`])})),UCe=o((()=>{HCe()}));function WCe(e){return!!(e.type===`text`||GCe(e)||u4(e)||BCe(e)||KCe(e)&&ICe(e,`itemProp`))}var GCe,KCe,qCe=o((()=>{qxe(),zCe(),UCe(),l4(),GCe=c4(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),KCe=c4(`meta`)})),JCe=o((()=>{qCe()}));function B4(e,t){let{rest:n,checkbox:r}=XCe(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:YCe(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function YCe(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(WCe(r))continue;if(r.tagName===`p`||n||YCe(r))return!0;n=!0}}return!1}function XCe(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=XCe(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}var ZCe=o((()=>{JCe()}));function V4(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),QCe),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:P4(r),children:r};return e.patch(t,a),a}function QCe(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var $Ce=o((()=>{hCe()}));function H4(e,t){let n=t||rwe;return ewe(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function ewe(e,t,n){if(nwe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return twe(e.children,t,n)}return Array.isArray(e)?twe(e,t,n):``}function twe(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ewe(e[i],t,n);return r.join(``)}function nwe(e){return!!(e&&typeof e==`object`)}var rwe,iwe=o((()=>{rwe={}})),U4=o((()=>{iwe()})),W4,awe=o((()=>{h4(),W4=m4([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`])})),owe=o((()=>{awe()}));function G4(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!dwe(n)||`children`in n&&G4(n.children))return!0}return!1}function swe(e){return lwe(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?d4(e.value):!1})?[]:[{type:`paragraph`,children:I4(e)}]}}function cwe(e){return lwe(e.children,t,n);function t(t){let n=K4(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=K4(e),r=K4(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function lwe(e,t,n){let r=uwe(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];dwe(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function uwe(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&G4(r.children)?t.push(...cwe(r)):t.push(r)}return t}function dwe(e){let t=e.data&&e.data.hName;return t?WCe({type:`element`,tagName:t,properties:{},children:[]}):W4(e)}function K4(e){return i4({...e,children:[]})}var q4=o((()=>{a4(),JCe(),f4(),owe(),L4()}));function fwe(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(v4({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||G4(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:H4(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}var pwe=o((()=>{U4(),y4(),q4()}));function mwe(e,t){let n=I4(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var hwe=o((()=>{L4()}));function gwe(e,t){let n=e.options.quotes||_we;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}var _we,vwe=o((()=>{_we=[`"`]}));function ywe(e,t){let n=e.all(t);(e.options.document||G4(n))&&(n=swe(n));let r={type:`root`,children:n};return e.patch(t,r),r}var bwe=o((()=>{q4()}));function xwe(e,t){let n=kCe(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}var Swe=o((()=>{jCe()}));function Cwe(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}var wwe=o((()=>{}));function Twe(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}var Ewe=o((()=>{}));function Dwe(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),Owe)};return e.patch(t,n),n}function Owe(){return{type:`tableCell`,children:[]}}var kwe=o((()=>{}));function Awe(e,t){if(e.inTable){let n={type:`text`,value:w4(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=jwe(t),i=e.toSpecificContent(e.all(t),Nwe);r&&i.unshift(Nwe());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,Mwe)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function jwe(e){let t={align:[null],headless:!0},n=0,r=0;return v4(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return NSe;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function Mwe(){return{type:`tableCell`,children:[]}}function Nwe(){return{type:`tableRow`,children:[]}}var Pwe=o((()=>{j4(),y4()}));function Fwe(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}var Iwe=o((()=>{}));function Lwe(e,t){let n={type:`text`,value:w4(t)};return e.patch(t,n),n}var Rwe=o((()=>{j4()}));function zwe(e,t){let n={type:`text`,value:``};return e.patch(t,n),n}var Bwe=o((()=>{}));function J4(e,t){return e.all(t)}function Y4(e,t){return e.toFlow(e.all(t))}function X4(){}var Vwe,Hwe,Uwe=o((()=>{VSe(),USe(),GSe(),qSe(),dCe(),pCe(),mCe(),yCe(),bCe(),xCe(),CCe(),TCe(),DCe(),OCe(),FCe(),ZCe(),$Ce(),pwe(),hwe(),vwe(),bwe(),Swe(),wwe(),Ewe(),kwe(),Pwe(),Iwe(),Rwe(),Bwe(),Vwe={comment:fCe,doctype:X4,root:ywe,text:Fwe},Hwe={applet:X4,area:X4,basefont:X4,bgsound:X4,caption:X4,col:X4,colgroup:X4,command:X4,content:X4,datalist:X4,dialog:X4,element:X4,embed:X4,frame:X4,frameset:X4,isindex:X4,keygen:X4,link:X4,math:X4,menu:X4,menuitem:X4,meta:X4,nextid:X4,noembed:X4,noframes:X4,optgroup:X4,option:X4,param:X4,script:X4,shadow:X4,source:X4,spacer:X4,style:X4,svg:X4,template:X4,title:X4,track:X4,abbr:J4,acronym:J4,bdi:J4,bdo:J4,big:J4,blink:J4,button:J4,canvas:J4,cite:J4,data:J4,details:J4,dfn:J4,font:J4,ins:J4,label:J4,map:J4,marquee:J4,meter:J4,nobr:J4,noscript:J4,object:J4,output:J4,progress:J4,rb:J4,rbc:J4,rp:J4,rt:J4,rtc:J4,ruby:J4,slot:J4,small:J4,span:J4,sup:J4,sub:J4,tbody:J4,tfoot:J4,thead:J4,time:J4,address:Y4,article:Y4,aside:Y4,body:Y4,center:Y4,div:Y4,fieldset:Y4,figcaption:Y4,figure:Y4,form:Y4,footer:Y4,header:Y4,hgroup:Y4,html:Y4,legend:Y4,main:Y4,multicol:Y4,nav:Y4,picture:Y4,section:Y4,a:BSe,audio:fwe,b:Cwe,base:HSe,blockquote:WSe,br:KSe,code:z4,dir:V4,dl:gCe,dt:B4,dd:B4,del:N4,em:F4,h1:R4,h2:R4,h3:R4,h4:R4,h5:R4,h6:R4,hr:SCe,i:F4,iframe:wCe,img:ECe,image:ECe,input:MCe,kbd:z4,li:B4,listing:M4,mark:F4,ol:V4,p:mwe,plaintext:M4,pre:M4,q:gwe,s:N4,samp:z4,select:xwe,strike:N4,strong:Cwe,summary:mwe,table:Awe,td:Twe,textarea:Lwe,th:Twe,tr:Dwe,tt:z4,u:F4,ul:V4,var:z4,video:fwe,wbr:zwe,xmp:M4}}));function Wwe(e){return{all:Gwe,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...Hwe,...e.handlers},inTable:!1,nodeHandlers:{...Vwe,...e.nodeHandlers},one:Kwe,options:e,patch:qwe,qNesting:0,resolve:Jwe,toFlow:Ywe,toSpecificContent:Xwe}}function Gwe(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function Kwe(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(Z4.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(Z4.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function qwe(e,t){e.position&&(t.position=RSe(e))}function Jwe(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function Ywe(e){return swe(e)}function Xwe(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var Z4,Zwe=o((()=>{S4(),Uwe(),q4(),Z4={}.hasOwnProperty}));function Qwe(e,t){let n=i4(e),r=t||$we,i=ESe({newlines:r.newlines===!0}),a=Wwe(r),o;i(n),v4(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},v4(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var $we,eTe=o((()=>{a4(),OSe(),y4(),Zwe(),$we={}})),tTe=o((()=>{eTe()}));function nTe(e,t){return e&&`run`in e?async function(n,r){let i=Qwe(n,{...Q4,...t});await e.run(i,r)}:function(t){return Qwe(t,{...Q4,...e})}}var Q4,rTe=o((()=>{tTe(),Q4={document:!0}})),iTe=o((()=>{rTe()}));function $4(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var aTe=o((()=>{}));function e3(e){return e!==null&&(e<32||e===127)}function t3(e){return e!==null&&e<-2}function n3(e){return e!==null&&(e<0||e===32)}function r3(e){return e===-2||e===-1||e===32}function i3(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var a3,o3,oTe,s3,sTe,cTe,c3,l3,u3=o((()=>{a3=i3(/[A-Za-z]/),o3=i3(/[\dA-Za-z]/),oTe=i3(/[#-'*+\--9=?A-Z^-~]/),s3=i3(/\d/),sTe=i3(/[\dA-Fa-f]/),cTe=i3(/[!-/:-@[-`{-~]/),c3=i3(/\p{P}|\p{S}/u),l3=i3(/\s/)}));function lTe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var uTe=o((()=>{}));function dTe(e,t,n){let r=m4((n||{}).ignore||[]),i=fTe(t),a=-1;for(;++a<i.length;)jSe(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function fTe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([pTe(e[0]),mTe(e[1])])}return t}function pTe(e){return typeof e==`string`?new RegExp(lTe(e),`g`):e}function mTe(e){return typeof e==`function`?e:function(){return e}}var hTe=o((()=>{uTe(),FSe(),h4()})),gTe=o((()=>{hTe()}));function _Te(){return{transforms:[wTe],enter:{literalAutolink:yTe,literalAutolinkEmail:d3,literalAutolinkHttp:d3,literalAutolinkWww:d3},exit:{literalAutolink:CTe,literalAutolinkEmail:STe,literalAutolinkHttp:bTe,literalAutolinkWww:xTe}}}function vTe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:f3,notInConstruct:p3},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:f3,notInConstruct:p3},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:f3,notInConstruct:p3}]}}function yTe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function d3(e){this.config.enter.autolinkProtocol.call(this,e)}function bTe(e){this.config.exit.autolinkProtocol.call(this,e)}function xTe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function STe(e){this.config.exit.autolinkEmail.call(this,e)}function CTe(e){this.exit(e)}function wTe(e){dTe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,TTe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ETe]],{ignore:[`link`,`linkReference`]})}function TTe(e,t,n,r,i){let a=``;if(!kTe(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!DTe(n)))return!1;let o=OTe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function ETe(e,t,n,r){return!kTe(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function DTe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function OTe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=$4(e,`(`),a=$4(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function kTe(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||l3(n)||c3(n))&&(!t||n!==47)}var f3,p3,ATe=o((()=>{aTe(),u1(),u3(),gTe(),f3=`phrasing`,p3=[`autolink`,`link`,`image`,`label`]})),jTe=o((()=>{ATe()}));function m3(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var h3=o((()=>{}));function MTe(){this.buffer()}function NTe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function PTe(){this.buffer()}function FTe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ITe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=m3(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LTe(e){this.exit(e)}function RTe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=m3(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zTe(e){this.exit(e)}function BTe(){return`[`}function VTe(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function HTe(){return{enter:{gfmFootnoteCallString:MTe,gfmFootnoteCall:NTe,gfmFootnoteDefinitionLabelString:PTe,gfmFootnoteDefinition:FTe},exit:{gfmFootnoteCallString:ITe,gfmFootnoteCall:LTe,gfmFootnoteDefinitionLabelString:RTe,gfmFootnoteDefinition:zTe}}}function UTe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VTe},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
133
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?GTe:WTe))),s(),o}}function WTe(e,t,n){return t===0?e:GTe(e,t,n)}function GTe(e,t,n){return(n?``:` `)+e}var KTe=o((()=>{u1(),h3(),VTe.peek=BTe})),qTe=o((()=>{KTe()}));function JTe(){return{canContainEols:[`delete`],enter:{strikethrough:XTe},exit:{strikethrough:ZTe}}}function YTe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:eEe}],handlers:{delete:QTe}}}function XTe(e){this.enter({type:`delete`,children:[]},e)}function ZTe(e){this.exit(e)}function QTe(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function $Te(){return`~`}var eEe,tEe=o((()=>{eEe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],QTe.peek=$Te})),nEe=o((()=>{tEe()}));function rEe(e){return e.length}function iEe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rEe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=aEe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=oEe(r[d]);else{let e=oEe(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
134
|
+
`)}function aEe(e){return e==null?``:String(e)}function oEe(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var sEe=o((()=>{}));function cEe(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&g3.call(t,e)){let n=String(t[e]);i=g3.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var g3,lEe=o((()=>{g3={}.hasOwnProperty}));function uEe(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)uEe(e,t.extensions[n]);for(r in t)if(pEe.call(t,r))switch(r){case`extensions`:break;case`unsafe`:dEe(e[r],t[r]);break;case`join`:dEe(e[r],t[r]);break;case`handlers`:fEe(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function dEe(e,t){t&&e.push(...t)}function fEe(e,t){t&&Object.assign(e,t)}var pEe,mEe=o((()=>{pEe={}.hasOwnProperty}));function hEe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),gEe);return i(),o}function gEe(e,t,n){return`>`+(n?``:` `)+e}var _Ee=o((()=>{}));function vEe(e,t){return yEe(e,t.inConstruct,!0)&&!yEe(e,t.notInConstruct,!1)}function yEe(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}var bEe=o((()=>{}));function xEe(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
135
|
+
`&&vEe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
136
|
+
`}var SEe=o((()=>{bEe()}));function CEe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}var wEe=o((()=>{}));function _3(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var TEe=o((()=>{}));function EEe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var DEe=o((()=>{}));function OEe(e,t,n,r){let i=EEe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(_3(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,kEe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(CEe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
137
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
138
|
+
`),a&&(u+=s.move(a+`
|
|
139
|
+
`)),u+=s.move(c),l(),u}function kEe(e,t,n){return(n?``:` `)+e}var AEe=o((()=>{wEe(),TEe(),DEe()}));function v3(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var y3=o((()=>{}));function jEe(e,t,n,r){let i=v3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
140
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}var MEe=o((()=>{y3()}));function NEe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var PEe=o((()=>{}));function b3(e){return`&#x`+e.toString(16).toUpperCase()+`;`}var x3=o((()=>{}));function S3(e){if(e===null||n3(e)||l3(e))return 1;if(c3(e))return 2}var C3=o((()=>{u3()}));function w3(e,t,n){let r=S3(e),i=S3(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var FEe=o((()=>{C3()}));function IEe(e,t,n,r){let i=NEe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=w3(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=b3(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=w3(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+b3(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function LEe(e,t,n){return n.options.emphasis||`*`}var REe=o((()=>{PEe(),x3(),FEe(),IEe.peek=LEe}));function zEe(e,t){let n=!1;return v4(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&H4(e)&&(t.options.setext||n))}var BEe=o((()=>{y4(),U4()}));function VEe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(zEe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
141
|
+
`,after:`
|
|
142
|
+
`});return r(),t(),o+`
|
|
143
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
144
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
145
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=b3(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}var HEe=o((()=>{x3(),BEe()}));function UEe(e){return e.value||``}function WEe(){return`<`}var GEe=o((()=>{UEe.peek=WEe}));function KEe(e,t,n,r){let i=v3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function qEe(){return`!`}var JEe=o((()=>{y3(),KEe.peek=qEe}));function YEe(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function XEe(){return`!`}var ZEe=o((()=>{YEe.peek=XEe}));function QEe(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function $Ee(){return"`"}var eDe=o((()=>{QEe.peek=$Ee}));function tDe(e,t){let n=H4(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var nDe=o((()=>{U4()}));function rDe(e,t,n,r){let i=v3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(tDe(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function iDe(e,t,n){return tDe(e,n)?`<`:`[`}var aDe=o((()=>{y3(),nDe(),rDe.peek=iDe}));function oDe(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function sDe(){return`[`}var cDe=o((()=>{oDe.peek=sDe}));function T3(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var E3=o((()=>{}));function lDe(e){let t=T3(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}var uDe=o((()=>{E3()}));function dDe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var fDe=o((()=>{}));function pDe(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var mDe=o((()=>{}));function hDe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?dDe(n):T3(n),s=e.ordered?o===`.`?`)`:`.`:lDe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),pDe(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}var gDe=o((()=>{E3(),uDe(),fDe(),mDe()}));function _De(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var vDe=o((()=>{}));function yDe(e,t,n,r){let i=_De(n),a=n.bulletCurrent||T3(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}var bDe=o((()=>{E3(),vDe()}));function xDe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var SDe=o((()=>{}));function CDe(e,t,n,r){return(e.children.some(function(e){return W4(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}var wDe=o((()=>{owe()}));function TDe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var EDe=o((()=>{}));function DDe(e,t,n,r){let i=TDe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=w3(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=b3(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=w3(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+b3(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ODe(e,t,n){return n.options.strong||`*`}var kDe=o((()=>{EDe(),x3(),FEe(),DDe.peek=ODe}));function ADe(e,t,n,r){return n.safe(e.value,r)}var jDe=o((()=>{}));function MDe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var NDe=o((()=>{}));function PDe(e,t,n){let r=(pDe(n)+(n.options.ruleSpaces?` `:``)).repeat(MDe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var FDe=o((()=>{NDe(),mDe()})),D3,IDe=o((()=>{_Ee(),SEe(),AEe(),MEe(),REe(),HEe(),GEe(),JEe(),ZEe(),eDe(),aDe(),cDe(),gDe(),bDe(),SDe(),wDe(),kDe(),jDe(),FDe(),D3={blockquote:hEe,break:xEe,code:OEe,definition:jEe,emphasis:IEe,hardBreak:xEe,heading:VEe,html:UEe,image:KEe,imageReference:YEe,inlineCode:QEe,link:rDe,linkReference:oDe,list:hDe,listItem:yDe,paragraph:xDe,root:CDe,strong:DDe,text:ADe,thematicBreak:PDe}}));function LDe(e,t,n,r){if(t.type===`code`&&_3(t,r)&&(e.type===`list`||e.type===t.type&&_3(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&zEe(t,r))?void 0:n.spread?1:0}var RDe,zDe=o((()=>{TEe(),BEe(),RDe=[LDe]})),O3,BDe,VDe=o((()=>{O3=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],BDe=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
146
|
+
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:O3},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
147
|
+
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:O3},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
148
|
+
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:O3},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
149
|
+
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
150
|
+
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
151
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:O3},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:O3},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:O3},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:O3},{atBreak:!0,character:`~`}]}));function k3(e){let t=`&`+e+`;`;A3.innerHTML=t;let n=A3.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}var A3,j3=o((()=>{A3=document.createElement(`i`)}));function HDe(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var UDe=o((()=>{}));function WDe(e){return e.replace(KDe,GDe)}function GDe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return HDe(n.slice(t?2:1),t?16:10)}return k3(n)||e}var KDe,qDe=o((()=>{j3(),UDe(),KDe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi}));function JDe(e){return e.label||!e.identifier?e.label||``:WDe(e.identifier)}var YDe=o((()=>{qDe()}));function XDe(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}var ZDe=o((()=>{}));function QDe(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
152
|
+
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=b3(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+b3(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}var $De=o((()=>{x3()}));function eOe(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
153
|
+
`,after:`
|
|
154
|
+
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(tOe(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function tOe(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
155
|
+
`.repeat(1+a);if(a===!1)return`
|
|
156
|
+
|
|
157
|
+
<!---->
|
|
158
|
+
|
|
159
|
+
`}return`
|
|
160
|
+
|
|
161
|
+
`}var nOe=o((()=>{}));function rOe(e,t){let n=[],r=0,i=0,a;for(;a=iOe.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}var iOe,aOe=o((()=>{iOe=/\r?\n|\r/g}));function oOe(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!vEe(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(sOe);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(cOe(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(b3(r.charCodeAt(e))),c++))}return a.push(cOe(r.slice(c,l),n.after)),a.join(``)}function sOe(e,t){return e-t}function cOe(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}var lOe=o((()=>{x3(),bEe()}));function uOe(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}var dOe=o((()=>{}));function fOe(e,t){let n=t||{},r={associationId:JDe,containerPhrasing:gOe,containerFlow:_Oe,createTracker:uOe,compilePattern:XDe,enter:a,handlers:{...D3},handle:void 0,indentLines:rOe,indexStack:[],join:[...RDe],options:{},safe:vOe,stack:[],unsafe:[...BDe]};uEe(r,n),r.options.tightDefinitions&&r.join.push(hOe),r.handle=cEe(`type`,{invalid:pOe,unknown:mOe,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
162
|
+
`,after:`
|
|
163
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
164
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function pOe(e){throw Error("Cannot handle value `"+e+"`, expected node")}function mOe(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function hOe(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function gOe(e,t){return QDe(e,this,t)}function _Oe(e,t){return eOe(e,this,t)}function vOe(e,t){return oOe(this,e,t)}var yOe=o((()=>{lEe(),mEe(),IDe(),zDe(),VDe(),YDe(),ZDe(),$De(),nOe(),aOe(),lOe(),dOe()})),M3=o((()=>{yOe(),IDe()}));function bOe(){return{enter:{table:xOe,tableData:wOe,tableHeader:wOe,tableRow:COe},exit:{codeText:TOe,table:SOe,tableData:N3,tableHeader:N3,tableRow:N3}}}function xOe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function SOe(e){this.exit(e),this.data.inTable=void 0}function COe(e){this.enter({type:`tableRow`,children:[]},e)}function N3(e){this.exit(e)}function wOe(e){this.enter({type:`tableCell`,children:[]},e)}function TOe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,EOe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function EOe(e,t){return t===`|`?t:e}function DOe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
165
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
166
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return iEe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=D3.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var OOe=o((()=>{u1(),sEe(),M3()})),kOe=o((()=>{OOe()}));function AOe(){return{exit:{taskListCheckValueChecked:MOe,taskListCheckValueUnchecked:MOe,paragraph:NOe}}}function jOe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:POe}}}function MOe(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function NOe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function POe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=D3.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var FOe=o((()=>{u1(),M3()})),IOe=o((()=>{FOe()}));function LOe(){return[_Te(),HTe(),JTe(),bOe(),AOe()]}function ROe(e){return{extensions:[vTe(),UTe(e),YTe(),DOe(e),jOe()]}}var zOe=o((()=>{jTe(),qTe(),nEe(),kOe(),IOe()})),BOe=o((()=>{zOe()}));function P3(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function F3(e,t){return e.length>0?(P3(e,e.length,0,t),e):t}var I3=o((()=>{}));function VOe(e){let t={},n=-1;for(;++n<e.length;)HOe(t,e[n]);return t}function HOe(e,t){let n;for(n in t){let r=(L3.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){L3.call(r,a)||(r[a]=[]);let e=i[a];UOe(r[a],Array.isArray(e)?e:e?[e]:[])}}}function UOe(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);P3(e,0,0,r)}var L3,WOe=o((()=>{I3(),L3={}.hasOwnProperty}));function GOe(){return{text:K3}}function KOe(e,t,n){let r=this,i,a;return o;function o(t){return!R3(t)||!nke.call(r,r.previous)||z3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return R3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ike,u,l)(t):t===45||t===95||o3(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&a3(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function qOe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!eke.call(r,r.previous)||z3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(rke,e.attempt(B3,e.attempt(V3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function JOe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&tke.call(r,r.previous)&&!z3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(a3(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||e3(t)||n3(t)||l3(t)||c3(t)?n(t):e.attempt(B3,e.attempt(V3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function YOe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function XOe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(H3,c,s)(t):t===null||n3(t)||l3(t)||t!==45&&c3(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function ZOe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(H3,t,a)(o):o===null||n3(o)||l3(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function QOe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||n3(o)||l3(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||n3(e)||l3(e)?t(e):r(e)}function a(e){return a3(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):a3(t)?(e.consume(t),o):n(t)}}function $Oe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return o3(e)?n(e):t(e)}}function eke(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||n3(e)}function tke(e){return!a3(e)}function nke(e){return!(e===47||R3(e))}function R3(e){return e===43||e===45||e===46||e===95||o3(e)}function z3(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var rke,B3,V3,H3,ike,U3,W3,G3,K3,q3,ake=o((()=>{for(u3(),rke={tokenize:YOe,partial:!0},B3={tokenize:XOe,partial:!0},V3={tokenize:ZOe,partial:!0},H3={tokenize:QOe,partial:!0},ike={tokenize:$Oe,partial:!0},U3={name:`wwwAutolink`,tokenize:qOe,previous:eke},W3={name:`protocolAutolink`,tokenize:JOe,previous:tke},G3={name:`emailAutolink`,tokenize:KOe,previous:nke},K3={},q3=48;q3<123;)K3[q3]=G3,q3++,q3===58?q3=65:q3===91&&(q3=97);K3[43]=G3,K3[45]=G3,K3[46]=G3,K3[95]=G3,K3[72]=[G3,W3],K3[104]=[G3,W3],K3[87]=[G3,U3],K3[119]=[G3,U3]}));function J3(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&o3(e.charCodeAt(n+1))&&o3(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var Y3=o((()=>{u3()})),oke=o((()=>{ake()}));function X3(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Z3=o((()=>{}));function ske(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};lke(d,-c),lke(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=F3(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=F3(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=F3(l,X3(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=F3(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=F3(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,P3(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function cke(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=S3(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=S3(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function lke(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Q3,uke=o((()=>{I3(),C3(),Z3(),Q3={name:`attention`,resolveAll:ske,tokenize:cke}}));function dke(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return a3(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||o3(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||o3(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||e3(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):oTe(t)?(e.consume(t),l):n(t)}function u(e){return o3(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||o3(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var fke,pke=o((()=>{u3(),fke={name:`autolink`,tokenize:dke}}));function $3(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return r3(r)?(e.enter(n),s(r)):t(r)}function s(r){return r3(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var e6=o((()=>{u3()}));function mke(e,t,n){return r;function r(t){return r3(t)?$3(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||t3(e)?t(e):n(e)}}var t6,n6=o((()=>{e6(),u3(),t6={partial:!0,tokenize:mke}}));function hke(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return r3(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function gke(e,t,n){let r=this;return i;function i(t){return r3(t)?$3(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(r6,t,n)(r)}}function _ke(e){e.exit(`blockQuote`)}var r6,vke=o((()=>{e6(),u3(),r6={continuation:{tokenize:gke},exit:_ke,name:`blockQuote`,tokenize:hke}}));function yke(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return cTe(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var i6,bke=o((()=>{u3(),i6={name:`characterEscape`,tokenize:yke}}));function xke(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=o3,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=sTe,u):(e.enter(`characterReferenceValue`),a=7,o=s3,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===o3&&!k3(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var a6,Ske=o((()=>{j3(),u3(),a6={name:`characterReference`,tokenize:xke}}));function Cke(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),r3(t)?$3(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||t3(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(o6,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||t3(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):r3(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$3(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||t3(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||t3(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&r3(t)?$3(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||t3(t)?e.check(o6,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||t3(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),r3(t)?$3(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),r3(t)?$3(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||t3(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function wke(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var o6,s6,Tke=o((()=>{e6(),u3(),o6={partial:!0,tokenize:wke},s6={concrete:!0,name:`codeFenced`,tokenize:Cke}}));function Eke(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$3(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):t3(t)?e.attempt(Oke,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||t3(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Dke(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):t3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$3(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):t3(e)?i(e):n(e)}}var c6,Oke,kke=o((()=>{e6(),u3(),c6={name:`codeIndented`,tokenize:Eke},Oke={partial:!0,tokenize:Dke}}));function Ake(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function jke(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Mke(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):t3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||t3(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Nke,Pke=o((()=>{u3(),Nke={name:`codeText`,previous:jke,resolve:Ake,tokenize:Mke}}));function l6(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}var Fke,Ike=o((()=>{Fke=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&l6(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),l6(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),l6(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);l6(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);l6(this.left,t.reverse())}}}}));function Lke(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Fke(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Rke(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return P3(e,0,1/0,u.slice(0)),!l}function Rke(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var zke=o((()=>{I3(),Ike()}));function Bke(e){return Lke(e),e}function Vke(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):t3(t)?e.check(Wke,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Hke(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$3(e,a,`linePrefix`)}function a(i){if(i===null||t3(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}var Uke,Wke,Gke=o((()=>{e6(),u3(),zke(),Uke={resolve:Bke,tokenize:Vke},Wke={partial:!0,tokenize:Hke}}));function Kke(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||e3(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||t3(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||n3(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||e3(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}var qke=o((()=>{u3()}));function Jke(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):t3(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||t3(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!r3(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}var Yke=o((()=>{u3()}));function Xke(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):t3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$3(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||t3(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}var Zke=o((()=>{e6(),u3()}));function u6(e,t){let n;return r;function r(i){return t3(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):r3(i)?$3(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Qke=o((()=>{e6(),u3()}));function $ke(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Jke.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=m3(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return n3(t)?u6(e,l)(t):l(t)}function l(t){return Kke(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(nAe,d,d)(t)}function d(t){return r3(t)?$3(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||t3(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function eAe(e,t,n){return r;function r(t){return n3(t)?u6(e,i)(t):n(t)}function i(t){return Xke(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return r3(t)?$3(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||t3(e)?t(e):n(e)}}var tAe,nAe,rAe=o((()=>{qke(),Yke(),e6(),Zke(),Qke(),u3(),h3(),tAe={name:`definition`,tokenize:$ke},nAe={partial:!0,tokenize:eAe}}));function iAe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return t3(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var aAe,oAe=o((()=>{u3(),aAe={name:`hardBreakEscape`,tokenize:iAe}}));function sAe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},P3(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function cAe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||n3(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||t3(n)?(e.exit(`atxHeading`),t(n)):r3(n)?$3(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||n3(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var lAe,uAe=o((()=>{e6(),u3(),I3(),lAe={name:`headingAtx`,resolve:sAe,tokenize:cAe}})),dAe,d6,fAe=o((()=>{dAe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),d6=[`pre`,`script`,`style`,`textarea`]}));function pAe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function mAe(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):a3(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):a3(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return a3(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||n3(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&d6.includes(l)?(i=1,r.interrupt?t(s):O(s)):dAe.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||o3(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return r3(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||a3(t)?(e.consume(t),b):r3(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||o3(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):r3(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):r3(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||t3(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||n3(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||r3(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||t3(t)?O(t):r3(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),ne):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):t3(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(vAe,oe,ee)(t)):t===null||t3(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(yAe,k,oe)(t)}function k(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||t3(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),j):O(t)}function ne(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return d6.includes(n)?(e.consume(t),ae):O(t)}return a3(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):O(t)}function ae(t){return t===null||t3(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function hAe(e,t,n){let r=this;return i;function i(t){return t3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function gAe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(t6,t,n)}}var _Ae,vAe,yAe,bAe=o((()=>{u3(),fAe(),n6(),_Ae={concrete:!0,name:`htmlFlow`,resolveTo:pAe,tokenize:mAe},vAe={partial:!0,tokenize:gAe},yAe={partial:!0,tokenize:hAe}}));function xAe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):a3(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):a3(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):t3(t)?(o=d,ne(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):t3(t)?(o=h,ne(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):t3(t)?(o=v,ne(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):t3(t)?(o=y,ne(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return a3(t)?(e.consume(t),S):n(t)}function S(t){return t===45||o3(t)?(e.consume(t),S):C(t)}function C(t){return t3(t)?(o=C,ne(t)):r3(t)?(e.consume(t),C):te(t)}function w(t){return t===45||o3(t)?(e.consume(t),w):t===47||t===62||n3(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||a3(t)?(e.consume(t),E):t3(t)?(o=T,ne(t)):r3(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||o3(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):t3(t)?(o=D,ne(t)):r3(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):t3(t)?(o=O,ne(t)):r3(t)?(e.consume(t),O):(e.consume(t),k)}function ee(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):t3(t)?(o=ee,ne(t)):(e.consume(t),ee)}function k(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||n3(t)?T(t):(e.consume(t),k)}function A(e){return e===47||e===62||n3(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ne(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return r3(t)?$3(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var SAe,CAe=o((()=>{e6(),u3(),SAe={name:`htmlText`,tokenize:xAe}}));function wAe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&P3(e,0,e.length,n),e}function TAe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=F3(s,e.slice(a+1,a+r+3)),s=F3(s,[[`enter`,u,t]]),s=F3(s,X3(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=F3(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=F3(s,e.slice(o+1)),s=F3(s,[[`exit`,c,t]]),P3(e,a,e.length,s),e}function EAe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(m3(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(AAe,u,o?u:d)(t):t===91?e.attempt(jAe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(MAe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function DAe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return n3(t)?u6(e,a)(t):a(t)}function a(t){return t===41?u(t):Kke(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return n3(t)?u6(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Xke(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return n3(t)?u6(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function OAe(e,t,n){let r=this;return i;function i(t){return Jke.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(m3(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function kAe(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var f6,AAe,jAe,MAe,p6=o((()=>{qke(),Yke(),Zke(),Qke(),u3(),I3(),h3(),Z3(),f6={name:`labelEnd`,resolveAll:wAe,resolveTo:TAe,tokenize:EAe},AAe={tokenize:DAe},jAe={tokenize:OAe},MAe={tokenize:kAe}}));function NAe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var PAe,FAe=o((()=>{p6(),PAe={name:`labelStartImage`,resolveAll:f6.resolveAll,tokenize:NAe}}));function IAe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var LAe,RAe=o((()=>{p6(),LAe={name:`labelStartLink`,resolveAll:f6.resolveAll,tokenize:IAe}}));function zAe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$3(e,t,`linePrefix`)}}var m6,BAe=o((()=>{e6(),m6={name:`lineEnding`,tokenize:zAe}}));function VAe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||t3(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),r3(t)?$3(e,s,`whitespace`)(t):s(t))}}var h6,HAe=o((()=>{e6(),u3(),h6={name:`thematicBreak`,tokenize:VAe}}));function UAe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:s3(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(h6,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return s3(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(t6,r.interrupt?n:u,e.attempt(JAe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return r3(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function WAe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(t6,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$3(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!r3(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(YAe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$3(e,e.attempt(g6,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function GAe(e,t,n){let r=this;return $3(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function KAe(e){e.exit(this.containerState.type)}function qAe(e,t,n){let r=this;return $3(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!r3(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var g6,JAe,YAe,XAe=o((()=>{e6(),u3(),n6(),HAe(),g6={continuation:{tokenize:WAe},exit:KAe,name:`list`,tokenize:UAe},JAe={partial:!0,tokenize:qAe},YAe={partial:!0,tokenize:GAe}}));function ZAe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function QAe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),r3(t)?$3(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||t3(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var _6,$Ae=o((()=>{e6(),u3(),_6={name:`setextUnderline`,resolveTo:ZAe,tokenize:QAe}})),v6=o((()=>{uke(),pke(),n6(),vke(),bke(),Ske(),Tke(),kke(),Pke(),Gke(),rAe(),oAe(),uAe(),bAe(),CAe(),p6(),FAe(),RAe(),BAe(),XAe(),$Ae(),HAe()}));function eje(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ije,continuation:{tokenize:aje},exit:oje}},text:{91:{name:`gfmFootnoteCall`,tokenize:rje},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tje,resolveTo:nje}}}}function tje(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=m3(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function nje(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function rje(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||n3(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(m3(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return n3(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ije(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||n3(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=m3(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return n3(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$3(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function aje(e,t,n){return e.check(t6,t,e.attempt(cje,t,n))}function oje(e){e.exit(`gfmFootnoteDefinition`)}function sje(e,t,n){let r=this;return $3(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}var cje,lje=o((()=>{v6(),e6(),u3(),h3(),cje={tokenize:sje,partial:!0}})),uje=o((()=>{lje()}));function dje(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&P3(o,o.length,0,X3(s,e.slice(r+1,n),t)),P3(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),P3(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=S3(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=S3(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var fje=o((()=>{I3(),C3(),Z3()})),pje=o((()=>{fje()}));function mje(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}var hje,gje=o((()=>{hje=class{constructor(){this.map=[]}add(e,t,n){mje(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}}));function _je(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}var vje=o((()=>{}));function yje(){return{flow:{null:{name:`table`,tokenize:bje,resolveAll:xje}}}}function bje(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):t3(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):r3(t)?$3(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||n3(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,r3(t)?$3(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return r3(t)?$3(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||t3(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return r3(t)?$3(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||t3(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||t3(n)?(e.exit(`tableRow`),t(n)):r3(n)?$3(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||n3(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function xje(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new hje;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Sje(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=y6(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=y6(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=y6(f,t,o,i,n,d)):(o[0]=o[1],d=y6(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Sje(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=_je(t.events,n))}return e}function y6(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},b6(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=b6(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=b6(t.events,n[2]),a=b6(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},b6(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Sje(e,t,n,r,i){let a=[],o=b6(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function b6(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Cje=o((()=>{e6(),u3(),gje(),vje()})),wje=o((()=>{Cje()}));function Tje(){return{text:{91:Oje}}}function Eje(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return n3(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return t3(r)?t(r):r3(r)?e.check({tokenize:Dje},t,n)(r):n(r)}}function Dje(e,t,n){return $3(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}var Oje,kje=o((()=>{e6(),u3(),Oje={name:`tasklistCheck`,tokenize:Eje}})),Aje=o((()=>{kje()}));function jje(e){return VOe([GOe(),eje(),dje(e),yje(),Tje()])}var Mje=o((()=>{WOe(),oke(),uje(),pje(),wje(),Aje()}));function Nje(e){let t=this,n=e||Pje,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(jje(n)),a.push(LOe()),o.push(ROe(n))}var Pje,Fje=o((()=>{BOe(),Mje(),Pje={}})),Ije=o((()=>{Fje()}));function Lje(e){let t=this;t.compiler=n;function n(n){return fOe(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}var Rje=o((()=>{M3()})),zje=o((()=>{Rje()}));function Bje(e){if(e)throw e}var Vje=o((()=>{})),Hje=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function x6(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var Uje=o((()=>{}));function Wje(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Gje(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Gje(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Kje=o((()=>{})),qje=o((()=>{Kje()})),Jje,Yje=o((()=>{Jje=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r})}));function S6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function C6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function w6(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Xje(e){if(!x6(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Zje(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function T6(e){return Qje(e)?e:new Z2(e)}function Qje(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $je(e){return typeof e==`string`||eMe(e)}function eMe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var E6,tMe,nMe,D6,rMe=o((()=>{Vje(),E6=u(Hje(),1),u1(),Uje(),qje(),hxe(),Yje(),tMe={}.hasOwnProperty,nMe=class e extends Jje{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Wje()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,E6.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(w6(`data`,this.frozen),this.namespace[e]=t,this):tMe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(w6(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=T6(e),n=this.parser||this.Parser;return S6(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),S6(`process`,this.parser||this.Parser),C6(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=T6(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$je(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),S6(`processSync`,this.parser||this.Parser),C6(`processSync`,this.compiler||this.Compiler),this.process(e,r),Zje(`processSync`,`process`,t),n;function r(e,r){t=!0,Bje(e),n=r}}run(e,t,n){Xje(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=T6(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Zje(`runSync`,`run`,n),r;function i(e,t){Bje(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=T6(t),r=this.compiler||this.Compiler;return C6(`stringify`,r),Xje(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(w6(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,E6.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];x6(o)&&x6(r)&&(r=(0,E6.default)(!0,o,r)),n[i]=[e,r,...a]}}}},D6=new nMe().freeze()})),iMe=o((()=>{rMe()}));function aMe(e,t){return oMe(e,t||{})||{type:`root`,children:[]}}function oMe(e,t){let n=sMe(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function sMe(e,t){switch(e.nodeType){case 1:return fMe(e,t);case 3:return uMe(e);case 8:return dMe(e);case 9:return cMe(e,t);case 10:return lMe();case 11:return cMe(e,t);default:return}}function cMe(e,t){return{type:`root`,children:pMe(e,t)}}function lMe(){return{type:`doctype`}}function uMe(e){return{type:`text`,value:e.nodeValue||``}}function dMe(e){return{type:`comment`,value:e.nodeValue||``}}function fMe(e,t){let n=e.namespaceURI,r=n===u0.svg?s0:o0,i=n===u0.html?e.tagName.toLowerCase():e.tagName,a=n===u0.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,pMe(a,t))}function pMe(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=oMe(n[i],t);e!==void 0&&r.push(e)}return r}var mMe=o((()=>{c0(),d0()})),hMe=o((()=>{mMe()}));function gMe(e){let t=Array.from(e.classList).filter(e=>!e.startsWith(`bn-`))||[];t.length>0?e.className=t.join(` `):e.removeAttribute(`class`)}function _Me(e,t,n,r){let i;if(t)if(typeof t==`string`)i=dX([t],e.pmSchema);else if(Array.isArray(t))i=dX(t,e.pmSchema);else if(t.type===`tableContent`)i=fX(t,e.pmSchema);else throw new gX(t.type);else throw Error(`blockContent is required`);let a=(r?.document??document).createDocumentFragment();for(let t of i)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let i=e.schema.inlineContentSpecs[t.type.name].implementation;if(i){let o=ZY(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=i.toExternalHTML?i.toExternalHTML(o,e):i.render.call({renderType:`dom`,props:void 0},o,()=>{},e);if(s){if(a.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,r);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=(e.schema.styleSpecs[r.type.name].implementation.toExternalHTML??e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=pj.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}a.appendChild(n)}else{let e=n.serializeFragment(R.from([t]),r);a.appendChild(e)}return a.childNodes.length===1&&a.firstChild?.nodeType===1&&gMe(a.firstChild),a}function vMe(e,t,n,r,i,a,o,s){var c,l;let u=s?.document??document,d=t.pmSchema.nodes.blockContainer,f=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))!(e in f)&&r.default!==void 0&&(f[e]=r.default);let p=((c=d.spec)?.toDOM)?.call(c,d.create({id:n.id,...f})),m=Array.from(p.dom.attributes),h=t.blockImplementations[n.type].implementation,g=h.toExternalHTML?.call({},{...n,props:f},t,{nestingLevel:o})||h.render.call({},{...n,props:f},t),_=u.createDocumentFragment();if(g.dom.classList.contains(`bn-block-content`)){let e=[...m,...Array.from(g.dom.attributes)].filter(e=>e.name.startsWith(`data`)&&e.name!==`data-content-type`&&e.name!==`data-file-block`&&e.name!==`data-node-view-wrapper`&&e.name!==`data-node-type`&&e.name!==`data-id`&&e.name!==`data-editable`);for(let t of e)g.dom.firstChild.setAttribute(t.name,t.value);gMe(g.dom.firstChild),o>0&&g.dom.firstChild.setAttribute(`data-nesting-level`,o.toString()),_.append(...Array.from(g.dom.childNodes))}else _.append(g.dom),o>0&&g.dom.setAttribute(`data-nesting-level`,o.toString());if(g.contentDOM&&n.content){let e=_Me(t,n.content,r,s);g.contentDOM.appendChild(e)}let v;if(i.has(n.type)?v=`OL`:a.has(n.type)&&(v=`UL`),v){if(e.lastChild?.nodeName!==v){let t=u.createElement(v);v===`OL`&&`start`in f&&f.start&&f?.start!==1&&t.setAttribute(`start`,f.start+``),e.append(t)}e.lastChild.appendChild(_)}else e.append(_);if(n.children&&n.children.length>0){let c=u.createDocumentFragment();if(M6(c,t,n.children,r,i,a,o+1,s),e.lastChild?.nodeName===`UL`||e.lastChild?.nodeName===`OL`)for(;c.firstChild?.nodeName===`UL`||c.firstChild?.nodeName===`OL`;)e.lastChild.lastChild.appendChild(c.firstChild);`childrenDOM`in g&&g.childrenDOM?g.childrenDOM.append(c):t.pmSchema.nodes[n.type].isInGroup(`blockContent`)?e.append(c):(l=g.contentDOM)==null||l.append(c)}}function yMe(e,t){if(t===0)return;let n=e.resolve(t);for(let e=n.depth;e>0;e--){let t=n.node(e);if(JZ(t))return t.attrs.id}}function bMe(e){return e.getMeta(`paste`)?{type:`paste`}:e.getMeta(`uiEvent`)===`drop`?{type:`drop`}:e.getMeta(`history$`)?{type:e.getMeta(`history$`).redo?`redo`:`undo`}:e.getMeta(`y-sync$`)?e.getMeta(`y-sync$`).isUndoRedoOperation?{type:`undo-redo`}:{type:`yjs-remote`}:{type:`local`}}function xMe(e){let t={},n={},r=HY(e);return e.descendants((i,a)=>{if(!JZ(i))return!0;let o=yMe(e,a),s=o??`__root__`;n[s]||(n[s]=[]);let c=QY(i,r);return t[i.attrs.id]={block:c,parentId:o},n[s].push(i.attrs.id),!0}),{byId:t,childrenByParent:n}}function SMe(e,t){let n=new Set;if(!e||!t)return n;let r=new Set(e),i=t.filter(e=>r.has(e)),a=e.filter(e=>i.includes(e));if(a.length<=1||i.length<=1)return n;let o={};for(let e=0;e<a.length;e++)o[a[e]]=e;let s=i.map(e=>o[e]),c=s.length,l=[],u=[],d=Array(c).fill(-1),f=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n};for(let e=0;e<c;e++){let t=s[e],n=f(l,t);n>0&&(d[e]=u[n-1]),n===l.length?(l.push(t),u.push(e)):(l[n]=t,u[n]=e)}let p=new Set,m=u[u.length-1]??-1;for(;m!==-1;)p.add(m),m=d[m];for(let e=0;e<i.length;e++)p.has(e)||n.add(i[e]);return n}function CMe(e,t=[]){let n=bMe(e),r=AK(e.before,[e,...t]),i=xMe(r.before),a=xMe(r.doc),o=[],s=new Set;Object.keys(a.byId).filter(e=>!(e in i.byId)).forEach(e=>{o.push({type:`insert`,block:a.byId[e].block,source:n,prevBlock:void 0}),s.add(e)}),Object.keys(i.byId).filter(e=>!(e in a.byId)).forEach(e=>{o.push({type:`delete`,block:i.byId[e].block,source:n,prevBlock:void 0}),s.add(e)}),Object.keys(a.byId).filter(e=>e in i.byId).forEach(e=>{let t=i.byId[e],r=a.byId[e];t.parentId===r.parentId?(0,YMe.default)({...t.block,children:void 0},{...r.block,children:void 0})||(o.push({type:`update`,block:r.block,prevBlock:t.block,source:n}),s.add(e)):(o.push({type:`move`,block:r.block,prevBlock:t.block,source:n,prevParent:t.parentId?i.byId[t.parentId]?.block:void 0,currentParent:r.parentId?a.byId[r.parentId]?.block:void 0}),s.add(e))});let c=i.childrenByParent,l=a.childrenByParent,u=new Set([...Object.keys(c),...Object.keys(l)]),d=new Set;return u.forEach(e=>{let t=SMe(c[e],l[e]);t.size!==0&&t.forEach(t=>{let r=i.byId[t],c=a.byId[t];!r||!c||r.parentId!==c.parentId||s.has(t)||(r.parentId??`__root__`)!==e||d.has(t)||(d.add(t),o.push({type:`move`,block:c.block,prevBlock:r.block,source:n,prevParent:r.parentId?i.byId[r.parentId]?.block:void 0,currentParent:c.parentId?a.byId[c.parentId]?.block:void 0}),s.add(t))})}),o}function wMe(e){let t=e.charAt(0)===`#`?e.substring(1,7):e,n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),a=[n/255,r/255,i/255].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*a[0]+.7152*a[1]+.0722*a[2]<=.179}function TMe(e){let t=document.createElement(`span`);t.classList.add(`bn-collaboration-cursor__base`);let n=document.createElement(`span`);n.setAttribute(`contentedEditable`,`false`),n.classList.add(`bn-collaboration-cursor__caret`),n.setAttribute(`style`,`background-color: ${e.color}; color: ${wMe(e.color)?`white`:`black`}`);let r=document.createElement(`span`);return r.classList.add(`bn-collaboration-cursor__label`),r.setAttribute(`style`,`background-color: ${e.color}; color: ${wMe(e.color)?`white`:`black`}`),r.insertBefore(document.createTextNode(e.name),null),n.insertBefore(r,null),t.insertBefore(document.createTextNode(``),null),t.insertBefore(n,null),t.insertBefore(document.createTextNode(``),null),t}function EMe(e,t){let n=e.doc;if(e._item===null){let r=Array.from(n.share.keys()).find(t=>n.share.get(t)===e);if(r==null)throw Error(`type does not exist in other ydoc`);return t.get(r,e.constructor)}else{let n=e._item,r=t.store.clients.get(n.id.client)??[];return r[ZB(r,n.id.clock)].content.type}}function DMe(e,t){return!e||!t?!1:!!e.closest(`.${t}`)}function OMe(e,t,n,r,i){let a=e.state.doc.resolve(t.pos);if(a.parent.inlineContent||t.orientation===`inline`)return null;let o=a.nodeBefore,s=a.nodeAfter;if(!o&&!s)return null;let c=t.orientation===`block-vertical-left`||t.orientation===`block-vertical-right`,l=c?t.pos:t.pos-(o?o.nodeSize:0),u=e.nodeDOM(l);if(!u)return null;let d=u.getBoundingClientRect();if(c){let e=n/2*r,i=t.orientation===`block-vertical-left`?d.left:d.right;return{left:i-e,right:i+e,top:d.top,bottom:d.bottom}}let f=o?d.bottom:d.top;o&&s&&(f=(f+e.nodeDOM(t.pos).getBoundingClientRect().top)/2);let p=n/2*i;return{left:d.left,right:d.right,top:f-p,bottom:f+p}}function kMe(e,t,n,r){let i=e.coordsAtPos(t.pos),a=n/2*r;return{left:i.left-a,right:i.left+a,top:i.top,bottom:i.bottom}}function AMe(e,t){e.classList.toggle(`prosemirror-dropcursor-inline`,t===`inline`),e.classList.toggle(`prosemirror-dropcursor-block-horizontal`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-left`,t===`block-vertical-left`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-right`,t===`block-vertical-right`),e.classList.toggle(`prosemirror-dropcursor-block`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-vertical`,t===`block-vertical-left`||t===`block-vertical-right`)}function jMe(e){if(!e||e===document.body&&getComputedStyle(e).position===`static`)return{parentLeft:-window.pageXOffset,parentTop:-window.pageYOffset};let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return{parentLeft:t.left-e.scrollLeft*n,parentTop:t.top-e.scrollTop*r}}function MMe(e,t){for(;e&&e.parentElement&&e.parentElement!==t.dom&&e.getAttribute?.call(e,`data-node-type`)!==`blockContainer`;)e=e.parentElement;if(e.getAttribute?.call(e,`data-node-type`)===`blockContainer`)return{node:e,id:e.getAttribute(`data-id`)}}function NMe(){let e=t=>{let n=t.children.length;for(let r=0;r<n;r++){let i=t.children[r];if(i.type===`element`&&(e(i),i.tagName===`u`))if(i.children.length>0){t.children.splice(r,1,...i.children);let e=i.children.length-1;n+=e,r+=e}else t.children.splice(r,1),n--,r--}};return e}function PMe(){let e=t=>{if(t.children&&`length`in t.children&&t.children.length)for(let n=t.children.length-1;n>=0;n--){let r=t.children[n],i=n+1<t.children.length?t.children[n+1]:void 0;r.type===`element`&&r.tagName===`input`&&r.properties?.type===`checkbox`&&i?.type===`element`&&i.tagName===`p`?(i.tagName=`span`,i.children.splice(0,0,aMe(document.createTextNode(` `)))):e(r)}};return e}function FMe(){return e=>{v4(e,`element`,(e,t,n)=>{if(n&&e.tagName===`video`){let r=e.properties?.src||e.properties?.[`data-url`]||``,i=e.properties?.title||e.properties?.[`data-name`]||``;n.children[t]={type:`text`,value:``}}})}}function O6(e){return D6().use(jxe,{fragment:!0}).use(FMe).use(NMe).use(PMe).use(nTe).use(Nje).use(Lje,{handlers:{text:e=>e.value}}).processSync(e).value}function IMe(e,t,n,r){return O6(N6(t,n).exportBlocks(e,r))}function LMe(e){let t=[];return e.descendants(e=>{var n;let r=HY(e);return e.type.name===`blockContainer`&&e.firstChild?.type.name===`blockGroup`?!0:e.type.name===`columnList`&&e.childCount===1?((n=e.firstChild)==null||n.forEach(e=>{t.push(QY(e,r))}),!1):e.type.isInGroup(`bnBlock`)?(t.push(QY(e,r)),!1):!0}),t}function RMe(e,t){let n,r,i=t.resolve(e.from).node().type.spec.group===`blockContent`,a=t.resolve(e.to).node().type.spec.group===`blockContent`,o=Math.min(e.$anchor.depth,e.$head.depth);if(i&&a){let i=e.$from.start(o-1),a=e.$to.end(o-1);n=t.resolve(i-1).pos,r=t.resolve(a+1).pos}else n=e.from,r=e.to;return{from:n,to:r}}function zMe(e,t,n=t){t===n&&(n+=e.state.doc.resolve(t+1).node().nodeSize);let r=e.domAtPos(t).node.cloneNode(!0),i=e.domAtPos(t).node,a=(e,t)=>Array.prototype.indexOf.call(e.children,t),o=a(i,e.domAtPos(t+1).node.parentElement),s=a(i,e.domAtPos(n-1).node.parentElement);for(let e=i.childElementCount-1;e>=0;e--)(e>s||e<o)&&r.removeChild(r.children[e]);BMe(e.root),G6=r;let c=G6.getElementsByTagName(`iframe`);for(let e=0;e<c.length;e++){let t=c[e],n=t.parentElement;n&&n.removeChild(t)}let l=e.dom.className.split(` `).filter(e=>e!==`ProseMirror`&&e!==`bn-root`&&e!==`bn-editor`).join(` `);G6.className=G6.className+` bn-drag-preview `+l,e.root instanceof ShadowRoot?e.root.appendChild(G6):e.root.body.appendChild(G6)}function BMe(e){G6!==void 0&&(e instanceof ShadowRoot?e.removeChild(G6):e.body.removeChild(G6),G6=void 0)}function VMe(e,t,n){if(!e.dataTransfer||n.headless)return;let r=n.prosemirrorView,i=qZ(t.id,r.state.doc);if(!i)throw Error(`Block with ID ${t.id} not found`);let a=i.posBeforeNode;if(a!=null){let t=r.state.selection,i=r.state.doc,{from:o,to:s}=RMe(t,i),c=o<=a&&a<s,l=t.$anchor.node()!==t.$head.node()||t instanceof W6;c&&l?(r.dispatch(r.state.tr.setSelection(W6.create(i,o,s))),zMe(r,o,s)):(r.dispatch(r.state.tr.setSelection(rM.create(r.state.doc,a))),zMe(r,a));let u=r.state.selection.content(),d=n.pmSchema,f=r.serializeForClipboard(u).dom.innerHTML,p=N6(d,n),m=LMe(u.content),h=p.exportBlocks(m,{}),g=O6(h);e.dataTransfer.clearData(),e.dataTransfer.setData(`blocknote/html`,f),e.dataTransfer.setData(`text/html`,h),e.dataTransfer.setData(`text/plain`,g),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setDragImage(G6,0,0)}}function k6(e,t,n=!0){let r=e.root.elementsFromPoint(t.left,t.top);for(let i of r)if(e.dom.contains(i))return n&&i.closest(`[data-node-type=columnList]`)?k6(e,{left:t.left+50,top:t.top},!1):MMe(i,e)}function HMe(e,t){if(!t.dom.firstChild)return;let n=t.dom.firstChild.getBoundingClientRect(),r=k6(t,{left:Math.min(Math.max(n.left+10,e.x),n.right-10),top:e.y});if(r)return k6(t,{left:r.node.getBoundingClientRect().right-10,top:e.y},!1)}async function UMe(){return J6||(J6=(async()=>{let[e,t]=await Promise.all([C(()=>import(`./module-5nFhWwDg.js`),[]),C(()=>import(`./native-DOSNxcOx.js`),[])]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),J6)}async function WMe(e,t){if(!(`text`in e.schema.inlineContentSchema)||e.schema.inlineContentSchema.text!==H$.text)return[];let{emojiData:n,emojiMart:r}=await UMe();return(t.trim()===``?Object.values(n.emojis):await r.SearchIndex.search(t)).map(t=>({id:t.skins[0].native,onItemClick:()=>e.insertInlineContent(t.skins[0].native+` `)}))}function GMe(e){Y6||(Y6=document.createElement(`div`),Y6.innerHTML=`_`,Y6.style.opacity=`0`,Y6.style.height=`1px`,Y6.style.width=`1px`,e instanceof Document?e.body.appendChild(Y6):e.appendChild(Y6))}function KMe(e){Y6&&=(e instanceof Document?e.body.removeChild(Y6):e.removeChild(Y6),void 0)}function A6(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function qMe(e){let t=e;for(;t&&t.nodeName!==`TD`&&t.nodeName!==`TH`&&!t.classList.contains(`tableWrapper`);){if(t.classList.contains(`ProseMirror`))return;let e=t.parentNode;if(!e||!(e instanceof Element))return;t=e}return t.nodeName===`TD`||t.nodeName===`TH`?{type:`cell`,domNode:t,tbodyNode:t.closest(`tbody`)}:{type:`wrapper`,domNode:t,tbodyNode:t.querySelector(`tbody`)}}function JMe(e,t){let n=t.querySelectorAll(e);for(let e=0;e<n.length;e++)n[e].style.visibility=`hidden`}var YMe,XMe,ZMe,j6,M6,QMe,N6,P6,F6,I6,L6,$Me,R6,eNe,tNe,nNe,rNe,z6,iNe,B6,V6,H6,aNe,oNe,sNe,cNe,U6,lNe,uNe,W6,G6,K6,dNe,fNe,q6,J6,Y6,pNe,X6,Z6,Q6,mNe,hNe=o((()=>{pM(),sY(),YMe=u(Ehe(),1),_X(),U$(),lG(),KW(),AU(),qG(),Xj(),m_e(),RP(),yY(),JG(),hj(),Nxe(),iTe(),Ije(),zje(),iMe(),hMe(),y4(),cZ(),w(),XMe=Object.defineProperty,ZMe=(e,t,n)=>t in e?XMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j6=(e,t,n)=>ZMe(e,typeof t==`symbol`?t:t+``,n),M6=(e,t,n,r,i,a,o=0,s)=>{for(let c of n)vMe(e,t,c,r,i,a,o,s)},QMe=(e,t,n,r,i,a)=>{let o=(a?.document??document).createDocumentFragment();return M6(o,e,t,n,r,i,0,a),o},N6=(e,t)=>{let n=pj.fromSchema(e);return{exportBlocks:(e,r)=>{let i=QMe(t,e,n,new Set([`numberedListItem`]),new Set([`bulletListItem`,`checkListItem`,`toggleListItem`]),r),a=document.createElement(`div`);return a.append(i),a.innerHTML},exportInlineContent:(e,r)=>{let i=_Me(t,e,n,r),a=document.createElement(`div`);return a.append(i.cloneNode(!0)),a.innerHTML}}},P6=oG(()=>{let e=[];return{key:`blockChange`,prosemirrorPlugins:[new uM({key:new fM(`blockChange`),filterTransaction:t=>{let n;return e.reduce((e,r)=>e===!1?e:r({getChanges(){return n||(n=CMe(t),n)},tr:t})!==!1,!0)}})],subscribe(t){return e.push(t),()=>{e.splice(e.indexOf(t),1)}}}}),F6=oG(({options:e})=>{let t=new Map,n=e.provider&&`awareness`in e.provider&&typeof e.provider.awareness==`object`?e.provider.awareness:void 0;return n&&(`setLocalStateField`in n&&typeof n.setLocalStateField==`function`&&n.setLocalStateField(`user`,e.user),`on`in n&&typeof n.on==`function`&&e.showCursorLabels!==`always`&&n.on(`change`,({updated:e})=>{for(let n of e){let e=t.get(n);e&&(setTimeout(()=>{e.element.setAttribute(`data-active`,``)},10),e.hideTimeout&&clearTimeout(e.hideTimeout),t.set(n,{element:e.element,hideTimeout:setTimeout(()=>{e.element.removeAttribute(`data-active`)},2e3)}))}})),{key:`yCursor`,prosemirrorPlugins:[n?RW(n,{selectionBuilder:FW,cursorBuilder(n,r){let i=t.get(r);if(!i){let a=(e.renderCursor??TMe)(n);e.showCursorLabels!==`always`&&(a.addEventListener(`mouseenter`,()=>{let e=t.get(r);e.element.setAttribute(`data-active`,``),e.hideTimeout&&(clearTimeout(e.hideTimeout),t.set(r,{element:e.element,hideTimeout:void 0}))}),a.addEventListener(`mouseleave`,()=>{let e=t.get(r);t.set(r,{element:e.element,hideTimeout:setTimeout(()=>{e.element.removeAttribute(`data-active`)},2e3)})})),i={element:a,hideTimeout:void 0},t.set(r,i)}return i.element}}):void 0].filter(Boolean),dependsOn:[`ySync`],updateUser(e){n?.setLocalStateField(`user`,e)}}}),I6=oG(({options:e})=>({key:`ySync`,prosemirrorPlugins:[eW(e.fragment)],runsBefore:[`default`]})),L6=oG(()=>({key:`yUndo`,prosemirrorPlugins:[GW()],dependsOn:[`yCursor`,`ySync`],undoCommand:VW,redoCommand:HW})),$Me=oG(({editor:e,options:t})=>{let n,r=sG({isForked:!1});return{key:`yForkDoc`,store:r,fork(){if(n)return;let i=t.fragment;if(!i)throw Error(`No fragment to fork from`);let a=new Zz;pB(a,gB(i.doc));let o=EMe(i,a);n={undoStack:LU.getState(e.prosemirrorState).undoManager.undoStack,originalFragment:i,forkedFragment:o},e.unregisterExtension([L6,F6,I6]);let s={...t,fragment:o};e.registerExtension([I6(s),L6()]),r.setState({isForked:!0})},merge({keepChanges:i}){if(!n)return;e.unregisterExtension([`ySync`,`yCursor`,`yUndo`]);let{originalFragment:a,forkedFragment:o,undoStack:s}=n;if(e.registerExtension([I6(t),F6(t),L6()]),LU.getState(e.prosemirrorState).undoManager.undoStack=s,i){let t=gB(o.doc,SB(a.doc));pB(a.doc,t,e)}n=void 0,r.setState({isForked:!1})}}}),R6=(e,t)=>{t(e),e.forEach(e=>{e instanceof PH&&R6(e,t)})},eNe=(e,t)=>{let n=new Map;return e.forEach(e=>{e instanceof PH&&R6(e,e=>{if(e.nodeName===`blockContainer`&&e.hasAttribute(`id`)){let t=e.getAttribute(`textColor`),r=e.getAttribute(`backgroundColor`),i={textColor:t===hQ.textColor.default?void 0:t,backgroundColor:r===hQ.backgroundColor.default?void 0:r};(i.textColor||i.backgroundColor)&&n.set(e.getAttribute(`id`),i)}})}),n.size===0?!1:(t.doc.descendants((e,r)=>{if(e.type.name===`blockContainer`&&n.has(e.attrs.id)){let i=t.doc.nodeAt(r+1);if(!i)throw Error(`No element found`);t.setNodeMarkup(r+1,void 0,{...i.attrs,...n.get(e.attrs.id)})}}),!0)},tNe=[eNe],nNe=oG(({options:e})=>{let t=!1;return{key:`schemaMigration`,prosemirrorPlugins:[new uM({key:new fM(`schemaMigration`),appendTransaction:(n,r,i)=>{if(t||!n.some(e=>e.getMeta(`y-sync$`))||n.every(e=>!e.docChanged)||!e.fragment.firstChild)return;let a=i.tr;for(let t of tNe)t(e.fragment,a);if(t=!0,a.docChanged)return a}})]}}),rNe=oG(({editor:e,options:t})=>{let n=null,r=null,i=-1,a=null,o={width:t.dropCursor?.width??5,color:t.dropCursor?.color??`#ddeeff`,exclude:t.dropCursor?.exclude??`bn-drag-exclude`,hooks:t.dropCursor?.hooks},s=e=>{e?.pos===n?.pos&&e?.orientation===n?.orientation||(n=e,e==null?(r&&r.parentNode&&r.parentNode.removeChild(r),r=null):c())},c=()=>{if(!n)return;let t=e.prosemirrorView,i=t.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,c=a.height/i.offsetHeight,l=OMe(t,n,o.width,s,c)??kMe(t,n,o.width,s),u=t.dom.offsetParent;r||(r=u.appendChild(document.createElement(`div`)),r.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,o.color&&(r.style.backgroundColor=o.color)),AMe(r,n.orientation);let{parentLeft:d,parentTop:f}=jMe(u);r.style.left=(l.left-d)/s+`px`,r.style.top=(l.top-f)/c+`px`,r.style.width=(l.right-l.left)/s+`px`,r.style.height=(l.bottom-l.top)/c+`px`},l=e=>{clearTimeout(i),i=window.setTimeout(()=>s(null),e)},u=e=>{let t=e;a=t.target instanceof Element?t.target:null},d=t=>{var n;let r=t;if(a&&DMe(a,o.exclude)||r.target instanceof Element&&DMe(r.target,o.exclude))return;let i=e.prosemirrorView;if(!i.editable)return;let c=i.posAtCoords({left:r.clientX,top:r.clientY}),u=c&&c.inside>=0&&i.state.doc.nodeAt(c.inside),d=u&&u.type.spec.disableDropCursor,f=typeof d==`function`?d(i,c,r):d;if(c&&!f){let t=c.pos;if(i.dragging&&i.dragging.slice){let e=Ede(i.state.doc,t,i.dragging.slice);e!=null&&(t=e)}let a=!i.state.doc.resolve(t).parent.inlineContent,u={pos:t,orientation:a?`block-horizontal`:`inline`},d=u;if((n=o.hooks)!=null&&n.computeDropPosition){let t=o.hooks.computeDropPosition({editor:e,event:r,view:i,defaultPosition:u});if(t===null){s(null);return}d=t}s(d),l(5e3)}},f=t=>{let n=t;(!(n.relatedTarget instanceof Node)||!e.prosemirrorView.dom.contains(n.relatedTarget))&&s(null)},p=()=>{l(20)},m=()=>{l(20),a=null};return{key:`dropCursor`,mount({signal:e,dom:t,root:n}){n.addEventListener(`dragstart`,u,{capture:!0,signal:e}),t.addEventListener(`dragover`,d,{signal:e}),t.addEventListener(`dragleave`,f,{signal:e}),t.addEventListener(`drop`,p,{signal:e}),t.addEventListener(`dragend`,m,{signal:e}),e.addEventListener(`abort`,()=>{clearTimeout(i),s(null)})}}}),z6=oG(({editor:e})=>{let t=sG(!1),n=()=>e.transact(e=>{if(e.selection.empty||e.selection instanceof rM&&(e.selection.node.type.spec.content===`inline*`||e.selection.node.firstChild?.type.spec.content===`inline*`)||e.selection instanceof B&&e.doc.textBetween(e.selection.from,e.selection.to).length===0)return!1;let t=!1;return e.selection.content().content.descendants(e=>(e.type.spec.code&&(t=!0),!t)),!t});return{key:`formattingToolbar`,store:t,mount({dom:r,signal:i}){let a=!1,o=e.onChange(()=>{a||t.setState(n())}),s=e.onSelectionChange(()=>{a||t.setState(n())});r.addEventListener(`pointerdown`,()=>{a=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`pointerup`,()=>{a=!1,e.isFocused()&&t.setState(n())},{signal:i,capture:!0}),r.addEventListener(`pointercancel`,()=>{a=!1},{signal:i,capture:!0}),i.addEventListener(`abort`,()=>{o(),s()})}}}),iNe=oG(()=>({key:`history`,prosemirrorPlugins:[p_e()],undoCommand:s1,redoCommand:c1})),B6=oG(({editor:e})=>{function t(t){let n=e.prosemirrorView.nodeDOM(t);for(;n&&n.parentElement;){if(n.nodeName===`A`)return n;n=n.parentElement}return null}function n(t,n){return e.transact(r=>{let i=r.doc.resolve(t),a=i.marks().find(e=>e.type.name===n);if(!a)return;let o=mK(i,a.type);if(o)return{range:o,mark:a,get text(){return r.doc.textBetween(o.from,o.to)},get position(){return cq(e.prosemirrorView,o.from,o.to).toJSON()}}})}function r(){return e.transact(e=>{let t=e.selection;if(t.empty)return n(t.anchor,`link`)})}return{key:`linkToolbar`,getLinkAtSelection:r,getLinkElementAtPos:t,getMarkAtPos:n,getLinkAtElement(t){return e.transact(()=>n(e.prosemirrorView.posAtDOM(t,0)+1,`link`))},editLink(t,r,i=e.transact(e=>e.selection.anchor)){e.transact(e=>{let a=HY(e),{range:o}=n(i+1,`link`)||{range:{from:e.selection.from,to:e.selection.to}};o&&(e.insertText(r,o.from,o.to),e.addMark(o.from,o.from+r.length,a.mark(`link`,{href:t})))}),e.prosemirrorView.focus()},deleteLink(t=e.transact(e=>e.selection.anchor)){e.transact(e=>{let r=HY(e),{range:i}=n(t+1,`link`)||{range:{from:e.selection.from,to:e.selection.to}};i&&e.removeMark(i.from,i.to,r.marks.link).setMeta(`preventAutolink`,!0)}),e.prosemirrorView.focus()}}}),V6=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`],H6=`https`,aNe=new fM(`node-selection-keyboard`),oNe=oG(()=>({key:`nodeSelectionKeyboard`,prosemirrorPlugins:[new uM({key:aNe,props:{handleKeyDown:(e,t)=>{if(`node`in e.state.selection){if(t.ctrlKey||t.metaKey)return!1;if(t.key.length===1)return t.preventDefault(),!0;if(t.key===`Enter`&&!t.isComposing&&!t.shiftKey&&!t.altKey&&!t.ctrlKey&&!t.metaKey){let t=e.state.tr;return e.dispatch(t.insert(e.state.tr.selection.$to.after(),e.state.schema.nodes.paragraph.createChecked()).setSelection(new B(t.doc.resolve(e.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),sNe=new fM(`blocknote-placeholder`),cNe=oG(({editor:e,options:t})=>{let n=t.placeholders;return{key:`placeholder`,prosemirrorPlugins:[new uM({key:sNe,view:t=>{let r=`placeholder-selector-${vY()}`;t.dom.classList.add(r);let i=document.createElement(`style`),a=e._tiptapEditor.options.injectNonce;a&&i.setAttribute(`nonce`,a),t.root instanceof window.ShadowRoot?t.root.append(i):t.root.head.appendChild(i);let o=i.sheet,s=(e=``)=>`.${r} .bn-block-content${e} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;try{let{default:e,emptyDocument:t,...r}=n||{};for(let[e,t]of Object.entries(r)){let n=`[data-content-type="${e}"]`;o.insertRule(`${s(n)} { content: ${JSON.stringify(t)}; }`)}o.insertRule(`${s(`[data-is-only-empty-block]`)} { content: ${JSON.stringify(t)}; }`),o.insertRule(`${s(`[data-is-empty-and-focused]`)} { content: ${JSON.stringify(e)}; }`)}catch(e){console.warn(`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,e)}return{destroy:()=>{t.root instanceof window.ShadowRoot?t.root.removeChild(i):t.root.head.removeChild(i)}}},props:{decorations:t=>{let{doc:n,selection:r}=t;if(!e.isEditable||!r.empty||r.$from.parent.type.spec.code)return;let i=[];t.doc.content.size===6&&i.push(wP.node(2,4,{"data-is-only-empty-block":`true`}));let a=r.$anchor,o=a.parent;if(o.content.size===0){let e=a.before();i.push(wP.node(e,e+o.nodeSize,{"data-is-empty-and-focused":`true`}))}return DP.create(n,i)}}})]}}),U6=new fM(`previous-blocks`),lNe={index:`index`,level:`level`,type:`type`,depth:`depth`,"depth-change":`depth-change`},uNe=oG(()=>{let e;return{key:`previousBlockType`,prosemirrorPlugins:[new uM({key:U6,view(t){return{update:async(t,n)=>{this.key?.getState(t.state).updatedBlocks.size>0&&(e=setTimeout(()=>{t.dispatch(t.state.tr.setMeta(U6,{clearUpdate:!0}))},0))},destroy:()=>{e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(e,t,n,r){if(t.currentTransactionOldBlockAttrs={},t.updatedBlocks.clear(),!e.docChanged||n.doc.eq(r.doc))return t;let i={},a=jK(n.doc,e=>e.attrs.id),o=new Map(a.map(e=>[e.node.attrs.id,e])),s=jK(r.doc,e=>e.attrs.id);for(let e of s){let a=o.get(e.node.attrs.id),s=a?.node.firstChild,c=e.node.firstChild;if(a&&s&&c){let o={index:c.attrs.index,level:c.attrs.level,type:c.type.name,depth:r.doc.resolve(e.pos).depth},l={index:s.attrs.index,level:s.attrs.level,type:s.type.name,depth:n.doc.resolve(a.pos).depth};i[e.node.attrs.id]=l,t.currentTransactionOldBlockAttrs[e.node.attrs.id]=l,JSON.stringify(l)!==JSON.stringify(o)&&(l[`depth-change`]=l.depth-o.depth,t.updatedBlocks.add(e.node.attrs.id))}}return t.prevTransactionOldBlockAttrs=i,t}},props:{decorations(e){let t=this.getState(e);if(t.updatedBlocks.size===0)return;let n=[];return e.doc.descendants((e,r)=>{if(!e.attrs.id||!t.updatedBlocks.has(e.attrs.id))return;let i=t.currentTransactionOldBlockAttrs[e.attrs.id],a={};for(let[e,t]of Object.entries(i))a[`data-prev-`+lNe[e]]=t||`none`;let o=wP.node(r,r+e.nodeSize,{...a});n.push(o)}),DP.create(e.doc,n)}}})]}}),W6=class e extends $j{constructor(e,t){super(e,t),j6(this,`nodes`);let n=e.node();this.nodes=[],e.doc.nodesBetween(e.pos,t.pos,(e,t,r)=>{if(r!==null&&r.eq(n))return this.nodes.push(e),!1})}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}content(){return new z(R.from(this.nodes),0,0)}eq(t){if(!(t instanceof e)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let e=0;e<this.nodes.length;e++)if(!this.nodes[e].eq(t.nodes[e]))return!1;return!0}map(t,n){let r=n.mapResult(this.from),i=n.mapResult(this.to);return i.deleted?$j.near(t.resolve(r.pos)):r.deleted?$j.near(t.resolve(i.pos)):new e(t.resolve(r.pos),t.resolve(i.pos))}toJSON(){return{type:`multiple-node`,anchor:this.anchor,head:this.head}}},$j.jsonID(`multiple-node`,W6),K6=250,dNe=class{constructor(e,t,n){j6(this,`state`),j6(this,`emitUpdate`),j6(this,`mousePos`),j6(this,`hoveredBlock`),j6(this,`menuFrozen`,!1),j6(this,`isDragOrigin`,!1),j6(this,`updateState`,e=>{this.state=e,this.emitUpdate(this.state)}),j6(this,`updateStateFromMousePos`,()=>{var e,t,n,r;if(this.menuFrozen||!this.mousePos)return;let i=this.findClosestEditorElement({clientX:this.mousePos.x,clientY:this.mousePos.y});if(i?.element!==this.pmView.dom||i.distance>K6){(e=this.state)!=null&&e.show&&(this.state.show=!1,this.updateState(this.state));return}let a=HMe(this.mousePos,this.pmView);if(!a||!this.editor.isEditable){(t=this.state)!=null&&t.show&&(this.state.show=!1,this.updateState(this.state));return}if(!((n=this.state)!=null&&n.show&&(r=this.hoveredBlock)!=null&&r.hasAttribute(`data-id`)&&this.hoveredBlock?.getAttribute(`data-id`)===a.id)&&(this.hoveredBlock=a.node,this.editor.isEditable)){let e=a.node.getBoundingClientRect(),t=a.node.closest(`[data-node-type=column]`);this.state={show:!0,referencePos:new DOMRect(t?t.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,e.y,e.width,e.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute(`data-id`))},this.updateState(this.state)}}),j6(this,`onDragStart`,e=>{let t=e.dataTransfer?.getData(`blocknote/html`);if(!t||this.pmView.dragging)return;let n=document.createElement(`div`);n.innerHTML=t;let r=aj.fromSchema(this.pmView.state.schema).parse(n,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new z(r.content,0,0),move:!0}}),j6(this,`findClosestEditorElement`,e=>{let t=Array.from(this.pmView.root.querySelectorAll(`.bn-editor`));if(t.length===0)return null;let n=t[0],r=Number.MAX_VALUE;return t.forEach(t=>{let i=t.querySelector(`.bn-block-group`).getBoundingClientRect(),a=e.clientX<i.left?i.left-e.clientX:e.clientX>i.right?e.clientX-i.right:0,o=e.clientY<i.top?i.top-e.clientY:e.clientY>i.bottom?e.clientY-i.bottom:0,s=Math.sqrt(a**2+o**2);s<r&&(r=s,n=t)}),{element:n,distance:r}}),j6(this,`onDragOver`,e=>{if(e.synthetic||!(this.pmView.dragging!==null||this.isDragOrigin||e.dataTransfer?.types.includes(`blocknote/html`)||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=this.getDragEventContext(e);if(!t||!t.isDropPoint){this.closeDropCursor();return}t.isDropPoint&&!t.isDropWithinEditorBounds&&this.dispatchSyntheticEvent(e)}),j6(this,`closeDropCursor`,()=>{let e=new Event(`dragleave`,{bubbles:!1});e.synthetic=!0,this.pmView.dom.dispatchEvent(e)}),j6(this,`getDragEventContext`,e=>{var t;if(!(this.pmView.dragging!==null||this.isDragOrigin||e.dataTransfer?.types.includes(`blocknote/html`)||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let n=!((t=e.dataTransfer)!=null&&t.types.includes(`blocknote/html`))&&!!this.pmView.dragging,r=!!this.isDragOrigin,i=n||r,a=this.findClosestEditorElement(e);if(!a||a.distance>K6)return;let o=a.element===this.pmView.dom,s=o&&a.distance===0;if(!(!o&&!i))return{isDropPoint:o,isDropWithinEditorBounds:s,isDragOrigin:i}}),j6(this,`onDrop`,e=>{if(e.synthetic||!(this.pmView.dragging!==null||this.isDragOrigin||e.dataTransfer?.types.includes(`blocknote/html`)||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=this.getDragEventContext(e);if(!t){this.closeDropCursor();return}let{isDropPoint:n,isDropWithinEditorBounds:r,isDragOrigin:i}=t;if(!r&&n&&this.dispatchSyntheticEvent(e),n){if(this.pmView.dragging)return;this.pmView.dispatch(this.pmView.state.tr.setSelection(B.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.anchor)));return}else if(i){setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0);return}}),j6(this,`onDragEnd`,e=>{e.synthetic||(this.pmView.dragging=null)}),j6(this,`onKeyDown`,e=>{var t;(t=this.state)!=null&&t.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))}),j6(this,`onMouseMove`,e=>{var t;if(this.menuFrozen)return;this.mousePos={x:e.clientX,y:e.clientY};let n=this.pmView.dom.getBoundingClientRect(),r=this.mousePos.x>n.left&&this.mousePos.x<n.right&&this.mousePos.y>n.top&&this.mousePos.y<n.bottom,i=this.pmView.dom.parentElement;if(r&&e&&e.target&&!(i===e.target||i.contains(e.target))){(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()}),this.editor=e,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw Error(`Attempting to update uninitialized side menu`);n(this.state)},this.pmView.root.addEventListener(`dragstart`,this.onDragStart),this.pmView.root.addEventListener(`dragover`,this.onDragOver),this.pmView.root.addEventListener(`drop`,this.onDrop,!0),this.pmView.root.addEventListener(`dragend`,this.onDragEnd,!0),this.pmView.root.addEventListener(`mousemove`,this.onMouseMove,!0),this.pmView.root.addEventListener(`keydown`,this.onKeyDown,!0)}dispatchSyntheticEvent(e){let t=new Event(e.type,e),n=this.pmView.dom.firstChild.getBoundingClientRect();t.clientX=e.clientX,t.clientY=e.clientY,t.clientX=Math.min(Math.max(e.clientX,n.left),n.left+n.width),t.clientY=Math.min(Math.max(e.clientY,n.top),n.top+n.height),t.dataTransfer=e.dataTransfer,t.preventDefault=()=>e.preventDefault(),t.synthetic=!0,this.pmView.dom.dispatchEvent(t)}update(e,t){var n;!t.doc.eq(this.pmView.state.doc)&&(n=this.state)!=null&&n.show&&this.updateStateFromMousePos()}destroy(){var e;(e=this.state)!=null&&e.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener(`mousemove`,this.onMouseMove,!0),this.pmView.root.removeEventListener(`dragstart`,this.onDragStart),this.pmView.root.removeEventListener(`dragover`,this.onDragOver),this.pmView.root.removeEventListener(`drop`,this.onDrop,!0),this.pmView.root.removeEventListener(`dragend`,this.onDragEnd,!0),this.pmView.root.removeEventListener(`keydown`,this.onKeyDown,!0)}},fNe=new fM(`SideMenuPlugin`),q6=oG(({editor:e})=>{let t,n=sG(void 0);return{key:`sideMenu`,store:n,prosemirrorPlugins:[new uM({key:fNe,view:r=>(t=new dNe(e,r,e=>{n.setState({...e})}),t)})],blockDragStart(n,r){t&&(t.isDragOrigin=!0),VMe(n,r,e)},blockDragEnd(){BMe(e.prosemirrorView.root),t&&(t.isDragOrigin=!1),e.blur()},freezeMenu(){t.menuFrozen=!0,t.state.show=!0,t.emitUpdate(t.state)},unfreezeMenu(){t.menuFrozen=!1,t.state.show=!1,t.emitUpdate(t.state)}}}),pNe=class{constructor(e,t,n){j6(this,`state`),j6(this,`emitUpdate`),j6(this,`tableId`),j6(this,`tablePos`),j6(this,`tableElement`),j6(this,`menuFrozen`,!1),j6(this,`mouseState`,`up`),j6(this,`prevWasEditable`,null),j6(this,`viewMousedownHandler`,()=>{this.mouseState=`down`}),j6(this,`mouseUpHandler`,e=>{this.mouseState=`up`,this.mouseMoveHandler(e)}),j6(this,`mouseMoveHandler`,e=>{var t,n,r,i,a,o;if(this.menuFrozen||this.mouseState===`selecting`||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;let s=qMe(e.target);if(s?.type===`cell`&&this.mouseState===`down`&&!((t=this.state)!=null&&t.draggingState)){this.mouseState=`selecting`,(n=this.state)!=null&&n.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!s||!this.editor.isEditable){(r=this.state)!=null&&r.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!s.tbodyNode)return;let c=s.tbodyNode.getBoundingClientRect(),l=MMe(s.domNode,this.pmView);if(!l)return;this.tableElement=l.node;let u,d=this.editor.transact(e=>qZ(l.id,e.doc));if(!d)throw Error(`Block with ID ${l.id} not found`);let f=QY(d.node,this.editor.pmSchema,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema);if(rQ(this.editor,`table`)&&(this.tablePos=d.posBeforeNode+1,u=f),!u)return;this.tableId=l.id;let p=s.domNode.closest(`.tableWrapper`)?.querySelector(`.table-widgets-container`);if(s?.type===`wrapper`){let t=e.clientY>=c.bottom-1&&e.clientY<c.bottom+20,n=e.clientX>=c.right-1&&e.clientX<c.right+20,r=this.state?.block.id!==u.id||e.clientX>c.right||e.clientY>c.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:t,showAddOrRemoveColumnsButton:n,referencePosTable:c,block:u,widgetContainer:p,colIndex:r||(i=this.state)==null?void 0:i.colIndex,rowIndex:r||(a=this.state)==null?void 0:a.rowIndex,referencePosCell:r||(o=this.state)==null?void 0:o.referencePosCell}}else{let e=A6(s.domNode),t=A6(s.domNode.parentElement),n=s.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===l.id&&this.state.rowIndex===t&&this.state.colIndex===e)return;this.state={show:!0,showAddOrRemoveColumnsButton:e===u.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:t===u.content.rows.length-1,referencePosTable:c,block:u,draggingState:void 0,referencePosCell:n,colIndex:e,rowIndex:t,widgetContainer:p}}return this.emitUpdate(),!1}),j6(this,`dragOverHandler`,e=>{if(this.state?.draggingState===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`,JMe(`.prosemirror-dropcursor-block, .prosemirror-dropcursor-inline`,this.pmView.root);let t={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(e=>e.tagName===`TD`||e.tagName===`TH`);if(n.length===0)return;let r=n[0],i=!1,a=A6(r.parentElement),o=A6(r),s=this.state.draggingState.draggedCellOrientation===`row`?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation===`row`?a:o)!==s;(this.state.rowIndex!==a||this.state.colIndex!==o)&&(this.state.rowIndex=a,this.state.colIndex=o,this.state.referencePosCell=r.getBoundingClientRect(),i=!0);let l=this.state.draggingState.draggedCellOrientation===`row`?t.top:t.left;this.state.draggingState.mousePos!==l&&(this.state.draggingState.mousePos=l,i=!0),i&&this.emitUpdate(),c&&this.editor.transact(e=>e.setMeta(X6,!0))}),j6(this,`dropHandler`,e=>{if(this.mouseState=`up`,this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw Error(`Attempted to drop table row or column, but no table block was hovered prior.`);e.preventDefault();let{draggingState:t,colIndex:n,rowIndex:r}=this.state,i=this.state.block.content.columnWidths;if(t.draggedCellOrientation===`row`){if(!sX(this.state.block,t.originalIndex,r))return!1;let e=Mhe(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,rows:e}})}else{if(!cX(this.state.block,t.originalIndex,n))return!1;let e=jhe(this.state.block,t.originalIndex,n),[r]=i.splice(t.originalIndex,1);i.splice(n,0,r),this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,columnWidths:i,rows:e}})}return this.editor.setTextCursorPosition(this.state.block.id),!0}),this.editor=e,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw Error(`Attempting to update uninitialized image toolbar`);n(this.state)},t.dom.addEventListener(`mousemove`,this.mouseMoveHandler),t.dom.addEventListener(`mousedown`,this.viewMousedownHandler),window.addEventListener(`mouseup`,this.mouseUpHandler),t.root.addEventListener(`dragover`,this.dragOverHandler),t.root.addEventListener(`drop`,this.dropHandler)}update(){var e;if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block||this.state.block.type!==`table`||!((e=this.tableElement)!=null&&e.isConnected)){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}let{height:t,width:n}=nX(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=n&&(this.state.colIndex=n-1));let r=this.tableElement.querySelector(`tbody`);if(!r)throw Error(`Table block does not contain a 'tbody' HTML element. This should never happen.`);if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){let e=r.children[this.state.rowIndex].children[this.state.colIndex];e?this.state.referencePosCell=e.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=r.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener(`mousemove`,this.mouseMoveHandler),window.removeEventListener(`mouseup`,this.mouseUpHandler),this.pmView.dom.removeEventListener(`mousedown`,this.viewMousedownHandler),this.pmView.root.removeEventListener(`dragover`,this.dragOverHandler),this.pmView.root.removeEventListener(`drop`,this.dropHandler)}},X6=new fM(`TableHandlesPlugin`),Z6=oG(({editor:e})=>{let t,n=sG(void 0);return{key:`tableHandles`,store:n,prosemirrorPlugins:[new uM({key:X6,view:r=>(t=new pNe(e,r,e=>{n.setState(e.block?{...e,draggingState:e.draggingState?{...e.draggingState}:void 0}:void 0)}),t),props:{decorations:e=>{if(t===void 0||t.state===void 0||t.state.draggingState===void 0||t.tablePos===void 0)return;let n=t.state.draggingState.draggedCellOrientation===`row`?t.state.rowIndex:t.state.colIndex;if(n===void 0)return;let r=[],{block:i,draggingState:a}=t.state,{originalIndex:o,draggedCellOrientation:s}=a;if(n===o||!i||s===`row`&&!sX(i,o,n)||s===`col`&&!cX(i,o,n))return DP.create(e.doc,r);let c=e.doc.resolve(t.tablePos+1);return t.state.draggingState.draggedCellOrientation===`row`?iX(t.state.block,n).forEach(({row:t,col:i})=>{let a=e.doc.resolve(c.posAtIndex(t)+1),s=e.doc.resolve(a.posAtIndex(i)+1),l=s.node(),u=s.pos+(n>o?l.nodeSize-2:0);r.push(wP.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.left=`0`,e.style.right=`0`,n>o?e.style.bottom=`-2px`:e.style.top=`-3px`,e.style.height=`4px`,e}))}):aX(t.state.block,n).forEach(({row:t,col:i})=>{let a=e.doc.resolve(c.posAtIndex(t)+1),s=e.doc.resolve(a.posAtIndex(i)+1),l=s.node(),u=s.pos+(n>o?l.nodeSize-2:0);r.push(wP.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.top=`0`,e.style.bottom=`0`,n>o?e.style.right=`-2px`:e.style.left=`-3px`,e.style.width=`4px`,e}))}),DP.create(e.doc,r)}}})],colDragStart(n){if(t===void 0||t.state===void 0||t.state.colIndex===void 0)throw Error(`Attempted to drag table column, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`col`,originalIndex:t.state.colIndex,mousePos:n.clientX},t.emitUpdate(),e.transact(e=>e.setMeta(X6,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.colIndex,newIndex:t.state.colIndex,tablePos:t.tablePos})),!e.headless&&(GMe(e.prosemirrorView.root),n.dataTransfer.setDragImage(Y6,0,0),n.dataTransfer.effectAllowed=`move`)},rowDragStart(n){if(t.state===void 0||t.state.rowIndex===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`row`,originalIndex:t.state.rowIndex,mousePos:n.clientY},t.emitUpdate(),e.transact(e=>e.setMeta(X6,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.rowIndex,newIndex:t.state.rowIndex,tablePos:t.tablePos})),!e.headless&&(GMe(e.prosemirrorView.root),n.dataTransfer.setDragImage(Y6,0,0),n.dataTransfer.effectAllowed=`copyMove`)},dragEnd(){if(t.state===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState=void 0,t.emitUpdate(),e.transact(e=>e.setMeta(X6,null)),!e.headless&&KMe(e.prosemirrorView.root)},freezeHandles(){t.menuFrozen=!0},unfreezeHandles(){t.menuFrozen=!1},getCellsAtRowHandle(e,t){return iX(e,t)},getCellsAtColumnHandle(e,t){return aX(e,t)},setCellSelection(e,n,r=n){if(!t)throw Error(`Table handles view not initialized`);let i=e.doc.resolve(t.tablePos+1),a=e.doc.resolve(i.posAtIndex(n.row)+1),o=e.doc.resolve(a.posAtIndex(n.col)),s=e.doc.resolve(i.posAtIndex(r.row)+1),c=e.doc.resolve(s.posAtIndex(r.col)),l=e.tr;return l.setSelection(new tZ(o,c)),e.apply(l)},addRowOrColumn(t,n){e.exec((e,r)=>{let i=this.setCellSelection(e,n.orientation===`row`?{row:t,col:0}:{row:0,col:t});return n.orientation===`row`?n.side===`above`?nge(i,r):rge(i,r):n.side===`left`?Zhe(i,r):Qhe(i,r)})},removeRowOrColumn(t,n){return n===`row`?e.exec((e,n)=>age(this.setCellSelection(e,{row:t,col:0}),n)):e.exec((e,n)=>ege(this.setCellSelection(e,{row:0,col:t}),n))},mergeCells(t){return e.exec((e,n)=>sge(t?this.setCellSelection(e,t.relativeStartCell,t.relativeEndCell):e,n))},splitCell(t){return e.exec((e,n)=>cge(t?this.setCellSelection(e,t):e,n))},getCellSelection(){return e.transact(e=>{let t=e.selection,n=t.$from,r=t.$to;if(aQ(t)){let{ranges:e}=t;e.forEach(e=>{n=e.$from.min(n??e.$from),r=e.$to.max(r??e.$to)})}else if(n=e.doc.resolve(t.$from.pos-t.$from.parentOffset-1),r=e.doc.resolve(t.$to.pos-t.$to.parentOffset-1),n.pos===0||r.pos===0)return;let i=e.doc.resolve(n.pos-n.parentOffset-1),a=e.doc.resolve(r.pos-r.parentOffset-1),o=e.doc.resolve(i.pos-i.parentOffset-1),s=n.index(i.depth),c=i.index(o.depth),l=r.index(a.depth),u=a.index(o.depth),d=[];for(let e=c;e<=u;e++)for(let t=s;t<=l;t++)d.push({row:e,col:t});return{from:{row:c,col:s},to:{row:u,col:l},cells:d}})},getMergeDirection(t){return e.transact(e=>{let n=aQ(e.selection)?e.selection:void 0;if(!n||!t||n.ranges.length<=1)return;let r=this.getCellSelection();if(r)return Fhe(r.from,r.to,t)?`vertical`:`horizontal`})},cropEmptyRowsOrColumns(e,t){return Nhe(e,t)},addRowsOrColumns(e,t,n){return Phe(e,t,n)}}}),Q6=new fM(`trailingNode`),mNe=oG(()=>({key:`trailingNode`,prosemirrorPlugins:[new uM({key:Q6,appendTransaction:(e,t,n)=>{let{doc:r,tr:i,schema:a}=n,o=Q6.getState(n),s=r.content.size-2,c=a.nodes.blockContainer,l=a.nodes.paragraph;if(o)return i.insert(s,c.create(void 0,l.create()))},state:{init:(e,t)=>{},apply:(e,t)=>{if(!e.docChanged)return t;let n=e.doc.lastChild;if(!n||n.type.name!==`blockGroup`)throw Error(`Expected blockGroup`);if(n=n.lastChild,!n||n.type.name!==`blockContainer`)return!0;let r=n.firstChild;if(!r)throw Error(`Expected blockContent`);return n.nodeSize>4||r.type.spec.content!==`inline*`}}})]}))})),gNe=o((()=>{hNe(),U$(),fG()})),_Ne=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),$6=s(((e,t)=>{t.exports=_Ne()})),vNe=s((e=>{var t=p(),n=$6();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),yNe=s(((e,t)=>{t.exports=vNe()}));function bNe(e,t=e=>e){return(0,CNe.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,xNe)}function xNe(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=SNe(e);if(n.length!==SNe(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function SNe(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var CNe,wNe=o((()=>{CNe=yNe(),aG()}));function TNe(e){let t=DNe(e),{roots:n,nonRoots:r}=ONe(t),i=[];for(;n.size;){i.push(n);let r=new Set;for(let i of n){let n=e.get(i);if(n)for(let e of n){let n=t.get(e);if(n===void 0)continue;let i=n-1;t.set(e,i),i===0&&r.add(e)}}n=r}if(r=ONe(t).nonRoots,r.size)throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(`, `)}`);return i}function ENe(e){return TNe(kNe(e))}function DNe(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,0);for(let e of r){let n=t.get(e)??0;t.set(e,n+1)}}return t}function ONe(e){let t=new Set,n=new Set;for(let[r,i]of e.entries())i===0?t.add(r):n.add(r);return{roots:t,nonRoots:n}}function kNe(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,new Set);for(let e of r)t.has(e)||t.set(e,new Set),t.get(e).add(n)}return t}function ANe(){return new Map}function jNe(e,t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),e}function MNe(e){let t=ANe();for(let n of e)Array.isArray(n.runsBefore)&&n.runsBefore.length>0?n.runsBefore.forEach(e=>{jNe(t,n.key,e)}):jNe(t,`default`,n.key);let n=ENe(t),r=n.findIndex(e=>e.has(`default`));return e=>91+(n.findIndex(t=>t.has(e))+r)*10}function NNe(e){return e&&Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var PNe,FNe,e8,INe,t8,LNe=o((()=>{U$(),PNe=Object.defineProperty,FNe=(e,t,n)=>t in e?PNe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e8=(e,t,n)=>FNe(e,typeof t==`symbol`?t:t+``,n),INe=class{constructor(e){e8(this,`BlockNoteEditor`,`only for types`),e8(this,`Block`,`only for types`),e8(this,`PartialBlock`,`only for types`),e8(this,`inlineContentSpecs`),e8(this,`styleSpecs`),e8(this,`blockSpecs`),e8(this,`blockSchema`),e8(this,`inlineContentSchema`),e8(this,`styleSchema`),this.opts=e;let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a}init(){let e=MNe(Object.entries({...this.opts.blockSpecs,...this.opts.inlineContentSpecs,...this.opts.styleSpecs}).map(([e,t])=>({key:e,runsBefore:t.implementation?.runsBefore??[]}))),t=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t,n])=>[t,Jge(n.config,n.implementation,n.extensions,e(t))])),n=Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t,n])=>typeof n.config==`object`?[t,{...n,implementation:{...n.implementation,node:n.implementation?.node.extend({priority:e(t)})}}]:[t,n])),r=Object.fromEntries(Object.entries(this.opts.styleSpecs).map(([t,n])=>[t,{...n,implementation:{...n.implementation,mark:n.implementation?.mark.extend({priority:e(t)})}}]));return{blockSpecs:t,blockSchema:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.config])),inlineContentSpecs:NNe(n),styleSpecs:NNe(r),inlineContentSchema:VZ(n),styleSchema:GZ(r)}}extend(e){Object.assign(this.opts.blockSpecs,e.blockSpecs),Object.assign(this.opts.inlineContentSpecs,e.inlineContentSpecs),Object.assign(this.opts.styleSpecs,e.styleSpecs);let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();return this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a,this}},t8=class e extends INe{static create(t){return new e({blockSpecs:t?.blockSpecs??L$,inlineContentSpecs:t?.inlineContentSpecs??V$,styleSpecs:t?.styleSpecs??B$})}}})),RNe,zNe=o((()=>{RNe={slash_menu:{heading:{title:`Heading 1`,subtext:`Top-level heading`,aliases:[`h`,`heading1`,`h1`],group:`Headings`},heading_2:{title:`Heading 2`,subtext:`Key section heading`,aliases:[`h2`,`heading2`,`subheading`],group:`Headings`},heading_3:{title:`Heading 3`,subtext:`Subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`],group:`Headings`},heading_4:{title:`Heading 4`,subtext:`Minor subsection heading`,aliases:[`h4`,`heading4`,`subheading4`],group:`Subheadings`},heading_5:{title:`Heading 5`,subtext:`Small subsection heading`,aliases:[`h5`,`heading5`,`subheading5`],group:`Subheadings`},heading_6:{title:`Heading 6`,subtext:`Lowest-level heading`,aliases:[`h6`,`heading6`,`subheading6`],group:`Subheadings`},toggle_heading:{title:`Toggle Heading 1`,subtext:`Toggleable top-level heading`,aliases:[`h`,`heading1`,`h1`,`collapsable`],group:`Subheadings`},toggle_heading_2:{title:`Toggle Heading 2`,subtext:`Toggleable key section heading`,aliases:[`h2`,`heading2`,`subheading`,`collapsable`],group:`Subheadings`},toggle_heading_3:{title:`Toggle Heading 3`,subtext:`Toggleable subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`,`collapsable`],group:`Subheadings`},quote:{title:`Quote`,subtext:`Quote or excerpt`,aliases:[`quotation`,`blockquote`,`bq`],group:`Basic blocks`},toggle_list:{title:`Toggle List`,subtext:`List with hideable sub-items`,aliases:[`li`,`list`,`toggleList`,`toggle list`,`collapsable list`],group:`Basic blocks`},numbered_list:{title:`Numbered List`,subtext:`List with ordered items`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`],group:`Basic blocks`},bullet_list:{title:`Bullet List`,subtext:`List with unordered items`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`],group:`Basic blocks`},check_list:{title:`Check List`,subtext:`List with checkboxes`,aliases:[`ul`,`li`,`list`,`checklist`,`check list`,`checked list`,`checkbox`],group:`Basic blocks`},paragraph:{title:`Paragraph`,subtext:`The body of your document`,aliases:[`p`,`paragraph`],group:`Basic blocks`},code_block:{title:`Code Block`,subtext:`Code block with syntax highlighting`,aliases:[`code`,`pre`],group:`Basic blocks`},page_break:{title:`Page Break`,subtext:`Page separator`,aliases:[`page`,`break`,`separator`],group:`Basic blocks`},table:{title:`Table`,subtext:`Table with editable cells`,aliases:[`table`],group:`Advanced`},image:{title:`Image`,subtext:`Resizable image with caption`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`],group:`Media`},video:{title:`Video`,subtext:`Resizable video with caption`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`],group:`Media`},audio:{title:`Audio`,subtext:`Embedded audio with caption`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`],group:`Media`},file:{title:`File`,subtext:`Embedded file`,aliases:[`file`,`upload`,`embed`,`media`,`url`],group:`Media`},emoji:{title:`Emoji`,subtext:`Search for and insert an emoji`,aliases:[`emoji`,`emote`,`emotion`,`face`],group:`Others`},divider:{title:`Divider`,subtext:`Visually divide blocks`,aliases:[`divider`,`hr`,`line`,`horizontal rule`],group:`Basic blocks`}},placeholders:{default:`Enter text or type '/' for commands`,heading:`Heading`,toggleListItem:`Toggle`,bulletListItem:`List`,numberedListItem:`List`,checkListItem:`List`,emptyDocument:void 0,new_comment:`Write a comment...`,edit_comment:`Edit comment...`,comment_reply:`Add comment...`},file_blocks:{add_button_text:{image:`Add image`,video:`Add video`,audio:`Add audio`,file:`Add file`}},toggle_blocks:{add_block_button:`Empty toggle. Click to add a block.`},side_menu:{add_block_label:`Add block`,drag_handle_label:`Open block menu`},drag_handle:{delete_menuitem:`Delete`,colors_menuitem:`Colors`,header_row_menuitem:`Header row`,header_column_menuitem:`Header column`},table_handle:{delete_column_menuitem:`Delete column`,delete_row_menuitem:`Delete row`,add_left_menuitem:`Add column left`,add_right_menuitem:`Add column right`,add_above_menuitem:`Add row above`,add_below_menuitem:`Add row below`,split_cell_menuitem:`Split cell`,merge_cells_menuitem:`Merge cells`,background_color_menuitem:`Background color`},suggestion_menu:{no_items_title:`No items found`},color_picker:{text_title:`Text`,background_title:`Background`,colors:{default:`Default`,gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`}},formatting_toolbar:{bold:{tooltip:`Bold`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italic`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Underline`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Strike`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Colors`},link:{tooltip:`Create link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Edit caption`,input_placeholder:`Edit caption`},file_replace:{tooltip:{image:`Replace image`,video:`Replace video`,audio:`Replace audio`,file:`Replace file`}},file_rename:{tooltip:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`},input_placeholder:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`}},file_download:{tooltip:{image:`Download image`,video:`Download video`,audio:`Download audio`,file:`Download file`}},file_delete:{tooltip:{image:`Delete image`,video:`Delete video`,audio:`Delete audio`,file:`Delete file`}},file_preview_toggle:{tooltip:`Toggle preview`},nest:{tooltip:`Nest block`,secondary_tooltip:`Tab`},unnest:{tooltip:`Unnest block`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Align text left`},align_center:{tooltip:`Align text center`},align_right:{tooltip:`Align text right`},align_justify:{tooltip:`Justify text`},table_cell_merge:{tooltip:`Merge cells`},comment:{tooltip:`Add comment`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload image`,video:`Upload video`,audio:`Upload audio`,file:`Upload file`},upload_error:`Error: Upload failed`},embed:{title:`Embed`,embed_button:{image:`Embed image`,video:`Embed video`,audio:`Embed audio`,file:`Embed file`},url_placeholder:`Enter URL`}},link_toolbar:{delete:{tooltip:`Remove link`},edit:{text:`Edit link`,tooltip:`Edit`},open:{tooltip:`Open in new tab`},form:{title_placeholder:`Edit title`,url_placeholder:`Edit URL`}},comments:{edited:`edited`,save_button_text:`Save`,cancel_button_text:`Cancel`,actions:{add_reaction:`Add reaction`,resolve:`Resolve`,edit_comment:`Edit comment`,delete_comment:`Delete comment`,more_actions:`More actions`},reactions:{reacted_by:`Reacted by`},sidebar:{marked_as_resolved:`Marked as resolved`,more_replies:e=>`${e} more replies`}},generic:{ctrl_shortcut:`Ctrl`}}}));function BNe(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}function VNe({rules:e}){let t=new uM({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return HNe(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&HNe(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function HNe(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state.tr.insertText(r,t,n),s=o.mapping.map(t),c=o.mapping.map(n),l=null,u=o.doc.resolve(s),d=u.parent.textBetween(Math.max(0,u.parentOffset-UNe),u.parentOffset,null,``);for(let t=0;t<i.length;t++){let n=i[t];if(!n.inCodeMark&&u.marks().some(e=>e.type.spec.code))continue;if(u.parent.type.spec.code){if(!n.inCode)continue}else if(n.inCode===`only`)continue;let f=n.match.exec(d);if(!f||f[0].length<r.length)continue;l??=e.state.apply(o);let p=n.handler(l,f,s-f[0].length,c);if(p)return e.dispatch(o),e.dispatch(f_e(e.state.tr)),n.undoable&&p.setMeta(a,{transform:p,from:s,to:c,text:r}),e.dispatch(p),!0}return!1}var n8,UNe,WNe=o((()=>{l1(),pM(),n8=class{match;handler;undoable;inCode;inCodeMark;constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?BNe(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}},UNe=500})),GNe=o((()=>{WNe(),new n8(/--$/,`—`,{inCodeMark:!1}),new n8(/\.\.\.$/,`…`,{inCodeMark:!1}),new n8(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new n8(/"$/,`”`,{inCodeMark:!1}),new n8(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new n8(/'$/,`’`,{inCodeMark:!1})})),KNe=o((()=>{WNe(),GNe()}));function qNe(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function JNe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||qNe(e.type))return!0;if(e.inlineContent)return!1}}return!0}function YNe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||qNe(e.type))return!0;if(e.inlineContent)return!1}}return!0}function XNe(){return new uM({props:{decorations:$Ne,createSelectionBetween(e,t,n){return t.pos==n.pos&&i8.valid(n)?new i8(n):null},handleClick:ZNe,handleKeyDown:tPe,handleDOMEvents:{beforeinput:QNe}}})}function r8(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof B){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=i8.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new i8(c))),!0):!1}}function ZNe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!i8.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&rM.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new i8(r))),!0)}function QNe(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof i8))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=R.empty;for(let e=r.length-1;e>=0;e--)i=R.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new z(i,0,0));return a.setSelection(B.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function $Ne(e){if(!(e.selection instanceof i8))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,DP.create(e.doc,[wP.widget(e.selection.head,t,{key:`gapcursor`})])}var i8,ePe,tPe,nPe=o((()=>{oK(),pM(),hj(),RP(),i8=class e extends $j{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):$j.near(r)}content(){return z.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new ePe(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!JNe(e)||!YNe(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!rM.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}},i8.prototype.visible=!1,i8.findFrom=i8.findGapCursorFrom,$j.jsonID(`gapcursor`,i8),ePe=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return i8.valid(t)?new i8(t):$j.near(t)}},tPe=rK({ArrowLeft:r8(`horiz`,-1),ArrowRight:r8(`horiz`,1),ArrowUp:r8(`vert`,-1),ArrowDown:r8(`vert`,1)})})),rPe=o((()=>{nPe()})),iPe,aPe=o((()=>{sY(),rPe(),iPe=WJ.create({name:`gapCursor`,addProseMirrorPlugins(){return[XNe()]},extendNodeSchema(e){return{allowGapCursor:zK(FK(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}})}));function oPe(e,t){return e in t||(t[e]=[]),t[e]}function a8(e,t,n){t[f8]&&(t[h8]=!0,t[g8]=!0),t[p8]&&(t[h8]=!0,t[m8]=!0),t[h8]&&(t[g8]=!0),t[m8]&&(t[g8]=!0),t[g8]&&(t[_8]=!0),t[v8]&&(t[_8]=!0);for(let r in t){let t=oPe(r,n);t.indexOf(e)<0&&t.push(e)}}function sPe(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function o8(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}function cPe(e=[]){let t={};o8.groups=t;let n=new o8;N5??=dPe(bPe),P5??=dPe(xPe),X(n,`'`,Q8),X(n,`{`,F8),X(n,`}`,I8),X(n,`[`,L8),X(n,`]`,R8),X(n,`(`,z8),X(n,`)`,B8),X(n,`<`,V8),X(n,`>`,H8),X(n,`(`,U8),X(n,`)`,W8),X(n,`「`,G8),X(n,`」`,K8),X(n,`『`,q8),X(n,`』`,J8),X(n,`<`,Y8),X(n,`>`,X8),X(n,`&`,Z8),X(n,`*`,$8),X(n,`@`,e5),X(n,"`",n5),X(n,`^`,r5),X(n,`:`,i5),X(n,`,`,a5),X(n,`$`,o5),X(n,`.`,s5),X(n,`=`,c5),X(n,`!`,l5),X(n,`-`,u5),X(n,`%`,d5),X(n,`|`,f5),X(n,`+`,p5),X(n,`#`,m5),X(n,`?`,h5),X(n,`"`,g5),X(n,`/`,y5),X(n,`;`,v5),X(n,`~`,b5),X(n,`_`,x5),X(n,`\\`,t5),X(n,`・`,_5);let r=x8(n,O5,M8,{[f8]:!0});x8(r,O5,r);let i=x8(r,T5,T8,{[h8]:!0}),a=x8(r,E5,E8,{[g8]:!0}),o=x8(n,T5,C8,{[p8]:!0});x8(o,O5,i),x8(o,T5,o),x8(i,O5,i),x8(i,T5,i);let s=x8(n,E5,w8,{[m8]:!0});x8(s,T5),x8(s,O5,a),x8(s,E5,s),x8(a,O5,a),x8(a,T5),x8(a,E5,a);let c=X(n,j5,P8,{[y8]:!0}),l=X(n,A5,N8,{[y8]:!0}),u=x8(n,k5,N8,{[y8]:!0});X(n,M5,u),X(l,j5,c),X(l,M5,u),x8(l,k5,u),X(u,A5),X(u,j5),x8(u,k5,u),X(u,M5,u);let d=x8(n,D5,S5,{[v8]:!0});X(d,`#`),x8(d,D5,d),X(d,wPe,d);let f=X(d,TPe);X(f,`#`),x8(f,D5,d);let p=[[T5,o],[O5,i]],m=[[T5,null],[E5,s],[O5,a]];for(let e=0;e<N5.length;e++)s8(n,N5[e],O8,C8,p);for(let e=0;e<P5.length;e++)s8(n,P5[e],k8,w8,m);a8(O8,{tld:!0,ascii:!0},t),a8(k8,{utld:!0,alpha:!0},t),s8(n,`file`,A8,C8,p),s8(n,`mailto`,A8,C8,p),s8(n,`http`,j8,C8,p),s8(n,`https`,j8,C8,p),s8(n,`ftp`,j8,C8,p),s8(n,`ftps`,j8,C8,p),a8(A8,{scheme:!0,ascii:!0},t),a8(j8,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[SPe]:!0}:{[CPe]:!0};r.indexOf(`-`)>=0?i[_8]=!0:T5.test(r)?O5.test(r)?i[h8]=!0:i[p8]=!0:i[f8]=!0,S8(n,r,r,i)}return S8(n,`localhost`,D8,{ascii:!0}),n.jd=new o8(C5),{start:n,tokens:Object.assign({groups:t},w5)}}function lPe(e,t){let n=uPe(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function uPe(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function s8(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new o8(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new o8(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function dPe(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}function c8(e,t=null){let n=Object.assign({},F5);e&&(n=Object.assign(n,e instanceof c8?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function fPe(e){return e}function pPe(e,t){this.t=`token`,this.v=e,this.tk=t}function l8(e,t){class n extends pPe{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}function mPe({groups:e}){let t=e.domain.concat([Z8,$8,e5,t5,n5,r5,o5,c5,u5,M8,d5,f5,p5,m5,y5,C5,b5,x5]),n=[Q8,i5,a5,s5,l5,d5,h5,g5,v5,V8,H8,F8,I8,R8,L8,z8,B8,U8,W8,G8,K8,q8,J8,Y8,X8],r=[Z8,Q8,$8,t5,n5,r5,o5,c5,u5,F8,I8,d5,f5,p5,m5,h5,y5,C5,b5,x5],i=z5(),a=X(i,b5);b8(a,r,a),b8(a,e.domain,a);let o=z5(),s=z5(),c=z5();b8(i,e.domain,o),b8(i,e.scheme,s),b8(i,e.slashscheme,c),b8(o,r,a),b8(o,e.domain,o);let l=X(o,e5);X(a,e5,l),X(s,e5,l),X(c,e5,l);let u=X(a,s5);b8(u,r,a),b8(u,e.domain,a);let d=z5();b8(l,e.domain,d),b8(d,e.domain,d);let f=X(d,s5);b8(f,e.domain,d);let p=z5(I5);b8(f,e.tld,p),b8(f,e.utld,p),X(l,D8,p);let m=X(d,u5);X(m,u5,m),b8(m,e.domain,d),b8(p,e.domain,d),X(p,s5,f),X(p,u5,m),b8(X(p,i5),e.numeric,I5);let h=X(o,u5),g=X(o,s5);X(h,u5,h),b8(h,e.domain,o),b8(g,r,a),b8(g,e.domain,o);let _=z5(R5);b8(g,e.tld,_),b8(g,e.utld,_),b8(_,e.domain,o),b8(_,r,a),X(_,s5,g),X(_,u5,h),X(_,e5,l);let v=X(_,i5),y=z5(R5);b8(v,e.numeric,y);let b=z5(R5),x=z5();b8(b,t,b),b8(b,n,x),b8(x,t,b),b8(x,n,x),X(_,y5,b),X(y,y5,b);let S=X(s,i5),C=X(X(X(c,i5),y5),y5);b8(s,e.domain,o),X(s,s5,g),X(s,u5,h),b8(c,e.domain,o),X(c,s5,g),X(c,u5,h),b8(S,e.domain,b),X(S,y5,b),X(S,h5,b),b8(C,e.domain,b),b8(C,t,b),X(C,y5,b);let w=[[F8,I8],[L8,R8],[z8,B8],[V8,H8],[U8,W8],[G8,K8],[q8,J8],[Y8,X8]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=X(b,r);X(x,r,a),X(a,i,b);let o=z5(R5);b8(a,t,o);let s=z5();b8(a,n),b8(o,t,o),b8(o,n,s),b8(s,t,o),b8(s,n,s),X(o,i,b),X(s,i,b)}return X(i,D8,_),X(i,P8,EPe),{start:i,tokens:w5}}function hPe(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(u8(L5,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(u8(e,t,r))}}return o.length>0&&a.push(u8(L5,t,o)),a}function u8(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}function gPe(){return o8.groups={},B5.scanner=null,B5.parser=null,B5.tokenQueue=[],B5.pluginQueue=[],B5.customSchemes=[],B5.initialized=!1,B5}function _Pe(e,t=!1){if(B5.initialized&&DPe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${OPe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
167
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
168
|
+
2. Cannot start or end with "-"
|
|
169
|
+
3. "-" cannot repeat`);B5.customSchemes.push([e,t])}function vPe(){B5.scanner=cPe(B5.customSchemes);for(let e=0;e<B5.tokenQueue.length;e++)B5.tokenQueue[e][1]({scanner:B5.scanner});B5.parser=mPe(B5.scanner.tokens);for(let e=0;e<B5.pluginQueue.length;e++)B5.pluginQueue[e][1]({scanner:B5.scanner,parser:B5.parser});return B5.initialized=!0,B5}function d8(e){return B5.initialized||vPe(),hPe(B5.parser.start,e,lPe(B5.scanner.start,e))}function yPe(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new c8(n),i=d8(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var bPe,xPe,f8,p8,m8,h8,g8,_8,v8,SPe,CPe,y8,b8,x8,S8,X,C8,w8,T8,E8,D8,O8,k8,A8,j8,M8,N8,P8,F8,I8,L8,R8,z8,B8,V8,H8,U8,W8,G8,K8,q8,J8,Y8,X8,Z8,Q8,$8,e5,t5,n5,r5,i5,a5,o5,s5,c5,l5,u5,d5,f5,p5,m5,h5,g5,_5,v5,y5,b5,x5,S5,C5,w5,T5,E5,D5,O5,k5,A5,j5,wPe,TPe,M5,N5,P5,F5,I5,L5,EPe,R5,z5,DPe,OPe,B5,kPe=o((()=>{bPe=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,xPe=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,f8=`numeric`,p8=`ascii`,m8=`alpha`,h8=`asciinumeric`,g8=`alphanumeric`,_8=`domain`,v8=`emoji`,SPe=`scheme`,CPe=`slashscheme`,y8=`whitespace`,o8.groups={},o8.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=o8.groups;let i;return t&&t.j?i=t:(i=new o8(t),n&&r&&a8(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=o8.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new o8,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new o8,a&&(r&&(o.t&&typeof o.t==`string`?a8(a,Object.assign(sPe(o.t,r),n),r):n&&a8(a,n,r)),o.t=a),i.j[e]=o,o}},b8=(e,t,n,r,i)=>e.ta(t,n,r,i),x8=(e,t,n,r,i)=>e.tr(t,n,r,i),S8=(e,t,n,r,i)=>e.ts(t,n,r,i),X=(e,t,n,r,i)=>e.tt(t,n,r,i),C8=`WORD`,w8=`UWORD`,T8=`ASCIINUMERICAL`,E8=`ALPHANUMERICAL`,D8=`LOCALHOST`,O8=`TLD`,k8=`UTLD`,A8=`SCHEME`,j8=`SLASH_SCHEME`,M8=`NUM`,N8=`WS`,P8=`NL`,F8=`OPENBRACE`,I8=`CLOSEBRACE`,L8=`OPENBRACKET`,R8=`CLOSEBRACKET`,z8=`OPENPAREN`,B8=`CLOSEPAREN`,V8=`OPENANGLEBRACKET`,H8=`CLOSEANGLEBRACKET`,U8=`FULLWIDTHLEFTPAREN`,W8=`FULLWIDTHRIGHTPAREN`,G8=`LEFTCORNERBRACKET`,K8=`RIGHTCORNERBRACKET`,q8=`LEFTWHITECORNERBRACKET`,J8=`RIGHTWHITECORNERBRACKET`,Y8=`FULLWIDTHLESSTHAN`,X8=`FULLWIDTHGREATERTHAN`,Z8=`AMPERSAND`,Q8=`APOSTROPHE`,$8=`ASTERISK`,e5=`AT`,t5=`BACKSLASH`,n5=`BACKTICK`,r5=`CARET`,i5=`COLON`,a5=`COMMA`,o5=`DOLLAR`,s5=`DOT`,c5=`EQUALS`,l5=`EXCLAMATION`,u5=`HYPHEN`,d5=`PERCENT`,f5=`PIPE`,p5=`PLUS`,m5=`POUND`,h5=`QUERY`,g5=`QUOTE`,_5=`FULLWIDTHMIDDLEDOT`,v5=`SEMI`,y5=`SLASH`,b5=`TILDE`,x5=`UNDERSCORE`,S5=`EMOJI`,C5=`SYM`,w5=Object.freeze({__proto__:null,ALPHANUMERICAL:E8,AMPERSAND:Z8,APOSTROPHE:Q8,ASCIINUMERICAL:T8,ASTERISK:$8,AT:e5,BACKSLASH:t5,BACKTICK:n5,CARET:r5,CLOSEANGLEBRACKET:H8,CLOSEBRACE:I8,CLOSEBRACKET:R8,CLOSEPAREN:B8,COLON:i5,COMMA:a5,DOLLAR:o5,DOT:s5,EMOJI:S5,EQUALS:c5,EXCLAMATION:l5,FULLWIDTHGREATERTHAN:X8,FULLWIDTHLEFTPAREN:U8,FULLWIDTHLESSTHAN:Y8,FULLWIDTHMIDDLEDOT:_5,FULLWIDTHRIGHTPAREN:W8,HYPHEN:u5,LEFTCORNERBRACKET:G8,LEFTWHITECORNERBRACKET:q8,LOCALHOST:D8,NL:P8,NUM:M8,OPENANGLEBRACKET:V8,OPENBRACE:F8,OPENBRACKET:L8,OPENPAREN:z8,PERCENT:d5,PIPE:f5,PLUS:p5,POUND:m5,QUERY:h5,QUOTE:g5,RIGHTCORNERBRACKET:K8,RIGHTWHITECORNERBRACKET:J8,SCHEME:A8,SEMI:v5,SLASH:y5,SLASH_SCHEME:j8,SYM:C5,TILDE:b5,TLD:O8,UNDERSCORE:x5,UTLD:k8,UWORD:w8,WORD:C8,WS:N8}),T5=/[a-z]/,E5=/\p{L}/u,D5=/\p{Emoji}/u,O5=/\d/,k5=/\s/,A5=`\r`,j5=`
|
|
170
|
+
`,wPe=`️`,TPe=``,M5=``,N5=null,P5=null,F5={defaultProtocol:`http`,events:null,format:fPe,formatHref:fPe,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null},c8.prototype={o:F5,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:F5[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}},pPe.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=F5.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}},I5=l8(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),L5=l8(`text`),EPe=l8(`nl`),R5=l8(`url`,{isLink:!0,toHref(e=F5.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==D8&&e[1].t===i5}}),z5=e=>new o8(e),DPe=typeof console<`u`&&console&&console.warn||(()=>{}),OPe=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,B5={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1},d8.scan=lPe}));function APe(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function jPe(e){return new uM({key:new fM(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(eq(AK(n.doc,[...t])).forEach(({newRange:t})=>{let n=MK(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!FPe.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(PPe).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=d8(n).map(t=>t.toObject(e.defaultProtocol));if(!APe(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{tq(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function MPe(e){return new uM({key:new fM(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=$K(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function NPe(e){return new uM({key:new fM(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=yPe(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function V5(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(IPe,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var H5,PPe,FPe,IPe,LPe,RPe=o((()=>{sY(),kPe(),qG(),H5=`[\0- \xA0 -\u2029 ]`,PPe=new RegExp(H5),FPe=RegExp(`${H5}$`),IPe=new RegExp(H5,`g`),LPe=LJ.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){_Pe(e);return}_Pe(e.scheme,e.optionalSlashes)})},onDestroy(){gPe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!V5(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!V5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!V5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,UK(this.options.HTMLAttributes,e),0]:[`a`,UK(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!V5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!V5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[gq({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=yPe(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!V5(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(jPe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!V5(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(MPe({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(NPe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}})})),zPe,BPe=o((()=>{sY(),zPe=oY.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``})}));function VPe(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$3(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return t3(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var HPe,UPe=o((()=>{e6(),u3(),HPe={tokenize:VPe}}));function WPe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return P3(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(U5,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(U5,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return t3(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;P3(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function GPe(e,t,n){return $3(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var KPe,U5,qPe=o((()=>{e6(),u3(),I3(),KPe={tokenize:WPe},U5={tokenize:GPe}}));function JPe(e){let t=this,n=e.attempt(t6,r,e.attempt(this.parser.constructs.flowInitial,i,$3(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Uke,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var W5,YPe=o((()=>{v6(),e6(),W5={tokenize:JPe}}));function XPe(e){return{resolveAll:ZPe(e===`text`?QPe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function ZPe(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function QPe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var $Pe,eFe,tFe,nFe=o((()=>{$Pe={resolveAll:ZPe()},eFe=XPe(`string`),tFe=XPe(`text`)})),rFe=c({attentionMarkers:()=>dFe,contentInitial:()=>aFe,disable:()=>fFe,document:()=>iFe,flow:()=>sFe,flowInitial:()=>oFe,insideSpan:()=>uFe,string:()=>cFe,text:()=>lFe}),iFe,aFe,oFe,sFe,cFe,lFe,uFe,dFe,fFe,pFe=o((()=>{v6(),nFe(),iFe={42:g6,43:g6,45:g6,48:g6,49:g6,50:g6,51:g6,52:g6,53:g6,54:g6,55:g6,56:g6,57:g6,62:r6},aFe={91:tAe},oFe={[-2]:c6,[-1]:c6,32:c6},sFe={35:lAe,42:h6,45:[_6,h6],60:_Ae,61:_6,95:h6,96:s6,126:s6},cFe={38:a6,92:i6},lFe={[-5]:m6,[-4]:m6,[-3]:m6,33:PAe,38:a6,42:Q3,60:[fke,SAe],91:LAe,92:[aAe,i6],93:f6,95:Q3,96:Nke},uFe={null:[Q3,$Pe]},dFe={null:[42,95]},fFe={null:[]}}));function mFe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=F3(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=X3(a,l.events,l),l.events):[]}function f(e,t){return gFe(p(e),t)}function p(e){return hFe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){t3(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&P3(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hFe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function gFe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
171
|
+
`;break;case-3:o=`\r
|
|
172
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}var _Fe=o((()=>{u3(),I3(),Z3()}));function vFe(e){let t={constructs:VOe([rFe,...(e||{}).extensions||[]]),content:n(HPe),defined:[],document:n(KPe),flow:n(W5),lazy:{},string:n(eFe),text:n(tFe)};return t;function n(e){return n;function n(n){return mFe(t,e,n)}}}var yFe=o((()=>{WOe(),UPe(),qPe(),YPe(),nFe(),pFe(),_Fe()}));function bFe(e){for(;!Lke(e););return e}var xFe=o((()=>{zke()}));function SFe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(G5.lastIndex=u,c=G5.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var G5,CFe=o((()=>{G5=/[\0\t\n\r]/g})),wFe=o((()=>{yFe(),xFe(),CFe()}));function TFe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),EFe(n)(bFe(vFe(n).document().write(SFe()(e,t,!0))))}function EFe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(A),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(k),htmlTextData:E,image:c(ne),label:ie,labelText:re,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:j,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};DFe(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];q5.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||kFe).call(a,void 0,e[0])}for(r.position={start:K5(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:K5(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:K5(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||kFe).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+H2({start:e.start,end:e.end})+`): it’s not open`);n.position.end=K5(e.end)}function u(){return H4(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=m3(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:K5(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=K5(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=K5(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=WDe(t),n.identifier=m3(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=m3(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=HDe(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=k3(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=K5(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function K5(e){return{line:e.line,column:e.column,offset:e.offset}}function DFe(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?DFe(e,r):OFe(e,r)}}function OFe(e,t){let n;for(n in t)if(q5.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function kFe(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+H2({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+H2({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+H2({start:t.start,end:t.end})+`) is still open`)}var q5,AFe=o((()=>{U4(),wFe(),UDe(),qDe(),h3(),j3(),Ybe(),q5={}.hasOwnProperty})),jFe=o((()=>{AFe()}));function MFe(e){let t=this;t.parser=n;function n(n){return TFe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var NFe=o((()=>{jFe()})),PFe=o((()=>{NFe()}));function FFe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}var IFe=o((()=>{}));function LFe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
173
|
+
`}]}var RFe=o((()=>{}));function zFe(e,t){let n=t.value?t.value+`
|
|
174
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}var BFe=o((()=>{}));function VFe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var HFe=o((()=>{}));function UFe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var WFe=o((()=>{}));function GFe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=J3(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}var KFe=o((()=>{Y3()}));function qFe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var JFe=o((()=>{}));function YFe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}var XFe=o((()=>{}));function ZFe(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}var QFe=o((()=>{}));function $Fe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZFe(e,t);let i={src:J3(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}var eIe=o((()=>{Y3(),QFe()}));function tIe(e,t){let n={src:J3(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}var nIe=o((()=>{Y3()}));function rIe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}var iIe=o((()=>{}));function aIe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZFe(e,t);let i={href:J3(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var oIe=o((()=>{Y3(),QFe()}));function sIe(e,t){let n={href:J3(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}var cIe=o((()=>{Y3()}));function lIe(e,t,n){let r=e.all(t),i=n?uIe(n):dIe(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
175
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
176
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function uIe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=dIe(n[r])}return t}function dIe(e){return e.spread??e.children.length>1}var fIe=o((()=>{}));function pIe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}var mIe=o((()=>{}));function hIe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var gIe=o((()=>{}));function _Ie(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}var vIe=o((()=>{}));function yIe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var bIe=o((()=>{}));function xIe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=x4(t.children[1]),o=b4(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}var SIe=o((()=>{S4()}));function CIe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}var wIe=o((()=>{}));function TIe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var EIe=o((()=>{}));function DIe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(OIe(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(OIe(t.slice(i),i>0,!1)),a.join(``)}function OIe(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===J5||t===Y5;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===J5||t===Y5;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}var J5,Y5,kIe=o((()=>{J5=9,Y5=32}));function AIe(e,t){let n={type:`text`,value:DIe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}var jIe=o((()=>{kIe()}));function MIe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var NIe=o((()=>{}));function X5(){}var Z5,PIe=o((()=>{IFe(),RFe(),BFe(),HFe(),WFe(),KFe(),JFe(),XFe(),eIe(),nIe(),iIe(),oIe(),cIe(),fIe(),mIe(),gIe(),vIe(),bIe(),SIe(),wIe(),EIe(),jIe(),NIe(),Z5={blockquote:FFe,break:LFe,code:zFe,delete:VFe,emphasis:UFe,footnoteReference:GFe,heading:qFe,html:YFe,imageReference:$Fe,image:tIe,inlineCode:rIe,linkReference:aIe,link:sIe,listItem:lIe,list:pIe,paragraph:hIe,root:_Ie,strong:yIe,table:xIe,tableCell:TIe,tableRow:CIe,text:AIe,thematicBreak:MIe,toml:X5,yaml:X5,definition:X5,footnoteDefinition:X5}}));function FIe(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function IIe(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function LIe(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||FIe,r=e.options.footnoteBackLabel||IIe,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=J3(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...i4(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
177
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
178
|
+
`}]}}var RIe=o((()=>{a4(),Y3()}));function zIe(e,t){let n=t||GIe,r=new Map,i=new Map,a={all:s,applyData:VIe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Z5,...n.handlers},one:o,options:n,patch:BIe,wrap:UIe};return v4(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Q5.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=i4(n);return r.children=a.all(e),r}return i4(e)}return(a.options.unknownHandler||HIe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=WIe(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=WIe(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function BIe(e,t){e.position&&(t.position=RSe(e))}function VIe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,i4(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function HIe(e,t){let n=t.data||{},r=`value`in t&&!(Q5.call(n,`hProperties`)||Q5.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function UIe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
179
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
180
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
181
|
+
`}),n}function WIe(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}var Q5,GIe,KIe=o((()=>{a4(),y4(),S4(),PIe(),Q5={}.hasOwnProperty,GIe={}}));function qIe(e,t){let n=zIe(e,t),r=n.one(e,void 0),i=LIe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
182
|
+
`},i)),a}var JIe=o((()=>{u1(),RIe(),KIe()})),YIe=o((()=>{PIe(),JIe()}));function XIe(e,t){return e&&`run`in e?async function(n,r){let i=qIe(n,{file:r,...t});await e.run(i,r)}:function(n,r){return qIe(n,{file:r,...e||t})}}var ZIe=o((()=>{YIe()})),QIe=o((()=>{YIe(),ZIe()})),$Ie,eLe=o((()=>{$Ie=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]}));function tLe(e,t){if(e=e.replace(t.subset?nLe(t.subset):iLe,r),t.subset||t.escapeOnly)return e;return e.replace(aLe,n).replace(oLe,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function nLe(e){let t=$5.get(e);return t||(t=rLe(e),$5.set(e,t)),t}function rLe(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(sLe,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var iLe,aLe,oLe,sLe,$5,cLe=o((()=>{iLe=/["&'<>`]/g,aLe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,oLe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,sLe=/[|\\{}()[\]^$+*?.]/g,$5=new WeakMap}));function lLe(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!uLe.test(String.fromCharCode(t))?r:r+`;`}var uLe,dLe=o((()=>{uLe=/[\dA-Fa-f]/}));function fLe(e,t,n){let r=`&#`+String(e);return n&&t&&!pLe.test(String.fromCharCode(t))?r:r+`;`}var pLe,mLe=o((()=>{pLe=/\d/})),hLe,gLe=o((()=>{hLe=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`)})),e7,_Le=o((()=>{e7={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`}})),vLe,yLe=o((()=>{vLe=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`]}));function bLe(e,t,n,r){let i=String.fromCharCode(e);if(t7.call(n7,i)){let e=n7[i],a=`&`+e;return n&&hLe.includes(e)&&!vLe.includes(e)&&(!r||t&&t!==61&&xLe.test(String.fromCharCode(t)))?a:a+`;`}return``}var t7,n7,r7,xLe,SLe=o((()=>{for(r7 in gLe(),_Le(),yLe(),t7={}.hasOwnProperty,n7={},e7)t7.call(e7,r7)&&(n7[e7[r7]]=r7);xLe=/[^\dA-Za-z]/}));function CLe(e,t,n){let r=lLe(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=bLe(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=fLe(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}var wLe=o((()=>{dLe(),mLe(),SLe()}));function i7(e,t){return tLe(e,Object.assign({format:CLe},t))}var TLe=o((()=>{cLe(),wLe()})),a7=o((()=>{TLe()}));function ELe(e,t,n,r){return r.settings.bogusComments?`<?`+i7(e.value,Object.assign({},r.settings.characterReferences,{subset:OLe}))+`>`:`<!--`+e.value.replace(DLe,i)+`-->`;function i(e){return i7(e,Object.assign({},r.settings.characterReferences,{subset:kLe}))}}var DLe,OLe,kLe,ALe=o((()=>{a7(),DLe=/^>|^->|<!--|-->|--!>|<!-$/g,OLe=[`>`],kLe=[`<`,`>`]}));function jLe(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var MLe=o((()=>{}));function NLe(e){return t;function t(t,n,r){let i=t?t.children:PLe,a=(n||0)+e,o=i[a];if(!r)for(;o&&d4(o);)a+=e,o=i[a];return o}}var o7,s7,PLe,FLe=o((()=>{f4(),o7=NLe(1),s7=NLe(-1),PLe=[]}));function ILe(e){return t;function t(t,n,r){return LLe.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var LLe,RLe=o((()=>{LLe={}.hasOwnProperty}));function c7(e,t,n){let r=o7(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&d4(r.value.charAt(0)))}function zLe(e,t,n){let r=o7(n,t);return!r||r.type!==`comment`}function BLe(e,t,n){let r=o7(n,t);return!r||r.type!==`comment`}function VLe(e,t,n){let r=o7(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function HLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&r.tagName===`li`}function ULe(e,t,n){let r=o7(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function WLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function GLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function KLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function qLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function JLe(e,t,n){let r=o7(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function YLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function XLe(e,t,n){return!o7(n,t)}function ZLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function QLe(e,t,n){let r=o7(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var l7,$Le=o((()=>{f4(),FLe(),RLe(),l7=ILe({body:BLe,caption:c7,colgroup:c7,dd:WLe,dt:ULe,head:c7,html:zLe,li:HLe,optgroup:KLe,option:qLe,p:VLe,rp:GLe,rt:GLe,tbody:YLe,td:QLe,tfoot:XLe,th:QLe,thead:JLe,tr:ZLe})}));function eRe(e){let t=o7(e,-1);return!t||t.type!==`comment`}function tRe(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function nRe(e){let t=o7(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&d4(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function rRe(e,t,n){let r=s7(n,t),i=o7(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&l7(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function iRe(e,t,n){let r=s7(n,t),i=o7(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&l7(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var aRe,oRe=o((()=>{f4(),FLe(),$Le(),RLe(),aRe=ILe({body:nRe,colgroup:rRe,head:tRe,html:eRe,tbody:iRe})}));function sRe(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Y1);let l=cRe(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!aRe(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!l7(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function cRe(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=lRe(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function lRe(e,t,n){let r=W1(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=i7(r.attribute,Object.assign({},e.settings.characterReferences,{subset:u7.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?T_e:k_e)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=i7(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:u7.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&$4(n,o)>$4(n,e.alternative)&&(o=e.alternative),s=o+i7(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?u7.single:u7.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var u7,uRe=o((()=>{aTe(),Q1(),X1(),t0(),a7(),$Le(),oRe(),u7={name:[[`
|
|
183
|
+
\f\r &/=>`.split(``),`
|
|
184
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
185
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
186
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
187
|
+
\f\r &>`.split(``),`\0
|
|
188
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
189
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
190
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]}}));function dRe(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:i7(e.value,Object.assign({},r.settings.characterReferences,{subset:fRe}))}var fRe,pRe=o((()=>{a7(),fRe=[`<`,`&`]}));function mRe(e,t,n,r){return r.settings.allowDangerousHtml?e.value:dRe(e,t,n,r)}var hRe=o((()=>{pRe()}));function gRe(e,t,n,r){return r.all(e)}var _Re=o((()=>{}));function vRe(e){throw Error("Expected node, not `"+e+"`")}function yRe(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var bRe,xRe=o((()=>{lEe(),ALe(),MLe(),uRe(),hRe(),_Re(),pRe(),bRe=cEe(`type`,{invalid:vRe,unknown:yRe,handlers:{comment:ELe,doctype:jLe,element:sRe,raw:mRe,root:gRe,text:dRe}})}));function SRe(e,t){let n=t||TRe,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:CRe,all:wRe,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||$Ie,characterReferences:n.characterReferences||ERe,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Y1:J1,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function CRe(e,t,n){return bRe(e,t,n,this)}function wRe(e){let t=[],n=e&&e.children||DRe,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var TRe,ERe,DRe,ORe=o((()=>{eLe(),X1(),xRe(),TRe={},ERe={},DRe=[]})),kRe=o((()=>{ORe()}));function ARe(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return SRe(e,n)}}var jRe=o((()=>{kRe()})),MRe=o((()=>{jRe()}));function NRe(e,t,n,r=`before`){let i=typeof n==`string`?n:n.id,a=HY(e),o=t.map(e=>mX(e,a)),s=qZ(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);let c=s.posBeforeNode;return r===`after`&&(c+=s.node.nodeSize),e.step(new Wj(c,c,new z(R.from(o),0,0))),o.map(e=>QY(e,a))}function d7(e){if(!e||e.type.name!==`column`)throw Error(`Invalid columnPos: does not point to column node.`);let t=e.firstChild;if(!t)throw Error(`Invalid column: does not have child node.`);let n=t.firstChild;if(!n)throw Error(`Invalid blockContainer: does not have child node.`);return e.childCount===1&&t.childCount===1&&n.type.name===`paragraph`&&n.content.content.length===0}function PRe(e,t){let n=e.doc.resolve(t),r=n.nodeAfter;if(!r||r.type.name!==`columnList`)throw Error(`Invalid columnListPos: does not point to columnList node.`);for(let t=r.childCount-1;t>=0;t--){let r=e.doc.resolve(n.pos+1).posAtIndex(t),i=e.doc.resolve(r).nodeAfter;if(!i||i.type.name!==`column`)throw Error(`Invalid columnPos: does not point to column node.`);d7(i)&&e.delete(r,r+i.nodeSize)}}function f7(e,t){PRe(e,t);let n=e.doc.resolve(t).nodeAfter;if(!n||n.type.name!==`columnList`)throw Error(`Invalid columnListPos: does not point to columnList node.`);if(n.childCount>2)return;if(n.childCount<2)throw Error(`Invalid columnList: contains fewer than two children.`);let r=t+1,i=e.doc.resolve(r).nodeAfter,a=t+n.nodeSize-1,o=e.doc.resolve(a).nodeBefore;if(!i||!o)throw Error(`Invalid columnList: does not contain children.`);let s=d7(i),c=d7(o);if(s&&c){e.delete(t,t+n.nodeSize);return}if(s){e.step(new Gj(t,t+n.nodeSize,a-o.nodeSize+1,a-1,z.empty,0,!1));return}if(c){e.step(new Gj(t,t+n.nodeSize,r+1,r+i.nodeSize-1,z.empty,0,!1));return}}function FRe(e,t,n){let r=HY(e),i=n.map(e=>mX(e,r)),a=new Set(t.map(e=>typeof e==`string`?e:e.id)),o=[],s=new Set,c=typeof t[0]==`string`?t[0]:t[0].id,l=0;if(e.doc.descendants((t,u)=>{if(a.size===0)return!1;if(!t.type.isInGroup(`bnBlock`)||!a.has(t.attrs.id))return!0;if(o.push(QY(t,r)),a.delete(t.attrs.id),n.length>0&&t.attrs.id===c){let t=e.doc.nodeSize;e.insert(u,i);let n=e.doc.nodeSize;l+=t-n}let d=e.doc.nodeSize,f=e.doc.resolve(u-l);f.node().type.name===`column`?s.add(f.before(-1)):f.node().type.name===`columnList`&&s.add(f.before()),f.node().type.name===`blockGroup`&&f.node(f.depth-1).type.name!==`doc`&&f.node().childCount===1?e.delete(f.before(),f.after()):e.delete(u-l,u-l+t.nodeSize);let p=e.doc.nodeSize;return l+=d-p,!1}),a.size>0){let e=[...a].join(`
|
|
191
|
+
`);throw Error(`Blocks with the following IDs could not be found in the editor: `+e)}return s.forEach(t=>f7(e,t)),{insertedBlocks:i.map(e=>QY(e,r)),removedBlocks:o}}function IRe(e,t,n,r,i){let a;if(t)if(typeof t==`string`)a=dX([t],e.pmSchema,r);else if(Array.isArray(t))a=dX(t,e.pmSchema,r);else if(t.type===`tableContent`)a=fX(t,e.pmSchema);else throw new gX(t.type);else throw Error(`blockContent is required`);let o=(i?.document??document).createDocumentFragment();for(let t of a)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let r=e.schema.inlineContentSpecs[t.type.name].implementation;if(r){let a=ZY(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=r.render.call({renderType:`dom`,props:void 0},a,()=>{},e);if(s){if(o.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,i);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=e.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=pj.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}o.appendChild(n)}else{let e=n.serializeFragment(R.from([t]),i);o.appendChild(e)}return o}function LRe(e,t,n,r){var i,a,o,s;let c=e.pmSchema.nodes.blockContainer,l=t.props||{};for(let[n,r]of Object.entries(e.schema.blockSchema[t.type].propSchema))!(n in l)&&r.default!==void 0&&(l[n]=r.default);let u=t.children||[],d=e.blockImplementations[t.type].implementation.render.call({renderType:`dom`,props:void 0},{...t,props:l,children:u},e);if(d.contentDOM&&t.content){let i=IRe(e,t.content,n,t.type,r);d.contentDOM.appendChild(i)}if(e.pmSchema.nodes[t.type].isInGroup(`bnBlock`)){if(t.children&&t.children.length>0){let a=RRe(e,t.children,n,r);(i=d.contentDOM)==null||i.append(a)}return d.dom}let f=((a=c.spec)?.toDOM)?.call(a,c.create({id:t.id,...l}));return(o=f.contentDOM)==null||o.appendChild(d.dom),t.children&&t.children.length>0&&((s=f.contentDOM)==null||s.appendChild(h7(e,t.children,n,r))),f.dom}function RRe(e,t,n,r){let i=(r?.document??document).createDocumentFragment();for(let a of t){let t=LRe(e,a,n,r);i.appendChild(t)}return i}function zRe(e){return e.transact(e=>{let t=IY(e.doc,e.selection.anchor);if(e.selection instanceof tZ)return{type:`cell`,anchorBlockId:t.node.attrs.id,anchorCellOffset:e.selection.$anchorCell.pos-t.posBeforeNode,headCellOffset:e.selection.$headCell.pos-t.posBeforeNode};if(e.selection instanceof rM)return{type:`node`,anchorBlockId:t.node.attrs.id};{let n=IY(e.doc,e.selection.head);return{type:`text`,anchorBlockId:t.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:e.selection.anchor-t.posBeforeNode,headOffset:e.selection.head-n.posBeforeNode}}})}function BRe(e,t){let n=qZ(t.anchorBlockId,e.doc)?.posBeforeNode;if(n===void 0)throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let r;if(t.type===`cell`)r=tZ.create(e.doc,n+t.anchorCellOffset,n+t.headCellOffset);else if(t.type===`node`)r=rM.create(e.doc,n+1);else{let i=qZ(t.headBlockId,e.doc)?.posBeforeNode;if(i===void 0)throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);r=B.create(e.doc,n+t.anchorOffset,i+t.headOffset)}e.setSelection(r)}function p7(e){return e.map(e=>e.type===`columnList`?e.children.map(e=>p7(e.children)).flat():{...e,children:p7(e.children)}).flat()}function VRe(e,t,n){e.transact(r=>{let i=e.getSelection()?.blocks||[e.getTextCursorPosition().block],a=zRe(e);e.removeBlocks(i),e.insertBlocks(p7(i),t,n),BRe(r,a)})}function HRe(e){return!e||e.type!==`columnList`}function URe(e,t,n){let r,i;if(t?t.children.length>0?(r=t.children[t.children.length-1],i=`after`):(r=t,i=`before`):n&&(r=n,i=`before`),!r||!i)return;let a=e.getParentBlock(r);return HRe(a)?{referenceBlock:r,placement:i}:URe(e,i===`after`?r:e.getPrevBlock(r),a)}function WRe(e,t,n){let r,i;if(t?t.children.length>0?(r=t.children[0],i=`before`):(r=t,i=`after`):n&&(r=n,i=`after`),!r||!i)return;let a=e.getParentBlock(r);return HRe(a)?{referenceBlock:r,placement:i}:WRe(e,i===`before`?r:e.getNextBlock(r),a)}function GRe(e){e.transact(()=>{let t=e.getSelection()?.blocks[0]||e.getTextCursorPosition().block,n=URe(e,e.getPrevBlock(t),e.getParentBlock(t));n&&VRe(e,n.referenceBlock,n.placement)})}function KRe(e){e.transact(()=>{let t=e.getSelection(),n=t?.blocks[t?.blocks.length-1]||e.getTextCursorPosition().block,r=WRe(e,e.getNextBlock(n),e.getParentBlock(n));r&&VRe(e,r.referenceBlock,r.placement)})}function qRe(e,t,n){let{$from:r,$to:i}=e.selection,a=r.blockRange(i,e=>e.childCount>0&&(e.type.name===`blockGroup`||e.type.name===`column`));if(!a)return!1;let o=a.startIndex;if(o===0)return!1;let s=a.parent.child(o-1);if(s.type!==t)return!1;let c=s.lastChild&&s.lastChild.type===n,l=R.from(c?t.create():null),u=new z(R.from(t.create(null,R.from(n.create(null,l)))),c?3:1,0),d=a.start,f=a.end;return e.step(new Gj(d-(c?3:1),f,d,f,u,1,!0)).scrollIntoView(),!0}function JRe(e){return e.transact(t=>qRe(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup))}function YRe(e){e._tiptapEditor.commands.liftListItem(`blockContainer`)}function XRe(e){return e.transact(e=>{let{bnBlock:t}=VY(e);return e.doc.resolve(t.beforePos).nodeBefore!==null})}function ZRe(e){return e.transact(e=>{let{bnBlock:t}=VY(e);return e.doc.resolve(t.beforePos).depth>1})}function QRe(e,t){let n=typeof t==`string`?t:t.id,r=HY(e),i=qZ(n,e);if(i)return QY(i.node,r)}function $Re(e,t){let n=qZ(typeof t==`string`?t:t.id,e),r=HY(e);if(!n)return;let i=e.resolve(n.posBeforeNode).nodeBefore;if(i)return QY(i,r)}function eze(e,t){let n=qZ(typeof t==`string`?t:t.id,e),r=HY(e);if(!n)return;let i=e.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(i)return QY(i,r)}function tze(e,t){let n=typeof t==`string`?t:t.id,r=HY(e),i=qZ(n,e);if(!i)return;let a=e.resolve(i.posBeforeNode),o=a.node(),s=a.node(-1),c=s.type.name===`doc`?void 0:o.type.name===`blockGroup`?s:o;if(c)return QY(c,r)}function nze(e){return!!e.getMeta(`y-sync$`)}function rze(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function ize(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||``)}function aze(e){e.querySelectorAll(`li > ul, li > ol`).forEach(e=>{let t=rze(e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement(`afterend`,e),r.reverse().forEach(t=>{if(ize(t))return;let n=document.createElement(`li`);n.append(t),e.insertAdjacentElement(`afterend`,n)}),n.childNodes.length===0&&n.remove()})}function oze(e){e.querySelectorAll(`li + ul, li + ol`).forEach(e=>{let t=e.previousElementSibling,n=document.createElement(`div`);t.insertAdjacentElement(`afterend`,n),n.append(t);let r=document.createElement(`div`);for(r.setAttribute(`data-node-type`,`blockGroup`),n.append(r);n.nextElementSibling?.nodeName===`UL`||n.nextElementSibling?.nodeName===`OL`;)r.append(n.nextElementSibling)})}function sze(){return Zze||=document.implementation.createHTMLDocument(`title`)}function cze(e){if(typeof e==`string`){let t=sze().createElement(`div`);t.innerHTML=e,e=t}return aze(e),oze(e),e}function lze(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||``))return!0;return!1}function uze(e){let t=new Set([`PRE`,`CODE`]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g,` `))}function dze(e){lze(e)||uze(e)}function fze(e,t){let n=cze(e);dze(n);let r=aj.fromSchema(t).parse(n,{topNode:t.nodes.blockGroup.create()}),i=[];for(let e=0;e<r.childCount;e++)i.push(QY(r.child(e),t));return i}function pze(e,t){let n=t.value?t.value:``,r={};t.lang&&(r[`data-language`]=t.lang);let i={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:`element`,tagName:`pre`,properties:{},children:[i]},e.patch(t,i),i}function mze(e,t){var n;let r=String(t?.url||``),i=t!=null&&t.title?String(t.title):void 0,a={type:`element`,tagName:`video`,properties:{src:r,"data-name":i,"data-url":r,controls:!0},children:[]};return(n=e.patch)==null||n.call(e,t,a),a=e.applyData?e.applyData(t,a):a,a}function hze(e){return D6().use(MFe).use(Nje).use(XIe,{handlers:{...Z5,image:(e,t)=>Hge(String(t?.url||``))?mze(e,t):Z5.image(e,t),code:pze,blockquote:(e,t)=>{let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!1)};return e.patch(t,n),e.applyData(t,n)}}}).use(ARe).processSync(e).value}function gze(e,t){return fze(hze(e),t)}function _ze(e,t){if(!e.startsWith(`.`)||!t.startsWith(`.`))throw Error(`The strings provided are not valid file extensions.`);return e===t}function vze(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==2)throw Error(`The string ${e} is not a valid MIME type.`);if(r.length!==2)throw Error(`The string ${t} is not a valid MIME type.`);return n[1]===`*`||r[1]===`*`?n[0]===r[0]:(n[0]===`*`||r[0]===`*`||n[0]===r[0])&&n[1]===r[1]}function yze(e,t,n,r=`after`){let i;return i=Array.isArray(t.content)&&t.content.length===0?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id,i}async function bze(e,t){if(!t.uploadFile){console.warn(`Attempted ot insert file, but uploadFile is not set in the BlockNote editor options`);return}let n=`dataTransfer`in e?e.dataTransfer:e.clipboardData;if(n===null)return;let r=null;for(let e of g7)if(n.types.includes(e)){r=e;break}if(r!==`Files`)return;let i=n.items;if(i){e.preventDefault();for(let n=0;n<i.length;n++){let r=`file`;for(let e of Object.values(t.schema.blockSpecs))for(let t of e.implementation.meta?.fileBlockAccept||[]){let a=t.startsWith(`.`),o=i[n].getAsFile();if(o&&(!a&&o.type&&vze(i[n].type,t)||a&&_ze(`.`+o.name.split(`.`).pop(),t))){r=e.config.type;break}}let a=i[n].getAsFile();if(a){let n={type:r,props:{name:a.name}},i;if(e.type===`paste`){let e=t.getTextCursorPosition().block;i=yze(t,e,n)}else if(e.type===`drop`){let r={left:e.clientX,top:e.clientY},a=t.prosemirrorView.posAtCoords(r);if(!a)return;i=t.transact(e=>{let i=IY(e.doc,a.pos),o=(t.domElement?.querySelector(`[data-id="${i.node.attrs.id}"]`))?.getBoundingClientRect();return yze(t,t.getBlock(i.node.attrs.id),n,o&&(o.top+o.bottom)/2>r.top?`before`:`after`)})}else return;let o=await t.uploadFile(a,i),s=typeof o==`string`?{props:{url:o}}:{...o};t.updateBlock(i,s)}}}}async function xze(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData(`text/plain`);if(!r)return!1;if(!n.nodes.codeBlock)return t.pasteText(r),!0;let i=e.clipboardData.getData(`vscode-editor-data`),a=(i?JSON.parse(i):void 0)?.mode;return a?(t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g,`
|
|
192
|
+
`)}</code></pre>`),!0):!1}function Sze({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData(`text/plain`);if(n)return t.pasteText(n),!0}let i;for(let t of g7)if(e.clipboardData.types.includes(t)){i=t;break}if(!i)return!0;if(i===`vscode-editor-data`)return xze(e,t.prosemirrorView),!0;if(i===`Files`)return bze(e,t),!0;let a=e.clipboardData.getData(i);if(i===`blocknote/html`)return t.pasteHTML(a,!0),!0;if(i===`text/markdown`)return t.pasteMarkdown(a),!0;if(n){let n=e.clipboardData.getData(`text/plain`);if(pBe(n))return t.pasteMarkdown(n),!0}return i===`text/html`?(t.pasteHTML(a),!0):r?(t.pasteMarkdown(a),!0):(t.pasteText(a),!0)}function Cze(e,t,n){let r=!1,i=e.state.selection instanceof tZ;if(!i){let n=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,i=[];for(let e=0;e<n.childCount;e++)i.push(n.child(e));r=i.find(e=>e.type.isInGroup(`bnBlock`)||e.type.name===`blockGroup`||e.type.spec.group===`blockContent`)===void 0,r&&(t=n)}let a,o=N6(e.state.schema,n);if(i){t.firstChild?.type.name===`table`&&(t=t.firstChild.content);let e=YY(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=`<table>${o.exportInlineContent(e,{})}</table>`}else if(r){let e=XY(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=o.exportInlineContent(e,{})}else{let e=LMe(t);a=o.exportBlocks(e,{})}return a}function wze(e,t){`node`in e.state.selection&&e.state.selection.node.type.spec.group===`blockContent`&&t.transact(t=>t.setSelection(new rM(t.doc.resolve(e.state.selection.from-1))));let n=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,r=e.state.selection.content().content,i=Cze(e,r,t);return{clipboardHTML:n,externalHTML:i,markdown:O6(i)}}function Tze(e,t){let n=[UJ.ClipboardTextSerializer,UJ.Commands,UJ.Editable,UJ.FocusEvents,UJ.Tabindex,iPe,hX.configure({types:[`blockContainer`,`columnList`,`column`],setIdAttribute:t.setIdAttribute}),_Be,zPe,xBe,SBe,CBe,LPe.extend({inclusive:!1}).configure({defaultProtocol:H6,protocols:w7?[]:V6}),...Object.values(e.schema.styleSpecs).map(t=>t.implementation.mark.configure({editor:e})),TBe,gBe,wBe,WJ.create({name:`OverrideEscape`,addKeyboardShortcuts:()=>({Escape:()=>{var t;return(t=e.getExtension(I$))!=null&&t.shown()?!1:(e.blur(),!0)}})}),kBe,DBe.configure({editor:e,domAttributes:t.domAttributes}),bBe.configure({editor:e,tabBehavior:t.tabBehavior}),OBe.configure({domAttributes:t.domAttributes}),...Object.values(e.schema.inlineContentSpecs).filter(e=>e.config!==`link`&&e.config!==`text`).map(t=>t.implementation.node.configure({editor:e})),...Object.values(e.schema.blockSpecs).flatMap(n=>[...`node`in n.implementation?[n.implementation.node.configure({editor:e,domAttributes:t.domAttributes})]:[]]),hBe(e),mBe(e,t.pasteHandler||(e=>e.defaultPasteHandler())),$ze(e)];return w7=!0,n}function Eze(e,t){let n=[P6(),rNe(t),xQ(t),z6(t),B6(t),oNe(),cNe(t),dG(t),q6(t),I$(t),...t.trailingBlock===!1?[]:[mNe()]];return t.collaboration?n.push(ABe(t.collaboration)):n.push(iNe()),`table`in e.schema.blockSpecs&&n.push(Z6(t)),t.animations!==!1&&n.push(uNe()),n}function Dze(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}function Oze(e){let t=HY(e);if(e.selection.empty||`node`in e.selection)return;let n=e.doc.resolve(IY(e.doc,e.selection.from).posBeforeNode),r=e.doc.resolve(IY(e.doc,e.selection.to).posBeforeNode),i=(r,i)=>{let a=n.posAtIndex(r,i),o=e.doc.resolve(a).nodeAfter;if(!o)throw Error(`Error getting selection - node not found at position ${a}`);return QY(o,t)},a=[],o=n.sharedDepth(r.pos),s=n.index(o),c=r.index(o);if(n.depth>o){a.push(QY(n.nodeAfter,t));for(let e=n.depth;e>o;e--)if(n.node(e).type.isInGroup(`childContainer`)){let t=n.index(e)+1,r=n.node(e).childCount;for(let n=t;n<r;n++)a.push(i(n,e))}}else a.push(i(s,o));for(let e=s+1;e<=c;e++)a.push(i(e,o));if(a.length===0)throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);return{blocks:a}}function kze(e,t,n){let r=typeof t==`string`?t:t.id,i=typeof n==`string`?n:n.id,a=WY(HY(e));if(r===i)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${r})`);let o=qZ(r,e.doc);if(!o)throw Error(`Block with ID ${r} not found`);let s=qZ(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);let c=RY(o),l=RY(s),u=a.blockSchema[c.blockNoteType],d=a.blockSchema[l.blockNoteType];if(!c.isBlockContainer||u.content===`none`)throw Error(`Attempting to set selection anchor in block without content (id ${r})`);if(!l.isBlockContainer||d.content===`none`)throw Error(`Attempting to set selection anchor in block without content (id ${i})`);let f,p;if(u.content===`table`){let e=$X.get(c.blockContent.node);f=c.blockContent.beforePos+e.positionAt(0,0,c.blockContent.node)+1+2}else f=c.blockContent.beforePos+1;if(d.content===`table`){let t=$X.get(l.blockContent.node),n=l.blockContent.beforePos+t.positionAt(t.height-1,t.width-1,l.blockContent.node)+1;p=n+e.doc.resolve(n).nodeAfter.nodeSize-2}else p=l.blockContent.afterPos-1;e.setSelection(B.create(e.doc,f,p))}function Aze(e,t=!1){let n=HY(e),r=t?Dze(e.doc,e.selection):e.selection,i=r.$from,a=r.$to;for(;a.parentOffset>=a.parent.nodeSize-2&&a.depth>0;)a=e.doc.resolve(a.pos+1);for(;a.parentOffset===0&&a.depth>0;)a=e.doc.resolve(a.pos-1);for(;i.parentOffset===0&&i.depth>0;)i=e.doc.resolve(i.pos-1);for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>0;)i=e.doc.resolve(i.pos+1);let o=Ahe(e.doc.slice(i.pos,a.pos,!0),n);return{_meta:{startPos:i.pos,endPos:a.pos},...o}}function jze(e){let{bnBlock:t}=VY(e),n=HY(e.doc),r=e.doc.resolve(t.beforePos),i=r.nodeBefore,a=e.doc.resolve(t.afterPos).nodeAfter,o;return r.depth>1&&(o=r.node(),o.type.isInGroup(`bnBlock`)||(o=r.node(r.depth-1))),{block:QY(t.node,n),prevBlock:i===null?void 0:QY(i,n),nextBlock:a===null?void 0:QY(a,n),parentBlock:o===void 0?void 0:QY(o,n)}}function Mze(e,t,n=`start`){let r=typeof t==`string`?t:t.id,i=WY(HY(e.doc)),a=qZ(r,e.doc);if(!a)throw Error(`Block with ID ${r} not found`);let o=RY(a),s=i.blockSchema[o.blockNoteType].content;if(o.isBlockContainer){let t=o.blockContent;if(s===`none`){e.setSelection(rM.create(e.doc,t.beforePos));return}if(s===`inline`)n===`start`?e.setSelection(B.create(e.doc,t.beforePos+1)):e.setSelection(B.create(e.doc,t.afterPos-1));else if(s===`table`)n===`start`?e.setSelection(B.create(e.doc,t.beforePos+4)):e.setSelection(B.create(e.doc,t.afterPos-4));else throw new gX(s)}else Mze(e,(n===`start`?o.childContainer.node.firstChild:o.childContainer.node.lastChild).attrs.id,n)}function Nze(e,t,n,r={updateSelection:!0}){let{from:i,to:a}=typeof t==`number`?{from:t,to:t}:{from:t.from,to:t.to},o=!0,s=!0,c=``;if(n.forEach(e=>{e.check(),o&&e.isText&&e.marks.length===0?c+=e.text:o=!1,s=s?e.isBlock:!1}),i===a&&s){let{parent:t}=e.doc.resolve(i);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(--i,a+=1)}return o?e.insertText(c,i,a):e.replaceWith(i,a,n),r.updateSelection&&CK(e,e.steps.length-1,-1),!0}function Pze(e){return NK(e.state.selection.$from,e=>e.type.name===`tableCell`||e.type.name===`tableHeader`)!==void 0}function Fze(e,t){let n=t.nodes.hardBreak,r=R.empty;return e.forEach(e=>{e.isTextblock&&e.childCount>0?(r=r.append(e.content),r=r.addToEnd(n.create())):e.isText?r=r.addToEnd(e):e.isBlock&&e.childCount>0&&(r=r.append(Fze(e.content,t)),r=r.addToEnd(n.create()))}),r.lastChild?.type===n&&(r=r.cut(0,r.size-1)),r}function Ize(e,t){let n=[];return e.forEach((e,r,i)=>{i!==t&&n.push(e)}),R.from(n)}function Lze(e,t){let n=[];for(let r=0;r<e.childCount;r++)if(e.child(r).type.name===`tableRow`)if(n.length>0&&n[n.length-1].type.name===`table`){let t=n[n.length-1],i=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=i}else{let i=t.nodes.table.createChecked(void 0,e.child(r));n.push(i)}else n.push(e.child(r));return e=R.from(n),e}function Rze(e,t){let n=R.from(e.content);if(n=Lze(n,t.state.schema),Pze(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup(`tableContent`)&&(e=!0)}),!e&&!t.state.schema.nodes.tableParagraph.validContent(n))return new z(Fze(n,t.state.schema),0,0)}if(!zze(n,t))return new z(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if(n.child(e).type.spec.group===`blockContent`){let r=[n.child(e)];if(e+1<n.childCount&&n.child(e+1).type.name===`blockGroup`){let t=n.child(e+1).child(0).child(0);(t.type.name===`bulletListItem`||t.type.name===`numberedListItem`||t.type.name===`checkListItem`)&&(r.push(n.child(e+1)),n=Ize(n,e+1))}let i=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,i)}return new z(n,e.openStart,e.openEnd)}function zze(e,t){let n=e.childCount===1,r=e.firstChild?.type.spec.content===`inline*`,i=e.firstChild?.type.spec.content===`tableRow+`;if(n){if(r)return!1;if(i){let e=BY(t.state);if(e.isBlockContainer)return e.blockContent.node.type.spec.content!==`tableRow+`}}return!0}var Bze,Vze,m7,h7,Hze,Uze,Wze,Gze,Kze,qze,Jze,Yze,Xze,Zze,Qze,g7,$ze,eBe,tBe,nBe,rBe,iBe,aBe,oBe,sBe,cBe,lBe,uBe,dBe,fBe,pBe,mBe,_7,v7,hBe,gBe,_Be,y7,b7,x7,S7,vBe,yBe,C7,bBe,xBe,SBe,CBe,wBe,TBe,EBe,DBe,OBe,kBe,ABe,w7,jBe,MBe,NBe,PBe,FBe,IBe,LBe=o((()=>{hj(),Xj(),_X(),U$(),hNe(),LNe(),sY(),fY(),JG(),zNe(),KNe(),sK(),lG(),aPe(),RPe(),BPe(),pM(),cZ(),fG(),Ije(),PFe(),QIe(),MRe(),iMe(),qG(),Bze=Object.defineProperty,Vze=(e,t,n)=>t in e?Bze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m7=(e,t,n)=>Vze(e,typeof t==`symbol`?t:t+``,n),h7=(e,t,n,r)=>{var i;let a=e.pmSchema.nodes.blockGroup,o=a.spec.toDOM(a.create({})),s=RRe(e,t,n,r);return(i=o.contentDOM)==null||i.appendChild(s),o.dom},Hze=e=>(e.querySelectorAll(`[data-content-type="numberedListItem"]`).forEach(e=>{let t=(e.closest(`.bn-block-outer`)?.previousElementSibling)?.querySelector(`[data-content-type="numberedListItem"]`);if(!t)e.setAttribute(`data-index`,e.getAttribute(`data-start`)||`1`);else{let n=t.getAttribute(`data-index`);e.setAttribute(`data-index`,(parseInt(n||`0`)+1).toString())}}),e),Uze=e=>(e.querySelectorAll(`[data-content-type="checkListItem"] input`).forEach(e=>{e.disabled=!0}),e),Wze=e=>(e.querySelectorAll(`.bn-toggle-wrapper[data-show-children="false"]`).forEach(e=>{e.setAttribute(`data-show-children`,`true`)}),e),Gze=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{e.setAttribute(`style`,`--default-cell-min-width: 120px;`),e.setAttribute(`data-show-children`,`true`)}),e),Kze=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{var t;let n=document.createElement(`div`);n.className=`tableWrapper`;let r=document.createElement(`div`);r.className=`tableWrapper-inner`,n.appendChild(r),(t=e.parentElement)==null||t.appendChild(n),n.appendChild(e)}),e),qze=e=>(e.querySelectorAll(`.bn-inline-content:empty`).forEach(e=>{let t=document.createElement(`span`);t.className=`ProseMirror-trailingBreak`,t.setAttribute(`style`,`display: inline-block;`),e.appendChild(t)}),e),Jze=(e,t)=>{let n=pj.fromSchema(e),r=[Hze,Uze,Wze,Gze,Kze,qze];return{serializeBlocks:(e,i)=>{let a=h7(t,e,n,i);for(let e of r)a=e(a);return a.outerHTML}}},Yze=class{constructor(e){this.editor=e}get document(){return this.editor.transact(e=>khe(e.doc,this.editor.pmSchema))}getBlock(e){return this.editor.transact(t=>QRe(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>$Re(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>eze(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>tze(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse();function r(n){for(let i of n)if(e(i)===!1||!r(t?i.children.slice().reverse():i.children))return!1;return!0}r(n)}insertBlocks(e,t,n=`before`){return this.editor.transact(r=>NRe(r,e,t,n))}updateBlock(e,t){return this.editor.transact(n=>Qge(n,e,t))}removeBlocks(e){return this.editor.transact(t=>FRe(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>FRe(n,e,t))}canNestBlock(){return XRe(this.editor)}nestBlock(){JRe(this.editor)}canUnnestBlock(){return ZRe(this.editor)}unnestBlock(){YRe(this.editor)}moveBlocksUp(){return GRe(this.editor)}moveBlocksDown(){return KRe(this.editor)}},Xze=class extends dY{constructor(e){super(),this.editor=e,e.on(`create`,()=>{e._tiptapEditor.on(`update`,({transaction:t,appendedTransactions:n})=>{this.emit(`onChange`,{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on(`selectionUpdate`,({transaction:t})=>{this.emit(`onSelectionChange`,{editor:e,transaction:t})}),e._tiptapEditor.on(`mount`,()=>{this.emit(`onMount`,{editor:e})}),e._tiptapEditor.on(`unmount`,()=>{this.emit(`onUnmount`,{editor:e})})})}onChange(e,t=!0){let n=({transaction:n,appendedTransactions:r})=>{!t&&nze(n)||e(this.editor,{getChanges(){return CMe(n,r)}})};return this.on(`onChange`,n),()=>{this.off(`onChange`,n)}}onSelectionChange(e,t=!1){let n=n=>{!t&&nze(n.transaction)||e(this.editor)};return this.on(`onSelectionChange`,n),()=>{this.off(`onSelectionChange`,n)}}onMount(e){return this.on(`onMount`,e),()=>{this.off(`onMount`,e)}}onUnmount(e){return this.on(`onUnmount`,e),()=>{this.off(`onUnmount`,e)}}},Zze=null,Qze=class{constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return N6(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){return Jze(this.editor.pmSchema,this.editor).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return fze(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return IMe(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){return gze(e,this.editor.pmSchema)}pasteHTML(e,t=!1){var n;let r=e;if(!t){let t=this.tryParseHTMLToBlocks(e);r=this.blocksToFullHTML(t)}r&&((n=this.editor.prosemirrorView)==null||n.pasteHTML(r))}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=hze(e);return this.pasteHTML(t)}},g7=[`vscode-editor-data`,`blocknote/html`,`text/markdown`,`text/html`,`text/plain`,`Files`],$ze=e=>WJ.create({name:`dropFile`,addProseMirrorPlugins(){return[new uM({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of g7)if(n.dataTransfer.types.includes(e)){r=e;break}return r===null?!0:r===`Files`?(bze(n,e),!0):!1}}}})]}}),eBe=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,tBe=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,nBe=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,rBe=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,iBe=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,aBe=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,oBe=/\n{2} {0,3}-{2,48}\n{2}/,sBe=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,cBe=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,lBe=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,uBe=/^\s*\|(.+\|)+\s*$/m,dBe=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,fBe=/^\s*\|(.+\|)+\s*$/m,pBe=e=>eBe.test(e)||tBe.test(e)||nBe.test(e)||rBe.test(e)||iBe.test(e)||aBe.test(e)||oBe.test(e)||sBe.test(e)||cBe.test(e)||lBe.test(e)||uBe.test(e)||dBe.test(e)||fBe.test(e),mBe=(e,t)=>WJ.create({name:`pasteFromClipboard`,addProseMirrorPlugins(){return[new uM({props:{handleDOMEvents:{paste(n,r){if(r.preventDefault(),e.isEditable)return t({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>Sze({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]}}),_7=()=>{let e=window.getSelection();if(!e||e.isCollapsed)return!0;let t=e.focusNode;for(;t;){if(t instanceof HTMLElement&&t.getAttribute(`contenteditable`)===`false`)return!0;t=t.parentElement}return!1},v7=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=wze(t,e);n.clipboardData.setData(`blocknote/html`,r),n.clipboardData.setData(`text/html`,i),n.clipboardData.setData(`text/plain`,a)},hBe=e=>WJ.create({name:`copyToClipboard`,addProseMirrorPlugins(){return[new uM({props:{handleDOMEvents:{copy(t,n){return _7()||v7(e,t,n),!0},cut(t,n){return _7()||(v7(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection())),!0},dragstart(t,n){if(!(`node`in t.state.selection)||t.state.selection.node.type.spec.group!==`blockContent`)return;e.transact(e=>e.setSelection(new rM(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=wze(t,e);return n.dataTransfer.setData(`blocknote/html`,r),n.dataTransfer.setData(`text/html`,i),n.dataTransfer.setData(`text/plain`,a),!0}}}})]}}),gBe=WJ.create({name:`blockBackgroundColor`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{backgroundColor:vQ()}}]}}),_Be=oY.create({name:`hardBreak`,inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,UK(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
193
|
+
`}}),y7=(e,t)=>{var n;let r=e.resolve(t),i=r.depth-1,a=r.before(i),o=e.resolve(a).nodeAfter;return o?(n=o.type.spec.group)!=null&&n.includes(`bnBlock`)?zY(e.resolve(a)):y7(e,a):void 0},b7=(e,t)=>{let n=e.resolve(t),r=n.index();if(r===0)return;let i=n.posAtIndex(r-1);return zY(e.resolve(i))},x7=(e,t)=>{let n=e.resolve(t),r=n.index();if(r===n.node().childCount-1)return;let i=n.posAtIndex(r+1);return zY(e.resolve(i))},S7=(e,t)=>{for(;t.childContainer;){let n=t.childContainer.node,r=e.resolve(t.childContainer.beforePos+1).posAtIndex(n.childCount-1);t=zY(e.resolve(r))}return t},vBe=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content===`inline*`&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content===`inline*`,yBe=(e,t,n,r)=>{if(!r.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but next block is not a block container`);if(r.childContainer){let n=e.doc.resolve(r.childContainer.beforePos+1),i=e.doc.resolve(r.childContainer.afterPos-1),a=n.blockRange(i);if(t){let t=e.doc.resolve(r.bnBlock.beforePos);e.tr.lift(a,t.depth)}}if(t){if(!n.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(n.blockContent.afterPos-1,r.blockContent.beforePos+1))}return!0},C7=e=>({state:t,dispatch:n})=>{let r=zY(t.doc.resolve(e)),i=b7(t.doc,r.bnBlock.beforePos);if(!i)return!1;let a=S7(t.doc,i);return vBe(a,r)?yBe(t,n,a,r):!1},bBe=WJ.create({priority:50,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.undoInputRule(),()=>t.command(({state:e})=>{let n=BY(e);if(!n.isBlockContainer)return!1;let r=e.selection.from===n.blockContent.beforePos+1,i=n.blockContent.node.type.name===`paragraph`;return r&&!i?t.command(pQ(n.bnBlock.beforePos,{type:`paragraph`,props:{}})):!1}),()=>t.command(({state:e})=>{let n=BY(e);if(!n.isBlockContainer)return!1;let{blockContent:r}=n;return e.selection.from===r.beforePos+1?t.liftListItem(`blockContainer`):!1}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:i}=n,a=b7(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer||a.blockContent.node.type.spec.content!==`inline*`)return!1;let o=t.selection.from===i.beforePos+1,s=t.selection.empty,c=r.beforePos;return o&&s?e().command(C7(c)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=BY(e);if(!r.isBlockContainer)return!1;let i=b7(e.doc,r.bnBlock.beforePos);if(!i||i.isBlockContainer)return!1;if(n){let e=i.bnBlock.afterPos-1,n=t.doc.resolve(e-1);return t.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),t.insert(n.pos,r.bnBlock.node),t.setSelection(B.near(t.doc.resolve(n.pos+1))),!0}return!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=BY(e);if(!r.isBlockContainer||t.selection.from!==r.blockContent.beforePos+1)return!1;let i=t.doc.resolve(r.bnBlock.beforePos);if(i.nodeBefore||i.node().type.name!==`column`)return!1;let a=t.doc.resolve(r.bnBlock.beforePos),o=t.doc.resolve(a.before()),s=o.before();return n&&(t.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),f7(t,s),o.pos===s+1?(t.insert(s,r.bnBlock.node),t.setSelection(B.near(t.doc.resolve(s)))):(t.insert(o.pos-1,r.bnBlock.node),t.setSelection(B.near(t.doc.resolve(o.pos))))),!0}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;if(n.blockContent.node.childCount===0&&n.blockContent.node.type.spec.content===`inline*`){let r=b7(t.doc,n.bnBlock.beforePos);if(!r||!r.isBlockContainer)return!1;let i=e();if(n.childContainer&&i.insertContentAt(n.bnBlock.afterPos,n.childContainer?.node.content),r.blockContent.node.type.spec.content===`tableRow+`){let e=n.bnBlock.beforePos-1-1-1-1-1;i=i.setTextSelection(e)}else if(r.blockContent.node.type.spec.content===``)i=i.setNodeSelection(r.blockContent.beforePos);else{let e=r.blockContent.afterPos-1;i=i.setTextSelection(e)}return i.deleteRange({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;let r=t.selection.from===n.blockContent.beforePos+1,i=t.selection.empty,a=b7(t.doc,n.bnBlock.beforePos);if(a&&r&&i){let r=S7(t.doc,a);if(!r.isBlockContainer)return!1;if(r.blockContent.node.type.spec.content===``||r.blockContent.node.type.spec.content===`inline*`&&r.blockContent.node.childCount===0)return e().cut({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos},r.bnBlock.afterPos).deleteRange({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos}).run()}return!1})]),t=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer||!n.childContainer)return!1;let{blockContent:r,childContainer:i}=n,a=t.selection.from===r.afterPos-1,o=t.selection.empty,s=zY(t.doc.resolve(i.beforePos+1));if(!s.isBlockContainer)return!1;if(a&&o){let n=s.blockContent.node,a=n.type.spec.content===`inline*`,o=r.node.type.spec.content===`inline*`;return e().insertContentAt(s.bnBlock.afterPos,s.childContainer?.node.content||R.empty).deleteRange(i.node.childCount===1?{from:i.beforePos,to:i.afterPos}:{from:s.bnBlock.beforePos,to:s.bnBlock.afterPos}).insertContentAt(t.selection.from,a&&o?n.content:null).setTextSelection(t.selection.from).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:i}=n,a=x7(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer)return!1;let o=t.selection.from===i.afterPos-1,s=t.selection.empty,c=r.afterPos;return o&&s?e().command(C7(c)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=BY(e);if(!r.isBlockContainer)return!1;let i=x7(e.doc,r.bnBlock.beforePos);if(!i||i.isBlockContainer)return!1;if(n){let e=i.bnBlock.beforePos+1,n=t.doc.resolve(e+1);return t.delete(n.pos,n.pos+n.nodeAfter.nodeSize),f7(t,i.bnBlock.beforePos),t.insert(r.bnBlock.afterPos,n.nodeAfter),t.setSelection(B.near(t.doc.resolve(n.pos))),!0}return!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=BY(e);if(!r.isBlockContainer||t.selection.from!==r.blockContent.afterPos-1)return!1;let i=t.doc.resolve(r.bnBlock.afterPos);if(i.nodeAfter||i.node().type.name!==`column`)return!1;let a=t.doc.resolve(r.bnBlock.afterPos),o=t.doc.resolve(a.after()),s=o.after();if(n){let e=o.pos===s-1?s:o.pos+1,n=zY(t.doc.resolve(e));t.delete(n.bnBlock.beforePos,n.bnBlock.afterPos),f7(t,s-o.node().nodeSize),t.insert(a.pos,n.bnBlock.node),t.setSelection(B.near(t.doc.resolve(e)))}return!0}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;let{blockContent:r}=n,i=t.selection.from===r.afterPos-1,a=t.selection.empty;if(i&&a){let i=(e,t)=>{let n=x7(e,t);if(n)return n;let r=y7(e,t);if(r)return i(e,r.bnBlock.beforePos)},a=i(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer)return!1;let o=a.blockContent.node,s=o.type.spec.content===`inline*`,c=r.node.type.spec.content===`inline*`;return e().insertContentAt(a.bnBlock.afterPos,a.childContainer?.node.content||R.empty).deleteRange({from:a.bnBlock.beforePos,to:a.bnBlock.afterPos}).insertContentAt(t.selection.from,s&&c?o.content:null).setTextSelection(t.selection.from).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;if(n.blockContent.node.childCount===0&&n.blockContent.node.type.spec.content===`inline*`){let r=x7(t.doc,n.bnBlock.beforePos);if(!r||!r.isBlockContainer)return!1;let i=e();if(r.blockContent.node.type.spec.content===`tableRow+`){let e=n.bnBlock.afterPos+1+1+1+1+1;i=i.setTextSelection(e)}else i=r.blockContent.node.type.spec.content===``?i.setNodeSelection(r.blockContent.beforePos):i.setTextSelection(r.blockContent.beforePos+1);return i.deleteRange({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=BY(t);if(!n.isBlockContainer)return!1;let r=t.selection.from===n.blockContent.afterPos-1,i=t.selection.empty,a=x7(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer)return!1;if(a&&r&&i&&(a.blockContent.node.type.spec.content===``||a.blockContent.node.type.spec.content===`inline*`&&a.blockContent.node.childCount===0)){let t=a.bnBlock.node.lastChild.content;return e().deleteRange({from:a.bnBlock.beforePos,to:a.bnBlock.afterPos}).insertContentAt(n.bnBlock.afterPos,a.bnBlock.node.childCount===2?t:null).run()}return!1})]),n=(e=!1)=>this.editor.commands.first(({commands:t,tr:n})=>[()=>t.command(({state:e})=>{let n=BY(e);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:i}=n,{depth:a}=e.doc.resolve(r.beforePos),o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=i.node.childCount===0;return o&&s&&c&&a>1?t.liftListItem(`blockContainer`):!1}),()=>t.command(({state:t})=>{let r=BY(t),i=this.options.editor.schema.blockSchema[r.blockNoteType].meta?.hardBreakShortcut??`shift+enter`;if(i===`none`)return!1;if(i===`shift+enter`&&e||i===`enter`){let e=n.storedMarks||n.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return n.insert(n.selection.head,n.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>t.command(({state:e,dispatch:t,tr:n})=>{let r=BY(e);if(!r.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=r,o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=a.node.childCount===0;if(o&&s&&c){let a=i.afterPos,o=a+2;if(t){let t=e.schema.nodes.blockContainer.createAndFill(void 0,[e.schema.nodes.paragraph.createAndFill()||void 0,r.childContainer?.node].filter(e=>e!==void 0));n.insert(a,t).setSelection(new B(n.doc.resolve(o))).scrollIntoView(),r.childContainer&&n.delete(r.childContainer.beforePos,r.childContainer.afterPos)}return!0}return!1}),()=>t.command(({state:e,chain:t})=>{let n=BY(e);if(!n.isBlockContainer)return!1;let{blockContent:r}=n,i=e.selection.$anchor.parentOffset===0;return r.node.childCount===0?!1:(t().deleteSelection().command(r$(e.selection.from,i,i)).run(),!0)})]);return{Backspace:e,Delete:t,Enter:()=>n(),"Shift-Enter":()=>n(!0),Tab:()=>{var e;return this.options.tabBehavior!==`prefer-indent`&&((e=this.options.editor.getExtension(z6))!=null&&e.store.state||this.options.editor.getExtension(xQ)?.store.state!==void 0)?!1:JRe(this.options.editor)},"Shift-Tab":()=>{var e;return this.options.tabBehavior!==`prefer-indent`&&((e=this.options.editor.getExtension(z6))!=null&&e.store.state||this.options.editor.getExtension(xQ)?.store.state!==void 0)?!1:this.editor.commands.liftListItem(`blockContainer`)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo()}}}),xBe=LJ.create({name:`insertion`,inclusive:!1,excludes:`deletion modification insertion`,addAttributes(){return{id:{default:null,validate:`number`}}},extendMarkSchema(e){return e.name===`insertion`?{blocknoteIgnore:!0,inclusive:!1,toDOM(e,t){return[`ins`,{"data-id":String(e.attrs.id),"data-inline":String(t),...!t&&{style:`display: contents`}},0]},parseDOM:[{tag:`ins`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10)}:!1}}]}:{}}}),SBe=LJ.create({name:`deletion`,inclusive:!1,excludes:`insertion modification deletion`,addAttributes(){return{id:{default:null,validate:`number`}}},extendMarkSchema(e){return e.name===`deletion`?{blocknoteIgnore:!0,inclusive:!1,toDOM(e,t){return[`del`,{"data-id":String(e.attrs.id),"data-inline":String(t),...!t&&{style:`display: contents`}},0]},parseDOM:[{tag:`del`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10)}:!1}}]}:{}}}),CBe=LJ.create({name:`modification`,inclusive:!1,excludes:`deletion insertion`,addAttributes(){return{id:{default:null,validate:`number`},type:{validate:`string`},attrName:{default:null,validate:`string|null`},previousValue:{default:null},newValue:{default:null}}},extendMarkSchema(e){return e.name===`modification`?{blocknoteIgnore:!0,inclusive:!1,toDOM(e,t){return[t?`span`:`div`,{"data-type":`modification`,"data-id":String(e.attrs.id),"data-mod-type":e.attrs.type,"data-mod-prev-val":JSON.stringify(e.attrs.previousValue),"data-mod-new-val":JSON.stringify(e.attrs.newValue)},0]},parseDOM:[{tag:`span[data-type='modification']`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10),type:e.dataset.modType,previousValue:e.dataset.modPrevVal,newValue:e.dataset.modNewVal}:!1}},{tag:`div[data-type='modification']`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10),type:e.dataset.modType,previousValue:e.dataset.modPrevVal}:!1}}]}:{}}}),wBe=WJ.create({name:`textAlignment`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{textAlignment:{default:`left`,parseHTML:e=>e.getAttribute(`data-text-alignment`),renderHTML:e=>e.textAlignment===`left`?{}:{"data-text-alignment":e.textAlignment}}}}]}}),TBe=WJ.create({name:`blockTextColor`,addGlobalAttributes(){return[{types:[`table`,`tableCell`,`tableHeader`],attributes:{textColor:yQ()}}]}}),EBe={blockColor:`data-block-color`,blockStyle:`data-block-style`,id:`data-id`,depth:`data-depth`,depthChange:`data-depth-change`},DBe=oY.create({name:`blockContainer`,group:`blockGroupChild bnBlock`,content:`blockContent blockGroup?`,priority:50,defining:!0,marks:`insertion modification deletion`,parseHTML(){return[{tag:`div[data-node-type=`+this.name+`]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t={};for(let[n,r]of Object.entries(EBe))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t}},{tag:`div[data-node-type="blockOuter"]`,skip:!0}]},renderHTML({HTMLAttributes:e}){let t=document.createElement(`div`);t.className=`bn-block-outer`,t.setAttribute(`data-node-type`,`blockOuter`);for(let[n,r]of Object.entries(e))n!==`class`&&t.setAttribute(n,r);let n={...this.options.domAttributes?.block||{},...e},r=document.createElement(`div`);r.className=FZ(`bn-block`,n.class),r.setAttribute(`data-node-type`,this.name);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);return t.appendChild(r),{dom:t,contentDOM:r}}}),OBe=oY.create({name:`blockGroup`,group:`childContainer`,content:`blockGroupChild+`,marks:`deletion insertion modification`,parseHTML(){return[{tag:`div`,getAttrs:e=>typeof e==`string`?!1:e.getAttribute(`data-node-type`)===`blockGroup`?null:!1}]},renderHTML({HTMLAttributes:e}){let t={...this.options.domAttributes?.blockGroup||{},...e},n=document.createElement(`div`);n.className=FZ(`bn-block-group`,t.class),n.setAttribute(`data-node-type`,`blockGroup`);for(let[e,r]of Object.entries(t))e!==`class`&&n.setAttribute(e,r);return{dom:n,contentDOM:n}}}),kBe=oY.create({name:`doc`,topNode:!0,content:`blockGroup`,marks:`insertion modification deletion`}),ABe=oG(({options:e})=>({key:`collaboration`,blockNoteExtensions:[$Me(e),F6(e),I6(e),L6(),nNe(e)]})),w7=!1,jBe=class{constructor(e,t){m7(this,`disabledExtensions`,new Set),m7(this,`extensions`,[]),m7(this,`abortMap`,new Map),m7(this,`extensionFactories`,new Map),m7(this,`extensionPlugins`,new Map),this.editor=e,this.options=t,e.onMount(()=>{for(let t of this.extensions)if(t.mount){let n=new window.AbortController,r=t.mount({dom:e.prosemirrorView.dom,root:e.prosemirrorView.root,signal:n.signal});r&&n.signal.addEventListener(`abort`,()=>{r()}),this.abortMap.set(t,n)}}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]);for(let e of Eze(this.editor,this.options))this.addExtension(e);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}registerExtension(e){var t;let n=[].concat(e).filter(Boolean);if(!n.length){console.warn(`No extensions found to register`,e);return}let r=n.map(e=>this.addExtension(e)).filter(Boolean),i=new Set;for(let e of r)e!=null&&e.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),(t=e?.inputRules)!=null&&t.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{i.add(e)});this.updatePlugins(e=>[...e,...i])}addExtension(e){let t;if(t=typeof e==`function`?e({editor:this.editor}):e,!(!t||this.disabledExtensions.has(t.key))){if(typeof e==`function`){let e=t[cG];typeof e==`function`&&this.extensionFactories.set(e,t)}if(this.extensions.push(t),t.blockNoteExtensions)for(let e of t.blockNoteExtensions)this.addExtension(e);return t}}resolveExtensions(e){let t=[];if(typeof e==`function`){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if(typeof e==`object`&&`key`in e)t.push(e);else if(typeof e==`string`){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){var t;let n=this.resolveExtensions(e);if(!n.length){console.warn(`No extensions found to unregister`,e);return}let r=!1,i=new Set;for(let a of n)this.extensions=this.extensions.filter(e=>e!==a),this.extensionFactories.forEach((e,t)=>{e===a&&this.extensionFactories.delete(t)}),(t=this.abortMap.get(a))==null||t.abort(),this.abortMap.delete(a),this.extensionPlugins.get(a)?.forEach(e=>{i.add(e)}),this.extensionPlugins.delete(a),a.tiptapExtensions&&!r&&(r=!0,console.warn(`Extension ${a.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));this.updatePlugins(e=>e.filter(e=>!i.has(e)))}updatePlugins(e){let t=this.editor.prosemirrorState,n=t.reconfigure({plugins:e(t.plugins.slice())});this.editor.prosemirrorView.updateState(n)}getTiptapExtensions(){let e=Tze(this.editor,this.options).filter(e=>!this.disabledExtensions.has(e.name)),t=MNe(this.extensions),n=new Map;for(let r of this.extensions){r.tiptapExtensions&&e.push(...r.tiptapExtensions);let i=t(r.key),{plugins:a,inputRules:o}=this.getProsemirrorPluginsFromExtension(r);a.length&&e.push(WJ.create({name:r.key,priority:i,addProseMirrorPlugins:()=>a})),o.length&&(n.has(i)||n.set(i,[]),n.get(i).push(...o))}e.push(WJ.create({name:`blocknote-input-rules`,addProseMirrorPlugins(){let e=[];return Array.from(n.keys()).sort().reverse().forEach(t=>{e.push(...n.get(t))}),[VNe({rules:e})]}}));for(let t of this.options._tiptapOptions?.extensions??[])e.push(t);return e}getProsemirrorPluginsFromExtension(e){var t,n,r;let i=[...e.prosemirrorPlugins??[]],a=[];return!((t=e.prosemirrorPlugins)!=null&&t.length)&&!Object.keys(e.keyboardShortcuts||{}).length&&!((n=e.inputRules)!=null&&n.length)?{plugins:i,inputRules:a}:(this.extensionPlugins.set(e,i),(r=e.inputRules)!=null&&r.length&&a.push(...e.inputRules.map(e=>new n8(e.find,(t,n,r,i)=>{let a=e.replace({match:n,range:{from:r,to:i},editor:this.editor});if(a){let e=this.editor.getTextCursorPosition();if(this.editor.schema.blockSchema[e.block.type].content!==`inline`)return null;let n=VY(t.tr),o=t.tr.deleteRange(r,i);return YZ(o,n.bnBlock.beforePos,a),o}return null}))),Object.keys(e.keyboardShortcuts||{}).length&&i.push(nK(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e,t])=>[e,()=>t({editor:this.editor})])))),{plugins:i,inputRules:a})}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if(typeof e==`string`)return this.extensions.find(t=>t.key===e)||void 0;if(typeof e==`function`)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return typeof e==`string`?this.extensions.some(t=>t.key===e):typeof e==`object`&&`key`in e?this.extensions.some(t=>t.key===e.key):typeof e==`function`?this.extensionFactories.has(e):!1}},MBe=class{constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>Oze(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>Aze(t,e))}setSelection(e,t){return this.editor.transact(n=>kze(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>jze(e))}setTextCursorPosition(e,t=`start`){return this.editor.transact(n=>Mze(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if(Zme(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return cq(this.editor.prosemirrorView,n,r).toJSON()}},NBe=class{constructor(e){m7(this,`activeTransaction`,null),m7(this,`isInCan`,!1),this.editor=e}can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");if(this.isInCan)return this.canExec(e);let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,e=>this.prosemirrorView.dispatch(e),n)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,void 0,n)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){var e;(e=this.prosemirrorView)==null||e.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return!1}return this.editor._tiptapEditor.isEditable===void 0?!0:this.editor._tiptapEditor.isEditable}set isEditable(e){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return}this.editor._tiptapEditor.options.editable!==e&&this.editor._tiptapEditor.setEditable(e)}undo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.undoCommand);throw Error(`No undo plugin found`)}redo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.redoCommand);throw Error(`No redo plugin found`)}},PBe=class{constructor(e){this.editor=e}insertInlineContent(e,{updateSelection:t=!1}={}){let n=dX(e,this.editor.pmSchema);this.editor.transact(e=>{Nze(e,{from:e.selection.from,to:e.selection.to},n,{updateSelection:t})})}getActiveStyles(){return this.editor.transact(e=>{let t={},n=e.selection.$to.marks();for(let e of n){let n=this.editor.schema.styleSchema[e.type.name];if(!n){e.type.name!==`link`&&!e.type.spec.blocknoteIgnore&&console.warn(`mark not found in styleschema`,e.type.name);continue}n.propSchema===`boolean`?t[n.type]=!0:t[n.type]=e.attrs.stringValue}return t})}addStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.setMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.setMark(t,{stringValue:n});else throw new gX(e.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.toggleMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.toggleMark(t,{stringValue:n});else throw new gX(e.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getSelectedLinkUrl(){return this.editor._tiptapEditor.getAttributes(`link`).href}createLink(e,t){if(e===``)return;let n=this.editor.pmSchema.mark(`link`,{href:e});this.editor.transact(e=>{let{from:r,to:i}=e.selection;t?e.insertText(t,r,i).addMark(r,r+t.length,n):e.setSelection(B.create(e.doc,i)).addMark(r,i,n)})}},FBe={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},IBe=class e extends dY{constructor(e){super(),m7(this,`pmSchema`),m7(this,`_tiptapEditor`),m7(this,`elementRenderer`,null),m7(this,`blockCache`,new WeakMap),m7(this,`dictionary`),m7(this,`schema`),m7(this,`blockImplementations`),m7(this,`inlineContentImplementations`),m7(this,`styleImplementations`),m7(this,`uploadFile`),m7(this,`onUploadStartCallbacks`,[]),m7(this,`onUploadEndCallbacks`,[]),m7(this,`resolveFileUrl`),m7(this,`settings`),m7(this,`_blockManager`),m7(this,`_eventManager`),m7(this,`_exportManager`),m7(this,`_extensionManager`),m7(this,`_selectionManager`),m7(this,`_stateManager`),m7(this,`_styleManager`),m7(this,`unregisterExtension`,(...e)=>this._extensionManager.unregisterExtension(...e)),m7(this,`registerExtension`,(...e)=>this._extensionManager.registerExtension(...e)),m7(this,`getExtension`,(...e)=>this._extensionManager.getExtension(...e)),m7(this,`mount`,e=>{this._tiptapEditor.mount({mount:e})}),m7(this,`unmount`,()=>{this._tiptapEditor.unmount()}),this.options=e,this.dictionary=e.dictionary||RNe,this.settings={tables:{splitCells:e?.tables?.splitCells??!1,cellBackgroundColor:e?.tables?.cellBackgroundColor??!1,cellTextColor:e?.tables?.cellTextColor??!1,headers:e?.tables?.headers??!1}};let t={defaultStyles:!0,schema:e.schema||t8.create(),...e,placeholders:{...this.dictionary.placeholders,...e.placeholders}};if(this.schema=t.schema,this.blockImplementations=t.schema.blockSpecs,this.inlineContentImplementations=t.schema.inlineContentSpecs,this.styleImplementations=t.schema.styleSpecs,t.uploadFile){let e=t.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=t.resolveFileUrl,this._eventManager=new Xze(this),this._extensionManager=new jBe(this,t);let n=this._extensionManager.getTiptapExtensions(),r=this._extensionManager.hasExtension(`ySync`)||this._extensionManager.hasExtension(`liveblocksExtension`);r&&t.initialContent&&console.warn(`When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider`);let i={...FBe,...t._tiptapOptions,element:null,autofocus:t.autofocus??!1,extensions:n,editorProps:{...t._tiptapOptions?.editorProps,attributes:{tabIndex:`0`,...t._tiptapOptions?.editorProps?.attributes,...t.domAttributes?.editor,class:FZ(`bn-editor`,t.defaultStyles?`bn-default-styles`:``,t.domAttributes?.editor?.class||``)},transformPasted:Rze}};try{let e=t.initialContent||(r?[{type:`paragraph`,id:`initialBlockId`}]:[{type:`paragraph`,id:hX.options.generateID()}]);if(!Array.isArray(e)||e.length===0)throw Error(`initialContent must be a non-empty array of blocks, received: `+e);let n=Gme(i.extensions),a=OK({type:`doc`,content:[{type:`blockGroup`,content:e.map(e=>mX(e,n,this.schema.styleSchema).toJSON())}]},n,i.parseOptions);this._tiptapEditor=new iY({...i,content:a.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}let a,o=this.pmSchema.nodes.doc.createAndFill;this.pmSchema.nodes.doc.createAndFill=(...e)=>{if(a)return a;let t=o.apply(this.pmSchema.nodes.doc,e),n=JSON.parse(JSON.stringify(t.toJSON()));return n.content[0].content[0].attrs.id=`initialBlockId`,a=ej.fromJSON(this.pmSchema,n),a},this.pmSchema.cached.blockNoteEditor=this,this._blockManager=new Yze(this),this._exportManager=new Qze(this),this._selectionManager=new MBe(this),this._stateManager=new NBe(this),this._styleManager=new PBe(this),this.emit(`create`)}static create(t){return new e(t??{})}get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}isFocused(){return this.headless?!1:this.prosemirrorView?.hasFocus()||!1}get headless(){return!this._tiptapEditor.isInitialized}focus(){this.headless||this.prosemirrorView.focus()}blur(){var e;this.headless||(e=this.domElement)==null||e.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on(`update`,e)}onEditorSelectionChange(e){this._tiptapEditor.on(`selectionUpdate`,e)}onBeforeChange(e){return this._extensionManager.getExtension(P6).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t=`start`){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n=`before`){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(){return this._blockManager.moveBlocksUp()}moveBlocksDown(){return this._blockManager.moveBlocksDown()}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onMount(e){this._eventManager.onMount(e)}onUnmount(e){this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return e.length===0||e.length===1&&e[0].type===`paragraph`&&e[0].content.length===0}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}}}));function RBe(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:HBe.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}function zBe({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,O7.useMemo)(()=>({editor:r}),[r]),a=(0,O7.useMemo)(()=>({editor:r}),[r]);return(0,k7.jsx)(A7.Provider,{value:a,children:(0,k7.jsx)(j7.Provider,{value:i,children:n})})}function BBe({...e}){let{editor:t}=tVe();return(0,k7.jsx)(ZBe,{editor:t,...e})}var VBe,T7,HBe,UBe,E7,D7,WBe,GBe,KBe,O7,k7,qBe,JBe,YBe,XBe,ZBe,QBe,A7,$Be,eVe,j7,tVe,nVe=o((()=>{VBe=u(p(),1),T7=u(p(),1),HBe=u(_(),1),UBe=$6(),E7=N(),p(),$6(),p(),yNe(),N(),D7=u(p(),1),N(),WBe=u(p(),1),GBe=N(),KBe=u(p(),1),p(),_(),N(),N(),sY(),p(),N(),O7=u(p(),1),k7=N(),sY(),qBe=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},JBe=({contentComponent:e})=>{let t=(0,UBe.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,E7.jsx)(E7.Fragment,{children:Object.values(t)})},YBe=class extends T7.Component{constructor(e){super(e),this.editorContentRef=T7.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=RBe(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,E7.jsxs)(E7.Fragment,{children:[(0,E7.jsx)(`div`,{ref:qBe(t,this.editorContentRef),...n}),e?.contentComponent&&(0,E7.jsx)(JBe,{contentComponent:e.contentComponent})]})}},XBe=(0,T7.forwardRef)((e,t)=>{let n=T7.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return T7.createElement(YBe,{key:n,innerRef:t,...e})}),ZBe=T7.memo(XBe),QBe=typeof window>`u`,QBe||typeof window<`u`&&window.next,A7=(0,VBe.createContext)({editor:null}),A7.Consumer,$Be=(0,D7.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),eVe=()=>(0,D7.useContext)($Be),WBe.forwardRef((e,t)=>{let{onDragStart:n}=eVe();return(0,GBe.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),KBe.createContext({markViewContentRef:()=>{}}),j7=(0,O7.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}}),j7.displayName=`TiptapContext`,tVe=()=>(0,O7.useContext)(j7),zBe.displayName=`Tiptap`,BBe.displayName=`Tiptap.Content`,Object.assign(zBe,{Content:BBe})}));function M7(e){return(0,Z.useContext)(Z7)}function N7(e){let t=M7();if(!(t!=null&&t.editor))throw Error(`useBlockNoteEditor was called outside of a BlockNoteContext provider or BlockNoteView component`);return t.editor}function P7(e,t){let n=(t?.editor??N7()).getExtension(e);if(!n)throw Error(`Extension not found`,{cause:{plugin:e}});return n}function F7(e,t){let{store:n}=P7(e,t);if(!n)throw Error(`Store not found on plugin`,{cause:{plugin:e}});return bNe(n,t?.selector)}function rVe(e){let t=new DOMRect,n=`getBoundingClientRect`in e?()=>e.getBoundingClientRect():()=>e.element.getBoundingClientRect();return()=>e.element&&(e.cacheMountedBoundingClientRect??!0)?(e.element.isConnected&&(t=n()),t):n()}function I7(){return(0,Z.useContext)(e9)}function L7(){return M7().editor.dictionary}function iVe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function aVe(){if(JHe)return a9;JHe=1;var e=Z.default;function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var n=typeof Object.is==`function`?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),l=s[0].inst,u=s[1];return a(function(){l.value=n,l.getSnapshot=t,c(l)&&u({inst:l})},[e,n,t]),i(function(){return c(l)&&u({inst:l}),e(function(){c(l)&&u({inst:l})})},[e]),o(n),n}function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch{return!0}}function l(e,t){return t()}var u=typeof window>`u`||typeof window.document>`u`||typeof window.document.createElement>`u`?l:s;return a9.useSyncExternalStore=e.useSyncExternalStore===void 0?u:e.useSyncExternalStore,a9}function oVe(){return YHe||(YHe=1,i9.exports=aVe()),i9.exports}function sVe(){if(XHe)return r9;XHe=1;var e=Z.default,t=oVe();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,s=e.useMemo,c=e.useDebugValue;return r9.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p},r9}function R7(e){let t=M7(),n=e.editor||t?.editor||null,r=e.on||`all`,[i]=(0,Z.useState)(()=>new $He(n)),a=ZHe.useSyncExternalStoreWithSelector(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,e.equalityFn??qHe);return QHe(()=>i.watch(n,r),[n,i,r]),(0,Z.useDebugValue)(a),a}function cVe(e,t){if(e==null)return{};var n=lVe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lVe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function z7(){return z7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z7.apply(this,arguments)}function uVe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uVe(Object(n),!0).forEach(function(t){dVe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uVe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dVe(e,t,n){return t=fVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fVe(e){var t=pVe(e,`string`);return typeof t==`symbol`?t:t+``}function pVe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function mVe(e){return e&&e.map((e,t)=>Z.createElement(e.tag,B7({key:t},e.attr),mVe(e.child)))}function V7(e){return t=>Z.createElement(hVe,z7({attr:B7({},e.attr)},t),mVe(e.child))}function hVe(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=cVe(e,eUe),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),Z.createElement(`svg`,z7({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:B7(B7({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&Z.createElement(`title`,null,i),e.children)};return c9===void 0?t(s9):Z.createElement(c9.Consumer,null,e=>t(e))}function gVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 7V11L2 6L8 1V5H13C17.4183 5 21 8.58172 21 13C21 17.4183 17.4183 21 13 21H4V19H13C16.3137 19 19 16.3137 19 13C19 9.68629 16.3137 7 13 7H8Z`},child:[]}]})(e)}function _Ve(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.29117 20.8242L2 22L3.17581 16.7088C2.42544 15.3056 2 13.7025 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C10.2975 22 8.6944 21.5746 7.29117 20.8242ZM7.58075 18.711L8.23428 19.0605C9.38248 19.6745 10.6655 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 13.3345 4.32549 14.6175 4.93949 15.7657L5.28896 16.4192L4.63416 19.3658L7.58075 18.711Z`},child:[]}]})(e)}function vVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.24264 17.9967H3V13.754L14.435 2.319C14.8256 1.92848 15.4587 1.92848 15.8492 2.319L18.6777 5.14743C19.0682 5.53795 19.0682 6.17112 18.6777 6.56164L7.24264 17.9967ZM3 19.9967H21V21.9967H3V19.9967Z`},child:[]}]})(e)}function yVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z`},child:[]}]})(e)}function bVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z`},child:[]}]})(e)}function xVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z`},child:[]}]})(e)}function SVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z`},child:[]}]})(e)}function CVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z`},child:[]}]})(e)}function wVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z`},child:[]}]})(e)}function TVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z`},child:[]}]})(e)}function EVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z`},child:[]}]})(e)}function DVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5.55397 22H3.3999L10.9999 3H12.9999L20.5999 22H18.4458L16.0458 16H7.95397L5.55397 22ZM8.75397 14H15.2458L11.9999 5.88517L8.75397 14Z`},child:[]}]})(e)}function H7(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z`},child:[]}]})(e)}function U7(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z`},child:[]}]})(e)}function W7(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function OVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM22 8V16H23.5V18H22V20H20V18H14.5V16.66L19.5 8H22ZM20 11.133L17.19 16H20V11.133Z`},child:[]}]})(e)}function kVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8V10H17.6769L17.2126 12.6358C17.5435 12.5472 17.8912 12.5 18.25 12.5C20.4591 12.5 22.25 14.2909 22.25 16.5C22.25 18.7091 20.4591 20.5 18.25 20.5C16.4233 20.5 14.8827 19.2756 14.4039 17.6027L16.3271 17.0519C16.5667 17.8881 17.3369 18.5 18.25 18.5C19.3546 18.5 20.25 17.6046 20.25 16.5C20.25 15.3954 19.3546 14.5 18.25 14.5C17.6194 14.5 17.057 14.7918 16.6904 15.2478L14.8803 14.3439L16 8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function AVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21.097 8L18.499 12.5C20.7091 12.5 22.5 14.2909 22.5 16.5C22.5 18.7091 20.7091 20.5 18.5 20.5C16.2909 20.5 14.5 18.7091 14.5 16.5C14.5 15.7636 14.699 15.0737 15.0461 14.4811L18.788 8H21.097ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 14.5C17.3954 14.5 16.5 15.3954 16.5 16.5C16.5 17.6046 17.3954 18.5 18.5 18.5C19.6046 18.5 20.5 17.6046 20.5 16.5C20.5 15.3954 19.6046 14.5 18.5 14.5Z`},child:[]}]})(e)}function jVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z`},child:[]}]})(e)}function MVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z`},child:[]}]})(e)}function NVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z`},child:[]}]})(e)}function PVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z`},child:[]}]})(e)}function FVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z`},child:[]}]})(e)}function IVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z`},child:[]}]})(e)}function LVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z`},child:[]}]})(e)}function RVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function zVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM4.5 6.5C3.67157 6.5 3 5.82843 3 5C3 4.17157 3.67157 3.5 4.5 3.5C5.32843 3.5 6 4.17157 6 5C6 5.82843 5.32843 6.5 4.5 6.5ZM4.5 13.5C3.67157 13.5 3 12.8284 3 12C3 11.1716 3.67157 10.5 4.5 10.5C5.32843 10.5 6 11.1716 6 12C6 12.8284 5.32843 13.5 4.5 13.5ZM4.5 20.4C3.67157 20.4 3 19.7284 3 18.9C3 18.0716 3.67157 17.4 4.5 17.4C5.32843 17.4 6 18.0716 6 18.9C6 19.7284 5.32843 20.4 4.5 20.4ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function BVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z`},child:[]}]})(e)}function VVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z`},child:[]}]})(e)}function HVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 4H3V6H21V4ZM21 11H8V13H21V11ZM21 18H8V20H21V18ZM5 11H3V20H5V11Z`},child:[]}]})(e)}function UVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z`},child:[]}]})(e)}function WVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 10V14H19V10H13ZM11 10H5V14H11V10ZM13 19H19V16H13V19ZM11 19V16H5V19H11ZM13 5V8H19V5H13ZM11 5H5V8H11V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z`},child:[]}]})(e)}function G7(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 6V21H11V6H5V4H19V6H13Z`},child:[]}]})(e)}function GVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z`},child:[]}]})(e)}function KVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z`},child:[]}]})(e)}function qVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z`},child:[]}]})(e)}function JVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 15V18H24V20H21V23H19V20H16V18H19V15H21ZM21.0082 3C21.556 3 22 3.44495 22 3.9934L22.0007 13.3417C21.3749 13.1204 20.7015 13 20 13V5H4L4.001 19L13.2929 9.70715C13.6528 9.34604 14.22 9.31823 14.6123 9.62322L14.7065 9.70772L18.2521 13.2586C15.791 14.0069 14 16.2943 14 19C14 19.7015 14.1204 20.3749 14.3417 21.0007L2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082ZM8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7Z`},child:[]}]})(e)}function YVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L12.0012 14.7562L11.995 18.995L16.2414 19.0012L17.571 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z`},child:[]}]})(e)}function XVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 18V20H2V18H22ZM2 3.5L10 8.5L2 13.5V3.5ZM22 11V13H12V11H22ZM22 4V6H12V4H22Z`},child:[]}]})(e)}function ZVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z`},child:[]}]})(e)}function QVe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z`},child:[]}]})(e)}function $Ve(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z`},child:[]}]})(e)}function eHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function tHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function nHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z`},child:[]}]})(e)}function rHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V12L17.206 8.207L11.2071 14.2071L9.79289 12.7929L15.792 6.793L12 3H21Z`},child:[]}]})(e)}function iHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z`},child:[]}]})(e)}function aHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11V13H19V11H5Z`},child:[]}]})(e)}function oHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13H8ZM8 11C8.82843 11 9.5 10.3284 9.5 9.5C9.5 8.67157 8.82843 8 8 8C7.17157 8 6.5 8.67157 6.5 9.5C6.5 10.3284 7.17157 11 8 11ZM16 11C16.8284 11 17.5 10.3284 17.5 9.5C17.5 8.67157 16.8284 8 16 8C15.1716 8 14.5 8.67157 14.5 9.5C14.5 10.3284 15.1716 11 16 11Z`},child:[]}]})(e)}function sHe(e){return V7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z`},child:[]}]})(e)}function cHe(e,t){return e in t.schema.styleSchema&&t.schema.styleSchema[e].type===e&&t.schema.styleSchema[e].propSchema===`boolean`}function K7(e,t){return`${e}Color`in t.schema.styleSchema&&t.schema.styleSchema[`${e}Color`].type===`${e}Color`&&t.schema.styleSchema[`${e}Color`].propSchema===`string`}function lHe(e){return`link`in e.schema.inlineContentSchema&&e.schema.inlineContentSchema.link===`link`}function q7(e,t){try{let n=new URL(e,t);if(n.protocol!==`javascript:`)return n.href}catch{}return`#`}function uHe(e){return V7({attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z`},child:[]},{tag:`path`,attr:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z`},child:[]}]})(e)}function dHe(e){return V7({attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`},child:[]}]})(e)}function fHe(e){return V7({attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m7 10 5 5 5-5z`},child:[]}]})(e)}async function pHe(e,t){return(await WMe(e,t)).map(({id:e,onItemClick:t})=>({id:e,onItemClick:t,icon:e}))}function mHe(e){let t=I7(),n=L7(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o,columns:s}=e,c=i===`loading-initial`||i===`loading`?(0,Q.jsx)(t.GridSuggestionMenu.Loader,{className:`bn-grid-suggestion-menu-loader`,columns:s}):null,l=(0,Z.useMemo)(()=>{let e=[];for(let n=0;n<r.length;n++){let i=r[n];e.push((0,Q.jsx)(t.GridSuggestionMenu.Item,{className:`bn-grid-suggestion-menu-item`,item:i,id:`bn-grid-suggestion-menu-item-${n}`,isSelected:n===a,onClick:()=>o?.(i)},i.id))}return e},[t,r,o,a]);return(0,Q.jsxs)(t.GridSuggestionMenu.Root,{id:`bn-grid-suggestion-menu`,columns:s,className:`bn-grid-suggestion-menu`,children:[c,l,l.length===0&&e.loadingState===`loaded`&&(0,Q.jsx)(t.GridSuggestionMenu.EmptyItem,{className:`bn-grid-suggestion-menu-empty-item`,columns:s,children:n.suggestion_menu.no_items_title})]})}function hHe(e,t,n,r=3){let i=(0,Z.useRef)(0);(0,Z.useEffect)(()=>{t!==void 0&&(e.length>0?i.current=t.length:t.length-i.current>r&&n())},[n,r,e.length,t])}function gHe(e,t){let[n,r]=(0,Z.useState)([]),[i,a]=(0,Z.useState)(!1),o=(0,Z.useRef)(void 0),s=(0,Z.useRef)(void 0);return(0,Z.useEffect)(()=>{let n=e;o.current=e,a(!0),t(e).then(e=>{o.current===n&&(r(e),a(!1),s.current=n)})},[e,t]),{items:n||[],usedQuery:s.current,loadingState:s.current===void 0?`loading-initial`:i?`loading`:`loaded`}}function _He(e,t,n,r,i){let[a,o]=(0,Z.useState)(0),s=r!==void 0&&r>1;return(0,Z.useEffect)(()=>{let t=e=>(e.key===`ArrowLeft`&&(e.preventDefault(),n.length&&o((a-1+n.length)%n.length)),e.key===`ArrowRight`&&(e.preventDefault(),n.length&&o((a+1+n.length)%n.length)),e.key===`ArrowUp`?(e.preventDefault(),n.length&&o((a-r+n.length)%n.length),!0):e.key===`ArrowDown`?(e.preventDefault(),n.length&&o((a+r)%n.length),!0):e.key===`Enter`&&!e.isComposing?(e.stopPropagation(),e.preventDefault(),n.length&&i?.(n[a]),!0):!1),s=e.domElement;return s?.addEventListener(`keydown`,t,!0),()=>{s?.removeEventListener(`keydown`,t,!0)}},[e.domElement,n,a,i,r,s]),(0,Z.useEffect)(()=>{o(0)},[t]),{selectedIndex:n.length===0?void 0:a}}function vHe(e){let t=M7().setContentEditableProps,n=N7(),{getItems:r,gridSuggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c,columns:l}=e,u=(0,Z.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:d,usedQuery:f,loadingState:p}=gHe(a,r);hHe(d,f,s);let{selectedIndex:m}=_He(n,a,d,l,u);return(0,Z.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,Z.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":m?`bn-suggestion-menu-item-`+m:void 0})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,m]),(0,Q.jsx)(i,{items:d,onItemClick:u,loadingState:p,selectedIndex:m,columns:l})}function yHe(e){let t=N7(),{triggerCharacter:n,gridSuggestionMenuComponent:r,columns:i,shouldOpen:a,minQueryLength:o,onItemClick:s,getItems:c}=e,l=(0,Z.useMemo)(()=>s||(e=>{e.onItemClick(t)}),[t,s]),u=(0,Z.useMemo)(()=>c||(async e=>await pHe(t,e)),[t,c]),d=P7(I$);(0,Z.useEffect)(()=>{d.addSuggestionMenu({triggerCharacter:n,shouldOpen:a})},[d,n,a]);let f=F7(I$),p=F7(I$,{selector:e=>({element:t.domElement?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),m=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:f?.show&&f?.triggerCharacter===n,onOpenChange:e=>{e||d.closeMenu()},placement:`bottom-start`,middleware:[np(10),sp({allowedPlacements:[`bottom-start`,`top-start`],padding:10}),rp(),op({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,t)}px`},padding:10})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:70},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,f?.show,f?.triggerCharacter,d,n]);return!f||!f.ignoreQueryLength&&o&&(f.query.startsWith(` `)||f.query.length<o)?null:(0,Q.jsx)(Q7,{reference:p,...m,children:n&&(0,Q.jsx)(vHe,{query:f.query,closeMenu:d.closeMenu,clearQuery:d.clearQuery,getItems:u,columns:i,gridSuggestionMenuComponent:r||mHe,onItemClick:l})})}function bHe(e){let t=I7(),n=L7(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o}=e,s=i===`loading-initial`||i===`loading`?(0,Q.jsx)(t.SuggestionMenu.Loader,{className:`bn-suggestion-menu-loader`}):null,c=(0,Z.useMemo)(()=>{let e,n=[];for(let i=0;i<r.length;i++){let s=r[i];s.group!==e&&(e=s.group,n.push((0,Q.jsx)(t.SuggestionMenu.Label,{className:`bn-suggestion-menu-label`,children:e},e))),n.push((0,Q.jsx)(t.SuggestionMenu.Item,{className:FZ(`bn-suggestion-menu-item`,s.size===`small`?`bn-suggestion-menu-item-small`:``),item:s,id:`bn-suggestion-menu-item-${i}`,isSelected:i===a,onClick:()=>o?.(s)},s.title))}return n},[t,r,o,a]);return(0,Q.jsxs)(t.SuggestionMenu.Root,{id:`bn-suggestion-menu`,className:`bn-suggestion-menu`,children:[c,c.length===0&&(e.loadingState===`loading`||e.loadingState===`loaded`)&&(0,Q.jsx)(t.SuggestionMenu.EmptyItem,{className:`bn-suggestion-menu-item`,children:n.suggestion_menu.no_items_title}),s]})}function xHe(e,t){let[n,r]=(0,Z.useState)(0);return{selectedIndex:n,setSelectedIndex:r,handler:i=>{if(i.key===`ArrowUp`)return i.preventDefault(),e.length&&r((n-1+e.length)%e.length),!0;if(i.key===`ArrowDown`)return i.preventDefault(),e.length&&r((n+1)%e.length),!0;if(i.key===`PageUp`)return i.preventDefault(),e.length&&r(0),!0;if(i.key===`PageDown`)return i.preventDefault(),e.length&&r(e.length-1),!0;let a=SHe(i)?i.nativeEvent.isComposing:i.isComposing;return i.key===`Enter`&&!a?(i.preventDefault(),i.stopPropagation(),e.length&&t?.(e[n]),!0):!1}}}function SHe(e){return e.nativeEvent!==void 0}function CHe(e,t,n,r,i){let{selectedIndex:a,setSelectedIndex:o,handler:s}=xHe(n,r);return(0,Z.useEffect)(()=>{let t=i||e.domElement;return t?.addEventListener(`keydown`,s,!0),()=>{t?.removeEventListener(`keydown`,s,!0)}},[e.domElement,n,a,r,i,s]),(0,Z.useEffect)(()=>{o(0)},[t,o]),{selectedIndex:n.length===0?void 0:a}}function wHe(e){let t=M7().setContentEditableProps,n=N7(),{getItems:r,suggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c}=e,l=(0,Z.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:u,usedQuery:d,loadingState:f}=gHe(a,r);hHe(u,d,s);let{selectedIndex:p}=CHe(n,a,u,l);return(0,Z.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,Z.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":p?`bn-suggestion-menu-item-`+p:void 0})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,p]),(0,Q.jsx)(i,{items:u,onItemClick:l,loadingState:f,selectedIndex:p})}function THe(e){return a_e(e).map(e=>{let t=FUe[e.key];return{...e,icon:(0,Q.jsx)(t,{size:18})}})}function EHe(e){let t=N7(),{triggerCharacter:n,suggestionMenuComponent:r,shouldOpen:i,minQueryLength:a,onItemClick:o,getItems:s}=e,c=(0,Z.useMemo)(()=>o||(e=>{e.onItemClick(t)}),[t,o]),l=(0,Z.useMemo)(()=>s||(async e=>o_e(THe(t),e)),[t,s]),u=P7(I$);(0,Z.useEffect)(()=>{u.addSuggestionMenu({triggerCharacter:n,shouldOpen:i})},[u,n,i]);let d=F7(I$),f=F7(I$,{selector:e=>({element:t.domElement?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),p=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:d?.show&&d?.triggerCharacter===n,onOpenChange:e=>{e||u.closeMenu()},placement:`bottom-start`,middleware:[np(10),sp({allowedPlacements:[`bottom-start`,`top-start`],padding:10}),rp(),op({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,t)}px`},padding:10})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:80},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,d?.show,d?.triggerCharacter,u,n]);return!d||!d.ignoreQueryLength&&a&&(d.query.startsWith(` `)||d.query.length<a)?null:(0,Q.jsx)(Q7,{reference:f,...p,children:n&&(0,Q.jsx)(wHe,{query:d.query,closeMenu:u.closeMenu,clearQuery:u.clearQuery,getItems:l,suggestionMenuComponent:r||bHe,onItemClick:c})})}function DHe(e){let t=N7();if(!t)throw Error(`BlockNoteDefaultUI must be used within a BlockNoteContext.Provider`);return(0,Q.jsxs)(Q.Fragment,{children:[t.getExtension(z6)&&e.formattingToolbar!==!1&&(0,Q.jsx)(v9,{}),t.getExtension(B6)&&e.linkToolbar!==!1&&(0,Q.jsx)(TUe,{}),t.getExtension(I$)&&e.slashMenu!==!1&&(0,Q.jsx)(EHe,{triggerCharacter:`/`,shouldOpen:e=>!e.selection.$from.parent.type.isInGroup(`tableContent`)}),t.getExtension(I$)&&e.emojiPicker!==!1&&(0,Q.jsx)(yHe,{triggerCharacter:`:`,columns:10,minQueryLength:2}),t.getExtension(q6)&&e.sideMenu!==!1&&(0,Q.jsx)(PUe,{}),t.getExtension(xQ)&&e.filePanel!==!1&&(0,Q.jsx)(KHe,{}),t.getExtension(Z6)&&e.tableHandles!==!1&&(0,Q.jsx)(JUe,{}),t.getExtension(EY)&&e.comments!==!1&&(0,Q.jsxs)(Z.Suspense,{children:[(0,Q.jsx)(YUe,{}),(0,Q.jsx)(XUe,{})]})]})}function OHe(e,t){let n=M7();t||=n?.editor,(0,Z.useEffect)(()=>{if(!t)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return t.onChange(e)},[e,t])}function kHe(e,t,n){let r=M7();t||=r?.editor,(0,Z.useEffect)(()=>{if(!t)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return t.onSelectionChange(e,n)},[e,t,n])}function AHe(){return(0,Z.useContext)(x9)}function jHe(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:(0,Y7.createPortal)(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}function MHe(e,t){let{editor:n,className:r,theme:i,children:a,editable:o,onSelectionChange:s,onChange:c,formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g,autoFocus:_,renderEditor:v=!0,...y}=e,[b,x]=(0,Z.useState)(),S=M7(),C=b9(),w=S?.colorSchemePreference||C,T=i||(w===`dark`?`dark`:`light`);OHe(c||S9,n),kHe(s||S9,n);let E=(0,Z.useCallback)(e=>{n.elementRenderer=e},[n]),D=(0,Z.useMemo)(()=>({...S,editor:n,setContentEditableProps:x,colorSchemePreference:T}),[S,n,T]),O=(0,Z.useMemo)(()=>({editorProps:{autoFocus:_,contentEditableProps:b,editable:o},defaultUIProps:{formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g}}),[_,b,o,l,u,d,f,p,m,h,g]);return(0,Q.jsx)(Z7.Provider,{value:D,children:(0,Q.jsxs)(x9.Provider,{value:O,children:[(0,Q.jsx)(QUe,{ref:E}),(0,Q.jsx)($Ue,{className:r,renderEditor:v,editorColorScheme:T,ref:t,...y,children:a})]})})}async function NHe(){return T9||(T9=(async()=>{let[e,t]=await Promise.all([C(()=>import(`./module-5nFhWwDg.js`),[]),C(()=>import(`./native-DOSNxcOx.js`),[])]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),T9)}function PHe(e){let t=(0,Z.useRef)(null),n=(0,Z.useRef)(null);return n.current&&n.current.update(e),(0,Z.useEffect)(()=>((async()=>{let{emojiMart:r}=await NHe();n.current=new r.Picker({...e,ref:t})})(),()=>{n.current=null}),[]),Z.createElement(`div`,{ref:t})}function FHe(e){return J7([e]).get(e)}function J7(e){let t=P7(EY).userStore,n=(0,Z.useCallback)(()=>{let n=new Map;for(let r of e){let e=t.getUser(r);e&&n.set(r,e)}return n},[t,e]),r=(0,Z.useMemo)(()=>({current:n()}),[n]);return(0,Z.useSyncExternalStore)((0,Z.useCallback)(i=>{let a=t.subscribe(e=>{r.current=n(),i()});return t.loadUsers(e),a},[t,n,e,r]),()=>r.current)}function IHe(){let e=P7(EY),t=I7(),n=L7(),r=C9({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.new_comment}},schema:e.commentEditorSchema||D9});return(0,Q.jsx)(t.Comments.Card,{className:`bn-thread`,children:(0,Q.jsx)(w9,{autoFocus:!0,editable:!0,editor:r,actions:({isEmpty:n})=>(0,Q.jsx)(t.Generic.Toolbar.Root,{className:FZ(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:(0,Q.jsx)(t.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:`Save`,variant:`compact`,isDisabled:n,onClick:async()=>{await e.createThread({initialComment:{body:r.document}}),e.stopPendingComment()},children:`Save`})})})})}function LHe(e){let t=N7(),n=P7(EY),r=F7(EY,{editor:t,selector:e=>e.pendingComment}),i=R7({editor:t,selector:({editor:e})=>r?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:e=>{e||(n.stopPendingComment(),t.focus())},placement:`bottom`,middleware:[np(10),rp(),ap()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...e.floatingUIOptions?.elementProps}}),[n,t,r,e.floatingUIOptions]),o=e.floatingComposer||IHe;return(0,Q.jsx)(o9,{position:i,...a,children:(0,Q.jsx)(o,{})})}function RHe(){let e=P7(EY).threadStore,t=(0,Z.useRef)(void 0);return t.current||=e.getThreads(),(0,Z.useSyncExternalStore)((0,Z.useCallback)(n=>e.subscribe(e=>{t.current=e,n()}),[e]),()=>t.current)}function zHe(e){let t=N7(),n=P7(EY),r=F7(EY,{editor:t,selector:e=>e.selectedThreadId?{id:e.selectedThreadId,position:e.threadPositions.get(e.selectedThreadId)}:void 0}),i=RHe(),a=(0,Z.useMemo)(()=>r?i.get(r.id):void 0,[r,i]),o=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{i===`escape-key`&&t.focus(),e||n.selectThread(void 0)},placement:`bottom`,middleware:[np(10),rp(),ap()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:30},...e.floatingUIOptions?.elementProps}}),[n,t,e.floatingUIOptions,r]),s=e.floatingThread||O9;return(0,Q.jsx)(o9,{position:r?.position,...o,children:a&&(0,Q.jsx)(s,{thread:a,selected:!0})})}function BHe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top<r.top,a=n.bottom>r.bottom;return i&&a?`both`:i?`top`:a?`bottom`:`none`}function VHe(e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Z,Q,Y7,HHe,UHe,X7,Z7,Q7,$7,e9,WHe,GHe,t9,KHe,qHe,n9,r9,i9,a9,JHe,YHe,XHe,ZHe,QHe,$He,o9,s9,c9,eUe,tUe,l9,u9,d9,f9,nUe,p9,m9,rUe,iUe,aUe,oUe,sUe,cUe,lUe,uUe,dUe,fUe,pUe,mUe,hUe,gUe,_Ue,vUe,yUe,h9,g9,_9,bUe,v9,xUe,SUe,CUe,wUe,TUe,EUe,DUe,OUe,kUe,AUe,jUe,MUe,NUe,PUe,FUe,IUe,LUe,RUe,zUe,BUe,VUe,y9,HUe,UUe,WUe,GUe,KUe,qUe,JUe,YUe,XUe,b9,x9,ZUe,QUe,S9,$Ue,eWe,tWe,nWe,C9,w9,T9,E9,rWe,iWe,aWe,oWe,D9,sWe,cWe,lWe,O9,uWe,k9=o((()=>{Z=u(p(),1),Q=N(),The(),gNe(),Pm(),wNe(),LBe(),sY(),Y7=u(_(),1),nVe(),y(),w(),HHe=Object.defineProperty,UHe=(e,t,n)=>t in e?HHe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X7=(e,t,n)=>UHe(e,typeof t==`symbol`?t:t+``,n),Z7=(0,Z.createContext)(void 0),Q7=e=>{var t;let{refs:n,floatingStyles:r,context:i}=Rp({whileElementsMounted:Af,...e.useFloatingOptions}),{isMounted:a,styles:o}=qp(i,e.useTransitionStylesProps),{status:s}=Kp(i,e.useTransitionStatusProps),{getFloatingProps:c}=Hp([Lp(i,e.useDismissProps),yp(i,{enabled:!1,...e.useHoverProps})]),l=(0,Z.useRef)(``),u=(0,Z.useRef)(null),d=fp([u,n.setFloating]);if((0,Z.useEffect)(()=>{if(e.reference){let t=`element`in e.reference?e.reference.element:void 0;t!==void 0&&n.setReference(t),n.setPositionReference({getBoundingClientRect:rVe(e.reference),contextElement:t})}},[e.reference,n]),(0,Z.useEffect)(()=>{var e;(s===`initial`||s===`open`)&&(e=u.current)!=null&&e.innerHTML&&(l.current=u.current.innerHTML)},[s,e.reference,e.children]),!a)return!1;let f={...e.elementProps,style:{display:`flex`,...e.elementProps?.style,zIndex:`calc(var(--bn-ui-base-z-index) + ${e.elementProps?.style?.zIndex||0})`,...r,...o},...c()};return s===`close`?(0,Q.jsx)(`div`,{ref:d,...f,dangerouslySetInnerHTML:{__html:l.current}}):(t=e.focusManagerProps)!=null&&t.disabled?(0,Q.jsx)(`div`,{ref:d,...f,children:e.children}):(0,Q.jsx)(Ip,{...e.focusManagerProps,context:i,children:(0,Q.jsx)(`div`,{ref:d,...f,children:e.children})})},$7=e=>{let{blockId:t,children:n,...r}=e,i=N7();return(0,Q.jsx)(Q7,{reference:(0,Z.useMemo)(()=>i.transact(e=>{if(!t)return;let n=qZ(t,e.doc);if(!n)return;let{node:r}=i.prosemirrorView.domAtPos(n.posBeforeNode+1);if(r instanceof Element)return{element:r}}),[i,t]),...r,children:t!==void 0&&n})},e9=(0,Z.createContext)(void 0),WHe=e=>{let t=I7(),n=L7(),r=N7(),i=r.getBlock(e.blockId),[a,o]=(0,Z.useState)(``),s=(0,Z.useCallback)(e=>{o(e.currentTarget.value)},[]),c=(0,Z.useCallback)(e=>{e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),r.updateBlock(i.id,{props:{name:RZ(a),url:a}}))},[r,i.id,a]),l=(0,Z.useCallback)(()=>{r.updateBlock(i.id,{props:{name:RZ(a),url:a}})},[r,i.id,a]);return(0,Q.jsxs)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,Q.jsx)(t.FilePanel.TextInput,{className:`bn-text-input`,placeholder:n.file_panel.embed.url_placeholder,value:a,onChange:s,onKeyDown:c,"data-test":`embed-input`}),(0,Q.jsx)(t.FilePanel.Button,{className:`bn-button`,onClick:l,"data-test":`embed-input-button`,children:n.file_panel.embed.embed_button[i.type]||n.file_panel.embed.embed_button.file})]})},GHe=e=>{var t;let n=I7(),r=L7(),{setLoading:i}=e,a=N7(),o=a.getBlock(e.blockId),[s,c]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{s&&setTimeout(()=>{c(!1)},3e3)},[s]);let l=(0,Z.useCallback)(t=>{if(t===null)return;async function n(t){if(i(!0),a.uploadFile!==void 0)try{let n=await a.uploadFile(t,e.blockId);typeof n==`string`&&(n={props:{name:t.name,url:n}}),a.updateBlock(e.blockId,n)}catch{c(!0)}finally{i(!1)}}n(t)},[e.blockId,a,i]),u=a.schema.blockSpecs[o.type],d=(t=u.implementation.meta?.fileBlockAccept)!=null&&t.length?u.implementation.meta.fileBlockAccept.join(`,`):`*/*`;return(0,Q.jsxs)(n.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,Q.jsx)(n.FilePanel.FileInput,{className:`bn-file-input`,"data-test":`upload-input`,accept:d,placeholder:r.file_panel.upload.file_placeholder[o.type]||r.file_panel.upload.file_placeholder.file,value:null,onChange:l}),s&&(0,Q.jsx)(`div`,{className:`bn-error-text`,children:r.file_panel.upload.upload_error})]})},t9=e=>{let t=I7(),n=L7(),r=N7(),[i,a]=(0,Z.useState)(!1),o=e.tabs??[...r.uploadFile===void 0?[]:[{name:n.file_panel.upload.title,tabPanel:(0,Q.jsx)(GHe,{blockId:e.blockId,setLoading:a})}],{name:n.file_panel.embed.title,tabPanel:(0,Q.jsx)(WHe,{blockId:e.blockId})}],[s,c]=(0,Z.useState)(e.defaultOpenTab||o[0].name);return(0,Q.jsx)(t.FilePanel.Root,{className:`bn-panel`,defaultOpenTab:s,openTab:s,setOpenTab:c,tabs:o,loading:i})},KHe=e=>{let t=N7(),n=P7(xQ),r=F7(xQ),i=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{e||n.closeMenu(),i===`escape-key`&&t.focus()},middleware:[np(10),ap()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:90},...e.floatingUIOptions?.elementProps}}),[r,t,n,e.floatingUIOptions]),a=e.filePanel||t9;return(0,Q.jsx)($7,{blockId:r,...i,children:r&&(0,Q.jsx)(a,{blockId:r})})},qHe=iVe(function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),n9={exports:{}},r9={},i9={exports:{}},a9={},n9.exports=sVe(),ZHe=n9.exports,QHe=typeof window<`u`?Z.useLayoutEffect:Z.useEffect,$He=class{constructor(e){X7(this,`transactionNumber`,0),X7(this,`lastTransactionNumber`,0),X7(this,`lastSnapshot`),X7(this,`editor`),X7(this,`subscribers`,new Set),this.editor=e,this.lastSnapshot={editor:e,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(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e,t){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor._tiptapEditor,r={all:`transaction`,selection:`selectionUpdate`,change:`update`};return n.on(r[t],e),()=>{n.off(r[t],e)}}}},o9=e=>{let{position:t,children:n,...r}=e,{from:i,to:a}=t||{},o=N7();return(0,Q.jsx)(Q7,{reference:(0,Z.useMemo)(()=>{if(!(i===void 0||a===void 0))return{element:o.domElement?.firstElementChild||void 0,getBoundingClientRect:()=>cq(o.prosemirrorView,i,a??i)}},[o,i,a]),...r,children:t!==void 0&&n})},s9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},c9=Z.createContext&&Z.createContext(s9),eUe=[`attr`,`size`,`title`],tUe={bold:TVe,italic:PVe,underline:GVe,strike:UVe,code:yVe},l9=e=>{let t=L7(),n=I7(),r=N7(),i=R7({editor:r,selector:({editor:t})=>{if(!(!t.isEditable||!cHe(e.basicTextStyle,t)||!(t.getSelection()?.blocks||[t.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return e.basicTextStyle in t.getActiveStyles()?{active:!0}:{active:!1}}}),a=(0,Z.useCallback)(e=>{r.focus(),r.toggleStyles({[e]:!0})},[r,e]);if(i===void 0)return null;let o=tUe[e.basicTextStyle];return(0,Q.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":e.basicTextStyle,onClick:()=>a(e.basicTextStyle),isSelected:i.active,label:t.formatting_toolbar[e.basicTextStyle].tooltip,mainTooltip:t.formatting_toolbar[e.basicTextStyle].tooltip,secondaryTooltip:PZ(t.formatting_toolbar[e.basicTextStyle].secondary_tooltip,t.generic.ctrl_shortcut),icon:(0,Q.jsx)(o,{})})},u9=e=>{let t=e.textColor||`default`,n=e.backgroundColor||`default`,r=e.size||16,i=(0,Z.useMemo)(()=>({pointerEvents:`none`,fontSize:(r*.75).toString()+`px`,height:r.toString()+`px`,lineHeight:r.toString()+`px`,textAlign:`center`,width:r.toString()+`px`}),[r]);return(0,Q.jsx)(`div`,{className:`bn-color-icon`,"data-background-color":n,"data-text-color":t,style:i,children:`A`})},d9=[`default`,`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`],f9=e=>{let t=I7(),n=L7();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(()=>e.text?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(t.Generic.Menu.Label,{children:n.color_picker.text_title}),d9.map(r=>(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick&&e.onClick(),e.text.setColor(r)},"data-test":`text-color-`+r,icon:(0,Q.jsx)(u9,{textColor:r,size:e.iconSize}),checked:e.text.color===r,children:n.color_picker.colors[r]},`text-color-`+r))]}):null,{}),(0,Q.jsx)(()=>e.background?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(t.Generic.Menu.Label,{children:n.color_picker.background_title}),d9.map(r=>(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick&&e.onClick(),e.background.setColor(r)},"data-test":`background-color-`+r,icon:(0,Q.jsx)(u9,{backgroundColor:r,size:e.iconSize}),checked:e.background.color===r,children:n.color_picker.colors[r]},`background-color-`+r))]}):null,{})]})},nUe=()=>{let e=I7(),t=L7(),n=N7(),r=K7(`text`,n),i=K7(`background`,n),a=R7({editor:n,selector:({editor:e})=>{if(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return;let t=K7(`text`,e),n=K7(`background`,e);if(!(!t&&!n))return{textColor:t?e.getActiveStyles().textColor||`default`:void 0,backgroundColor:n?e.getActiveStyles().backgroundColor||`default`:void 0}}}),o=(0,Z.useCallback)(e=>{if(!r)throw Error(`Tried to set text color, but style does not exist in editor schema.`);e===`default`?n.removeStyles({textColor:e}):n.addStyles({textColor:e}),setTimeout(()=>{n.focus()})},[n,r]),s=(0,Z.useCallback)(e=>{if(!i)throw Error(`Tried to set background color, but style does not exist in editor schema.`);e===`default`?n.removeStyles({backgroundColor:e}):n.addStyles({backgroundColor:e}),setTimeout(()=>{n.focus()})},[i,n]);return a===void 0?null:(0,Q.jsxs)(e.Generic.Menu.Root,{children:[(0,Q.jsx)(e.Generic.Menu.Trigger,{children:(0,Q.jsx)(e.FormattingToolbar.Button,{className:`bn-button`,"data-test":`colors`,label:t.formatting_toolbar.colors.tooltip,mainTooltip:t.formatting_toolbar.colors.tooltip,icon:(0,Q.jsx)(u9,{textColor:a.textColor,backgroundColor:a.backgroundColor,size:20})})}),(0,Q.jsx)(e.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(f9,{text:a.textColor?{color:a.textColor,setColor:o}:void 0,background:a.backgroundColor?{color:a.backgroundColor,setColor:s}:void 0})})]})},p9=e=>{for(let t of V6)if(e.startsWith(t))return e;return`${H6}://${e}`},m9=e=>{let t=I7(),n=L7(),{editLink:r}=P7(B6),{url:i,text:a,showTextField:o}=e,[s,c]=(0,Z.useState)(i),[l,u]=(0,Z.useState)(a);(0,Z.useEffect)(()=>{c(i),u(a)},[a,i]);let d=(0,Z.useCallback)(t=>{var n,i;t.key===`Enter`&&!t.nativeEvent.isComposing&&(t.preventDefault(),r(p9(s),l,e.range.from),(n=e.setToolbarOpen)==null||n.call(e,!1),(i=e.setToolbarPositionFrozen)==null||i.call(e,!1))},[r,s,l,e]),f=(0,Z.useCallback)(e=>c(e.currentTarget.value),[]),p=(0,Z.useCallback)(e=>u(e.currentTarget.value),[]),m=(0,Z.useCallback)(()=>{var t,n;r(p9(s),l,e.range.from),(t=e.setToolbarOpen)==null||t.call(e,!1),(n=e.setToolbarPositionFrozen)==null||n.call(e,!1)},[r,s,l,e]);return(0,Q.jsxs)(t.Generic.Form.Root,{children:[(0,Q.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`url`,icon:(0,Q.jsx)(IVe,{}),autoFocus:!0,placeholder:n.link_toolbar.form.url_placeholder,value:s,onKeyDown:d,onChange:f,onSubmit:m}),o!==!1&&(0,Q.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`title`,icon:(0,Q.jsx)(G7,{}),placeholder:n.link_toolbar.form.title_placeholder,value:l,onKeyDown:d,onChange:p,onSubmit:m})]})},rUe=()=>{let e=N7(),t=I7(),n=L7(),r=P7(z6),{showSelection:i}=P7(dG),[a,o]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>(i(a,`createLinkButton`),()=>i(!1,`createLinkButton`)),[a,i]);let s=R7({editor:e,selector:({editor:e})=>{if(!(!e.isEditable||!lHe(e)||aQ(e.prosemirrorState.selection)||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return{url:e.getSelectedLinkUrl(),text:e.getSelectedText(),range:{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}}}});return(0,Z.useEffect)(()=>{o(!1)},[s]),(0,Z.useEffect)(()=>{let t=e=>{(e.ctrlKey||e.metaKey)&&e.key===`k`&&(o(!0),e.preventDefault())},n=e.domElement;return n?.addEventListener(`keydown`,t),()=>{n?.removeEventListener(`keydown`,t)}},[e.domElement]),s===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:o,children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`createLink`,label:n.formatting_toolbar.link.tooltip,mainTooltip:n.formatting_toolbar.link.tooltip,secondaryTooltip:PZ(n.formatting_toolbar.link.secondary_tooltip,n.generic.ctrl_shortcut),icon:(0,Q.jsx)(IVe,{}),onClick:()=>o(e=>!e)})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(m9,{url:s.url||``,text:s.text,range:s.range,showTextField:!1,setToolbarOpen:e=>r.store.setState(e)})})]})},iUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(iQ(n,e,n.type,{url:`string`,caption:`string`}))return n}}),[i,a]=(0,Z.useState)();(0,Z.useEffect)(()=>{r!==void 0&&a(r.props.caption)},[r]);let o=(0,Z.useCallback)(e=>a(e.currentTarget.value),[]),s=(0,Z.useCallback)(e=>{r!==void 0&&rQ(n,r.type,{caption:`string`})&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),n.updateBlock(r.id,{props:{caption:i}}))},[r,i,n]);return r===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_caption.tooltip,mainTooltip:e.formatting_toolbar.file_caption.tooltip,icon:(0,Q.jsx)(NVe,{})})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(t.Generic.Form.Root,{children:(0,Q.jsx)(t.Generic.Form.TextInput,{name:`file-caption`,icon:(0,Q.jsx)(NVe,{}),value:i||``,autoFocus:!0,placeholder:e.formatting_toolbar.file_caption.input_placeholder,onKeyDown:s,onChange:o})})})]})},aUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(iQ(n,e,n.type,{url:`string`}))return n}}),i=(0,Z.useCallback)(()=>{r!==void 0&&(n.focus(),n.removeBlocks([r.id]))},[r,n]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,mainTooltip:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,icon:(0,Q.jsx)(eHe,{}),onClick:i})},oUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(iQ(n,e,n.type,{url:`string`,name:`string`}))return n}}),[i,a]=(0,Z.useState)();(0,Z.useEffect)(()=>{r!==void 0&&a(r.props.name)},[r]);let o=(0,Z.useCallback)(e=>a(e.currentTarget.value),[]),s=(0,Z.useCallback)(e=>{r!==void 0&&rQ(n,r.type,{name:`string`})&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),n.updateBlock(r.id,{props:{name:i}}))},[r,i,n]);return r===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_rename.tooltip[r.type]||e.formatting_toolbar.file_rename.tooltip.file,mainTooltip:e.formatting_toolbar.file_rename.tooltip[r.type]||e.formatting_toolbar.file_rename.tooltip.file,icon:(0,Q.jsx)(DVe,{})})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(t.Generic.Form.Root,{children:(0,Q.jsx)(t.Generic.Form.TextInput,{name:`file-name`,icon:(0,Q.jsx)(DVe,{}),value:i||``,autoFocus:!0,placeholder:e.formatting_toolbar.file_rename.input_placeholder[r.type]||e.formatting_toolbar.file_rename.input_placeholder.file,onKeyDown:s,onChange:o})})})]})},sUe=()=>{let e=L7(),t=I7(),n=R7({editor:N7(),selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(iQ(n,e,n.type,{url:`string`}))return n}});return n===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{position:`bottom`,children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,mainTooltip:e.formatting_toolbar.file_replace.tooltip[n.type]||e.formatting_toolbar.file_replace.tooltip.file,label:e.formatting_toolbar.file_replace.tooltip[n.type]||e.formatting_toolbar.file_replace.tooltip.file,icon:(0,Q.jsx)(YVe,{})})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-panel-popover`,variant:`panel-popover`,children:(0,Q.jsx)(t9,{blockId:n.id})})]})},cUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{if(!(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return{canNestBlock:e.canNestBlock()}}}),i=(0,Z.useCallback)(()=>{r!==void 0&&r.canNestBlock&&(n.focus(),n.nestBlock())},[n,r]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`nestBlock`,onClick:i,isDisabled:!r.canNestBlock,label:e.formatting_toolbar.nest.tooltip,mainTooltip:e.formatting_toolbar.nest.tooltip,secondaryTooltip:PZ(e.formatting_toolbar.nest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,Q.jsx)(MVe,{})})},lUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{if(!(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return{canUnnestBlock:e.canUnnestBlock()}}}),i=(0,Z.useCallback)(()=>{r!==void 0&&r.canUnnestBlock&&(n.focus(),n.unnestBlock())},[n,r]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`unnestBlock`,onClick:i,isDisabled:!r.canUnnestBlock,label:e.formatting_toolbar.unnest.tooltip,mainTooltip:e.formatting_toolbar.unnest.tooltip,secondaryTooltip:PZ(e.formatting_toolbar.unnest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,Q.jsx)(jVe,{})})},uUe=e=>[{name:e.slash_menu.paragraph.title,type:`paragraph`,icon:G7},{name:e.slash_menu.heading.title,type:`heading`,props:{level:1,isToggleable:!1},icon:H7},{name:e.slash_menu.heading_2.title,type:`heading`,props:{level:2,isToggleable:!1},icon:U7},{name:e.slash_menu.heading_3.title,type:`heading`,props:{level:3,isToggleable:!1},icon:W7},{name:e.slash_menu.heading_4.title,type:`heading`,props:{level:4,isToggleable:!1},icon:OVe},{name:e.slash_menu.heading_5.title,type:`heading`,props:{level:5,isToggleable:!1},icon:kVe},{name:e.slash_menu.heading_6.title,type:`heading`,props:{level:6,isToggleable:!1},icon:AVe},{name:e.slash_menu.toggle_heading.title,type:`heading`,props:{level:1,isToggleable:!0},icon:H7},{name:e.slash_menu.toggle_heading_2.title,type:`heading`,props:{level:2,isToggleable:!0},icon:U7},{name:e.slash_menu.toggle_heading_3.title,type:`heading`,props:{level:3,isToggleable:!0},icon:W7},{name:e.slash_menu.quote.title,type:`quote`,icon:HVe},{name:e.slash_menu.toggle_list.title,type:`toggleListItem`,icon:XVe},{name:e.slash_menu.bullet_list.title,type:`bulletListItem`,icon:zVe},{name:e.slash_menu.numbered_list.title,type:`numberedListItem`,icon:RVe},{name:e.slash_menu.check_list.title,type:`checkListItem`,icon:LVe}],dUe=e=>{let t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>e.getSelection()?.blocks||[e.getTextCursorPosition().block]}),i=r[0],a=(0,Z.useMemo)(()=>(e.items||uUe(n.dictionary)).filter(e=>rQ(n,e.type,Object.fromEntries(Object.entries(e.props||{}).map(([e,t])=>[e,typeof t])))),[n,e.items]),o=(0,Z.useMemo)(()=>a.map(e=>{let t=e.icon,a=e.type===i.type,o=Object.entries(e.props||{}).filter(([e,t])=>t!==i.props[e]).length===0;return{text:e.name,icon:(0,Q.jsx)(t,{size:16}),onClick:()=>{n.focus(),n.transact(()=>{for(let t of r)n.updateBlock(t,{type:e.type,props:e.props})})},isSelected:a&&o}}),[n,a,i.props,i.type,r]);return!(0,Z.useMemo)(()=>o.find(e=>e.isSelected)!==void 0,[o])||!n.isEditable?null:(0,Q.jsx)(t.FormattingToolbar.Select,{className:`bn-select`,items:o})},fUe=()=>{let e=L7(),t=I7(),n=P7(`comments`),{store:r}=P7(z6),i=(0,Z.useCallback)(()=>{n.startPendingComment(),r.setState(!1)},[n,r]);return(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,Q.jsx)(_Ve,{}),onClick:i})},pUe=()=>N7().getExtension(`comments`)?(0,Q.jsx)(fUe,{}):null,mUe=()=>{let e=L7(),t=I7(),n=N7(),r=(0,Z.useCallback)(()=>{n._tiptapEditor.chain().focus().addPendingComment().run()},[n]);return!n._tiptapEditor.commands.addPendingComment||!n.isEditable?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,Q.jsx)(_Ve,{}),onClick:r})},hUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(iQ(n,e,n.type,{url:`string`}))return n}}),i=(0,Z.useCallback)(()=>{r!==void 0&&(n.focus(),n.resolveFileUrl?n.resolveFileUrl(r.props.url).then(e=>window.open(q7(e,window.location.href))):window.open(q7(r.props.url,window.location.href)))},[r,n]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,mainTooltip:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,icon:(0,Q.jsx)(nHe,{}),onClick:i})},gUe=()=>{let e=L7(),t=I7(),n=N7(),r=R7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(iQ(n,e,n.type,{url:`string`,showPreview:`boolean`}))return n}}),i=(0,Z.useCallback)(()=>{r!==void 0&&rQ(n,r.type,{showPreview:`boolean`})&&n.updateBlock(r.id,{props:{showPreview:!r.props.showPreview}})},[r,n]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:`Toggle preview`,mainTooltip:e.formatting_toolbar.file_preview_toggle.tooltip,icon:(0,Q.jsx)(JVe,{}),isSelected:r.props.showPreview,onClick:i})},_Ue=()=>{let e=L7(),t=I7(),n=N7(),r=P7(Z6),i=R7({editor:n,selector:({editor:e})=>{if(!e.isEditable||!e.settings.tables.splitCells)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(n.type===`table`)return{mergeDirection:r.getMergeDirection(n)}}}),a=(0,Z.useCallback)(()=>{r?.mergeCells()},[r]);return i===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.table_cell_merge.tooltip,mainTooltip:e.formatting_toolbar.table_cell_merge.tooltip,icon:i.mergeDirection===`horizontal`?(0,Q.jsx)(BVe,{}):(0,Q.jsx)(VVe,{}),onClick:a})},vUe=()=>N7().getExtension(Z6)?(0,Q.jsx)(_Ue,{}):null,yUe={left:CVe,center:xVe,right:wVe,justify:SVe},h9=e=>{let t=I7(),n=L7(),r=N7(),i=R7({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block],n=t[0];if(iQ(n,e,n.type,{textAlignment:hQ.textAlignment}))return{textAlignment:n.props.textAlignment,blocks:t};if(t.length===1&&iQ(n,e,`table`))return e.getExtension(Z6)?.getCellSelection()?{textAlignment:AY(n.content.rows[0].cells[0]).props.textAlignment,blocks:[n]}:void 0}}),a=(0,Z.useCallback)(e=>{if(i!==void 0){r.focus();for(let t of i.blocks)if(iQ(t,r,t.type,{textAlignment:hQ.textAlignment})&&rQ(r,t.type,{textAlignment:hQ.textAlignment}))r.updateBlock(t,{props:{textAlignment:e}});else if(t.type===`table`){let n=r.getExtension(Z6)?.getCellSelection();if(!n)continue;let i=t.content.rows.map(e=>({...e,cells:e.cells.map(e=>AY(e))}));n.cells.forEach(({row:t,col:n})=>{i[t].cells[n].props.textAlignment=e}),r.updateBlock(t,{type:`table`,content:{...t.content,type:`tableContent`,rows:i}}),r.setTextCursorPosition(t)}}},[r,i]);if(i===void 0)return null;let o=yUe[e.textAlignment];return(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`alignText${e.textAlignment.slice(0,1).toUpperCase()+e.textAlignment.slice(1)}`,onClick:()=>a(e.textAlignment),isSelected:i.textAlignment===e.textAlignment,label:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,mainTooltip:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,icon:(0,Q.jsx)(o,{})})},g9=e=>[(0,Q.jsx)(dUe,{items:e},`blockTypeSelect`),(0,Q.jsx)(vUe,{},`tableCellMergeButton`),(0,Q.jsx)(iUe,{},`fileCaptionButton`),(0,Q.jsx)(sUe,{},`replaceFileButton`),(0,Q.jsx)(oUe,{},`fileRenameButton`),(0,Q.jsx)(aUe,{},`fileDeleteButton`),(0,Q.jsx)(hUe,{},`fileDownloadButton`),(0,Q.jsx)(gUe,{},`filePreviewButton`),(0,Q.jsx)(l9,{basicTextStyle:`bold`},`boldStyleButton`),(0,Q.jsx)(l9,{basicTextStyle:`italic`},`italicStyleButton`),(0,Q.jsx)(l9,{basicTextStyle:`underline`},`underlineStyleButton`),(0,Q.jsx)(l9,{basicTextStyle:`strike`},`strikeStyleButton`),(0,Q.jsx)(h9,{textAlignment:`left`},`textAlignLeftButton`),(0,Q.jsx)(h9,{textAlignment:`center`},`textAlignCenterButton`),(0,Q.jsx)(h9,{textAlignment:`right`},`textAlignRightButton`),(0,Q.jsx)(nUe,{},`colorStyleButton`),(0,Q.jsx)(cUe,{},`nestBlockButton`),(0,Q.jsx)(lUe,{},`unnestBlockButton`),(0,Q.jsx)(rUe,{},`createLinkButton`),(0,Q.jsx)(pUe,{},`addCommentButton`),(0,Q.jsx)(mUe,{},`addTiptapCommentButton`)],_9=e=>(0,Q.jsx)(I7().FormattingToolbar.Root,{className:`bn-toolbar bn-formatting-toolbar`,children:e.children||g9(e.blockTypeSelectItems)}),bUe=e=>{switch(e){case`left`:return`top-start`;case`center`:return`top`;case`right`:return`top-end`;default:return`top-start`}},v9=e=>{let t=N7(),n=P7(z6,{editor:t}),r=F7(z6,{editor:t}),i=R7({editor:t,selector:({editor:e})=>n.store.state?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=R7({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block;return iQ(t,e,t.type,{textAlignment:hQ.textAlignment})?bUe(t.props.textAlignment):`top-start`}}),o=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,r,i)=>{n.store.setState(e),i===`escape-key`&&t.focus()},placement:a,middleware:[np(10),rp(),ap()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:40},...e.floatingUIOptions?.elementProps}}),[r,a,e.floatingUIOptions,n.store,t]),s=e.formattingToolbar||_9;return(0,Q.jsx)(o9,{position:i,...o,children:r&&(0,Q.jsx)(s,{})})},xUe=e=>{let t=I7(),n=L7(),{deleteLink:r}=P7(B6);return(0,Q.jsx)(t.LinkToolbar.Button,{className:`bn-button`,label:n.link_toolbar.delete.tooltip,mainTooltip:n.link_toolbar.delete.tooltip,isSelected:!1,onClick:()=>{var t;r(e.range.from),(t=e.setToolbarOpen)==null||t.call(e,!1)},icon:(0,Q.jsx)(FVe,{})})},SUe=e=>{let t=I7(),n=L7();return(0,Q.jsxs)(t.Generic.Popover.Root,{onOpenChange:e.setToolbarPositionFrozen,children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.edit.tooltip,isSelected:!1,children:n.link_toolbar.edit.text})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(m9,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen})})]})},CUe=e=>{let t=I7(),n=L7();return(0,Q.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.open.tooltip,label:n.link_toolbar.open.tooltip,isSelected:!1,onClick:()=>{window.open(q7(e.url,window.location.href),`_blank`)},icon:(0,Q.jsx)(rHe,{})})},wUe=e=>(0,Q.jsx)(I7().LinkToolbar.Root,{className:`bn-toolbar bn-link-toolbar`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(SUe,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen}),(0,Q.jsx)(CUe,{url:e.url}),(0,Q.jsx)(xUe,{range:e.range,setToolbarOpen:e.setToolbarOpen})]})}),TUe=e=>{let t=N7(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1),o=P7(B6),[s,c]=(0,Z.useState)(void 0);(0,Z.useEffect)(()=>{let e=()=>{let e=o.getLinkAtSelection();if(!e){c(void 0),i||r(!1);return}c({cursorType:`text`,url:e.mark.attrs.href,text:e.text,range:e.range,element:o.getLinkElementAtPos(e.range.from)}),i||r(!0)},n=e=>{if(s!==void 0&&s.cursorType===`text`||!(e.target instanceof HTMLElement))return;let t=o.getLinkAtElement(e.target);t&&c({cursorType:`mouse`,url:t.mark.attrs.href,text:t.text,range:t.range,element:o.getLinkElementAtPos(t.range.from)})},a=t.onChange(e),l=t.onSelectionChange(e),u=t.domElement;return u?.addEventListener(`mouseover`,n),()=>{a(),l(),u?.removeEventListener(`mouseover`,n)}},[t,t.domElement,o,s,i]);let l=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,onOpenChange:(e,n,a)=>{i||s!==void 0&&s.cursorType===`text`&&a===`hover`||(a===`escape-key`&&t.focus(),r(e))},placement:`top-start`,middleware:[np(10),ap()],...e.floatingUIOptions?.useFloatingOptions},useHoverProps:{enabled:s!==void 0&&s.cursorType===`mouse`,delay:{open:250,close:250},handleClose:pee(),...e.floatingUIOptions?.useHoverProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:50},...e.floatingUIOptions?.elementProps}}),[t,s,e.floatingUIOptions,n,i]),u=(0,Z.useMemo)(()=>s!=null&&s.element?{element:s.element}:void 0,[s?.element]);if(!t.isEditable)return null;let d=e.linkToolbar||wUe;return(0,Q.jsx)(Q7,{reference:u,...l,children:s&&(0,Q.jsx)(d,{url:s.url,text:s.text,range:s.range,setToolbarOpen:r,setToolbarPositionFrozen:a})})},EUe=()=>{let e=I7(),t=L7(),n=N7(),r=P7(I$),i=F7(q6,{editor:n,selector:e=>e?.block}),a=(0,Z.useCallback)(()=>{if(i===void 0)return;let e=i.content;if(e!==void 0&&Array.isArray(e)&&e.length===0)n.setTextCursorPosition(i),r.openSuggestionMenu(`/`);else{let e=n.insertBlocks([{type:`paragraph`}],i,`after`)[0];n.setTextCursorPosition(e),r.openSuggestionMenu(`/`)}},[i,n,r]);return i===void 0?null:(0,Q.jsx)(e.SideMenu.Button,{className:`bn-button`,label:t.side_menu.add_block_label,icon:(0,Q.jsx)(uHe,{size:24,onClick:a,"data-test":`dragHandleAdd`})})},DUe=e=>{let t=I7(),n=N7(),r=F7(q6,{editor:n,selector:e=>e?.block});return r===void 0||!iQ(r,n,r.type,{textColor:`string`})&&!iQ(r,n,r.type,{backgroundColor:`string`})?null:(0,Q.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children})}),(0,Q.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(f9,{iconSize:18,text:iQ(r,n,r.type,{textColor:`string`})&&rQ(n,r.type,{textColor:`string`})?{color:r.props.textColor,setColor:e=>n.updateBlock(r,{type:r.type,props:{textColor:e}})}:void 0,background:iQ(r,n,r.type,{backgroundColor:`string`})&&rQ(n,r.type,{backgroundColor:`string`})?{color:r.props.backgroundColor,setColor:e=>n.updateBlock(r,{props:{backgroundColor:e}})}:void 0})})]})},OUe=e=>{let t=I7(),n=N7(),r=F7(q6,{editor:n,selector:e=>e?.block});return r===void 0?null:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>n.removeBlocks([r]),children:e.children})},kUe=e=>{let t=I7(),n=N7(),r=F7(q6,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerRows;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerRows:i?void 0:1}})},children:e.children})},AUe=e=>{let t=I7(),n=N7(),r=F7(q6,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerCols;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerCols:i?void 0:1}})},children:e.children})},jUe=e=>{let t=I7(),n=L7();return(0,Q.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-drag-handle-menu`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(OUe,{children:n.drag_handle.delete_menuitem}),(0,Q.jsx)(DUe,{children:n.drag_handle.colors_menuitem}),(0,Q.jsx)(kUe,{children:n.drag_handle.header_row_menuitem}),(0,Q.jsx)(AUe,{children:n.drag_handle.header_column_menuitem})]})})},MUe=e=>{let t=I7(),n=L7(),r=P7(q6),i=F7(q6,{selector:e=>e?.block});if(i===void 0)return null;let a=e.dragHandleMenu||jUe;return(0,Q.jsxs)(t.Generic.Menu.Root,{onOpenChange:e=>{e?r.freezeMenu():r.unfreezeMenu()},position:`left`,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{children:(0,Q.jsx)(t.SideMenu.Button,{label:n.side_menu.drag_handle_label,draggable:!0,onDragStart:e=>r.blockDragStart(e,i),onDragEnd:r.blockDragEnd,className:`bn-button`,icon:(0,Q.jsx)(dHe,{size:24,"data-test":`dragHandle`})})}),(0,Q.jsx)(a,{children:e.children})]})},NUe=e=>{let t=I7(),n=N7(),r=F7(q6,{editor:n,selector:e=>e?.block}),i=(0,Z.useMemo)(()=>{var e;if(r===void 0)return{};let t={"data-block-type":r.type};return r.type===`heading`&&(t[`data-level`]=r.props.level.toString()),(e=n.schema.blockSpecs[r.type].implementation.meta)!=null&&e.fileBlockAccept&&(r.props.url?t[`data-url`]=`true`:t[`data-url`]=`false`),t},[r,n.schema.blockSpecs]);return(0,Q.jsx)(t.SideMenu.Root,{className:`bn-side-menu`,...i,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(EUe,{}),(0,Q.jsx)(MUe,{dragHandleMenu:e.dragHandleMenu})]})})},PUe=e=>{let{show:t,block:n}=F7(q6,{selector:e=>e===void 0?void 0:{show:e.show,block:e.block}})||{},r=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:t,placement:`left-start`,...e.floatingUIOptions?.useFloatingOptions},useDismissProps:{enabled:!1,...e.floatingUIOptions?.useDismissProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:20},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,t]),i=e.sideMenu||NUe;return(0,Q.jsx)($7,{blockId:t?n?.id:void 0,...r,children:n?.id&&(0,Q.jsx)(i,{})})},FUe={heading:H7,heading_2:U7,heading_3:W7,heading_4:OVe,heading_5:kVe,heading_6:AVe,toggle_heading:H7,toggle_heading_2:U7,toggle_heading_3:W7,quote:HVe,toggle_list:XVe,numbered_list:RVe,bullet_list:zVe,check_list:LVe,paragraph:G7,table:WVe,image:qVe,video:KVe,audio:ZVe,file:bVe,emoji:oHe,code_block:EVe,divider:aHe},IUe=(e,t=.3)=>{let n=Math.floor(e)+t,r=Math.ceil(e)-t;return e>=n&&e<=r?Math.round(e):e<n?Math.floor(e):Math.ceil(e)},LUe=e=>{let t=I7(),n=N7(),r=P7(Z6),i=F7(Z6,{selector:e=>e?.block}),a=(0,Z.useRef)(!1),[o,s]=(0,Z.useState)(),c=(0,Z.useCallback)(t=>{r.freezeHandles(),e.hideOtherElements(!0),i&&(s({originalContent:i.content,originalCroppedContent:{rows:r.cropEmptyRowsOrColumns(i,e.orientation===`addOrRemoveColumns`?`columns`:`rows`)},startPos:e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY}),a.current=!1,t.preventDefault())},[i,e,r]),l=(0,Z.useCallback)(()=>{!i||a.current||n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns(i,`columns`,1):r.addRowsOrColumns(i,`rows`,1)}})},[i,n,e.orientation,r]);return(0,Z.useEffect)(()=>{let t=t=>{if(!i)return;if(!o)throw Error(`editingState is undefined`);a.current=!0;let s=(e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY)-o.startPos,c=e.orientation===`addOrRemoveColumns`?o.originalCroppedContent.rows[0]?.cells.length??0:o.originalCroppedContent.rows.length,l=e.orientation===`addOrRemoveColumns`?o.originalContent.rows[0]?.cells.length??0:o.originalContent.rows.length,u=e.orientation===`addOrRemoveColumns`?i.content.rows[0].cells.length:i.content.rows.length,d=l+IUe(s/(e.orientation===`addOrRemoveColumns`?120:31),.3);d>=c&&d>0&&d!==u&&(n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`columns`,d-c):r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`rows`,d-c)}}),i.content&&n.setTextCursorPosition(i))};return o&&window.addEventListener(`mousemove`,t),()=>{window.removeEventListener(`mousemove`,t)}},[i,o,n,e.orientation,r]),(0,Z.useEffect)(()=>{let t=()=>{e.hideOtherElements(!1),r.unfreezeHandles(),s(void 0)};return o&&window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mouseup`,t)}},[o,e,r]),n.isEditable?(0,Q.jsx)(t.TableHandle.ExtendButton,{className:FZ(`bn-extend-button`,e.orientation===`addOrRemoveColumns`?`bn-extend-button-add-remove-columns`:`bn-extend-button-add-remove-rows`,o===null?``:`bn-extend-button-editing`),onClick:l,onMouseDown:c,children:e.children||(0,Q.jsx)(QVe,{size:18,"data-test":`extendButton`})}):null},RUe=e=>{let t=I7(),n=L7(),r=N7(),{block:i,colIndex:a,rowIndex:o}=F7(Z6,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})}),s=(e,t)=>{if(i===void 0||a===void 0||o===void 0)return;let n=i.content.rows.map(e=>({...e,cells:e.cells.map(e=>AY(e))}));t===`text`?n[o].cells[a].props.textColor=e:n[o].cells[a].props.backgroundColor=e,r.updateBlock(i,{type:`table`,content:{...i.content,rows:n}}),r.setTextCursorPosition(i)};if(i===void 0||a===void 0||o===void 0)return null;let c=i.content.rows[o]?.cells?.[a];return!c||r.settings.tables.cellTextColor===!1&&r.settings.tables.cellBackgroundColor===!1?null:(0,Q.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||n.drag_handle.colors_menuitem})}),(0,Q.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(f9,{iconSize:18,text:r.settings.tables.cellTextColor?{color:MY(c)?c.props.textColor:`default`,setColor:e=>s(e,`text`)}:void 0,background:r.settings.tables.cellBackgroundColor?{color:MY(c)?c.props.backgroundColor:`default`,setColor:e=>s(e,`background`)}:void 0})})]})},zUe=()=>{let e=I7(),t=L7(),n=N7(),r=P7(Z6),{block:i,colIndex:a,rowIndex:o}=F7(Z6,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})});if(i===void 0||a===void 0||o===void 0)return null;let s=i.content.rows[o]?.cells?.[a];return!s||!MY(s)||PY(s)===1&&NY(s)===1||!n.settings.tables.splitCells?null:(0,Q.jsx)(e.Generic.Menu.Item,{onClick:()=>{r.splitCell({row:o,col:a})},children:t.table_handle.split_cell_menuitem})},BUe=e=>(0,Q.jsx)(I7().Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-table-handle-menu`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(zUe,{}),(0,Q.jsx)(RUe,{})]})}),VUe=e=>{let t=I7(),n=N7(),r=P7(Z6),i=e.tableCellMenu||BUe;return!n.settings.tables.splitCells&&!n.settings.tables.cellBackgroundColor&&!n.settings.tables.cellTextColor?null:(0,Q.jsxs)(t.Generic.Menu.Root,{onOpenChange:t=>{t?(r.freezeHandles(),e.hideOtherElements(!0)):(r.unfreezeHandles(),e.hideOtherElements(!1),n.focus())},position:`right`,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{children:(0,Q.jsx)(t.Generic.Menu.Button,{className:`bn-table-cell-handle`,children:e.children||(0,Q.jsx)(fHe,{size:12,"data-test":`tableCellHandle`})})}),(0,Q.jsx)(i,{})]})},y9=e=>{let t=I7(),n=L7(),r=P7(Z6),i=F7(Z6,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>{r.addRowOrColumn(i,e.orientation===`row`?{orientation:`row`,side:e.side}:{orientation:`column`,side:e.side})},children:n.table_handle[`add_${e.side}_menuitem`]})},HUe=e=>{let t=I7(),n=L7(),r=P7(Z6),i=F7(Z6,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>r.removeRowOrColumn(i,e.orientation),children:e.orientation===`row`?n.table_handle.delete_row_menuitem:n.table_handle.delete_column_menuitem})},UUe=e=>{let t=I7(),n=L7(),r=N7(),i=P7(Z6),{block:a,index:o}=F7(Z6,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})}),s=(0,Z.useMemo)(()=>i===void 0||a===void 0||o===void 0?[]:e.orientation===`row`?i.getCellsAtRowHandle(a,o):i.getCellsAtColumnHandle(a,o),[a,o,e.orientation,i]),c=(e,t)=>{if(a===void 0)return;let n=a.content.rows.map(e=>({...e,cells:e.cells.map(e=>AY(e))}));s.forEach(({row:r,col:i})=>{t===`text`?n[r].cells[i].props.textColor=e:n[r].cells[i].props.backgroundColor=e}),r.updateBlock(a,{type:`table`,content:{...a.content,rows:n}}),r.setTextCursorPosition(a)};if(!s||!s[0]||!i||r.settings.tables.cellTextColor===!1&&r.settings.tables.cellBackgroundColor===!1)return null;let l=AY(s[0].cell);return(0,Q.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||n.drag_handle.colors_menuitem})}),(0,Q.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(f9,{iconSize:18,text:r.settings.tables.cellTextColor?{color:s.every(({cell:e})=>MY(e)&&e.props.textColor===l.props.textColor)?l.props.textColor:`default`,setColor:e=>{c(e,`text`)}}:void 0,background:r.settings.tables.cellBackgroundColor?{color:s.every(({cell:e})=>MY(e)&&e.props.backgroundColor===l.props.backgroundColor)?l.props.backgroundColor:`default`,setColor:e=>c(e,`background`)}:void 0})})]})},WUe=e=>{let t=I7(),n=L7(),r=N7(),i=P7(Z6),{block:a,index:o}=F7(Z6,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})});if(i===void 0||a===void 0||o!==0||e.orientation!==`row`||!r.settings.tables.headers)return null;let s=!!a.content.headerRows;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerRows:s?void 0:1}})},children:n.drag_handle.header_row_menuitem})},GUe=e=>{let t=I7(),n=L7(),r=N7(),i=P7(Z6),a=F7(Z6,{selector:e=>e?.block}),o=F7(Z6,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});if(!i||o!==0||!a||e.orientation!==`column`||!r.settings.tables.headers)return null;let s=!!a.content.headerCols;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerCols:s?void 0:1}})},children:n.drag_handle.header_column_menuitem})},KUe=e=>(0,Q.jsx)(I7().Generic.Menu.Dropdown,{className:`bn-table-handle-menu`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(HUe,{orientation:e.orientation}),(0,Q.jsx)(y9,{orientation:e.orientation,side:e.orientation===`row`?`above`:`left`}),(0,Q.jsx)(y9,{orientation:e.orientation,side:e.orientation===`row`?`below`:`right`}),(0,Q.jsx)(WUe,{orientation:e.orientation}),(0,Q.jsx)(GUe,{orientation:e.orientation}),(0,Q.jsx)(UUe,{orientation:e.orientation})]})}),qUe=e=>{let t=N7(),n=I7(),[r,i]=(0,Z.useState)(!1),a=e.tableHandleMenu||KUe,o=P7(Z6),s=F7(Z6),c=(0,Z.useMemo)(()=>!o||!s||!s.block||s.block.type!==`table`?!1:e.orientation===`column`?o.getCellsAtColumnHandle(s.block,s.colIndex).every(({cell:e})=>NY(e)===1):o.getCellsAtRowHandle(s.block,s.rowIndex).every(({cell:e})=>PY(e)===1),[e.orientation,s,o]);return s?(0,Q.jsxs)(n.Generic.Menu.Root,{onOpenChange:n=>{n?(o.freezeHandles(),e.hideOtherElements(!0)):(o.unfreezeHandles(),e.hideOtherElements(!1),t.focus())},position:`right`,children:[(0,Q.jsx)(n.Generic.Menu.Trigger,{children:(0,Q.jsx)(n.TableHandle.Root,{className:FZ(`bn-table-handle`,r?`bn-table-handle-dragging`:``,c?``:`bn-table-handle-not-draggable`),draggable:c,onDragStart:t=>{i(!0),e.hideOtherElements(!0),e.orientation===`column`?o.colDragStart(t):o.rowDragStart(t)},onDragEnd:()=>{o.dragEnd(),e.hideOtherElements(!1),i(!1)},style:e.orientation===`column`?{transform:`rotate(0.25turn)`}:void 0,children:e.children||(0,Q.jsx)(dHe,{size:24,"data-test":`tableHandle`})})}),(0,Q.jsx)(a,{orientation:e.orientation})]}):null},JUe=e=>{let t=N7(),[n,r]=(0,Z.useState)(),i=F7(Z6),a=(0,Z.useMemo)(()=>{let e={};if(i===void 0)return{};let n=qZ(i.block.id,t.prosemirrorState.doc);if(!n)return{};let r=n.posBeforeNode+1,a=t.prosemirrorView.domAtPos(r+1).node;if(!(a instanceof Element))return{};if(e.tableReference={element:a},i.rowIndex===void 0||i.colIndex===void 0)return e;let o=t.prosemirrorState.doc.resolve(r+1).posAtIndex(i.rowIndex),s=t.prosemirrorState.doc.resolve(o+1).posAtIndex(i.colIndex),c=t.prosemirrorView.domAtPos(s+1).node;return c instanceof Element?(e.cellReference={element:c},e.rowReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(e.x,i.draggingState&&i.draggingState.draggedCellOrientation===`row`?i.draggingState.mousePos-t.height/2:t.y,e.width,t.height)}},e.columnReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(i.draggingState&&i.draggingState.draggedCellOrientation===`col`?i.draggingState.mousePos-t.width/2:t.x,e.y,t.width,e.height)}},e):{}},[t,i]),o=(0,Z.useMemo)(()=>i===void 0?void 0:{rowTableHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`),placement:`left`,middleware:[np(-10)]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},columnTableHandle:{useFloatingOptions:{open:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`),placement:`top`,middleware:[np(-12)]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},tableCellHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`),placement:`top-end`,middleware:[np({mainAxis:-15,crossAxis:-1})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendRowsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`),placement:`bottom`,middleware:[op({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendColumnsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`),placement:`right`,middleware:[op({apply({rects:e,elements:t}){Object.assign(t.floating.style,{height:`${e.reference.height}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}}},[n,i]);if(!i)return null;let s=e.tableHandle||qUe,c=e.extendButton||LUe,l=e.tableCellHandle||VUe;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Q7,{reference:a?.rowReference,...o?.rowTableHandle,children:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`)&&(0,Q.jsx)(s,{orientation:`row`,hideOtherElements:e=>r(e?`rowTableHandle`:void 0)})}),(0,Q.jsx)(Q7,{reference:a?.columnReference,...o?.columnTableHandle,children:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`)&&(0,Q.jsx)(s,{orientation:`column`,hideOtherElements:e=>r(e?`columnTableHandle`:void 0)})}),(0,Q.jsx)(Q7,{reference:a?.cellReference,...o?.tableCellHandle,children:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`)&&(0,Q.jsx)(l,{hideOtherElements:e=>r(e?`tableCellHandle`:void 0)})}),(0,Q.jsx)(Q7,{reference:a?.tableReference,...o?.extendRowsButton,children:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`)&&(0,Q.jsx)(c,{orientation:`addOrRemoveRows`,hideOtherElements:e=>r(e?`extendRowsButton`:void 0)})}),(0,Q.jsx)(Q7,{reference:a?.tableReference,...o?.extendColumnsButton,children:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`)&&(0,Q.jsx)(c,{orientation:`addOrRemoveColumns`,hideOtherElements:e=>r(e?`extendColumnsButton`:void 0)})})]})},YUe=(0,Z.lazy)(()=>Promise.resolve().then(()=>lWe)),XUe=(0,Z.lazy)(()=>Promise.resolve().then(()=>uWe)),b9=()=>{let e=(0,Z.useMemo)(()=>window.matchMedia?.call(window,`(prefers-color-scheme: dark)`),[]),t=(0,Z.useMemo)(()=>window.matchMedia?.call(window,`(prefers-color-scheme: light)`),[]),n=e?.matches,r=t?.matches,[i,a]=(0,Z.useState)(n?`dark`:r?`light`:`no-preference`);return(0,Z.useEffect)(()=>{a(n?`dark`:r?`light`:`no-preference`)},[n,r]),(0,Z.useEffect)(()=>{if(typeof e?.addEventListener==`function`){let n=({matches:e})=>e&&a(`dark`),r=({matches:e})=>e&&a(`light`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,r),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,r)}}else{let n=()=>a(e.matches?`dark`:t.matches?`light`:`no-preference`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,n),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,n)}}},[e,t]),window.matchMedia,i},x9=(0,Z.createContext)(void 0),ZUe=({contentComponent:e})=>{let t=(0,Z.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Q.jsx)(Q.Fragment,{children:Object.values(t)})},QUe=(0,Z.forwardRef)((e,t)=>{let[n,r]=(0,Z.useState)();return(0,Z.useImperativeHandle)(t,()=>(e,t)=>{(0,Y7.flushSync)(()=>{r({node:e,container:t})}),r(void 0)},[]),(0,Q.jsx)(Q.Fragment,{children:n&&(0,Y7.createPortal)(n.node,n.container)})}),S9=()=>{},$Ue=Z.forwardRef(({className:e,renderEditor:t,editorColorScheme:n,children:r,...i},a)=>(0,Q.jsx)(`div`,{className:FZ(`bn-container`,n,e),"data-color-scheme":n,...i,ref:a,children:t?(0,Q.jsx)(tWe,{children:r}):r})),eWe=Z.forwardRef(MHe),tWe=e=>{let t=AHe(),n=N7(),r=(0,Z.useMemo)(()=>jHe(),[]),i=(0,Z.useCallback)(e=>{n.isEditable=t.editorProps.editable!==!1,n._tiptapEditor.contentComponent=r,e?n.mount(e):n.unmount()},[t.editorProps.editable,n,r]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ZUe,{contentComponent:r}),(0,Q.jsx)(nWe,{...t.editorProps,...e,mount:i}),(0,Q.jsx)(DHe,{...t.defaultUIProps}),e.children]})},nWe=e=>{let{autoFocus:t,mount:n,contentEditableProps:r}=e;return(0,Q.jsx)(`div`,{"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"data-bn-autofocus":t,ref:n,...r})},HQ(),C9=(e={},t=[])=>(0,Z.useMemo)(()=>{let t=IBe.create(e);return window&&(window.ProseMirror=t._tiptapEditor),t},t),w9=e=>{let[t,n]=(0,Z.useState)(!1),r=R7({editor:e.editor,selector:({editor:e})=>e.isEmpty}),i=I7(),a=(0,Z.useCallback)(()=>{n(!0)},[]),o=(0,Z.useCallback)(()=>{n(!1)},[]);return(0,Z.useEffect)(()=>{e.editable&&e.autoFocus&&e.editor.focus()},[e.autoFocus,e.editable,e.editor]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i.Comments.Editor,{autoFocus:e.autoFocus,className:`bn-comment-editor`,editor:e.editor,onFocus:a,onBlur:o,editable:e.editable}),e.actions&&(0,Q.jsx)(`div`,{className:`bn-comment-actions-wrapper`,children:(0,Q.jsx)(e.actions,{isFocused:t,isEmpty:r})})]})},E9=e=>{let[t,n]=(0,Z.useState)(!1),r=I7(),i=N7(),a=M7();return(0,Q.jsxs)(r.Generic.Popover.Root,{open:t,children:[(0,Q.jsx)(r.Generic.Popover.Trigger,{children:(0,Q.jsx)(`div`,{onClick:r=>{var i;r.preventDefault(),r.stopPropagation(),n(!t),(i=e.onOpenChange)==null||i.call(e,!t)},style:{display:`flex`,justifyContent:`center`,alignItems:`center`},children:e.children})}),i.domElement?.parentElement&&(0,Y7.createPortal)((0,Q.jsx)(r.Generic.Popover.Content,{className:`bn-emoji-picker-popover`,variant:`panel-popover`,children:(0,Q.jsx)(PHe,{perLine:7,onClickOutside:()=>{var t;n(!1),(t=e.onOpenChange)==null||t.call(e,!1)},onEmojiSelect:t=>{var r;e.onEmojiSelect(t),n(!1),(r=e.onOpenChange)==null||r.call(e,!1)},theme:a?.colorSchemePreference})}),i.domElement.parentElement)]})},rWe=e=>{let t=I7(),n=L7(),r=P7(EY),i=e.comment.reactions.find(t=>t.emoji===e.emoji);if(!i)throw Error(`Trying to render reaction badge for non-existing reaction`);let[a,o]=(0,Z.useState)([]),s=J7(a);return(0,Q.jsx)(t.Generic.Badge.Root,{className:FZ(`bn-badge`,`bn-comment-reaction`),text:i.userIds.length.toString(),icon:i.emoji,isSelected:r.threadStore.auth.canDeleteReaction(e.comment,i.emoji),onClick:()=>e.onReactionSelect(i.emoji),onMouseEnter:()=>o(i.userIds),mainTooltip:n.comments.reactions.reacted_by,secondaryTooltip:`${Array.from(s.values()).map(e=>e.username).join(`
|
|
194
|
+
`)}`},i.emoji)},{textColor:iWe,backgroundColor:aWe,...oWe}=B$,D9=t8.create({blockSpecs:{paragraph:g$()},styleSpecs:oWe}),sWe=({comment:e,thread:t,showResolveButton:n})=>{let r=P7(EY),i=L7(),a=C9({initialContent:e.body,trailingBlock:!1,dictionary:{...i,placeholders:{emptyDocument:i.placeholders.edit_comment}},schema:r.commentEditorSchema||D9}),o=I7(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),d=r.threadStore,f=(0,Z.useCallback)(()=>{c(!0)},[]),p=(0,Z.useCallback)(()=>{a.replaceBlocks(a.document,e.body),c(!1)},[a,e.body]),m=(0,Z.useCallback)(async n=>{await d.updateComment({commentId:e.id,comment:{body:a.document},threadId:t.id}),c(!1)},[e,t.id,a,d]),h=(0,Z.useCallback)(async()=>{await d.deleteComment({commentId:e.id,threadId:t.id})},[e,t.id,d]),g=(0,Z.useCallback)(async n=>{d.auth.canAddReaction(e,n)?await d.addReaction({threadId:t.id,commentId:e.id,emoji:n}):d.auth.canDeleteReaction(e,n)&&await d.deleteReaction({threadId:t.id,commentId:e.id,emoji:n})},[d,e,t.id]),_=(0,Z.useCallback)(async()=>{await d.resolveThread({threadId:t.id})},[t.id,d]),v=(0,Z.useCallback)(async()=>{await d.unresolveThread({threadId:t.id})},[t.id,d]),y=FHe(e.userId);if(!e.body)return null;let b,x=d.auth.canAddReaction(e),S=d.auth.canDeleteComment(e),C=d.auth.canUpdateComment(e),w=n&&(t.resolved?d.auth.canUnresolveThread(t):d.auth.canResolveThread(t));s||(b=(0,Q.jsxs)(o.Generic.Toolbar.Root,{className:FZ(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:[x&&(0,Q.jsx)(E9,{onEmojiSelect:e=>g(e.native),onOpenChange:u,children:(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.add_reaction,variant:`compact`,children:(0,Q.jsx)(sHe,{size:16})},`add-reaction`)}),w&&(t.resolved?(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:`Re-open`,variant:`compact`,onClick:v,children:(0,Q.jsx)(gVe,{size:16})},`reopen`):(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.resolve,variant:`compact`,onClick:_,children:(0,Q.jsx)($Ve,{size:16})},`resolve`)),(S||C)&&(0,Q.jsxs)(o.Generic.Menu.Root,{position:`bottom-start`,children:[(0,Q.jsx)(o.Generic.Menu.Trigger,{children:(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.more_actions,variant:`compact`,children:(0,Q.jsx)(iHe,{size:16})},`more-actions`)}),(0,Q.jsxs)(o.Generic.Menu.Dropdown,{className:`bn-menu-dropdown`,children:[C&&(0,Q.jsx)(o.Generic.Menu.Item,{icon:(0,Q.jsx)(vVe,{}),onClick:f,children:i.comments.actions.edit_comment},`edit-comment`),S&&(0,Q.jsx)(o.Generic.Menu.Item,{icon:(0,Q.jsx)(tHe,{}),onClick:h,children:i.comments.actions.delete_comment},`delete-comment`)]})]})]}));let T=e.createdAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`});if(!e.body)throw Error(`soft deletes are not yet supported`);return(0,Q.jsx)(o.Comments.Comment,{authorInfo:y??`loading`,timeString:T,edited:e.updatedAt.getTime()!==e.createdAt.getTime(),showActions:`hover`,actions:b,className:`bn-thread-comment`,emojiPickerOpen:l,children:(0,Q.jsx)(w9,{autoFocus:s,editor:a,editable:s,actions:e.reactions.length>0||s?({isEmpty:t})=>(0,Q.jsxs)(Q.Fragment,{children:[e.reactions.length>0&&!s&&(0,Q.jsxs)(o.Generic.Badge.Group,{className:FZ(`bn-badge-group`,`bn-comment-reactions`),children:[e.reactions.map(t=>(0,Q.jsx)(rWe,{comment:e,emoji:t.emoji,onReactionSelect:g},t.emoji)),x&&(0,Q.jsx)(E9,{onEmojiSelect:e=>g(e.native),onOpenChange:u,children:(0,Q.jsx)(o.Generic.Badge.Root,{className:FZ(`bn-badge`,`bn-comment-add-reaction`),text:`+`,icon:(0,Q.jsx)(sHe,{size:16}),mainTooltip:i.comments.actions.add_reaction})})]}),s&&(0,Q.jsxs)(o.Generic.Toolbar.Root,{variant:`action-toolbar`,className:FZ(`bn-action-toolbar`,`bn-comment-actions`),children:[(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.save_button_text,variant:`compact`,onClick:m,isDisabled:t,children:i.comments.save_button_text}),(0,Q.jsx)(o.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:i.comments.cancel_button_text,variant:`compact`,onClick:p,children:i.comments.cancel_button_text})]})]}):void 0})})},cWe=({thread:e,maxCommentsBeforeCollapse:t})=>{let n=I7(),r=L7(),i=J7(e.resolvedBy?[e.resolvedBy]:[]),a=e.comments.map((t,n)=>(0,Q.jsx)(sWe,{thread:e,comment:t,showResolveButton:n===0},t.id+JSON.stringify(t.body||`{}`)));if(e.resolved&&e.resolvedUpdatedAt&&e.resolvedBy){if(!i.get(e.resolvedBy))throw Error(`User ${e.resolvedBy} resolved thread ${e.id}, but their data could not be found.`);let t=e.comments.findLastIndex(t=>e.resolvedUpdatedAt.getTime()>t.createdAt.getTime())+1;a.splice(t,0,(0,Q.jsx)(n.Comments.Comment,{className:`bn-thread-comment`,authorInfo:e.resolvedBy&&i.get(e.resolvedBy)||`loading`,timeString:e.resolvedUpdatedAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),edited:!1,showActions:!1,children:(0,Q.jsx)(`div`,{className:`bn-resolved-text`,children:r.comments.sidebar.marked_as_resolved})},`resolved-comment`))}return t&&a.length>t&&a.splice(1,a.length-2,(0,Q.jsx)(n.Comments.ExpandSectionsPrompt,{className:`bn-thread-expand-prompt`,children:r.comments.sidebar.more_replies(e.comments.length-2)},`expand-prompt`)),a},lWe=Object.freeze(Object.defineProperty({__proto__:null,default:LHe},Symbol.toStringTag,{value:`Module`})),O9=({thread:e,selected:t,referenceText:n,maxCommentsBeforeCollapse:r,onFocus:i,onBlur:a,tabIndex:o})=>{let s=I7(),c=L7(),l=P7(EY),u=C9({trailingBlock:!1,dictionary:{...c,placeholders:{emptyDocument:c.placeholders.comment_reply}},schema:l.commentEditorSchema||D9}),d=(0,Z.useCallback)(async()=>{await l.threadStore.addComment({comment:{body:u.document},threadId:e.id}),u.removeBlocks(u.document)},[l,u,e.id]);return(0,Q.jsxs)(s.Comments.Card,{className:`bn-thread`,headerText:n,onFocus:i,onBlur:a,selected:t,tabIndex:o,children:[(0,Q.jsx)(s.Comments.CardSection,{className:`bn-thread-comments`,children:(0,Q.jsx)(cWe,{thread:e,maxCommentsBeforeCollapse:t?void 0:r||5})}),t&&(0,Q.jsx)(s.Comments.CardSection,{className:`bn-thread-composer`,children:(0,Q.jsx)(w9,{autoFocus:!1,editable:!0,editor:u,actions:({isEmpty:e})=>e?null:(0,Q.jsx)(s.Generic.Toolbar.Root,{variant:`action-toolbar`,className:FZ(`bn-action-toolbar`,`bn-comment-actions`),children:(0,Q.jsx)(s.Generic.Toolbar.Button,{mainTooltip:c.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:d,children:c.comments.save_button_text})})})})]})},uWe=Object.freeze(Object.defineProperty({__proto__:null,default:zHe},Symbol.toStringTag,{value:`Module`})),Z.memo(({thread:e,selectedThreadId:t,maxCommentsBeforeCollapse:n,referenceText:r})=>{let i=P7(EY),a=(0,Z.useCallback)(t=>{t.target.closest(`.bn-action-toolbar`)||i.selectThread(e.id)},[i,e.id]),o=(0,Z.useCallback)(e=>{if(!e.relatedTarget||e.relatedTarget.closest(`.bn-action-toolbar`))return;let t=e.target instanceof Node?e.target:null,n=e.relatedTarget instanceof Node?e.relatedTarget.closest(`.bn-thread`):null;(!t||!n||!n.contains(t))&&i.selectThread(void 0)},[i]);return(0,Q.jsx)(O9,{thread:e,selected:e.id===t,referenceText:r,maxCommentsBeforeCollapse:n,onFocus:a,onBlur:o,tabIndex:0})})}));function dWe(e,t){if(e==null)return{};var n=fWe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fWe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function A9(){return A9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A9.apply(this,arguments)}function pWe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pWe(Object(n),!0).forEach(function(t){mWe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pWe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mWe(e,t,n){return t=hWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hWe(e){var t=gWe(e,`string`);return typeof t==`symbol`?t:t+``}function gWe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _We(e){return e&&e.map((e,t)=>M9.createElement(e.tag,j9({key:t},e.attr),_We(e.child)))}function vWe(e){return t=>M9.createElement(yWe,A9({attr:j9({},e.attr)},t),_We(e.child))}function yWe(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=dWe(e,cGe),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),M9.createElement(`svg`,A9({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:j9(j9({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&M9.createElement(`title`,null,i),e.children)};return z9===void 0?t(R9):M9.createElement(z9.Consumer,null,e=>t(e))}function bWe(e){return vWe({attr:{viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,clipRule:`evenodd`},child:[]}]})(e)}var $,M9,N9,P9,xWe,SWe,F9,I9,CWe,wWe,TWe,EWe,DWe,OWe,kWe,AWe,jWe,MWe,NWe,PWe,FWe,IWe,LWe,RWe,zWe,BWe,VWe,HWe,UWe,WWe,GWe,KWe,qWe,JWe,YWe,XWe,ZWe,QWe,$We,eGe,tGe,nGe,rGe,iGe,aGe,oGe,sGe,L9,R9,z9,cGe,B9,lGe,V9,H9,U9,uGe=o((()=>{$=N(),LBe(),k9(),gre(),M9=u(p(),1),la(),N9=(e,t,n=!1)=>{let r=[];function i(e,r=`--bn`){for(let a in e){let o=`${r}-${a.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`;typeof e[a]==`object`?i(e[a],o):(typeof e[a]==`number`&&(e[a]=`${e[a]}px`),n?t.style.removeProperty(o):t.style.setProperty(o,e[a].toString()))}}return i(e),r},P9=(e,t)=>N9(e,t),xWe={colors:{editor:{text:void 0,background:void 0},menu:{text:void 0,background:void 0},tooltip:{text:void 0,background:void 0},hovered:{text:void 0,background:void 0},selected:{text:void 0,background:void 0},disabled:{text:void 0,background:void 0},shadow:void 0,border:void 0,sideMenu:void 0,highlights:{gray:{text:void 0,background:void 0},brown:{text:void 0,background:void 0},red:{text:void 0,background:void 0},orange:{text:void 0,background:void 0},yellow:{text:void 0,background:void 0},green:{text:void 0,background:void 0},blue:{text:void 0,background:void 0},purple:{text:void 0,background:void 0},pink:{text:void 0,background:void 0}}},borderRadius:void 0,fontFamily:void 0},SWe=e=>N9(xWe,e,!0),F9=e=>(0,$.jsxs)(Ey,{gap:0,className:`bn-tooltip`,children:[(0,$.jsx)(Wg,{size:`sm`,lineClamp:5,children:e.mainTooltip}),e.secondaryTooltip&&(0,$.jsx)(Wg,{size:`xs`,lineClamp:5,children:e.secondaryTooltip})]}),I9=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:c,onClick:l,label:u,variant:d,...f}=e;FY(f,!1);let[p,m]=(0,M9.useState)(!1),h=r?(0,$.jsx)(T_,{"aria-label":u,className:n,onMouseDown:e=>{dQ()&&e.currentTarget.focus()},onClick:e=>{m(!0),l?.(e)},onPointerLeave:()=>m(!1),"aria-pressed":s,"data-selected":s||void 0,"data-test":i?i.slice(0,1).toLowerCase()+i.replace(/\s+/g,``).slice(1):void 0,size:d===`compact`?`compact-xs`:`xs`,disabled:c||!1,ref:t,...f,children:r}):(0,$.jsx)(og,{className:n,"aria-label":u,onMouseDown:e=>{dQ()&&e.currentTarget.focus()},onClick:e=>{m(!0),l?.(e)},onPointerLeave:()=>m(!1),"aria-pressed":s,"data-selected":s||void 0,"data-test":i?i.slice(0,1).toLowerCase()+i.replace(/\s+/g,``).slice(1):void 0,size:d===`compact`?20:30,disabled:c||!1,ref:t,...f,children:o});return i?(0,$.jsx)(yy,{disabled:p,withinPortal:!1,label:(0,$.jsx)(F9,{mainTooltip:i,secondaryTooltip:a}),children:h}):h}),CWe=(0,M9.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:c,onMouseEnter:l,...u}=e;FY(u,!1);let[d,f]=(0,M9.useState)(!1),p=(0,$.jsxs)(K_,{className:n,checked:a===!0,wrapperProps:{onMouseEnter:l,onMouseLeave:()=>f(!1),onClick:e=>{f(!0),c?.(e)}},variant:`light`,icon:null,ref:t,children:[(0,$.jsx)(`span`,{children:i}),(0,$.jsx)(`span`,{children:r})]});return!o||d?p:(0,$.jsx)(yy,{refProp:`rootRef`,withinPortal:!1,label:(0,$.jsx)(F9,{mainTooltip:o,secondaryTooltip:s}),children:p})}),wWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i),(0,$.jsx)(pg,{className:n,ref:t,children:r})}),TWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,headerText:i,selected:a,onFocus:o,onBlur:s,tabIndex:c,...l}=e;return FY(l,!1),(0,$.jsxs)(I_,{className:FZ(n,a?`selected`:``),onFocus:o,onBlur:s,tabIndex:c,ref:t,children:[i&&(0,$.jsx)(Wg,{className:`bn-header-text`,children:i}),r]})}),EWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i,!1),(0,$.jsx)(I_.Section,{className:n,ref:t,children:r})}),DWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i,!1),(0,$.jsx)(Z_,{className:n,label:(0,$.jsx)(Wg,{children:r}),ref:t})}),OWe=(0,M9.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=L7();return FY(a,!1),n===`loading`?(0,$.jsxs)(pg,{children:[(0,$.jsx)(wy,{height:24,width:24}),(0,$.jsx)(`div`,{children:(0,$.jsx)(wy,{height:12,width:100})})]}):(0,$.jsxs)(pg,{children:[(0,$.jsx)(c_,{src:n.avatarUrl,alt:n.username,radius:`xl`,size:`sm`,color:`initials`}),(0,$.jsxs)(Wg,{fz:`sm`,fw:`bold`,children:[n.username,(0,$.jsxs)(Wg,{fz:`xs`,c:`dimmed`,span:!0,ml:`xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),kWe=(0,M9.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,edited:o,actions:s,emojiPickerOpen:c,children:l,...u}=e,{hovered:d,ref:f}=$i(),p=VHe([t,f]);return FY(u,!1),(0,$.jsxs)(pg,{pos:`relative`,ref:p,className:n,children:[s&&(r===!0||r===void 0||r===`hover`&&d||c)?(0,$.jsx)(pg,{style:{position:`absolute`,right:0,top:0,zIndex:10},children:s}):null,(0,$.jsx)(OWe,{...e}),l]})}),AWe=(0,M9.forwardRef)((e,t)=>{let{className:n,autoFocus:r,onFocus:i,onBlur:a,editor:o,editable:s,...c}=e;FY(c,!1);let l=M7();return(0,$.jsx)(V9,{autoFocus:r,className:n,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,theme:l?.colorSchemePreference,ref:t,onFocus:i,onBlur:a,children:(0,$.jsx)(v9,{formattingToolbar:jWe})})}),jWe=()=>(0,$.jsx)(_9,{blockTypeSelectItems:[],children:g9([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`)}),MWe=(0,M9.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:c,placeholder:l,disabled:u,onKeyDown:d,onChange:f,onSubmit:p,autoComplete:m,"aria-activedescendant":h,rightSection:g,..._}=e;return FY(_),(0,$.jsx)(Ry,{size:`xs`,className:FZ(n||``,a===`large`?`bn-mt-input-large`:``),ref:t,name:r,label:i,leftSection:o,value:s,autoFocus:c,"data-autofocus":c?`true`:void 0,rightSection:g,placeholder:l,disabled:u,onKeyDown:d,onChange:f,onSubmit:p,autoComplete:m,"aria-activedescendant":h})}),NWe=(0,M9.createContext)(void 0),PWe=e=>{let{children:t,onOpenChange:n,position:r,sub:i,...a}=e;return FY(a),i?(0,$.jsx)(Kv.Sub,{transitionProps:{duration:250,exitDelay:250},withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onChange:n,position:r,children:t}):(0,$.jsx)(Kv,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onChange:n,position:r,returnFocus:!1,children:t})},FWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,subTrigger:o,onClick:s,...c}=e;return FY(c,!1),o?(0,$.jsx)(Kv.Sub.Item,{className:n,ref:t,leftSection:i,rightSection:a?(0,$.jsx)(Gg,{size:10}):a===!1?(0,$.jsx)(`div`,{className:`bn-tick-space`}):null,onClick:s,...c,children:r}):(0,$.jsx)(Kv.Item,{className:n,ref:t,leftSection:i,rightSection:a?(0,$.jsx)(Gg,{size:10}):a===!1?(0,$.jsx)(`div`,{className:`bn-tick-space`}):null,onClick:s,...c,children:r})}),IWe=e=>{let{children:t,sub:n,...r}=e;return FY(r),n?(0,$.jsx)(Kv.Sub.Target,{children:t}):(0,$.jsx)(Kv.Target,{children:t})},LWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;FY(a);let o=(0,M9.useContext)(NWe);return i?(0,$.jsx)(Kv.Sub.Dropdown,{className:n,ref:t,onMouseOver:o?.onMenuMouseOver,onMouseLeave:o?.onMenuMouseLeave,children:r}):(0,$.jsx)(Kv.Dropdown,{className:n,ref:t,onMouseOver:o?.onMenuMouseOver,onMouseLeave:o?.onMenuMouseLeave,children:r})}),RWe=(0,M9.forwardRef)((e,t)=>{let{className:n,...r}=e;return FY(r),(0,$.jsx)(Kv.Divider,{className:n,ref:t})}),zWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i),(0,$.jsx)(Kv.Label,{className:n,ref:t,children:r})}),BWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;return FY(u,!1),i?(0,$.jsx)(og,{size:24,className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:i}):(0,$.jsx)(T_,{className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:r})}),VWe=(0,M9.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...c}=e;return FY(c),(0,$.jsx)(pg,{className:n,ref:t,children:(0,$.jsxs)(Ly,{value:a,defaultValue:i,onChange:o,children:[s&&(0,$.jsx)(fv,{visible:s}),(0,$.jsx)(Ly.List,{children:r.map(e=>(0,$.jsx)(Ly.Tab,{"data-test":`${e.name.toLowerCase()}-tab`,value:e.name,children:e.name},e.name))}),r.map(e=>(0,$.jsx)(Ly.Panel,{value:e.name,children:e.tabPanel},e.name))]})})}),HWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,onClick:i,label:a,...o}=e;return FY(o),(0,$.jsx)(T_,{size:`xs`,"aria-label":a,className:n,ref:t,onClick:i,...o,children:r})}),UWe=(0,M9.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;return FY(s),(0,$.jsx)(sv,{size:`xs`,className:n,ref:t,accept:r,value:i,placeholder:a,onChange:o,...s})}),WWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i),(0,$.jsx)(`div`,{className:n,ref:t,children:r})}),GWe=(0,M9.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;return FY(s),(0,$.jsx)(Ry,{size:`xs`,"data-test":`embed-input`,className:n,ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),KWe=e=>{let{open:t,onOpenChange:n,position:r,children:i,...a}=e;return FY(a),(0,$.jsx)(jh,{middlewares:{size:{padding:20}},withinPortal:!1,opened:t,onChange:n,position:r,zIndex:1e4,children:i})},qWe=e=>{let{children:t,...n}=e;return FY(n),(0,$.jsx)(Oh,{children:t})},JWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,variant:i,...a}=e;return FY(a),(0,$.jsx)(wh,{className:n,ref:t,children:r})}),YWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i,!1),(0,$.jsx)(pg,{align:`center`,gap:0,className:n,ref:t,...i,children:r})}),XWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;return FY(u,!1),i?(0,$.jsx)(og,{size:24,className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:i}):(0,$.jsx)(T_,{className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:r})}),ZWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return FY(a),(0,$.jsx)(Ey,{gap:0,className:n,ref:t,id:i,role:`listbox`,children:r})}),QWe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i),(0,$.jsx)(pg,{className:n,ref:t,children:(0,$.jsx)(pg,{className:`bn-mt-suggestion-menu-item-title`,children:r})})}),$We=(0,M9.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;FY(s);let c=(0,M9.useRef)(null);return(0,M9.useEffect)(()=>{!c.current||!r||BHe(c.current,c.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,$.jsxs)(pg,{gap:0,className:n,ref:Wi(t,c),id:o,role:`option`,onMouseDown:e=>e.preventDefault(),onClick:i,"aria-selected":r||void 0,children:[a.icon&&(0,$.jsx)(pg,{className:`bn-mt-suggestion-menu-item-section`,"data-position":`left`,children:a.icon}),(0,$.jsxs)(Ey,{gap:0,className:`bn-mt-suggestion-menu-item-body`,children:[(0,$.jsx)(Wg,{className:`bn-mt-suggestion-menu-item-title`,children:a.title}),(0,$.jsx)(Wg,{className:`bn-mt-suggestion-menu-item-subtitle`,children:a.subtext})]}),a.badge&&(0,$.jsx)(pg,{"data-position":`right`,className:`bn-mt-suggestion-menu-item-section`,children:(0,$.jsx)(f_,{size:`xs`,children:a.badge})})]})}),eGe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return FY(i),(0,$.jsx)(pg,{className:n,ref:t,children:r})}),tGe=(0,M9.forwardRef)((e,t)=>{let{className:n,...r}=e;return FY(r),(0,$.jsx)(Qh,{className:n,type:`dots`,size:16,ref:t})}),nGe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return FY(o),(0,$.jsx)(`div`,{className:n,style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),rGe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return FY(a),(0,$.jsx)(pg,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:(0,$.jsx)(pg,{className:`bn-mt-suggestion-menu-item-title`,children:r})})}),iGe=(0,M9.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;FY(s);let c=(0,M9.useRef)(null);return(0,M9.useEffect)(()=>{!c.current||!r||BHe(c.current,c.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,$.jsx)(`div`,{className:n,ref:Wi(t,c),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),aGe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return FY(a),(0,$.jsx)(Qh,{className:n,style:{gridColumn:`1 / ${i+1}`},type:`dots`,ref:t})}),oGe=(0,M9.forwardRef)((e,t)=>{let{children:n,className:r,onMouseDown:i,onClick:a,...o}=e;return FY(o,!1),(0,$.jsx)(T_,{className:r,ref:t,onMouseDown:i,onClick:a,...o,children:n})}),sGe=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:c,...l}=e;return FY(l,!1),(0,$.jsx)(T_,{className:n,ref:t,"aria-label":c,draggable:i,onDragStart:a,onDragEnd:o,style:s,...l,children:r})}),L9=(0,M9.forwardRef)((e,t)=>{let{className:n,children:r,onMouseEnter:i,onMouseLeave:a,variant:o,...s}=e;FY(s);let{ref:c,focused:l}=oa();return(0,$.jsx)(Pg,{className:n,ref:Wi(t,c,Ni(l)),role:`toolbar`,onMouseEnter:i,onMouseLeave:a,gap:o===`action-toolbar`?2:void 0,children:r})}),R9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},z9=M9.createContext&&M9.createContext(R9),cGe=[`attr`,`size`,`title`],B9=(0,M9.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,...a}=e;FY(a);let o=r.filter(e=>e.isSelected)[0];return o?(0,$.jsxs)(Kv,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:i,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[(0,$.jsx)(Kv.Target,{children:(0,$.jsx)(T_,{onMouseDown:e=>{dQ()&&e.currentTarget.focus()},leftSection:o.icon,rightSection:(0,$.jsx)(bWe,{}),size:`xs`,variant:`subtle`,disabled:i,children:o.text})}),(0,$.jsx)(Kv.Dropdown,{className:n,ref:t,children:r.map(e=>(0,$.jsx)(Kv.Item,{onClick:e.onClick,leftSection:e.icon,rightSection:e.isSelected?(0,$.jsx)(Gg,{size:10,className:`bn-tick-icon`}):(0,$.jsx)(`div`,{className:`bn-tick-space`}),disabled:e.isDisabled,children:e.text},e.text))})]}):null}),lGe={FormattingToolbar:{Root:L9,Button:I9,Select:B9},FilePanel:{Root:VWe,Button:HWe,FileInput:UWe,TabPanel:WWe,TextInput:GWe},GridSuggestionMenu:{Root:nGe,Item:iGe,EmptyItem:rGe,Loader:aGe},LinkToolbar:{Root:L9,Button:I9,Select:B9},SideMenu:{Root:YWe,Button:XWe},SuggestionMenu:{Root:ZWe,Item:$We,EmptyItem:QWe,Label:eGe,Loader:tGe},TableHandle:{Root:sGe,ExtendButton:oGe},Generic:{Badge:{Root:CWe,Group:wWe},Form:{Root:e=>(0,$.jsx)(`div`,{children:e.children}),TextInput:MWe},Menu:{Root:PWe,Trigger:IWe,Dropdown:LWe,Divider:RWe,Label:zWe,Item:FWe,Button:BWe},Popover:{Root:KWe,Trigger:qWe,Content:JWe},Toolbar:{Root:L9,Button:I9,Select:B9}},Comments:{Comment:kWe,Editor:AWe,Card:TWe,CardSection:EWe,ExpandSectionsPrompt:DWe}},V9=e=>{let{className:t,theme:n,...r}=e,i=M7(),a=b9(),o=i?.colorSchemePreference||a,s=(0,M9.useCallback)(e=>{if(e&&(SWe(e),typeof n==`object`)){if(`light`in n&&`dark`in n){P9(n[o===`dark`?`dark`:`light`],e);return}P9(n,e);return}},[o,n]),c=(0,M9.useContext)(Ia),l=typeof n==`string`?n:o===`no-preference`?`light`:o,u=(0,$.jsx)(e9.Provider,{value:lGe,children:(0,$.jsx)(eWe,{"data-mantine-color-scheme":l,className:FZ(`bn-mantine`,t||``),theme:typeof n==`object`?void 0:n,...r,ref:s})});return c?u:(0,$.jsx)(fs,{withCssVariables:!1,getRootElement:()=>{},children:u})},H9=[`#FFFFFF`,`#EFEFEF`,`#CFCFCF`,`#AFAFAF`,`#7F7F7F`,`#3F3F3F`,`#1F1F1F`,`#161616`,`#0F0F0F`,`#000000`],U9={colors:{editor:{text:H9[5],background:H9[0]},menu:{text:H9[5],background:H9[0]},tooltip:{text:H9[5],background:H9[1]},hovered:{text:H9[5],background:H9[1]},selected:{text:H9[0],background:H9[5]},disabled:{text:H9[3],background:H9[1]},shadow:H9[2],border:H9[1],sideMenu:H9[2],highlights:mQ},borderRadius:6,fontFamily:`"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif`},H9[2],H9[6],H9[2],H9[6],H9[2],H9[7],H9[2],H9[7],H9[2],H9[8],H9[5],H9[7],H9[8],H9[7],H9[4],U9.borderRadius,U9.fontFamily})),dGe=o((()=>{})),fGe=o((()=>{}));function pGe(e){let t=e.match(hGe);if(!t)return{frontmatter:{},body:e};let n=t[1],r={};for(let e of n.split(`
|
|
195
|
+
`)){let t=e.indexOf(`:`);if(t===-1)continue;let n=e.slice(0,t).trim(),i=e.slice(t+1).trim();/^-?\d+(\.\d+)?$/.test(i)&&(i=Number(i)),r[n]=i}return{frontmatter:r,body:e.slice(t[0].length)}}function mGe(e,t){let n=Object.keys(e);return n.length===0?t:`---\n${n.map(t=>`${t}: ${e[t]}`).join(`
|
|
196
|
+
`)}\n---\n${t}`}var hGe,gGe=o((()=>{hGe=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/}));async function _Ge(e){let t=e.document,n=await e.blocksToMarkdownLossy(t),r={};function i(e){for(let t of e){if(t.type===`image`&&t.props?.url){let e=t.props.previewWidth,n=t.props.textAlignment;(e!=null||n&&n!==`left`)&&(r[t.props.url]={previewWidth:e,textAlignment:n})}t.children&&i(t.children)}}return i(t),n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let i=r[n];if(!i)return e;let a=[`src="${n}"`,`alt="${t}"`];i.previewWidth&&a.push(`width="${i.previewWidth}"`);let o=`<img ${a.join(` `)} />`;return i.textAlignment&&i.textAlignment!==`left`?`<div align="${i.textAlignment===`center`?`center`:`right`}">${o}</div>`:o})}function vGe(e){let t={},n=e.replace(/<div\s+align="([^"]*)">\s*<img\s+([^>]*)\/?\s*>\s*<\/div>/gi,(e,n,r)=>{let i=r.match(/src="([^"]*)"/i),a=r.match(/alt="([^"]*)"/i),o=r.match(/width="([^"]*)"/i);if(!i)return e;let s=i[1],c=a?a[1]:``;return t[s]={textAlignment:n===`center`?`center`:n===`right`?`right`:`left`},o&&(t[s].previewWidth=Number(o[1])||o[1]),``});return n=n.replace(/<img\s+([^>]*)\/?\s*>/gi,(e,n)=>{let r=n.match(/src="([^"]*)"/i),i=n.match(/alt="([^"]*)"/i),a=n.match(/width="([^"]*)"/i);if(!r)return e;let o=r[1],s=i?i[1]:``;return a&&(t[o]||(t[o]={}),t[o].previewWidth=Number(a[1])||a[1]),``}),{processed:n,imageProps:t}}function W9(e,t){for(let n of e){if(n.type===`image`&&n.props?.url&&t[n.props.url]){let e=t[n.props.url];e.previewWidth&&(n.props.previewWidth=e.previewWidth),e.textAlignment&&(n.props.textAlignment=e.textAlignment)}n.children&&W9(n.children,t)}return e}var yGe=o((()=>{}));function bGe(){let[e,t]=(0,G9.useState)(()=>document.documentElement.getAttribute(`data-theme`)||`light`);return(0,G9.useEffect)(()=>{let e=new MutationObserver(()=>{t(document.documentElement.getAttribute(`data-theme`)||`light`)});return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>e.disconnect()},[]),e}var G9,xGe=o((()=>{G9=u(p())})),SGe=o((()=>{}));function CGe({docPath:e}){let t=e.split(`/`);return(0,K9.jsx)(`span`,{className:`breadcrumb`,children:t.map((e,n)=>{let r=t.slice(0,n+1).join(`/`),i=n===t.length-1;return(0,K9.jsxs)(`span`,{className:`breadcrumb-segment`,children:[n>0&&(0,K9.jsx)(`span`,{className:`breadcrumb-sep`,children:`/`}),i?(0,K9.jsx)(`span`,{className:`breadcrumb-current`,children:e}):(0,K9.jsx)(Vn,{to:`/doc/${r}`,className:`breadcrumb-link`,children:e})]},r)})})}var K9,wGe=o((()=>{p(),Xn(),SGe(),K9=N()})),TGe=o((()=>{}));function EGe({content:e,docPath:t,onSave:n,onDelete:r,isFolder:i,fullWidth:a,onToggleWidth:o}){let s=(0,q9.useRef)(null),c=(0,q9.useRef)({}),l=(0,q9.useRef)(null),u=bGe(),d=C9({initialContent:void 0,uploadFile:async e=>(await Tre(e)).url});(0,q9.useMemo)(()=>{if(d&&e!==void 0){let{frontmatter:t,body:n}=pGe(e);c.current=t,(async()=>{try{let{processed:e,imageProps:t}=vGe(n),r=await d.tryParseMarkdownToBlocks(e);W9(r,t),d.replaceBlocks(d.document,r)}catch{d.replaceBlocks(d.document,[{type:`paragraph`,content:[{type:`text`,text:n}]}])}})()}},[d,e]);let f=(0,q9.useCallback)(async()=>{clearTimeout(s.current),s.current=setTimeout(async()=>{try{let e=await _Ge(d);await n(mGe(c.current,e))}catch(e){console.error(`Auto-save failed:`,e)}},1e3)},[d,n]);return(0,J9.jsxs)(`div`,{className:`editor-container`,children:[(0,J9.jsxs)(`div`,{className:`editor-toolbar`,children:[(0,J9.jsx)(CGe,{docPath:t}),(0,J9.jsxs)(`div`,{className:`editor-toolbar-actions`,children:[(0,J9.jsx)(`button`,{className:`editor-width-btn`,onClick:o,title:a?`Narrow view`:`Full width`,children:a?(0,J9.jsx)(OA,{size:16}):(0,J9.jsx)(wA,{size:16})}),!i&&(0,J9.jsx)(`button`,{className:`editor-delete-btn`,onClick:r,title:`Delete document`,children:(0,J9.jsx)(cA,{size:16})})]})]}),(0,J9.jsx)(`div`,{className:`editor-blocknote`,ref:l,children:(0,J9.jsx)(V9,{editor:d,onChange:f,theme:u})})]})}var q9,J9,DGe=o((()=>{q9=u(p()),k9(),uGe(),dGe(),fGe(),gGe(),yGe(),xGe(),Vy(),MA(),wGe(),TGe(),J9=N()})),OGe=o((()=>{}));function kGe({folderPath:e,onTreeChange:t,fullWidth:n,onToggleWidth:r}){let[i,a]=(0,Y9.useState)(null),[o,s]=(0,Y9.useState)(!0),c=(0,Y9.useRef)(null),l=(0,Y9.useRef)({}),u=(0,Y9.useRef)(null),d=bGe(),f=C9({initialContent:void 0,uploadFile:async e=>(await Tre(e)).url});(0,Y9.useEffect)(()=>{e&&(s(!0),Cre(e).then(e=>{if(a(e),f&&e.content){let{frontmatter:t,body:n}=pGe(e.content);l.current=t,(async()=>{try{let{processed:e,imageProps:t}=vGe(n),r=await f.tryParseMarkdownToBlocks(e);W9(r,t),f.replaceBlocks(f.document,r)}catch{f.replaceBlocks(f.document,[{type:`paragraph`,content:[{type:`text`,text:n}]}])}})()}}).catch(()=>a(null)).finally(()=>s(!1)))},[e,f]);let p=(0,Y9.useCallback)(async()=>{clearTimeout(c.current),c.current=setTimeout(async()=>{try{let n=await _Ge(f);await wre(e,mGe(l.current,n)),t()}catch(e){console.error(`Auto-save failed:`,e)}},1e3)},[f,e,t]);return o?(0,X9.jsx)(`div`,{className:`loading`,children:`Loading...`}):i?(0,X9.jsxs)(`div`,{className:`folder-view`,children:[(0,X9.jsxs)(`div`,{className:`editor-toolbar`,children:[(0,X9.jsx)(CGe,{docPath:e}),(0,X9.jsx)(`div`,{className:`editor-toolbar-actions`,children:(0,X9.jsx)(`button`,{className:`editor-width-btn`,onClick:r,title:n?`Narrow view`:`Full width`,children:n?(0,X9.jsx)(OA,{size:16}):(0,X9.jsx)(wA,{size:16})})})]}),(0,X9.jsx)(`div`,{className:`folder-editor`,ref:u,children:(0,X9.jsx)(V9,{editor:f,onChange:p,theme:d})}),i.children&&i.children.length>0&&(0,X9.jsxs)(`div`,{className:`folder-children`,children:[(0,X9.jsx)(`h3`,{className:`folder-children-title`,children:`Contents`}),(0,X9.jsx)(`ul`,{className:`folder-children-list`,children:i.children.map(e=>(0,X9.jsx)(`li`,{className:`folder-child-item`,children:(0,X9.jsxs)(Vn,{to:`/doc/${e.path}`,className:`folder-child-link`,children:[(0,X9.jsx)(`span`,{className:`folder-child-icon`,children:e.type===`folder`?(0,X9.jsx)(Qk,{size:18}):(0,X9.jsx)(Yk,{size:18})}),(0,X9.jsx)(`span`,{className:`folder-child-name`,children:e.title||e.name})]})},e.path))})]})]}):(0,X9.jsx)(`div`,{className:`not-found`,children:`Folder not found.`})}var Y9,X9,AGe=o((()=>{Y9=u(p()),Xn(),k9(),uGe(),dGe(),fGe(),Vy(),gGe(),yGe(),xGe(),MA(),wGe(),OGe(),X9=N()})),jGe=o((()=>{}));function Z9({onTreeChange:e,fullWidth:t,onToggleWidth:n}){let r=Fe(),i=Ne(),a=r[`*`]||``,[o,s]=(0,Q9.useState)(null),[c,l]=(0,Q9.useState)(!1);(0,Q9.useEffect)(()=>{if(!a){s(null);return}l(!0),bre(a).then(e=>s(e)).catch(()=>s(null)).finally(()=>l(!1))},[a]);let u=(0,Q9.useCallback)(async t=>{await zy(a,t),e()},[a,e]),d=(0,Q9.useCallback)(async()=>{confirm(`Delete this document?`)&&(await xre(a),e(),i(`/`))},[a,i,e]),f=(0,Q9.useCallback)(async()=>{let t=prompt(`Document name:`);if(!t)return;let n=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``);await Sre(a);let r=`${a}/${n}`;await zy(r,`# ${t}\n\n`),e(),i(`/doc/${r}`)},[a,e,i]);return a?c?(0,$9.jsx)(`div`,{className:`loading`,children:`Loading...`}):o?o.isFolder?(0,$9.jsx)(kGe,{folderPath:a,onTreeChange:e,fullWidth:t,onToggleWidth:n},a):(0,$9.jsx)(EGe,{content:o.content,docPath:a,onSave:u,onDelete:d,onAddChild:f,isFolder:!1,fullWidth:t,onToggleWidth:n},a):(0,$9.jsx)(`div`,{className:`not-found`,children:`Document not found.`}):(0,$9.jsxs)(`div`,{className:`welcome`,children:[(0,$9.jsx)(`h1`,{children:`Doku`}),(0,$9.jsx)(`p`,{children:`Select a document from the sidebar or create a new one.`})]})}function MGe(){let[e,t]=(0,Q9.useState)([]),[n,r]=(0,Q9.useState)(`Doku`),[i,a]=(0,Q9.useState)(280),[o,s]=(0,Q9.useState)(()=>localStorage.getItem(`doku-full-width`)===`true`),c=Ne(),l=(0,Q9.useCallback)(()=>{yre().then(t).catch(console.error)},[]);return(0,Q9.useEffect)(()=>{l(),vre().then(e=>r(e.projectName)).catch(()=>{})},[l]),(0,$9.jsxs)($9.Fragment,{children:[(0,$9.jsx)(uue,{tree:e,projectName:n,onNewDoc:(0,Q9.useCallback)(async(e=``)=>{let t=prompt(`Document name:`);if(!t)return;let n=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``);if(!e){await zy(n,`# ${t}\n\n`),l(),c(`/doc/${n}`);return}await Sre(e);let r=`${e}/${n}`;await zy(r,`# ${t}\n\n`),l(),c(`/doc/${r}`)},[l,c]),onSearchSelect:(0,Q9.useCallback)(e=>{c(`/doc/${e}`)},[c]),sidebarWidth:i,onResize:a}),(0,$9.jsx)(`main`,{className:`main-content`,children:(0,$9.jsx)(`div`,{className:`editor-area ${o?`full-width`:``}`,children:(0,$9.jsxs)(Qe,{children:[(0,$9.jsx)(Xe,{path:`/`,element:(0,$9.jsx)(Z9,{onTreeChange:l,fullWidth:o,onToggleWidth:()=>{s(e=>{let t=!e;return localStorage.setItem(`doku-full-width`,t),t})}})}),(0,$9.jsx)(Xe,{path:`/doc/*`,element:(0,$9.jsx)(Z9,{onTreeChange:l,fullWidth:o,onToggleWidth:()=>{s(e=>{let t=!e;return localStorage.setItem(`doku-full-width`,t),t})}})})]})})})]})}var Q9,$9,NGe=o((()=>{Q9=u(p()),Xn(),due(),DGe(),AGe(),Vy(),jGe(),$9=N()})),PGe=o((()=>{}));s((()=>{var e=u(p()),t=u(y());Xn(),gre(),_re(),NGe(),PGe();var n=N();t.createRoot(document.getElementById(`root`)).render((0,n.jsx)(e.StrictMode,{children:(0,n.jsx)(fs,{children:(0,n.jsx)(jt,{children:(0,n.jsx)(MGe,{})})})}))}))();export{o as t};
|